apexcharts 6.0.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.css +7 -0
- package/dist/apexcharts.esm.js +545 -103
- package/dist/apexcharts.js +545 -103
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +545 -103
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +170 -2
- package/dist/bar.common.js +1 -1
- package/dist/bar.esm.js +1 -1
- package/dist/boxPlot.common.js +1 -1
- package/dist/boxPlot.esm.js +1 -1
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +170 -2
- package/dist/candlestick.common.js +1 -1
- package/dist/candlestick.esm.js +1 -1
- package/dist/column.common.js +1 -1
- package/dist/column.esm.js +1 -1
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +161 -54
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +218 -51
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/drilldown.common.js +1 -1
- package/dist/features/drilldown.esm.js +1 -1
- package/dist/features/exports.common.js +1 -1
- package/dist/features/exports.esm.js +1 -1
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/keyboard.common.js +1 -1
- package/dist/features/keyboard.esm.js +1 -1
- package/dist/features/legend.common.js +1 -1
- package/dist/features/legend.esm.js +1 -1
- package/dist/features/link.common.js +2 -2
- package/dist/features/link.esm.js +20 -5
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/measure.common.js +2 -2
- package/dist/features/measure.esm.js +9 -4
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +1 -1
- package/dist/features/renderer-canvas.common.js +2 -2
- package/dist/features/renderer-canvas.esm.js +105 -13
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +1 -1
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +85 -30
- package/dist/features/weave.common.js +1 -1
- package/dist/features/weave.esm.js +1 -1
- package/dist/heatmap.common.js +1 -1
- package/dist/heatmap.esm.js +1 -1
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +170 -2
- package/dist/locales/en.json +2 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +1 -1
- package/dist/radar.esm.js +1 -1
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +170 -2
- package/dist/rangeBar.common.js +1 -1
- package/dist/rangeBar.esm.js +1 -1
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +170 -2
- package/dist/treemap.common.js +1 -1
- package/dist/treemap.esm.js +1 -1
- package/dist/violin.common.js +1 -1
- package/dist/violin.esm.js +1 -1
- package/package.json +1 -1
- package/src/assets/apexcharts.css +7 -0
- package/src/assets/ico-measure.svg +7 -0
- package/src/charts/Line.js +220 -1
- package/src/charts/Scatter.js +159 -56
- package/src/locales/en.json +2 -1
- package/src/modules/Base.js +6 -0
- package/src/modules/Graphics.js +11 -7
- package/src/modules/Markers.js +44 -12
- package/src/modules/Toolbar.js +86 -25
- package/src/modules/ZoomPanSelection.js +12 -7
- package/src/modules/link/Crossfilter.js +19 -2
- package/src/modules/link/LinkedViews.js +17 -2
- package/src/modules/measure/Measure.js +20 -3
- package/src/modules/settings/Options.js +5 -1
- package/src/renderers/canvas/CanvasCompositor.js +125 -22
- package/src/renderers/canvas/CanvasGraphics.js +8 -0
- package/src/types/internal.d.ts +1 -0
- package/types/apexcharts.d.ts +8 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v6.
|
|
2
|
+
* ApexCharts v6.2.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,n=(t,e)=>{for(var s in e||(e={}))a.call(e,s)&&o(t,s,e[s]);if(i)for(var s of i(e))r.call(e,s)&&o(t,s,e[s]);return t},l=(t,i)=>e(t,s(i)),h=(t,e,s)=>o(t,"symbol"!=typeof e?e+"":e,s);class c{static isSSR(){return"undefined"==typeof window||"undefined"==typeof document}static isBrowser(){return!this.isSSR()}static hasAPI(t){return!this.isSSR()&&void 0!==window[t]}static getApex(){return"undefined"!=typeof window&&window.Apex?window.Apex:"undefined"!=typeof global&&global.Apex?global.Apex:{}}}class d{constructor(t,e=null){this.nodeName=t,this.namespaceURI=e,this.attributes=new Map,this.children=[],this.textContent="",this.style={},this.classList=new g,this.parentNode=null,this._ssrWidth=void 0,this._ssrHeight=void 0,this._ssrMode=void 0}setAttribute(t,e){this.attributes.set(t,e)}getAttribute(t){return this.attributes.get(t)}removeAttribute(t){this.attributes.delete(t)}hasAttribute(t){return this.attributes.has(t)}appendChild(t){if(t&&t!==this){if(t.parentNode&&t.parentNode!==this)t.parentNode.removeChild(t);else if(t.parentNode===this){const e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1)}t.parentNode=this,this.children.push(t)}return t}removeChild(t){const e=this.children.indexOf(t);return-1!==e&&(this.children.splice(e,1),t.parentNode=null),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(t.parentNode&&t.parentNode!==this)t.parentNode.removeChild(t);else if(t.parentNode===this){const e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1)}const s=this.children.indexOf(e);return-1!==s&&(t.parentNode=this,this.children.splice(s,0,t)),t}cloneNode(t=!1){const e=new d(this.nodeName,this.namespaceURI);return e.textContent=this.textContent,this.attributes.forEach((t,s)=>{e.attributes.set(s,t)}),Object.assign(e.style,this.style),t&&this.children.forEach(t=>{t.cloneNode&&e.appendChild(t.cloneNode(!0))}),e}getBoundingClientRect(){return{width:this._ssrWidth||0,height:this._ssrHeight||0,top:0,left:0,right:this._ssrWidth||0,bottom:this._ssrHeight||0,x:0,y:0}}getRootNode(){let t=this;for(;t.parentNode;)t=t.parentNode;return t}querySelector(){return null}querySelectorAll(){return[]}getElementsByClassName(){return[]}addEventListener(){}removeEventListener(){}get childNodes(){return this.children}toString(){let t="";if(this.attributes.forEach((e,s)=>{t+=` ${s}="${e}"`}),0===this.children.length&&!this.textContent)return`<${this.nodeName}${t}/>`;const e=this.children.map(t=>t.toString()).join("");return`<${this.nodeName}${t}>${this.textContent}${e}</${this.nodeName}>`}get innerHTML(){return this.children.map(t=>t.toString()).join("")}set innerHTML(t){this.children=[],this.textContent=t}get outerHTML(){return this.toString()}get isConnected(){return!0}}class g{constructor(){this.classes=new Set}add(...t){t.forEach(t=>this.classes.add(t))}remove(...t){t.forEach(t=>this.classes.delete(t))}contains(t){return this.classes.has(t)}toggle(t,e){return!0===e?(this.classes.add(t),!0):!1===e||this.classes.has(t)?(this.classes.delete(t),!1):(this.classes.add(t),!0)}toString(){return Array.from(this.classes).join(" ")}}class p{constructor(){this.SVGNS="http://www.w3.org/2000/svg",this.XLINKNS="http://www.w3.org/1999/xlink"}createElementNS(t,e){return new d(e,t)}createTextNode(t){const e={nodeName:"#text",nodeType:3,textContent:t,toString:()=>e.textContent};return e}querySelector(){return null}querySelectorAll(){return[]}getComputedStyle(){return{}}getBoundingClientRect(t){return t&&t.getBoundingClientRect?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}createXMLSerializer(){return{serializeToString:t=>t.toString?t.toString():""}}createDOMParser(){return{parseFromString(t,e){const s=new d("root");return s.innerHTML=t,{documentElement:s}}}}}let u=null,x=null,f=null;class m{static init(){c.isSSR()&&!u&&(u=new p)}static createElement(t){return c.isSSR()?(u||this.init(),u.createElementNS(null,t)):document.createElement(t)}static createElementNS(t,e){return c.isSSR()?(u||this.init(),u.createElementNS(t,e)):document.createElementNS(t,e)}static createTextNode(t){return c.isSSR()?(u||this.init(),u.createTextNode(t)):document.createTextNode(t)}static querySelector(t){return c.isSSR()?null:document.querySelector(t)}static querySelectorAll(t){return c.isSSR()?[]:document.querySelectorAll(t)}static getComputedStyle(t){return c.isSSR()?{}:window.getComputedStyle(t)}static matchMedia(t){if(c.isSSR()||"function"!=typeof window.matchMedia)return null;try{return window.matchMedia(t)}catch(t){return null}}static getBoundingClientRect(t){return c.isSSR()?(u||this.init(),u.getBoundingClientRect(t)):t?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}static getXMLSerializer(){return c.isSSR()?(u||this.init(),x||(x=u.createXMLSerializer()),x):(x||(x=new XMLSerializer),x)}static getDOMParser(){return c.isSSR()?(u||this.init(),f||(f=u.createDOMParser()),f):(f||(f=new DOMParser),f)}static addWindowEventListener(t,e,s){c.isBrowser()&&window.addEventListener(t,e,s)}static removeWindowEventListener(t,e,s){c.isBrowser()&&window.removeEventListener(t,e,s)}static requestAnimationFrame(t){return c.isBrowser()?window.requestAnimationFrame(t):(t(0),null)}static cancelAnimationFrame(t){c.isBrowser()&&t&&window.cancelAnimationFrame(t)}static elementExists(t){return!!t&&(c.isSSR()?!0===t._ssrMode||void 0!==t.nodeName:!!t.getRootNode&&(t.getRootNode({composed:!0})===document||t.isConnected))}static getWindow(){return c.isBrowser()?window:null}static getDocument(){return c.isBrowser()?document:null}static _getShim(){return u}static _resetShim(){u=null,x=null,f=null}}let b=class t{static isObject(t){return t&&"object"==typeof t&&!Array.isArray(t)}static is(t,e){return Object.prototype.toString.call(e)==="[object "+t+"]"}static isSafari(){return c.isBrowser()&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}static extend(t,e){const s=Object.assign({},t);return this.isObject(t)&&this.isObject(e)&&Object.keys(e).forEach(i=>{this.isObject(e[i])?i in t?s[i]=this.extend(t[i],e[i]):Object.assign(s,{[i]:e[i]}):Object.assign(s,{[i]:e[i]})}),s}static extendArray(e,s){const i=[];return e.map(e=>{i.push(t.extend(s,e))}),e=i}static monthMod(t){return t%12}static clone(t,e=new WeakMap,s=!1){if(null===t||"object"!=typeof t)return t;if(e.has(t))return e.get(t);let i;if(Array.isArray(t))if(s)i=t.slice();else{i=[],e.set(t,i);for(let s=0;s<t.length;s++)i[s]=this.clone(t[s],e,!1)}else if(t instanceof Date)i=new Date(t.getTime());else if(s)i=Object.assign({},t);else{i={},e.set(t,i);for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=this.clone(t[s],e,!1))}return i}static shallowClone(t){return null===t||"object"!=typeof t?t:Array.isArray(t)?t.slice():Object.assign({},t)}static shallowEqual(t,e){if(t===e)return!0;if(!t||!e)return!1;if("object"!=typeof t||"object"!=typeof e)return t===e;const s=Object.keys(t),i=Object.keys(e);if(s.length!==i.length)return!1;for(const i of s)if(t[i]!==e[i])return!1;return!0}static log10(t){return Math.log(t)/Math.LN10}static roundToBase10(t){return Math.pow(10,Math.floor(Math.log10(t)))}static roundToBase(t,e){return Math.pow(e,Math.floor(Math.log(t)/Math.log(e)))}static parseNumber(t){return"number"==typeof t||null===t?t:parseFloat(t)}static stripNumber(t,e=2){return Number.isInteger(t)?t:parseFloat(t.toPrecision(e))}static randomId(){return(Math.random()+1).toString(36).substring(4)}static noExponents(t){return t.toString().includes("e")?Math.round(t):t}static elementExists(t){return!(!t||!t.isConnected)}static isInShadowDOM(e){if(!e||!e.getRootNode)return!1;const s=e.getRootNode();return s&&s!==document&&t.is("ShadowRoot",s)}static getShadowRootHost(e){if(!t.isInShadowDOM(e))return null;return e.getRootNode().host||null}static getDimensions(t){if(!t)return[0,0];if(c.isSSR())return[t._ssrWidth||400,t._ssrHeight||300];let e;try{e=getComputedStyle(t,null)}catch(e){return[t.clientWidth||0,t.clientHeight||0]}let s=t.clientWidth,i=t.clientHeight;if(!s||!i){const e=t.getBoundingClientRect();s=s||e.width,i=i||e.height}return i-=parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),s-=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight),[s,i]}static getBoundingClientRect(t){if(!t)return{top:0,right:0,bottom:0,left:0,width:0,height:0,x:0,y:0};if(c.isSSR())return m.getBoundingClientRect(t);const e=t.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:t.clientWidth,height:t.clientHeight,x:e.left,y:e.top}}static getLargestStringFromArr(t){return t.reduce((t,e)=>(Array.isArray(e)&&(e=e.reduce((t,e)=>t.length>e.length?t:e)),t.length>e.length?t:e),0)}static hexToRgba(t="#999999",e=.6){"#"!==t.substring(0,1)&&(t="#999999");const s=t.replace("#",""),i=s.match(new RegExp("(.{"+s.length/3+"})","g"))||[];for(let t=0;t<i.length;t++)i[t]=parseInt(1===i[t].length?i[t]+i[t]:i[t],16);return void 0!==e&&i.push(e),"rgba("+i.join(",")+")"}static getOpacityFromRGBA(t){return parseFloat(t.replace(/^.*,(.+)\)/,"$1"))}static parseHex(t){if("string"!=typeof t)return null;let e=t.trim().replace("#","");return 3===e.length&&(e=e.split("").map(t=>t+t).join("")),/^[0-9a-fA-F]{6}$/.test(e)?[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]:null}static relativeLuminance([t,e,s]){const i=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)};return.2126*i(t)+.7152*i(e)+.0722*i(s)}static getContrastRatio(e,s){const i=t.parseHex(e),a=t.parseHex(s);if(!i||!a)return 0;const r=t.relativeLuminance(i),o=t.relativeLuminance(a);return(Math.max(r,o)+.05)/(Math.min(r,o)+.05)}static rgb2hex(t){return(t=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===t.length?"#"+("0"+parseInt(t[1],10).toString(16)).slice(-2)+("0"+parseInt(t[2],10).toString(16)).slice(-2)+("0"+parseInt(t[3],10).toString(16)).slice(-2):""}shadeRGBColor(t,e){const s=e.split(","),i=t<0?0:255,a=t<0?-1*t:t,r=parseInt(s[0].slice(4),10),o=parseInt(s[1],10),n=parseInt(s[2],10);return"rgb("+(Math.round((i-r)*a)+r)+","+(Math.round((i-o)*a)+o)+","+(Math.round((i-n)*a)+n)+")"}shadeHexColor(t,e){const s=parseInt(e.slice(1),16),i=t<0?0:255,a=t<0?-1*t:t,r=s>>16,o=s>>8&255,n=255&s;return"#"+(16777216+65536*(Math.round((i-r)*a)+r)+256*(Math.round((i-o)*a)+o)+(Math.round((i-n)*a)+n)).toString(16).slice(1)}shadeColor(e,s){return t.isColorHex(s)?this.shadeHexColor(e,s):this.shadeRGBColor(e,s)}static isColorHex(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(t)}static isCSSVariable(t){if("string"!=typeof t)return!1;const e=t.trim();return e.startsWith("var(")&&e.endsWith(")")}static getThemeColor(e){if(!t.isCSSVariable(e))return e;if(c.isSSR())return e;const s=document.createElement("div");let i;s.style.cssText="position:fixed; left: -9999px; visibility:hidden;",s.style.color=e,document.body.appendChild(s);try{i=window.getComputedStyle(s).color}finally{s.parentNode&&s.parentNode.removeChild(s)}return i}static applyOpacityToColor(t,e){const s=Number(e);if(!Number.isFinite(s))return t;if(s<=0)return"transparent";if(s>=1)return t;return`color-mix(in srgb, ${t} ${Math.round(100*s)}%, transparent)`}static getPolygonPos(t,e){const s=[],i=2*Math.PI/e;for(let a=0;a<e;a++){const e={};e.x=t*Math.sin(a*i),e.y=-t*Math.cos(a*i),s.push(e)}return s}static polarToCartesian(t,e,s,i){const a=(i-90)*Math.PI/180;return{x:t+s*Math.cos(a),y:e+s*Math.sin(a)}}static escapeString(t,e="x"){let s=t.toString().slice();return s=s.replace(/[` ~!@#$%^&*()|+=?;:'",.<>{}[\]\\/]/gi,e),s}static negToZero(t){return t<0?0:t}static moveIndexInArray(t,e,s){if(s>=t.length){let e=s-t.length+1;for(;e--;)t.push(void 0)}return t.splice(s,0,t.splice(e,1)[0]),t}static extractNumber(t){return parseFloat(t.replace(/[^\d.]*/g,""))}static findAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}static setELstyles(t,e){for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t.style.key=e[s])}static preciseAddition(t,e){const s=(String(t).split(".")[1]||"").length,i=(String(e).split(".")[1]||"").length,a=Math.pow(10,Math.max(s,i));return(Math.round(t*a)+Math.round(e*a))/a}static isNumber(t){return!isNaN(t)&&parseFloat(String(Number(t)))===t&&!isNaN(parseInt(t,10))}static isFloat(t){return Number(t)===t&&t%1!=0}static isMsEdge(){if(c.isSSR())return!1;const t=window.navigator.userAgent,e=t.indexOf("Edge/");return e>0&&parseInt(t.substring(e+5,t.indexOf(".",e)),10)}static getGCD(t,e,s=7){let i=Math.pow(10,s-Math.floor(Math.log10(Math.max(t,e))));for(i>1?(t=Math.round(Math.abs(t)*i),e=Math.round(Math.abs(e)*i)):i=1;e;){const s=e;e=t%e,t=s}return t/i}static getPrimeFactors(t){const e=[];let s=2;for(;t>=2;)t%s==0?(e.push(s),t/=s):s++;return e}static mod(t,e,s=7){const i=Math.pow(10,s-Math.floor(Math.log10(Math.max(t,e))));return(t=Math.round(Math.abs(t)*i))%(e=Math.round(Math.abs(e)*i))/i}};class y{constructor(t){this.w=t,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}isValidDate(t){return"number"!=typeof t&&!isNaN(this.parseDate(t))}getTimeStamp(t){if(!Date.parse(t))return t;return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toISOString().substr(0,25)).getTime():new Date(t).getTime()}getDate(t){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toUTCString()):new Date(t)}parseDate(t){const e=Date.parse(t);if(!isNaN(e))return this.getTimeStamp(t);let s=Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "));return s=this.getTimeStamp(s),s}parseDateWithTimezone(t){return Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "))}formatDate(t,e){const s=this.w.globals.locale,i=this.w.config.xaxis.labels.datetimeUTC,a=["\0",...s.months],r=["\x01",...s.shortMonths],o=["\x02",...s.days],n=["\x03",...s.shortDays];function l(t,e=2){let s=t+"";for(;s.length<e;)s="0"+s;return s}const h=i?t.getUTCFullYear():t.getFullYear();e=(e=(e=e.replace(/(^|[^\\])yyyy+/g,"$1"+h)).replace(/(^|[^\\])yy/g,"$1"+h.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+h);const c=(i?t.getUTCMonth():t.getMonth())+1;e=(e=(e=(e=e.replace(/(^|[^\\])MMMM+/g,"$1"+a[0])).replace(/(^|[^\\])MMM/g,"$1"+r[0])).replace(/(^|[^\\])MM/g,"$1"+l(c))).replace(/(^|[^\\])M/g,"$1"+c);const d=i?t.getUTCDate():t.getDate();e=(e=(e=(e=e.replace(/(^|[^\\])dddd+/g,"$1"+o[0])).replace(/(^|[^\\])ddd/g,"$1"+n[0])).replace(/(^|[^\\])dd/g,"$1"+l(d))).replace(/(^|[^\\])d/g,"$1"+d);const g=i?t.getUTCHours():t.getHours(),p=g>12?g-12:0===g?12:g;e=(e=(e=(e=e.replace(/(^|[^\\])HH+/g,"$1"+l(g))).replace(/(^|[^\\])H/g,"$1"+g)).replace(/(^|[^\\])hh+/g,"$1"+l(p))).replace(/(^|[^\\])h/g,"$1"+p);const u=i?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\])mm+/g,"$1"+l(u))).replace(/(^|[^\\])m/g,"$1"+u);const x=i?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\])ss+/g,"$1"+l(x))).replace(/(^|[^\\])s/g,"$1"+x);let f=i?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+l(f,3)),f=Math.round(f/10),e=e.replace(/(^|[^\\])ff/g,"$1"+l(f)),f=Math.round(f/10);const m=g<12?"AM":"PM";e=(e=(e=e.replace(/(^|[^\\])f/g,"$1"+f)).replace(/(^|[^\\])TT+/g,"$1"+m)).replace(/(^|[^\\])T/g,"$1"+m.charAt(0));const b=m.toLowerCase();e=(e=e.replace(/(^|[^\\])tt+/g,"$1"+b)).replace(/(^|[^\\])t/g,"$1"+b.charAt(0));let y=-t.getTimezoneOffset(),w=i||!y?"Z":y>0?"+":"-";if(!i){y=Math.abs(y);const t=y%60;w+=l(Math.floor(y/60))+":"+l(t)}e=e.replace(/(^|[^\\])K/g,"$1"+w);const v=(i?t.getUTCDay():t.getDay())+1;return e=(e=(e=(e=(e=e.replace(new RegExp(o[0],"g"),o[v])).replace(new RegExp(n[0],"g"),n[v])).replace(new RegExp(a[0],"g"),a[c])).replace(new RegExp(r[0],"g"),r[c])).replace(/\\(.)/g,"$1")}getTimeUnitsfromTimestamp(t,e){const s=this.w;void 0!==s.config.xaxis.min&&(t=s.config.xaxis.min),void 0!==s.config.xaxis.max&&(e=s.config.xaxis.max);const i=this.getDate(t),a=this.getDate(e),r=this.formatDate(i,"yyyy MM dd HH mm ss fff").split(" "),o=this.formatDate(a,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(r[6],10),maxMillisecond:parseInt(o[6],10),minSecond:parseInt(r[5],10),maxSecond:parseInt(o[5],10),minMinute:parseInt(r[4],10),maxMinute:parseInt(o[4],10),minHour:parseInt(r[3],10),maxHour:parseInt(o[3],10),minDate:parseInt(r[2],10),maxDate:parseInt(o[2],10),minMonth:parseInt(r[1],10)-1,maxMonth:parseInt(o[1],10)-1,minYear:parseInt(r[0],10),maxYear:parseInt(o[0],10)}}isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}calculcateLastDaysOfMonth(t,e,s){return this.determineDaysOfMonths(t,e)-s}determineDaysOfYear(t){let e=365;return this.isLeapYear(t)&&(e=366),e}determineRemainingDaysOfYear(t,e,s){let i=this.daysCntOfYear[e]+s;return e>1&&this.isLeapYear(t)&&i++,i}determineDaysOfMonths(t,e){let s=30;switch(t=b.monthMod(t),!0){case this.months30.indexOf(t)>-1:2===t&&(s=this.isLeapYear(e)?29:28);break;case this.months31.indexOf(t)>-1:default:s=31}return s}getDateFields(t,e){const s=new Date(t);return e?{year:s.getUTCFullYear(),month:s.getUTCMonth(),date:s.getUTCDate(),hour:s.getUTCHours(),minute:s.getUTCMinutes(),second:s.getUTCSeconds(),ms:s.getUTCMilliseconds(),weekday:s.getUTCDay()}:{year:s.getFullYear(),month:s.getMonth(),date:s.getDate(),hour:s.getHours(),minute:s.getMinutes(),second:s.getSeconds(),ms:s.getMilliseconds(),weekday:s.getDay()}}addInterval(t,e,s,i){const a=new Date(t);if(i)switch(e){case"year":a.setUTCFullYear(a.getUTCFullYear()+s);break;case"month":a.setUTCMonth(a.getUTCMonth()+s);break;case"week":a.setUTCDate(a.getUTCDate()+7*s);break;case"day":a.setUTCDate(a.getUTCDate()+s);break;case"hour":a.setUTCHours(a.getUTCHours()+s);break;case"minute":a.setUTCMinutes(a.getUTCMinutes()+s);break;case"second":a.setUTCSeconds(a.getUTCSeconds()+s)}else switch(e){case"year":a.setFullYear(a.getFullYear()+s);break;case"month":a.setMonth(a.getMonth()+s);break;case"week":a.setDate(a.getDate()+7*s);break;case"day":a.setDate(a.getDate()+s);break;case"hour":a.setHours(a.getHours()+s);break;case"minute":a.setMinutes(a.getMinutes()+s);break;case"second":a.setSeconds(a.getSeconds()+s)}return a.getTime()}ceilToBoundary(t,e,s,i){const a=new Date(t);if(i)switch(e){case"second":{const e=a.getUTCSeconds(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(i),a.getTime())}case"minute":{const e=a.getUTCMinutes(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(i),a.getTime())}case"hour":{const e=a.getUTCHours(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(i),a.getTime())}case"day":return 0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0),a.setUTCDate(a.getUTCDate()+1),a.getTime());case"week":{const e=6048e5,i=Date.UTC(1970,0,5);a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0);const r=a.getTime(),o=Math.ceil((r-i)/e),n=i+Math.ceil(o/s)*s*e;return n>=t?n:n+s*e}case"month":{const e=a.getUTCMonth(),i=Math.ceil(e/s)*s;return i===e&&1===a.getUTCDate()&&0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0),a.setUTCDate(1),a.setUTCMonth(i),a.getTime())}case"year":{const e=a.getUTCFullYear(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCMonth()&&1===a.getUTCDate()&&0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:Date.UTC(i,0,1)}}else switch(e){case"second":{const e=a.getSeconds(),i=Math.ceil(e/s)*s;return i===e&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(i),a.getTime())}case"minute":{const e=a.getMinutes(),i=Math.ceil(e/s)*s;return i===e&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(i),a.getTime())}case"hour":{const e=a.getHours(),i=Math.ceil(e/s)*s;return i===e&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(i),a.getTime())}case"day":return 0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0),a.setDate(a.getDate()+1),a.getTime());case"week":{const e=6048e5,i=new Date(1970,0,5).getTime();a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0);const r=a.getTime(),o=Math.ceil((r-i)/e),n=i+Math.ceil(o/s)*s*e;return n>=t?n:n+s*e}case"month":{const e=a.getMonth(),i=Math.ceil(e/s)*s;return i===e&&1===a.getDate()&&0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0),a.setDate(1),a.setMonth(i),a.getTime())}case"year":{const e=a.getFullYear(),i=Math.ceil(e/s)*s;return i===e&&0===a.getMonth()&&1===a.getDate()&&0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:new Date(i,0,1).getTime()}}return t}isAtBoundary(t,e,s){const i=this.getDateFields(t,s);switch(e){case"year":return 0===i.month&&1===i.date&&0===i.hour&&0===i.minute&&0===i.second&&0===i.ms;case"month":return 1===i.date&&0===i.hour&&0===i.minute&&0===i.second&&0===i.ms;case"day":return 0===i.hour&&0===i.minute&&0===i.second&&0===i.ms;case"hour":return 0===i.minute&&0===i.second&&0===i.ms;case"minute":return 0===i.second&&0===i.ms;case"second":return 0===i.ms}return!1}}class w{constructor(t){this.w=t,this.tooltipKeyFormat="dd MMM"}xLabelFormat(t,e,s,i){const a=this.w;if("datetime"===a.config.xaxis.type&&void 0===a.config.xaxis.labels.formatter&&void 0===a.config.tooltip.x.formatter){const t=new y(this.w);return t.formatDate(t.getDate(e),a.config.tooltip.x.format)}return t(e,s,i)}defaultGeneralFormatter(t){return Array.isArray(t)?t.map(t=>t):t}defaultYFormatter(t,e){const s=this.w;if(b.isNumber(t))if(0!==s.globals.yValueDecimal)t=t.toFixed(void 0!==e.decimalsInFloat?e.decimalsInFloat:s.globals.yValueDecimal);else{const e=t.toFixed(0);t=Number(e)===t?e:t.toFixed(1)}return t}setLabelFormatters(){const t=this.w,e=t.formatters;return e.xaxisTooltipFormatter=t=>this.defaultGeneralFormatter(t),e.ttKeyFormatter=t=>this.defaultGeneralFormatter(t),e.ttZFormatter=t=>t,e.legendFormatter=t=>this.defaultGeneralFormatter(t),void 0!==t.config.xaxis.labels.formatter?e.xLabelFormatter=t.config.xaxis.labels.formatter:e.xLabelFormatter=e=>{if(b.isNumber(e)){if(!t.config.xaxis.convertedCatToNumeric&&"numeric"===t.config.xaxis.type){if(b.isNumber(t.config.xaxis.decimalsInFloat))return e.toFixed(t.config.xaxis.decimalsInFloat);{const s=t.globals.maxX-t.globals.minX;if(s>0){const t=s/10,i=Math.max(0,-Math.floor(Math.log10(t)));return e.toFixed(i)}return e.toFixed(0)}}if(t.globals.isBarHorizontal){if(t.globals.maxY-t.globals.minYArr<4)return e.toFixed(1)}return e.toFixed(0)}return e},"function"==typeof t.config.tooltip.x.formatter?e.ttKeyFormatter=t.config.tooltip.x.formatter:e.ttKeyFormatter=e.xLabelFormatter,"function"==typeof t.config.xaxis.tooltip.formatter&&(e.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||void 0!==t.config.tooltip.y.formatter)&&(e.ttVal=t.config.tooltip.y),void 0!==t.config.tooltip.z.formatter&&(e.ttZFormatter=t.config.tooltip.z.formatter),void 0!==t.config.legend.formatter&&(e.legendFormatter=t.config.legend.formatter),e.yLabelFormatters=[],t.config.yaxis.forEach((s,i)=>{if(void 0!==s.labels.formatter)e.yLabelFormatters[i]=s.labels.formatter;else if("violin"===t.config.chart.type){const s=t=>"number"==typeof t&&isFinite(t)?""+Math.round(100*t)/100:t;e.yLabelFormatters[i]=e=>t.globals.xyCharts?Array.isArray(e)?e.map(s):s(e):e}else e.yLabelFormatters[i]=e=>t.globals.xyCharts?Array.isArray(e)?e.map(t=>this.defaultYFormatter(t,s)):this.defaultYFormatter(e,s):e}),t.globals}heatmapLabelFormatters(){const t=this.w;if("heatmap"===t.config.chart.type){t.globals.yAxisScale[0].result=t.seriesData.seriesNames.slice();const e=t.seriesData.seriesNames.reduce((t,e)=>t.length>e.length?t:e,0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}}const v=({isTimeline:t,seriesIndex:e,dataPointIndex:s,y1:i,y2:a,w:r})=>{var o;let n=r.rangeData.seriesRangeStart[e][s],l=r.rangeData.seriesRangeEnd[e][s],h=r.labelData.labels[s],c=r.config.series[e].name?r.config.series[e].name:"";const d=r.formatters.ttKeyFormatter,g=r.config.tooltip.y.title.formatter,p={w:r,seriesIndex:e,dataPointIndex:s,start:n,end:l};if("function"==typeof g&&(c=g(c,p)),(null==(o=r.config.series[e].data[s])?void 0:o.x)&&(h=r.config.series[e].data[s].x),!t&&"datetime"===r.config.xaxis.type){h=new w(r).xLabelFormat(r.formatters.ttKeyFormatter,h,h,{i:void 0,dateFormatter:new y(r).formatDate,w:r})}"function"==typeof d&&(h=d(h,p)),Number.isFinite(i)&&Number.isFinite(a)&&(n=i,l=a);let u="",x="";const f=r.globals.colors[e];if(void 0===r.config.tooltip.x.formatter)if("datetime"===r.config.xaxis.type){const t=new y(r);u=t.formatDate(t.getDate(n),r.config.tooltip.x.format),x=t.formatDate(t.getDate(l),r.config.tooltip.x.format)}else u=n,x=l;else u=r.config.tooltip.x.formatter(n),x=r.config.tooltip.x.formatter(l);return{start:n,end:l,startVal:u,endVal:x,ylabel:h,color:f,seriesName:c}},A=t=>{let{color:e,seriesName:s,ylabel:i,start:a,end:r,seriesIndex:o,dataPointIndex:n}=t;const l=t.w.globals.tooltip.tooltipLabels.getFormatters(o);a=l.yLbFormatter(a),r=l.yLbFormatter(r);const h=l.yLbFormatter(t.w.seriesData.series[o][n]);let c="";const d=`<span class="value start-value">\n ${a}\n </span> <span class="separator">-</span> <span class="value end-value">\n ${r}\n </span>`;return c=t.w.globals.comboCharts?"rangeArea"===t.w.config.series[o].type||"rangeBar"===t.w.config.series[o].type?d:`<span>${h}</span>`:d,'<div class="apexcharts-tooltip-rangebar"><div> <span class="series-name" style="color: '+e+'">'+(s||"")+'</span></div><div> <span class="category">'+i+": </span> "+c+" </div></div>"};class C{constructor(t){this.opts=t}hideYAxis(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}line(){return{dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}sparkline(t){this.hideYAxis();return b.extend(t,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}slope(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter(t,e){const s=e.w.config.series[e.seriesIndex].name;return null!==t?s+": "+t:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}bar(){return{chart:{stacked:!1},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"square"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}funnel(){return this.hideYAxis(),l(n({},this.bar()),{chart:{animations:{speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}pyramid(){return this.funnel()}gauge(){const t=this.radialBar();return l(n({},t),{plotOptions:{radialBar:{startAngle:-135,endAngle:135,hollow:{margin:0,size:"60%"},track:{background:"#e7e7e7",strokeWidth:"100%",margin:5},dataLabels:{name:{show:!1},value:{show:!0,fontSize:"32px",fontWeight:600,offsetY:8}}}}})}candlestick(){return{stroke:{width:1},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getBoxTooltip(s,t,e,["Open","High","","Low","Close"],"candlestick")},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}boxPlot(){return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getBoxTooltip(s,t,e,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}violin(){return{chart:{zoom:{enabled:!1},animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},fill:{opacity:.7},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getViolinTooltip(s,t,e)},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}rangeBar(){return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter(t,{seriesIndex:e,dataPointIndex:s,w:i}){const a=()=>{const t=i.rangeData.seriesRangeStart[e][s];return i.rangeData.seriesRangeEnd[e][s]-t};return i.globals.comboCharts?"rangeBar"===i.config.series[e].type||"rangeArea"===i.config.series[e].type?a():t:a()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:t=>t.w.config.plotOptions&&t.w.config.plotOptions.bar&&t.w.config.plotOptions.bar.horizontal?(t=>{const{color:e,seriesName:s,ylabel:i,startVal:a,endVal:r}=v(l(n({},t),{isTimeline:!0}));return A(l(n({},t),{color:e,seriesName:s,ylabel:i,start:a,end:r}))})(t):(t=>{const{color:e,seriesName:s,ylabel:i,start:a,end:r}=v(t);return A(l(n({},t),{color:e,seriesName:s,ylabel:i,start:a,end:r}))})(t)},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}dumbbell(t){var e,s;return(null==(e=t.plotOptions.bar)?void 0:e.barHeight)||(t.plotOptions.bar.barHeight=2),(null==(s=t.plotOptions.bar)?void 0:s.columnWidth)||(t.plotOptions.bar.columnWidth=2),t}area(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}rangeArea(){return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom:t=>(t=>{const{color:e,seriesName:s,ylabel:i,start:a,end:r}=v(t);return A(l(n({},t),{color:e,seriesName:s,ylabel:i,start:a,end:r}))})(t)}}}brush(t){return b.extend(t,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}stacked100(t){t.dataLabels=t.dataLabels||{},t.dataLabels.formatter=t.dataLabels.formatter||void 0;const e=t.dataLabels.formatter;t.yaxis.forEach((e,s)=>{t.yaxis[s].min=0,t.yaxis[s].max=100});return"bar"===t.chart.type&&(t.dataLabels.formatter=e||function(t){return"number"==typeof t&&t?t.toFixed(0)+"%":t}),t}stackedBars(){const t=this.bar();return l(n({},t),{plotOptions:l(n({},t.plotOptions),{bar:l(n({},t.plotOptions.bar),{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}convertCatToNumeric(t){return t.xaxis.convertedCatToNumeric=!0,t}convertCatToNumericXaxis(t,e){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return b.isNumber(t)?Math.floor(t):t};const s=t.xaxis.labels.formatter;let i=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return e&&e.length&&(i=e.map(t=>Array.isArray(t)?t:String(t))),i&&i.length&&(t.xaxis.labels.formatter=function(t){return b.isNumber(t)?s(i[Math.floor(t)-1]):s(t)}),t.xaxis.categories=[],t.labels=[],t.xaxis.tickAmount=t.xaxis.tickAmount||"dataPoints",t}bubble(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}scatter(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}heatmap(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}treemap(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}pie(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:t=>t.toFixed(1)+"%",style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}donut(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:t=>t.toFixed(1)+"%",style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}polarArea(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:t=>t.toFixed(1)+"%",enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}radar(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:t=>t,style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}radialBar(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},stroke:{lineCap:"butt"},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}_getBoxTooltip(t,e,s,i,a){const r=t.candleData.seriesCandleO[e][s],o=t.candleData.seriesCandleH[e][s],n=t.candleData.seriesCandleM[e][s],l=t.candleData.seriesCandleL[e][s],h=t.candleData.seriesCandleC[e][s],c=t.config.series[e];return c.type&&c.type!==a?`<div class="apexcharts-custom-tooltip">\n ${c.name?c.name:"series-"+(e+1)}: <strong>${t.seriesData.series[e][s]}</strong>\n </div>`:`<div class="apexcharts-tooltip-box apexcharts-tooltip-${t.config.chart.type}"><div>${i[0]}: <span class="value">`+r+`</span></div><div>${i[1]}: <span class="value">`+o+"</span></div>"+(n?`<div>${i[2]}: <span class="value">`+n+"</span></div>":"")+`<div>${i[3]}: <span class="value">`+l+`</span></div><div>${i[4]}: <span class="value">`+h+"</span></div></div>"}_getViolinTooltip(t,e,s){var i,a,r;const o=null==(i=t.violinData.seriesViolinMin[e])?void 0:i[s],n=null==(a=t.violinData.seriesViolinMax[e])?void 0:a[s],l=(null==(r=t.violinData.seriesViolinPoints[e])?void 0:r[s])||[],h=t.config.series[e].name||"series-"+(e+1);return`<div class="apexcharts-tooltip-box apexcharts-tooltip-${t.config.chart.type}"><div class="apexcharts-tooltip-violin-name">${h}</div><div>Min: <span class="value">${o}</span></div><div>Max: <span class="value">${n}</span></div><div>Observations: <span class="value">${l.length}</span></div></div>`}}const S={name:"en",options:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom"}}};class k{constructor(){this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,alignZero:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}init(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},plugins:[],chart:{animations:{enabled:!0,speed:800,easing:"easeInOutSine",animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350,easing:void 0},chartTypeMorph:{enabled:!0,speed:600},respectReducedMotion:!0,largeDatasetThreshold:1e3},background:"",locales:[S],defaultLocale:"en",perspectives:{serializeOptions:["theme","xaxis","yaxis","title","subtitle"]},history:{enabled:!1,maxDepth:100,coalesceMs:250,keyboard:!0},renderer:"svg",rendererThreshold:8e3,layers:{series:"auto",grid:"svg",annotations:"svg",dataLabels:"svg"},dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.7},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0,crossFilter:void 0,filterChange:void 0,annotationDragged:void 0,annotationEdited:void 0,annotationCreated:void 0,annotationStyled:void 0,annotationDeleted:void 0,measured:void 0,keyDown:void 0,keyUp:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,offsetX:0,offsetY:0,injectStyleSheet:!0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},link:{enabled:!1,mode:"highlight",dimOpacity:.2,id:void 0,dimension:void 0,reduce:void 0,type:void 0,bins:void 0,order:void 0,seriesName:void 0},ink:{enabled:!1,palette:!1,snap:!1,noteColors:void 0},measure:{enabled:!1,mode:"span",key:"m",pinOnRelease:!0,colors:{up:void 0,down:void 0,neutral:void 0,guide:void 0},band:!0,guides:!0,markers:!0,format:{x:void 0,y:void 0,percent:void 0},label:void 0},contextMenu:{enabled:!1,items:["annotate","xline","yline","measure"],labels:{annotate:void 0,xline:void 0,yline:void 0,measure:void 0},noteText:"Note",line:{text:"",strokeDashArray:4,color:void 0}},stacked:!1,stackOnlyBar:!0,stackType:"normal",streaming:{enabled:!1,maxPoints:void 0},toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:!0,pinch:!0,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}},pan:{inertia:!0,friction:.92},accessibility:{enabled:!0,description:void 0,announcements:{enabled:!0},keyboard:{enabled:!0,navigation:{enabled:!0,wrapAround:!1}}},dataReducer:{enabled:!1,algorithm:"lttb",targetPoints:250,threshold:500}},parsing:{x:void 0,y:void 0},plotOptions:{line:{isSlopeChart:!1,colors:{threshold:0,colorAboveThreshold:void 0,colorBelowThreshold:void 0}},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0},scatter:{jitter:{enabled:!1,x:0,y:0,distributed:!1,maxPoints:5e3}},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"},points:{show:!1,shape:"circle",size:2.5,jitter:.5,maxPoints:3e3,opacity:.9,fillColor:"series-dark",strokeColor:"#fff",strokeWidth:1}},violin:{bandwidthScale:1,normalize:"individual",points:{show:!0,shape:"circle",size:2.5,jitter:.5,constrainToViolin:!0,maxPoints:3e3,opacity:.9,fillColor:"series-dark",strokeColor:"#fff",strokeWidth:1}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0,gradientLegend:{enabled:!1,width:"70%",height:"70%",thickness:12,align:"center",stops:16,showLabels:!0,showHoverValue:!0,labelStyle:{fontSize:"11px",fontFamily:void 0,colors:void 0},arrow:{size:8,color:void 0},formatter:void 0}}},funnel:{shape:"rectangle",lastShape:"flat"},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale"},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0},seriesTitle:{show:!0,offsetY:1,offsetX:1,borderColor:"#000",borderWidth:1,borderRadius:2,style:{background:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"12px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:6,right:6,top:2,bottom:2}}}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,shape:"arc",min:0,max:100,bands:[],bandsStyle:{strokeWidth:"40%",gap:0,hideTrackWhenPresent:!0},ticks:{show:!1,major:{count:11,length:10,width:2,color:"#666",placement:"outside"},minor:{count:4,length:5,width:1,color:"#999",placement:"outside"},labels:{show:!1,offset:6,fontSize:"11px",fontFamily:void 0,fontWeight:400,color:"#666",formatter:t=>String(t)}},needle:{color:"#333",length:"85%",baseWidth:4,tipWidth:1,offsetY:0,showValueArc:!1,animation:{enabled:!0,duration:800,easing:"ease-out"}},hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",stroke:void 0,strokeWidth:1,strokeDasharray:void 0,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:t=>t},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:t=>t+"%"},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:t=>t.globals.seriesTotals.reduce((t,e)=>t+e,0)/t.seriesData.series.length+"%"}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:t=>t,onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10,external:{show:!1,offsetX:0,offsetY:0,fontSize:void 0,fontFamily:void 0,fontWeight:void 0,color:void 0,formatter:void 0,connector:{show:!0,width:1,color:void 0,length:16,gap:6}}},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:t=>t},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:t=>t},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:t=>t.globals.seriesTotals.reduce((t,e)=>t+e,0)}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:t=>null!==t?t:"",textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",backgroundColor:void 0,borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],drilldown:{enabled:!1,series:[],breadcrumb:{show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0},animation:{enabled:!0,zoomFromPoint:!1,speed:260}},legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],clusterGroupedSeries:!0,clusterGroupedSeriesOrientation:"vertical",labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{hover:{filter:{type:"lighten"}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken"}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,arrow:!0,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0,background:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:t=>t?t+": ":""}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM",day:"dd MMM",hour:"HH:mm",minute:"HH:mm",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.8}},tooltip:{enabled:!1,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",tokens:!0,follow:!1,name:"",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65},accessibility:{colorBlindMode:""}}}}}class _{constructor(t){this.opts=t}init({responsiveOverride:t}){var e,s,i,a,r,o,n,l,h,d;let g=this.opts;const p=new k,u=new C(g);g=this.normalizeAliasedChartType(g),this.chartType=g.chart.type,g=this.extendYAxis(g),g=this.extendAnnotations(g);let x=p.init(),f={};if(g&&"object"==typeof g){let p={};const m=["line","area","bar","candlestick","boxPlot","violin","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"],y=g.chart.requestedType;p="funnel"===y||"pyramid"===y?u[y]():"gauge"===y?u.gauge():-1!==m.indexOf(g.chart.type)?u[g.chart.type]():u.line(),(null==(s=null==(e=g.plotOptions)?void 0:e.bar)?void 0:s.isFunnel)&&(p=u.funnel()),g.chart.stacked&&"bar"===g.chart.type&&(p=u.stackedBars()),(null==(i=g.chart.brush)?void 0:i.enabled)&&(p=u.brush(p)),(null==(r=null==(a=g.plotOptions)?void 0:a.line)?void 0:r.isSlopeChart)&&(p=u.slope()),g.chart.stacked&&"100%"===g.chart.stackType&&(g=u.stacked100(g)),(null==(n=null==(o=g.plotOptions)?void 0:o.bar)?void 0:n.isDumbbell)&&(g=u.dumbbell(g)),this.checkForDarkTheme(c.getApex()),this.checkForDarkTheme(g),g.xaxis=g.xaxis||c.getApex().xaxis||{},t||(g.xaxis.convertedCatToNumeric=!1),g=this.checkForCatToNumericXAxis(this.chartType,p,g),((null==(l=g.chart.sparkline)?void 0:l.enabled)||(null==(d=null==(h=c.getApex().chart)?void 0:h.sparkline)?void 0:d.enabled))&&(p=u.sparkline(p)),f=b.extend(x,p)}const m=b.extend(f,c.getApex());return x=b.extend(m,g),x=this.handleUserInputErrors(x),x}normalizeAliasedChartType(t){if(!t||!t.chart)return t;const e=t.chart.type;return"funnel"!==e&&"pyramid"!==e&&"gauge"!==e||(t.chart.requestedType=e,"funnel"===e||"pyramid"===e?(t.plotOptions=t.plotOptions||{},t.plotOptions.bar=t.plotOptions.bar||{},t.plotOptions.bar.isFunnel=!0,t.plotOptions.bar.horizontal=!0,t.chart.type="bar",t.plotOptions.bar.isPyramid="pyramid"===e):"gauge"===e&&(t.chart.type="radialBar")),t}checkForCatToNumericXAxis(t,e,s){var i,a,r,o,n;const l=new C(s),h=("bar"===t||"boxPlot"===t||"violin"===t)&&(null==(a=null==(i=s.plotOptions)?void 0:i.bar)?void 0:a.horizontal),c="pie"===t||"polarArea"===t||"donut"===t||"radar"===t||"radialBar"===t||"heatmap"===t,d="datetime"!==s.xaxis.type&&"numeric"!==s.xaxis.type,g=("scatter"===t||"bubble"===t)&&(null==(n=null==(o=null==(r=s.plotOptions)?void 0:r.scatter)?void 0:o.jitter)?void 0:n.enabled),p=s.xaxis.tickPlacement?s.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return h||c||g||!d||"between"===p||(s=l.convertCatToNumeric(s)),s}extendYAxis(t,e){const s=new k;(void 0===t.yaxis||!t.yaxis||Array.isArray(t.yaxis)&&0===t.yaxis.length)&&(t.yaxis={});const i=c.getApex();t.yaxis.constructor!==Array&&i.yaxis&&i.yaxis.constructor!==Array&&(t.yaxis=b.extend(t.yaxis,i.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[b.extend(s.yAxis,t.yaxis)]:t.yaxis=b.extendArray(t.yaxis,s.yAxis);let a=!1;t.yaxis.forEach(t=>{t.logarithmic&&(a=!0)});let r=t.series;return e&&!r&&(r=e.config.series),a&&r.length!==t.yaxis.length&&r.length&&(t.yaxis=r.map((e,i)=>{if(e.name||(r[i].name=`series-${i+1}`),t.yaxis[i])return t.yaxis[i].seriesName=r[i].name,t.yaxis[i];{const e=b.extend(s.yAxis,t.yaxis[0]);return e.show=!1,e}})),a&&r.length>1&&(r.length,t.yaxis.length),t}extendAnnotations(t){return void 0===t.annotations&&(t.annotations={},t.annotations.yaxis=[],t.annotations.xaxis=[],t.annotations.points=[]),t=this.extendYAxisAnnotations(t),t=this.extendXAxisAnnotations(t),t=this.extendPointAnnotations(t)}extendYAxisAnnotations(t){const e=new k;return t.annotations.yaxis=b.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}extendXAxisAnnotations(t){const e=new k;return t.annotations.xaxis=b.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}extendPointAnnotations(t){const e=new k;return t.annotations.points=b.extendArray(void 0!==t.annotations.points?t.annotations.points:[],e.pointAnnotation),t}checkForDarkTheme(t){t.theme&&"dark"===t.theme.mode&&(t.tooltip||(t.tooltip={}),"light"!==t.tooltip.theme&&(t.tooltip.theme="dark"),t.chart.foreColor||(t.chart.foreColor="#f6f7f8"),t.theme.palette||(t.theme.palette="palette4"))}handleUserInputErrors(t){const e=t;if(e.tooltip.shared&&e.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if("bar"===e.chart.type&&e.plotOptions.bar.horizontal){if(e.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");e.yaxis[0].reversed&&(e.yaxis[0].opposite=!0),e.xaxis.tooltip.enabled=!1,e.yaxis[0].tooltip.enabled=!1,e.chart.zoom.enabled=!1}return"bar"!==e.chart.type&&"rangeBar"!==e.chart.type||e.tooltip.shared&&"barWidth"===e.xaxis.crosshairs.width&&e.series.length>1&&(e.xaxis.crosshairs.width="tickWidth"),"candlestick"!==e.chart.type&&"boxPlot"!==e.chart.type||e.yaxis[0].reversed&&(e.yaxis[0].reversed=!1),e}}const L=[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],D=[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24];class M{initGlobalVars(t){t.series=[],t.seriesCandleO=[],t.seriesCandleH=[],t.seriesCandleM=[],t.seriesCandleL=[],t.seriesCandleC=[],t.seriesRangeStart=[],t.seriesRangeEnd=[],t.seriesRange=[],t.seriesPercent=[],t.seriesGoals=[],t.seriesX=[],t.seriesZ=[],t.seriesNames=[],t.seriesTotals=[],t.seriesLog=[],t.seriesColors=[],t.stackedSeriesTotals=[],t.seriesXvalues=[],t.seriesYvalues=[],t.dataWasParsed=!1,t.originalSeries=null,t.maxValsInArrayIndex=0,t.yValueDecimal=0,t.allSeriesHasEqualX=!0,t.labels=[],t.hasXaxisGroups=!1,t.groups=[],t.barGroups=[],t.lineGroups=[],t.areaGroups=[],t.hasSeriesGroups=!1,t.seriesGroups=[],t.categoryLabels=[],t.timescaleLabels=[],t.noLabelsProvided=!1,t.isXNumeric=!1,t.skipLastTimelinelabel=!1,t.skipFirstTimelinelabel=!1,t.isDataXYZ=!1,t.isMultiLineX=!1,t.isMultipleYAxis=!1,t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE,t.minYArr=[],t.maxYArr=[],t.maxX=-Number.MAX_VALUE,t.minX=Number.MAX_VALUE,t.initialMaxX=-Number.MAX_VALUE,t.initialMinX=Number.MAX_VALUE,t.maxDate=0,t.minDate=Number.MAX_VALUE,t.minZ=Number.MAX_VALUE,t.maxZ=-Number.MAX_VALUE,t.minXDiff=Number.MAX_VALUE,t.yAxisScale=[],t.xAxisScale=null,t.xAxisTicksPositions=[],t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0,t.multiAxisTickAmount=0,t.disableZoomIn=!1,t.disableZoomOut=!1,t.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.rotateXLabels=!1,t.overlappingXLabels=!1,t.radialSize=0,t.barHeight=0,t.barWidth=0,t.animationEnded=!1,t.isDestroyed=!1,t.bulkRevealScheduled=!1,t.resizeTimer=null,t.selectionResizeTimer=null,t.lastWheelExecution=0,t.delayedElements=[],t.pointsArray=[],t.barCanvasCoords=null,t.activeRenderer=null,t.dataLabelsRects=[],t.lastDrawnDataLabelsIndexes=[],t.textRectsCache=new Map,t.domCache=new Map,t.dimensionCache={},t.cachedSelectors={},t.seriesNS||this._attachNamespaces(t)}_attachNamespaces(t){const e=(e,s,i=s)=>{Object.defineProperty(e,i,{get:()=>t[s],set(e){t[s]=e},enumerable:!0,configurable:!0})},s={};e(s,"series","data");for(const t of["seriesNames","seriesX","seriesZ","seriesXvalues","seriesYvalues","seriesGoals","seriesLog","seriesColors","seriesPercent","seriesTotals","stackedSeriesTotals","seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC","seriesRangeStart","seriesRangeEnd","seriesRange","seriesYAxisMap","seriesYAxisReverseMap","seriesGroups","barGroups","lineGroups","areaGroups","originalSeries","collapsedSeries","collapsedSeriesIndices","ancillaryCollapsedSeries","ancillaryCollapsedSeriesIndices","allSeriesCollapsed","risingSeries","previousPaths","ignoreYAxisIndexes","labels","categoryLabels","timescaleLabels","groups"])e(s,t);Object.defineProperty(t,"seriesNS",{value:s,writable:!1,enumerable:!1,configurable:!0});const i={};for(const t of["minX","maxX","initialMinX","initialMaxX","minY","maxY","minYArr","maxYArr","minZ","maxZ","minDate","maxDate","minXDiff","xRange","yRange","zRange","xAxisScale","yAxisScale","xAxisTicksPositions","xTickAmount","multiAxisTickAmount","dataPoints","maxValsInArrayIndex","isXNumeric","isMultipleYAxis","isMultiLineX","isDataXYZ","dataFormatXNumeric","allSeriesHasEqualX","hasNullValues","dataWasParsed","hasXaxisGroups","hasSeriesGroups","skipFirstTimelinelabel","skipLastTimelinelabel","yValueDecimal","invalidLogScale","noLabelsProvided"])e(i,t);Object.defineProperty(t,"axes",{value:i,writable:!1,enumerable:!1,configurable:!0});const a={};for(const t of["svgWidth","svgHeight","gridWidth","gridHeight","translateX","translateY","translateXAxisX","translateXAxisY","translateYAxisX","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yAxisLabelsWidth","yAxisWidths","yLabelsCoords","yTitleCoords","padHorizontal","barPadForNumericAxis","rotateXLabels","scaleX","scaleY","radialSize","defaultLabels","overlappingXLabels"])e(a,t);Object.defineProperty(t,"layout",{value:a,writable:!1,enumerable:!1,configurable:!0});const r={};for(const t of["domCache","dimensionCache","cachedSelectors","textRectsCache","pointsArray","dataLabelsRects","lastDrawnDataLabelsIndexes","delayedElements","resizeTimer","selectionResizeTimer","resizeObserver"])e(r,t);Object.defineProperty(t,"cache",{value:r,writable:!1,enumerable:!1,configurable:!0})}globalVars(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},LINE_HEIGHT_RATIO:1.618,axisCharts:!0,isSlopeChart:t.plotOptions.line.isSlopeChart,comboCharts:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],ignoreYAxisIndexes:[],isDirty:!1,isExecCalled:!1,dataChanged:!1,resized:!1,invalidLogScale:!1,hasNullValues:!1,columnSeries:null,yaxis:null,total:0,shouldAnimate:!0,previousPaths:[],prevStreamFrame:null,prevChromeFrame:null,svgWidth:0,svgHeight:0,defaultLabels:!1,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateYAxisX:[],yAxisWidths:[],tooltip:null,resizeObserver:null,locale:{},memory:{methodsToExec:[]},niceScaleAllowedMagMsd:L,niceScaleDefaultTicks:D,seriesYAxisMap:[],seriesYAxisReverseMap:[],noData:!1}}init(t){const e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=b.extend({},t),e.initialSeries=b.clone(t.series),e.lastXAxis=b.clone(e.initialConfig.xaxis),e.lastYAxis=b.clone(e.initialConfig.yaxis),e}}class E{constructor(t){this.opts=t}init(){const t=new _(this.opts).init({responsiveOverride:!1}),e=(new M).init(t),s={config:t,globals:e,dom:{},interact:{zoomEnabled:"zoom"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.zoom&&t.chart.zoom.enabled,panEnabled:"pan"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.pan,selectionEnabled:"selection"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.selection,zoomed:!1,selection:void 0,visibleXRange:void 0,selectedDataPoints:[],mousedown:!1,clientX:null,clientY:null,lastClientPosition:{},lastWheelExecution:0,capturedSeriesIndex:-1,capturedDataPointIndex:-1,disableZoomIn:!1,disableZoomOut:!1,isTouchDevice:!!c.isBrowser()&&("ontouchstart"in window||navigator.maxTouchPoints>0)},formatters:{xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,legendFormatter:void 0},candleData:{seriesCandleO:[],seriesCandleH:[],seriesCandleM:[],seriesCandleL:[],seriesCandleC:[],seriesBoxPoints:[]},rangeData:{seriesRangeStart:[],seriesRangeEnd:[],seriesRange:[]},violinData:{seriesViolinDensity:[],seriesViolinPoints:[],seriesViolinMin:[],seriesViolinMax:[]},labelData:{labels:[],categoryLabels:[],timescaleLabels:[],hasXaxisGroups:!1,groups:[],seriesGroups:[]},axisFlags:{isXNumeric:!1,dataFormatXNumeric:!1,isDataXYZ:!1,isRangeData:!1,isRangeBar:!1,isMultiLineX:!1,noLabelsProvided:!1,dataWasParsed:!1},seriesData:{series:[],seriesNames:[],seriesX:[],seriesZ:[],seriesColors:[],seriesGoals:[],stackedSeriesTotals:[],stackedSeriesTotalsByGroups:[]},layout:{gridHeight:0,gridWidth:0,translateX:0,translateY:0,translateXAxisX:0,translateXAxisY:0,rotateXLabels:!1,xAxisHeight:0,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yLabelsCoords:[],yTitleCoords:[]}};Object.defineProperty(e,"dom",{get:()=>s.dom,set(t){s.dom=t},enumerable:!1,configurable:!0});for(const t of["xLabelFormatter","yLabelFormatters","xaxisTooltipFormatter","ttKeyFormatter","ttVal","ttZFormatter","legendFormatter"])Object.defineProperty(e,t,{get:()=>s.formatters[t],set(e){s.formatters[t]=e},enumerable:!1,configurable:!0});for(const t of["zoomEnabled","panEnabled","selectionEnabled","zoomed","selection","visibleXRange","selectedDataPoints","mousedown","clientX","clientY","lastClientPosition","lastWheelExecution","capturedSeriesIndex","capturedDataPointIndex","disableZoomIn","disableZoomOut","isTouchDevice"])Object.defineProperty(e,t,{get:()=>s.interact[t],set(e){s.interact[t]=e},enumerable:!1,configurable:!0});for(const t of["gridHeight","gridWidth","translateX","translateY","translateXAxisX","translateXAxisY","rotateXLabels","xAxisHeight","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yLabelsCoords","yTitleCoords"])Object.defineProperty(e,t,{get:()=>s.layout[t],set(e){s.layout[t]=e},enumerable:!1,configurable:!0});for(const t of["series","seriesNames","seriesX","seriesZ","seriesColors","seriesGoals","stackedSeriesTotals","stackedSeriesTotalsByGroups"])Object.defineProperty(e,t,{get:()=>s.seriesData[t],set(e){s.seriesData[t]=e},enumerable:!1,configurable:!0});for(const t of["isXNumeric","dataFormatXNumeric","isDataXYZ","isRangeData","isRangeBar","isMultiLineX","noLabelsProvided","dataWasParsed"])Object.defineProperty(e,t,{get:()=>s.axisFlags[t],set(e){s.axisFlags[t]=e},enumerable:!1,configurable:!0});for(const t of["labels","categoryLabels","timescaleLabels","hasXaxisGroups","groups","seriesGroups"])Object.defineProperty(e,t,{get:()=>s.labelData[t],set(e){s.labelData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesRangeStart","seriesRangeEnd","seriesRange"])Object.defineProperty(e,t,{get:()=>s.rangeData[t],set(e){s.rangeData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC"])Object.defineProperty(e,t,{get:()=>s.candleData[t],set(e){s.candleData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesViolinDensity","seriesViolinPoints","seriesViolinMin","seriesViolinMax"])Object.defineProperty(e,t,{get:()=>s.violinData[t],set(e){s.violinData[t]=e},enumerable:!1,configurable:!0});return s}}class P{constructor(t){this.w=t}static checkComboSeries(t,e){let s=!1,i=0,a=0;return void 0===e&&(e="line"),t.length&&void 0!==t[0].type&&t.forEach(t=>{"bar"!==t.type&&"column"!==t.type&&"candlestick"!==t.type&&"boxPlot"!==t.type&&"violin"!==t.type||i++,void 0!==t.type&&t.type!==e&&a++}),a>0&&(s=!0),{comboBarCount:i,comboCharts:s}}getStackedSeriesTotals(t=[]){const e=this.w,s=[];if(0===e.seriesData.series.length)return s;for(let i=0;i<e.seriesData.series[e.globals.maxValsInArrayIndex].length;i++){let a=0;for(let s=0;s<e.seriesData.series.length;s++)void 0!==e.seriesData.series[s][i]&&-1===t.indexOf(s)&&(a+=e.seriesData.series[s][i]);s.push(a)}return s}getSeriesTotalByIndex(t=null){if(null===t)return this.w.config.series.reduce((t,e)=>t+e,0);{const e=this.w.seriesData.series[t];return Array.isArray(e)?e.reduce((t,e)=>t+e,0):null!=e?e:0}}getStackedSeriesTotalsByGroups(){const t=this.w,e=[];return t.labelData.seriesGroups.forEach(s=>{const i=[];t.config.series.forEach((e,a)=>{s.indexOf(t.seriesData.seriesNames[a])>-1&&i.push(a)});const a=t.seriesData.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t);e.push(this.getStackedSeriesTotals(a))}),e}setSeriesYAxisMappings(){const t=this.w.globals,e=this.w.config;let s=[];const i=[],a=[],r=this.w.seriesData.series.length>e.yaxis.length||e.yaxis.some(t=>Array.isArray(t.seriesName));e.series.forEach((t,e)=>{a.push(e),i.push(null)}),e.yaxis.forEach((t,e)=>{s[e]=[]});const o=[];e.yaxis.forEach((t,i)=>{let n=!1;if(t.seriesName){let o=[];Array.isArray(t.seriesName)?o=t.seriesName:o.push(t.seriesName),o.forEach(t=>{e.series.forEach((e,o)=>{if(e.name===t){let t=o;i===o||r?(!r||a.indexOf(o)>-1)&&s[i].push([i,o]):(s[o].push([o,i]),t=i),n=!0,t=a.indexOf(t),-1!==t&&a.splice(t,1)}})})}n||o.push(i)}),s=s.map(t=>{const e=[];return t.forEach(t=>{i[t[1]]=t[0],e.push(t[1])}),e});let n=e.yaxis.length-1;for(let t=0;t<o.length&&(n=o[t],s[n]=[],a);t++){const t=a[0];a.shift(),s[n].push(t),i[t]=n}a.forEach(t=>{s[n].push(t),i[t]=n}),t.seriesYAxisMap=s.map(t=>t),t.seriesYAxisReverseMap=i.map(t=>t),t.seriesYAxisMap.forEach((t,s)=>{t.forEach(t=>{if(e.series[t]&&void 0===e.series[t].group){e.series[t].group="apexcharts-axis-".concat(s.toString())}})})}isSeriesNull(t=null){let e=[];const s=this.w.config.series;return e=null===t?s.filter(t=>null!==t):s[t]&&Array.isArray(s[t].data)?s[t].data.filter(t=>null!==t):null!==s[t]&&void 0!==s[t]?[s[t]]:[],0===e.length}seriesHaveSameValues(t){const e=this.w.seriesData.series[t];return!Array.isArray(e)||e.every((t,e,s)=>t===s[0])}getCategoryLabels(t){const e=this.w;let s=t.slice();return e.config.xaxis.convertedCatToNumeric&&(s=t.map(t=>e.config.xaxis.labels.formatter(t-e.globals.minX+1))),s}getLargestSeries(){const t=this.w;t.globals.maxValsInArrayIndex=t.seriesData.series.map(t=>t.length).indexOf(Math.max.apply(Math,t.seriesData.series.map(t=>t.length)))}getLargestMarkerSize(){const t=this.w;let e=0;return t.globals.markers.size.forEach(t=>{e=Math.max(e,t)}),t.config.markers.discrete&&t.config.markers.discrete.length&&t.config.markers.discrete.forEach(t=>{e=Math.max(e,t.size)}),e>0&&(t.config.markers.hover.size>0?e=t.config.markers.hover.size:e+=t.config.markers.hover.sizeOffset),t.globals.markers.largestSize=e,e}getSeriesTotals(){const t=this.w;t.globals.seriesTotals=t.seriesData.series.map(t=>{let e=0;if(Array.isArray(t))for(let s=0;s<t.length;s++)e+=t[s];else e+=t;return e})}getSeriesTotalsXRange(t,e){const s=this.w;return s.seriesData.series.map((i,a)=>{let r=0;for(let o=0;o<i.length;o++)s.seriesData.seriesX[a][o]>t&&s.seriesData.seriesX[a][o]<e&&(r+=i[o]);return r})}getPercentSeries(){const t=this.w;t.globals.seriesPercent=t.seriesData.series.map(e=>{const s=[];if(Array.isArray(e))for(let i=0;i<e.length;i++){const a=t.seriesData.stackedSeriesTotals[i];let r=0;a&&(r=100*e[i]/a),s.push(r)}else{const i=100*e/t.globals.seriesTotals.reduce((t,e)=>t+e,0);s.push(i)}return s})}getCalculatedRatios(){const t=this.w,e=t.globals,s=[];let i=0,a=0,r=0,o=0,n=[],l=.1,h=0;if(e.yRange=[],e.isMultipleYAxis)for(let t=0;t<e.minYArr.length;t++)e.yRange.push(Math.abs(e.minYArr[t]-e.maxYArr[t])),n.push(0);else e.yRange.push(Math.abs(e.minY-e.maxY));e.xRange=Math.abs(e.maxX-e.minX),e.zRange=Math.abs(e.maxZ-e.minZ);for(let t=0;t<e.yRange.length;t++)s.push(e.yRange[t]/this.w.layout.gridHeight);if(a=e.xRange/this.w.layout.gridWidth,i=e.yRange/this.w.layout.gridWidth,r=e.xRange/this.w.layout.gridHeight,o=e.zRange/this.w.layout.gridHeight*16,o||(o=1),e.minY!==Number.MIN_VALUE&&0!==Math.abs(e.minY)){e.hasNegs=!0}if(t.globals.seriesYAxisReverseMap.length>0){const r=(e,i)=>{const a=t.config.yaxis[t.globals.seriesYAxisReverseMap[i]],r=e<0?-1:1;return e=Math.abs(e),a.logarithmic&&(e=this.getBaseLog(a.logBase,e)),-r*e/s[i]};if(e.isMultipleYAxis){n=[];for(let t=0;t<s.length;t++)n.push(r(e.minYArr[t],t))}else n=[],n.push(r(e.minY,0)),e.minY!==Number.MIN_VALUE&&0!==Math.abs(e.minY)&&(l=-e.minY/i,h=e.minX/a)}else n=[],n.push(0),l=0,h=0;return{yRatio:s,invertedYRatio:i,zRatio:o,xRatio:a,invertedXRatio:r,baseLineInvertedY:l,baseLineY:n,baseLineX:h}}getLogSeries(t){const e=this.w;return e.globals.seriesLog=t.map((t,s)=>{const i=e.globals.seriesYAxisReverseMap[s];return e.config.yaxis[i]&&e.config.yaxis[i].logarithmic?t.map(t=>null===t?null:this.getLogVal(e.config.yaxis[i].logBase,t,s)):t}),e.globals.invalidLogScale?t:e.globals.seriesLog}getLogValAtSeriesIndex(t,e){if(null===t)return null;const s=this.w,i=s.globals.seriesYAxisReverseMap[e];return s.config.yaxis[i]&&s.config.yaxis[i].logarithmic?this.getLogVal(s.config.yaxis[i].logBase,t,e):t}getBaseLog(t,e){return Math.log(e)/Math.log(t)}getLogVal(t,e,s){if(e<=0)return 0;const i=this.w,a=0===i.globals.minYArr[s]?-1:this.getBaseLog(t,i.globals.minYArr[s]),r=(0===i.globals.maxYArr[s]?0:this.getBaseLog(t,i.globals.maxYArr[s]))-a;if(e<1)return e/r;return(this.getBaseLog(t,e)-a)/r}getLogYRatios(t){const e=this.w,s=this.w.globals,i=s;return i.yLogRatio=t.slice(),i.logYRange=s.yRange.map((t,a)=>{const r=e.globals.seriesYAxisReverseMap[a];if(e.config.yaxis[r]&&this.w.config.yaxis[r].logarithmic){let t=-Number.MAX_VALUE,r=Number.MIN_VALUE,o=1;return s.seriesLog.forEach((s,i)=>{s.forEach(s=>{e.config.yaxis[i]&&e.config.yaxis[i].logarithmic&&(t=Math.max(s,t),r=Math.min(s,r))})}),o=Math.pow(s.yRange[a],Math.abs(r-t)/s.yRange[a]),i.yLogRatio[a]=o/this.w.layout.gridHeight,o}}),i.invalidLogScale?t.slice():i.yLogRatio}static extendArrayProps(t,e,s){var i,a;return(null==e?void 0:e.yaxis)&&(e=t.extendYAxis(e,s)),(null==e?void 0:e.annotations)&&(e.annotations.yaxis&&(e=t.extendYAxisAnnotations(e)),(null==(i=null==e?void 0:e.annotations)?void 0:i.xaxis)&&(e=t.extendXAxisAnnotations(e)),(null==(a=null==e?void 0:e.annotations)?void 0:a.points)&&(e=t.extendPointAnnotations(e))),e}drawSeriesByGroup(t,e,s,i){const a=this.w,r=[];return t.series.length>0&&e.forEach(e=>{const o=[],n=[];t.i.forEach((s,i)=>{a.config.series[s].group===e&&(o.push(t.series[i]),n.push(s))}),o.length>0&&r.push(i.draw(o,s,n))}),r}}const F="http://www.w3.org/2000/svg";class T{constructor(t,e){"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t||0,this.y=e||0)}transform(t){return t.apply(this)}clone(){return new T(this.x,this.y)}}class I{constructor(t,e,s,i,a,r){this.a=null!=t?t:1,this.b=null!=e?e:0,this.c=null!=s?s:0,this.d=null!=i?i:1,this.e=null!=a?a:0,this.f=null!=r?r:0}rotate(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return this.multiply(new I(s,i,-i,s,0,0))}scale(t,e){return this.multiply(new I(t,0,0,null!=e?e:t,0,0))}multiply(t){return new I(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)}apply(t){return new T(this.a*t.x+this.c*t.y+this.e,this.b*t.x+this.d*t.y+this.f)}}class X{constructor(t,e,s,i){this.x=t,this.y=e,this.w=s,this.h=i,this.width=s,this.height=i,this.x2=t+s,this.y2=e+i}}function R(t){if(!t||"string"!=typeof t)return[["M",0,0]];const e=[],s=/([MmLlHhVvCcSsQqTtAaZz])\s*/g,i=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;let a;const r=[],o=[];for(;null!==(a=s.exec(t));)r.push(a[1]),o.push(a.index);for(let s=0;s<r.length;s++){const a=o[s]+r[s].length,n=s+1<o.length?o[s+1]:t.length,l=t.substring(a,n),h=[];let c;for(i.lastIndex=0;null!==(c=i.exec(l));)h.push(parseFloat(c[0]));const d=r[s].toUpperCase();if("Z"===d)e.push(["Z"]);else if("M"===d||"L"===d||"T"===d)for(let t=0;t<h.length;t+=2)e.push([d,h[t],h[t+1]]);else if("H"===d)for(let t=0;t<h.length;t++)e.push([d,h[t]]);else if("V"===d)for(let t=0;t<h.length;t++)e.push([d,h[t]]);else if("C"===d)for(let t=0;t<h.length;t+=6)e.push([d,h[t],h[t+1],h[t+2],h[t+3],h[t+4],h[t+5]]);else if("S"===d||"Q"===d)for(let t=0;t<h.length;t+=4)e.push([d,h[t],h[t+1],h[t+2],h[t+3]]);else if("A"===d)for(let t=0;t<h.length;t+=7)e.push([d,h[t],h[t+1],h[t+2],h[t+3],h[t+4],h[t+5],h[t+6]])}return 0===e.length&&e.push(["M",0,0]),e}function z(t){let e=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEach(t=>{for(let r=1;r<t.length;r+=2)if(r+1<=t.length){const o=t[r],n=t[r+1];"number"==typeof o&&"number"==typeof n&&(o<e&&(e=o),o>i&&(i=o),n<s&&(s=n),n>a&&(a=n))}}),e===1/0?{x:0,y:0,width:0,height:0}:{x:e,y:s,width:i-e,height:a-s}}function B(t){return t.map(t=>t.join(" ")).join(" ")}function Y(t){switch(t[0]){case"z":case"Z":t[0]="L",t[1]=this.start[0],t[2]=this.start[1];break;case"H":t[0]="L",t[2]=this.pos[1];break;case"V":t[0]="L",t[2]=t[1],t[1]=this.pos[0];break;case"T":t[0]="Q",t[3]=t[1],t[4]=t[2],t[1]=this.reflection[1],t[2]=this.reflection[0];break;case"S":t[0]="C",t[6]=t[4],t[5]=t[3],t[4]=t[2],t[3]=t[1],t[2]=this.reflection[1],t[1]=this.reflection[0]}return t}function N(t){var e=t.length;return this.pos=[t[e-2],t[e-1]],-1!="SCQT".indexOf(t[0])&&(this.reflection=[2*this.pos[0]-t[e-4],2*this.pos[1]-t[e-3]]),t}function O(t){var e,s=[t];switch(t[0]){case"M":return this.pos=this.start=[t[1],t[2]],s;case"L":t[5]=t[3]=t[1],t[6]=t[4]=t[2],t[1]=this.pos[0],t[2]=this.pos[1];break;case"Q":t[6]=t[4],t[5]=t[3],t[4]=1*t[4]/3+2*t[2]/3,t[3]=1*t[3]/3+2*t[1]/3,t[2]=1*this.pos[1]/3+2*t[2]/3,t[1]=1*this.pos[0]/3+2*t[1]/3;break;case"A":s=function(t,e){var s,i,a,r,o,n,l,h,c,d,g,p,u,x,f,m,b,y,w,v,A,C,S,k,_,L,D=Math.abs(e[1]),M=Math.abs(e[2]),E=e[3]%360,P=e[4],F=e[5],X=e[6],R=e[7],z=new T(t[0],t[1]),B=new T(X,R),Y=[];if(0===D||0===M||z.x===B.x&&z.y===B.y)return[["C",z.x,z.y,B.x,B.y,B.x,B.y]];s=new T((z.x-B.x)/2,(z.y-B.y)/2).transform((new I).rotate(E)),(i=s.x*s.x/(D*D)+s.y*s.y/(M*M))>1&&(D*=i=Math.sqrt(i),M*=i);a=(new I).rotate(E).scale(1/D,1/M).rotate(-E),z=z.transform(a),B=B.transform(a),r=[B.x-z.x,B.y-z.y],n=r[0]*r[0]+r[1]*r[1],o=Math.sqrt(n),r[0]/=o,r[1]/=o,l=n<4?Math.sqrt(1-n/4):0,P===F&&(l*=-1);h=new T((B.x+z.x)/2+l*-r[1],(B.y+z.y)/2+l*r[0]),c=new T(z.x-h.x,z.y-h.y),d=new T(B.x-h.x,B.y-h.y),g=Math.acos(c.x/Math.sqrt(c.x*c.x+c.y*c.y)),c.y<0&&(g*=-1);p=Math.acos(d.x/Math.sqrt(d.x*d.x+d.y*d.y)),d.y<0&&(p*=-1);F&&g>p&&(p+=2*Math.PI);!F&&g<p&&(p-=2*Math.PI);for(x=Math.ceil(2*Math.abs(g-p)/Math.PI),m=[],b=g,u=(p-g)/x,f=4*Math.tan(u/4)/3,A=0;A<=x;A++)w=Math.cos(b),y=Math.sin(b),v=new T(h.x+w,h.y+y),m[A]=[new T(v.x+f*y,v.y-f*w),v,new T(v.x-f*y,v.y+f*w)],b+=u;for(m[0][0]=m[0][1].clone(),m[m.length-1][2]=m[m.length-1][1].clone(),a=(new I).rotate(E).scale(D,M).rotate(-E),A=0,C=m.length;A<C;A++)m[A][0]=m[A][0].transform(a),m[A][1]=m[A][1].transform(a),m[A][2]=m[A][2].transform(a);for(A=1,C=m.length;A<C;A++)S=(v=m[A-1][2]).x,k=v.y,_=(v=m[A][0]).x,L=v.y,X=(v=m[A][1]).x,R=v.y,Y.push(["C",S,k,_,L,X,R]);return Y}(null!=(e=this.pos)?e:[],t),t=s[0]}return t[0]="C",this.pos=[t[5],t[6]],this.reflection=[2*t[5]-t[3],2*t[6]-t[4]],s}function H(t,e){if(!1===e)return!1;for(var s=e,i=t.length;s<i;++s)if("M"==t[s][0])return s;return!1}function W(t,e,s,i,a,r){for(var o=t.slice(e,s||void 0),n=i.slice(a,r||void 0),l=0,h={pos:[0,0],start:[0,0]},c={pos:[0,0],start:[0,0]};o[l]=Y.call(h,o[l]),n[l]=Y.call(c,n[l]),o[l][0]!=n[l][0]||"M"==o[l][0]||"A"==o[l][0]&&(o[l][4]!=n[l][4]||o[l][5]!=n[l][5])?(Array.prototype.splice.apply(o,[l,1].concat(O.call(h,o[l]))),Array.prototype.splice.apply(n,[l,1].concat(O.call(c,n[l])))):(o[l]=N.call(h,o[l]),n[l]=N.call(c,n[l])),++l!=o.length||l!=n.length;)l==o.length&&o.push(["C",h.pos[0],h.pos[1],h.pos[0],h.pos[1],h.pos[0],h.pos[1]]),l==n.length&&n.push(["C",c.pos[0],c.pos[1],c.pos[0],c.pos[1],c.pos[0],c.pos[1]]);return{start:o,dest:n}}function $(t,e){var s=function(t,e){for(var s,i=R(t),a=R(e),r=0,o=0,n=!1,l=!1;!1!==r||!1!==o;){if(n=H(i,!1!==r&&r+1),l=H(a,!1!==o&&o+1),!1===r){const t=z(s.start);r=0==t.height||0==t.width?i.push(i[0])-1:i.push(["M",t.x+t.width/2,t.y+t.height/2])-1}if(!1===o){const t=z(s.dest);o=0==t.height||0==t.width?a.push(a[0])-1:a.push(["M",t.x+t.width/2,t.y+t.height/2])-1}s=W(i,r,n,a,o,l),i=i.slice(0,r).concat(s.start,!1===n?[]:i.slice(n)),a=a.slice(0,o).concat(s.dest,!1===l?[]:a.slice(l)),r=!1!==n&&r+s.start.length,o=!1!==l&&o+s.dest.length}return{start:i,dest:a}}(t,e),i=s.start,a=s.dest;return function(t){return B(i.map(function(e,s){return a[s].map(function(i,r){return 0===r?i:e[r]+(a[s][r]-e[r])*t})}))}}let j=null,G=null;function V(t,e){const s=new Array(e);if(!c.isBrowser()){const i=z(R(t)),a=i.x+i.width/2,r=i.y+i.height/2;for(let t=0;t<e;t++)s[t]={x:a,y:r};return s}j||(j=document.createElementNS("http://www.w3.org/2000/svg","svg"),j.setAttribute("width","0"),j.setAttribute("height","0"),j.setAttribute("style","position:absolute;width:0;height:0;visibility:hidden;pointer-events:none;"),G=document.createElementNS("http://www.w3.org/2000/svg","path"),j.appendChild(G),document.body.appendChild(j)),G.setAttribute("d",t||"M0 0");let i=0;try{i=G.getTotalLength()}catch(t){i=0}if(!i||!isFinite(i)){const i=z(R(t)),a=i.x+i.width/2,r=i.y+i.height/2;for(let t=0;t<e;t++)s[t]={x:a,y:r};return s}for(let t=0;t<e;t++)try{const a=G.getPointAtLength(t/e*i);s[t]={x:a.x,y:a.y}}catch(e){s[t]={x:0,y:0}}return s}function U(t){return-Math.cos(t*Math.PI)/2+.5}let q=U;function Z(t){if(!t||"string"!=typeof t)return null;if("#"===t[0]){let e=t.slice(1);3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const s=parseInt(e,16);return[s>>16&255,s>>8&255,255&s,1]}const e=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);return e?[+e[1],+e[2],+e[3],void 0!==e[4]?+e[4]:1]:null}function K(t,e,s){return`rgba(${Math.round(t[0]+(e[0]-t[0])*s)},${Math.round(t[1]+(e[1]-t[1])*s)},${Math.round(t[2]+(e[2]-t[2])*s)},${t[3]+(e[3]-t[3])*s})`}class J{constructor(t,e,s){this.el=t,this.duration=null!=e?e:300,this.delay=s||0,this._attrTarget=null,this._plotTarget=null,this._plotSnap=null,this._plotAlgorithm="commands",this._afterCb=null,this._duringCb=null,this._easing=null,this._next=null,this._root=null,this._scheduled=!1}ease(t){return"function"==typeof t&&(this._easing=t),this._schedule(),this}attr(t){return this._attrTarget=t,this._schedule(),this}plot(t,e,s){return this._plotTarget=t,e&&(this._plotAlgorithm=e),this._plotSnap=s||null,this._schedule(),this}after(t){return this._afterCb=t,this._schedule(),this}during(t){return this._duringCb=t,this._schedule(),this}animate(t,e){const s=new J(this.el,t,e);return this._next=s,s._root=this._root||this,s}_schedule(){const t=this._root||this;t._scheduled||(t._scheduled=!0,queueMicrotask(()=>t._executeChain()))}_executeChain(){const t=[];let e=this;for(;e;)t.push(e),e=e._next;let s=0;t.forEach(t=>{s+=t.delay,t._execute(s),s+=t.duration})}_execute(t){const e=this.el,s=this.duration;if(s<=1){const s=()=>{this._attrTarget&&e.attr(this._attrTarget),this._plotTarget&&e.plot(this._plotSnap||this._plotTarget),this._afterCb&&this._afterCb.call(e)};return void(t>0?setTimeout(s,t):s())}const i=()=>{const t={},i={},a={};if(this._attrTarget)for(const s of Object.keys(this._attrTarget)){const r=e.attr(s);t[s]=r;const o=Z(r),n=Z(String(this._attrTarget[s]));o&&n&&(i[s]=o,a[s]=n)}let r=null;if(this._plotTarget){const t=e.attr("d")||"";try{r="polygons"===this._plotAlgorithm?function(t,e,s=96){const i=V(t,s),a=V(e,s);let r=0,o=1/0;for(let t=0;t<s;t++){let e=0;for(let r=0;r<s;r++){const n=i[(r+t)%s],l=a[r],h=n.x-l.x,c=n.y-l.y;if(e+=h*h+c*c,e>=o)break}e<o&&(o=e,r=t)}const n=new Array(s);for(let t=0;t<s;t++)n[t]=i[(t+r)%s];return function(t){let e="";for(let i=0;i<s;i++){const s=n[i],r=a[i],o=s.x+(r.x-s.x)*t,l=s.y+(r.y-s.y)*t;e+=(0===i?"M":"L")+o.toFixed(3)+" "+l.toFixed(3)+" "}return e+"Z"}}(t,this._plotTarget):$(t,this._plotTarget)}catch(t){r=null}}const o=performance.now(),n=this._easing||q,l=h=>{const c=h-o,d=Math.min(c/s,1),g=n(d);if(this._attrTarget)if(d>=1)e.attr(this._attrTarget);else{const s={};for(const e of Object.keys(this._attrTarget))if(i[e]&&a[e])s[e]=K(i[e],a[e],g);else{const i=parseFloat(t[e]),a=parseFloat(this._attrTarget[e]);isNaN(i)||isNaN(a)||(s[e]=i+(a-i)*g)}e.attr(s)}r&&d<1&&e.attr("d",r(g)),this._duringCb&&this._duringCb(g),d<1?m.requestAnimationFrame(l):(this._plotTarget&&e.attr("d",this._plotSnap||this._plotTarget),this._afterCb&&this._afterCb.call(e))};m.requestAnimationFrame(l)};t>0?setTimeout(i,t):i()}}function Q(t){return-Math.cos(t*Math.PI)/2+.5}function tt(t,e,s,i){t=Math.min(Math.max(t,0),1),s=Math.min(Math.max(s,0),1);const a=3*t,r=3*(s-t)-a,o=1-a-r,n=3*e,l=3*(i-e)-n,h=1-n-l,c=t=>((o*t+r)*t+a)*t,d=t=>(3*o*t+2*r)*t+a;return t=>t<=0?0:t>=1?1:(t=>((h*t+l)*t+n)*t)((t=>{let e=t;for(let s=0;s<5;s++){const s=d(e);if(0===s)break;e-=(c(e)-t)/s}let s=0,i=1;if(e=t,e<s)return s;if(e>i)return i;for(;s<i;){const a=c(e);if(Math.abs(a-t)<1e-4)return e;t>a?s=e:i=e,e=(s+i)/2}return e})(t))}const et=new Map;function st(t){return"function"==typeof t?t:(e=t,Array.isArray(e)&&4===e.length&&e.every(t=>"number"==typeof t)?tt(t[0],t[1],t[2],t[3]):"string"==typeof t&&et.has(t)?et.get(t):Q);var e}et.set("linear",t=>t),et.set("easeInOutSine",Q),et.set("easeInSine",t=>1-Math.cos(t*Math.PI/2)),et.set("easeOutSine",t=>Math.sin(t*Math.PI/2)),et.set("easeInQuad",t=>t*t),et.set("easeOutQuad",t=>1-(1-t)*(1-t)),et.set("easeInOutQuad",t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2),et.set("easeInCubic",t=>t*t*t),et.set("easeOutCubic",t=>1-Math.pow(1-t,3)),et.set("easeInOutCubic",t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2),et.set("easeOutBack",t=>{const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}),et.set("easeInOutBack",t=>{const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2});const it="http://www.w3.org/2000/svg";function at(t){return 1-Math.pow(1-t,3)}let rt=null;function ot(){if(!c.isBrowser())return!1;try{return rt||(rt=window.matchMedia("(prefers-reduced-motion: reduce)")),!!rt.matches}catch(t){return!1}}function nt(t,e,s){if(!c.isBrowser())return!1;if(s.globals.dataChanged||s.globals.resized)return!1;const i=s.config.chart.animations;if(!i||!1===i.enabled)return!1;const a=s.config.chart.type;if("line"!==a&&"area"!==a&&"rangeArea"!==a)return!1;if(!(s.layout.gridWidth>0))return!1;const r=2*(i.speed||800),o=Math.max(0,Math.min(1,e/s.layout.gridWidth)),n=(1-Math.cbrt(1-o))*r,l=t.node.style;l.opacity="0";let h=null;const d=t=>{null===h&&(h=t),t-h>=n?l.opacity="":m.requestAnimationFrame(d)};return m.requestAnimationFrame(d),!0}function lt(t){const e=t.config.chart.animations;var s;e&&(!1!==e.respectReducedMotion&&ot()&&(e.enabled=!1,e.dynamicAnimation&&(e.dynamicAnimation.enabled=!1)),s=st(e.easing),q="function"==typeof s?s:U)}function ht(t){const e=t.style,s=t.index||0,i="number"==typeof t.baseDelay?t.baseDelay:40,a=t.row||0,r=t.col||0,o=t.groupIndex||0,n=t.perGroup||1,l=t.centerDistance||0;switch(e){case"none":return 0;case"diagonal":return(a+r)*i;case"group":return o*i+s%n*(i/4);case"centroid":return l*i*(s+1);default:return s*i}}class ct{constructor(t,e){this.w=t,this.ctx=e}animateLine(t,e,s,i){t.attr(e).animate(i).attr(s)}animateMarker(t,e,s,i){t.attr({opacity:0}).animate(e).attr({opacity:1}).after(()=>{i()})}animatePop(t,{speed:e,delay:s=0,onComplete:i}){const a=this.w;if(!c.isBrowser()||!a.globals.shouldAnimate||e<1)return void(i&&i());const r=t.node.style;r.transformBox="fill-box",r.transformOrigin="center",r.transform="scale(0)",r.opacity="0";const o=performance.now()+s,n=t=>{const s=Math.max(0,Math.min(1,(t-o)/e));r.transform=`scale(${function(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}(s)})`,r.opacity=String(Math.min(1,2*s)),s<1?m.requestAnimationFrame(n):(r.transform="",r.transformOrigin="",r.transformBox="",r.opacity="",i&&i())};m.requestAnimationFrame(n)}animateRect(t,e,s,i,a,r=0){t.attr(e).animate(i,r).attr(s).after(()=>a())}animatePathsGradually(t){const{el:e,realIndex:s,j:i,fill:a,pathFrom:r,pathTo:o,pathToInterp:n,speed:l,delay:h,scrollMorph:c}=t,d=this.w;let g=0;d.config.chart.animations.animateGradually.enabled&&(g=d.config.chart.animations.animateGradually.delay),d.config.chart.animations.dynamicAnimation.enabled&&d.globals.dataChanged&&"bar"!==d.config.chart.type&&(g=0),this.morphSVG(e,s,i,"line"!==d.config.chart.type||d.globals.comboCharts?a:"stroke",r,o,l,h*g,c,n)}revealBulk(t){const e=this.w;t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node}),c.isBrowser()&&e.globals.shouldAnimate?e.globals.bulkRevealScheduled||(e.globals.bulkRevealScheduled=!0,m.requestAnimationFrame(()=>{e.globals.isDestroyed||(e.globals.bulkRevealScheduled=!1,this.animationCompleted(t))})):this.animationCompleted(t)}showDelayedElements(){this.w.globals.delayedElements.forEach(t=>{if(t.holdUntilComplete&&!this.w.globals.animationEnded)return;const e=t.el;e.classList.remove("apexcharts-element-hidden"),e.classList.add("apexcharts-hidden-element-shown")})}animationCompleted(t){const e=this.w;e.globals.animationEnded||(e.globals.animationEnded=!0,this.showDelayedElements(),"function"==typeof e.config.chart.events.animationEnd&&e.config.chart.events.animationEnd(this.ctx,{el:t,w:e}))}animateDraw(t,{realIndex:e,j:s,isFill:i,isLast:a,speed:r,delay:o,mask:n}){const l=this.w,h=this,d=()=>{a&&l.globals.shouldAnimate&&h.animationCompleted(t),h.showDelayedElements()};if(!c.isBrowser()||!l.globals.shouldAnimate||r<1)return void d();const g=t.node,p=()=>{const t=n&&"radial"===n.type,a=l.layout.gridWidth+8,h=n&&n.cx||0,c=n&&n.cy||0,p=(n&&n.r||l.layout.gridWidth/2)+4,u=`apexDrawMask${l.globals.cuid}-${e}-${null!=s?s:0}-${i?"f":"s"}`,x=m.createElementNS(it,"mask");let f;if(x.setAttribute("id",u),x.setAttribute("maskUnits","userSpaceOnUse"),t){const t=p;x.setAttribute("x",String(h-t)),x.setAttribute("y",String(c-t)),x.setAttribute("width",String(2*t)),x.setAttribute("height",String(2*t)),f=m.createElementNS(it,"circle"),f.setAttribute("cx",String(h)),f.setAttribute("cy",String(c)),f.setAttribute("r","0"),f.setAttribute("fill","#fff")}else x.setAttribute("x",String(-4)),x.setAttribute("y",String(-4)),x.setAttribute("width",String(a)),x.setAttribute("height",String(l.layout.gridHeight+8)),f=m.createElementNS(it,"rect"),f.setAttribute("x",String(-4)),f.setAttribute("y",String(-4)),f.setAttribute("width","0"),f.setAttribute("height",String(l.layout.gridHeight+8)),f.setAttribute("fill","#fff");x.appendChild(f),l.dom.elDefs.node.appendChild(x),g.setAttribute("mask",`url(#${u})`);const b=performance.now()+(o||0),y=e=>{if(l.globals.isDestroyed)return;const s=Math.max(0,Math.min(1,(e-b)/r)),i=at(s);t?f.setAttribute("r",String(i*p)):f.setAttribute("width",String(i*a)),s<1?m.requestAnimationFrame(y):(g.removeAttribute("mask"),x.parentNode&&x.parentNode.removeChild(x),d())};m.requestAnimationFrame(y)};m.requestAnimationFrame(()=>{if(l.globals.isDestroyed)return;if(i)return void p();const t=g.getAttribute("stroke-dasharray");if(!!t&&"0"!==t&&""!==t)return void p();let e=0;try{"function"==typeof g.getTotalLength&&(e=g.getTotalLength())}catch(t){e=0}e?(t=>{g.setAttribute("stroke-dasharray",String(t)),g.setAttribute("stroke-dashoffset",String(t));const e=performance.now()+(o||0),s=i=>{if(l.globals.isDestroyed)return;const a=Math.max(0,Math.min(1,(i-e)/r));g.setAttribute("stroke-dashoffset",String(t*(1-at(a)))),a<1?m.requestAnimationFrame(s):(g.removeAttribute("stroke-dasharray"),g.removeAttribute("stroke-dashoffset"),d())};m.requestAnimationFrame(s)})(e):d()})}morphSVG(t,e,s,i,a,r,o,n,l,h){var c,d;const g=this.w;a||(a=t.attr("pathFrom")),r||(r=t.attr("pathTo"));const p=()=>("radar"===g.config.chart.type&&(o=1),`M 0 ${g.layout.gridHeight}`);(!a||a.indexOf("undefined")>-1||a.indexOf("NaN")>-1)&&(a=p()),(!r.trim()||r.indexOf("undefined")>-1||r.indexOf("NaN")>-1)&&(r=p(),h=void 0),h&&(!h.trim()||h.indexOf("undefined")>-1||h.indexOf("NaN")>-1)&&(h=void 0),g.globals.shouldAnimate||(o=1);const u=!0===(null==(d=null==(c=this.ctx)?void 0:c.morphTypeChange)?void 0:d.isActive())?"polygons":"commands";let x=null;if(g.globals.dataChanged){const t=g.config.chart.animations.dynamicAnimation.easing;null!=t?x=st(t):l&&(x=st("linear"))}const f=t.plot(a).animate(1,n).plot(a).animate(o,n);x&&f.ease(x),f.plot(h||r,u,h?r:void 0).after(()=>{b.isNumber(s)?s===g.seriesData.series[g.globals.maxValsInArrayIndex].length-2&&g.globals.shouldAnimate&&this.animationCompleted(t):"none"!==i&&g.globals.shouldAnimate&&(!g.globals.comboCharts&&e===g.seriesData.series.length-1||g.globals.comboCharts)&&this.animationCompleted(t),this.showDelayedElements()})}}class dt{constructor(t){this.w=t}getDefaultFilter(t,e){const s=this.w;t.unfilter&&t.unfilter(!0),s.config.chart.dropShadow.enabled&&this.dropShadow(t,s.config.chart.dropShadow,e)}applyFilter(t,e,s){var i,a,r;const o=this.w;if(t.unfilter&&t.unfilter(!0),"none"===s)return void this.getDefaultFilter(t,e);const n=o.config.chart.dropShadow,l="lighten"===s?2:.3;t.filterWith&&(t.filterWith(t=>{t.colorMatrix({type:"matrix",values:`\n ${l} 0 0 0 0\n 0 ${l} 0 0 0\n 0 0 ${l} 0 0\n 0 0 0 1 0\n `,in:"SourceGraphic",result:"brightness"}),n.enabled&&this.addShadow(t,e,n,"brightness")}),n.noUserSpaceOnUse||null==(a=null==(i=t.filterer())?void 0:i.node)||a.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(r=t.filterer())?void 0:r.node))}addShadow(t,e,s,i){var a;const r=this.w;let{blur:o,top:n,left:l,color:h,opacity:c}=s;if(h=Array.isArray(h)?h[e]:h,(null==(a=r.config.chart.dropShadow.enabledOnSeries)?void 0:a.length)>0&&-1===r.config.chart.dropShadow.enabledOnSeries.indexOf(e))return t;t.offset({in:i,dx:l,dy:n,result:"offset"}),t.gaussianBlur({in:"offset",stdDeviation:o,result:"blur"}),t.flood({"flood-color":h,"flood-opacity":c,result:"flood"}),t.composite({in:"flood",in2:"blur",operator:"in",result:"shadow"}),t.merge(["shadow",i])}dropShadow(t,e,s=0){var i,a,r,o,n;const l=this.w;return t.unfilter&&t.unfilter(!0),b.isMsEdge()&&"radialBar"===l.config.chart.type||(null==(i=l.config.chart.dropShadow.enabledOnSeries)?void 0:i.length)>0&&-1===(null==(a=l.config.chart.dropShadow.enabledOnSeries)?void 0:a.indexOf(s))||t.filterWith&&(t.filterWith(t=>{this.addShadow(t,s,e,"SourceGraphic")}),e.noUserSpaceOnUse||null==(o=null==(r=t.filterer())?void 0:r.node)||o.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(n=t.filterer())?void 0:n.node)),t}setSelectionFilter(t,e,s){const i=this.w;if(void 0!==i.interact.selectedDataPoints[e]&&i.interact.selectedDataPoints[e].indexOf(s)>-1){t.node.setAttribute("selected",!0);const s=i.config.states.active.filter;"none"!==s&&this.applyFilter(t,e,s.type)}}_scaleFilterSize(t){if(!t)return;(e=>{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.setAttribute(s,e[s])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}class gt{constructor(t,e=null){this.w=t,this.ctx=e}roundPathCorners(t,e){function s(t,e,s){var a=e.x-t.x,r=e.y-t.y,o=Math.sqrt(a*a+r*r);return i(t,e,Math.min(1,s/o))}function i(t,e,s){return{x:t.x+(e.x-t.x)*s,y:t.y+(e.y-t.y)*s}}function a(t,e){t.length>2&&(t[t.length-2]=e.x,t[t.length-1]=e.y)}function r(t){return{x:parseFloat(t[t.length-2]),y:parseFloat(t[t.length-1])}}t.indexOf("NaN")>-1&&(t="");var o=t.split(/[,\s]/).reduce(function(t,e){var s=e.match(/^([a-zA-Z])(.+)/);return s?(t.push(s[1]),t.push(s[2])):t.push(e),t},[]).reduce(function(t,e){return parseFloat(e)==e&&t.length?t[t.length-1].push(e):t.push([e]),t},[]),n=[];if(o.length>1){var l=r(o[0]),h=null;"Z"==o[o.length-1][0]&&o[0].length>2&&(h=["L",l.x,l.y],o[o.length-1]=h),n.push(o[0]);for(var c=1;c<o.length;c++){var d=n[n.length-1],g=o[c],p=g==h?o[1]:o[c+1];if(p&&d&&d.length>2&&"L"==g[0]&&p.length>2&&"L"==p[0]){var u,x,f=r(d),m=r(g),b=r(p);u=s(m,f,e),x=s(m,b,e),a(g,u),g.origPoint=m,n.push(g);var y=i(u,m,.5),w=i(m,x,.5),v=["C",y.x,y.y,w.x,w.y,x.x,x.y];v.origPoint=m,n.push(v)}else n.push(g)}if(h){var A=r(n[n.length-1]);n.push(["Z"]),a(n[0],A)}}else n=o;return n.reduce(function(t,e){return t+e.join(" ")+" "},"")}drawLine(t,e,s,i,a="#a8a8a8",r=0,o=null,n="butt"){return this.w.dom.Paper.line().attr({x1:t,y1:e,x2:s,y2:i,stroke:a,"stroke-dasharray":r,"stroke-width":o,"stroke-linecap":n})}drawRect(t=0,e=0,s=0,i=0,a=0,r="#fefefe",o=1,n=null,l=null,h=0){const c=this.w.dom.Paper.rect();return c.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,rx:a,ry:a,opacity:o,"stroke-width":null!==n?n:0,stroke:null!==l?l:"none","stroke-dasharray":h}),c.node.setAttribute("fill",r),c}drawPolygon(t,e="#e1e1e1",s=1,i="none"){return this.w.dom.Paper.polygon(t).attr({fill:i,stroke:e,"stroke-width":s})}drawCircle(t,e=null){t<0&&(t=0);const s=this.w.dom.Paper.circle(2*t);return null!==e&&s.attr(e),s}drawPath({d:t="",stroke:e="#a8a8a8",strokeWidth:s=1,fill:i,fillOpacity:a=1,strokeOpacity:r=1,classes:o,strokeLinecap:n=null,strokeDashArray:l=0}){const h=this.w;null===n&&(n=h.config.stroke.lineCap),(t.indexOf("undefined")>-1||t.indexOf("NaN")>-1)&&(t=`M 0 ${h.layout.gridHeight}`);return h.dom.Paper.path(t).attr({fill:i,"fill-opacity":a,stroke:e,"stroke-opacity":r,"stroke-linecap":n,"stroke-width":s,"stroke-dasharray":l,class:o})}group(t=null){const e=this.w.dom.Paper.group();return null!==t&&e.attr(t),e}move(t,e){return["M",t,e].join(" ")}line(t,e,s=null){return"H"===s?[" H",t].join(" "):"V"===s?[" V",e].join(" "):[" L",t,e].join(" ")}curve(t,e,s,i,a,r){return["C",t,e,s,i,a,r].join(" ")}quadraticCurve(t,e,s,i){return["Q",t,e,s,i].join(" ")}arc(t,e,s,i,a,r,o,n=!1){let l="A";n&&(l="a");return[l,t,e,s,i,a,r,o].join(" ")}renderPaths({j:t,realIndex:e,pathFrom:s,pathTo:i,pathToInterp:a,stroke:r,strokeWidth:o,strokeLinecap:h,fill:c,animationDelay:d,initialSpeed:g,dataChangeSpeed:p,className:u,chartType:x,shouldClipToGrid:f=!0,bindEventsOnPaths:m=!0,drawShadow:b=!0,drawMask:y=null,scrollMorph:w=!1}){var v,A;const C=this.w,S=new dt(this.w),k=new ct(this.w,null!=(v=this.ctx)?v:void 0),_=this.w.config.chart.animations.enabled,L=_&&this.w.config.chart.animations.dynamicAnimation.enabled;if(s&&s.startsWith("M 0 0 ")&&i){const t=i.match(/^M\s+[\d.-]+\s+[\d.-]+/);t&&(s=s.replace(/^M\s+0\s+0/,t[0]))}let D;const M=!!(_&&!C.globals.resized||L&&C.globals.dataChanged&&C.globals.shouldAnimate),E="string"==typeof u&&(u.indexOf("apexcharts-line")>-1||u.indexOf("apexcharts-area")>-1||u.indexOf("apexcharts-rangeArea")>-1||u.indexOf("apexcharts-radar")>-1),P=!(!_||C.globals.resized||C.globals.dataChanged||!E),F=null!=(A=C.config.chart.animations.largeDatasetThreshold)?A:0,T=!!(M&&!P&&F>0&&C.globals.dataPoints>F),I=!(!("candlestick"===x||"boxPlot"===x)||!M||P||!C.globals.dataChanged),X=T||I;!M||P||X?(D=i,M||(C.globals.animationEnded=!0)):D=s;const R=C.config.stroke.dashArray;let z=0;z=Array.isArray(R)?R[e]:C.config.stroke.dashArray;const B=this.drawPath({d:D,stroke:r,strokeWidth:o,fill:c,fillOpacity:1,classes:u,strokeLinecap:h,strokeDashArray:z});B.attr("index",e),f&&("bar"===x&&!C.globals.isBarHorizontal||C.globals.comboCharts?B.attr({"clip-path":`url(#gridRectBarMask${C.globals.cuid})`}):B.attr({"clip-path":`url(#gridRectMask${C.globals.cuid})`})),C.config.chart.dropShadow.enabled&&b&&S.dropShadow(B,C.config.chart.dropShadow,e),m&&(B.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,B)),B.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,B)),B.node.addEventListener("mousedown",this.pathMouseDown.bind(this,B))),B.attr({pathTo:i,pathFrom:s});const Y={el:B,j:t,realIndex:e,pathFrom:s,pathTo:i,pathToInterp:a,fill:c,strokeWidth:o,delay:d,scrollMorph:w};if(!_||C.globals.resized||C.globals.dataChanged)!C.globals.resized&&C.globals.dataChanged||X||k.showDelayedElements();else if(P){const s=2*g,i="none"===r||0===o,a=C.seriesData.series.length,n=!!C.globals.comboCharts||e===a-1;k.animateDraw(B,{realIndex:e,j:t,isFill:i,isLast:n,speed:s,delay:0,mask:y})}else X||k.animatePathsGradually(l(n({},Y),{speed:g}));return C.globals.dataChanged&&L&&M&&!X&&k.animatePathsGradually(l(n({},Y),{speed:p})),X&&k.revealBulk(B),B}drawPattern(t,e,s,i="#a8a8a8",a=0){return this.w.dom.Paper.pattern(e,s,r=>{"horizontalLines"===t?r.line(0,0,s,0).stroke({color:i,width:a+1}):"verticalLines"===t?r.line(0,0,0,e).stroke({color:i,width:a+1}):"slantedLines"===t?r.line(0,0,e,s).stroke({color:i,width:a}):"squares"===t?r.rect(e,s).fill("none").stroke({color:i,width:a}):"circles"===t&&r.circle(e).fill("none").stroke({color:i,width:a})})}drawGradient(t,e,s,i,a,r=null,o=null,n=[],l=0){const h=this.w;let c;e.length<9&&0===e.indexOf("#")&&(e=b.hexToRgba(e,i)),s.length<9&&0===s.indexOf("#")&&(s=b.hexToRgba(s,a));let d=0,g=1,p=1,u=null;null!==o&&(d=void 0!==o[0]?o[0]/100:0,g=void 0!==o[1]?o[1]/100:1,p=void 0!==o[2]?o[2]/100:1,u=void 0!==o[3]?o[3]/100:null);const x=!("donut"!==h.config.chart.type&&"pie"!==h.config.chart.type&&"polarArea"!==h.config.chart.type&&"bubble"!==h.config.chart.type);if(c=n&&0!==n.length?h.dom.Paper.gradient(x?"radial":"linear",t=>{(Array.isArray(n[l])?n[l]:n).forEach(e=>{t.stop(e.offset/100,e.color,e.opacity)})}):h.dom.Paper.gradient(x?"radial":"linear",t=>{t.stop(d,e,i),t.stop(g,s,a),t.stop(p,s,a),null!==u&&t.stop(u,e,i)}),x){const t=h.layout.gridWidth/2,e=h.layout.gridHeight/2;"bubble"!==h.config.chart.type?c.attr({gradientUnits:"userSpaceOnUse",cx:t,cy:e,r:r}):c.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else"vertical"===t?c.from(0,0).to(0,1):"diagonal"===t?c.from(0,0).to(1,1):"horizontal"===t?c.from(0,1).to(1,1):"diagonal2"===t&&c.from(1,0).to(0,1);return c}getTextBasedOnMaxWidth({text:t,maxWidth:e,fontSize:s,fontFamily:i}){const a=this.getTextRects(t,s,i,""),r=a.width/t.length,o=Math.floor(e/r);return e<a.width?t.slice(0,o-3)+"...":t}drawText({x:t,y:e,text:s,textAnchor:i,fontSize:a,fontFamily:r,fontWeight:o,foreColor:l,opacity:h,maxWidth:c,cssClass:d="",isPlainText:g=!0,dominantBaseline:p="auto"}){const u=this.w;void 0===s&&(s="");let x=s;i||(i="start"),l&&l.length||(l=u.config.chart.foreColor),r=r||u.config.chart.fontFamily,o=o||"regular";const f={maxWidth:c,fontSize:a=a||"11px",fontFamily:r};let m;return Array.isArray(s)?m=u.dom.Paper.text(t=>{for(let e=0;e<s.length;e++)x=s[e],c&&(x=this.getTextBasedOnMaxWidth(n({text:s[e]},f))),0===e?t.tspan(x):t.tspan(x).newLine()}):(c&&(x=this.getTextBasedOnMaxWidth(n({text:s},f))),m=g?u.dom.Paper.plain(s):u.dom.Paper.text(t=>t.tspan(x))),m.attr({x:t,y:e,"text-anchor":i,"dominant-baseline":p,"font-size":a,"font-family":r,"font-weight":o,fill:l,class:"apexcharts-text "+d}),m.node.style.fontFamily=r,m.node.style.opacity=h,m}getMarkerPath(t,e,s,i){let a="";switch(s){case"cross":a=`M ${t-(i/=1.4)} ${e-i} L ${t+i} ${e+i} M ${t-i} ${e+i} L ${t+i} ${e-i}`;break;case"plus":a=`M ${t-(i/=1.12)} ${e} L ${t+i} ${e} M ${t} ${e-i} L ${t} ${e+i}`;break;case"star":case"sparkle":{let r=5;i*=1.15,"sparkle"===s&&(i/=1.1,r=4);const o=Math.PI/r;for(let s=0;s<=2*r;s++){const r=s*o,n=s%2==0?i:i/2;a+=(0===s?"M":"L")+(t+n*Math.sin(r))+","+(e-n*Math.cos(r))}a+="Z";break}case"triangle":a=`M ${t} ${e-i} \n L ${t+i} ${e+i} \n L ${t-i} ${e+i} \n Z`;break;case"square":case"rect":a=`M ${t-(i/=1.125)} ${e-i} \n L ${t+i} ${e-i} \n L ${t+i} ${e+i} \n L ${t-i} ${e+i} \n Z`;break;case"diamond":a=`M ${t} ${e-(i*=1.05)} \n L ${t+i} ${e} \n L ${t} ${e+i} \n L ${t-i} ${e} \n Z`;break;case"line":a=`M ${t-(i/=1.1)} ${e} \n L ${t+i} ${e}`;break;default:a=`M ${t}, ${e} \n m -${(i*=2)/2}, 0 \n a ${i/2},${i/2} 0 1,0 ${i},0 \n a ${i/2},${i/2} 0 1,0 -${i},0`}return a}drawMarkerShape(t,e,s,i,a){const r=this.drawPath({d:this.getMarkerPath(t,e,s,i),stroke:a.pointStrokeColor,strokeDashArray:a.pointStrokeDashArray,strokeWidth:a.pointStrokeWidth,fill:a.pointFillColor,fillOpacity:a.pointFillOpacity,strokeOpacity:a.pointStrokeOpacity});return r.attr({cx:t,cy:e,shape:a.shape,class:a.class?a.class:""}),r}drawMarker(t,e,s){t=t||0;let i=s.pSize||0;return b.isNumber(e)||(i=0,e=0),this.drawMarkerShape(t,e,null==s?void 0:s.shape,i,n(n({},s),"line"===s.shape||"plus"===s.shape||"cross"===s.shape?{pointStrokeColor:s.pointFillColor,pointStrokeOpacity:s.pointFillOpacity}:{}))}pathMouseEnter(t,e){var s,i;const a=this.w,r=new dt(this.w),o=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);if(!(isNaN(o)||isNaN(n)||("function"==typeof a.config.chart.events.dataPointMouseEnter&&a.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}),gt._fireEvent(a,"dataPointMouseEnter",[e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}]),"none"!==a.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"===a.config.states.hover.filter.type||a.interact.isTouchDevice))){const e=a.config.states.hover.filter;r.applyFilter(t,o,e.type)}}pathMouseLeave(t,e){var s,i;const a=this.w,r=new dt(this.w),o=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);isNaN(o)||isNaN(n)||("function"==typeof a.config.chart.events.dataPointMouseLeave&&a.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}),gt._fireEvent(a,"dataPointMouseLeave",[e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}]),"none"!==a.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"!==a.config.states.hover.filter.type&&r.getDefaultFilter(t,o))}pathMouseDown(t,e){var s,i;const a=this.w,r=new dt(this.w),o=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);if(isNaN(o)||isNaN(n))return;const l=a.config.chart.link;if(!!(!l||"function"!=typeof l.dimension)){let e="false";if("true"===t.node.getAttribute("selected")){t.node.setAttribute("selected","false");const e=a.interact.selectedDataPoints[o].indexOf(n);e>-1&&a.interact.selectedDataPoints[o].splice(e,1)}else{if(!a.config.states.active.allowMultipleDataPointsSelection&&a.interact.selectedDataPoints.length>0){a.interact.selectedDataPoints=[];const t=a.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),e=a.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),s=t=>{Array.prototype.forEach.call(t,t=>{t.node.setAttribute("selected","false"),r.getDefaultFilter(t,o)})};s(t),s(e)}t.node.setAttribute("selected","true"),e="true",void 0===a.interact.selectedDataPoints[o]&&(a.interact.selectedDataPoints[o]=[]),a.interact.selectedDataPoints[o].push(n)}if("true"===e){const e=a.config.states.active.filter;if("none"!==e)r.applyFilter(t,o,e.type);else if("none"!==a.config.states.hover.filter&&!a.interact.isTouchDevice){const e=a.config.states.hover.filter;r.applyFilter(t,o,e.type)}}else if("none"!==a.config.states.active.filter.type)if("none"===a.config.states.hover.filter.type||a.interact.isTouchDevice)r.getDefaultFilter(t,o);else{const e=a.config.states.hover.filter;r.applyFilter(t,o,e.type)}}"function"==typeof a.config.chart.events.dataPointSelection&&a.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:o,dataPointIndex:n,w:a}),e&>._fireEvent(a,"dataPointSelection",[e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:o,dataPointIndex:n,w:a}])}rotateAroundCenter(t){let e={};t&&"function"==typeof t.getBBox&&(e=t.getBBox());return{x:e.x+e.width/2,y:e.y+e.height/2}}setupEventDelegation(t,e){let s=null;t.node.addEventListener("mouseover",i=>{const a=gt._findDelegateTarget(i.target,t.node,e);a&&a!==s&&(s&&s.instance&&this.pathMouseLeave(s.instance,i),s=a,a.instance&&this.pathMouseEnter(a.instance,i))}),t.node.addEventListener("mouseout",i=>{if(!s)return;(i.relatedTarget?gt._findDelegateTarget(i.relatedTarget,t.node,e):null)!==s&&(s&&s.instance&&this.pathMouseLeave(s.instance,i),s=null)}),t.node.addEventListener("mousedown",s=>{const i=gt._findDelegateTarget(s.target,t.node,e);i&&i.instance&&this.pathMouseDown(i.instance,s)})}static _fireEvent(t,e,s){const i=t.globals.events;if(!i||!Object.prototype.hasOwnProperty.call(i,e))return;const a=i[e];for(let t=0;t<a.length;t++)a[t].apply(null,s)}static _findDelegateTarget(t,e,s){for(;t&&t!==e&&t!==document;){if(t.matches&&t.matches(s))return t;t=t.parentNode}return null}static setAttrs(t,e){for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.setAttribute(s,e[s])}getTextRects(t,e,s,i,a=!0){const r=this.w,o=[t,e,s,i,a].join("\0"),n=r.globals.textRectsCache;if(n&&n.has(o))return n.get(o);const l=this.drawText({x:-200,y:-200,text:t,textAnchor:"start",fontSize:e,fontFamily:s,foreColor:"#fff",opacity:0});i&&l.attr("transform",i),r.dom.Paper.add(l);let h=l.bbox();const c=h.y;a||(h=l.node.getBoundingClientRect()),l.remove();const d={width:h.width,height:h.height,centerOffset:a?c+h.height/2- -200:0};return n&&n.set(o,d),d}placeTextWithEllipsis(t,e,s){if("function"==typeof t.getComputedTextLength&&(t.textContent=e,e.length>0&&t.getComputedTextLength()>=s/1.1)){for(let i=e.length-3;i>0;i-=3)if(t.getSubStringLength(0,i)<=s/1.1)return void(t.textContent=e.substring(0,i)+"...");t.textContent="."}}}class pt{constructor(t){this.w=t,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}clippedImgArea(t){const e=this.w,s=e.config,i=parseInt(String(e.layout.gridWidth),10),a=parseInt(String(e.layout.gridHeight),10),r=i>a?i:a,o=t.image;let n=0,l=0;void 0===t.width&&void 0===t.height?void 0!==s.fill.image.width&&void 0!==s.fill.image.height?(n=s.fill.image.width+1,l=s.fill.image.height):(n=r+1,l=r):(n=t.width,l=t.height);const h=m.createElementNS(F,"pattern");gt.setAttrs(h,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:n+"px",height:l+"px"});const d=m.createElementNS(F,"image");h.appendChild(d);const g=c.isBrowser()?window.SVG:global.SVG;d.setAttributeNS(g.xlink,"href",o),gt.setAttrs(d,{x:0,y:0,preserveAspectRatio:"none",width:n+"px",height:l+"px"}),d.style.opacity=t.opacity,e.dom.elDefs.node.appendChild(h)}getSeriesIndex(t){const e=this.w,s=e.config.chart.type;return("bar"===s||"rangeBar"===s)&&e.config.plotOptions.bar.distributed||"heatmap"===s||"treemap"===s?this.seriesIndex=t.seriesNumber:this.seriesIndex=t.seriesNumber%e.seriesData.series.length,this.seriesIndex}computeColorStops(t,e){const s=this.w;let i=null,a=null;for(const s of t)s>=e.threshold?(null===i||s>i)&&(i=s):(null===a||s<a)&&(a=s);null===i&&(i=e.threshold),null===a&&(a=e.threshold);let r=i-e.threshold+(e.threshold-a);0===r&&(r=1);let o=100-(e.threshold-a)/r*100;return o=Math.max(0,Math.min(o,100)),[{offset:o,color:e.colorAboveThreshold,opacity:s.config.fill.opacity},{offset:0,color:e.colorBelowThreshold,opacity:s.config.fill.opacity}]}fillPath(t){var e,s,i,a;const r=this.w;this.opts=t;const o=this.w.config;let n,l,h;this.seriesIndex=this.getSeriesIndex(t);const c=o.plotOptions.line.colors.colorAboveThreshold&&o.plotOptions.line.colors.colorBelowThreshold;let d=this.getFillColors()[this.seriesIndex];void 0!==r.seriesData.seriesColors[this.seriesIndex]&&(d=r.seriesData.seriesColors[this.seriesIndex]),"function"==typeof d&&(d=d({seriesIndex:this.seriesIndex,dataPointIndex:t.dataPointIndex,value:t.value,w:r}));const g=t.fillType?t.fillType:this.getFillType(this.seriesIndex);let p=Array.isArray(o.fill.opacity)?o.fill.opacity[this.seriesIndex]:o.fill.opacity;const u="gradient"===g||c;t.color&&(d=t.color);const x=r.config.series[this.seriesIndex];(null==(s=null==(e=null==x?void 0:x.data)?void 0:e[t.dataPointIndex])?void 0:s.fillColor)&&(d=null==(a=null==(i=null==x?void 0:x.data)?void 0:i[t.dataPointIndex])?void 0:a.fillColor),d||(d="#fff"),void 0!==t.opacity&&null!==t.opacity&&(p=t.opacity);let f=d;b.isCSSVariable(d)?f=b.applyOpacityToColor(d,p):-1===d.indexOf("rgb")?-1===d.indexOf("#")?f=d:d.length<9&&(f=b.hexToRgba(d,p)):d.indexOf("rgba")>-1?p=b.getOpacityFromRGBA(d):f=b.hexToRgba(b.rgb2hex(d),p);const m=b.isCSSVariable(d)?b.getThemeColor(d):d;if("pattern"===g&&(l=this.handlePatternFill({fillConfig:t.fillConfig,patternFill:l,fillColor:m,defaultColor:f})),u){const e=o.fill.gradient.colorStops?[...o.fill.gradient.colorStops]:[];let s=o.fill.gradient.type;c&&(e[this.seriesIndex]=this.computeColorStops(r.seriesData.series[this.seriesIndex],o.plotOptions.line.colors),s="vertical"),h=this.handleGradientFill({type:s,fillConfig:t.fillConfig,fillColor:m,fillOpacity:p,colorStops:e,i:this.seriesIndex})}if("image"===g){const e=o.fill.image.src,s=t.patternID?t.patternID:"",i=`pattern${r.globals.cuid}${t.seriesNumber+1}${s}`;-1===this.patternIDs.indexOf(i)&&(this.clippedImgArea({opacity:p,image:Array.isArray(e)?t.seriesNumber<e.length?e[t.seriesNumber]:e[0]:e,width:t.width?t.width:void 0,height:t.height?t.height:void 0,patternUnits:t.patternUnits,patternID:i}),this.patternIDs.push(i)),n=`url(#${i})`}else n=u?h:"pattern"===g?l:f;return t.solid&&(n=f),n}getFillType(t){const e=this.w;return Array.isArray(e.config.fill.type)?e.config.fill.type[t]:e.config.fill.type}getFillColors(){const t=this.w,e=t.config,s=this.opts;let i=[];return t.globals.comboCharts?"line"===t.config.series[this.seriesIndex].type?Array.isArray(t.globals.stroke.colors)?i=t.globals.stroke.colors:i.push(t.globals.stroke.colors):Array.isArray(t.globals.fill.colors)?i=t.globals.fill.colors:i.push(t.globals.fill.colors):"line"===e.chart.type?Array.isArray(t.globals.stroke.colors)?i=t.globals.stroke.colors:i.push(t.globals.stroke.colors):Array.isArray(t.globals.fill.colors)?i=t.globals.fill.colors:i.push(t.globals.fill.colors),void 0!==s.fillColors&&(i=[],Array.isArray(s.fillColors)?i=s.fillColors.slice():i.push(s.fillColors)),i}handlePatternFill({fillConfig:t,patternFill:e,fillColor:s,defaultColor:i}){let a=this.w.config.fill;t&&(a=t);const r=this.opts,o=new gt(this.w),n=Array.isArray(a.pattern.strokeWidth)?a.pattern.strokeWidth[this.seriesIndex]:a.pattern.strokeWidth,l=s;if(Array.isArray(a.pattern.style))if(void 0!==a.pattern.style[r.seriesNumber]){e=o.drawPattern(a.pattern.style[r.seriesNumber],a.pattern.width,a.pattern.height,l,n)}else e=i;else e=o.drawPattern(a.pattern.style,a.pattern.width,a.pattern.height,l,n);return e}handleGradientFill({type:t,fillColor:e,fillOpacity:s,fillConfig:i,colorStops:a,i:r}){let o=this.w.config.fill;i&&(o=n(n({},o),i));const l=this.opts,h=new gt(this.w),c=new b;t=t||o.gradient.type;let d,g=e,p=void 0===o.gradient.opacityFrom?s:Array.isArray(o.gradient.opacityFrom)?o.gradient.opacityFrom[r]:o.gradient.opacityFrom;g.indexOf("rgba")>-1&&(p=b.getOpacityFromRGBA(g));let u=void 0===o.gradient.opacityTo?s:Array.isArray(o.gradient.opacityTo)?o.gradient.opacityTo[r]:o.gradient.opacityTo;if(void 0===o.gradient.gradientToColors||0===o.gradient.gradientToColors.length)d="dark"===o.gradient.shade?c.shadeColor(-1*parseFloat(o.gradient.shadeIntensity),e.indexOf("rgb")>-1?b.rgb2hex(e):e):c.shadeColor(parseFloat(o.gradient.shadeIntensity),e.indexOf("rgb")>-1?b.rgb2hex(e):e);else if(o.gradient.gradientToColors[l.seriesNumber]){const t=o.gradient.gradientToColors[l.seriesNumber];d=t,t.indexOf("rgba")>-1&&(u=b.getOpacityFromRGBA(t))}else d=e;if(o.gradient.gradientFrom&&(g=o.gradient.gradientFrom),o.gradient.gradientTo&&(d=o.gradient.gradientTo),o.gradient.inverseColors){const t=g;g=d,d=t}return g.indexOf("rgb")>-1&&(g=b.rgb2hex(g)),d.indexOf("rgb")>-1&&(d=b.rgb2hex(d)),h.drawGradient(t,g,d,p,u,l.size,o.gradient.stops,a,r)}}const ut=["none","lighten","darken"];function xt(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}function ft(t){var e,s;const i=t.config.fill&&t.config.fill.type,a=t=>"pattern"===t||"image"===t||"gradient"===t;if(Array.isArray(i)?i.some(a):a(i))return!0;const r=null==(s=null==(e=t.config.plotOptions)?void 0:e.line)?void 0:s.colors;if(r&&r.colorAboveThreshold&&r.colorBelowThreshold)return!0;const o=t.config.states||{},n=o.hover&&o.hover.filter&&o.hover.filter.type,l=o.active&&o.active.filter&&o.active.filter.type;return!(!n||ut.includes(n))||!(!l||ut.includes(l))}class mt{constructor(t,e){this.w=t,this.ctx=e,this._filters=new dt(this.w),this._graphics=new gt(this.w,this.ctx)}setGlobalMarkerSize(){const t=this.w;if(t.globals.markers.size=Array.isArray(t.config.markers.size)?t.config.markers.size:[t.config.markers.size],t.globals.markers.size.length>0){if(t.globals.markers.size.length<t.seriesData.series.length+1)for(let e=0;e<=t.seriesData.series.length;e++)void 0===t.globals.markers.size[e]&&t.globals.markers.size.push(t.globals.markers.size[0])}else t.globals.markers.size=t.config.series.map(()=>t.config.markers.size)}plotChartMarkers({pointsPos:t,seriesIndex:e,j:s,pSize:i,alwaysDrawMarker:a=!1,isVirtualPoint:r=!1}){const o=this.w,n=e,l=t;let h=null;const c=new gt(this.w),d=xt(this.ctx,c),g=o.config.markers.discrete&&o.config.markers.discrete.length;if(Array.isArray(l.x))for(let t=0;t<l.x.length;t++){let c,p=s,u=!b.isNumber(l.y[t]);0===o.globals.markers.largestSize&&o.globals.hasNullValues&&null!==o.seriesData.series[n][s+1]&&!r&&(u=!0),1===s&&0===t&&(p=0),1===s&&1===t&&(p=1);let x="apexcharts-marker";"line"!==o.config.chart.type&&"area"!==o.config.chart.type||o.globals.comboCharts||o.config.tooltip.intersect||(x+=" no-pointer-events");if((Array.isArray(o.config.markers.size)?o.globals.markers.size[e]>0:o.config.markers.size>0)||a||g){"canvas"===d.kind&&(void 0===o.globals.pointsArray[e]&&(o.globals.pointsArray[e]=[]),o.globals.pointsArray[e][p]=[l.x[t],l.y[t]]),u||(x+=` w${b.randomId()}`);const s=this.getMarkerConfig({cssClass:x,seriesIndex:e,dataPointIndex:p}),r=o.config.series[n];if(r.data[p]&&(r.data[p].fillColor&&(s.pointFillColor=r.data[p].fillColor),r.data[p].strokeColor&&(s.pointStrokeColor=r.data[p].strokeColor)),void 0!==i&&(s.pSize=i),(l.x[t]<-o.globals.markers.largestSize||l.x[t]>o.layout.gridWidth+o.globals.markers.largestSize||l.y[t]<-o.globals.markers.largestSize||l.y[t]>o.layout.gridHeight+o.globals.markers.largestSize)&&(s.pSize=0),!u){(o.globals.markers.size[e]>0||a||g)&&!h&&(h=d.group({class:a||g?"":"apexcharts-series-markers"}),h.attr("clip-path",`url(#gridRectMarkerMask${o.globals.cuid})`),this.setupMarkerDelegation(h)),c=d.drawMarker(l.x[t],l.y[t],s),c.attr("rel",p),c.attr("j",p),c.attr("index",e),c.node.setAttribute("default-marker-size",s.pSize),nt(c,l.x[t],o),this._filters.setSelectionFilter(c,e,p),h&&h.add(c)}}else void 0===o.globals.pointsArray[e]&&(o.globals.pointsArray[e]=[]),o.globals.pointsArray[e].push([l.x[t],l.y[t]])}return h}getMarkerConfig({cssClass:t,seriesIndex:e,dataPointIndex:s=null,radius:i=null,size:a=null,strokeWidth:r=null}){const o=this.w,n=this.getMarkerStyle(e);let l=null===a?o.globals.markers.size[e]:a;const h=o.config.markers;return null!==s&&h.discrete.length&&h.discrete.map(t=>{t.seriesIndex===e&&t.dataPointIndex===s&&(n.pointStrokeColor=t.strokeColor,n.pointFillColor=t.fillColor,l=t.size,n.pointShape=t.shape)}),{pSize:null===i?l:i,pRadius:null!==i?i:h.radius,pointStrokeWidth:null!==r?r:Array.isArray(h.strokeWidth)?h.strokeWidth[e]:h.strokeWidth,pointStrokeColor:n.pointStrokeColor,pointFillColor:n.pointFillColor,shape:n.pointShape||(Array.isArray(h.shape)?h.shape[e]:h.shape),class:t,pointStrokeOpacity:Array.isArray(h.strokeOpacity)?h.strokeOpacity[e]:h.strokeOpacity,pointStrokeDashArray:Array.isArray(h.strokeDashArray)?h.strokeDashArray[e]:h.strokeDashArray,pointFillOpacity:Array.isArray(h.fillOpacity)?h.fillOpacity[e]:h.fillOpacity,seriesIndex:e}}setupMarkerDelegation(t){const e=this.w,s=".apexcharts-marker";this._graphics.setupEventDelegation(t,s),t.node.addEventListener("click",i=>{if(e.config.markers.onClick){gt._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onClick(i)}}),t.node.addEventListener("dblclick",i=>{if(e.config.markers.onDblClick){gt._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onDblClick(i)}}),t.node.addEventListener("touchstart",e=>{const i=gt._findDelegateTarget(e.target,t.node,s);i&&i.instance&&this._graphics.pathMouseDown(i.instance,e)},{passive:!0})}addEvents(t){const e=this.w;t.node.addEventListener("mouseenter",this._graphics.pathMouseEnter.bind(this.ctx,t)),t.node.addEventListener("mouseleave",this._graphics.pathMouseLeave.bind(this.ctx,t)),t.node.addEventListener("mousedown",this._graphics.pathMouseDown.bind(this.ctx,t)),t.node.addEventListener("click",e.config.markers.onClick),t.node.addEventListener("dblclick",e.config.markers.onDblClick),t.node.addEventListener("touchstart",this._graphics.pathMouseDown.bind(this.ctx,t),{passive:!0})}getMarkerStyle(t){const e=this.w,s=e.globals.markers.colors,i=e.config.markers.strokeColor||e.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(i)?i[t]:i,pointFillColor:Array.isArray(s)?s[t]:s}}}class bt{constructor(t,e){this.ctx=e,this.w=t,this.initialAnim=this.w.config.chart.animations.enabled,this.anim=new ct(this.w),this.filters=new dt(this.w),this.fill=new pt(this.w),this.markers=new mt(this.w,this.ctx),this.graphics=new gt(this.w)}draw(t,e,s){const i=this.w,a=this.graphics,r=xt(this.ctx,a),o=s.realIndex,n=s.pointsPos,l=s.zRatio,h=s.elParent,c=r.group({class:`apexcharts-series-markers apexcharts-series-${i.config.chart.type}`});if(c.attr("clip-path",`url(#gridRectMarkerMask${i.globals.cuid})`),this.markers.setupMarkerDelegation(c),Array.isArray(n.x))for(let t=0;t<n.x.length;t++){let s=e+1,a=!0;0===e&&0===t&&(s=0),0===e&&1===t&&(s=1);let d=i.globals.markers.size[o];if(l!==1/0){const t=i.config.plotOptions.bubble;d=i.seriesData.seriesZ[o][s],t.zScaling&&(d/=l),t.minBubbleRadius&&d<t.minBubbleRadius&&(d=t.minBubbleRadius),t.maxBubbleRadius&&d>t.maxBubbleRadius&&(d=t.maxBubbleRadius)}const g=n.x[t],p=n.y[t];if(d=d||0,null!==p&&void 0!==i.seriesData.series[o][s]||(a=!1),a){const t=this.drawPoint(g,p,d,o,s,e);c.add(t),"canvas"===r.kind&&(void 0===i.globals.pointsArray[o]&&(i.globals.pointsArray[o]=[]),i.globals.pointsArray[o][s]=[g,p])}h.add(c)}}drawPoint(t,e,s,i,a,r){var o,n;const l=this.w,h=i,c=this.anim,d=this.filters,g=this.fill,p=this.markers,u=this.graphics,x=xt(this.ctx,u),f=p.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:h,dataPointIndex:a,radius:"bubble"===l.config.chart.type||l.globals.comboCharts&&l.config.series[i]&&"bubble"===l.config.series[i].type?s:null});let m=g.fillPath({seriesNumber:i,dataPointIndex:a,color:f.pointFillColor,patternUnits:"objectBoundingBox",value:l.seriesData.series[i][r]});const b=x.drawMarker(t,e,f),y=l.config.series[h];y.data[a]&&y.data[a].fillColor&&(m=y.data[a].fillColor);const w=null==(o=l.config.plotOptions.scatter)?void 0:o.jitter;if((null==w?void 0:w.enabled)&&w.distributed&&l.globals.colors.length){const t=Math.round(null==(n=l.seriesData.seriesX[i])?void 0:n[a]);isNaN(t)||(m=l.globals.colors[t%l.globals.colors.length])}if(b.attr({fill:m}),l.config.chart.dropShadow.enabled){const t=l.config.chart.dropShadow;d.dropShadow(b,t,i)}if(!this.initialAnim||l.globals.dataChanged||l.globals.resized)l.globals.animationEnded=!0;else{const t=l.config.chart.animations,e=t.speed,s=l.globals.dataPoints||1,i=t.animateGradually,r=i&&!1!==i.enabled?Math.min(20,.5*e/Math.max(1,s)):0,o=ht({style:r>0?"sequential":"none",index:a,baseDelay:r});c.animatePop(b,{speed:e,delay:o,onComplete:()=>c.animationCompleted(b)})}return b.attr({rel:a,j:a,index:i,"default-marker-size":f.pSize}),d.setSelectionFilter(b,i,a),b.node.classList.add("apexcharts-marker"),b}centerTextInBubble(t){const e=this.w;return{y:t+=parseInt(e.config.dataLabels.style.fontSize,10)/4}}}class yt{constructor(t,e=null){this.w=t,this.ctx=e}dataLabelsCorrection(t,e,s,i,a,r,o){const n=this.w;let l=!1;const h=new gt(this.w).getTextRects(s,o),c=h.width,d=h.height;e<0&&(e=0),e>n.layout.gridHeight+d&&(e=n.layout.gridHeight+d/2),void 0===n.globals.dataLabelsRects[i]&&(n.globals.dataLabelsRects[i]=[]),n.globals.dataLabelsRects[i].push({x:t,y:e,width:c,height:d});const g=n.globals.dataLabelsRects[i].length-2,p=void 0!==n.globals.lastDrawnDataLabelsIndexes[i]?n.globals.lastDrawnDataLabelsIndexes[i][n.globals.lastDrawnDataLabelsIndexes[i].length-1]:0;if(void 0!==n.globals.dataLabelsRects[i][g]){const s=n.globals.dataLabelsRects[i][p];(t>s.x+s.width||e>s.y+s.height||e+d<s.y||t+c<s.x)&&(l=!0)}return(0===a||r)&&(l=!0),{x:t,y:e,textRects:h,drawnextLabel:l}}drawDataLabel({type:t,pos:e,i:s,j:i,isRangeStart:a,strokeWidth:r=2}){const o=this.w,n=new gt(this.w),l=o.config.dataLabels;let h=0,c=0,d=i,g=null;if(-1!==o.globals.collapsedSeriesIndices.indexOf(s)||!l.enabled||!Array.isArray(e.x))return g;g=n.group({class:"apexcharts-data-labels"});for(let n=0;n<e.x.length;n++)if(h=e.x[n]+l.offsetX,c=e.y[n]+l.offsetY+r,!isNaN(h)){1===i&&0===n&&(d=0),1===i&&1===n&&(d=1);let r=o.seriesData.series[s][d];"rangeArea"===t&&(r=a?o.rangeData.seriesRangeStart[s][d]:o.rangeData.seriesRangeEnd[s][d]);let l="";const p=t=>o.config.dataLabels.formatter(t,{seriesIndex:s,dataPointIndex:d,w:o});if("bubble"===o.config.chart.type){r=o.seriesData.seriesZ[s][d],l=p(r),c=e.y[n];c=new bt(this.w,this.ctx).centerTextInBubble(c).y}else void 0!==r&&(l=p(r));let u=o.config.dataLabels.textAnchor;o.globals.isSlopeChart&&(u=0===d?"end":d===o.config.series[s].data.length-1?"start":"middle"),this.plotDataLabelsText({x:h,y:c,text:l,i:s,j:d,parent:g,offsetCorrection:!0,dataLabelsConfig:o.config.dataLabels,textAnchor:u})}return g}plotDataLabelsText(t){const e=this.w,s=new gt(this.w);let{x:i,y:a,i:r,j:o,text:n,textAnchor:l,fontSize:h,parent:c,dataLabelsConfig:d,color:g,alwaysDrawDataLabel:p,offsetCorrection:u,className:x}=t,f=null;if(Array.isArray(e.config.dataLabels.enabledOnSeries)&&e.config.dataLabels.enabledOnSeries.indexOf(r)<0)return f;let m={x:i,y:a,drawnextLabel:!0,textRects:null};if(u&&(m=this.dataLabelsCorrection(i,a,n,r,o,p,parseInt(d.style.fontSize,10).toString())),e.interact.zoomed||(i=m.x,a=m.y),m.textRects){const t=e.globals.barPadForNumericAxis||0;(i<-(t+20)-m.textRects.width||i>e.layout.gridWidth+m.textRects.width+t+30)&&(n="")}let b=e.globals.dataLabels.style.colors[r];(("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||e.config.dataLabels.distributed)&&(b=e.globals.dataLabels.style.colors[o]),"function"==typeof b&&(b=b({series:e.seriesData.series,seriesIndex:r,dataPointIndex:o,w:e})),g&&(b=g);let y=d.offsetX,w=d.offsetY;if("bar"!==e.config.chart.type&&"rangeBar"!==e.config.chart.type||(y=0,w=0),e.globals.isSlopeChart&&(0!==o&&(y=-2*d.offsetX+5),0!==o&&o!==e.config.series[r].data.length-1&&(y=0)),m.drawnextLabel){if("middle"===l&&i===e.layout.gridWidth&&(l="end"),f=s.drawText({x:i+y,y:a+w,foreColor:b,textAnchor:l||d.textAnchor,text:n,fontSize:h||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||"normal"}),f.attr({class:x||"apexcharts-datalabel",cx:i,cy:a}),d.dropShadow.enabled){const t=d.dropShadow;new dt(this.w).dropShadow(f,t)}c.add(f),nt(f,i,e),void 0===e.globals.lastDrawnDataLabelsIndexes[r]&&(e.globals.lastDrawnDataLabelsIndexes[r]=[]),e.globals.lastDrawnDataLabelsIndexes[r].push(o)}return f}addBackgroundToDataLabel(t,e){const s=this.w,i=s.config.dataLabels.background,a=i.padding,r=i.padding/2,o=e.width,n=e.height,l=new gt(this.w).drawRect(e.x-a,e.y-r/2,o+2*a,n+r,i.borderRadius,"transparent"!==s.config.chart.background&&s.config.chart.background?s.config.chart.background:"#fff",i.opacity,i.borderWidth,i.borderColor);if(i.dropShadow.enabled){new dt(this.w).dropShadow(l,i.dropShadow)}return l}dataLabelsBackground(){var t;const e=this.w;if("bubble"===e.config.chart.type)return;const s=e.dom.baseEl.querySelectorAll(".apexcharts-datalabels text");for(let i=0;i<s.length;i++){const a=s[i],r=a.getBBox();let o=null;if(r.width&&r.height&&(o=this.addBackgroundToDataLabel(a,r)),o){null==(t=a.parentNode)||t.insertBefore(o.node,a);const s=e.config.dataLabels.background.backgroundColor||a.getAttribute("fill");e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged?o.animate().attr({fill:s}):o.attr({fill:s}),a.setAttribute("fill",e.config.dataLabels.background.foreColor);const i=a.getAttribute("cx");null!==i&&nt(o,parseFloat(i),e)}}}bringForward(){const t=this.w,e=t.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),s=t.dom.baseEl.querySelector(".apexcharts-plot-series:last-child");for(let t=0;t<e.length;t++)s&&s.insertBefore(e[t],s.nextSibling)}}class wt{static invalidateAll(t){t&&t.globals&&(t.globals.cachedSelectors&&(t.globals.cachedSelectors={}),t.globals.domCache&&t.globals.domCache.clear(),t.globals.dimensionCache={})}static invalidateDimensions(t){t&&t.globals&&(t.globals.dimensionCache={})}static invalidateSelectors(t){t&&t.globals&&t.globals.cachedSelectors&&(t.globals.cachedSelectors={})}static getCachedSelector(t,e,s){return t&&t.globals?(t.globals.cachedSelectors||(t.globals.cachedSelectors={}),t.globals.cachedSelectors[e]||(t.globals.cachedSelectors[e]=s()),t.globals.cachedSelectors[e]):s()}static getCachedDimension(t,e,s,i=1e3){if(!t||!t.globals)return s();t.globals.dimensionCache||(t.globals.dimensionCache={});const a=t.globals.dimensionCache[e],r=Date.now();if(a&&a.lastUpdate&&r-a.lastUpdate<i)return a.value;const o=s();return t.globals.dimensionCache[e]={value:o,lastUpdate:r},o}static cacheDOMElement(t,e,s){t&&t.globals&&(t.globals.domCache||(t.globals.domCache=new Map),t.globals.domCache.set(e,s))}static getCachedDOMElement(t,e){return t&&t.globals&&t.globals.domCache&&t.globals.domCache.get(e)||null}}class vt{constructor(t,{theme:e=null,timeScale:s=null}={}){this.w=t,this.theme=e,this.timeScale=s}getLabel(t,e,s,i,a=[],r="12px",o=!0){const n=this.w,l=void 0===t[i]?"":t[i];let h=l;const c=n.formatters.xLabelFormatter,d=n.config.xaxis.labels.formatter,g=new w(this.w),p=l;o&&(h=g.xLabelFormat(c,l,p,{i:i,dateFormatter:new y(this.w).formatDate,w:n}),void 0!==d&&(h=d(l,t[i],{i:i,dateFormatter:new y(this.w).formatDate,w:n}))),e.length>0?(s=e[i].position,h=e[i].value):"datetime"===n.config.xaxis.type&&void 0===d&&(h=""),void 0===h&&(h=""),h=Array.isArray(h)?h:h.toString();const u=new gt(this.w);let x={};x=n.layout.rotateXLabels&&o?u.getTextRects(h,parseInt(r,10).toString(),null,`rotate(${n.config.xaxis.labels.rotate} 0 0)`,!1):u.getTextRects(h,parseInt(r,10).toString());const f=!n.config.xaxis.labels.showDuplicates&&this.timeScale;return!Array.isArray(h)&&("NaN"===String(h)||a.indexOf(h)>=0&&f)&&(h=""),{x:s,text:h,textRect:x}}checkLabelBasedOnTickamount(t,e,s){const i=this.w;let a=i.config.xaxis.tickAmount;if("dataPoints"===a&&(a=Math.round(i.layout.gridWidth/120)),a>s)return e;return t%Math.round(s/(a+1))===0||(e.text=""),e}checkForOverflowingLabels(t,e,s,i,a){const r=this.w;if(0===t&&r.globals.skipFirstTimelinelabel&&(e.text=""),t===s-1&&r.globals.skipLastTimelinelabel&&(e.text=""),r.config.xaxis.labels.hideOverlappingLabels&&i.length>0){const t=a[a.length-1];if(r.config.xaxis.labels.trim&&"datetime"!==r.config.xaxis.type)return e;e.x<t.textRect.width/(r.layout.rotateXLabels?Math.abs(r.config.xaxis.labels.rotate)/12:1.01)+t.x&&(e.text="")}return e}checkForReversedLabels(t,e){const s=this.w;return s.config.yaxis[t]&&s.config.yaxis[t].reversed&&e.reverse(),e}yAxisAllSeriesCollapsed(t){const e=this.w.globals;return!e.seriesYAxisMap[t].some(t=>-1===e.collapsedSeriesIndices.indexOf(t))}translateYAxisIndex(t){const e=this.w,s=e.globals,i=e.config.yaxis;return e.seriesData.series.length>i.length||i.some(t=>Array.isArray(t.seriesName))?t:s.seriesYAxisReverseMap[t]}isYAxisHidden(t){const e=this.w,s=e.config.yaxis[t];if(!s.show||this.yAxisAllSeriesCollapsed(t))return!0;if(!s.showForNullSeries){const s=e.globals.seriesYAxisMap[t],i=new P(this.w);return s.every(t=>i.isSeriesNull(t))}return!1}getYAxisForeColor(t,e){var s;const i=this.w;return Array.isArray(t)&&i.globals.yAxisScale[e]&&(null==(s=this.theme)||s.pushExtraColors(t,i.globals.yAxisScale[e].result.length,!1)),t}drawYAxisTicks(t,e,s,i,a,r,o){const n=this.w,l=new gt(this.w);let h=n.layout.translateY+n.config.yaxis[a].labels.offsetY;if(n.globals.isBarHorizontal?h=0:"heatmap"===n.config.chart.type&&(h+=r/2),i.show&&e>0){!0===n.config.yaxis[a].opposite&&(t+=i.width);for(let a=e;a>=0;a--){const e=l.drawLine(t+s.offsetX-i.width+i.offsetX,h+i.offsetY,t+s.offsetX+i.offsetX,h+i.offsetY,i.color);o.add(e),h+=r}}}}class At{constructor(t,e,s){this.w=t,this.ctx=e,this.elgrid=s,this.axesUtils=new vt(t,{theme:e.theme,timeScale:e.timeScale}),this.xaxisLabels=t.labelData.labels.slice(),t.labelData.timescaleLabels.length>0&&!t.globals.isBarHorizontal&&(this.xaxisLabels=t.labelData.timescaleLabels.slice()),t.config.xaxis.overwriteCategories&&(this.xaxisLabels=t.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===t.config.xaxis.position?this.offY=0:this.offY=t.layout.gridHeight,this.offY=this.offY+t.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===t.config.chart.type&&t.config.plotOptions.bar.horizontal,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.xaxisBorderWidth=t.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=t.config.yaxis[0].axisBorder.width.toString()),String(this.xaxisBorderWidth).indexOf("%")>-1?this.xaxisBorderWidth=t.layout.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=t.config.xaxis.axisBorder.height,this.yaxis=t.config.yaxis[0]}drawXaxis(){const t=this.w,e=new gt(this.w),s=e.group({class:"apexcharts-xaxis",transform:`translate(${t.config.xaxis.offsetX}, ${t.config.xaxis.offsetY})`}),i=e.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${t.layout.translateXAxisX}, ${t.layout.translateXAxisY})`});s.add(i);let a=[];for(let t=0;t<this.xaxisLabels.length;t++)a.push(this.xaxisLabels[t]);if(this.drawXAxisLabelAndGroup(!0,e,i,a,t.axisFlags.isXNumeric,(t,e)=>e),t.labelData.hasXaxisGroups){const s=t.labelData.groups;a=[];for(let t=0;t<s.length;t++)a.push(s[t].title);const r={};t.config.xaxis.group.style&&(r.xaxisFontSize=t.config.xaxis.group.style.fontSize,r.xaxisFontFamily=t.config.xaxis.group.style.fontFamily,r.xaxisForeColors=t.config.xaxis.group.style.colors,r.fontWeight=t.config.xaxis.group.style.fontWeight,r.cssClass=t.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,e,i,a,!1,(t,e)=>s[t].cols*e,r)}if(void 0!==t.config.xaxis.title.text){const i=e.group({class:"apexcharts-xaxis-title"}),a=e.drawText({x:t.layout.gridWidth/2+t.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+("bottom"===t.config.xaxis.position?t.layout.xAxisLabelsHeight:-t.layout.xAxisLabelsHeight-10)+t.config.xaxis.title.offsetY,text:t.config.xaxis.title.text,textAnchor:"middle",fontSize:t.config.xaxis.title.style.fontSize,fontFamily:t.config.xaxis.title.style.fontFamily,fontWeight:t.config.xaxis.title.style.fontWeight,foreColor:t.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+t.config.xaxis.title.style.cssClass});i.add(a),s.add(i)}if(t.config.xaxis.axisBorder.show){const i=t.globals.barPadForNumericAxis,a=e.drawLine(t.globals.padHorizontal+t.config.xaxis.axisBorder.offsetX-i,this.offY,this.xaxisBorderWidth+i,this.offY,t.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&t.config.grid.show?this.elgrid.elGridBorders.add(a):s.add(a)}return s}drawXAxisLabelAndGroup(t,e,s,i,a,r,o={}){var n,l;const h=[],c=[],d=this.w,g=o.xaxisFontSize||this.xaxisFontSize,p=o.xaxisFontFamily||this.xaxisFontFamily,u=o.xaxisForeColors||this.xaxisForeColors,x=o.fontWeight||d.config.xaxis.labels.style.fontWeight,f=o.cssClass||d.config.xaxis.labels.style.cssClass;let b,y=d.globals.padHorizontal;const w=i.length;let v="category"===d.config.xaxis.type?d.globals.dataPoints:w;if(0===v&&w>v&&(v=w),a){const t=Math.max(Number(d.config.xaxis.tickAmount)||1,v>1?v-1:v);b=d.layout.gridWidth/Math.min(t,w-1),y=y+r(0,b)/2+d.config.xaxis.labels.offsetX}else b=d.layout.gridWidth/v,y=y+r(0,b)+d.config.xaxis.labels.offsetX;for(let a=0;a<=w-1;a++){let o=y-r(a,b)/2+d.config.xaxis.labels.offsetX;0===a&&1===w&&b/2===y&&1===v&&(o=d.layout.gridWidth/2);let A=this.axesUtils.getLabel(i,d.labelData.timescaleLabels,o,a,h,g,t),C=28;d.layout.rotateXLabels&&t&&(C=22),d.config.xaxis.title.text&&"top"===d.config.xaxis.position&&(C+=parseFloat(d.config.xaxis.title.style.fontSize)+2),t||(C=C+parseFloat(g)+(d.layout.xAxisLabelsHeight-d.layout.xAxisGroupLabelsHeight)+(d.layout.rotateXLabels?10:0));A=void 0!==d.config.xaxis.tickAmount&&"dataPoints"!==d.config.xaxis.tickAmount&&"datetime"!==d.config.xaxis.type?this.axesUtils.checkLabelBasedOnTickamount(a,A,w):this.axesUtils.checkForOverflowingLabels(a,A,w,h,c);const S=()=>t&&d.config.xaxis.convertedCatToNumeric?u[d.globals.minX+a-1]:u[a],k=(null!=(l=null==(n=A.textRect)?void 0:n.width)?l:0)/2,_=A.x+k<0;if(d.config.xaxis.labels.show&&!_){const i=e.drawText({x:A.x,y:this.offY+d.config.xaxis.labels.offsetY+C-("top"===d.config.xaxis.position?d.layout.xAxisHeight+d.config.xaxis.axisTicks.height-2:0),text:A.text,textAnchor:"middle",fontWeight:x,fontSize:g,fontFamily:p,foreColor:Array.isArray(u)?S():u,isPlainText:!1,cssClass:(t?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+f});if(s.add(i),i.on("click",t=>{if("function"==typeof d.config.chart.events.xAxisLabelClick){const e=Object.assign({},d,{labelIndex:a});d.config.chart.events.xAxisLabelClick(t,this.ctx,e)}}),t){const t=m.createElementNS(F,"title");t.textContent=Array.isArray(A.text)?A.text.join(" "):A.text,i.node.appendChild(t),""!==A.text&&(h.push(A.text),c.push(A))}}a<w-1&&(y+=r(a+1,b))}}drawXaxisInversed(t){const e=this.w,s=new gt(this.w),i=e.config.yaxis[0].opposite?e.globals.translateYAxisX[t]:0,a=s.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:t}),r=s.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+i+", 0)"});a.add(r);const o=[];if(e.config.yaxis[t].show)for(let t=0;t<this.xaxisLabels.length;t++)o.push(this.xaxisLabels[t]);const n=e.layout.gridHeight/o.length;let l=-n/2.2;const h=e.formatters.yLabelFormatters[0],c=e.config.yaxis[0].labels;if(c.show)for(let i=0;i<=o.length-1;i++){let a=void 0===o[i]?"":o[i];a=h(a,{seriesIndex:t,dataPointIndex:i,w:e});const d=this.axesUtils.getYAxisForeColor(c.style.colors,t),g=()=>Array.isArray(d)?d[i]:d;let p=0;Array.isArray(a)&&(p=a.length/2*parseInt(c.style.fontSize,10));let u=c.offsetX-15,x="end";this.yaxis.opposite&&(x="start"),"left"===e.config.yaxis[0].labels.align?(u=c.offsetX,x="start"):"center"===e.config.yaxis[0].labels.align?(u=c.offsetX,x="middle"):"right"===e.config.yaxis[0].labels.align&&(x="end");const f=s.drawText({x:u,y:l+n+c.offsetY-p,text:a,textAnchor:x,foreColor:g(),fontSize:c.style.fontSize,fontFamily:c.style.fontFamily,fontWeight:c.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+c.style.cssClass,maxWidth:c.maxWidth});r.add(f),f.on("click",t=>{if("function"==typeof e.config.chart.events.xAxisLabelClick){const s=Object.assign({},e,{labelIndex:i});e.config.chart.events.xAxisLabelClick(t,this.ctx,s)}});const b=m.createElementNS(F,"title");if(b.textContent=Array.isArray(a)?a.join(" "):a,f.node.appendChild(b),0!==e.config.yaxis[t].labels.rotate){const i=s.rotateAroundCenter(f.node);f.node.setAttribute("transform",`rotate(${e.config.yaxis[t].labels.rotate} 0 ${i.y})`)}l+=n}if(void 0!==e.config.yaxis[0].title.text){const t=s.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+i+", 0)"}),r=s.drawText({x:e.config.yaxis[0].title.offsetX,y:e.layout.gridHeight/2+e.config.yaxis[0].title.offsetY,text:e.config.yaxis[0].title.text,textAnchor:"middle",foreColor:e.config.yaxis[0].title.style.color,fontSize:e.config.yaxis[0].title.style.fontSize,fontWeight:e.config.yaxis[0].title.style.fontWeight,fontFamily:e.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+e.config.yaxis[0].title.style.cssClass});t.add(r),a.add(t)}let d=0;this.isCategoryBarHorizontal&&e.config.yaxis[0].opposite&&(d=e.layout.gridWidth);const g=e.config.xaxis.axisBorder;if(g.show){const t=s.drawLine(e.globals.padHorizontal+g.offsetX+d,1+g.offsetY,e.globals.padHorizontal+g.offsetX+d,e.layout.gridHeight+g.offsetY,g.color,0);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(t):a.add(t)}return e.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(d,o.length,e.config.yaxis[0].axisBorder,e.config.yaxis[0].axisTicks,0,n,a),a}drawXaxisTicks(t,e,s){const i=this.w,a=t;if(t<0||t-2>i.layout.gridWidth)return;const r=this.offY+i.config.xaxis.axisTicks.offsetY;if(e=e+r+i.config.xaxis.axisTicks.height,"top"===i.config.xaxis.position&&(e=r-i.config.xaxis.axisTicks.height),i.config.xaxis.axisTicks.show){const o=new gt(this.w).drawLine(t+i.config.xaxis.axisTicks.offsetX,r+i.config.xaxis.offsetY,a+i.config.xaxis.axisTicks.offsetX,e+i.config.xaxis.offsetY,i.config.xaxis.axisTicks.color);s.add(o),o.node.classList.add("apexcharts-xaxis-tick")}}getXAxisTicksPositions(){const t=this.w,e=[],s=this.xaxisLabels.length;let i=t.globals.padHorizontal;if(t.labelData.timescaleLabels.length>0)for(let t=0;t<s;t++)i=this.xaxisLabels[t].position,e.push(i);else{const a=s;for(let s=0;s<a;s++){let s=a;t.axisFlags.isXNumeric&&"bar"!==t.config.chart.type&&(s-=1),i+=t.layout.gridWidth/s,e.push(i)}}return e}xAxisLabelCorrections(){var t,e,s;const i=this.w,a=new gt(this.w),r=i.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),o=i.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),n=i.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),l=i.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(i.layout.rotateXLabels||i.config.xaxis.labels.rotateAlways)for(let t=0;t<o.length;t++){const e=a.rotateAroundCenter(o[t]);e.y=e.y-1,e.x=e.x+1,o[t].setAttribute("transform",`rotate(${i.config.xaxis.labels.rotate} ${e.x} ${e.y})`),o[t].setAttribute("text-anchor","end"),null==r||r.setAttribute("transform","translate(0, -10)");const s=o[t].childNodes;i.config.xaxis.labels.trim&&Array.prototype.forEach.call(s,t=>{a.placeTextWithEllipsis(t,t.textContent,i.layout.xAxisLabelsHeight-("bottom"===i.config.legend.position?20:10))})}else{const t=i.layout.gridWidth/(i.labelData.labels.length+1);for(let e=0;e<o.length;e++){const s=o[e].childNodes;i.config.xaxis.labels.trim&&"datetime"!==i.config.xaxis.type&&Array.prototype.forEach.call(s,e=>{a.placeTextWithEllipsis(e,e.textContent,t)})}}if(n.length>0){const r=n[n.length-1].getBBox(),o=n[0].getBBox();r.x<-20&&(null==(t=n[n.length-1].parentNode)||t.removeChild(n[n.length-1])),o.x+o.width>i.layout.gridWidth&&!i.globals.isBarHorizontal&&(null==(e=n[0].parentNode)||e.removeChild(n[0]));for(let t=0;t<l.length;t++)a.placeTextWithEllipsis(l[t],null!=(s=l[t].textContent)?s:"",i.config.yaxis[0].labels.maxWidth-(i.config.yaxis[0].title.text?2*parseFloat(i.config.yaxis[0].title.style.fontSize):0)-15)}}}class Ct{constructor(t,e){this.w=t,this.ctx=e,this.xaxisLabels=t.labelData.labels.slice(),this.axesUtils=new vt(e.w,{theme:e.theme,timeScale:e.timeScale}),this.isRangeBar=t.rangeData.seriesRange.length&&t.globals.isBarHorizontal,t.labelData.timescaleLabels.length>0&&(this.xaxisLabels=t.labelData.timescaleLabels.slice())}drawGridArea(t=null){const e=this.w,s=new gt(this.w);t||(t=s.group({class:"apexcharts-grid"}));const i=s.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.layout.gridHeight,"transparent"),a=s.drawLine(e.globals.padHorizontal,e.layout.gridHeight,e.layout.gridWidth,e.layout.gridHeight,"transparent");return t.add(a),t.add(i),t}drawGrid(){if(this.w.globals.axisCharts){const t=this.renderGrid();return this.drawGridArea(t.el),t}return null}createGridMask(){const t=this.w,e=t.globals,s=new gt(this.w),i=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width,a=t=>{const e=m.createElementNS(F,"clipPath");return e.setAttribute("id",t),e};t.dom.elGridRectMask=a(`gridRectMask${e.cuid}`),t.dom.elGridRectBarMask=a(`gridRectBarMask${e.cuid}`),t.dom.elGridRectMarkerMask=a(`gridRectMarkerMask${e.cuid}`),t.dom.elForecastMask=a(`forecastMask${e.cuid}`),t.dom.elNonForecastMask=a(`nonForecastMask${e.cuid}`);let r=0,o=0;(["bar","rangeBar","candlestick","boxPlot","violin"].includes(t.config.chart.type)||t.globals.comboBarCount>0)&&t.axisFlags.isXNumeric&&!t.globals.isBarHorizontal&&(r=Math.max(t.config.grid.padding.left,e.barPadForNumericAxis),o=Math.max(t.config.grid.padding.right,e.barPadForNumericAxis)),t.dom.elGridRect=s.drawRect(-i/2-2,-i/2-2,t.layout.gridWidth+i+4,t.layout.gridHeight+i+4,0,"#fff"),t.dom.elGridRectBar=s.drawRect(-i/2-r-2,-i/2-2,t.layout.gridWidth+i+o+r+4,t.layout.gridHeight+i+4,0,"#fff");const n=t.globals.markers.largestSize;t.dom.elGridRectMarker=s.drawRect(Math.min(-i/2-r-2,-n),-n,t.layout.gridWidth+Math.max(i+o+r+4,2*n),t.layout.gridHeight+2*n,0,"#fff"),t.dom.elGridRectMask.appendChild(t.dom.elGridRect.node),t.dom.elGridRectBarMask.appendChild(t.dom.elGridRectBar.node),t.dom.elGridRectMarkerMask.appendChild(t.dom.elGridRectMarker.node);const l=t.dom.elDefs.node;l.appendChild(t.dom.elGridRectMask),l.appendChild(t.dom.elGridRectBarMask),l.appendChild(t.dom.elGridRectMarkerMask),l.appendChild(t.dom.elForecastMask),l.appendChild(t.dom.elNonForecastMask)}_drawGridLines({i:t,x1:e,y1:s,x2:i,y2:a,xCount:r,parent:o}){const n=this.w;if(!(0===t&&n.globals.skipFirstTimelinelabel||t===r-1&&n.globals.skipLastTimelinelabel&&!n.config.xaxis.labels.formatter||"radar"===n.config.chart.type)){n.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:r,parent:o});let l=0;if(n.labelData.hasXaxisGroups&&"between"===n.config.xaxis.tickPlacement){const e=n.labelData.groups;if(e){let s=0;for(let i=0;s<t&&i<e.length;i++)s+=e[i].cols;s===t&&(l=.6*n.layout.xAxisLabelsHeight)}}new At(this.w,this.ctx).drawXaxisTicks(e,l,n.dom.elGraphical)}}_drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:r,parent:o}){const n=this.w,l=o.node.classList.contains("apexcharts-gridlines-horizontal"),h=n.globals.barPadForNumericAxis,c=0===s&&0===a||0===e&&0===i||s===n.layout.gridHeight&&a===n.layout.gridHeight||n.globals.isBarHorizontal&&(0===t||t===r-1),d=new gt(this.w).drawLine(e-(l?h:0),s,i+(l?h:0),a,n.config.grid.borderColor,n.config.grid.strokeDashArray);d.node.classList.add("apexcharts-gridline"),c&&n.config.grid.show?this.elGridBorders.add(d):o.add(d)}_drawGridBandRect({c:t,x1:e,y1:s,x2:i,y2:a,type:r}){const o=this.w,n=new gt(this.w),l=o.globals.barPadForNumericAxis,h=o.config.grid[r].colors[t],c=n.drawRect(e-("row"===r?l:0),s,i+("row"===r?2*l:0),a,0,h,o.config.grid[r].opacity);this.elg.add(c),c.attr("clip-path",`url(#gridRectMask${o.globals.cuid})`),c.node.classList.add(`apexcharts-grid-${r}`)}_drawXYLines({xCount:t,tickAmount:e}){var s;const i=this.w,a=({xC:e,x1:s,y1:i,x2:a,y2:r})=>{for(let o=0;o<e;o++)s=this.xaxisLabels[o].position,a=this.xaxisLabels[o].position,this._drawGridLines({i:o,x1:s,y1:i,x2:a,y2:r,xCount:t,parent:this.elgridLinesV})},r=({xC:e,x1:s,y1:a,x2:r,y2:o})=>{for(let n=0;n<e+(i.axisFlags.isXNumeric?0:1);n++)0===n&&1===e&&1===i.globals.dataPoints&&(r=s=i.layout.gridWidth/2),this._drawGridLines({i:n,x1:s,y1:a,x2:r,y2:o,xCount:t,parent:this.elgridLinesV}),r=s+=i.layout.gridWidth/(i.axisFlags.isXNumeric?e-1:e)};if(i.config.grid.xaxis.lines.show||i.config.xaxis.axisTicks.show){const e=i.globals.padHorizontal,o=0;let n;const l=i.layout.gridHeight;i.labelData.timescaleLabels.length?a({xC:t,x1:e,y1:o,x2:n,y2:l}):(i.axisFlags.isXNumeric&&(t=null==(s=i.globals.xAxisScale)?void 0:s.result.length),r({xC:t,x1:e,y1:o,x2:n,y2:l}))}if(i.config.grid.yaxis.lines.show){const t=0;let s=0,a=0;const r=i.layout.gridWidth;let o=e+1;this.isRangeBar&&(o=i.labelData.labels.length);for(let n=0;n<o+(this.isRangeBar?1:0);n++)this._drawGridLine({i:n,xCount:o+(this.isRangeBar?1:0),x1:t,y1:s,x2:r,y2:a,parent:this.elgridLinesH}),s+=i.layout.gridHeight/(this.isRangeBar?o:e),a=s}}_drawInvertedXYLines({xCount:t}){const e=this.w;if(e.config.grid.xaxis.lines.show||e.config.xaxis.axisTicks.show){let s=e.globals.padHorizontal;const i=0;let a;const r=e.layout.gridHeight;for(let o=0;o<t+1;o++){e.config.grid.xaxis.lines.show&&this._drawGridLine({i:o,xCount:t+1,x1:s,y1:i,x2:a,y2:r,parent:this.elgridLinesV});new At(this.w,this.ctx).drawXaxisTicks(s,0,e.dom.elGraphical),s+=e.layout.gridWidth/t,a=s}}if(e.config.grid.yaxis.lines.show){const t=0;let s=0,i=0;const a=e.layout.gridWidth;for(let r=0;r<e.globals.dataPoints+1;r++)this._drawGridLine({i:r,xCount:e.globals.dataPoints+1,x1:t,y1:s,x2:a,y2:i,parent:this.elgridLinesH}),s+=e.layout.gridHeight/e.globals.dataPoints,i=s}}renderGrid(){var t,e,s;const i=this.w,a=i.globals,r=new gt(this.w);this.elg=r.group({class:"apexcharts-grid"}),this.elgridLinesH=r.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=r.group({class:"apexcharts-gridlines-vertical"}),this.elGridBorders=r.group({class:"apexcharts-grid-borders"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),i.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide(),this.elGridBorders.hide());let o=0;for(;o<a.seriesYAxisMap.length&&a.ignoreYAxisIndexes.includes(o);)o++;o===a.seriesYAxisMap.length&&(o=0);let n,l=a.yAxisScale[o].result.length-1;return!a.isBarHorizontal||this.isRangeBar?(n=this.xaxisLabels.length,this.isRangeBar&&(l=i.labelData.labels.length,i.config.xaxis.tickAmount&&i.config.xaxis.labels.formatter&&(n=i.config.xaxis.tickAmount),(null==(s=null==(e=null==(t=a.yAxisScale)?void 0:t[o])?void 0:e.result)?void 0:s.length)>0&&"datetime"!==i.config.xaxis.type&&(n=a.yAxisScale[o].result.length-1)),this._drawXYLines({xCount:n,tickAmount:l})):(n=l,l=a.xTickAmount,this._drawInvertedXYLines({xCount:n,tickAmount:l})),this.drawGridBands(n,l),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:i.layout.gridWidth/n}}drawGridBands(t,e){var s,i,a,r,o;const n=this.w,l=(t,s,i,a,r,o)=>{for(let l=0,h=0;l<s;l++,h++)h>=n.config.grid[t].colors.length&&(h=0),this._drawGridBandRect({c:h,x1:i,y1:a,x2:r,y2:o,type:t}),a+=n.layout.gridHeight/e};if((null==(s=n.config.grid.row.colors)?void 0:s.length)>0&&l("row",e,0,0,n.layout.gridWidth,n.layout.gridHeight/e),(null==(i=n.config.grid.column.colors)?void 0:i.length)>0){let e=n.globals.isBarHorizontal||"on"!==n.config.xaxis.tickPlacement||"category"!==n.config.xaxis.type&&!n.config.xaxis.convertedCatToNumeric?t:t-1;n.axisFlags.isXNumeric&&(e=(null!=(r=null==(a=n.globals.xAxisScale)?void 0:a.result.length)?r:1)-1);let s=n.globals.padHorizontal;const i=0;let l=n.globals.padHorizontal+n.layout.gridWidth/e;const h=n.layout.gridHeight;for(let a=0,r=0;a<t;a++,r++)r>=n.config.grid.column.colors.length&&(r=0),"datetime"===n.config.xaxis.type&&(s=this.xaxisLabels[a].position,l=((null==(o=this.xaxisLabels[a+1])?void 0:o.position)||n.layout.gridWidth)-this.xaxisLabels[a].position),this._drawGridBandRect({c:r,x1:s,y1:i,x2:l,y2:h,type:"column"}),s+=n.layout.gridWidth/e}}}class St{constructor(t){this.w=t,this.coreUtils=new P(this.w)}niceScale(t,e,s=0){const i=1e-11,a=this.w,r=a.globals;let o,n,l,h;r.isBarHorizontal?(o=a.config.xaxis,n=Math.max((r.svgWidth-100)/25,2)):(o=a.config.yaxis[s],n=Math.max((r.svgHeight-100)/15,2)),b.isNumber(n)||(n=10),l=void 0!==o.min&&null!==o.min,h=void 0!==o.max&&null!==o.min;let c=void 0!==o.stepSize&&null!==o.stepSize,d=void 0!==o.tickAmount&&null!==o.tickAmount,g=d?o.tickAmount:D[Math.min(Math.round(n/2),D.length-1)];if(r.isMultipleYAxis&&!d&&r.multiAxisTickAmount>0&&(g=r.multiAxisTickAmount,d=!0),g="dataPoints"===g?r.dataPoints-1:Math.abs(Math.round(g)),(t===Number.MIN_VALUE&&0===e||!b.isNumber(t)&&!b.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE)&&(t=b.isNumber(o.min)?o.min:0,e=b.isNumber(o.max)?o.max:t+g,r.allSeriesCollapsed=!1),t>e){const s=e;e=t,t=s}else t===e&&(t=0===t?0:t-1,e=0===e?2:e+1);const p=[];g<1&&(g=1);let u=g,x=Math.abs(e-t);!l&&t>0&&t/x<.15&&(t=0,l=!0),!h&&e<0&&-e/x<.15&&(e=0,h=!0),x=Math.abs(e-t);let f=x/u,m=f;const y=Math.floor(Math.log10(m)),w=Math.pow(10,y);let v=Math.ceil(m/w);if(v=L[0===r.yValueDecimal?0:1][v],m=v*w,f=m,r.isBarHorizontal&&o.stepSize&&"datetime"!==o.type?(f=o.stepSize,c=!0):c&&(f=o.stepSize),c&&o.forceNiceScale){const t=Math.floor(Math.log10(f));f*=Math.pow(10,y-t)}if(l&&h){let t=x/u;if(d)if(c)if(0!=b.mod(x,f)){const e=b.getGCD(f,t);f=t/e<10?e:t}else 0==b.mod(f,t)?f=t:(t=f,d=!1);else f=t;else if(c)0==b.mod(x,f)?t=f:f=t;else if(0==b.mod(x,f))t=f;else{u=Math.ceil(x/f),t=x/u;const e=b.getGCD(x,f);x/e<n&&(t=e),f=t}u=Math.round(x/f)}else{if(l||h){if(h)if(d)t=e-f*u;else{const s=t;t=f*Math.floor(t/f),Math.abs(e-t)/b.getGCD(x,f)>n&&(t=e-f*g,t+=f*Math.floor((s-t)/f))}else if(l)if(d)e=t+f*u;else{const s=e;e=f*Math.ceil(e/f),Math.abs(e-t)/b.getGCD(x,f)>n&&(e=t+f*g,e+=f*Math.ceil((s-e)/f))}}else if(r.isMultipleYAxis&&d){const s=f*Math.floor(t/f);let i=s+f*u;i<e&&(f*=2),i=e,e=(t=s)+f*u,x=Math.abs(e-t),t>0&&t<Math.abs(i-e)&&(t=0,e=f*u),e<0&&-e<Math.abs(s-t)&&(e=0,t=-f*u)}else t=f*Math.floor(t/f),e=f*Math.ceil(e/f);x=Math.abs(e-t),f=b.getGCD(x,f),u=Math.round(x/f)}if(d||l||h||(u=Math.ceil((x-i)/(f+i)),u>16&&b.getPrimeFactors(u).length<2&&u++),!d&&o.forceNiceScale&&0===r.yValueDecimal&&u>x&&(u=x,f=Math.round(x/u)),u>n&&(!d&&!c||o.forceNiceScale)){const t=b.getPrimeFactors(u),e=t.length-1;let s=u;t:for(var A=0;A<e;A++)for(var C=0;C<=e-A;C++){const i=Math.min(C+A,e);let a=s,r=1;for(var S=C;S<=i;S++)r*=t[S];if(a/=r,a<n){s=a;break t}}f=s===u?x:x/s,u=Math.round(x/f)}r.isMultipleYAxis&&0==r.multiAxisTickAmount&&r.ignoreYAxisIndexes.indexOf(s)<0&&(r.multiAxisTickAmount=u);let k=t-f;const _=f*i;do{k+=f,p.push(b.stripNumber(k,7))}while(e-k>_);return{result:p,niceMin:p[0],niceMax:p[p.length-1]}}linearScale(t,e,s=10,i=0,a=void 0){const r=Math.abs(e-t);let o=[];if(t===e)return o=[t],{result:o,niceMin:o[0],niceMax:o[o.length-1]};"dataPoints"===(s=this._adjustTicksForSmallRange(s,i,r))&&(s=this.w.globals.dataPoints-1);const n=s;a||(a=r/n);if(0!==a&&isFinite(a)){const t=Math.floor(Math.log10(Math.abs(a))),e=Math.max(2,2-t),s=Math.pow(10,e);a=Math.round((a+Number.EPSILON)*s)/s}let l=s===Number.MAX_VALUE?5:n;s===Number.MAX_VALUE&&(a=1);let h=t;for(;l>=0;)o.push(h),h=b.preciseAddition(h,a),l-=1;return{result:o,niceMin:o[0],niceMax:o[o.length-1]}}logarithmicScaleNice(t,e,s){e<=0&&(e=Math.max(t,s)),t<=0&&(t=Math.min(e,s));const i=[],a=Math.ceil(Math.log(e)/Math.log(s)+1);for(let e=Math.floor(Math.log(t)/Math.log(s));e<a;e++)i.push(Math.pow(s,e));return{result:i,niceMin:i[0],niceMax:i[i.length-1]}}logarithmicScale(t,e,s){e<=0&&(e=Math.max(t,s)),t<=0&&(t=Math.min(e,s));const i=[],a=Math.log(e)/Math.log(s),r=Math.log(t)/Math.log(s),o=a-r,n=Math.round(o),l=o/n;for(let t=0,e=r;t<n;t++,e+=l)i.push(Math.pow(s,e));return i.push(Math.pow(s,a)),{result:i,niceMin:t,niceMax:e}}_adjustTicksForSmallRange(t,e,s){let i=t;if(void 0!==e&&this.w.config.yaxis[e].labels.formatter&&void 0===this.w.config.yaxis[e].tickAmount){const t=Number(this.w.config.yaxis[e].labels.formatter(1));b.isNumber(t)&&0===this.w.globals.yValueDecimal&&(i=Math.ceil(s))}return i<t?i:t}setYScaleForIndex(t,e,s){const i=this.w.globals,a=this.w.config,r=i.isBarHorizontal?a.xaxis:a.yaxis[t];void 0===i.yAxisScale[t]&&(i.yAxisScale[t]=[]);const o=Math.abs(s-e);r.logarithmic&&o<=5&&(i.invalidLogScale=!0),r.logarithmic&&o>5?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=r.forceNiceScale?this.logarithmicScaleNice(e,s,r.logBase):this.logarithmicScale(e,s,r.logBase)):s!==-Number.MAX_VALUE&&b.isNumber(s)&&e!==Number.MAX_VALUE&&b.isNumber(e)?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=this.niceScale(e,s,t)):i.yAxisScale[t]=this.niceScale(Number.MIN_VALUE,0,t)}setXScale(t,e){const s=this.w,i=s.globals;if(e!==-Number.MAX_VALUE&&b.isNumber(e)){const a=i.xTickAmount;i.xAxisScale=this.linearScale(t,e,a,0,void 0===s.config.xaxis.max?s.config.xaxis.stepSize:void 0)}else i.xAxisScale=this.linearScale(0,10,10);return i.xAxisScale}scaleMultipleYAxes(){const t=this.w.config,e=this.w.globals;this.coreUtils.setSeriesYAxisMappings();const s=e.seriesYAxisMap,i=e.minYArr,a=e.maxYArr,r=[],o=!e.isBarHorizontal;if(e.allSeriesCollapsed=!0,e.barGroups=[],s.forEach((s,n)=>{const l=[];if(s.forEach(e=>{var s;const i=null==(s=t.series[e])?void 0:s.group;l.indexOf(i)<0&&l.push(i)}),s.length>0){let h,c,d=Number.MAX_VALUE,g=-Number.MAX_VALUE,p=d,u=g;if(t.chart.stacked){const i=new Array(e.dataPoints).fill(0),a=[],r=[],o=[];l.forEach(()=>{a.push(i.map(()=>Number.MIN_VALUE)),r.push(i.map(()=>Number.MIN_VALUE)),o.push(i.map(()=>Number.MIN_VALUE))});for(let i=0;i<s.length;i++){!h&&t.series[s[i]].type&&(h=t.series[s[i]].type);const d=s[i];c=t.series[d].group?t.series[d].group:"axis-".concat(n.toString());!(e.collapsedSeriesIndices.indexOf(d)<0&&e.ancillaryCollapsedSeriesIndices.indexOf(d)<0)||(e.allSeriesCollapsed=!1,l.forEach((e,s)=>{if(t.series[d].group===e)for(let t=0;t<this.w.seriesData.series[d].length;t++){const e=this.w.seriesData.series[d][t];e>=0?r[s][t]+=e:o[s][t]+=e,a[s][t]+=e,p=Math.min(p,e),u=Math.max(u,e)}})),"bar"!==h&&"column"!==h||e.barGroups.push(c)}h||(h=t.chart.type),"bar"===h||"column"===h?l.forEach((t,e)=>{d=Math.min(d,Math.min.apply(null,o[e])),g=Math.max(g,Math.max.apply(null,r[e]))}):(l.forEach((t,e)=>{p=Math.min(p,Math.min.apply(null,a[e])),u=Math.max(u,Math.max.apply(null,a[e]))}),d=p,g=u),d===Number.MIN_VALUE&&g===Number.MIN_VALUE&&(g=-Number.MAX_VALUE)}else for(let t=0;t<s.length;t++){const r=s[t];d=Math.min(d,i[r]),g=Math.max(g,a[r]);!(e.collapsedSeriesIndices.indexOf(r)<0&&e.ancillaryCollapsedSeriesIndices.indexOf(r)<0)||(e.allSeriesCollapsed=!1)}void 0!==t.yaxis[n].min&&(d="function"==typeof t.yaxis[n].min?t.yaxis[n].min(d):t.yaxis[n].min),void 0!==t.yaxis[n].max&&(g="function"==typeof t.yaxis[n].max?t.yaxis[n].max(g):t.yaxis[n].max),e.barGroups=e.barGroups.filter((t,e,s)=>s.indexOf(t)===e);const x=t.yaxis[n];o&&!0===x.alignZero&&!x.logarithmic&&void 0===x.min&&void 0===x.max&&e.ignoreYAxisIndexes.indexOf(n)<0&&b.isNumber(d)&&b.isNumber(g)?r.push({ai:n,minY:d,maxY:g}):(this.setYScaleForIndex(n,d,g),s.forEach(t=>{i[t]=e.yAxisScale[n].niceMin,a[t]=e.yAxisScale[n].niceMax}))}else this.setYScaleForIndex(n,0,-Number.MAX_VALUE)}),r.length>=2){r.forEach(t=>{this.setYScaleForIndex(t.ai,t.minY,t.maxY),s[t.ai].forEach(s=>{i[s]=e.yAxisScale[t.ai].niceMin,a[s]=e.yAxisScale[t.ai].niceMax})});let t=0;r.forEach(s=>{const i=e.yAxisScale[s.ai],a=i.niceMax-i.niceMin;if(a>0){const e=-i.niceMin/a;e>t&&(t=e)}}),t>1&&(t=1),t<0&&(t=0);const o=t=>{if(t<=0)return 1;const e=Math.floor(Math.log10(t)),s=Math.pow(10,e),i=t/s;let a;return a=i<=1+1e-9?1:i<=2+1e-9?2:i<=2.5+1e-9?2.5:i<=5+1e-9?5:10,a*s};r.forEach(r=>{const n=e.yAxisScale[r.ai];if(!n.result||n.result.length<2)return;const l=n.niceMax-n.niceMin;if(l<=0)return;const h=-n.niceMin/l;if(Math.abs(h-t)<=1e-9)return;const c=h<t&&t<1-1e-9,d=!c&&h>t&&t>1e-9;if(!c&&!d)return;const g=c?-t*n.niceMax/(1-t):n.niceMin,p=d?-n.niceMin*(1-t)/t:n.niceMax,u=p-g;if(u<=0)return;const x=Math.max(n.result.length,5),f=o(u/Math.max(x-1,1));if(f<=0)return;let m,y;if(c){m=Math.floor(g/f+1e-9)*f;const e=t>1e-9?m*(t-1)/t:n.niceMax,s=Math.max(e,n.niceMax);y=Math.ceil(s/f-1e-9)*f}else{y=Math.ceil(p/f-1e-9)*f;const e=t<1-1e-9?-t*y/(1-t):n.niceMin,s=Math.min(e,n.niceMin);m=Math.floor(s/f+1e-9)*f}n.result=[];for(let t=m;t<=y+1e-9*f;t=b.preciseAddition(t,f))n.result.push(b.stripNumber(t,7));n.niceMin=m,n.niceMax=y,s[r.ai].forEach(t=>{i[t]=n.niceMin,a[t]=n.niceMax})})}else if(1===r.length){const t=r[0];this.setYScaleForIndex(t.ai,t.minY,t.maxY),s[t.ai].forEach(s=>{i[s]=e.yAxisScale[t.ai].niceMin,a[s]=e.yAxisScale[t.ai].niceMax})}}}class kt{constructor(t){this.w=t,this.scales=new St(this.w)}init(){this.setYRange(),this.setXRange(),this.setZRange()}getMinYMaxY(t,e=Number.MAX_VALUE,s=-Number.MAX_VALUE,i=null){var a,r,o,n,l,h,c,d;const g=this.w.config,p=this.w.globals;let u=-Number.MAX_VALUE,x=Number.MIN_VALUE;null===i&&(i=t+1);const f=this.w.seriesData.series;let m=f,y=f;"candlestick"===g.chart.type?(m=this.w.candleData.seriesCandleL,y=this.w.candleData.seriesCandleH):"boxPlot"===g.chart.type?(m=this.w.candleData.seriesCandleO,y=this.w.candleData.seriesCandleC):"violin"===g.chart.type?(m=this.w.violinData.seriesViolinMin,y=this.w.violinData.seriesViolinMax):this.w.axisFlags.isRangeData&&(m=this.w.rangeData.seriesRangeStart,y=this.w.rangeData.seriesRangeEnd);let w=!1;if(this.w.seriesData.seriesX.length>=i){const t=null==(a=p.brushSource)?void 0:a.w.config.chart.brush;(g.chart.zoom.enabled&&g.chart.zoom.autoScaleYaxis||(null==t?void 0:t.enabled)&&(null==t?void 0:t.autoScaleYaxis))&&(w=!0)}for(let a=t;a<i;a++){p.dataPoints=Math.max(p.dataPoints,f[a].length);const t=g.series[a].type;this.w.labelData.categoryLabels.length&&(p.dataPoints=this.w.labelData.categoryLabels.filter(t=>void 0!==t).length),this.w.labelData.labels.length&&"datetime"!==g.xaxis.type&&0!==this.w.seriesData.series.reduce((t,e)=>t+e.length,0)&&(p.dataPoints=Math.max(p.dataPoints,this.w.labelData.labels.length));let i=0,v=f[a].length-1;if(w){if(g.xaxis.min)for(;i<v&&this.w.seriesData.seriesX[a][i]<g.xaxis.min;i++);if(g.xaxis.max)for(;v>i&&this.w.seriesData.seriesX[a][v]>g.xaxis.max;v--);}for(let g=i;g<=v&&g<this.w.seriesData.series[a].length;g++){let i=f[a][g];if(null!==i&&b.isNumber(i)){switch(void 0!==(null==(r=y[a])?void 0:r[g])&&(u=Math.max(u,y[a][g]),e=Math.min(e,y[a][g])),void 0!==(null==(o=m[a])?void 0:o[g])&&(e=Math.min(e,m[a][g]),s=Math.max(s,m[a][g])),t){case"candlestick":void 0!==this.w.candleData.seriesCandleC[a][g]&&(u=Math.max(u,this.w.candleData.seriesCandleH[a][g]),e=Math.min(e,this.w.candleData.seriesCandleL[a][g]));break;case"boxPlot":void 0!==this.w.candleData.seriesCandleC[a][g]&&(u=Math.max(u,this.w.candleData.seriesCandleC[a][g]),e=Math.min(e,this.w.candleData.seriesCandleO[a][g]));break;case"violin":void 0!==(null==(n=this.w.violinData.seriesViolinMax[a])?void 0:n[g])&&(u=Math.max(u,this.w.violinData.seriesViolinMax[a][g]),e=Math.min(e,this.w.violinData.seriesViolinMin[a][g]))}if(t&&"candlestick"!==t&&"boxPlot"!==t&&"violin"!==t&&"rangeArea"!==t&&"rangeBar"!==t&&(u=Math.max(u,this.w.seriesData.series[a][g]),e=Math.min(e,this.w.seriesData.series[a][g])),this.w.seriesData.seriesGoals[a]&&this.w.seriesData.seriesGoals[a][g]&&Array.isArray(this.w.seriesData.seriesGoals[a][g])&&this.w.seriesData.seriesGoals[a][g].forEach(t=>{u=Math.max(u,t.value),e=Math.min(e,t.value)}),"boxPlot"===this.w.config.chart.type||"boxPlot"===t){const t=null==(h=null==(l=this.w.candleData.seriesBoxPoints)?void 0:l[a])?void 0:h[g];if(t)for(let s=0;s<t.length;s++){const i=t[s];"number"==typeof i&&(u=Math.max(u,i),e=Math.min(e,i))}}s=u,i=b.noExponents(i),b.isFloat(i)&&(p.yValueDecimal=Math.max(p.yValueDecimal,i.toString().split(".")[1].length)),x>(null==(c=m[a])?void 0:c[g])&&(null==(d=m[a])?void 0:d[g])<0&&(x=m[a][g])}else p.hasNullValues=!0}"bar"!==t&&"column"!==t||(x<0&&u<0&&(u=0,s=Math.max(s,0)),x===Number.MIN_VALUE&&(x=0,e=Math.min(e,0)))}return"rangeBar"===g.chart.type&&this.w.rangeData.seriesRangeStart.length&&p.isBarHorizontal&&(x=e),"bar"===g.chart.type&&(x<0&&u<0&&(u=0),x===Number.MIN_VALUE&&(x=0)),{minY:x,maxY:u,lowestY:e,highestY:s}}setYRange(){const t=this.w.globals,e=this.w.config;t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE;let s,i=Number.MAX_VALUE;if(t.isMultipleYAxis){i=Number.MAX_VALUE;for(let e=0;e<this.w.seriesData.series.length;e++)s=this.getMinYMaxY(e),t.minYArr[e]=s.lowestY,t.maxYArr[e]=s.highestY,i=Math.min(i,s.lowestY)}if(s=this.getMinYMaxY(0,i,void 0,this.w.seriesData.series.length),"bar"===e.chart.type?(t.minY=s.minY,t.maxY=s.maxY):(t.minY=s.lowestY,t.maxY=s.highestY),i=s.lowestY,e.chart.stacked&&this._setStackedMinMax(),"line"===e.chart.type||"area"===e.chart.type||"scatter"===e.chart.type||"candlestick"===e.chart.type||"boxPlot"===e.chart.type||"violin"===e.chart.type||"rangeBar"===e.chart.type&&!t.isBarHorizontal?t.minY===Number.MIN_VALUE&&i!==-Number.MAX_VALUE&&i!==t.maxY&&(t.minY=i):t.minY=t.minY!==Number.MIN_VALUE?Math.min(s.minY,t.minY):s.minY,e.yaxis.forEach((e,s)=>{void 0!==e.max&&("number"==typeof e.max?t.maxYArr[s]=e.max:"function"==typeof e.max&&(t.maxYArr[s]=e.max(t.isMultipleYAxis?t.maxYArr[s]:t.maxY)),t.maxY=t.maxYArr[s]),void 0!==e.min&&("number"==typeof e.min?t.minYArr[s]=e.min:"function"==typeof e.min&&(t.minYArr[s]=e.min(t.isMultipleYAxis?t.minYArr[s]===Number.MIN_VALUE?0:t.minYArr[s]:t.minY)),t.minY=t.minYArr[s])}),t.isBarHorizontal){["min","max"].forEach(s=>{void 0!==e.xaxis[s]&&"number"==typeof e.xaxis[s]&&("min"===s?t.minY=e.xaxis[s]:t.maxY=e.xaxis[s])})}return t.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),t.minY=i):(this.scales.setYScaleForIndex(0,t.minY,t.maxY),t.minY=t.yAxisScale[0].niceMin,t.maxY=t.yAxisScale[0].niceMax,t.minYArr[0]=t.minY,t.maxYArr[0]=t.maxY),t.barGroups=[],t.lineGroups=[],t.areaGroups=[],e.series.forEach(s=>{const i=s;switch(i.type||e.chart.type){case"bar":case"column":t.barGroups.push(i.group);break;case"line":t.lineGroups.push(i.group);break;case"area":t.areaGroups.push(i.group)}}),t.barGroups=t.barGroups.filter((t,e,s)=>s.indexOf(t)===e),t.lineGroups=t.lineGroups.filter((t,e,s)=>s.indexOf(t)===e),t.areaGroups=t.areaGroups.filter((t,e,s)=>s.indexOf(t)===e),{minY:t.minY,maxY:t.maxY,minYArr:t.minYArr,maxYArr:t.maxYArr,yAxisScale:t.yAxisScale}}setXRange(){const t=this.w.globals,e=this.w.config,s="numeric"===e.xaxis.type||"datetime"===e.xaxis.type||"category"===e.xaxis.type&&!this.w.axisFlags.noLabelsProvided||this.w.axisFlags.noLabelsProvided||this.w.axisFlags.isXNumeric,i=()=>{for(let e=0;e<this.w.seriesData.series.length;e++)if(this.w.labelData.labels[e])for(let s=0;s<this.w.labelData.labels[e].length;s++)null!==this.w.labelData.labels[e][s]&&b.isNumber(this.w.labelData.labels[e][s])&&(t.maxX=Math.max(t.maxX,this.w.labelData.labels[e][s]),t.initialMaxX=Math.max(t.maxX,this.w.labelData.labels[e][s]),t.minX=Math.min(t.minX,this.w.labelData.labels[e][s]),t.initialMinX=Math.min(t.minX,this.w.labelData.labels[e][s]))};if(this.w.axisFlags.isXNumeric&&i(),this.w.axisFlags.noLabelsProvided&&0===e.xaxis.categories.length&&(t.maxX=this.w.labelData.labels[this.w.labelData.labels.length-1],t.initialMaxX=this.w.labelData.labels[this.w.labelData.labels.length-1],t.minX=1,t.initialMinX=1),this.w.axisFlags.isXNumeric||this.w.axisFlags.noLabelsProvided||this.w.axisFlags.dataFormatXNumeric){let i=10;if(void 0===e.xaxis.tickAmount)i=Math.round(t.svgWidth/150),"numeric"===e.xaxis.type&&t.dataPoints<30&&(i=t.dataPoints-1),i>t.dataPoints&&0!==t.dataPoints&&(i=t.dataPoints-1);else if("dataPoints"===e.xaxis.tickAmount){if(this.w.seriesData.series.length>1&&(i=this.w.seriesData.series[t.maxValsInArrayIndex].length-1),this.w.axisFlags.isXNumeric){const e=Math.round(t.maxX-t.minX);e<30&&(i=e)}}else i=e.xaxis.tickAmount;if(t.xTickAmount=i,void 0!==e.xaxis.max&&"number"==typeof e.xaxis.max&&(t.maxX=e.xaxis.max),void 0!==e.xaxis.min&&"number"==typeof e.xaxis.min&&(t.minX=e.xaxis.min),void 0!==e.xaxis.range&&(t.minX=t.maxX-e.xaxis.range),t.minX!==Number.MAX_VALUE&&t.maxX!==-Number.MAX_VALUE)if(e.xaxis.convertedCatToNumeric&&!this.w.axisFlags.dataFormatXNumeric){const e=[];for(let s=t.minX-1;s<t.maxX;s++)e.push(s+1);t.xAxisScale={result:e,niceMin:e[0],niceMax:e[e.length-1]}}else t.xAxisScale=this.scales.setXScale(t.minX,t.maxX);else t.xAxisScale=this.scales.linearScale(0,i,i,0,e.xaxis.stepSize),this.w.axisFlags.noLabelsProvided&&this.w.labelData.labels.length>0&&(t.xAxisScale=this.scales.linearScale(1,this.w.labelData.labels.length,i-1,0,e.xaxis.stepSize),this.w.seriesData.seriesX=this.w.labelData.labels.slice());s&&(this.w.labelData.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&this.w.labelData.labels.length&&(t.xTickAmount=this.w.labelData.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}setZRange(){const t=this.w.globals;if(this.w.axisFlags.isDataXYZ)for(let e=0;e<this.w.seriesData.series.length;e++)if(void 0!==this.w.seriesData.seriesZ[e])for(let s=0;s<this.w.seriesData.seriesZ[e].length;s++)null!==this.w.seriesData.seriesZ[e][s]&&b.isNumber(this.w.seriesData.seriesZ[e][s])&&(t.maxZ=Math.max(t.maxZ,this.w.seriesData.seriesZ[e][s]),t.minZ=Math.min(t.minZ,this.w.seriesData.seriesZ[e][s]))}_handleSingleDataPoint(){const t=this.w.globals,e=this.w.config;if(t.minX===t.maxX){const s=new y(this.w);if("datetime"===e.xaxis.type){const i=s.getDate(t.minX);e.xaxis.labels.datetimeUTC?i.setUTCDate(i.getUTCDate()-2):i.setDate(i.getDate()-2),t.minX=new Date(i).getTime();const a=s.getDate(t.maxX);e.xaxis.labels.datetimeUTC?a.setUTCDate(a.getUTCDate()+2):a.setDate(a.getDate()+2),t.maxX=new Date(a).getTime()}else("numeric"===e.xaxis.type||"category"===e.xaxis.type&&!this.w.axisFlags.noLabelsProvided)&&(t.minX=t.minX-2,t.initialMinX=t.minX,t.maxX=t.maxX+2,t.initialMaxX=t.maxX)}}_getMinXDiff(){const t=this.w.globals;this.w.axisFlags.isXNumeric&&this.w.seriesData.seriesX.forEach(e=>{if(e.length){1===e.length&&e.push(this.w.seriesData.seriesX[t.maxValsInArrayIndex][this.w.seriesData.seriesX[t.maxValsInArrayIndex].length-1]);const s=e.slice();s.sort((t,e)=>t-e),s.forEach((e,i)=>{if(i>0){const a=e-s[i-1];a>0&&(t.minXDiff=Math.min(a,t.minXDiff))}}),1!==t.dataPoints&&t.minXDiff!==Number.MAX_VALUE||(t.minXDiff=.5)}})}_setStackedMinMax(){const t=this.w.globals;if(!this.w.seriesData.series.length)return;let e=this.w.labelData.seriesGroups;e.length||(e=[this.w.seriesData.seriesNames.map(t=>t)]);const s={},i={};e.forEach(e=>{s[e]=[],i[e]=[];this.w.config.series.map((t,s)=>e.indexOf(this.w.seriesData.seriesNames[s])>-1?s:null).filter(t=>null!==t).forEach(a=>{var r,o,n,l;for(let h=0;h<this.w.seriesData.series[t.maxValsInArrayIndex].length;h++){void 0===s[e][h]&&(s[e][h]=0,i[e][h]=0);(this.w.config.chart.stacked&&!t.comboCharts||this.w.config.chart.stacked&&t.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(o=null==(r=this.w.config.series)?void 0:r[a])?void 0:o.type)||"column"===(null==(l=null==(n=this.w.config.series)?void 0:n[a])?void 0:l.type)))&&null!==this.w.seriesData.series[a][h]&&b.isNumber(this.w.seriesData.series[a][h])&&(this.w.seriesData.series[a][h]>0?s[e][h]+=parseFloat(String(this.w.seriesData.series[a][h]))+1e-4:i[e][h]+=parseFloat(String(this.w.seriesData.series[a][h])))}})}),Object.entries(s).forEach(([e])=>{s[e].forEach((a,r)=>{t.maxY=Math.max(t.maxY,s[e][r]),t.minY=Math.min(t.minY,i[e][r])})})}}class _t{constructor(t,{theme:e=null,timeScale:s=null}={},i){this.w=t,this.elgrid=i,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.axisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===t.config.chart.type&&t.config.plotOptions.bar.horizontal,this.xAxisoffX="bottom"===t.config.xaxis.position?t.layout.gridHeight:0,this.drawnLabels=[],this.axesUtils=new vt(t,{theme:e,timeScale:s})}drawYaxis(t){const e=this.w,s=new gt(this.w),i=e.config.yaxis[t].labels.style,{fontSize:a,fontFamily:r,fontWeight:o}=i,n=s.group({class:"apexcharts-yaxis",rel:t,transform:`translate(${e.globals.translateYAxisX[t]}, 0)`});if(this.axesUtils.isYAxisHidden(t))return n;const l=s.group({class:"apexcharts-yaxis-texts-g"});n.add(l);const h=e.globals.yAxisScale[t].result.length-1,c=e.layout.gridHeight/h,d=e.formatters.yLabelFormatters[t],g=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());if(e.config.yaxis[t].labels.show){let n=e.layout.translateY+e.config.yaxis[t].labels.offsetY;e.globals.isBarHorizontal?n=0:"heatmap"===e.config.chart.type&&(n-=c/2),n+=parseInt(a,10)/3;let p=null;for(let u=h;u>=0;u--){const h=d(g[u],u,e);let x=e.config.yaxis[t].labels.padding;e.config.yaxis[t].opposite&&0!==e.config.yaxis.length&&(x*=-1);const f=this.getTextAnchor(e.config.yaxis[t].labels.align,e.config.yaxis[t].opposite),m=this.axesUtils.getYAxisForeColor(i.colors,t),b=Array.isArray(m)?m[u]:m,y=Array.from(e.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-label tspan`)).map(t=>t.textContent),w=s.drawText({x:x,y:n,text:y.includes(h)&&!e.config.yaxis[t].labels.showDuplicates?"":h,textAnchor:f,fontSize:a,fontFamily:r,fontWeight:o,maxWidth:e.config.yaxis[t].labels.maxWidth,foreColor:b,isPlainText:!1,cssClass:`apexcharts-yaxis-label ${i.cssClass}`});l.add(w),this.addTooltip(w,h),null===p&&(p=w),0!==e.config.yaxis[t].labels.rotate&&this.rotateLabel(s,w,p,e.config.yaxis[t].labels.rotate),n+=c}}return this.addYAxisTitle(s,n,t),this.addAxisBorder(s,n,t,h,c),n}getTextAnchor(t,e){return"left"===t?"start":"center"===t?"middle":"right"===t?"end":e?"start":"end"}addTooltip(t,e){const s=m.createElementNS(F,"title");s.textContent=Array.isArray(e)?e.join(" "):e,t.node.appendChild(s)}rotateLabel(t,e,s,i){const a=t.rotateAroundCenter(s.node),r=t.rotateAroundCenter(e.node);e.node.setAttribute("transform",`rotate(${i} ${a.x} ${r.y})`)}addYAxisTitle(t,e,s){const i=this.w;if(void 0!==i.config.yaxis[s].title.text){const a=t.group({class:"apexcharts-yaxis-title"}),r=i.config.yaxis[s].opposite?i.globals.translateYAxisX[s]:0,o=t.drawText({x:r,y:i.layout.gridHeight/2+i.layout.translateY+i.config.yaxis[s].title.offsetY,text:i.config.yaxis[s].title.text,textAnchor:"end",foreColor:i.config.yaxis[s].title.style.color,fontSize:i.config.yaxis[s].title.style.fontSize,fontWeight:i.config.yaxis[s].title.style.fontWeight,fontFamily:i.config.yaxis[s].title.style.fontFamily,cssClass:`apexcharts-yaxis-title-text ${i.config.yaxis[s].title.style.cssClass}`});a.add(o),e.add(a)}}addAxisBorder(t,e,s,i,a){const r=this.w,o=r.config.yaxis[s].axisBorder;let n=31+o.offsetX;if(r.config.yaxis[s].opposite&&(n=-31-o.offsetX),o.show){const s=t.drawLine(n,r.layout.translateY+o.offsetY-2,n,r.layout.gridHeight+r.layout.translateY+o.offsetY+2,o.color,0,o.width);e.add(s)}r.config.yaxis[s].axisTicks.show&&this.axesUtils.drawYAxisTicks(n,i,o,r.config.yaxis[s].axisTicks,s,a,e)}drawYaxisInversed(t){const e=this.w,s=new gt(this.w),i=s.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),a=s.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${e.layout.translateXAxisX}, ${e.layout.translateXAxisY})`});i.add(a);let r=e.globals.yAxisScale[t].result.length-1;const o=e.layout.gridWidth/r+.1;let n=o+e.config.xaxis.labels.offsetX;const l=e.formatters.xLabelFormatter;let h=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());const c=e.labelData.timescaleLabels;if(c.length>0&&(this.xaxisLabels=c.slice(),h=c.slice(),r=h.length),e.config.xaxis.labels.show)for(let i=c.length?0:r;c.length?i<c.length:i>=0;c.length?i++:i--){let r=null==l?void 0:l(h[i],i,e),d=e.layout.gridWidth+e.globals.padHorizontal-(n-o+e.config.xaxis.labels.offsetX);if(c.length){const t=this.axesUtils.getLabel(h,c,d,i,this.drawnLabels,this.xaxisFontSize);d=t.x,r=t.text,this.drawnLabels.push(t.text),0===i&&e.globals.skipFirstTimelinelabel&&(r=""),i===h.length-1&&e.globals.skipLastTimelinelabel&&(r="")}const g=s.drawText({x:d,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-("top"===e.config.xaxis.position?e.layout.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:r,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.axisFontFamily,fontWeight:e.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:`apexcharts-xaxis-label ${e.config.xaxis.labels.style.cssClass}`});a.add(g),this.addTooltip(g,r),n+=o}return this.inversedYAxisTitleText(i),this.inversedYAxisBorder(i),i}inversedYAxisBorder(t){const e=this.w,s=new gt(this.w),i=e.config.xaxis.axisBorder;if(i.show){let a=0;"bar"===e.config.chart.type&&e.axisFlags.isXNumeric&&(a-=15);const r=s.drawLine(e.globals.padHorizontal+a+i.offsetX,this.xAxisoffX,e.layout.gridWidth,this.xAxisoffX,i.color,0,i.height);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(r):t.add(r)}}inversedYAxisTitleText(t){const e=this.w,s=new gt(this.w);if(void 0!==e.config.xaxis.title.text){const i=s.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),a=s.drawText({x:e.layout.gridWidth/2+e.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(e.config.xaxis.title.style.fontSize)+e.config.xaxis.title.offsetY+20,text:e.config.xaxis.title.text,textAnchor:"middle",fontSize:e.config.xaxis.title.style.fontSize,fontFamily:e.config.xaxis.title.style.fontFamily,fontWeight:e.config.xaxis.title.style.fontWeight,foreColor:e.config.xaxis.title.style.color,cssClass:`apexcharts-xaxis-title-text ${e.config.xaxis.title.style.cssClass}`});i.add(a),t.add(i)}}yAxisTitleRotate(t,e){const s=this.w,i=new gt(this.w),a=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-texts-g`),r=a?a.getBoundingClientRect():{width:0,height:0},o=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-title text`),n=o?o.getBoundingClientRect():{width:0,height:0};if(o){const a=this.xPaddingForYAxisTitle(t,r,n,e);o.setAttribute("x",String(a.xPos-(e?10:0)));const l=i.rotateAroundCenter(o);o.setAttribute("transform",`rotate(${e?-1*s.config.yaxis[t].title.rotate:s.config.yaxis[t].title.rotate} ${l.x} ${l.y})`)}}xPaddingForYAxisTitle(t,e,s,i){const a=this.w;let r=0,o=10;return void 0===a.config.yaxis[t].title.text||t<0?{xPos:r,padd:0}:(i?r=e.width+a.config.yaxis[t].title.offsetX+s.width/2+o/2:(r=-1*e.width+a.config.yaxis[t].title.offsetX+o/2+s.width/2,a.globals.isBarHorizontal&&(o=25,r=-1*e.width-a.config.yaxis[t].title.offsetX-o)),{xPos:r,padd:o})}setYAxisXPosition(t,e){const s=this.w;let i=0,a=0,r=18,o=1;s.config.yaxis.length>1&&(this.multipleYs=!0),s.config.yaxis.forEach((n,l)=>{const h=s.globals.ignoreYAxisIndexes.includes(l)||!n.show||n.floating||0===t[l].width,c=t[l].width+e[l].width;n.opposite?s.globals.isBarHorizontal?(a=s.layout.gridWidth+s.layout.translateX-1,s.globals.translateYAxisX[l]=a-n.labels.offsetX):(a=s.layout.gridWidth+s.layout.translateX+o,h||(o+=c+20),s.globals.translateYAxisX[l]=a-n.labels.offsetX+20):(i=s.layout.translateX-r,h||(r+=c+20),s.globals.translateYAxisX[l]=i+n.labels.offsetX)})}setYAxisTextAlignments(){const t=this.w;Array.from(t.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach((e,s)=>{const i=t.config.yaxis[s];if(i&&!i.floating&&void 0!==i.labels.align){const e=t.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${s}'] .apexcharts-yaxis-texts-g`),a=Array.from(t.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${s}'] .apexcharts-yaxis-label`)),r=e.getBoundingClientRect();a.forEach(t=>{t.setAttribute("text-anchor",i.labels.align)}),"left"!==i.labels.align||i.opposite?"center"===i.labels.align?e.setAttribute("transform",`translate(${r.width/2*(i.opposite?1:-1)}, 0)`):"right"===i.labels.align&&i.opposite&&e.setAttribute("transform",`translate(${r.width}, 0)`):e.setAttribute("transform",`translate(-${r.width}, 0)`)}})}}class Lt{constructor(t,e){this.w=t,this.ctx=e,this.documentEvent=this.documentEvent.bind(this)}addEventListener(t,e){const s=this.w;Object.prototype.hasOwnProperty.call(s.globals.events,t)?s.globals.events[t].push(e):s.globals.events[t]=[e]}removeEventListener(t,e){const s=this.w;if(!Object.prototype.hasOwnProperty.call(s.globals.events,t))return;const i=s.globals.events[t].indexOf(e);-1!==i&&s.globals.events[t].splice(i,1)}fireEvent(t,e){const s=this.w;if(!Object.prototype.hasOwnProperty.call(s.globals.events,t))return;e&&e.length||(e=[]);const i=s.globals.events[t],a=i.length;for(let t=0;t<a;t++)i[t].apply(null,e)}setupEventHandlers(){const t=this.w,e=this.ctx,s=t.dom.baseEl.querySelector(t.globals.chartClass);this.ctx.eventList.forEach(i=>{null==s||s.addEventListener(i,s=>{const i=null===s.target.getAttribute("i")&&-1!==t.interact.capturedSeriesIndex?t.interact.capturedSeriesIndex:s.target.getAttribute("i"),a=null===s.target.getAttribute("j")&&-1!==t.interact.capturedDataPointIndex?t.interact.capturedDataPointIndex:s.target.getAttribute("j"),r=Object.assign({},t,{seriesIndex:t.globals.axisCharts?i:0,dataPointIndex:a});"keydown"===s.type?t.config.chart.accessibility.enabled&&t.config.chart.accessibility.keyboard.enabled&&(e.ctx.keyboardNavigation&&e.ctx.keyboardNavigation.handleKey(s),"function"==typeof t.config.chart.events.keyDown&&t.config.chart.events.keyDown(s,e,r),e.ctx.events.fireEvent("keydown",[s,e,r])):"keyup"===s.type?t.config.chart.accessibility.enabled&&t.config.chart.accessibility.keyboard.enabled&&("function"==typeof t.config.chart.events.keyUp&&t.config.chart.events.keyUp(s,e,r),e.ctx.events.fireEvent("keyup",[s,e,r])):"mousemove"===s.type||"touchmove"===s.type?"function"==typeof t.config.chart.events.mouseMove&&t.config.chart.events.mouseMove(s,e,r):"mouseleave"===s.type||"touchleave"===s.type?"function"==typeof t.config.chart.events.mouseLeave&&t.config.chart.events.mouseLeave(s,e,r):("mouseup"===s.type&&1===s.which||"touchend"===s.type)&&("function"==typeof t.config.chart.events.click&&t.config.chart.events.click(s,e,r),e.ctx.events.fireEvent("click",[s,e,r]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(e=>{t.dom.baseEl.addEventListener(e,this.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}documentEvent(t){const e=this.w,s=t.target.className;if("click"===t.type){const t=e.dom.baseEl.querySelector(".apexcharts-menu");t&&t.classList.contains("apexcharts-menu-open")&&"apexcharts-menu-icon"!==s&&t.classList.remove("apexcharts-menu-open")}e.interact.clientX="touchmove"===t.type?t.touches[0].clientX:t.clientX,e.interact.clientY="touchmove"===t.type?t.touches[0].clientY:t.clientY}}class Dt{constructor(t){this.w=t}setCurrentLocaleValues(t){let e=this.w.config.chart.locales;const s=c.getApex();s.chart&&s.chart.locales&&s.chart.locales.length>0&&(e=this.w.config.chart.locales.concat(s.chart.locales));const i=e.filter(e=>e.name===t)[0];if(!i)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");{const t=b.extend(S,i);this.w.globals.locale=t.options}}}class Mt{constructor(t,e){this.w=t,this.ctx=e}drawAxis(t,e){const s=this.w.globals,i=this.w.config,a=new At(this.w,this.ctx,e),r=new _t(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale},e);if(s.axisCharts&&"radar"!==t){let t,e;s.isBarHorizontal?(e=r.drawYaxisInversed(0),t=a.drawXaxisInversed(0),this.w.dom.elGraphical.add(t),this.w.dom.elGraphical.add(e)):(t=a.drawXaxis(),this.w.dom.elGraphical.add(t),i.yaxis.map((t,i)=>{if(-1===s.ignoreYAxisIndexes.indexOf(i)&&(e=r.drawYaxis(i),this.w.dom.Paper.add(e),"back"===this.w.config.grid.position)){const t=this.w.dom.Paper.children()[1];t&&(t.remove(),this.w.dom.Paper.add(t))}}))}}}class Et{constructor(t){this.w=t}drawXCrosshairs(){const t=this.w,e=new gt(this.w),s=new dt(this.w),i=t.config.xaxis.crosshairs.fill.gradient,a=t.config.xaxis.crosshairs.dropShadow,r=t.config.xaxis.crosshairs.fill.type,o=i.colorFrom,n=i.colorTo,l=i.opacityFrom,h=i.opacityTo,c=i.stops,d=a.enabled,g=a.left,p=a.top,u=a.blur,x=a.color,f=a.opacity;let m=t.config.xaxis.crosshairs.fill.color;if(t.config.xaxis.crosshairs.show){"gradient"===r&&(m=e.drawGradient("vertical",o,n,l,h,null,c,[]));let i=e.drawRect();1===t.config.xaxis.crosshairs.width&&(i=e.drawLine(0,0,0,0));let a=t.layout.gridHeight;(!b.isNumber(a)||a<0)&&(a=0);let y=t.config.xaxis.crosshairs.width;(!b.isNumber(y)||Number(y)<0)&&(y=0),i.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:a,width:y,height:a,fill:m,filter:"none","fill-opacity":t.config.xaxis.crosshairs.opacity,stroke:t.config.xaxis.crosshairs.stroke.color,"stroke-width":t.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":t.config.xaxis.crosshairs.stroke.dashArray}),d&&(i=s.dropShadow(i,{left:g,top:p,blur:u,color:x,opacity:f})),t.dom.elGraphical.add(i)}}drawYCrosshairs(){const t=this.w,e=new gt(this.w),s=t.config.yaxis[0].crosshairs,i=t.globals.barPadForNumericAxis;if(t.config.yaxis[0].crosshairs.show){const a=e.drawLine(-i,0,t.layout.gridWidth+i,0,s.stroke.color,s.stroke.dashArray,s.stroke.width);a.attr({class:"apexcharts-ycrosshairs"}),t.dom.elGraphical.add(a)}const a=e.drawLine(-i,0,t.layout.gridWidth+i,0,s.stroke.color,0,0);a.attr({class:"apexcharts-ycrosshairs-hidden"}),t.dom.elGraphical.add(a)}}function Pt(t,e){if(!b.isObject(t)||!b.isObject(e))return void 0!==e?e:t;const s=n({},t);for(const i of Object.keys(e)){const a=e[i];void 0!==a&&(b.isObject(a)&&b.isObject(t[i])?s[i]=Pt(t[i],a):s[i]=a)}return s}class Ft{constructor(t){this.w=t,this._activeBreakpoint=null}checkResponsiveConfig(t){const e=this.w,s=e.config;if(0===s.responsive.length)return;const i=s.responsive.slice();i.sort((t,e)=>t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0).reverse();const a=new _({}),r=(t={})=>{var s;const r=i[0].breakpoint,o=c.isBrowser()?window.innerWidth>0?window.innerWidth:screen.width:0;if(o>r){if(null!==this._activeBreakpoint){if(!e.globals.initialConfig)return;const s=b.clone(e.globals.initialConfig);s.series=b.clone(e.config.series);const i=P.extendArrayProps(a,s,e);t=b.extend(i,t),this.overrideResponsiveOptions(t),this._activeBreakpoint=null}}else for(let r=0;r<i.length;r++)if(o<i[r].breakpoint){const o=(null==(s=i[r].options)?void 0:s.yaxis)?b.clone(i[r].options.yaxis):null;if(t=P.extendArrayProps(a,i[r].options,e),t=b.extend(e.config,t),Array.isArray(e.config.yaxis)&&o){const s=Array.isArray(o)?o:[o];t=l(n({},t),{yaxis:e.config.yaxis.map((t,e)=>Pt(t,s[e]))})}this.overrideResponsiveOptions(t),this._activeBreakpoint=i[r].breakpoint}};if(t){let s=P.extendArrayProps(a,t,e);s=b.extend(e.config,s),s=b.extend(s,t),r(s)}else r({})}overrideResponsiveOptions(t){const e=new _(t).init({responsiveOverride:!0});this.w.config=e}}const Tt=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function It(t,e){const{ax:s,bx:i,ay:a,by:r}=e,o=[],n=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let l;for(;null!==(l=n.exec(t));){const t=l[1].toUpperCase(),e=(l[2].match(Tt)||[]).map(parseFloat);if("Z"===t){o.push("z");continue}if("H"===t){for(const t of e)o.push(`H ${s*t+i}`);continue}if("V"===t){for(const t of e)o.push(`V ${a*t+r}`);continue}if("A"===t){for(let t=0;t+6<e.length;t+=7)o.push(`A ${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${s*e[t+5]+i} ${a*e[t+6]+r}`);continue}const n=[];for(let t=0;t+1<e.length;t+=2)n.push(`${s*e[t]+i} ${a*e[t+1]+r}`);n.length&&o.push(`${t} ${n.join(" ")}`)}return o.join(" ")}function Xt(t,e,s){if(!t||"string"!=typeof t)return null;const i=R(t);if(!i.length||"M"!==i[0][0])return null;for(let t=1;t<i.length;t++)if("M"===i[t][0])return null;let a=i,r=null;if(s){if(i.length<5)return null;if(r=i.slice(-3),a=i.slice(0,-3),"Z"!==r[2][0])return null;if("L"!==r[1][0])return null;if("L"!==r[0][0]&&"C"!==r[0][0])return null}else if("Z"===i[i.length-1][0])return null;if(a.length!==e||a.length<2)return null;const o=a[1][0];if("L"!==o&&"C"!==o)return null;for(let t=2;t<a.length;t++)if(a[t][0]!==o)return null;const n=a.map(t=>"C"===t[0]?[Number(t[5]),Number(t[6])]:[Number(t[1]),Number(t[2])]);for(const t of n)if(!isFinite(t[0])||!isFinite(t[1]))return null;return{body:a,closing:r,segType:o,anchors:n}}function Rt(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}function zt(t,e,s){const i=t,a=[e[1],e[2]],r=[e[3],e[4]],o=[e[5],e[6]],n=Rt(i,a,s),l=Rt(a,r,s),h=Rt(r,o,s),c=Rt(n,l,s),d=Rt(l,h,s),g=Rt(c,d,s);return{first:["C",n[0],n[1],c[0],c[1],g[0],g[1]],second:["C",d[0],d[1],h[0],h[1],o[0],o[1]],mid:g}}function Bt(t,e,s){const i=[e[1],e[2]],a=Rt(t,i,s);return{first:["L",a[0],a[1]],second:["L",i[0],i[1]],mid:a}}function Yt(t,e){const{body:s,closing:i,segType:a,anchors:r}=t,o=r.length,n=e.length,l=t=>"C"===a?["C",t[0],t[1],t[0],t[1],t[0],t[1]]:["L",t[0],t[1]],h=[["M",r[0][0],r[0][1]]];let c=0;for(;c<n&&0!==e[c];)c++;for(let t=1;t<=c;t++)h.push(l(r[0]));let d=c+1;for(let t=0;t<o-1;t++){let i=0;for(;d+i<n&&-1===e[d+i];)i++;const o=s[t+1];if(i){const e=i+1;let s=r[t],n=o;for(let t=0;t<i;t++){const i=1/(e-t),r="C"===a?zt(s,n,i):Bt(s,n,i);h.push(r.first),s=r.mid,n=r.second}h.push(n)}else h.push(o.slice());d+=i+1}for(;d<n;)h.push(l(r[o-1])),d++;return i&&i.forEach(t=>h.push(t.slice())),h}function Nt(t,e,s,i,a,r){const o=Xt(t,i,r);if(!o)return null;const n=Xt(e,a,r);if(!n)return null;if(o.segType!==n.segType)return null;if((o.closing||n.closing)&&(!o.closing||!n.closing||o.closing[0][0]!==n.closing[0][0]))return null;const l=s.map(t=>t.oldJ),h=s.map(t=>t.newJ);return{from:B(Yt(o,l)),toInterp:B(Yt(n,h))}}function Ot(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const i=null!=(e=s.largeDatasetThreshold)?e:0;return!(i>0&&t.globals.dataPoints>i)&&!!(c.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function Ht(t,e,s){var i,a,r,o;if(null==(i=t.axisFlags)?void 0:i.isXNumeric){const i=null==(r=null==(a=t.seriesData)?void 0:a.seriesX)?void 0:r[e];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const n=null==(o=t.globals.labels)?void 0:o[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}function Wt(t){const e=new Map;return t.map(t=>{const s=e.get(t)||0;return e.set(t,s+1),0===s?t:`${t}#${s}`})}function $t(t,e,s=!1){var i,a;if(!Ot(t))return null;const r=t.globals.prevStreamFrame;if(!r)return null;const o=null==(i=r.seriesY)?void 0:i[e],n=null==(a=t.seriesData.series)?void 0:a[e];if(!Array.isArray(o)||!Array.isArray(n))return null;if(!o.length||!n.length)return null;const l=Wt(o.map((t,s)=>function(t,e,s){var i,a;if(t.isXNumeric){const a=null==(i=t.seriesX)?void 0:i[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const r=null==(a=t.labels)?void 0:a[s];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+s}(r,e,s))),h=Wt(n.map((s,i)=>Ht(t,e,i))),c=function(t,e){const s=new Map;t.forEach((t,e)=>{s.has(t)||s.set(t,e)});const i=new Array(e.length),a=new Set;let r=-1,o=!0,n=t.length===e.length;e.forEach((t,e)=>{const l=s.has(t)&&!a.has(s.get(t))?s.get(t):-1;i[e]=l,-1!==l&&(a.add(l),l<r&&(o=!1),r=l),l!==e&&(n=!1)});const l=[];for(let e=0;e<t.length;e++)a.has(e)||l.push(e);return{toOld:i,exits:l,ordered:o,changed:!n}}(l,h);return c.ordered&&(c.changed||s)?{join:c,oldKeys:l,newKeys:h}:null}function jt(t){var e,s;const i=t.config.chart.animations;return st(null!=(s=null==(e=i.dynamicAnimation)?void 0:e.easing)?s:i.easing)}function Gt(t,e,s,i,a){const r=performance.now(),o=n=>{if(t.globals.isDestroyed)return;const l=Math.max(0,Math.min(1,(n-r)/e));i(s(l),l),l<1?m.requestAnimationFrame(o):a&&a()};m.requestAnimationFrame(o)}function Vt(t,{elPointsMain:e,realIndex:s,speed:i}){var a,r,o,n;if(!(null==e?void 0:e.node))return!1;const l=$t(t,s,!0);if(!l)return!1;const h=t.globals.prevStreamFrame;if(!h)return!1;const c=null==(a=h.xPixels)?void 0:a[s],d=null==(r=h.yPixels)?void 0:r[s];if(!c||!d)return!1;const g=e.node.querySelectorAll(".apexcharts-marker");if(!g.length)return!1;const p=(null==(o=t.globals.seriesXvalues)?void 0:o[s])||[],u=(null==(n=t.globals.seriesYvalues)?void 0:n[s])||[],x=jt(t),f=Math.max(1,i||1);return e.node.classList.remove("apexcharts-element-hidden"),g.forEach(e=>{var i,a,r,o,n,g,m,b,y;const w=parseInt(null!=(a=null!=(i=e.getAttribute("j"))?i:e.getAttribute("rel"))?a:"",10);if(!isFinite(w)||w<0||w>=l.join.toOld.length)return;const v=l.join.toOld[w],A=null!=p[w]&&null!=u[w]?[p[w],u[w]]:null;if(-1===v||!A){const s=e.style;return s.opacity="0",void Gt(t,f,x,t=>{s.opacity=String(t)},()=>{s.opacity=""})}const C=(null!=(r=c[v])?r:NaN)-A[0],S=(null!=(o=d[v])?o:NaN)-A[1];if(!isFinite(C)||!isFinite(S))return;const k=null!=(m=null==(g=null==(n=h.rPixels)?void 0:n[s])?void 0:g[v])?m:NaN,_=parseFloat(null!=(y=null!=(b=e.getAttribute("r"))?b:e.getAttribute("default-marker-size"))?y:""),L=isFinite(k)&&isFinite(_)&&_>0&&Math.abs(k-_)>.25;if(!(Math.abs(C)>=.5||Math.abs(S)>=.5)&&!L)return;const D=t=>{const s=C*(1-t),i=S*(1-t);if(L){const a=(k+(_-k)*t)/_;e.setAttribute("transform",`translate(${s+A[0]*(1-a)}, ${i+A[1]*(1-a)}) scale(${a})`)}else e.setAttribute("transform",`translate(${s}, ${i})`)};D(0),Gt(t,f,x,D,()=>{e.removeAttribute("transform")})}),!0}function Ut(t,{type:e,realIndex:s,pathFromLine:i,pathFromArea:a,linePaths:r,areaPaths:o}){var n,l;const h=$t(t,s);if(!h)return null;const{join:c,oldKeys:d,newKeys:g}=h,p=t.globals.prevStreamFrame;if(!p)return null;const u=null==(n=p.seriesY)?void 0:n[s],x=null==(l=t.seriesData.series)?void 0:l[s];if(u.length<2||x.length<2)return null;if(u.some(t=>null===t)||x.some(t=>null===t))return null;const f=function(t,e){const s=new Set(t.exits),i=[];let a=0;for(let e=0;e<t.toOld.length;e++){const r=t.toOld[e];if(-1!==r){for(;a<r;)s.has(a)&&i.push({oldJ:a,newJ:-1}),a++;i.push({oldJ:r,newJ:e}),a=r+1}else i.push({oldJ:-1,newJ:e})}for(;a<e;)s.has(a)&&i.push({oldJ:a,newJ:-1}),a++;return i}(c,d.length),m={};return Array.isArray(r)&&1===r.length&&i&&(m.line=Nt(i,r[0],f,d.length,g.length,!1)),"area"===e&&Array.isArray(o)&&1===o.length&&a&&(m.area=Nt(a,o[0],f,d.length,g.length,!0)),m.line||m.area?m:null}function qt({w:t,elSeries:e,record:s,newKeys:i,isHorizontal:a,speed:r}){var o;if(!Ot(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const n=new Set(i),l=s.paths.filter(t=>t&&t.d&&null!=t.key&&!n.has(t.key));if(!l.length)return;const h=new gt(t),c=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];l.forEach(s=>{let i=s.fill||c||"#c8c8c8";0===String(i).indexOf("url(")&&(i=c||"#c8c8c8");const o=h.drawPath({d:s.d,stroke:"none",strokeWidth:0,fill:i,fillOpacity:1,classes:"apexcharts-bar-ghost"}),n=o.node;n.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(n,e.node.firstChild);const l=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),i=parseFloat(e[2]);return isFinite(s)&&isFinite(i)?{x:s,y:i}:null}(s.d);let d=a?"left center":"center bottom";try{const t=n.getBBox();l&&t&&(d=a?Math.abs(l.x-t.x)<=Math.abs(l.x-(t.x+t.width))?"left center":"right center":Math.abs(l.y-(t.y+t.height))<=Math.abs(l.y-t.y)?"center bottom":"center top")}catch(t){}const g=n.style;g.transformBox="fill-box",g.transformOrigin=d;const p=Math.max(1,r||1),u=performance.now(),x=e=>{if(t.globals.isDestroyed||!n.parentNode)return;const s=Math.max(0,Math.min(1,(e-u)/p)),i=1-Math.pow(1-s,3),r=1-i;g.transform=a?`scaleX(${r})`:`scaleY(${r})`,g.opacity=String(1-i),s<1?m.requestAnimationFrame(x):n.parentNode.removeChild(n)};m.requestAnimationFrame(x)})}function Zt(t,e,s){return[...t.querySelectorAll(e)].map(t=>{var e,i,a;return{text:t.textContent||"",display:null!=(a=null!=(i=null==(e=t.querySelector("tspan"))?void 0:e.textContent)?i:t.textContent)?a:"",pos:parseFloat(t.getAttribute(s)||""),transform:t.getAttribute("transform")}})}function Kt(t,e,s){return[...t.querySelectorAll(e)].map(t=>parseFloat(t.getAttribute(s)||""))}const Jt=":not(.apexcharts-tick-ghost)",Qt=`.apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)${Jt}`,te=`.apexcharts-yaxis-texts-g text${Jt}`,ee=`.apexcharts-gridlines-vertical line${Jt}`,se=`.apexcharts-gridlines-horizontal line${Jt}`;function ie(t){var e,s;const i=t.globals;if(!(null==(e=t.axisFlags)?void 0:e.isXNumeric)||i.isBarHorizontal)return null;if(null==(s=t.config.xaxis)?void 0:s.reversed)return null;const a=i.minX,r=i.maxX,o=t.layout.gridWidth;return isFinite(a)&&isFinite(r)&&r>a&&o>0?{min:a,max:r,width:o}:null}function ae(t,e){var s;const i=t.globals;if(i.isBarHorizontal)return null;if(!Array.isArray(t.config.yaxis)||1!==t.config.yaxis.length)return null;if(null==(s=t.config.yaxis[0])?void 0:s.logarithmic)return null;const a=i.minY,r=i.maxY;if(!(isFinite(a)&&isFinite(r)&&r>a))return null;const o=e.map(t=>t.pos).filter(t=>isFinite(t));return o.length<2?null:{min:a,max:r,pLo:Math.max(...o),pHi:Math.min(...o)}}function re(t,e){if(!t||!e)return null;const s=t.pHi-t.pLo,i=e.pHi-e.pLo,a=t.max-t.min,r=e.max-e.min;if(!(s&&i&&a>0&&r>0))return null;return{toNew:o=>e.pLo+((e=>t.min+(e-t.pLo)/s*a)(o)-e.min)/r*i,toOld:o=>t.pLo+((t=>e.min+(t-e.pLo)/i*r)(o)-t.min)/a*s}}function oe(t,e,s,i){const a=e.style;a.opacity="0",Gt(t,s,i,t=>{a.opacity=String(t)},()=>{a.opacity=""})}function ne(t,e,s,i,a,r,o){s.forEach(t=>e.setAttribute(t,String(i))),Gt(t,r,o,t=>{const r=String(i+(a-i)*t);s.forEach(t=>e.setAttribute(t,r))},()=>{s.forEach(t=>e.setAttribute(t,String(a)))})}function le(t,{template:e,display:s,attrs:i,from:a,to:r,duration:o,ease:n}){const l=e.parentNode;if(!l)return;const h=e.cloneNode(!0);if(h.classList.add("apexcharts-tick-ghost"),h.setAttribute("pointer-events","none"),h.removeAttribute("id"),void 0!==s){const t=h.querySelector("tspan");t?t.textContent=s:h.textContent=s;const e=h.querySelector("title");e&&(e.textContent=s)}i.forEach(t=>h.setAttribute(t,String(a)));const c=h.style;c.opacity="1",l.appendChild(h),Gt(t,o,n,t=>{const e=String(a+(r-a)*t);i.forEach(t=>h.setAttribute(t,e)),c.opacity=String(1-t)},()=>{h.parentNode&&h.parentNode.removeChild(h)})}function he(t,{newLabels:e,oldLabels:s,posAttr:i,newLines:a,oldLines:r,lineAttrs:o,duration:h,ease:c,project:d}){const g=new Map;s.forEach((t,e)=>{g.has(t.text)||g.set(t.text,l(n({},t),{i:e}))});const p=new Set,u=a.length===e.length,x=r.length===s.length,f=s.map(t=>t.pos).concat(e.map(t=>parseFloat(t.getAttribute(i)||""))).filter(t=>isFinite(t)),m=Math.min(...f),b=Math.max(...f),y=Math.max(40,.25*(b-m)),w=t=>Math.max(m-y,Math.min(b+y,t));if(e.forEach((e,s)=>{const n=parseFloat(e.getAttribute(i)||""),l=g.get(e.textContent||""),x=u?a[s]:null;if(l&&p.add(l.i),l&&isFinite(l.pos)&&!l.transform&&!e.getAttribute("transform")){if(isFinite(n)&&!(Math.abs(l.pos-n)<.5)&&(ne(t,e,[i],l.pos,n,h,c),x)){const e=parseFloat(x.getAttribute(o[0])||""),s=r[l.i];isFinite(e)&&isFinite(s)&&ne(t,x,o,s,e,h,c)}}else if(!l){if(d&&isFinite(n)&&!e.getAttribute("transform")){const s=isFinite(d.toOld(n))?w(d.toOld(n)):NaN;isFinite(s)&&Math.abs(s-n)>.5&&(ne(t,e,[i],s,n,h,c),x&&ne(t,x,o,s,n,h,c))}oe(t,e,h,c),x&&oe(t,x,h,c)}}),!d||!e.length)return;let v=0;s.forEach((s,n)=>{if(p.has(n))return;if(!isFinite(s.pos)||s.transform)return;if(v>=20)return;const l=d.toNew(s.pos);!isFinite(l)||Math.abs(l-s.pos)<.5||(v++,le(t,{template:e[0],display:s.display,attrs:[i],from:s.pos,to:w(l),duration:h,ease:c}),x&&a.length&&isFinite(r[n])&&le(t,{template:a[0],attrs:o,from:r[n],to:w(d.toNew(r[n])),duration:h,ease:c}))})}class ce{constructor(t,{toggleDataSeries:e,revertDefaultAxisMinMax:s,updateSeries:i}={}){this.w=t,this._toggleDataSeries=e||null,this._revertDefaultAxisMinMax=s||null,this._updateSeries=i||null,this.legendInactiveClass="legend-mouseover-inactive"}clearSeriesCache(){const t=this.w;t.globals.cachedSelectors&&(delete t.globals.cachedSelectors.allSeriesEls,delete t.globals.cachedSelectors.highlightSeriesEls)}getAllSeriesEls(){const t=this.w,e="allSeriesEls";return t.globals.cachedSelectors[e]||(t.globals.cachedSelectors[e]=t.dom.baseEl.getElementsByClassName("apexcharts-series")),t.globals.cachedSelectors[e]}getSeriesByName(t){return this.w.dom.baseEl.querySelector(`.apexcharts-inner .apexcharts-series[seriesName='${b.escapeString(t)}']`)}isSeriesHidden(t){var e;const s=this.getSeriesByName(t),i=parseInt(null!=(e=s.getAttribute("data:realIndex"))?e:"0",10);return{isHidden:s.classList.contains("apexcharts-series-collapsed"),realIndex:i}}addCollapsedClassToSeries(t,e){ce.addCollapsedClassToSeries(this.w,t,e)}static addCollapsedClassToSeries(t,e,s){function i(t){for(let i=0;i<t.length;i++)t[i].index===s&&e.node.classList.add("apexcharts-series-collapsed")}i(t.globals.collapsedSeries),i(t.globals.ancillaryCollapsedSeries)}toggleSeries(t){var e;const s=this.isSeriesHidden(t);return null==(e=this._toggleDataSeries)||e.call(this,s.realIndex,s.isHidden),s.isHidden}showSeries(t){var e;const s=this.isSeriesHidden(t);s.isHidden&&(null==(e=this._toggleDataSeries)||e.call(this,s.realIndex,!0))}hideSeries(t){var e;const s=this.isSeriesHidden(t);s.isHidden||null==(e=this._toggleDataSeries)||e.call(this,s.realIndex,!1)}resetSeries(t=!0,e=!0,s=!0){var i,a;const r=this.w;this.clearSeriesCache();let o=b.clone(r.globals.initialSeries);r.globals.previousPaths=[],s?(r.globals.collapsedSeries=[],r.globals.ancillaryCollapsedSeries=[],r.globals.collapsedSeriesIndices=[],r.globals.ancillaryCollapsedSeriesIndices=[]):o=this.emptyCollapsedSeries(o),r.config.series=o,t&&(e&&(r.interact.zoomed=!1,null==(i=this._revertDefaultAxisMinMax)||i.call(this)),null==(a=this._updateSeries)||a.call(this,o,r.config.chart.animations.dynamicAnimation.enabled))}emptyCollapsedSeries(t){const e=this.w;for(let s=0;s<t.length;s++)e.globals.collapsedSeriesIndices.indexOf(s)>-1&&(t[s].data=[]);return t}canvasRestyle(t){const e=this.w.globals.activeRenderer;e&&"canvas"===e.kind&&"function"==typeof e.restyle&&e.restyle(t)}highlightSeries(t){var e;const s=this.w,i=this.getSeriesByName(t),a=parseInt(null!=(e=null==i?void 0:i.getAttribute("data:realIndex"))?e:"",10),r="highlightSeriesEls";let o=s.globals.cachedSelectors[r];o||(o=s.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),s.globals.cachedSelectors[r]=o);let n=null,l=null,h=null;if(s.globals.axisCharts||"radialBar"===s.config.chart.type)if(s.globals.axisCharts){n=s.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${a}']`),l=s.dom.baseEl.querySelector(`.apexcharts-datalabels[data\\:realIndex='${a}']`);const t=s.globals.seriesYAxisReverseMap[a];h=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}']`)}else n=s.dom.baseEl.querySelector(`.apexcharts-series[rel='${a+1}']`);else n=s.dom.baseEl.querySelector(`.apexcharts-series[rel='${a+1}'] path`);for(let t=0;t<o.length;t++){o[t].classList.add(this.legendInactiveClass)}if(n){if(!s.globals.axisCharts){const t=n.parentNode;null==t||t.classList.remove(this.legendInactiveClass)}n.classList.remove(this.legendInactiveClass),null!==l&&l.classList.remove(this.legendInactiveClass),null!==h&&h.classList.remove(this.legendInactiveClass)}else for(let t=0;t<o.length;t++){o[t].classList.remove(this.legendInactiveClass)}this.canvasRestyle(n&&!Number.isNaN(a)?{active:a,opacity:.2}:null)}toggleSeriesOnHover(t,e){const s=this.w;e||(e=t.target);const i=s.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if("mousemove"===t.type){const t=parseInt(e.getAttribute("rel"),10)-1;this.highlightSeries(s.seriesData.seriesNames[t])}else if("mouseout"===t.type){for(let t=0;t<i.length;t++)i[t].classList.remove(this.legendInactiveClass);this.canvasRestyle(null)}}highlightRangeInSeries(t,e){const s=this.w,i=s.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),a=t=>{for(let e=0;e<i.length;e++){const s=i[e].classList;"function"==typeof s[t]&&s[t](this.legendInactiveClass)}};if("reset"===e)return void a("remove");const r=s.config.plotOptions.heatmap.colorScale.ranges,o=r&&r[t];if(o){a("add");for(let t=0;t<i.length;t++){const e=Number(i[t].getAttribute("val"));e>=o.from&&e<=o.to&&i[t].classList.remove(this.legendInactiveClass)}}}getActiveConfigSeriesIndex(t="asc",e=[]){const s=this.w;let i=0;if(s.config.series.length>1){const a=s.config.series.map((t,i)=>t.data&&t.data.length>0&&-1===s.globals.collapsedSeriesIndices.indexOf(i)&&(!s.globals.comboCharts||0===e.length||e.length&&e.indexOf(s.config.series[i].type)>-1)?i:-1);for(let e="asc"===t?0:a.length-1;"asc"===t?e<a.length:e>=0;"asc"===t?e++:e--)if(-1!==a[e]){i=a[e];break}}return i}getBarSeriesIndices(){return this.w.globals.comboCharts?this.w.config.series.map((t,e)=>"bar"===t.type||"column"===t.type?e:-1).filter(t=>-1!==t):this.w.config.series.map((t,e)=>e)}getPreviousPaths(){var t,e,s,i;const a=this.w;if(function(t){var e,s,i;const a=t.globals;if(!a.axisCharts||!t.seriesData||!Array.isArray(t.seriesData.series)||0===t.seriesData.series.length)return void(a.prevStreamFrame=null);const r=[];(null==(s=null==(e=t.dom)?void 0:e.baseEl)?void 0:s.querySelectorAll)&&t.dom.baseEl.querySelectorAll(".apexcharts-marker").forEach(t=>{var e,s,i,a,o;const n=parseInt(null!=(e=t.getAttribute("index"))?e:"",10),l=parseInt(null!=(i=null!=(s=t.getAttribute("j"))?s:t.getAttribute("rel"))?i:"",10),h=parseFloat(null!=(o=null!=(a=t.getAttribute("r"))?a:t.getAttribute("default-marker-size"))?o:"");isFinite(n)&&isFinite(l)&&isFinite(h)&&((r[n]=r[n]||[])[l]=h)}),a.prevStreamFrame={seriesX:(t.seriesData.seriesX||[]).slice(),seriesY:t.seriesData.series.slice(),xPixels:(a.seriesXvalues||[]).slice(),yPixels:(a.seriesYvalues||[]).slice(),rPixels:r,labels:(a.labels||[]).slice(),isXNumeric:!!(null==(i=t.axisFlags)?void 0:i.isXNumeric)}}(a),function(t){const e=t.globals;if(e.prevChromeFrame=null,!e.axisCharts||!c.isBrowser())return;const s=t.dom.baseEl;if(b.elementExists(s))try{const i=Zt(s,te,"y");e.prevChromeFrame={xLabels:Zt(s,Qt,"x"),yLabels:i,vGrid:Kt(s,ee,"x1"),hGrid:Kt(s,se,"y1"),xScale:ie(t),yAnchors:ae(t,i)}}catch(t){e.prevChromeFrame=null}}(a),!a.globals.axisCharts)return void(a.globals.previousPaths=a.seriesData.series);if(!b.elementExists(a.dom.baseEl))return void(a.globals.previousPaths=[]);function r(t,e,s){const i=t[e].childNodes,r={type:s,paths:[],realIndex:t[e].getAttribute("data:realIndex")};for(let t=0;t<i.length;t++)if(i[t].hasAttribute("pathTo")){const e=i[t].getAttribute("pathTo");r.paths.push({d:e,key:i[t].getAttribute("data:pathKey"),fill:i[t].getAttribute("fill")})}a.globals.previousPaths.push(r)}a.globals.previousPaths=[];["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(t=>{const e=(s=t,a.dom.baseEl.querySelectorAll(`.apexcharts-${s}-series .apexcharts-series`));var s;for(let s=0;s<e.length;s++)r(e,s,t)});const o=a.dom.baseEl.querySelectorAll(`.apexcharts-${a.config.chart.type} .apexcharts-series`);if(o.length>0)for(let r=0;r<o.length;r++){const o=a.dom.baseEl.querySelectorAll(`.apexcharts-${a.config.chart.type} .apexcharts-series[data\\:realIndex='${r}'] rect`),n=[];for(let a=0;a<o.length;a++){const r=t=>o[a].getAttribute(t),l={x:parseFloat(null!=(t=r("x"))?t:"0"),y:parseFloat(null!=(e=r("y"))?e:"0"),width:parseFloat(null!=(s=r("width"))?s:"0"),height:parseFloat(null!=(i=r("height"))?i:"0")};n.push({rect:l,color:o[a].getAttribute("color")})}a.globals.previousPaths.push(n)}}clearPreviousPaths(){const t=this.w;t.globals.previousPaths=[],t.globals.allSeriesCollapsed=!1}handleNoData(){const t=this.w,e=t.config.noData,s=new gt(this.w);let i=t.globals.svgWidth/2,a=t.globals.svgHeight/2,r="middle";if(t.globals.noData=!0,t.globals.animationEnded=!0,"left"===e.align?(i=10,r="start"):"right"===e.align&&(i=t.globals.svgWidth-10,r="end"),"top"===e.verticalAlign?a=50:"bottom"===e.verticalAlign&&(a=t.globals.svgHeight-50),i+=e.offsetX,a=a+parseInt(e.style.fontSize,10)+2+e.offsetY,void 0!==e.text&&""!==e.text){const o=s.drawText({x:i,y:a,text:e.text,textAnchor:r,fontSize:e.style.fontSize,fontFamily:e.style.fontFamily,foreColor:e.style.color,opacity:1,cssClass:"apexcharts-text-nodata"});t.dom.Paper.add(o)}}setNullSeriesToZeroValues(t){const e=this.w;for(let s=0;s<t.length;s++)if(0===t[s].length)for(let i=0;i<t[e.globals.maxValsInArrayIndex].length;i++)t[s].push(0);return t}hasAllSeriesEqualX(){let t=!0;const e=this.w,s=this.filteredSeriesX();for(let e=0;e<s.length-1;e++)if(s[e][0]!==s[e+1][0]){t=!1;break}return e.globals.allSeriesHasEqualX=t,t}filteredSeriesX(){return this.w.seriesData.seriesX.map(t=>t.length>0?t:[])}}const de={accent:"--apx-accent",fore:"--apx-fore",grid:"--apx-grid",surface:"--apx-surface"};const ge="__apexcharts_themes__";function pe(){return globalThis[ge]}globalThis[ge]||(globalThis[ge]={});const ue="#373d3f",xe="#f6f7f8",fe="#e0e0e0";class me{constructor(t){this.w=t,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed(),this._tokens={},this._namedTheme=null}checkHeatmapDistributed(){const{chart:t,plotOptions:e}=this.w.config;return"treemap"===t.type&&e.treemap&&e.treemap.distributed||"heatmap"===t.type&&e.heatmap&&e.heatmap.distributed}checkBarDistributed(){const{chart:t,plotOptions:e}=this.w.config;return e.bar&&e.bar.distributed&&("bar"===t.type||"rangeBar"===t.type)}init(){this.setDefaultColors()}setDefaultColors(){var t;const e=this.w,s=new b;var i;this._namedTheme=(i=e.config.theme.name)&&pe()[i]||null,this._applyNamedThemeMode(),e.dom.elWrap.classList.add(`apexcharts-theme-${e.config.theme.mode||"light"}`),this._applyModeDefaults(),this._tokens=this._resolveTokens(),this.applyTokenChrome(this._tokens);const a=null==(t=e.config.theme.accessibility)?void 0:t.colorBlindMode;if(a){e.globals.colors=this.getColorBlindColors(a),this.applySeriesColors(e.seriesData.seriesColors,e.globals.colors);const t=e.globals.colors.slice();return this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],t),this.applyDataLabelsColors(t),this.applyRadarPolygonsColors(),this.applyMarkersColors(t),void("highContrast"===a&&e.dom.elWrap.classList.add("apexcharts-high-contrast"))}const r=[...e.config.colors||e.config.fill.colors||[]];e.globals.colors=this.getColors(r),this.applySeriesColors(e.seriesData.seriesColors,e.globals.colors),e.config.theme.monochrome.enabled&&(e.globals.colors=this.getMonochromeColors(e.config.theme.monochrome,e.seriesData.series,s));const o=e.globals.colors.slice();this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],o),this.applyDataLabelsColors(o),this.applyRadarPolygonsColors(),this.applyMarkersColors(o)}_applyModeDefaults(){const t=this.w,e=t.config.theme.mode;"dark"===e?(t.config.chart.foreColor===ue&&(t.config.chart.foreColor=xe),"palette1"===t.config.theme.palette&&(t.config.theme.palette="palette4"),t.config.tooltip&&"light"!==t.config.tooltip.theme&&(t.config.tooltip.theme="dark")):"light"===e&&(t.config.chart.foreColor===xe&&(t.config.chart.foreColor=ue),"palette4"===t.config.theme.palette&&(t.config.theme.palette="palette1"))}_applyNamedThemeMode(){const t=this._namedTheme;if(!t)return;const e=this.w.config.theme;t.mode&&!e.mode&&(e.mode=t.mode),!t.accessibility||!t.accessibility.colorBlindMode||e.accessibility&&e.accessibility.colorBlindMode||(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode=t.accessibility.colorBlindMode),t.monochrome&&t.monochrome.enabled&&!e.monochrome.enabled&&(e.monochrome=n(n({},e.monochrome),t.monochrome))}_resolveTokens(){const t=this._namedTheme&&this._namedTheme.tokens||{},e=this._shouldUseTokens()?function(t){if(!c.isBrowser())return{};const e=t.dom&&(t.dom.elWrap||t.dom.baseEl)||null;if(!e)return{};const s=m.getComputedStyle(e);if(!s||"function"!=typeof s.getPropertyValue)return{};const i=t=>{const e=s.getPropertyValue(t);return e?String(e).trim():""},a={};for(const t in de){const e=i(de[t]);e&&(a[t]=e)}const r=[];for(let t=1;t<=24;t++){const e=i(`--apx-series-${t}`);if(!e)break;r.push(e)}return r.length&&(a.series=r),a}(this.w):{};return n(n({},t),e)}_shouldUseTokens(){return!1!==this.w.config.theme.tokens}applyTokenChrome(t){if(!t)return;const e=this.w;if(!t.fore||e.config.chart.foreColor!==ue&&e.config.chart.foreColor!==xe||(e.config.chart.foreColor=t.fore),t.grid){e.config.grid.borderColor===fe&&(e.config.grid.borderColor=t.grid);const s=e=>{e&&(e.axisBorder&&e.axisBorder.color===fe&&(e.axisBorder.color=t.grid),e.axisTicks&&e.axisTicks.color===fe&&(e.axisTicks.color=t.grid))};s(e.config.xaxis),Array.isArray(e.config.yaxis)?e.config.yaxis.forEach(s):s(e.config.yaxis)}if(t.surface&&!e.config.chart.background){e.config.chart.background=t.surface;const s=e.dom.Paper&&e.dom.Paper.node;s&&s.style&&(s.style.background=t.surface)}}getColors(t){const e=this.w;return t&&0!==t.length?Array.isArray(t)&&t.length>0&&"function"==typeof t[0]?(this.isColorFn=!0,e.config.series.map((s,i)=>{const a=t[i]||t[0];return"function"==typeof a?a({value:e.globals.axisCharts?e.seriesData.series[i][0]||0:e.seriesData.series[i],seriesIndex:i,dataPointIndex:i,w:this.w}):a})):t:this.predefined()}applySeriesColors(t,e){t.forEach((t,s)=>{t&&(e[s]=t)})}getMonochromeColors(t,e,s){const{color:i,shadeIntensity:a,shadeTo:r}=t,o=this.isBarDistributed||this.isHeatmapDistributed?e[0].length*e.length:e.length,n=1/(o/a);let l=0;return Array.from({length:o},()=>{const t="dark"===r?s.shadeColor(-1*l,i):s.shadeColor(l,i);return l+=n,t})}applyColorTypes(t,e){const s=this.w;t.forEach(t=>{s.globals[t].colors=void 0===s.config[t].colors?this.isColorFn?s.config.colors:e:s.config[t].colors.slice(),this.pushExtraColors(s.globals[t].colors)})}applyDataLabelsColors(t){const e=this.w;e.globals.dataLabels.style.colors=void 0===e.config.dataLabels.style.colors?t:e.config.dataLabels.style.colors.slice(),this.pushExtraColors(e.globals.dataLabels.style.colors,50)}applyRadarPolygonsColors(){const t=this.w;t.globals.radarPolygons.fill.colors=void 0===t.config.plotOptions.radar.polygons.fill.colors?["dark"===t.config.theme.mode?"#343A3F":"none"]:t.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(t.globals.radarPolygons.fill.colors,20)}applyMarkersColors(t){const e=this.w;e.globals.markers.colors=void 0===e.config.markers.colors?t:e.config.markers.colors.slice(),this.pushExtraColors(e.globals.markers.colors)}pushExtraColors(t,e,s=null){const i=this.w;let a=e||i.seriesData.series.length;if(null===s&&(s=this.isBarDistributed||this.isHeatmapDistributed||"heatmap"===i.config.chart.type&&i.config.plotOptions.heatmap&&i.config.plotOptions.heatmap.colorScale.inverse),s&&i.seriesData.series.length&&(a=i.seriesData.series[i.globals.maxValsInArrayIndex].length*i.seriesData.series.length),t.length<a){const e=a-t.length;for(let s=0;s<e;s++)t.push(t[s])}}getColorBlindColors(t){const e={palette1:["#008FFB","#00A86F","#CA8501","#FF4560","#846DD5"],palette2:["#6978CB","#039DE2","#49A84D","#B39105","#D68000"],palette3:["#209FCC","#648291","#D4526E","#0FA783","#A19285"],palette4:["#2FA59D","#73A20B","#099DE1","#FD5D5D","#648291"],palette5:["#2B908F","#F56566","#2EAB16","#FA4443","#1EA2BD"],palette6:["#449DD1","#F86624","#EA3A4A","#9C63D1","#899E2A"],palette7:["#DF475B","#1B998B","#7E75B7","#F46036","#B1911B"],palette8:["#9C63D1","#F86624","#B38F04","#EA3A4A","#2FA2B3"],palette9:["#98776F","#A19285","#A8705E","#BA6560","#A0927F"],palette10:["#C91EFF","#A94BFD","#6C6AFE","#2983FF","#009ED8"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]};return({deuteranopia:e.cvdDeuteranopia,protanopia:e.cvdProtanopia,tritanopia:e.cvdTritanopia,highContrast:e.highContrast}[t]||e.palette1).slice()}updateThemeOptions(t){t.chart=t.chart||{},t.tooltip=t.tooltip||{};const e=t.theme.mode,s="dark"===e?"palette4":"light"===e?"palette1":t.theme.palette||"palette1",i="dark"===e?"#f6f7f8":"light"===e?"#373d3f":t.chart.foreColor||"#373d3f";return t.tooltip.theme=e||"light",t.chart.foreColor=i,t.theme.palette=s,t}predefined(){const t={palette1:["#008FFB","#00A86F","#CA8501","#FF4560","#846DD5"],palette2:["#6978CB","#039DE2","#49A84D","#B39105","#D68000"],palette3:["#209FCC","#648291","#D4526E","#0FA783","#A19285"],palette4:["#2FA59D","#73A20B","#099DE1","#FD5D5D","#648291"],palette5:["#2B908F","#F56566","#2EAB16","#FA4443","#1EA2BD"],palette6:["#449DD1","#F86624","#EA3A4A","#9C63D1","#899E2A"],palette7:["#DF475B","#1B998B","#7E75B7","#F46036","#B1911B"],palette8:["#9C63D1","#F86624","#B38F04","#EA3A4A","#2FA2B3"],palette9:["#98776F","#A19285","#A8705E","#BA6560","#A0927F"],palette10:["#C91EFF","#A94BFD","#6C6AFE","#2983FF","#009ED8"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]},e=t[this.w.config.theme.palette]||t.palette1,s=this._tokens||{};if(Array.isArray(s.series)&&s.series.length)return s.series.slice();if(s.accent)return[s.accent,...e];const i=this._namedTheme;return i&&Array.isArray(i.palette)&&i.palette.length?i.palette.slice():e}}class be{constructor(t){this.w=t}draw(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}drawTitleSubtitle(t){const e=this.w,s="title"===t?e.config.title:e.config.subtitle;let i=e.globals.svgWidth/2,a=s.offsetY,r="middle";if("left"===s.align?(i=10,r="start"):"right"===s.align&&(i=e.globals.svgWidth-10,r="end"),i+=s.offsetX,a=a+parseInt(s.style.fontSize,10)+s.margin/2,void 0!==s.text){const o=new gt(this.w).drawText({x:i,y:a,text:s.text,textAnchor:r,fontSize:s.style.fontSize,fontFamily:s.style.fontFamily,fontWeight:s.style.fontWeight,foreColor:s.style.color,opacity:1});o.node.setAttribute("class",`apexcharts-${t}-text`),e.dom.Paper.add(o)}}}let ye=class{constructor(t){this.w=t.w,this.dCtx=t}getTitleSubtitleCoords(t){const e=this.w;let s=0,i=0;const a="title"===t?e.config.title.floating:e.config.subtitle.floating,r=e.dom.baseEl.querySelector(`.apexcharts-${t}-text`);if(null!==r&&!a){const t=r.getBoundingClientRect();s=t.width,i=e.globals.axisCharts?t.height+5:t.height}return{width:s,height:i}}getLegendsRect(){const t=this.w,e=t.dom.elLegendWrap;t.config.legend.height||"top"!==t.config.legend.position&&"bottom"!==t.config.legend.position||e&&(e.style.maxHeight=t.globals.svgHeight/2+"px");const s=Object.assign({},b.getBoundingClientRect(e));return null!==e&&!t.config.legend.floating&&t.config.legend.show?this.dCtx.lgRect={x:s.x,y:s.y,height:s.height,width:0===s.height?0:s.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},"left"!==t.config.legend.position&&"right"!==t.config.legend.position||1.5*this.dCtx.lgRect.width>t.globals.svgWidth&&(this.dCtx.lgRect.width=t.globals.svgWidth/1.5),this.dCtx.lgRect}getDatalabelsRect(){const t=this.w,e=[];t.config.series.forEach((s,i)=>{s.data.forEach((s,a)=>{const r=(o=t.seriesData.series[i][a],t.config.dataLabels.formatter(o,{seriesIndex:i,dataPointIndex:a,w:t}));var o;e.push(r)})});const s=b.getLargestStringFromArr(e),i=new gt(this.w),a=t.config.dataLabels.style,r=i.getTextRects(s,parseInt(a.fontSize).toString(),a.fontFamily);return{width:1.05*r.width,height:r.height}}getLargestStringFromMultiArr(t,e){let s=t;if(this.w.axisFlags.isMultiLineX){const t=e.map(t=>Array.isArray(t)?t.length:1),i=Math.max(...t);s=e[t.indexOf(i)]}return s}};class we{constructor(t){this.w=t.w,this.dCtx=t}getxAxisLabelsCoords(){const t=this.w;let e,s=t.labelData.labels.slice();if(t.config.xaxis.convertedCatToNumeric&&0===s.length&&(s=t.labelData.categoryLabels),t.labelData.timescaleLabels.length>0){const s=this.getxAxisTimeScaleLabelsCoords();e={width:s.width,height:s.height},t.layout.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends="left"!==t.config.legend.position&&"right"!==t.config.legend.position||t.config.legend.floating?0:this.dCtx.lgRect.width;const i=t.formatters.xLabelFormatter;let a=b.getLargestStringFromArr(s),r=this.dCtx.dimHelpers.getLargestStringFromMultiArr(a,s);t.globals.isBarHorizontal&&(a=t.globals.yAxisScale[0].result.reduce((t,e)=>t.length>e.length?t:e,0),r=a);const o=new w(this.w),n=a;a=o.xLabelFormat(i,a,n,{i:void 0,dateFormatter:new y(this.w).formatDate,w:t}),r=o.xLabelFormat(i,r,n,{i:void 0,dateFormatter:new y(this.w).formatDate,w:t}),(t.config.xaxis.convertedCatToNumeric&&void 0===a||""===String(a).trim())&&(a="1",r=a);const l=new gt(this.w);let h=l.getTextRects(a,t.config.xaxis.labels.style.fontSize),c=h;if(a!==r&&(c=l.getTextRects(r,t.config.xaxis.labels.style.fontSize)),e={width:h.width>=c.width?h.width:c.width,height:h.height>=c.height?h.height:c.height},e.width*s.length>t.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==t.config.xaxis.labels.rotate||t.config.xaxis.labels.rotateAlways){if(!t.globals.isBarHorizontal){t.layout.rotateXLabels=!0;const s=e=>l.getTextRects(e,t.config.xaxis.labels.style.fontSize,t.config.xaxis.labels.style.fontFamily,`rotate(${t.config.xaxis.labels.rotate} 0 0)`,!1);h=s(a),a!==r&&(c=s(r)),e.height=(h.height>c.height?h.height:c.height)/1.5,e.width=h.width>c.width?h.width:c.width}}else t.layout.rotateXLabels=!1}return t.config.xaxis.labels.show||(e={width:0,height:0}),{width:e.width,height:e.height}}getxAxisGroupLabelsCoords(){var t;const e=this.w;if(!e.labelData.hasXaxisGroups)return{width:0,height:0};const s=(null==(t=e.config.xaxis.group.style)?void 0:t.fontSize)||e.config.xaxis.labels.style.fontSize,i=e.labelData.groups.map(t=>t.title);let a;const r=b.getLargestStringFromArr(i),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(r,i),n=new gt(this.w),l=n.getTextRects(r,s);let h=l;return r!==o&&(h=n.getTextRects(o,s)),a={width:l.width>=h.width?l.width:h.width,height:l.height>=h.height?l.height:h.height},e.config.xaxis.labels.show||(a={width:0,height:0}),{width:a.width,height:a.height}}getxAxisTitleCoords(){const t=this.w;let e=0,s=0;if(void 0!==t.config.xaxis.title.text){const i=new gt(this.w).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize);e=i.width,s=i.height}return{width:e,height:s}}getxAxisTimeScaleLabelsCoords(){const t=this.w;this.dCtx.timescaleLabels=t.labelData.timescaleLabels.slice();const e=this.dCtx.timescaleLabels.map(t=>t.value),s=e.reduce((t,e)=>void 0===t?0:t.length>e.length?t:e,0),i=new gt(this.w).getTextRects(s,t.config.xaxis.labels.style.fontSize);return 1.05*i.width*e.length>t.layout.gridWidth&&0!==t.config.xaxis.labels.rotate&&(t.globals.overlappingXLabels=!0),i}additionalPaddingXLabels(t){const e=this.w,s=e.globals,i=e.config,a=i.xaxis.type,r=t.width;s.skipLastTimelinelabel=!1,s.skipFirstTimelinelabel=!1;const o=e.config.yaxis[0].opposite&&e.globals.isBarHorizontal,n=t=>{if(this.dCtx.timescaleLabels&&this.dCtx.timescaleLabels.length){const a=this.dCtx.timescaleLabels[0],o=this.dCtx.timescaleLabels[this.dCtx.timescaleLabels.length-1].position+r/1.75-this.dCtx.yAxisWidthRight,n=a.position-r/1.75+this.dCtx.yAxisWidthLeft,l="right"===e.config.legend.position&&this.dCtx.lgRect.width>0?this.dCtx.lgRect.width:0;o>s.svgWidth-e.layout.translateX-l&&(s.skipLastTimelinelabel=!0),n<-(t.show&&!t.floating||"bar"!==i.chart.type&&"candlestick"!==i.chart.type&&"rangeBar"!==i.chart.type&&"boxPlot"!==i.chart.type&&"violin"!==i.chart.type?10:r/1.75)&&(s.skipFirstTimelinelabel=!0)}else"datetime"===a?this.dCtx.gridPad.right<r&&!e.layout.rotateXLabels&&(s.skipLastTimelinelabel=!0):"datetime"!==a&&this.dCtx.gridPad.right<r/2-this.dCtx.yAxisWidthRight&&!e.layout.rotateXLabels&&!e.config.xaxis.labels.trim&&(this.dCtx.xPadRight=r/2+1)},l=(t,e)=>{i.yaxis.length>1&&(t=>-1!==s.collapsedSeriesIndices.indexOf(t))(e)||n(t)};i.yaxis.forEach((t,e)=>{o?(this.dCtx.gridPad.left<r&&(this.dCtx.xPadLeft=r/2+1),this.dCtx.xPadRight=r/2+1):l(t,e)})}}class ve{constructor(t){this.w=t.w,this.dCtx=t}getyAxisLabelsCoords(){const t=this.w,e=[];let s=10;const i=new vt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale});return t.config.yaxis.map((a,r)=>{const o={seriesIndex:r,dataPointIndex:-1,w:t},n=t.globals.yAxisScale[r];let l=0;if(!i.isYAxisHidden(r)&&a.labels.show&&void 0!==a.labels.minWidth&&(l=a.labels.minWidth),!i.isYAxisHidden(r)&&a.labels.show&&n.result.length){const i=t.formatters.yLabelFormatters[r],h=n.niceMin===Number.MIN_VALUE?0:n.niceMin;let c=n.result.reduce((t,e)=>{var s,a;return(null==(s=String(i(t,o)))?void 0:s.length)>(null==(a=String(i(e,o)))?void 0:a.length)?t:e},h);c=i(c,o);let d=c;if(void 0!==c&&0!==c.length||(c=n.niceMax),1===String(c).length&&(c+=".0",d=c),t.globals.isBarHorizontal){s=0;const e=t.labelData.labels.slice();c=b.getLargestStringFromArr(e),c=i(c,{seriesIndex:r,dataPointIndex:-1,w:t}),d=this.dCtx.dimHelpers.getLargestStringFromMultiArr(c,e)}const g=new gt(this.w),p="rotate(".concat(a.labels.rotate," 0 0)"),u=g.getTextRects(c,a.labels.style.fontSize,a.labels.style.fontFamily,p,!1);let x=u;c!==d&&(x=g.getTextRects(d,a.labels.style.fontSize,a.labels.style.fontFamily,p,!1)),e.push({width:(l>x.width||l>u.width?l:x.width>u.width?x.width:u.width)+s,height:x.height>u.height?x.height:u.height})}else e.push({width:0,height:0})}),e}getyAxisTitleCoords(){const t=this.w,e=[];return t.config.yaxis.map(t=>{if(t.show&&void 0!==t.title.text){const s=new gt(this.w),i="rotate(".concat(t.title.rotate," 0 0)"),a=s.getTextRects(t.title.text,t.title.style.fontSize,t.title.style.fontFamily,i,!1);e.push({width:a.width,height:a.height})}else e.push({width:0,height:0})}),e}getTotalYAxisWidth(){const t=this.w;let e=0,s=0,i=0;const a=t.globals.yAxisScale.length>1?10:0,r=new vt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale}),o=(o,n)=>{const l=t.config.yaxis[n].floating;let h=0;o.width>0&&!l?(h=o.width+a,function(e){return t.globals.ignoreYAxisIndexes.indexOf(e)>-1}(n)&&(h=h-o.width-a)):h=l||r.isYAxisHidden(n)?0:5,t.config.yaxis[n].opposite?i+=h:s+=h,e+=h};return t.layout.yLabelsCoords.map((t,e)=>{o(t,e)}),t.layout.yTitleCoords.map((t,e)=>{o(t,e)}),t.globals.isBarHorizontal&&!t.config.yaxis[0].floating&&(e=t.layout.yLabelsCoords[0].width+t.layout.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=s,this.dCtx.yAxisWidthRight=i,e}}class Ae{constructor(t){this.w=t.w,this.dCtx=t}gridPadForColumnsInNumericAxis(t){const{w:e}=this,{config:s,globals:i}=e;if(i.noData||i.collapsedSeries.length+i.ancillaryCollapsedSeries.length===s.series.length)return 0;const a=t=>["bar","rangeBar","candlestick","boxPlot","violin"].includes(t),r=s.chart.type;let o=0,n=a(r)?s.series.length:1;i.comboBarCount>0&&(n=i.comboBarCount),i.collapsedSeries.forEach(t=>{a(t.type)&&(n-=1)}),s.chart.stacked&&(n=1);const l=a(r)||i.comboBarCount>0;let h=Math.abs(i.initialMaxX-i.initialMinX);if(l&&e.axisFlags.isXNumeric&&!i.isBarHorizontal&&n>0&&0!==h){h<=3&&(h=i.dataPoints);const e=h/t;let a=i.minXDiff&&i.minXDiff/e>0?i.minXDiff/e:0;a>t/2&&(a/=2),o=a*parseInt(s.plotOptions.bar.columnWidth,10)/100,o<1&&(o=1),i.barPadForNumericAxis=o}return o}gridPadFortitleSubtitle(){const{w:t}=this,{globals:e}=t;let s=this.dCtx.isSparkline||!e.axisCharts?0:10;["title","subtitle"].forEach(i=>{void 0!==t.config[i].text?s+=t.config[i].margin:s+=this.dCtx.isSparkline||!e.axisCharts?0:5}),!t.config.legend.show||"bottom"!==t.config.legend.position||t.config.legend.floating||e.axisCharts||(s+=10);const i=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),a=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");t.layout.gridHeight-=i.height+a.height+s,t.layout.translateY+=i.height+a.height+s}setGridXPosForDualYAxis(t,e){const{w:s}=this,i=new vt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale});s.config.yaxis.forEach((a,r)=>{-1!==s.globals.ignoreYAxisIndexes.indexOf(r)||a.floating||i.isYAxisHidden(r)||(a.opposite&&(s.layout.translateX-=e[r].width+t[r].width+parseInt(a.labels.style.fontSize,10)/1.2+12),s.layout.translateX<2&&(s.layout.translateX=2))})}}class Ce{constructor(t,e){this.w=t,this.ctx=e,this.theme=e.theme,this.timeScale=e.timeScale,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new ye(this),this.dimYAxis=new ve(this),this.dimXAxis=new we(this),this.dimGrid=new Ae(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0,this.datalabelsCoords={width:0,height:0},this.xAxisWidth=0,this.timescaleLabels=[]}plotCoords(){const t=this.w,e=t.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};const s=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width;this.isSparkline&&((t.config.markers.discrete.length>0||t.config.markers.size>0)&&Object.entries(this.gridPad).forEach(([t,e])=>{this.gridPad[t]=Math.max(e,this.w.globals.markers.largestSize/1.5)}),this.gridPad.top=Math.max(s/2,this.gridPad.top),this.gridPad.bottom=Math.max(s/2,this.gridPad.bottom)),e.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),t.layout.gridHeight=t.layout.gridHeight-this.gridPad.top-this.gridPad.bottom,t.layout.gridWidth=t.layout.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;const i=this.dimGrid.gridPadForColumnsInNumericAxis(t.layout.gridWidth);return t.layout.gridWidth=t.layout.gridWidth-2*i,t.layout.translateX=t.layout.translateX+this.gridPad.left+this.xPadLeft+(i>0?i:0),t.layout.translateY=t.layout.translateY+this.gridPad.top,{layout:{gridHeight:t.layout.gridHeight,gridWidth:t.layout.gridWidth,translateX:t.layout.translateX,translateY:t.layout.translateY,translateXAxisX:t.layout.translateXAxisX,translateXAxisY:t.layout.translateXAxisY,rotateXLabels:t.layout.rotateXLabels,xAxisHeight:t.layout.xAxisHeight,xAxisLabelsHeight:t.layout.xAxisLabelsHeight,xAxisGroupLabelsHeight:t.layout.xAxisGroupLabelsHeight,xAxisLabelsWidth:t.layout.xAxisLabelsWidth,yLabelsCoords:t.layout.yLabelsCoords,yTitleCoords:t.layout.yTitleCoords}}}setDimensionsForAxisCharts(){const t=this.w,e=t.globals,s=this.dimYAxis.getyAxisLabelsCoords(),i=this.dimYAxis.getyAxisTitleCoords();e.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),t.layout.yLabelsCoords=[],t.layout.yTitleCoords=[],t.config.yaxis.map((e,a)=>{t.layout.yLabelsCoords.push({width:s[a].width,index:a}),t.layout.yTitleCoords.push({width:i[a].width,index:a})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();const a=this.dimXAxis.getxAxisLabelsCoords(),r=this.dimXAxis.getxAxisGroupLabelsCoords(),o=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(a,o,r),t.layout.translateXAxisY=t.layout.rotateXLabels?this.xAxisHeight/8:-4,t.layout.translateXAxisX=t.layout.rotateXLabels&&t.axisFlags.isXNumeric&&t.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,t.globals.isBarHorizontal&&(t.layout.rotateXLabels=!1,t.layout.translateXAxisY=parseInt(t.config.xaxis.labels.style.fontSize,10)/1.5*-1),t.layout.translateXAxisY=t.layout.translateXAxisY+t.config.xaxis.labels.offsetY,t.layout.translateXAxisX=t.layout.translateXAxisX+t.config.xaxis.labels.offsetX;let n=this.yAxisWidth,l=this.xAxisHeight;t.layout.xAxisLabelsHeight=this.xAxisHeight-o.height,t.layout.xAxisGroupLabelsHeight=t.layout.xAxisLabelsHeight-a.height,t.layout.xAxisLabelsWidth=this.xAxisWidth,t.layout.xAxisHeight=this.xAxisHeight;let h=10;("radar"===t.config.chart.type||this.isSparkline)&&(n=0,l=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||"treemap"===t.config.chart.type)&&(n=0,l=0,h=0),this.isSparkline||"treemap"===t.config.chart.type||this.dimXAxis.additionalPaddingXLabels(a);const c=()=>{t.layout.translateX=n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-this.lgRect.height-l-(this.isSparkline||"treemap"===t.config.chart.type?0:t.layout.rotateXLabels?10:15),t.layout.gridWidth=e.svgWidth-n-2*this.datalabelsCoords.width};switch("top"===t.config.xaxis.position&&(h=t.layout.xAxisHeight-t.config.xaxis.axisTicks.height-5),t.config.legend.position){case"bottom":t.layout.translateY=h,c();break;case"top":t.layout.translateY=this.lgRect.height+h,c();break;case"left":t.layout.translateY=h,t.layout.translateX=this.lgRect.width+n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-l-12,t.layout.gridWidth=e.svgWidth-this.lgRect.width-n-2*this.datalabelsCoords.width;break;case"right":t.layout.translateY=h,t.layout.translateX=n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-l-12,t.layout.gridWidth=e.svgWidth-this.lgRect.width-n-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(i,s);new _t(this.w,{theme:this.theme,timeScale:this.timeScale}).setYAxisXPosition(s,i)}setDimensionsForNonAxisCharts(){const t=this.w,e=t.globals,s=t.config;let i=0;t.config.legend.show&&!t.config.legend.floating&&(i=20);const a="pie"===s.chart.type||"polarArea"===s.chart.type||"donut"===s.chart.type?"pie":"radialBar",r=s.plotOptions[a].offsetY,o=s.plotOptions[a].offsetX;if(!s.legend.show||s.legend.floating){t.layout.gridHeight=e.svgHeight;const s=t.dom.elWrap.getBoundingClientRect().width;return t.layout.gridWidth=Math.min(s,t.layout.gridHeight),t.layout.translateY=r,void(t.layout.translateX=o+(e.svgWidth-t.layout.gridWidth)/2)}switch(s.legend.position){case"bottom":t.layout.gridHeight=e.svgHeight-this.lgRect.height,t.layout.gridWidth=e.svgWidth,t.layout.translateY=r-10,t.layout.translateX=o+(e.svgWidth-t.layout.gridWidth)/2;break;case"top":t.layout.gridHeight=e.svgHeight-this.lgRect.height,t.layout.gridWidth=e.svgWidth,t.layout.translateY=this.lgRect.height+r+10,t.layout.translateX=o+(e.svgWidth-t.layout.gridWidth)/2;break;case"left":t.layout.gridWidth=e.svgWidth-this.lgRect.width-i,t.layout.gridHeight="auto"!==s.chart.height?e.svgHeight:t.layout.gridWidth,t.layout.translateY=r,t.layout.translateX=o+this.lgRect.width+i;break;case"right":t.layout.gridWidth=e.svgWidth-this.lgRect.width-i-5,t.layout.gridHeight="auto"!==s.chart.height?e.svgHeight:t.layout.gridWidth,t.layout.translateY=r,t.layout.translateX=o+10;break;default:throw new Error("Legend position not supported")}}conditionalChecksForAxisCoords(t,e,s){const i=this.w,a=i.labelData.hasXaxisGroups?2:1,r=s.height+t.height+e.height,o=i.axisFlags.isMultiLineX?1.2:1.618,n=i.layout.rotateXLabels?22:10,l=i.layout.rotateXLabels&&"bottom"===i.config.legend.position?10:0;this.xAxisHeight=r*o+a*n+l,this.xAxisWidth=t.width,this.xAxisHeight-e.height>i.config.xaxis.labels.maxHeight&&(this.xAxisHeight=i.config.xaxis.labels.maxHeight),i.config.xaxis.labels.minHeight&&this.xAxisHeight<i.config.xaxis.labels.minHeight&&(this.xAxisHeight=i.config.xaxis.labels.minHeight),i.config.xaxis.floating&&(this.xAxisHeight=0);let h=0,c=0;i.config.yaxis.forEach(t=>{h+=t.labels.minWidth,c+=t.labels.maxWidth}),this.yAxisWidth<h&&(this.yAxisWidth=h),this.yAxisWidth>c&&(this.yAxisWidth=c)}}const Se=1e3,ke=6e4,_e=36e5,Le=24*_e,De=7*Le,Me=30*Le,Ee=365*Le,Pe=10/86400,Fe=[{unit:"second",step:1,approxMs:Se},{unit:"second",step:5,approxMs:5e3},{unit:"second",step:15,approxMs:15e3},{unit:"second",step:30,approxMs:3e4},{unit:"minute",step:1,approxMs:ke},{unit:"minute",step:5,approxMs:3e5},{unit:"minute",step:15,approxMs:9e5},{unit:"minute",step:30,approxMs:18e5},{unit:"hour",step:1,approxMs:_e},{unit:"hour",step:3,approxMs:3*_e},{unit:"hour",step:6,approxMs:6*_e},{unit:"hour",step:12,approxMs:12*_e},{unit:"day",step:1,approxMs:Le},{unit:"day",step:2,approxMs:2*Le},{unit:"week",step:1,approxMs:De},{unit:"week",step:2,approxMs:2*De},{unit:"month",step:1,approxMs:Me},{unit:"month",step:3,approxMs:7776e6},{unit:"month",step:6,approxMs:15552e6},{unit:"year",step:1,approxMs:Ee},{unit:"year",step:2,approxMs:63072e6},{unit:"year",step:5,approxMs:15768e7},{unit:"year",step:10,approxMs:31536e7},{unit:"year",step:25,approxMs:7884e8},{unit:"year",step:50,approxMs:15768e8},{unit:"year",step:100,approxMs:31536e8}];class Te{constructor(t,e){this.w=t,this.ctx=e,this.tickInterval=null,this.timeScaleArray=[],this.utc=t.config.xaxis.labels.datetimeUTC}calculateTimeScaleTicks(t,e){const s=this.w;if(s.globals.allSeriesCollapsed)return s.labelData.labels=[],s.labelData.timescaleLabels=[],this.timeScaleArray=[],[];const i=e-t,a=i/Le;s.interact.disableZoomIn=!1,s.interact.disableZoomOut=!1,a<Pe?s.interact.disableZoomIn=!0:a>5e4&&(s.interact.disableZoomOut=!0);const r=Number.isFinite(s.config.xaxis.tickAmount)?s.config.xaxis.tickAmount:10;this.tickInterval=function(t,e){(!Number.isFinite(e)||e<=0)&&(e=10);if(t<=0)return Fe[0];const s=t/e;let i=Fe[0],a=1/0;for(const t of Fe){const e=Math.abs(Math.log(t.approxMs/s));e<a&&(a=e,i=t)}return i}(i,r);const o=this.generateBaseTicks(t,e,this.tickInterval);return this.timeScaleArray=o,o}generateBaseTicks(t,e,s){const i=this.w,a=new y(i),r=this.utc,o=i.layout.gridWidth,n=e-t,l=[];let h=a.ceilToBoundary(t,s.unit,s.step,r),c=0;for(;h<=e&&c<5e3;){const e=a.getDateFields(h,r),i=n>0?(h-t)/n*o:0;l.push({timestamp:h,position:i,unit:s.unit,year:e.year,month:e.month+1,day:e.date,hour:e.hour,minute:e.minute,second:e.second,value:h}),h=a.addInterval(h,s.unit,s.step,r),c++}return l}recalcDimensionsBasedOnFormat(t){const e=this.w,s=this.formatDates(t),i=this.removeOverlappingTS(s);e.labelData.timescaleLabels=i.slice();const a=new Ce(this.w,this.ctx).plotCoords();this.ctx._writeLayoutCoords(a.layout)}formatDates(t){const e=this.w,s=new y(e),i=e.config.xaxis.labels.format,a=e.config.xaxis.labels.datetimeFormatter,r=this.utc,o=(t,e=2)=>String(t).padStart(e,"0"),n=i||this._effectiveFormat(t,a);return t.map(t=>{const e=s.getDate(t.timestamp),i=s.formatDate(e,n);return{dateString:`${t.year}-${o(t.month)}-${o(t.day)}T${o(t.hour)}:${o(t.minute)}:${o(t.second)}.000${r?"Z":""}`,position:t.position,value:i,unit:t.unit,year:t.year,month:t.month}})}_effectiveFormat(t,e){if(0===t.length)return e.day||"dd MMM";const s=this.tickInterval&&this.tickInterval.unit||t[0].unit,i=e["week"===s?"day":s]||e.day||"dd MMM",a=t[0],r=t[t.length-1],o=a.year!==r.year,n=o||a.month!==r.month||a.day!==r.day,l=/y/i.test(i),h=/M/.test(i),c=/d/i.test(i);if("month"===s||"week"===s)return o&&!l?i+" yyyy":i;if("day"===s)return o&&!l?i+" yyyy":i;if("hour"===s||"minute"===s||"second"===s){if(n&&!c&&!h){return(o?"dd MMM yyyy":"dd MMM")+" "+i}return i}return i}removeOverlappingTS(t){if(0===t.length)return[];const e=this.w,s=new gt(e);let i,a=!1;t[0].value&&t.every(e=>e.value.length===t[0].value.length)&&(a=!0,i=s.getTextRects(t[0].value,e.config.xaxis.labels.style.fontSize).width);let r=0;return t.map((o,n)=>{if(0===n)return o;if(!e.config.xaxis.labels.hideOverlappingLabels)return o;const l=a?i:s.getTextRects(t[r].value,e.config.xaxis.labels.style.fontSize).width,h=t[r].position;return o.position>h+l+10?(r=n,o):null}).filter(t=>null!==t)}}const Ie="__apexcharts_registry__",Xe="__apexcharts_custom_types__";function Re(){return globalThis[Ie]}function ze(){return globalThis[Xe]}function Be(t){return ze().has(t)}function Ye(t){Object.assign(Re(),t)}function Ne(t){const e=Re()[t];if(!e)throw new Error(`ApexCharts: chart type "${t}" is not registered. Import it via ApexCharts.use() or use the full apexcharts bundle.`);return e}globalThis[Ie]||(globalThis[Ie]={}),globalThis[Xe]||(globalThis[Xe]=new Set);class Oe{constructor(t,e,s){this.w=e,this.ctx=s,this.el=t}setupElements(){const{globals:t,config:e}=this.w,s=e.chart.type,i=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","violin","scatter","bubble"],a=[...i,"radar","heatmap","treemap"],r=!a.includes(s)&&!["pie","donut","polarArea","radialBar"].includes(s)&&Be(s);t.axisCharts=a.includes(s)||r,t.xyCharts=i.includes(s)||r,t.isBarHorizontal=["bar","rangeBar","boxPlot","violin"].includes(s)&&e.plotOptions.bar.horizontal,t.chartClass=`.apexcharts${t.chartID}`,this.w.dom.baseEl=this.el,this.w.dom.elWrap=m.createElementNS("http://www.w3.org/1999/xhtml","div"),gt.setAttrs(this.w.dom.elWrap,{id:t.chartClass.substring(1),class:`apexcharts-canvas ${t.chartClass.substring(1)}`}),this.el.appendChild(this.w.dom.elWrap);const o=globalThis.SVG;if(this.w.dom.Paper=o().addTo(this.w.dom.elWrap),this.w.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:`translate(${e.chart.offsetX}, ${e.chart.offsetY})`}),this.w.dom.Paper.node.style.background="dark"!==e.theme.mode||e.chart.background?"light"!==e.theme.mode||e.chart.background?e.chart.background:"#fff":"#343A3F",this.setSVGDimensions(),this.w.dom.elLegendForeign=m.createElementNS(F,"foreignObject"),gt.setAttrs(this.w.dom.elLegendForeign,{x:0,y:0,width:t.svgWidth,height:t.svgHeight}),this.w.dom.elLegendWrap=m.createElementNS("http://www.w3.org/1999/xhtml","div"),this.w.dom.elLegendWrap.classList.add("apexcharts-legend"),this.w.dom.elWrap.appendChild(this.w.dom.elLegendWrap),this.w.dom.Paper.node.appendChild(this.w.dom.elLegendForeign),e.chart.accessibility.enabled&&e.chart.accessibility.announcements.enabled){const t=m.createElement("div");t.className="apexcharts-sr-status",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),this.w.dom.elWrap.appendChild(t)}if(e.chart.accessibility.enabled){const t=this.getAccessibleChartLabel(),s=e.chart.accessibility.keyboard.enabled&&e.chart.accessibility.keyboard.navigation.enabled?"application":"img";if(this.w.dom.Paper.attr({role:s,"aria-label":t}),e.chart.accessibility.description){const t=m.createElementNS(F,"desc");t.textContent=e.chart.accessibility.description,this.w.dom.Paper.node.insertBefore(t,this.w.dom.elLegendForeign.nextSibling)}}this.w.dom.elGraphical=this.w.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),this.w.dom.elDefs=this.w.dom.Paper.defs(),this.w.dom.Paper.add(this.w.dom.elGraphical),this.w.dom.elGraphical.add(this.w.dom.elDefs)}plotChartType(t,e){const{w:s,ctx:i}=this,{config:a,globals:r}=s,o=i.renderer&&"canvas"===i.renderer.kind;o&&i.renderer.beginSeries();const n={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},bar:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},violin:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},l={},h=a.chart.type||"line";let c=null,d=0;this.w.seriesData.series.forEach((e,i)=>{var a,r;const o="column"===(null==(a=t[i])?void 0:a.type)?"bar":(null==(r=t[i])?void 0:r.type)||("column"===h?"bar":h),g=n;g[o]?("rangeArea"===o?(g[o].series.push(this.w.rangeData.seriesRangeStart[i]),g[o].seriesRangeEnd.push(this.w.rangeData.seriesRangeEnd[i])):g[o].series.push(e),g[o].i.push(i),"bar"===o&&(s.globals.columnSeries=n.bar)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(o)?c=o:Be(o)&&(l[o]||(l[o]={series:[],i:[]}),l[o].series.push(e),l[o].i.push(i)),h!==o&&"scatter"!==o&&d++}),d>0&&n.bar.series.length>0&&a.plotOptions.bar.horizontal&&(d-=n.bar.series.length,n.bar={series:[],i:[]},s.globals.columnSeries={series:[],i:[]}),r.comboCharts||(r.comboCharts=d>0);const g=n.line.series.length>0||n.area.series.length>0||n.scatter.series.length>0||n.bubble.series.length>0||n.rangeArea.series.length>0||!r.comboCharts&&["line","area","scatter","bubble","rangeArea"].includes(a.chart.type)?new(Ne("line"))(i.w,i,e):null,p=n.candlestick.series.length>0||n.boxPlot.series.length>0||!r.comboCharts&&["candlestick","boxPlot"].includes(a.chart.type)?new(Ne("candlestick"))(i.w,i,e):null,u=n.violin.series.length>0||!r.comboCharts&&"violin"===a.chart.type?new(Ne("violin"))(i.w,i,e):null,x=!r.comboCharts&&["pie","donut","polarArea"].includes(a.chart.type);i.pie=x?new(Ne("pie"))(i.w,i):null;const f=n.rangeBar.series.length>0||!r.comboCharts&&"rangeBar"===a.chart.type;i.rangeBar=f?new(Ne("rangeBar"))(i.w,i,e):null;let m=[];if(r.comboCharts){const t=new P(this.w);if(n.area.series.length>0&&m.push(...t.drawSeriesByGroup(n.area,r.areaGroups,"area",g)),n.bar.series.length>0)if(a.chart.stacked){const t=new(Ne("barStacked"))(i.w,i,e);m.push(t.draw(n.bar.series,n.bar.i))}else i.bar=new(Ne("bar"))(i.w,i,e),m.push(i.bar.draw(n.bar.series,n.bar.i));if(n.rangeArea.series.length>0&&m.push(g.draw(n.rangeArea.series,"rangeArea",n.rangeArea.i,n.rangeArea.seriesRangeEnd)),n.line.series.length>0&&m.push(...t.drawSeriesByGroup(n.line,r.lineGroups,"line",g)),n.candlestick.series.length>0&&m.push(p.draw(n.candlestick.series,"candlestick",n.candlestick.i)),n.boxPlot.series.length>0&&m.push(p.draw(n.boxPlot.series,"boxPlot",n.boxPlot.i)),n.violin.series.length>0&&m.push(u.draw(n.violin.series,"violin",n.violin.i)),n.rangeBar.series.length>0&&m.push(i.rangeBar.draw(n.rangeBar.series,n.rangeBar.i)),n.scatter.series.length>0){const t=new(Ne("line"))(i.w,i,e,!0);m.push(t.draw(n.scatter.series,"scatter",n.scatter.i))}if(n.bubble.series.length>0){const t=new(Ne("line"))(i.w,i,e,!0);m.push(t.draw(n.bubble.series,"bubble",n.bubble.i))}Object.keys(l).forEach(t=>{const s=l[t];if(s.series.length>0){const a=new(Ne(t))(i.w,i,e);m.push(a.draw(s.series,t,s.i))}})}else{const t=a.chart.type;switch(t){case"line":m=g.draw(this.w.seriesData.series,"line");break;case"area":m=g.draw(this.w.seriesData.series,"area");break;case"bar":if(a.chart.stacked){const t=new(Ne("barStacked"))(i.w,i,e);m=t.draw(this.w.seriesData.series)}else i.bar=new(Ne("bar"))(i.w,i,e),m=i.bar.draw(this.w.seriesData.series);break;case"candlestick":m=p.draw(this.w.seriesData.series,"candlestick");break;case"boxPlot":m=p.draw(this.w.seriesData.series,t);break;case"violin":m=u.draw(this.w.seriesData.series,"violin");break;case"rangeBar":m=i.rangeBar.draw(this.w.seriesData.series);break;case"rangeArea":m=g.draw(this.w.rangeData.seriesRangeStart,"rangeArea",void 0,this.w.rangeData.seriesRangeEnd);break;case"heatmap":{const t=new(Ne("heatmap"))(i.w,i,e);m=t.draw(this.w.seriesData.series);break}case"treemap":{const t=new(Ne("treemap"))(i.w,i);m=t.draw(this.w.seriesData.series);break}case"pie":case"donut":case"polarArea":m=i.pie.draw(this.w.seriesData.series);break;case"radialBar":{const t=new(Ne("radialBar"))(i.w,i);m=t.draw(this.w.seriesData.series);break}case"radar":{const t=new(Ne("radar"))(i.w,i);m=t.draw(this.w.seriesData.series);break}default:if(Be(t)){const s=new(Ne(t))(i.w,i,e);m=s.draw(this.w.seriesData.series,t)}else m=g.draw(this.w.seriesData.series)}}if(o){const t=i.renderer.present();if(t){const e=new gt(s).group({class:"apexcharts-canvas-series-wrap"});e.add(t);return(Array.isArray(m)?m:[m]).forEach(t=>{t&&e.add(t)}),e}}return m}setSVGDimensions(){var t;const{globals:e,config:s}=this.w;s.chart.width=s.chart.width||"100%",s.chart.height=s.chart.height||"auto";const i=s.chart.width,a=s.chart.height;e.svgWidth=NaN,e.svgHeight=NaN;let r=b.getDimensions(this.el);const o=i.toString().split(/[0-9]+/g).pop();"%"===o?b.isNumber(r[0])&&(0===r[0].width&&(r=b.getDimensions(this.el.parentNode)),e.svgWidth=r[0]*parseInt(i,10)/100):"px"!==o&&""!==o||(e.svgWidth=parseInt(i,10));const n=String(a).toString().split(/[0-9]+/g).pop();if("auto"!==a&&""!==a)if("%"===n){const t=b.getDimensions(this.el.parentNode);e.svgHeight=t[1]*parseInt(a,10)/100}else e.svgHeight=parseInt(a,10);else e.svgHeight=e.axisCharts?e.svgWidth/1.61:e.svgWidth/1.2;if(e.svgWidth=Math.max(e.svgWidth,0),e.svgHeight=Math.max(e.svgHeight,0),gt.setAttrs(this.w.dom.Paper.node,{width:e.svgWidth,height:e.svgHeight}),"%"!==n&&c.isBrowser()){const i=e.axisCharts&&(s.grid.show||s.dataLabels.enabled||s.xaxis.labels.show||s.xaxis.axisBorder.show||s.xaxis.axisTicks.show||s.yaxis.some(t=>t.show&&(t.labels.show||t.axisBorder.show||t.axisTicks.show))),a=s.chart.sparkline.enabled||!i?0:s.chart.parentHeightOffset,r=this.w.dom.Paper.node;(null==(t=r.parentNode)?void 0:t.parentNode)&&(r.parentNode.parentNode.style.minHeight=`${e.svgHeight+a}px`)}this.w.dom.elWrap.style.width=`${e.svgWidth}px`,this.w.dom.elWrap.style.height=`${e.svgHeight}px`}shiftGraphPosition(){const{globals:t}=this.w,{translateY:e,translateX:s}=t;gt.setAttrs(this.w.dom.elGraphical.node,{transform:`translate(${s}, ${e})`})}resizeNonAxisCharts(){var t,e,s,i,a,r;const{w:o}=this,n=o.config.chart.height?String(o.config.chart.height):"",l=""!==n&&"auto"!==n,h=n.includes("%");let d=0,g=o.config.chart.sparkline.enabled?1:15;g+=o.config.grid.padding.bottom,["top","bottom"].includes(o.config.legend.position)&&o.config.legend.show&&!o.config.legend.floating&&(d=(null!=(e=null==(t=this.ctx.legend)?void 0:t.legendHelpers.getLegendDimensions().clwh)?e:0)+7);const p=o.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),u=o.globals.pieExternalLabelMarginY||0;let x=u>0?2*o.globals.radialSize+2*u:2.05*o.globals.radialSize;const f=Math.abs(o.config.plotOptions.radialBar.endAngle-o.config.plotOptions.radialBar.startAngle);if(p&&!o.config.chart.sparkline.enabled&&f<360){const t=b.getBoundingClientRect(this.w.dom.Paper.node);let e=1/0,n=-1/0;const l=s=>{var i,a,r,o;if(null==(i=s.classList)?void 0:i.contains("apexcharts-radialbar-hollow"))return;const h=null==(r=null==(a=s.tagName)?void 0:a.toLowerCase)?void 0:r.call(a);if("text"===h||"tspan"===h)return;const c=Array.from(null!=(o=s.children)?o:[]);if(c.length>0)return void c.forEach(t=>l(t));const d=b.getBoundingClientRect(s);if(d.bottom-d.top>0){const s=d.top-t.top,i=d.bottom-t.top;s<e&&(e=s),i>n&&(n=i)}};if(Array.from(null!=(s=p.children)?s:[]).forEach(t=>l(t)),Number.isFinite(e)||(e=0),!Number.isFinite(n)){const e=b.getBoundingClientRect(p);n=e.bottom-t.top}const u=Math.max(g,.2*o.globals.radialSize),f=Math.max(u-e,0);0!==f&&(o.layout.translateY=(null!=(i=o.layout.translateY)?i:0)+f,gt.setAttrs(this.w.dom.elGraphical.node,{transform:`translate(${null!=(a=o.layout.translateX)?a:0}, ${o.layout.translateY})`}),n+=f),x=n>0?n:2.05*o.globals.radialSize;const m=Math.max(u,e),y=Math.ceil(x+d+m),w=null!=(r=o.config.chart.offsetY)?r:0,v=y+Math.max(w,0);return void(h||(this.w.dom.elLegendForeign&&this.w.dom.elLegendForeign.setAttribute("height",String(v)),this.w.dom.elWrap.style.height=`${v}px`,gt.setAttrs(this.w.dom.Paper.node,{height:y}),c.isBrowser()&&(this.w.dom.Paper.node.parentNode.parentNode.style.minHeight=`${v}px`)))}const m=Math.ceil(x+this.w.layout.translateY+d+g);l||(this.w.dom.elLegendForeign&&this.w.dom.elLegendForeign.setAttribute("height",String(m)),this.w.dom.elWrap.style.height=`${m}px`,gt.setAttrs(this.w.dom.Paper.node,{height:m}),c.isBrowser()&&(this.w.dom.Paper.node.parentNode.parentNode.style.minHeight=`${m}px`))}coreCalculations(){new kt(this.w).init()}resetGlobals(){const t=()=>this.w.config.series.map(()=>[]),e=new M,{globals:s}=this.w,i={dataWasParsed:this.w.axisFlags.dataWasParsed,originalSeries:s.originalSeries};e.initGlobalVars(s),s.seriesXvalues=t(),s.seriesYvalues=t(),i.dataWasParsed&&(this.w.axisFlags.dataWasParsed=i.dataWasParsed,s.originalSeries=i.originalSeries)}isMultipleY(){return!!(Array.isArray(this.w.config.yaxis)&&this.w.config.yaxis.length>1)&&(this.w.globals.isMultipleYAxis=!0,!0)}xySettings(){const{w:t}=this;let e=null;if(t.globals.axisCharts){if("back"===t.config.xaxis.crosshairs.position&&new Et(this.w).drawXCrosshairs(),"back"===t.config.yaxis[0].crosshairs.position&&new Et(this.w).drawYCrosshairs(),"datetime"===t.config.xaxis.type&&void 0===t.config.xaxis.labels.formatter){this.ctx.timeScale=new Te(this.w,this.ctx);let e=[];isFinite(t.globals.minX)&&isFinite(t.globals.maxX)&&!t.globals.isBarHorizontal?e=this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minX,t.globals.maxX):t.globals.isBarHorizontal&&(e=this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minY,t.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(e)}e=new P(this.w).getCalculatedRatios()}return e}updateSourceChart(t){this.ctx.w.interact.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:t.w.globals.minX,max:t.w.globals.maxX}}}},!1,!1)}setupBrushHandler(){const{ctx:t,w:e}=this;if(e.config.chart.brush.enabled&&"function"!=typeof e.config.chart.events.selection){const s=Array.isArray(e.config.chart.brush.targets)?e.config.chart.brush.targets:[e.config.chart.brush.target];s.forEach(e=>{const s=t.constructor.getChartByID(e);s.w.globals.brushSource=this.ctx,"function"!=typeof s.w.config.chart.events.zoomed&&(s.w.config.chart.events.zoomed=()=>this.updateSourceChart(s)),"function"!=typeof s.w.config.chart.events.scrolled&&(s.w.config.chart.events.scrolled=()=>this.updateSourceChart(s))}),e.config.chart.events.selection=(e,i)=>{s.forEach(e=>{t.constructor.getChartByID(e).ctx.updateHelpers._updateOptions({xaxis:{min:i.xaxis.min,max:i.xaxis.max}},!1,!1,!1,!1)})}}}getAccessibleChartLabel(){const t=this.w,e=t.config;if(e.chart.accessibility&&e.chart.accessibility.description)return e.chart.accessibility.description;const s=e.chart.type,i=[];if(e.title.text)i.push(`${e.title.text}. ${s} chart`),e.subtitle.text&&i.push(e.subtitle.text);else{const a=Array.isArray(t.seriesData.seriesNames)&&t.seriesData.seriesNames.length?t.seriesData.seriesNames.filter(Boolean):Array.isArray(e.series)?e.series.map(t=>"object"==typeof t&&null!==t?t.name:null).filter(Boolean):[],r=t.seriesData.series.length||(e.series?e.series.length:0);a.length?i.push(`${s} chart with ${r} data series: ${a.join(", ")}`):i.push(`${s} chart with ${r} data series`)}return i.join(". ")}}class He{constructor(t,{resetGlobals:e=()=>{},isMultipleY:s=()=>{}}={}){this.w=t,this.resetGlobals=e,this.isMultipleY=s,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new P(this.w),this.activeSeriesIndex=0}getFirstDataPoint(){const t=this.w.config.series,e=new ce(this.w);this.activeSeriesIndex=e.getActiveConfigSeriesIndex();const s=t[this.activeSeriesIndex];return s&&s.data&&s.data.length>0&&null!==s.data[0]&&void 0!==s.data[0]?s.data[0]:null}isMultiFormat(){return this.isFormatXY()||this.isFormat2DArray()}isFormatXY(){var t;const e=this.getFirstDataPoint();if(!e||void 0===e.x)return!1;const s=null==(t=this.w.config.series[this.activeSeriesIndex])?void 0:t.data;if(s){const t=t=>t&&void 0!==t.x;for(let e=1;e<Math.min(3,s.length)&&!0===t(s[e]);e++);}return!0}isFormat2DArray(){const t=this.getFirstDataPoint();return t&&Array.isArray(t)}handleFormat2DArray(t,e){const s=this.w.config,i=t[e].data,a="boxPlot"===s.chart.type||"boxPlot"===s.series[e].type;for(let t=0;t<i.length;t++){const e=i[t],r=e[0],o=e[1],n=e[2];if(void 0!==o&&(Array.isArray(o)&&4===o.length&&!a?this.twoDSeries.push(b.parseNumber(o[3])):e.length>=5?this.twoDSeries.push(b.parseNumber(e[4])):this.twoDSeries.push(b.parseNumber(o)),this.w.axisFlags.dataFormatXNumeric=!0),"datetime"===s.xaxis.type){const t=new Date(r).getTime();this.twoDSeriesX.push(t)}else this.twoDSeriesX.push(r);void 0!==n&&(this.threeDSeries.push(n),this.w.axisFlags.isDataXYZ=!0)}}handleFormatXY(t,e){const s=this.w.config,i=this.w.globals,a=new y(this.w),r=t[e].data;let o=e;i.collapsedSeriesIndices.indexOf(e)>-1&&(o=this.activeSeriesIndex);const n=t[o].data;for(let t=0;t<r.length;t++){const s=r[t];if(void 0!==s.y){const t=Array.isArray(s.y)?b.parseNumber(s.y[s.y.length-1]):b.parseNumber(s.y);this.twoDSeries.push(t)}void 0===this.seriesGoals[e]&&(this.seriesGoals[e]=[]),void 0!==s.goals&&Array.isArray(s.goals)?this.seriesGoals[e].push(s.goals):this.seriesGoals[e].push(null),void 0!==s.z&&(this.threeDSeries.push(s.z),this.w.axisFlags.isDataXYZ=!0)}for(let t=0;t<n.length;t++){const e=n[t].x,r="string"==typeof e,o=Array.isArray(e),l=!o&&!!a.isValidDate(e);if(r||l)if(r||s.xaxis.convertedCatToNumeric){const t=i.isBarHorizontal&&this.w.axisFlags.isRangeData;"datetime"!==s.xaxis.type||t?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e),isNaN(e)||"category"===this.w.config.xaxis.type||"string"==typeof e||(this.w.axisFlags.isXNumeric=!0)):this.twoDSeriesX.push(a.parseDate(e))}else"datetime"===s.xaxis.type?this.twoDSeriesX.push(a.parseDate(e.toString())):(this.w.axisFlags.dataFormatXNumeric=!0,this.w.axisFlags.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(e)));else o?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e)):(this.w.axisFlags.isXNumeric=!0,this.w.axisFlags.dataFormatXNumeric=!0,this.twoDSeriesX.push(e))}}handleRangeData(t,e){let s={start:[],end:[],rangeUniques:[]};return this.isFormat2DArray()?s=this.handleRangeDataFormat("array",t,e):this.isFormatXY()&&(s=this.handleRangeDataFormat("xy",t,e)),this.w.rangeData.seriesRangeStart[e]=void 0===s.start?[]:s.start,this.w.rangeData.seriesRangeEnd[e]=void 0===s.end?[]:s.end,this.w.rangeData.seriesRange[e]=s.rangeUniques,this.w.rangeData.seriesRange.forEach(t=>{t&&t.forEach(t=>{const e=t.y,s=e.length;if(!(s<=1))for(let i=0;i<s;i++){const a=e[i],r=a.y1,o=a.y2;for(let n=i+1;n<s;n++){const s=e[n],i=s.y1;if(r<=s.y2&&i<=o){const e=t;e.overlaps.add(a.rangeName),e.overlaps.add(s.rangeName)}}}})}),s}handleCustomRangeData(t,e,s){const i=t[e].data||[],a=[],r=[];for(let t=0;t<i.length;t++){const e=i[t];let o,n;if("function"==typeof s){let i=s(e,t);Array.isArray(i)||(i=[i]);const a=i.map(t=>b.parseNumber(t)).filter(t=>null!==t&&!isNaN(t));o=a.length?Math.min(...a):null,n=a.length?Math.max(...a):null}else{const t=null==e?null:e.y;Array.isArray(t)?(o=b.parseNumber(t[0]),n=b.parseNumber(t[t.length-1])):o=n=b.parseNumber(t)}a.push(o),r.push(n)}this.w.rangeData.seriesRangeStart[e]=a,this.w.rangeData.seriesRangeEnd[e]=r}handleCandleStickBoxData(t,e){let s={o:[],h:[],m:[],l:[],c:[]};return this.isFormat2DArray()?s=this.handleCandleStickBoxDataFormat("array",t,e):this.isFormatXY()&&(s=this.handleCandleStickBoxDataFormat("xy",t,e)),this.w.candleData.seriesCandleO[e]=s.o,this.w.candleData.seriesCandleH[e]=s.h,this.w.candleData.seriesCandleM[e]=s.m,this.w.candleData.seriesCandleL[e]=s.l,this.w.candleData.seriesCandleC[e]=s.c,this.w.candleData.seriesBoxPoints[e]=s.points||[],s}handleViolinData(t,e){var s,i,a,r,o,n;const l=this.w,h=t[e].data,c=[],d=[],g=[],p=[],u=[];for(let t=0;t<h.length;t++){const e=h[t],l=null!=(a=null!=(i=null==(s=null==e?void 0:e.y)?void 0:s.density)?i:null==e?void 0:e[1])?a:[],x=null!=(n=null!=(o=null==(r=null==e?void 0:e.y)?void 0:r.points)?o:null==e?void 0:e[2])?n:[],f=[],m=[];let y=0,w=null,v=1/0,A=-1/0;for(let t=0;t<l.length;t++){const e=b.parseNumber(l[t][0]),s=b.parseNumber(l[t][1]);null!==e&&null!==s&&(f.push(e),m.push(s),s>y&&(y=s,w=e),e<v&&(v=e),e>A&&(A=e))}const C=[];for(let t=0;t<x.length;t++){const e=b.parseNumber(x[t]);null!==e&&(C.push(e),e<v&&(v=e),e>A&&(A=e))}c.push({values:f,weights:m,maxWeight:y}),d.push(C),g.push(v===1/0?0:v),p.push(A===-1/0?0:A),u.push(null!==w?w:C.length?C[Math.floor(C.length/2)]:0)}l.violinData.seriesViolinDensity[e]=c,l.violinData.seriesViolinPoints[e]=d,l.violinData.seriesViolinMin[e]=g,l.violinData.seriesViolinMax[e]=p,this.twoDSeries=u}handleRangeDataFormat(t,e,s){const i=[],a=[],r=new Map,o=[];if(e[s].data.forEach(t=>{if(!r.has(t.x)){const e={x:t.x,overlaps:new Set,y:[]};r.set(t.x,e),o.push(e)}}),"array"===t)for(let t=0;t<e[s].data.length;t++)Array.isArray(e[s].data[t])?(i.push(e[s].data[t][1][0]),a.push(e[s].data[t][1][1])):(i.push(e[s].data[t]),a.push(e[s].data[t]));else if("xy"===t)for(let t=0;t<e[s].data.length;t++){const o=Array.isArray(e[s].data[t].y),n=b.randomId(),l=e[s].data[t].x,h={y1:o?e[s].data[t].y[0]:e[s].data[t].y,y2:o?e[s].data[t].y[1]:e[s].data[t].y,rangeName:n};e[s].data[t].rangeName=n;const c=r.get(l);c&&c.y.push(h),i.push(h.y1),a.push(h.y2)}return{start:i,end:a,rangeUniques:o}}handleCandleStickBoxDataFormat(t,e,s){const i=this.w,a="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[s].type,r=[],o=[],n=[],l=[],h=[],c=[],d=e[s].data;let g;if("array"===t){g=a&&6===d[0].length||!a&&5===d[0].length?t=>t.slice(1):t=>Array.isArray(t[1])?t[1]:[]}else g=t=>Array.isArray(t.y)?t.y:[];for(let t=0;t<d.length;t++){const e=g(d[t]);e&&e.length>=2&&(r.push(e[0]),o.push(e[1]),a?(n.push(e[2]),l.push(e[3]),h.push(e[4])):(l.push(e[2]),h.push(e[3])));const s=d[t]&&d[t].points;c.push(Array.isArray(s)?s:[])}return{o:r,h:o,m:n,l:l,c:h,points:c}}parseDataAxisCharts(t){var e,s,i,a,r,o;const h=this.w.config,c=this.w.globals,d=new y(this.w),g=h.labels.length>0?h.labels.slice():h.xaxis.categories.slice();this.w.axisFlags.isRangeBar="rangeBar"===h.chart.type&&c.isBarHorizontal,this.w.labelData.hasXaxisGroups="category"===h.xaxis.type&&h.xaxis.group.groups.length>0,this.w.labelData.hasXaxisGroups&&(this.w.labelData.groups=h.xaxis.group.groups),t.forEach((t,e)=>{void 0!==t.name?this.w.seriesData.seriesNames.push(t.name):this.w.seriesData.seriesNames.push("series-"+parseInt(String(e+1),10))}),this.coreUtils.setSeriesYAxisMappings();const p=[],u=[...new Set(h.series.map(t=>t.group))];h.series.forEach((t,e)=>{const s=u.indexOf(t.group);p[s]||(p[s]=[]),p[s].push(this.w.seriesData.seriesNames[e])}),this.w.labelData.seriesGroups=p;const x=()=>{for(let t=0;t<g.length;t++)if("string"==typeof g[t]){if(!d.isValidDate(g[t]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");this.twoDSeriesX.push(d.parseDate(g[t]))}else this.twoDSeriesX.push(g[t])};for(let d=0;d<t.length;d++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],void 0===t[d].data)return;const p=h.chart.dataReducer,u=null==(s=null==(e=c.dataReducerRawSeries)?void 0:e[d])?void 0:s.data;if((null==p?void 0:p.enabled)&&this.isMultiFormat()&&Array.isArray(u)&&u.length>(null!=(i=p.threshold)?i:500)){const e=null!=(a=p.targetPoints)?a:250,s=h.xaxis.min,i=h.xaxis.max,c=null==s&&null==i?u:He.sliceByXRange(u,s,i);let g=c;if(c.length>e){const t=Array.isArray(c[0])?null==(o=c[0])?void 0:o[1]:null==(r=c[0])?void 0:r.y;Array.isArray(t)?4===t.length?g=He.ohlcAggregate(c,e):2===t.length&&(g=He.rangeAggregate(c,e)):g=He.lttbDownsample(c,e)}t[d]=l(n({},t[d]),{data:g})}"rangeBar"!==h.chart.type&&"rangeArea"!==h.chart.type&&"rangeBar"!==t[d].type&&"rangeArea"!==t[d].type||(this.w.axisFlags.isRangeData=!0,this.handleRangeData(t,d));const f=t[d].type||h.chart.type;if(Be(f)){const e=Ne(f),s=e&&e.yExtent;(e&&"rangeXY"===e.dataType||"function"==typeof s)&&(this.w.axisFlags.isRangeData=!0,this.handleCustomRangeData(t,d,s))}if(this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(t,d):this.isFormatXY()&&this.handleFormatXY(t,d),"candlestick"!==h.chart.type&&"candlestick"!==t[d].type&&"boxPlot"!==h.chart.type&&"boxPlot"!==t[d].type||this.handleCandleStickBoxData(t,d),"violin"!==h.chart.type&&"violin"!==t[d].type||this.handleViolinData(t,d),this.w.seriesData.series.push(this.twoDSeries),this.w.labelData.labels.push(this.twoDSeriesX),this.w.seriesData.seriesX.push(this.twoDSeriesX),this.w.seriesData.seriesGoals=this.seriesGoals,d!==this.activeSeriesIndex||this.fallbackToCategory||(this.w.axisFlags.isXNumeric=!0);else{"datetime"===h.xaxis.type?(this.w.axisFlags.isXNumeric=!0,x(),this.w.seriesData.seriesX.push(this.twoDSeriesX)):"numeric"===h.xaxis.type&&(this.w.axisFlags.isXNumeric=!0,g.length>0&&(this.twoDSeriesX=g,this.w.seriesData.seriesX.push(this.twoDSeriesX))),this.w.labelData.labels.push(this.twoDSeriesX);const e=t[d].data.map(t=>b.parseNumber(t));this.w.seriesData.series.push(e)}this.w.seriesData.seriesZ.push(this.threeDSeries),void 0!==t[d].color?this.w.seriesData.seriesColors.push(t[d].color):this.w.seriesData.seriesColors.push(void 0)}return this.w}parseDataNonAxisCharts(t){const e=this.w.config,s=Array.isArray(t)&&t.every(t=>"number"==typeof t)&&e.labels.length>0;Array.isArray(t)&&t.some(t=>t&&"object"==typeof t&&t.data||t&&"object"==typeof t&&t.parsing);if(s){this.w.seriesData.series=t.slice(),this.w.seriesData.seriesNames=e.labels.slice();for(let t=0;t<this.w.seriesData.series.length;t++)void 0===this.w.seriesData.seriesNames[t]&&this.w.seriesData.seriesNames.push("series-"+(t+1));return this.w}if(Array.isArray(t)&&t.every(t=>"number"==typeof t)){this.w.seriesData.series=t.slice(),this.w.seriesData.seriesNames=[];for(let t=0;t<this.w.seriesData.series.length;t++)this.w.seriesData.seriesNames.push(e.labels[t]||`series-${t+1}`);return this.w}const i=this.extractPieDataFromSeries(t);this.w.seriesData.series=i.values,this.w.seriesData.seriesNames=i.labels,"radialBar"===e.chart.type&&(this.w.seriesData.series=this.w.seriesData.series.map(t=>{const e=b.parseNumber(t);return e}));for(let t=0;t<this.w.seriesData.series.length;t++)void 0===this.w.seriesData.seriesNames[t]&&this.w.seriesData.seriesNames.push("series-"+(t+1));return this.w}resetParsingFlags(){const t=this.w;t.axisFlags.dataWasParsed=!1,t.globals.originalSeries=null,t.config.series&&t.config.series.forEach(t=>{t.__apexParsed&&delete t.__apexParsed})}extractPieDataFromSeries(t){const e=[],s=[];if(!Array.isArray(t))return{values:[],labels:[]};if(0===t.length)return{values:[],labels:[]};const i=t[0];return"object"==typeof i&&null!==i&&i.data?(this.extractPieDataFromSeriesObjects(t,e,s),{values:e,labels:s}):{values:[],labels:[]}}extractPieDataFromSeriesObjects(t,e,s){t.forEach((t,i)=>{t.data&&Array.isArray(t.data)&&t.data.forEach(t=>{"object"==typeof t&&null!==t&&void 0!==t.x&&void 0!==t.y&&(s.push(String(t.x)),e.push(b.parseNumber(t.y)))})})}handleExternalLabelsData(t){const e=this.w.config;if(e.xaxis.categories.length>0)this.w.labelData.labels=e.xaxis.categories;else if(e.labels.length>0)this.w.labelData.labels=e.labels.slice();else if(this.fallbackToCategory){if(this.w.labelData.labels=this.w.labelData.labels[0],this.w.rangeData.seriesRange.length){this.w.rangeData.seriesRange.map(t=>{t.forEach(t=>{this.w.labelData.labels.indexOf(t.x)<0&&t.x&&this.w.labelData.labels.push(t.x)})});const t=this.w.labelData.labels;if(t.length>0&&("number"==typeof t[0]||"string"==typeof t[0]))this.w.labelData.labels=[...new Set(t)];else{const e=new Map;for(const s of t){const t=JSON.stringify(s);e.has(t)||e.set(t,s)}this.w.labelData.labels=Array.from(e.values())}}if(e.xaxis.convertedCatToNumeric){new C(e).convertCatToNumericXaxis(e,this.w.seriesData.seriesX[0]),this._generateExternalLabels(t)}}else this._generateExternalLabels(t)}_generateExternalLabels(t){const e=this.w.globals,s=this.w.config;let i=[];if(e.axisCharts){if(this.w.seriesData.series.length>0)if(this.isFormatXY()){const t=s.series.map(t=>{const e=new Map;for(const s of t.data)e.has(s.x)||e.set(s.x,s);return Array.from(e.values())}),e=t.reduce((t,e,s,i)=>i[t].length>e.length?t:s,0);for(let s=0;s<t[e].length;s++)i.push(s+1)}else for(let t=0;t<this.w.seriesData.series[e.maxValsInArrayIndex].length;t++)i.push(t+1);this.w.seriesData.seriesX=[];for(let e=0;e<t.length;e++)this.w.seriesData.seriesX.push(i);this.w.globals.isBarHorizontal||(this.w.axisFlags.isXNumeric=!0)}if(0===i.length){i=e.axisCharts?[]:this.w.seriesData.series.map((t,e)=>e+1);for(let e=0;e<t.length;e++)this.w.seriesData.seriesX.push(i)}this.w.labelData.labels=i,s.xaxis.convertedCatToNumeric&&(this.w.labelData.categoryLabels=i.map(t=>s.xaxis.labels.formatter(t))),this.w.axisFlags.noLabelsProvided=!0}parseRawDataIfNeeded(t){const e=this.w.config,s=this.w.globals,i=e.parsing;if(this.w.axisFlags.dataWasParsed)return t;if(!i&&!t.some(t=>t.parsing))return t;const a=t.map((t,e)=>{var s,a,r;if(!t.data||!Array.isArray(t.data)||0===t.data.length)return t;const o={x:(null==(s=t.parsing)?void 0:s.x)||(null==i?void 0:i.x),y:(null==(a=t.parsing)?void 0:a.y)||(null==i?void 0:i.y),z:(null==(r=t.parsing)?void 0:r.z)||(null==i?void 0:i.z)};if(!o.x&&!o.y)return t;const h=t.data[0];if("object"==typeof h&&null!==h&&(Object.prototype.hasOwnProperty.call(h,"x")||Object.prototype.hasOwnProperty.call(h,"y"))||Array.isArray(h))return t;if(!o.x||!o.y||Array.isArray(o.y)&&0===o.y.length)return t;const c=t.data.map((t,e)=>{if("object"!=typeof t||null===t)return t;const s=this.getNestedValue(t,o.x);let i,a;if(Array.isArray(o.y)){const e=o.y.map(e=>this.getNestedValue(t,e));"bubble"===this.w.config.chart.type?(e.length,i=e[0]):i=e}else i=this.getNestedValue(t,o.y);o.z&&(a=this.getNestedValue(t,o.z));const r={x:s,y:i,z:void 0};if("bubble"===this.w.config.chart.type&&Array.isArray(o.y)&&2===o.y.length){const e=this.getNestedValue(t,o.y[1]);void 0!==e&&(r.z=e)}return void 0!==a&&(r.z=a),r});return l(n({},t),{data:c,__apexParsed:!0})});return this.w.axisFlags.dataWasParsed=!0,s.originalSeries||(s.originalSeries=b.clone(t)),a}getNestedValue(t,e){if(!t||"object"!=typeof t||!e)return;if(-1===e.indexOf("."))return t[e];const s=e.split(".");let i=t;for(let t=0;t<s.length;t++){if(null==i||"object"!=typeof i)return;i=i[s[t]]}return i}expandScatterJitterData(t){var e,s;const i=this.w.config,a="scatter"===i.chart.type||"bubble"===i.chart.type,r=null==(s=null==(e=i.plotOptions)?void 0:e.scatter)?void 0:s.jitter;if(!(a&&r&&r.enabled&&Array.isArray(t)))return t;if(!t.some(t=>Array.isArray(null==t?void 0:t.data)&&t.data.some(t=>t&&!Array.isArray(t)&&Array.isArray(t.y))))return"datetime"!==i.xaxis.type&&(Array.isArray(i.xaxis.categories)&&i.xaxis.categories.length?this._applyBandAxis(i.xaxis.categories.slice()):Array.isArray(i.xaxis._scatterBandLabels)&&i.xaxis._scatterBandLabels.length&&this._applyBandAxis(i.xaxis._scatterBandLabels)),t;const o=[],h=new Map;t.forEach(t=>{Array.isArray(null==t?void 0:t.data)&&t.data.forEach(t=>{if(t&&Array.isArray(t.y)){const e=String(t.x);h.has(e)||(h.set(e,o.length),o.push(t.x))}})});const c=r.maxPoints||5e3,d=t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;const e=[];return t.data.forEach(t=>{if(t&&Array.isArray(t.y)){const s=h.get(String(t.x)),i=t.y,a=i.length>c?Math.ceil(i.length/c):1;for(let t=0;t<i.length;t+=a){const a=b.parseNumber(i[t]);null!==a&&e.push({x:s,y:a})}}else if(t&&"object"==typeof t&&!Array.isArray(t)){const s=String(t.x);e.push({x:h.has(s)?h.get(s):t.x,y:t.y})}else e.push(t)}),l(n({},t),{data:e})});return this._applyBandAxis(o),d}_applyBandAxis(t){var e;const s=this.w.config.xaxis,i=t.length;if(!i)return;const a=s._scatterBand=s._scatterBand||{};if(s._scatterBandLabels=t.slice(),s.type="numeric",(null==(e=this.w.interact)?void 0:e.zoomed)&&"number"==typeof s.min&&"number"==typeof s.max&&isFinite(s.min)&&isFinite(s.max)){const t=t=>Math.max(0,Math.min(i-1,t));let e=t(Math.round(s.min+.49)),r=t(Math.round(s.max-.49));r<e&&(e=r=t(Math.round((s.min+s.max)/2))),s.min=e-1,s.max=r+1,s.tickAmount=r-e+2,a.min=!0,a.max=!0,a.tick=!0}else(null==s.min||a.min)&&(s.min=-1,a.min=!0),(null==s.max||a.max)&&(s.max=i,a.max=!0),(null==s.tickAmount||"dataPoints"===s.tickAmount||a.tick)&&(s.tickAmount=i+1,a.tick=!0);s.labels=s.labels||{};const r=s.labels.formatter;if("function"!=typeof r||r._scatterBand){const e=e=>{const s=Math.round(e);return Math.abs(e-s)<1e-6&&void 0!==t[s]?t[s]:""};e._scatterBand=!0,s.labels.formatter=e}}parseData(t){var e,s,i,a,r,o;const h=this.w,c=h.config,d=h.globals;if(t=this.parseRawDataIfNeeded(t),t=this.expandScatterJitterData(t),(null==(e=c.chart.dataReducer)?void 0:e.enabled)&&d.axisCharts&&!d.dataReducerRawSeries){d.dataReducerRawSeries=t.map(t=>({data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data}));let e=1/0,o=-1/0;for(const n of t){const t=null==n?void 0:n.data;if(!Array.isArray(t)||0===t.length)continue;const l=!Array.isArray(t[0]),h=l?null==(s=t[0])?void 0:s.x:null==(i=t[0])?void 0:i[0],c=l?null==(a=t[t.length-1])?void 0:a.x:null==(r=t[t.length-1])?void 0:r[0];"number"==typeof h&&(e=Math.min(e,h)),"number"==typeof c&&(o=Math.max(o,c))}e!==1/0&&(d.dataReducerRawMinX=e,d.dataReducerRawMaxX=o)}if(c.series=t,d.dataReducerRawSeries&&(null==(o=c.chart.dataReducer)?void 0:o.enabled)){const e=d.dataReducerRawSeries;d.initialSeries=t.map((t,s)=>{var i,a,r;return l(n({},t),{data:null!=(r=null==(a=null==(i=e[s])?void 0:i.data)?void 0:a.slice())?r:t.data})})}else d.initialSeries=b.clone(t);if(this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.resetGlobals(),this.isMultipleY(),d.axisCharts?(this.parseDataAxisCharts(t),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(t),c.chart.stacked){const t=new ce(this.w);this.w.seriesData.series=t.setNullSeriesToZeroValues(this.w.seriesData.series)}this.coreUtils.getSeriesTotals(),d.axisCharts&&(this.w.seriesData.stackedSeriesTotals=this.coreUtils.getStackedSeriesTotals(),this.w.seriesData.stackedSeriesTotalsByGroups=this.coreUtils.getStackedSeriesTotalsByGroups()),this.coreUtils.getPercentSeries(),this.w.axisFlags.dataFormatXNumeric||this.w.axisFlags.isXNumeric&&("numeric"!==c.xaxis.type||0!==c.labels.length||0!==c.xaxis.categories.length)||this.handleExternalLabelsData(t);const g=this.coreUtils.getCategoryLabels(this.w.labelData.labels);for(let t=0;t<g.length;t++)if(Array.isArray(g[t])){this.w.axisFlags.isMultiLineX=!0;break}return{seriesData:{series:this.w.seriesData.series,seriesNames:this.w.seriesData.seriesNames,seriesX:this.w.seriesData.seriesX,seriesZ:this.w.seriesData.seriesZ,seriesColors:this.w.seriesData.seriesColors,seriesGoals:this.w.seriesData.seriesGoals,initialSeries:d.initialSeries,originalSeries:d.originalSeries,stackedSeriesTotals:this.w.seriesData.stackedSeriesTotals,stackedSeriesTotalsByGroups:this.w.seriesData.stackedSeriesTotalsByGroups,noLabelsProvided:this.w.axisFlags.noLabelsProvided},rangeData:{seriesRangeStart:this.w.rangeData.seriesRangeStart,seriesRangeEnd:this.w.rangeData.seriesRangeEnd,seriesRange:this.w.rangeData.seriesRange},candleData:{seriesCandleO:this.w.candleData.seriesCandleO,seriesCandleH:this.w.candleData.seriesCandleH,seriesCandleM:this.w.candleData.seriesCandleM,seriesCandleL:this.w.candleData.seriesCandleL,seriesCandleC:this.w.candleData.seriesCandleC,seriesBoxPoints:this.w.candleData.seriesBoxPoints},labelData:{labels:this.w.labelData.labels,categoryLabels:this.w.labelData.categoryLabels},axisFlags:{isXNumeric:this.w.axisFlags.isXNumeric,dataFormatXNumeric:this.w.axisFlags.dataFormatXNumeric,isDataXYZ:this.w.axisFlags.isDataXYZ,isRangeData:this.w.axisFlags.isRangeData,isRangeBar:this.w.axisFlags.isRangeBar,isMultiLineX:this.w.axisFlags.isMultiLineX,dataWasParsed:this.w.axisFlags.dataWasParsed,hasXaxisGroups:this.w.labelData.hasXaxisGroups,groups:this.w.labelData.groups,seriesGroups:this.w.labelData.seriesGroups}}}static sliceByXRange(t,e,s){const i=t.length;if(0===i)return t;const a=!Array.isArray(t[0])?t=>t.x:t=>t[0];let r=0;if(null!=e){let s=0,o=i-1;for(;s<=o;){const i=s+o>>1;a(t[i])<e?s=i+1:o=i-1}r=Math.max(0,s-1)}let o=i;if(null!=s){let e=0,r=i-1;for(;e<=r;){const i=e+r>>1;a(t[i])>s?r=i-1:e=i+1}o=Math.min(i,e+1)}return 0===r&&o===i?t.slice():t.slice(r,o)}static lttbDownsample(t,e){const s=t.length;if(e>=s||e<3)return t;const i=!Array.isArray(t[0]),a=i?t=>t.x:t=>t[0],r=i?t=>t.y:t=>t[1],o=[];o.push(t[0]);const n=(s-2)/(e-2);let l=0;for(let i=0;i<e-2;i++){const e=Math.floor((i+1)*n)+1,h=Math.min(Math.floor((i+2)*n)+1,s);let c=0,d=0;const g=h-e;for(let s=e;s<h;s++)c+=a(t[s]),d+=r(t[s]);c/=g,d/=g;const p=Math.floor(i*n)+1,u=Math.min(Math.floor((i+1)*n)+1,s),x=a(t[l]),f=r(t[l]);let m=-1,b=p;for(let e=p;e<u;e++){const s=.5*Math.abs((x-c)*(r(t[e])-f)-(x-a(t[e]))*(d-f));s>m&&(m=s,b=e)}o.push(t[b]),l=b}return o.push(t[s-1]),o}static ohlcAggregate(t,e){const s=t.length;if(e>=s||e<1)return t;const i=!Array.isArray(t[0]),a=i?t=>t.x:t=>t[0],r=i?t=>t.y:t=>t[1],o=i?(t,e)=>({x:t,y:e}):(t,e)=>[t,e],n=[],l=s/e;for(let i=0;i<e;i++){const h=Math.floor(i*l),c=i===e-1?s:Math.floor((i+1)*l);if(c<=h)continue;const d=r(t[h]),g=d[0];let p=d[1],u=d[2],x=d[3];for(let e=h+1;e<c;e++){const s=r(t[e]);s[1]>p&&(p=s[1]),s[2]<u&&(u=s[2]),x=s[3]}n.push(o(a(t[h]),[g,p,u,x]))}return n}static rangeAggregate(t,e){const s=t.length;if(e>=s||e<1)return t;const i=!Array.isArray(t[0]),a=i?t=>t.x:t=>t[0],r=i?t=>t.y:t=>t[1],o=i?(t,e)=>({x:t,y:e}):(t,e)=>[t,e],n=[],l=s/e;for(let i=0;i<e;i++){const h=Math.floor(i*l),c=i===e-1?s:Math.floor((i+1)*l);if(c<=h)continue;let d=1/0,g=-1/0;for(let e=h;e<c;e++){const s=r(t[e]);if(null!=s)for(let t=0;t<2;t++){const e=s[t];null!=e&&isFinite(e)&&(e<d&&(d=e),e>g&&(g=e))}}n.push(o(a(t[h]),d===1/0?[null,null]:[d,g]))}return n}excludeCollapsedSeriesInYAxis(){const t=this.w,e=[];t.globals.seriesYAxisMap.forEach((s,i)=>{let a=0;s.forEach(e=>{-1!==t.globals.collapsedSeriesIndices.indexOf(e)&&a++}),a>0&&a==s.length&&e.push(i)}),t.globals.ignoreYAxisIndexes=e.map(t=>t)}}class We{constructor(t,e){this.w=t,this.ctx=e}_updateOptions(t,e=!1,s=!0,i=!0,a=!1){return new Promise(r=>{let o=[this.ctx];i&&(o=this.ctx.getSyncedCharts()),this.w.globals.isExecCalled&&(o=[this.ctx],this.w.globals.isExecCalled=!1),o.forEach((i,n)=>{var l,h;const c=i.w;if(c.globals.shouldAnimate=s,e||(c.globals.resized=!0,c.globals.dataChanged=!0,s&&i.series.getPreviousPaths()),s&&t&&"object"==typeof t){const e=null==(l=null==t?void 0:t.chart)?void 0:l.type,s=c.config.chart.requestedType||c.config.chart.type;e&&e!==s&&(null==(h=i.morphTypeChange)||h.captureBeforeDestroy({fromType:s,toType:e,newSeries:t.series||c.config.series}))}if(t&&"object"==typeof t){i.config=new _(t);const e=t.chart&&t.chart.type,s="funnel"===e||"pyramid"===e||"gauge"===e,r=!!c.config.chart.requestedType;if(e&&!s&&r){t.chart=t.chart||{},t.chart.requestedType=e;const s=c.config.chart.requestedType;"funnel"!==s&&"pyramid"!==s||(t.plotOptions=t.plotOptions||{},t.plotOptions.bar=t.plotOptions.bar||{},void 0===t.plotOptions.bar.isFunnel&&(t.plotOptions.bar.isFunnel=!1),void 0===t.plotOptions.bar.isPyramid&&(t.plotOptions.bar.isPyramid=!1))}if(i.config.normalizeAliasedChartType(t),t=P.extendArrayProps(i.config,t,c),i.w.globals.chartID!==this.w.globals.chartID&&(delete t.series,delete t.yaxis),c.config=b.extend(c.config,t),a&&(c.globals.lastXAxis=t.xaxis?b.clone(t.xaxis):[],c.globals.lastYAxis=t.yaxis?b.clone(t.yaxis):[],c.globals.initialConfig=b.extend({},c.config),c.globals.initialSeries=b.clone(c.config.series),t.series)){for(let t=0;t<c.globals.collapsedSeriesIndices.length;t++){const e=c.config.series[c.globals.collapsedSeriesIndices[t]];c.globals.collapsedSeries[t].data=c.globals.axisCharts?e.data.slice():e}for(let t=0;t<c.globals.ancillaryCollapsedSeriesIndices.length;t++){const e=c.config.series[c.globals.ancillaryCollapsedSeriesIndices[t]];c.globals.ancillaryCollapsedSeries[t].data=c.globals.axisCharts?e.data.slice():e}i.series.emptyCollapsedSeries(c.config.series)}}return i.update(t).then(()=>{n===o.length-1&&r(i)})})})}_updateSeries(t,e,s=!1){return new Promise(i=>{const a=this.w;a.globals.shouldAnimate=e,a.globals.dataChanged=!0;const r=JSON.stringify({y:(a.globals.yAxisScale||[]).map(t=>t?t.result:null),xMin:a.globals.minX,xMax:a.globals.maxX});wt.invalidateSelectors(a),e&&this.ctx.series.getPreviousPaths();const o=a.config.series.length,n=a.config.series.map(t=>{var e,s;return null!=(s=null==(e=null==t?void 0:t.data)?void 0:e.length)?s:0});a.globals.dataReducerRawSeries=null,this.ctx.data.resetParsingFlags();const l=this.ctx.data.parseData(t);return this.ctx._writeParsedSeriesData(l.seriesData),this.ctx._writeParsedRangeData(l.rangeData),this.ctx._writeParsedCandleData(l.candleData),this.ctx._writeParsedLabelData(l.labelData),this.ctx._writeParsedAxisFlags(l.axisFlags),s&&(a.globals.initialConfig&&(a.globals.initialConfig.series=b.clone(a.config.series)),a.globals.initialSeries=b.clone(a.config.series)),this._canUseFastPath(t,o,n,a)?this.ctx.fastUpdate(e,r).then(()=>{i(this.ctx)}):this.ctx.update().then(()=>{i(this.ctx)})})}_canUseFastPath(t,e,s,i){return!!i.dom.elGraphical&&(!!i.globals.axisCharts&&(t.length===e&&(!t.some((t,e)=>{var i,a;return(null!=(a=null==(i=null==t?void 0:t.data)?void 0:i.length)?a:0)!==s[e]})&&(!(i.globals.collapsedSeries.length>0)&&(!(i.globals.ancillaryCollapsedSeries.length>0)&&(!(i.globals.risingSeries.length>0)&&(!i.globals.comboCharts&&!i.interact.zoomed)))))))}_extendSeries(t,e){const s=this.w,i=s.config.series[e];return l(n({},s.config.series[e]),{name:t.name?t.name:null==i?void 0:i.name,color:t.color?t.color:null==i?void 0:i.color,type:t.type?t.type:null==i?void 0:i.type,group:t.group?t.group:null==i?void 0:i.group,hidden:void 0!==t.hidden?t.hidden:null==i?void 0:i.hidden,data:t.data?t.data:null==i?void 0:i.data,zIndex:void 0!==t.zIndex?t.zIndex:e})}toggleDataPointSelection(t,e){const s=this.w;let i=null;const a=`.apexcharts-series[data\\:realIndex='${t}']`;if(s.globals.axisCharts?i=s.dom.Paper.findOne(`${a} path[j='${e}'], ${a} circle[j='${e}'], ${a} rect[j='${e}']`):void 0===e&&(i=s.dom.Paper.findOne(`${a} path[j='${t}']`),"pie"!==s.config.chart.type&&"polarArea"!==s.config.chart.type&&"donut"!==s.config.chart.type||this.ctx.pie.pieClicked(t)),!i)return null;new gt(this.w).pathMouseDown(i,null);return i.node?i.node:null}forceXAxisUpdate(t){const e=this.w;if(["min","max"].forEach(s=>{void 0!==t.xaxis[s]&&(e.config.xaxis[s]=t.xaxis[s],e.globals.lastXAxis[s]=t.xaxis[s])}),t.xaxis.categories&&t.xaxis.categories.length&&(e.config.xaxis.categories=t.xaxis.categories),e.config.xaxis.convertedCatToNumeric){const e=new C(t);t=e.convertCatToNumericXaxis(t,this.ctx)}return t}forceYAxisUpdate(t){return t.chart&&t.chart.stacked&&"100%"===t.chart.stackType&&(Array.isArray(t.yaxis)?t.yaxis.forEach((e,s)=>{t.yaxis[s].min=0,t.yaxis[s].max=100}):(t.yaxis.min=0,t.yaxis.max=100)),t}revertDefaultAxisMinMax(t){const e=this.w;let s=e.globals.lastXAxis,i=e.globals.lastYAxis;t&&t.xaxis&&(s=t.xaxis),t&&t.yaxis&&(i=t.yaxis);const a=s;e.config.xaxis.min=a.min,e.config.xaxis.max=a.max;const r=t=>{if(void 0!==i[t]){const s=i[t];e.config.yaxis[t].min=s.min,e.config.yaxis[t].max=s.max}};e.config.yaxis.map((t,s)=>{e.interact.zoomed||void 0!==i[s]?r(s):void 0!==this.ctx.opts.yaxis[s]&&(t.min=this.ctx.opts.yaxis[s].min,t.max=this.ctx.opts.yaxis[s].max)})}}class $e{constructor(t){this.w=t.w,this.ttCtx=t}getNearestValues({hoverArea:t,elGrid:e,clientX:s,clientY:i}){var a,r;const o=this.w,n=e.getBoundingClientRect(),l=n.width,h=n.height;let c=l/(o.globals.dataPoints-1);const d=h/o.globals.dataPoints,g=this.hasBars();!o.globals.comboCharts&&!g||o.config.xaxis.convertedCatToNumeric||(c=l/o.globals.dataPoints);const p=s-n.left-o.globals.barPadForNumericAxis,u=i-n.top;p<0||u<0||p>l||u>h?(t.classList.remove("hovering-zoom"),t.classList.remove("hovering-pan")):o.interact.zoomEnabled?(t.classList.remove("hovering-pan"),t.classList.add("hovering-zoom")):o.interact.panEnabled&&(t.classList.remove("hovering-zoom"),t.classList.add("hovering-pan"));let x=Math.round(p/c);const f=Math.floor(u/d);g&&!o.config.xaxis.convertedCatToNumeric&&(x=Math.ceil(p/c),x-=1);let m=null,y=null,w=o.globals.seriesXvalues.map(t=>t.filter(t=>b.isNumber(t)));const v=o.globals.seriesYvalues.map(t=>t.filter(t=>b.isNumber(t)));if(o.axisFlags.isXNumeric){const t=this.ttCtx.getElGrid();if(!t)return{hoverX:p,hoverY:u};const e=t.getBoundingClientRect(),s=p*(e.width/l),i=u*(e.height/h);y=this.closestInMultiArray(s,i,w,v),m=y.index,x=null!=(a=y.j)?a:0,null!==m&&o.globals.hasNullValues&&(w=o.globals.seriesXvalues[m],y=this.closestInArray(s,w),x=null!=(r=y.j)?r:0)}return o.interact.capturedSeriesIndex=null===m?-1:m,(!x||x<1)&&(x=0),o.globals.isBarHorizontal?o.interact.capturedDataPointIndex=f:o.interact.capturedDataPointIndex=x,{capturedSeries:m,j:o.globals.isBarHorizontal?f:x,hoverX:p,hoverY:u}}getFirstActiveXArray(t){const e=this.w;let s=0;const i=t.map((t,e)=>t.length>0?e:-1);for(let t=0;t<i.length;t++)if(-1!==i[t]&&-1===e.globals.collapsedSeriesIndices.indexOf(t)&&-1===e.globals.ancillaryCollapsedSeriesIndices.indexOf(t)){s=i[t];break}return s}closestInMultiArray(t,e,s,i){const a=this.w,r=t=>-1===a.globals.collapsedSeriesIndices.indexOf(t)&&-1===a.globals.ancillaryCollapsedSeriesIndices.indexOf(t),o=a.config.chart.type,n=!a.globals.comboCharts&&("line"===o||"area"===o);let l=1/0,h=null,c=null;if(a.globals.allSeriesHasEqualX){let a=1/0;for(let e=0;e<s.length;e++){if(!r(e))continue;const o=s[e],n=i[e],l=Math.min(o.length,n.length);for(let e=0;e<l;e++){const s=Math.abs(t-o[e]);s<a&&(a=s,c=e)}}if(null!==c)if(n){let a=1/0;for(let o=0;o<s.length;o++){if(!r(o))continue;const n=s[o],l=i[o],d=Math.min(n.length,l.length);if(d<2){const t=l[c];if("number"!=typeof t)continue;const s=Math.abs(e-t);s<a&&(a=s,h=o);continue}for(let s=0;s<d-1;s++){const i=this._distanceToSegment(t,e,n[s],l[s],n[s+1],l[s+1]);i.dist<a&&(a=i.dist,h=o)}}}else{let t=1/0;for(let a=0;a<s.length;a++){if(!r(a))continue;const s=i[a][c];if("number"!=typeof s)continue;const o=Math.abs(e-s);o<t&&(t=o,h=a)}}return{index:h,j:c}}for(let a=0;a<s.length;a++){if(!r(a))continue;const o=s[a],d=i[a],g=Math.min(o.length,d.length);if(n&&g>=2)for(let s=0;s<g-1;s++){const i=this._distanceToSegment(t,e,o[s],d[s],o[s+1],d[s+1]);i.dist<l&&(l=i.dist,h=a,c=i.t<.5?s:s+1)}else for(let s=0;s<g;s++){const i=t-o[s],r=e-d[s],n=Math.sqrt(i*i+r*r);n<l&&(l=n,h=a,c=s)}}return{index:h,j:c}}_distanceToSegment(t,e,s,i,a,r){const o=a-s,n=r-i,l=o*o+n*n;let h=0===l?0:((t-s)*o+(e-i)*n)/l;h<0?h=0:h>1&&(h=1);const c=t-(s+h*o),d=e-(i+h*n);return{dist:Math.sqrt(c*c+d*d),t:h}}closestInArray(t,e){const s=e[0];let i=null,a=Math.abs(t-s);for(let s=0;s<e.length;s++){const r=Math.abs(t-e[s]);r<a&&(a=r,i=s)}return{j:i}}isXoverlap(t){const e=[],s=this.w.seriesData.seriesX.filter(t=>void 0!==t[0]);if(s.length>0)for(let i=0;i<s.length-1;i++)void 0!==s[i][t]&&void 0!==s[i+1][t]&&s[i][t]!==s[i+1][t]&&e.push("unEqual");return 0===e.length}isInitialSeriesSameLen(){var t,e,s;let i=!0;const a=(null==(t=this.w.globals.initialSeries)?void 0:t.filter((t,e)=>{var s;return!(null==(s=this.w.globals.collapsedSeriesIndices)?void 0:s.includes(e))}))||[];for(let t=0;t<a.length-1;t++){if(!(null==(e=a[t])?void 0:e.data)||!(null==(s=a[t+1])?void 0:s.data))return!0;if(a[t].data.length!==a[t+1].data.length){i=!1;break}}return i}getBarsHeight(t){return[...t].reduce((t,e)=>t+e.getBBox().height,0)}getElMarkers(t){return"number"==typeof t?this.w.dom.baseEl.querySelectorAll(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers-wrap > *`):this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}getAllMarkers(t=!1){let e=[...this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap")];t&&(e=e.filter(t=>{const e=Number(t.getAttribute("data:realIndex"));return-1===this.w.globals.collapsedSeriesIndices.indexOf(e)})),e.sort((t,e)=>{var s=Number(t.getAttribute("data:realIndex")),i=Number(e.getAttribute("data:realIndex"));return i<s?1:i>s?-1:0});const s=[];return e.forEach(t=>{s.push(t.querySelector(".apexcharts-marker"))}),s}hasMarkers(t){return this.getElMarkers(t).length>0}getPathFromPoint(t,e){const s=Number(t.getAttribute("cx")),i=Number(t.getAttribute("cy")),a=t.getAttribute("shape");return new gt(this.w).getMarkerPath(s,i,a,e)}getElBars(){return this.w.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-violin-series, .apexcharts-rangebar-series")}hasBars(){return this.getElBars().length>0}getHoverMarkerSize(t){const e=this.w;let s=e.config.markers.hover.size;return void 0===s&&(s=e.globals.markers.size[t]+e.config.markers.hover.sizeOffset),s}toggleAllTooltipSeriesGroups(t){const e=this.w,s=this.ttCtx;0===s.allTooltipSeriesGroups.length&&(s.allTooltipSeriesGroups=e.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));const i=s.allTooltipSeriesGroups;for(let s=0;s<i.length;s++)"enable"===t?(i[s].classList.add("apexcharts-active"),i[s].style.display=e.config.tooltip.items.display):(i[s].classList.remove("apexcharts-active"),i[s].style.display="none")}}class je{constructor(t){this.w=t.w,this.ttCtx=t,this.tooltipUtil=new $e(t)}drawSeriesTexts({shared:t=!0,ttItems:e,i:s=0,j:i=null,y1:a,y2:r,e:o}){const n=this.w;void 0!==n.config.tooltip.custom?this.handleCustomTooltip({i:s,j:i,y1:a,y2:r,w:n}):this.toggleActiveInactiveSeries(t,s);const l=this.getValuesToPrint({i:s,j:i});this.printLabels({i:s,j:i,values:l,ttItems:e,shared:t,e:o});const h=this.ttCtx.getElTooltip();h&&(this.ttCtx.tooltipRect.ttWidth=h.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=h.getBoundingClientRect().height)}printLabels({i:t,j:e,values:s,ttItems:i,shared:a,e:r}){const o=this.w,{xVal:n,zVal:l,xAxisTTVal:h}=s,c=o.seriesData.series.length,d=null!==e&&o.config.plotOptions.bar.distributed?o.globals.colors[e]:o.globals.colors[t];for(let s=0;s<c;s++){const g=o.config.tooltip.inverseOrder?c-1-s:s,p=this.computeSeriesRow({i:t,j:e,t:s,tIndex:g,shared:a,e:r,basePColor:d});this.DOMHandling({i:t,t:g,j:e,ttItems:i,values:{val:p.val,goalVals:p.goalVals,xVal:n,xAxisTTVal:h,zVal:l},seriesName:p.seriesName,shared:a,pColor:p.pColor})}}computeSeriesRow({i:t,j:e,tIndex:s,shared:i,e:a,basePColor:r}){const o=this.w;let h,c=this.getFormatters(t),d=r,g=[],p="treemap"===o.config.chart.type?c.yLbTitleFormatter(String(o.config.series[t].data[e].x),{series:o.seriesData.series,seriesIndex:t,dataPointIndex:e,w:o}):this.getSeriesName({fn:c.yLbTitleFormatter,index:t,seriesIndex:t,j:e});return o.globals.axisCharts&&(i?(c=this.getFormatters(s),p=this.getSeriesName({fn:c.yLbTitleFormatter,index:s,seriesIndex:t,j:e}),d=o.globals.colors[s],h=this.formatYValue(c,s,e),g=this.formatGoalVals(c,s,e)):(d=this.resolvePatternColor(a,d),h=this.formatYValue(c,t,e),g=this.formatGoalVals(c,t,e))),null===e&&(h=c.yLbFormatter(o.seriesData.series[t],l(n({},o),{seriesIndex:t,dataPointIndex:t}))),{seriesName:p,val:h,goalVals:g,pColor:d}}formatYValue(t,e,s){var i,a,r,o;const n=this.w;return n.axisFlags.isRangeData?t.yLbFormatter(null==(a=null==(i=n.rangeData.seriesRangeStart)?void 0:i[e])?void 0:a[s],{series:n.rangeData.seriesRangeStart,seriesIndex:e,dataPointIndex:s,w:n})+" - "+t.yLbFormatter(null==(o=null==(r=n.rangeData.seriesRangeEnd)?void 0:r[e])?void 0:o[s],{series:n.rangeData.seriesRangeEnd,seriesIndex:e,dataPointIndex:s,w:n}):t.yLbFormatter(n.seriesData.series[e][s],{series:n.seriesData.series,seriesIndex:e,dataPointIndex:s,w:n})}formatGoalVals(t,e,s){var i;const a=this.w,r=null==(i=a.seriesData.seriesGoals[e])?void 0:i[s];return Array.isArray(r)?r.map(i=>({attrs:i,val:t.yLbFormatter(i.value,{seriesIndex:e,dataPointIndex:s,w:a})})):[]}resolvePatternColor(t,e){var s,i,a;const r=this.w,o=null==(s=null==t?void 0:t.target)?void 0:s.getAttribute("fill");if(!o)return e;if(-1===o.indexOf("url"))return o;if(-1===o.indexOf("Pattern"))return e;const n=r.dom.baseEl.querySelector(o.substr(4).slice(0,-1));return null!=(a=null==(i=null==n?void 0:n.childNodes[0])?void 0:i.getAttribute("stroke"))?a:e}getFormatters(t){const e=this.w;let s,i=e.formatters.yLabelFormatters[t];return void 0!==e.formatters.ttVal?Array.isArray(e.formatters.ttVal)?(i=e.formatters.ttVal[t]&&e.formatters.ttVal[t].formatter,s=e.formatters.ttVal[t]&&e.formatters.ttVal[t].title&&e.formatters.ttVal[t].title.formatter):(i=e.formatters.ttVal.formatter,"function"==typeof e.formatters.ttVal.title.formatter&&(s=e.formatters.ttVal.title.formatter)):s=e.config.tooltip.y.title.formatter,"function"!=typeof i&&(i=e.formatters.yLabelFormatters[0]?e.formatters.yLabelFormatters[0]:function(t){return t}),"function"!=typeof s&&(s=function(t){return t?t+": ":""}),{yLbFormatter:i,yLbTitleFormatter:s}}getSeriesName({fn:t,index:e,seriesIndex:s,j:i}){const a=this.w;return t(String(a.seriesData.seriesNames[e]),{series:a.seriesData.series,seriesIndex:s,dataPointIndex:i,w:a})}DOMHandling({t:t,j:e,ttItems:s,values:i,seriesName:a,shared:r,pColor:o}){const n=this.w,l=this.ttCtx,{val:h,goalVals:c,xVal:d,xAxisTTVal:g,zVal:p}=i;if(!s||!s[t])return;let u=null;u=s[t].children,n.config.tooltip.fillSeriesColor&&(s[t].style.backgroundColor=o,u[0].style.display="none"),l.showTooltipTitle&&(null===l.tooltipTitle&&(l.tooltipTitle=n.dom.baseEl.querySelector(".apexcharts-tooltip-title")),l.tooltipTitle&&(l.tooltipTitle.innerHTML=d)),l.isXAxisTooltipEnabled&&l.xaxisTooltipText&&(l.xaxisTooltipText.innerHTML=""!==g?g:d);const x=s[t].querySelector(".apexcharts-tooltip-text-y-label");x&&(x.innerHTML=a||"");const f=s[t].querySelector(".apexcharts-tooltip-text-y-value");f&&(f.innerHTML=void 0!==h?h:""),u[0]&&u[0].classList.contains("apexcharts-tooltip-marker")&&(n.config.tooltip.marker.fillColors&&Array.isArray(n.config.tooltip.marker.fillColors)&&(o=n.config.tooltip.marker.fillColors[t]),n.config.tooltip.fillSeriesColor?u[0].style.backgroundColor=o:u[0].style.color=o),n.config.tooltip.marker.show||(u[0].style.display="none");const m=s[t].querySelector(".apexcharts-tooltip-text-goals-label"),b=s[t].querySelector(".apexcharts-tooltip-text-goals-value");if(c.length&&n.seriesData.seriesGoals[t]){const s=()=>{let t="<div>",e="<div>";c.forEach(s=>{t+=` <div style="display: flex"><span class="apexcharts-tooltip-marker" style="background-color: ${s.attrs.strokeColor}; height: 3px; border-radius: 0; top: 5px;"></span> ${s.attrs.name}</div>`,e+=`<div>${s.val}</div>`}),m.innerHTML=t+"</div>",b.innerHTML=e+"</div>"};r?n.seriesData.seriesGoals[t][e]&&Array.isArray(n.seriesData.seriesGoals[t][e])?s():(m.innerHTML="",b.innerHTML=""):s()}else m.innerHTML="",b.innerHTML="";if(null!==p){s[t].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=n.config.tooltip.z.title;s[t].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=void 0!==p?p:""}if(r&&u[0]){if(n.config.tooltip.hideEmptySeries){const e=s[t].querySelector(".apexcharts-tooltip-marker"),i=s[t].querySelector(".apexcharts-tooltip-text");0==parseFloat(h)?(e.style.display="none",i.style.display="none"):(e.style.display="block",i.style.display="block")}null==h||n.globals.ancillaryCollapsedSeriesIndices.indexOf(t)>-1||n.globals.collapsedSeriesIndices.indexOf(t)>-1||Array.isArray(l.tConfig.enabledOnSeries)&&-1===l.tConfig.enabledOnSeries.indexOf(t)?u[0].parentNode.style.display="none":u[0].parentNode.style.display=n.config.tooltip.items.display}else Array.isArray(l.tConfig.enabledOnSeries)&&-1===l.tConfig.enabledOnSeries.indexOf(t)&&(u[0].parentNode.style.display="none")}toggleActiveInactiveSeries(t,e){const s=this.w;if(t)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");const t=s.dom.baseEl.querySelector(`.apexcharts-tooltip-series-group-${e}`);if(t){const e=t;e.classList.add("apexcharts-active"),e.style.display=s.config.tooltip.items.display}}}getValuesToPrint({i:t,j:e}){var s,i,a,r,o,n,l,h;const c=this.w,d=c.seriesData.seriesX.map(t=>t.length>0?t:[]);let g="",p="",u=null,x=null;const f={series:c.seriesData.series,seriesIndex:t,dataPointIndex:e,w:c},m=c.formatters.ttZFormatter;if(null===e)x=c.seriesData.series[t];else if(c.axisFlags.isXNumeric&&"treemap"!==c.config.chart.type){if(g=d[t][e],0===d[t].length){g=d[this.tooltipUtil.getFirstActiveXArray(d)][e]}}else{g=new He(this.w).isFormatXY()?void 0!==c.config.series[t].data[e]?c.config.series[t].data[e].x:"":void 0!==c.labelData.labels[e]?c.labelData.labels[e]:""}const b=g;if(c.axisFlags.isXNumeric&&"datetime"===c.config.xaxis.type){g=new w(this.w).xLabelFormat(c.formatters.ttKeyFormatter,b,b,{i:void 0,dateFormatter:new y(this.w).formatDate,w:this.w})}else g=c.globals.isBarHorizontal?c.formatters.yLabelFormatters[0](b,f):null!=(a=null==(i=(s=c.formatters).xLabelFormatter)?void 0:i.call(s,b,f))?a:b;return void 0!==c.config.tooltip.x.formatter&&(g=null!=(n=null==(o=(r=c.formatters).ttKeyFormatter)?void 0:o.call(r,b,f))?n:b),c.seriesData.seriesZ.length>0&&c.seriesData.seriesZ[t].length>0&&(u=null==m?void 0:m(c.seriesData.seriesZ[t][e],c)),p="function"==typeof c.config.xaxis.tooltip.formatter?null==(h=(l=c.formatters).xaxisTooltipFormatter)?void 0:h.call(l,b,f):g,{val:Array.isArray(x)?x.join(" "):x,xVal:Array.isArray(g)?g.join(" "):g,xAxisTTVal:Array.isArray(p)?p.join(" "):p,zVal:u}}handleCustomTooltip({i:t,j:e,y1:s,y2:i,w:a}){const r=this.ttCtx.getElTooltip();let o=a.config.tooltip.custom;Array.isArray(o)&&o[t]&&(o=o[t]);const n=o({series:a.seriesData.series,seriesIndex:t,dataPointIndex:e,y1:s,y2:i,w:a});r&&("string"==typeof n||"number"==typeof n?r.innerHTML=String(n):(n instanceof Element||"string"==typeof n.nodeName)&&(r.innerHTML="",r.appendChild(n.cloneNode(!0))))}}class Ge{constructor(t){this.ttCtx=t,this.w=t.w}moveXCrosshairs(t,e=null){const s=this.ttCtx,i=this.w,a=s.getElXCrosshairs();let r=t-s.xcrosshairsWidth/2;const o=i.labelData.labels.slice().length;if(null!==e&&(r=i.layout.gridWidth/o*e),null===a||i.globals.isBarHorizontal||(a.setAttribute("x",String(r)),a.setAttribute("x1",String(r)),a.setAttribute("x2",String(r)),a.setAttribute("y2",String(i.layout.gridHeight)),a.classList.add("apexcharts-active")),r<0&&(r=0),r>i.layout.gridWidth&&(r=i.layout.gridWidth),s.isXAxisTooltipEnabled){let t=r;"tickWidth"!==i.config.xaxis.crosshairs.width&&"barWidth"!==i.config.xaxis.crosshairs.width||(t=r+s.xcrosshairsWidth/2),this.moveXAxisTooltip(t)}}moveYCrosshairs(t){const e=this.ttCtx;null!==e.ycrosshairs&>.setAttrs(e.ycrosshairs,{y1:t,y2:t}),null!==e.ycrosshairsHidden&>.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t})}moveXAxisTooltip(t){var e,s;const i=this.w,a=this.ttCtx;if(null!==a.xaxisTooltip&&0!==a.xcrosshairsWidth){a.xaxisTooltip.classList.add("apexcharts-active");const r=a.xaxisOffY+i.config.xaxis.tooltip.offsetY+i.layout.translateY+5+i.config.xaxis.offsetY;if(t-=a.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(t)){t+=i.layout.translateX;const o=new gt(this.w).getTextRects(null!=(s=null==(e=a.xaxisTooltipText)?void 0:e.innerHTML)?s:"",i.config.xaxis.labels.style.fontSize);a.xaxisTooltipText&&(a.xaxisTooltipText.style.minWidth=o.width+"px"),a.xaxisTooltip.style.left=t+"px",a.xaxisTooltip.style.top=r+"px"}}}moveYAxisTooltip(t){var e,s;const i=this.w,a=this.ttCtx;null===a.yaxisTTEls&&(a.yaxisTTEls=[...i.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")]);const r=parseInt(null!=(s=null==(e=a.ycrosshairsHidden)?void 0:e.getAttribute("y1"))?s:"0",10);let o=i.layout.translateY+r;if(a.yaxisTTEls){const e=a.yaxisTTEls[t].getBoundingClientRect(),s=e.height;let r;const n=i.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-texts-g`),l=i.dom.elWrap.getBoundingClientRect();if(n){const t=n.getBoundingClientRect();if(t.width>0){r=t.left+t.width/2-l.left-e.width/2}}if(null==r){const s=4;r=i.config.yaxis[t].opposite?i.globals.translateYAxisX[t]+s:i.globals.translateYAxisX[t]-e.width-s}o-=s/2,-1===i.globals.ignoreYAxisIndexes.indexOf(t)&&o>0&&o<i.layout.gridHeight?(a.yaxisTTEls[t].classList.add("apexcharts-active"),a.yaxisTTEls[t].style.top=o+"px",a.yaxisTTEls[t].style.left=r+i.config.yaxis[t].tooltip.offsetX+"px"):a.yaxisTTEls[t].classList.remove("apexcharts-active")}}moveTooltip(t,e,s=null){const i=this.ttCtx.getElTooltip();if(!i)return;const a=this.computeTooltipPosition(t,e,s);null!==a&&this.applyTooltipPosition(i,a)}computeTooltipPosition(t,e,s=null){var i,a,r,o,n,l,h;const c=this.w,d=this.ttCtx,g=d.tooltipRect,p=!!c.config.tooltip.arrow,u=null!==s?parseFloat(String(s)):1,x=g.ttHeight||0,f=g.ttWidth||0,m=parseFloat(String(t)),b=parseFloat(String(e));if(isNaN(m))return null;let y=m+u+5;const w=b+c.layout.translateY;let v=p?w-x/2+u/2:b+u/2,A="right";if(y>c.layout.gridWidth/2&&(y=y-f-u-10,A="left"),y>c.layout.gridWidth-f-10&&(y=c.layout.gridWidth-f),y<-20&&(y=-20),c.config.tooltip.followCursor){const t=d.getElGrid();if(!t)return null;const e=t.getBoundingClientRect();y=d.e.clientX-e.left,y>c.layout.gridWidth/2?(y-=f,A="left"):A="right",v=d.e.clientY+c.layout.translateY-e.top,v>c.layout.gridHeight/2&&(v-=x)}else if(!c.globals.isBarHorizontal)if(p){const t=c.layout.translateY,e=c.layout.translateY+c.layout.gridHeight;v+x>e&&(v=e-x),v<t&&(v=t)}else x/2+v>c.layout.gridHeight&&(v=c.layout.gridHeight-x+c.layout.translateY);if(isNaN(y))return null;y+=c.layout.translateX;const C=null==(a=null==(i=c.config)?void 0:i.chart)?void 0:a.accessibility;if((null==C?void 0:C.enabled)&&(null==(o=null==(r=null==C?void 0:C.keyboard)?void 0:r.navigation)?void 0:o.enabled)&&(null==(h=null==(l=null==(n=c.dom)?void 0:n.baseEl)?void 0:l.querySelector)?void 0:h.call(l,".apexcharts-keyboard-focused"))){const t=p?w:b,e=(u||1)+12,s=v,i=v+x;!isNaN(t)&&x>0&&s<t+e&&i>t-e&&(v=t-x-e,v<0&&(v=t+e))}let S=null;if(p&&x>0){const t=w-v,e=10,s=x-10;S=Math.max(e,Math.min(s,t))}return{x:y,y:v,placement:A,arrowY:S}}applyTooltipPosition(t,e){if(!t)return;const s="true"!==t.dataset.positioned;s&&(t.style.transitionProperty="none"),t.style.left=e.x+"px",t.style.top=e.y+"px",e.placement&&(t.dataset.placement=e.placement),null!=e.arrowY&&t.style.setProperty("--apx-tt-arrow-y",e.arrowY+"px"),null!=e.arrowX&&t.style.setProperty("--apx-tt-arrow-x",e.arrowX+"px"),s&&(t.offsetWidth,t.dataset.positioned="true",requestAnimationFrame(()=>{t.style.transitionProperty=""}))}moveMarkers(t,e){var s;const i=this.w,a=this.ttCtx;if(i.globals.markers.size[t]>0){const r=i.dom.baseEl.querySelectorAll(` .apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker`);for(let t=0;t<r.length;t++)parseInt(null!=(s=r[t].getAttribute("rel"))?s:"0",10)===e&&(a.marker.resetPointsSize(),a.marker.enlargeCurrentPoint(e,r[t]))}else a.marker.resetPointsSize(),this.moveDynamicPointOnHover(e,t)}moveDynamicPointOnHover(t,e){var s,i,a,r,o;const n=this.w,l=this.ttCtx;let h=0,c=0;const d=new gt(this.w),g=n.globals.pointsArray,p=l.tooltipUtil.getHoverMarkerSize(e),u=n.config.series[e].type;if(u&&("column"===u||"candlestick"===u||"boxPlot"===u||"violin"===u))return;h=null==(i=null==(s=g[e])?void 0:s[t])?void 0:i[0],c=(null==(r=null==(a=g[e])?void 0:a[t])?void 0:r[1])||0;const x=n.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${e}'] .apexcharts-series-markers path`);if(x&&c<n.layout.gridHeight&&c>0){const t=null!=(o=x.getAttribute("shape"))?o:"circle",e=d.getMarkerPath(h,c,t,1.5*p);x.setAttribute("d",e)}this.moveXCrosshairs(h),l.fixedTooltip||this.moveTooltip(h,c,p)}moveDynamicPointsOnHover(t){var e,s;const i=this.ttCtx,a=i.w;let r=0,o=0,n=0;const l=a.globals.pointsArray,h=new ce(this.w),c=new gt(this.w);n=h.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);const d=i.tooltipUtil.getHoverMarkerSize(n);if((null==(e=l[n])?void 0:e[t])&&(r=l[n][t][0],o=l[n][t][1]),isNaN(r))return;const g=i.tooltipUtil.getAllMarkers();if(g.length)for(let e=0;e<a.seriesData.series.length;e++){const i=l[e];if(a.globals.comboCharts&&void 0===i&&g.splice(e,0,null),g[e]&&i&&i.length){let i,o=l[e][t][1];g[e].setAttribute("cx",r);const n=null!=(s=g[e].getAttribute("shape"))?s:"circle";if("rangeArea"===a.config.chart.type&&!a.globals.comboCharts){const s=t+a.seriesData.series[e].length;i=l[e][s][1];o-=Math.abs(o-i)/2}if(null!==o&&!isNaN(o)&&o<a.layout.gridHeight+d&&o+d>0){const t=c.getMarkerPath(r,o,n,d);g[e].setAttribute("d",t)}else g[e].setAttribute("d","")}}this.moveXCrosshairs(r),i.fixedTooltip||this.moveTooltip(r,o||a.layout.gridHeight,d)}moveStickyTooltipOverBars(t,e){var s,i,a,r,o;const n=this.w,l=this.ttCtx;let h=n.globals.columnSeries?n.globals.columnSeries.length:n.seriesData.series.length;n.config.chart.stacked&&(h=n.globals.barGroups.length);let c=h>=2&&h%2==0?Math.floor(h/2):Math.floor(h/2)+1;if(n.globals.isBarHorizontal){c=new ce(this.w).getActiveConfigSeriesIndex("desc")+1}let d=n.dom.baseEl.querySelector(`.apexcharts-bar-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-candlestick-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-boxPlot-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-violin-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-rangebar-series .apexcharts-series[rel='${c}'] path[j='${t}']`);d||"number"!=typeof e||(d=n.dom.baseEl.querySelector(`.apexcharts-bar-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n .apexcharts-violin-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}']`));let g=null;const p=n.globals.barCanvasCoords;if(!d&&p&&(g="number"==typeof e&&(null==(s=p[e])?void 0:s[t])||null,!g))for(const e in p)if(null==(i=p[e])?void 0:i[t]){g=p[e][t];break}let u=d?parseFloat(null!=(a=d.getAttribute("cx"))?a:"0"):g?g.cx:0,x=d?parseFloat(null!=(r=d.getAttribute("cy"))?r:"0"):g?g.cy:0;const f=d?parseFloat(null!=(o=d.getAttribute("barWidth"))?o:"0"):g?g.barWidth:0,m=l.getElGrid();if(!m)return;const b=m.getBoundingClientRect(),y=d&&(d.classList.contains("apexcharts-candlestick-area")||d.classList.contains("apexcharts-boxPlot-area"));if(n.axisFlags.isXNumeric){if(d&&!y){const e=this._datapointCenterXFromBars(t,b);null!=e?u=e:u-=h%2!=0?f/2:0}d&&y&&(u-=f/2)}else n.globals.isBarHorizontal||g||(u=l.xAxisTicksPositions[t-1]+l.dataPointsDividedWidth/2,isNaN(u)&&(u=l.xAxisTicksPositions[t]-l.dataPointsDividedWidth/2));if(n.globals.isBarHorizontal?x-=l.tooltipRect.ttHeight:n.config.tooltip.followCursor?x=l.e.clientY-b.top-l.tooltipRect.ttHeight/2:x+l.tooltipRect.ttHeight+15>n.layout.gridHeight&&(x=n.layout.gridHeight),n.globals.isBarHorizontal||this.moveXCrosshairs(u),!l.fixedTooltip){if(n.globals.isBarHorizontal&&!n.config.tooltip.followCursor){if(this.placeHorizontalSharedTooltip(t))return}this.moveTooltip(u,x||n.layout.gridHeight)}}_datapointCenterXFromBars(t,e){var s,i;const a=this.w,r=a.dom.baseEl.querySelectorAll(`.apexcharts-bar-series path[j='${t}'],.apexcharts-rangebar-series path[j='${t}']`);if(!r.length)return null;let o=1/0,n=-1/0;for(const t of r){const e=t.parentNode;if(null==(i=null==(s=null==e?void 0:e.classList)?void 0:s.contains)?void 0:i.call(s,"apexcharts-series-collapsed"))continue;const a=t.getBoundingClientRect();0===a.width&&0===a.height||(a.left<o&&(o=a.left),a.right>n&&(n=a.right))}return isFinite(o)?(o+n)/2-e.left-(a.globals.barPadForNumericAxis||0):null}placeHorizontalSharedTooltip(t){var e,s;const i=this.w,a=this.ttCtx,r=a.getElTooltip();if(!r)return!1;const o=a.getElGrid();if(!o)return!1;const n=o.getBoundingClientRect(),l=i.dom.baseEl.querySelectorAll(`.apexcharts-bar-series path[j='${t}'],.apexcharts-rangebar-series path[j='${t}'],.apexcharts-boxPlot-series path[j='${t}']`);if(!l.length)return!1;let h=1/0,c=-1/0,d=1/0,g=-1/0;for(const t of l){const i=t.parentNode;if(null==(s=null==(e=null==i?void 0:i.classList)?void 0:e.contains)?void 0:s.call(e,"apexcharts-series-collapsed"))continue;const a=t.getBoundingClientRect();0===a.width&&0===a.height||(a.left<h&&(h=a.left),a.right>c&&(c=a.right),a.top<d&&(d=a.top),a.bottom>g&&(g=a.bottom))}if(!isFinite(h))return!1;const p=a.tooltipRect.ttWidth||0,u=a.tooltipRect.ttHeight||0,x=(h+c)/2-n.left+i.layout.translateX,f=d-n.top+i.layout.translateY,m=g-n.top+i.layout.translateY,b=i.layout.translateY,y=i.layout.translateY+i.layout.gridHeight,w=i.layout.translateX,v=i.layout.translateX+i.layout.gridWidth;let A="top",C=f-u-7;if(C<b){const t=m+7;t+u<=y&&(A="bottom",C=t)}let S=x-p/2;S<w&&(S=w),S+p>v&&(S=v-p);const k=Math.max(10,Math.min(p-10,x-S));return this.applyTooltipPosition(r,{x:S,y:C,placement:A,arrowY:null,arrowX:k}),!0}}function Ve(t){const e=t=>`<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">${t}</svg>`;switch(t){case"square":case"rect":return e('<rect x="1" y="1" width="10" height="10" rx="1" fill="currentColor"/>');case"line":return e('<rect x="0" y="5" width="12" height="2" rx="1" fill="currentColor"/>');case"diamond":return e('<path d="M6 0.5 L11.5 6 L6 11.5 L0.5 6 Z" fill="currentColor"/>');case"triangle":return e('<path d="M6 1 L11.2 10.5 L0.8 10.5 Z" fill="currentColor"/>');case"cross":return e('<path d="M2 2 L10 10 M10 2 L2 10" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>');case"plus":return e('<path d="M6 1 L6 11 M1 6 L11 6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>');case"star":return e('<path d="M6 0.5 L7.5 4.4 L11.5 4.7 L8.4 7.2 L9.5 11.1 L6 8.9 L2.5 11.1 L3.6 7.2 L0.5 4.7 L4.5 4.4 Z" fill="currentColor"/>');case"sparkle":return e('<path d="M6 0.5 L7 5 L11.5 6 L7 7 L6 11.5 L5 7 L0.5 6 L5 5 Z" fill="currentColor"/>');default:return e('<circle cx="6" cy="6" r="5" fill="currentColor"/>')}}class Ue{constructor(t){this.w=t.w,this.ttCtx=t,this.ctx=t.ctx,this.tooltipPosition=new Ge(t)}drawDynamicPoints(){const t=this.w,e=new gt(this.w),s=new mt(this.w,this.ctx),i=[...t.dom.baseEl.querySelectorAll(".apexcharts-series")];t.config.chart.stacked&&i.sort((t,e)=>parseFloat(t.getAttribute("data:realIndex"))-parseFloat(e.getAttribute("data:realIndex")));for(let a=0;a<i.length;a++){const r=i[a].querySelector(".apexcharts-series-markers-wrap");if(null!==r){let i=`apexcharts-marker w${(Math.random()+1).toString(36).substring(4)}`;"line"!==t.config.chart.type&&"area"!==t.config.chart.type||t.globals.comboCharts||t.config.tooltip.intersect||(i+=" no-pointer-events");const a=s.getMarkerConfig({cssClass:i,seriesIndex:Number(r.getAttribute("data:realIndex"))}),o=e.drawMarker(0,0,a);o.node.setAttribute("default-marker-size",0);const n=m.createElementNS(F,"g");n.classList.add("apexcharts-series-markers"),n.appendChild(o.node),r.appendChild(n)}}}enlargeCurrentPoint(t,e,s=null,i=null){const a=this.w;"bubble"!==a.config.chart.type&&this.newPointSize(t,e);let r=e.getAttribute("cx"),o=e.getAttribute("cy");if(null!==s&&null!==i&&(r=s,o=i),this.tooltipPosition.moveXCrosshairs(r),!this.fixedTooltip){if("radar"===a.config.chart.type){const t=this.ttCtx.getElGrid();if(!t)return;const e=t.getBoundingClientRect();r=this.ttCtx.e.clientX-e.left}this.tooltipPosition.moveTooltip(r,o,a.config.markers.hover.size)}}enlargePoints(t){var e,s;const i=this.w,a=this,r=this.ttCtx,o=t,n=i.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker");let l=i.config.markers.hover.size;for(let t=0;t<n.length;t++){const h=n[t].getAttribute("rel"),c=n[t].getAttribute("index");if(void 0===l&&(l=i.globals.markers.size[c]+i.config.markers.hover.sizeOffset),o===parseInt(null!=h?h:"0",10)){a.newPointSize(o,n[t]);const i=null!=(e=n[t].getAttribute("cx"))?e:"0",h=null!=(s=n[t].getAttribute("cy"))?s:"0";a.tooltipPosition.moveXCrosshairs(parseFloat(i)),r.fixedTooltip||a.tooltipPosition.moveTooltip(parseFloat(i),parseFloat(h),l)}else a.oldPointSize(n[t])}}newPointSize(t,e){const s=this.w;let i=s.config.markers.hover.size;const a=0===t?e.parentNode.firstChild:e.parentNode.lastChild;if("0"!==a.getAttribute("default-marker-size")){const t=parseInt(a.getAttribute("index"),10);void 0===i&&(i=s.globals.markers.size[t]+s.config.markers.hover.sizeOffset),i<0&&(i=0);const r=this.ttCtx.tooltipUtil.getPathFromPoint(e,i);e.setAttribute("d",r)}}oldPointSize(t){const e=parseFloat(t.getAttribute("default-marker-size")),s=this.ttCtx.tooltipUtil.getPathFromPoint(t,e);t.setAttribute("d",s)}resetPointsSize(){var t;const e=this.w.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker");for(let s=0;s<e.length;s++){const i=parseFloat(null!=(t=e[s].getAttribute("default-marker-size"))?t:"0");if(b.isNumber(i)&&i>0){const t=this.ttCtx.tooltipUtil.getPathFromPoint(e[s],i);e[s].setAttribute("d",t)}else e[s].setAttribute("d","M0,0")}}}class qe{constructor(t){this.w=t.w;const e=this.w;this.ttCtx=t,this.isVerticalGroupedRangeBar=!e.globals.isBarHorizontal&&"rangeBar"===e.config.chart.type&&e.config.plotOptions.bar.rangeBarGroupRows}getAttr(t,e){var s;return parseFloat(null!=(s=t.target.getAttribute(e))?s:"")}handleHeatTreeTooltip({e:t,opt:e,x:s,y:i,type:a}){var r,o;const n=this.ttCtx,l=this.w;if(t.target.classList.contains(`apexcharts-${a}-rect`)){const a=this.getAttr(t,"i"),h=this.getAttr(t,"j"),c=this.getAttr(t,"cx"),d=this.getAttr(t,"cy"),g=this.getAttr(t,"width"),p=this.getAttr(t,"height");if(n.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:a,j:h,shared:!1,e:t}),l.interact.capturedSeriesIndex=a,l.interact.capturedDataPointIndex=h,s=c+n.tooltipRect.ttWidth/2+g,i=d+n.tooltipRect.ttHeight/2-p/2,n.tooltipPosition.moveXCrosshairs(c+g/2),s>l.layout.gridWidth/2&&(s=c-n.tooltipRect.ttWidth/2+g),n.w.config.tooltip.followCursor){const t=l.dom.elWrap.getBoundingClientRect();s=(null!=(r=l.interact.clientX)?r:0)-t.left-(s>l.layout.gridWidth/2?n.tooltipRect.ttWidth:0),i=(null!=(o=l.interact.clientY)?o:0)-t.top-(i>l.layout.gridHeight/2?n.tooltipRect.ttHeight:0)}}return{x:s,y:i}}handleMarkerTooltip({e:t,opt:e,x:s,y:i}){const a=this.w,r=this.ttCtx;let o,n;if(t.target.classList.contains("apexcharts-marker")){const l=parseInt(e.paths.getAttribute("cx"),10),h=parseInt(e.paths.getAttribute("cy"),10),c=parseFloat(e.paths.getAttribute("val"));if(n=parseInt(e.paths.getAttribute("rel"),10),o=parseInt(e.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,r.intersect){const t=b.findAncestor(e.paths,"apexcharts-series");t&&(o=parseInt(t.getAttribute("data:realIndex"),10))}r.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:o,j:n,shared:!r.showOnIntersect&&a.config.tooltip.shared,e:t}),"mouseup"===t.type&&r.markerClick(t,o,n),a.interact.capturedSeriesIndex=o,a.interact.capturedDataPointIndex=n;if(s=l,!!a.config.tooltip.arrow?i=h:(i=h+a.layout.translateY-1.4*r.tooltipRect.ttHeight,c<0&&(i=h)),r.w.config.tooltip.followCursor){const t=r.getElGrid();if(!t)return{x:s,y:i};const e=t.getBoundingClientRect();i=r.e.clientY+a.layout.translateY-e.top}r.marker.enlargeCurrentPoint(n,e.paths,s,i)}return{x:s,y:i}}handleBarTooltip({e:t,opt:e}){var s,i,a;const r=this.w,o=this.ttCtx,n=o.getElTooltip();let l,h=0,c=0,d=0,g=0;const p=this.getBarTooltipXY({e:t,opt:e});if(null===p.j&&0===p.barHeight&&0===p.barWidth)return;g=p.i;const u=p.j;if(r.interact.capturedSeriesIndex=g,r.interact.capturedDataPointIndex=null!==u?u:r.interact.capturedDataPointIndex,r.globals.isBarHorizontal&&o.tooltipUtil.hasBars()||!r.config.tooltip.shared?(c=p.x,d=p.y,l=Array.isArray(r.config.stroke.width)?r.config.stroke.width[g]:r.config.stroke.width,h=c):r.globals.comboCharts||r.config.tooltip.shared||(h/=2),isNaN(d)&&(d=r.globals.svgHeight-o.tooltipRect.ttHeight),c+o.tooltipRect.ttWidth>r.layout.gridWidth?c-=o.tooltipRect.ttWidth:c<0&&(c=0),o.w.config.tooltip.followCursor){if(!o.getElGrid())return}if(null===o.tooltip&&(o.tooltip=r.dom.baseEl.querySelector(".apexcharts-tooltip")),r.config.tooltip.shared||(r.globals.comboBarCount>0?o.tooltipPosition.moveXCrosshairs(h+l/2):o.tooltipPosition.moveXCrosshairs(h)),!o.fixedTooltip&&(!r.config.tooltip.shared||r.globals.isBarHorizontal&&o.tooltipUtil.hasBars())&&(d=d+r.layout.translateY-o.tooltipRect.ttHeight/2,n)){const t=o.tooltipRect.ttWidth||0,e=o.tooltipRect.ttHeight||0,l=!!r.config.tooltip.arrow,{barAnchorXInGrid:h,barAnchorYInGrid:g,barRectInGrid:u}=p,x=7,f=null==(s=o.getElGrid())?void 0:s.getBoundingClientRect(),m=r.dom.elWrap.getBoundingClientRect(),b=f?f.left-m.left:r.layout.translateX;let y,w=null,v=null,A=c+b,C=d;if(l&&r.globals.isBarHorizontal&&null!=u){const s=r.layout.translateY,i=r.layout.translateY+r.layout.gridHeight,a=b,o=b+r.layout.gridWidth,n=(u.left+u.right)/2+b,l=u.top+r.layout.translateY,h=u.bottom+r.layout.translateY;let c=l-e-x;if(y="top",c<s){const t=h+x;t+e<=i&&(y="bottom",c=t)}C=c,A=n-t/2,A<a&&(A=a),A+t>o&&(A=o-t),v=Math.max(10,Math.min(t-10,n-A))}else if(l&&null!=h&&null!=g){const s=h+b,o=b+r.layout.gridWidth/2,n=(null!=(i=null==u?void 0:u.left)?i:h)+b,l=(null!=(a=null==u?void 0:u.right)?a:h)+b;if(s<o?(y="right",A=l+x):(y="left",A=n-t-x),u){C=(u.top+u.bottom)/2+r.layout.translateY-e/2;const t=r.layout.translateY,s=r.layout.translateY+r.layout.gridHeight;C<t&&(C=t),C+e>s&&(C=s-e)}if(e>0&&u){const t=(u.top+u.bottom)/2+r.layout.translateY;w=Math.max(10,Math.min(e-10,t-C))}}o.tooltipPosition.applyTooltipPosition(n,{x:A,y:C,placement:y,arrowY:w,arrowX:v})}}getBarTooltipXY({e:t,opt:e}){const s=this.w;let i=null;const a=this.ttCtx;let r=0,o=0,n=0,l=0,h=0,c=null,d=null,g=null,p=null,u=null;const x=t.target.classList;if(x.contains("apexcharts-bar-area")||x.contains("apexcharts-candlestick-area")||x.contains("apexcharts-boxPlot-area")||x.contains("apexcharts-rangebar-area")){const x=t.target,f=x.getBoundingClientRect(),m=e.elGrid.getBoundingClientRect(),b=f.height;h=f.height;const y=f.width,w=parseInt(x.getAttribute("cx"),10),v=parseInt(x.getAttribute("cy"),10);c=w,d=v,l=parseFloat(x.getAttribute("barWidth"));const A=f.left-m.left,C=f.top-m.top,S=C+b/2;g=A+y/2,p=s.globals.isBarHorizontal?S:C,u={left:A,top:C,right:A+y,bottom:C+b};const k="touchmove"===t.type?t.touches[0].clientX:t.clientX;i=parseInt(x.getAttribute("j"),10),r=parseInt(x.parentNode.getAttribute("rel"),10)-1;const _=x.getAttribute("data-range-y1"),L=x.getAttribute("data-range-y2");s.globals.comboCharts&&(r=parseInt(x.parentNode.getAttribute("data:realIndex"),10));const D=t=>s.axisFlags.isXNumeric?w-y/2:this.isVerticalGroupedRangeBar?w+y/2:w-a.dataPointsDividedWidth+y/2,M=()=>v-a.dataPointsDividedHeight+b/2-a.tooltipRect.ttHeight/2;a.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:r,j:i,y1:_?parseInt(_,10):null,y2:L?parseInt(L,10):null,shared:!a.showOnIntersect&&s.config.tooltip.shared,e:t}),s.config.tooltip.followCursor?s.globals.isBarHorizontal?(o=k-m.left+15,n=M()):(o=D(o),n=t.clientY-m.top-a.tooltipRect.ttHeight/2-15):s.globals.isBarHorizontal?(o=w,a.xyRatios&&o<a.xyRatios.baseLineInvertedY&&(o=w-a.tooltipRect.ttWidth),n=M()):(o=D(o),n=v)}return{x:o,y:n,barHeight:h,barWidth:l,i:r,j:i,barCx:c,barCy:d,barAnchorXInGrid:g,barAnchorYInGrid:p,barRectInGrid:u}}}class Ze{constructor(t){this.w=t.w,this.ttCtx=t}drawXaxisTooltip(){const t=this.w,e=this.ttCtx,s="bottom"===t.config.xaxis.position;e.xaxisOffY=s?t.layout.gridHeight+1:-t.layout.xAxisHeight-t.config.xaxis.axisTicks.height+3;const i=s?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",a=t.dom.elWrap;if(e.isXAxisTooltipEnabled){null===t.dom.baseEl.querySelector(".apexcharts-xaxistooltip")&&(e.xaxisTooltip=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.xaxisTooltip.setAttribute("class",i+" apexcharts-theme-"+t.config.tooltip.theme),a.appendChild(e.xaxisTooltip),e.xaxisTooltipText=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),e.xaxisTooltipText.style.fontFamily=t.config.xaxis.tooltip.style.fontFamily||t.config.chart.fontFamily,e.xaxisTooltipText.style.fontSize=t.config.xaxis.tooltip.style.fontSize,e.xaxisTooltip.appendChild(e.xaxisTooltipText))}}drawYaxisTooltip(){const t=this.w,e=this.ttCtx;for(let s=0;s<t.config.yaxis.length;s++){const i=t.config.yaxis[s].opposite||t.config.yaxis[s].crosshairs.opposite;e.yaxisOffX=i?t.layout.gridWidth+1:1;const a=i?`apexcharts-yaxistooltip apexcharts-yaxistooltip-${s} apexcharts-yaxistooltip-right`:`apexcharts-yaxistooltip apexcharts-yaxistooltip-${s} apexcharts-yaxistooltip-left`,r=t.dom.elWrap;null===t.dom.baseEl.querySelector(`.apexcharts-yaxistooltip apexcharts-yaxistooltip-${s}`)&&(e.yaxisTooltip=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.yaxisTooltip.setAttribute("class",a+" apexcharts-theme-"+t.config.tooltip.theme),r.appendChild(e.yaxisTooltip),0===s&&(e.yaxisTooltipText=[]),e.yaxisTooltipText[s]=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.yaxisTooltipText[s].classList.add("apexcharts-yaxistooltip-text"),e.yaxisTooltip.appendChild(e.yaxisTooltipText[s]))}}setXCrosshairWidth(){var t,e;const s=this.w,i=this.ttCtx,a=i.getElXCrosshairs();if(i.xcrosshairsWidth=parseInt(s.config.xaxis.crosshairs.width,10),s.globals.comboCharts){const t=s.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==t&&"barWidth"===s.config.xaxis.crosshairs.width){const s=parseFloat(null!=(e=t.getAttribute("barWidth"))?e:"0");i.xcrosshairsWidth=s}else if("tickWidth"===s.config.xaxis.crosshairs.width){const t=s.labelData.labels.length;i.xcrosshairsWidth=s.layout.gridWidth/t}}else if("tickWidth"===s.config.xaxis.crosshairs.width){const t=s.labelData.labels.length;i.xcrosshairsWidth=s.layout.gridWidth/t}else if("barWidth"===s.config.xaxis.crosshairs.width){const e=s.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==e){const s=parseFloat(null!=(t=e.getAttribute("barWidth"))?t:"0");i.xcrosshairsWidth=s}else i.xcrosshairsWidth=1}s.globals.isBarHorizontal&&(i.xcrosshairsWidth=0),null!==a&&i.xcrosshairsWidth>0&&a.setAttribute("width",String(i.xcrosshairsWidth))}handleYCrosshair(){const t=this.w,e=this.ttCtx;e.ycrosshairs=t.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),e.ycrosshairsHidden=t.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}drawYaxisTooltipText(t,e,s){const i=this.ttCtx,a=this.w,r=a.globals,o=r.seriesYAxisMap[t];if(i.yaxisTooltips[t]&&o.length>0){const n=a.formatters.yLabelFormatters[t],l=i.getElGrid();if(!l)return;const h=l.getBoundingClientRect(),c=o[0];let d=0;s.yRatio.length>1&&(d=c);const g=(e-h.top)*s.yRatio[d],p=r.maxYArr[c]-r.minYArr[c];let u=r.minYArr[c]+(p-g);a.config.yaxis[t].reversed&&(u=r.maxYArr[c]-(p-g)),i.tooltipPosition.moveYCrosshairs(e-h.top),i.yaxisTooltipText[t].innerHTML=n(u),i.tooltipPosition.moveYAxisTooltip(t)}}}class Ke{constructor(t,e){this.w=t,this.ctx=e,this.tConfig=t.config.tooltip,this.tooltipUtil=new $e(this),this.tooltipLabels=new je(this),this.tooltipPosition=new Ge(this),this.marker=new Ue(this),this.intersect=new qe(this),this.axesTooltip=new Ze(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.xaxisTooltipText=null,this.yaxisTooltip=null,this.yaxisTooltipText=null,this.yaxisTTEls=null,this.xaxisOffY=0,this.yaxisOffX=0,this.xcrosshairsWidth=0,this.ycrosshairs=null,this.ycrosshairsHidden=null,this.tooltip=null,this.e=null,this.isBarShared=!t.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now(),this.dimensionUpdateScheduled=!1,this.xyRatios=null,this.isXAxisTooltipEnabled=!1,this.yaxisTooltips=[],this.allTooltipSeriesGroups=[],this.xAxisTicksPositions=null,this.dataPointsDividedHeight=0,this.dataPointsDividedWidth=0,this.tooltipTitle=null,this.legendLabels=null,this.ttItems=null,this.seriesBound=null,this.seriesHoverTimeout=void 0,this.clientX=0,this.clientY=0,this.barSeriesHeight=0,this.tooltipRect={x:0,y:0,ttWidth:0,ttHeight:0}}setupDimensionCache(){const t=this.w,e=this.getElTooltip();e&&(this.updateDimensionCache(),"undefined"==typeof ResizeObserver||t.globals.resizeObserver||(t.globals.resizeObserver=new ResizeObserver(()=>{this.dimensionUpdateScheduled||(this.dimensionUpdateScheduled=!0,requestAnimationFrame(()=>{this.updateDimensionCache(),this.dimensionUpdateScheduled=!1}))}),t.globals.resizeObserver.observe(e)))}updateDimensionCache(){const t=this.w,e=this.getElTooltip();if(!e)return;const s=e.getBoundingClientRect();t.globals.dimensionCache.tooltip={width:s.width,height:s.height,lastUpdate:Date.now()}}getCachedDimensions(){const t=this.w;if(t.globals.dimensionCache.tooltip){const e=t.globals.dimensionCache.tooltip;if(Date.now()-e.lastUpdate<1e3)return{ttWidth:e.width,ttHeight:e.height}}this.updateDimensionCache();const e=t.globals.dimensionCache.tooltip;return e?{ttWidth:e.width,ttHeight:e.height}:{ttWidth:0,ttHeight:0}}getElTooltip(t){return t||(t=this),t.w.dom.baseEl?t.w.dom.baseEl.querySelector(".apexcharts-tooltip"):null}getElXCrosshairs(){return this.w.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}getElGrid(){return this.w.dom.baseEl.querySelector(".apexcharts-grid")}drawTooltip(t){const e=this.w;this.xyRatios=t,this.isXAxisTooltipEnabled=e.config.xaxis.tooltip.enabled&&e.globals.axisCharts,this.yaxisTooltips=e.config.yaxis.map(t=>!!(t.show&&t.tooltip.enabled&&e.globals.axisCharts)),this.allTooltipSeriesGroups=[],e.globals.axisCharts||(this.showTooltipTitle=!1);const s=this.getElTooltip();(null==s?void 0:s.parentNode)&&s.parentNode.removeChild(s),this.tooltipTitle=null;const i=m.createElementNS("http://www.w3.org/1999/xhtml","div");i.classList.add("apexcharts-tooltip"),e.config.tooltip.cssClass&&i.classList.add(e.config.tooltip.cssClass),i.classList.add(`apexcharts-theme-${this.tConfig.theme||"light"}`),this.tConfig.fillSeriesColor&&i.classList.add("apexcharts-tooltip-fill-series"),this.tConfig.style&&this.tConfig.style.background&&i.style.setProperty("--apx-tt-bg",this.tConfig.style.background);const a=this.tConfig.shared&&e.config.series.length>1&&!e.globals.isBarHorizontal;if(this.tConfig.arrow&&!this.tConfig.followCursor&&!this.tConfig.fixed.enabled&&!a&&!this.tConfig.fillSeriesColor&&e.globals.axisCharts){const t=m.createElementNS("http://www.w3.org/1999/xhtml","div");t.classList.add("apexcharts-tooltip-arrow"),i.appendChild(t)}if(e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&(i.setAttribute("role","tooltip"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),i.setAttribute("aria-hidden","true")),e.dom.elWrap.appendChild(i),e.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();const t=new At(this.w,this.ctx,void 0);this.xAxisTicksPositions=t.getXAxisTicksPositions()}if(!e.globals.comboCharts&&!this.tConfig.intersect&&"rangeBar"!==e.config.chart.type||this.tConfig.shared||(this.showOnIntersect=!0),0!==e.config.markers.size&&0!==e.globals.markers.largestSize||this.marker.drawDynamicPoints(),e.globals.collapsedSeries.length===e.seriesData.series.length)return;this.dataPointsDividedHeight=e.layout.gridHeight/e.globals.dataPoints,this.dataPointsDividedWidth=e.layout.gridWidth/e.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=m.createElementNS("http://www.w3.org/1999/xhtml","div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,i.appendChild(this.tooltipTitle));let r=e.seriesData.series.length;(e.globals.xyCharts||e.globals.comboCharts)&&this.tConfig.shared&&(r=this.showOnIntersect?1:e.seriesData.series.length),this.legendLabels=e.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(r),this.addSVGEvents(),this.setupDimensionCache()}createTTElements(t){const e=this.w,s=[],i=this.getElTooltip();if(!i)return s;for(let a=0;a<t;a++){const r=m.createElementNS("http://www.w3.org/1999/xhtml","div");r.classList.add("apexcharts-tooltip-series-group",`apexcharts-tooltip-series-group-${a}`),r.style.order=String(e.config.tooltip.inverseOrder?t-a:a+1);const o=m.createElementNS("http://www.w3.org/1999/xhtml","span");o.classList.add("apexcharts-tooltip-marker"),e.config.tooltip.fillSeriesColor?o.style.backgroundColor=e.globals.colors[a]:o.style.color=e.globals.colors[a];const n=e.config.markers.shape;let l=n;Array.isArray(n)&&(l=n[a]),o.setAttribute("shape",l),o.innerHTML=Ve(l),r.appendChild(o);const h=m.createElementNS("http://www.w3.org/1999/xhtml","div");h.classList.add("apexcharts-tooltip-text"),h.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,h.style.fontSize=this.tConfig.style.fontSize,["y","goals","z"].forEach(t=>{const e=m.createElementNS("http://www.w3.org/1999/xhtml","div");e.classList.add(`apexcharts-tooltip-${t}-group`);const s=m.createElementNS("http://www.w3.org/1999/xhtml","span");s.classList.add(`apexcharts-tooltip-text-${t}-label`),e.appendChild(s);const i=m.createElementNS("http://www.w3.org/1999/xhtml","span");i.classList.add(`apexcharts-tooltip-text-${t}-value`),e.appendChild(i),h.appendChild(e)}),r.appendChild(h),i.appendChild(r),s.push(r)}return s}addSVGEvents(){const t=this.w,e=t.config.chart.type,s=this.getElTooltip();if(!s)return;const i=!("bar"!==e&&"candlestick"!==e&&"boxPlot"!==e&&"violin"!==e&&"rangeBar"!==e),a="area"===e||"line"===e||"scatter"===e||"bubble"===e||"radar"===e,r=t.dom.Paper.node,o=this.getElGrid();o&&(this.seriesBound=o.getBoundingClientRect());const n=[],l=[],h={hoverArea:r,elGrid:o,tooltipEl:s,tooltipY:n,tooltipX:l,ttItems:this.ttItems};let c;if(t.globals.axisCharts&&(a?c=t.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):i?c=t.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-violin-area, .apexcharts-series .apexcharts-rangebar-area"):"heatmap"!==e&&"treemap"!==e||(c=t.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),c&&c.length))for(let t=0;t<c.length;t++)n.push(c[t].getAttribute("cy")),l.push(c[t].getAttribute("cx"));if(t.globals.xyCharts&&!this.showOnIntersect||t.globals.comboCharts&&!this.showOnIntersect||i&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([r],h);else if(i&&!t.globals.comboCharts||a&&this.showOnIntersect)this.addDatapointEventsListeners(h);else if(!t.globals.axisCharts||"heatmap"===e||"treemap"===e){const e=t.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(e,h)}if(this.showOnIntersect){const e=t.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");e.length>0&&this.addPathsEventListeners(e,h),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(h)}}drawFixedTooltipRect(){const t=this.w,e=this.getElTooltip();if(!e)return{x:0,y:0,ttWidth:0,ttHeight:0};const s=e.getBoundingClientRect(),i=s.width+10,a=s.height+10;let r=this.tConfig.fixed.offsetX,o=this.tConfig.fixed.offsetY;const n=this.tConfig.fixed.position.toLowerCase();return n.indexOf("right")>-1&&(r=r+t.globals.svgWidth-i+10),n.indexOf("bottom")>-1&&(o=o+t.globals.svgHeight-a-10),this.tooltipPosition.applyTooltipPosition(e,{x:r,y:o}),{x:r,y:o,ttWidth:i,ttHeight:a}}addDatapointEventsListeners(t){const e=this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area");this.addPathsEventListeners(e,t)}addPathsEventListeners(t,e){const s=this;for(let i=0;i<t.length;i++){const a={paths:t[i],tooltipEl:e.tooltipEl,tooltipY:e.tooltipY,tooltipX:e.tooltipX,elGrid:e.elGrid,hoverArea:e.hoverArea,ttItems:e.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map(e=>t[i].addEventListener(e,s.onSeriesHover.bind(s,a),{capture:!1,passive:!0}))}}onSeriesHover(t,e){const s=Date.now()-this.lastHoverTime;s>=20?this.seriesHover(t,e):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout(()=>{this.seriesHover(t,e)},20-s))}seriesHover(t,e){this.lastHoverTime=Date.now();let s=[];const i=this.w,a=t=>{var e,s,i;const a=null==(i=null==(s=null==(e=null==t?void 0:t.w)?void 0:e.config)?void 0:s.chart)?void 0:i.link;return!(!a||"function"!=typeof a.dimension)};i.config.chart.group&&!a(this.ctx)&&(s=this.ctx.getGroupedCharts().filter(t=>!a(t))),i.globals.axisCharts&&(i.globals.minX===-1/0&&i.globals.maxX===1/0||0===i.globals.dataPoints)||(s.length?s.forEach(s=>{const i=this.getElTooltip(s),a={paths:t.paths,tooltipEl:i,tooltipY:t.tooltipY,tooltipX:t.tooltipX,elGrid:t.elGrid,hoverArea:t.hoverArea,ttItems:s.w.globals.tooltip.ttItems};s.w.globals.minX===this.w.globals.minX&&s.w.globals.maxX===this.w.globals.maxX&&s.w.globals.tooltip.seriesHoverByContext({chartCtx:s,ttCtx:s.w.globals.tooltip,opt:a,e:e})}):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:t,e:e}))}seriesHoverByContext({chartCtx:t,ttCtx:e,opt:s,e:i}){const a=t.w;if(!this.getElTooltip(t))return;const r=e.getCachedDimensions();if(e.tooltipRect={x:0,y:0,ttWidth:r.ttWidth,ttHeight:r.ttHeight},e.e=i,e.tooltipUtil.hasBars()&&!a.globals.comboCharts&&!e.isBarShared&&this.tConfig.onDatasetHover.highlightDataSeries){new ce(t.w).toggleSeriesOnHover(i,i.target.parentNode)}a.globals.axisCharts?e.axisChartsTooltips({e:i,opt:s,tooltipRect:e.tooltipRect}):e.nonAxisChartsTooltips({e:i,opt:s,tooltipRect:e.tooltipRect}),e.fixedTooltip&&e.drawFixedTooltipRect()}axisChartsTooltips({e:t,opt:e}){var s;const i=this.w;let a,r;const o=e.elGrid.getBoundingClientRect(),n="touchmove"===t.type?t.touches[0].clientX:t.clientX,l="touchmove"===t.type?t.touches[0].clientY:t.clientY;if(this.clientY=l,this.clientX=n,i.interact.capturedSeriesIndex=-1,i.interact.capturedDataPointIndex=-1,l<o.top||l>o.top+o.height)return void this.handleMouseOut(e);if(Array.isArray(this.tConfig.enabledOnSeries)&&!i.config.tooltip.shared){const t=parseInt(e.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(t)<0)return void this.handleMouseOut(e)}const h=this.getElTooltip();if(!h)return;const c=this.getElXCrosshairs();let d=[];i.config.chart.group&&(d=this.ctx.getSyncedCharts());const g=i.globals.xyCharts||"bar"===i.config.chart.type&&!i.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||i.globals.comboCharts&&this.tooltipUtil.hasBars();if("mousemove"===t.type||"touchmove"===t.type||"mouseup"===t.type){if(i.globals.collapsedSeries.length+i.globals.ancillaryCollapsedSeries.length===i.seriesData.series.length)return;null!==c&&c.classList.add("apexcharts-active");const o=null==(s=this.yaxisTooltips)?void 0:s.filter(t=>!0===t),p=this.ycrosshairs;if(null!==p&&(null==o?void 0:o.length)&&p.classList.add("apexcharts-active"),g&&!this.showOnIntersect||d.length>1)this.handleStickyTooltip(t,n,l,e);else if("heatmap"===i.config.chart.type||"treemap"===i.config.chart.type){const s=this.intersect.handleHeatTreeTooltip({e:t,opt:e,x:a,y:r,type:i.config.chart.type});a=s.x,r=s.y,h.style.left=a+"px",h.style.top=r+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:t,opt:e}),this.tooltipUtil.hasMarkers(0)&&this.intersect.handleMarkerTooltip({e:t,opt:e,x:a,y:r});if(this.yaxisTooltips&&this.yaxisTooltips.length)for(let t=0;t<i.config.yaxis.length;t++)this.axesTooltip.drawYaxisTooltipText(t,l,this.xyRatios);i.dom.baseEl.classList.add("apexcharts-tooltip-active"),e.tooltipEl.classList.add("apexcharts-active"),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.announcements.enabled&&e.tooltipEl.removeAttribute("aria-hidden")}else"mouseout"!==t.type&&"touchend"!==t.type||this.handleMouseOut(e)}nonAxisChartsTooltips({e:t,opt:e,tooltipRect:s}){var i,a,r,o;const n=this.w,l=e.paths.getAttribute("rel"),h=this.getElTooltip();if(!h)return;const c=n.dom.elWrap.getBoundingClientRect();if("mousemove"===t.type||"touchmove"===t.type){let t,o;n.dom.baseEl.classList.add("apexcharts-tooltip-active"),h.classList.add("apexcharts-active"),n.config.chart.accessibility.enabled&&n.config.chart.accessibility.announcements.enabled&&h.removeAttribute("aria-hidden"),this.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:parseInt(l,10)-1,shared:!1});const d=e.paths.querySelector("path[data\\:cx]")||e.paths;if(n.config.tooltip.intersect&&d.hasAttribute("data:cx")&&d.hasAttribute("data:cy")){const e=n.dom.Paper.node.getBoundingClientRect();t=e.left-c.left+parseFloat(d.getAttribute("data:cx"))-s.ttWidth/2,o=e.top-c.top+parseFloat(d.getAttribute("data:cy"))-s.ttHeight-10}else t=(null!=(i=n.interact.clientX)?i:0)-c.left-s.ttWidth/2,o=(null!=(a=n.interact.clientY)?a:0)-c.top-s.ttHeight-10;if(h.style.left=t+"px",h.style.top=o+"px",n.config.legend.tooltipHoverFormatter){const t=n.config.legend.tooltipHoverFormatter,e=l-1,s=null==(r=this.legendLabels)?void 0:r[e];if(!s)return;const i=t(s.getAttribute("data:default-text"),{seriesIndex:e,dataPointIndex:e,w:n});s.innerHTML=i}}else"mouseout"!==t.type&&"touchend"!==t.type||(h.classList.remove("apexcharts-active"),n.dom.baseEl.classList.remove("apexcharts-tooltip-active"),n.config.legend.tooltipHoverFormatter&&(null==(o=this.legendLabels)||o.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(null!=e?e:"")})))}handleStickyTooltip(t,e,s,i){const a=this.w,r=this.tooltipUtil.getNearestValues({context:this,hoverArea:i.hoverArea,elGrid:i.elGrid,clientX:e,clientY:s}),o=r.j;let n=r.capturedSeries;null!==n&&a.globals.collapsedSeriesIndices.includes(null!=n?n:-1)&&(n=null);const l=i.elGrid.getBoundingClientRect();if(r.hoverX<0||r.hoverX>l.width)this.handleMouseOut(i);else if(null!==n)this.handleStickyCapturedSeries(t,null!=n?n:-1,i,null!=o?o:0);else if(this.tooltipUtil.isXoverlap(null!=o?o:0)||a.globals.isBarHorizontal){const e=a.seriesData.series.findIndex((t,e)=>!a.globals.collapsedSeriesIndices.includes(e));this.create(t,this,e,null!=o?o:0,i.ttItems)}}handleStickyCapturedSeries(t,e,s,i){const a=this.w;if(!this.tConfig.shared){if(null===a.seriesData.series[e][i])return void this.handleMouseOut(s)}if(void 0!==a.seriesData.series[e][i])this.tConfig.shared&&this.tooltipUtil.isXoverlap(i)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(t,this,e,i,s.ttItems):this.create(t,this,e,i,s.ttItems,!1);else if(this.tooltipUtil.isXoverlap(i)){const e=a.seriesData.series.findIndex((t,e)=>!a.globals.collapsedSeriesIndices.includes(e));this.create(t,this,e,i,s.ttItems)}}deactivateHoverFilter(){const t=this.w,e=new gt(this.w,this.ctx),s=t.dom.Paper.find(".apexcharts-bar-area");for(let t=0;t<s.length;t++)e.pathMouseLeave(s[t],void 0)}handleMouseOut(t){var e,s;const i=this.w,a=this.getElXCrosshairs();i.dom.baseEl.classList.remove("apexcharts-tooltip-active"),t.tooltipEl.classList.remove("apexcharts-active"),delete t.tooltipEl.dataset.positioned,i.config.chart.accessibility.enabled&&i.config.chart.accessibility.announcements.enabled&&t.tooltipEl.setAttribute("aria-hidden","true"),this.deactivateHoverFilter(),"bubble"!==i.config.chart.type&&this.marker.resetPointsSize(),null!==a&&a.classList.remove("apexcharts-active");const r=this.ycrosshairs;if(null!==r&&r.classList.remove("apexcharts-active"),this.isXAxisTooltipEnabled&&(null==(e=this.xaxisTooltip)||e.classList.remove("apexcharts-active")),this.yaxisTooltips&&this.yaxisTooltips.length){null===this.yaxisTTEls&&(this.yaxisTTEls=[...i.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")]);for(let t=0;t<this.yaxisTTEls.length;t++)this.yaxisTTEls[t].classList.remove("apexcharts-active")}i.config.legend.tooltipHoverFormatter&&(null==(s=this.legendLabels)||s.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(null!=e?e:"")}))}markerClick(t,e,s){const i=this.w;"function"==typeof i.config.chart.events.markerClick&&i.config.chart.events.markerClick(t,this.ctx,{seriesIndex:e,dataPointIndex:s,w:i}),this.ctx.events.fireEvent("markerClick",[t,this.ctx,{seriesIndex:e,dataPointIndex:s,w:i}])}_hasCustomSeries(){const t=this.w;if(Be(t.config.chart.type))return!0;return(t.config.series||[]).some(t=>t&&t.type&&Be(t.type))}create(t,e,s,i,a,r=null){var o,h,c,d,g,p,u,x,f,m,b,y,w,v,A,C,S,k,_,L,D;const M=this.w,E=e;"mouseup"===t.type&&this.markerClick(t,s,i),null===r&&(r=this.tConfig.shared);const P=this.tooltipUtil.hasMarkers(s),F="canvas"===(null==(h=null==(o=this.ctx)?void 0:o.renderer)?void 0:h.kind),T=F&&!this.tooltipUtil.hasBars(),I=!F&&!P&&!this.tooltipUtil.hasBars()&&this._hasCustomSeries(),X=T||I,R=this.tooltipUtil.getElBars(),z=()=>{M.globals.markers.largestSize>0&&!F?E.marker.enlargePoints(i):E.tooltipPosition.moveDynamicPointsOnHover(i)};if(M.config.legend.tooltipHoverFormatter){const t=M.config.legend.tooltipHoverFormatter,e=Array.from(null!=(c=this.legendLabels)?c:[]);e.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(null!=e?e:"")});for(let a=0;a<e.length;a++){const o=e[a],n=parseInt(null!=(d=o.getAttribute("i"))?d:"",10),l=decodeURIComponent(null!=(g=o.getAttribute("data:default-text"))?g:""),h=t(l,{seriesIndex:r?n:s,dataPointIndex:i,w:M});if(r)o.innerHTML=M.globals.collapsedSeriesIndices.indexOf(n)<0?h:l;else if(o.innerHTML=n===s?h:l,s===n)break}}const B=M.rangeData,Y=n(n({ttItems:a,i:s,j:i},void 0!==(null==(f=null==(x=null==(u=null==(p=B.seriesRange)?void 0:p[s])?void 0:u[i])?void 0:x.y[0])?void 0:f.y1)&&{y1:null==(w=null==(y=null==(b=null==(m=B.seriesRange)?void 0:m[s])?void 0:b[i])?void 0:y.y[0])?void 0:w.y1}),void 0!==(null==(S=null==(C=null==(A=null==(v=B.seriesRange)?void 0:v[s])?void 0:A[i])?void 0:C.y[0])?void 0:S.y2)&&{y2:null==(D=null==(L=null==(_=null==(k=B.seriesRange)?void 0:k[s])?void 0:_[i])?void 0:L.y[0])?void 0:D.y2});if(r){if(E.tooltipLabels.drawSeriesTexts(l(n({},Y),{shared:!this.showOnIntersect&&this.tConfig.shared})),P||X)z();else if(this.tooltipUtil.hasBars()&&(F&&E.tooltipPosition.moveStickyTooltipOverBars(i,s),this.barSeriesHeight=this.tooltipUtil.getBarsHeight([...R]),this.barSeriesHeight>0)){const t=new gt(this.w,this.ctx),e=M.dom.Paper.find(`.apexcharts-bar-area[j='${i}']`);this.deactivateHoverFilter();E.tooltipUtil.getAllMarkers(!0).length&&!this.barSeriesHeight&&z(),E.tooltipPosition.moveStickyTooltipOverBars(i,s);for(let s=0;s<e.length;s++)t.pathMouseEnter(e[s],void 0)}}else E.tooltipLabels.drawSeriesTexts(n({shared:!1},Y)),this.tooltipUtil.hasBars()&&E.tooltipPosition.moveStickyTooltipOverBars(i,s),P?E.tooltipPosition.moveMarkers(s,i):X&&E.tooltipPosition.moveDynamicPointOnHover(i,s)}}class Je{constructor(t,e){this.w=t,this.ctx=e,this.kind="svg"}beginSeries(){}present(){return null}clear(){}group(t){return this.ctx.graphics.group(t)}drawPath(t){return this.ctx.graphics.drawPath(t)}drawLine(...t){return this.ctx.graphics.drawLine(...t)}drawRect(...t){return this.ctx.graphics.drawRect(...t)}drawCircle(t,e){return this.ctx.graphics.drawCircle(t,e)}drawText(t){return this.ctx.graphics.drawText(t)}renderPaths(t){return this.ctx.graphics.renderPaths(t)}drawMarker(t,e,s={}){return this.ctx.graphics.drawMarker(t,e,s)}supports(t){return!0}hitTest(){return null}restyle(){}toBitmap(){return null}destroy(){}}const Qe="__apexcharts_renderers__";function ts(){const t=globalThis;return t[Qe]||(t[Qe]=new Map),t[Qe]}class es{static get _rendererRegistry(){return ts()}static registerRenderer(t,e){ts().set(t,e)}static unregisterRenderer(t){ts().delete(t)}constructor(t,e){this.w=t,this.ctx=e,this.svg=new Je(t,e),this.active=this.svg,this._activeKind="svg",this._instances={}}_desiredKind(){const t=this.w.config.chart,e=t.renderer||"svg";if(!c.isBrowser())return"svg";if("svg"===e)return"svg";if(ft(this.w))return"svg";if("canvas"===e)return"canvas";return function(t){const e=t.config.series||[],s=t.config.chart.type,i="scatter"===s||"bubble"===s,a=t.config.markers&&t.config.markers.size,r=Array.isArray(a)?a.some(t=>t>0):(a||0)>0,o=!(!t.config.dataLabels||!t.config.dataLabels.enabled);let n=0,l=0;return e.forEach(t=>{const e=Array.isArray(t.data)?t.data.length:0;e>l&&(l=e),(i||r)&&(n+=e),o&&(n+=e)}),l>=5e4&&(n=Math.max(n,l)),n}(this.w)>=(t.rendererThreshold||8e3)?"canvas":"svg"}resolve(){const t=this.w.config.chart.renderer||"svg",e=this._desiredKind();if("svg"!==e){const t=ts().get(e);if(t)return this._instances[e]||(this._instances[e]=t(this.w,this.ctx)),this.active=this._instances[e],this._activeKind=e,this.ctx.renderer=this.active,this.w.globals.activeRenderer=this.active,this._activeKind}else"canvas"===t&&ft(this.w);return this.active=this.svg,this._activeKind="svg",this.ctx.renderer=this.active,this.w.globals.activeRenderer=this.active,this._activeKind}getActiveKind(){return this._activeKind}teardown(){for(const t in this._instances){const e=this._instances[t];e&&"function"==typeof e.destroy&&e.destroy()}this._instances={},this.active=this.svg,this._activeKind="svg"}}class ss{constructor(t){this.node=t,t&&(t.instance=this),this._listeners=[],this._filter=null}attr(t,e){if("string"==typeof t&&void 0===e)return this.node.getAttribute(t);const s="string"==typeof t?{[t]:e}:t;for(const t in s){let e=s[t];null===e?this.node.removeAttribute(t):void 0!==e&&("number"==typeof e&&isNaN(e)&&(e=0),this.node.setAttribute(t,e))}if("text"===this.node.nodeName&&null!=s.x){const t=this.node.querySelectorAll("tspan[data-newline]");for(let e=0;e<t.length;e++)t[e].setAttribute("x",s.x)}return this}css(t){for(const e in t)this.node.style[e]=t[e];return this}fill(t){return"object"==typeof t?this.attr(t):this.attr("fill",t)}stroke(t){return"object"==typeof t?(void 0!==t.color&&this.attr("stroke",t.color),void 0!==t.width&&this.attr("stroke-width",t.width),void 0!==t.dasharray&&this.attr("stroke-dasharray",t.dasharray),void 0!==t.linecap&&this.attr("stroke-linecap",t.linecap),void 0!==t.opacity&&this.attr("stroke-opacity",t.opacity),this):this.attr("stroke",t)}size(t,e){return this.attr({width:t,height:e})}move(t,e){return this.attr({x:t,y:e})}center(t,e){if("g"===this.node.nodeName){const s=this.bbox(),i=t-(s.x+s.width/2),a=e-(s.y+s.height/2);return this.attr("transform",`translate(${i}, ${a})`)}return this.attr({cx:t,cy:e})}add(t){return t&&t.__isCanvasMark||this.node.appendChild(t.node||t),this}addTo(t){return(t.node||t).appendChild(this.node),this}remove(){return this.node.parentNode&&this.node.parentNode.removeChild(this.node),this}clear(){for(;this.node.firstChild;)this.node.removeChild(this.node.firstChild);return this}find(t){return Array.from(this.node.querySelectorAll(t)).map(t=>t.instance||new ss(t))}findOne(t){const e=this.node.querySelector(t);return e?e.instance||new ss(e):null}on(t,e){const s=t.split(".")[0];return this._listeners.push({event:t,eventType:s,handler:e}),this.node.addEventListener(s,e),this}off(t,e){if(t||e)if(t&&!e){const e=t.split(".")[0];this._listeners=this._listeners.filter(t=>t.eventType!==e||(this.node.removeEventListener(t.eventType,t.handler),!1))}else{const s=t.split(".")[0];this._listeners=this._listeners.filter(t=>t.eventType!==s||t.handler!==e||(this.node.removeEventListener(t.eventType,t.handler),!1))}else this._listeners.forEach(t=>{this.node.removeEventListener(t.eventType,t.handler)}),this._listeners=[];return this}each(t,e){return Array.from(this.node.children).forEach(s=>{const i=s.instance||new ss(s);t.call(i),e&&i.each(t,e)}),this}removeClass(t){return"*"===t?this.node.removeAttribute("class"):this.node.classList.remove(t),this}children(){return Array.from(this.node.childNodes).filter(t=>1===t.nodeType).map(t=>t.instance||new ss(t))}hide(){return this.node.style.display="none",this}show(){return this.node.style.display="",this}bbox(){if("function"==typeof this.node.getBBox)try{return this.node.getBBox()}catch(t){}return{x:0,y:0,width:0,height:0}}tspan(t){const e=m.createElementNS("http://www.w3.org/2000/svg","tspan");return e.textContent=t,this.node.appendChild(e),new ss(e)}plot(t){return"string"==typeof t&&this.attr("d",t),this}animate(){throw new Error("Animation module not loaded")}filterWith(){throw new Error("Filter module not loaded")}unfilter(t){return this._filter&&(this.node.removeAttribute("filter"),t&&this._filter.node&&this._filter.node.parentNode&&this._filter.node.parentNode.removeChild(this._filter.node),this._filter=null),this}filterer(){return this._filter}}let is=0;class as extends ss{constructor(t,e,s){const i="radial"===e?"radialGradient":"linearGradient";super(m.createElementNS(F,i)),this._id="SvgjsGradient"+ ++is,this.attr("id",this._id),"function"==typeof s&&s(new rs(this));let a=t.node.querySelector("defs");a||(a=m.createElementNS(F,"defs"),t.node.appendChild(a)),a.appendChild(this.node)}stop(t,e,s){const i=m.createElementNS(F,"stop");return i.setAttribute("offset",t),i.setAttribute("stop-color",e),void 0!==s&&i.setAttribute("stop-opacity",String(s)),this.node.appendChild(i),this}from(t,e){return this.attr({x1:t,y1:e})}to(t,e){return this.attr({x2:t,y2:e})}url(){return"url(#"+this._id+")"}toString(){return this.url()}valueOf(){return this.url()}fill(){return this.url()}}class rs{constructor(t){this.gradient=t}stop(t,e,s){return this.gradient.stop(t,e,s),this}}let os=0;class ns extends ss{constructor(t,e,s,i){if(super(m.createElementNS(F,"pattern")),this._id="SvgjsPattern"+ ++os,this.attr({id:this._id,width:e,height:s,patternUnits:"userSpaceOnUse"}),"function"==typeof i){i(new ls(this.node))}let a=t.node.querySelector("defs");a||(a=m.createElementNS(F,"defs"),t.node.appendChild(a)),a.appendChild(this.node)}url(){return"url(#"+this._id+")"}toString(){return this.url()}valueOf(){return this.url()}fill(){return this.url()}}class ls extends ss{line(t,e,s,i){const a=this._make("line");return void 0!==t&&a.attr({x1:t,y1:e,x2:s,y2:i}),a}rect(t,e){const s=this._make("rect");return void 0!==t&&s.attr({width:t,height:e}),s}circle(t){const e=this._make("circle");return void 0!==t&&e.attr({r:t/2,cx:t/2,cy:t/2}),e}path(t){const e=this._make("path");return t&&e.attr("d",t),e}polygon(t){const e=this._make("polygon");return t&&e.attr("points",t),e}group(){return this._makeContainer("g")}defs(){return this._makeContainer("defs")}plain(t){const e=m.createElementNS(F,"text");e.textContent=t;const s=new ss(e);return this.node.appendChild(e),s}text(t){const e=m.createElementNS(F,"text"),s=new ss(e);return this.node.appendChild(e),"function"==typeof t&&t(new hs(e)),s}image(t,e){const s=m.createElementNS(F,"image");s.setAttributeNS("http://www.w3.org/1999/xlink","href",t);const i=new ss(s);if(this.node.appendChild(s),"function"==typeof e){const s=new Image;s.onload=function(){i.size(s.width,s.height),e.call(i,{width:s.width,height:s.height})},s.src=t}return i}gradient(t,e){return new as(this,t,e)}pattern(t,e,s){return new ns(this,t,e,s)}_make(t){const e=m.createElementNS(F,t);return this.node.appendChild(e),new ss(e)}_makeContainer(t){const e=m.createElementNS(F,t);return this.node.appendChild(e),new ls(e)}}class hs{constructor(t){this.textNode=t}tspan(t){const e=m.createElementNS(F,"tspan");return e.textContent=t,this.textNode.appendChild(e),new cs(e,this.textNode)}}class cs{constructor(t,e){this.node=t,this.textNode=e}newLine(){return this.node.setAttribute("dy","1.1em"),this.node.dataset.newline="1",this}}let ds=0;class gs extends ss{constructor(){super(m.createElementNS(F,"filter")),this._id="SvgjsFilter"+ ++ds,this.attr("id",this._id)}size(t,e,s,i){return this.attr({width:t,height:e,x:s,y:i})}}class ps{constructor(t){this.filter=t}colorMatrix(t){return this._primitive("feColorMatrix",t)}offset(t){return this._primitive("feOffset",t)}gaussianBlur(t){return this._primitive("feGaussianBlur",t)}flood(t){return this._primitive("feFlood",t)}composite(t){return this._primitive("feComposite",t)}merge(t){const e=m.createElementNS(F,"feMerge");return t.forEach(t=>{const s=m.createElementNS(F,"feMergeNode");s.setAttribute("in",t),e.appendChild(s)}),this.filter.node.appendChild(e),new ss(e)}_primitive(t,e){const s=m.createElementNS(F,t);for(const t in e)s.setAttribute(t,e[t]);return this.filter.node.appendChild(s),new ss(s)}}var us;function xs(){const t=m.createElementNS(F,"svg"),e=new ls(t);return e.attr({xmlns:F}),e}(us=ss).prototype.filterWith=function(t){const e=new gs;this._filter=e;let s=this.node;for(;s&&"svg"!==s.nodeName;)s=s.parentNode;if(s){let t=s.querySelector("defs");t||(t=m.createElementNS(F,"defs"),s.insertBefore(t,s.firstChild)),t.appendChild(e.node)}return t(new ps(e)),this.attr("filter","url(#"+e._id+")"),this},us.prototype.unfilter=function(t){return this._filter&&(this.node.removeAttribute("filter"),t&&this._filter.node&&this._filter.node.parentNode&&this._filter.node.parentNode.removeChild(this._filter.node),this._filter=null),this},us.prototype.filterer=function(){return this._filter},function(t){t.prototype.animate=function(t,e){return new J(this,t,e)}}(ss),function(t){t.prototype.draggable=function(t){if(!1===t)return this._dragCleanup&&(this._dragCleanup(),this._dragCleanup=null),this;const e=this,s=t||{},i=t=>{if(t.button&&0!==t.button)return;t.stopPropagation();const i="touchstart"===t.type?t.touches[0]:t,a=e.node,r=parseFloat(a.getAttribute("x"))||0,o=parseFloat(a.getAttribute("y"))||0,n=i.clientX,l=i.clientY,h=a.ownerSVGElement;let d=null;h&&(d=h.getScreenCTM());const g=t=>{const e="touchmove"===t.type?t.touches[0]:t;let i=e.clientX-n,h=e.clientY-l;d&&(i/=d.a,h/=d.d);let c=r+i,g=o+h;const p=parseFloat(a.getAttribute("width"))||0,u=parseFloat(a.getAttribute("height"))||0;void 0!==s.minX&&c<s.minX&&(c=s.minX),void 0!==s.minY&&g<s.minY&&(g=s.minY),void 0!==s.maxX&&c+p>s.maxX&&(c=s.maxX-p),void 0!==s.maxY&&g+u>s.maxY&&(g=s.maxY-u);const x=new CustomEvent("dragmove",{detail:{handler:{move:function(t,e){a.setAttribute("x",t),a.setAttribute("y",e)}},box:{x:c,y:g,w:p,h:u,x2:c+p,y2:g+u}}});a.dispatchEvent(x)},p=()=>{c.isBrowser()&&(document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p))};c.isBrowser()&&(document.addEventListener("mousemove",g),document.addEventListener("touchmove",g),document.addEventListener("mouseup",p),document.addEventListener("touchend",p))};return e.node.addEventListener("mousedown",i),e.node.addEventListener("touchstart",i),e._dragCleanup=()=>{e.node.removeEventListener("mousedown",i),e.node.removeEventListener("touchstart",i)},e}}(ss),function(t){t.prototype.select=function(t){if(!1===t)return this._selectCleanup&&(this._selectCleanup(),this._selectCleanup=null),this;const e=this,{createHandle:s,updateHandle:i}=t,a=document.createElementNS(F,"g");a.setAttribute("class","svg_select_points");const r=e.node.parentNode;r&&r.appendChild(a);const o={},n=["t","b","l","r","lt","rt","lb","rb"];n.forEach((t,e)=>{const i=new ls(document.createElementNS(F,"g"));a.appendChild(i.node);const r=s(i,[0,0],e,[],t);o[t]={group:i,handle:r}});const l=()=>{const t=parseFloat(e.attr("x"))||0,s=parseFloat(e.attr("y"))||0,r=parseFloat(e.attr("width"))||0,l=parseFloat(e.attr("height"))||0,h=e.node.getAttribute("transform");h?a.setAttribute("transform",h):a.removeAttribute("transform");const c={t:[t+r/2,s],b:[t+r/2,s+l],l:[t,s+l/2],r:[t+r,s+l/2],lt:[t,s],rt:[t+r,s],lb:[t,s+l],rb:[t+r,s+l]};n.forEach(t=>{o[t]&&c[t]&&i(o[t].group,c[t])})};return l(),e._selectHandles=a,e._selectHandlesMap=o,e._updateSelectPositions=l,e._selectCleanup=()=>{a.parentNode&&a.parentNode.removeChild(a),e._selectHandles=null,e._selectHandlesMap=null,e._updateSelectPositions=null},e},t.prototype.resize=function(t){if(!1===t)return this._resizeCleanup&&(this._resizeCleanup(),this._resizeCleanup=null),this;const e=this,s=e._selectHandlesMap;if(!s)return e;const i=[],a=t=>{const a=s[t];if(!a||!a.group||!a.group.node)return;const r=a.group.node,o=s=>{if(s.button&&0!==s.button)return;s.stopPropagation();const i=("touchstart"===s.type?s.touches[0]:s).clientX,a=e.node.ownerSVGElement;let r=null;a&&(r=a.getScreenCTM());const o=parseFloat(e.attr("x"))||0,n=parseFloat(e.attr("width"))||0,l=s=>{let a=("touchmove"===s.type?s.touches[0]:s).clientX-i;r&&(a/=r.a);let l=o,h=n;"l"===t?(l=o+a,h=n-a):"r"===t&&(h=n+a),h<0&&(h=0),e.attr({x:l,width:h}),e._updateSelectPositions&&e._updateSelectPositions();const c=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(c)},h=()=>{c.isBrowser()&&(document.removeEventListener("mousemove",l),document.removeEventListener("touchmove",l),document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h));const t=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(t)};c.isBrowser()&&(document.addEventListener("mousemove",l),document.addEventListener("touchmove",l),document.addEventListener("mouseup",h),document.addEventListener("touchend",h))};r.addEventListener("mousedown",o),r.addEventListener("touchstart",o),i.push(()=>{r.removeEventListener("mousedown",o),r.removeEventListener("touchstart",o)})};return a("l"),a("r"),e._resizeCleanup=()=>{i.forEach(t=>t())},e}}(ss),xs.xlink="http://www.w3.org/1999/xlink",c.isBrowser()&&void 0===window.SVG&&(window.SVG=xs),c.isBrowser()?(void 0===window.SVG&&(window.SVG=xs),void 0===window.Apex&&(window.Apex={})):"undefined"!=typeof global&&(void 0===global.Apex&&(global.Apex={}),void 0===global.SVG&&(global.SVG=xs));const fs=class t{static registerFeatures(e){for(const[s,i]of Object.entries(e))t._featureRegistry.set(s,i)}constructor(t){this.ctx=t,this.w=t.w}initModules(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","highlightSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","drillDown","drillUp","drillToRoot","paper","getActiveRenderer","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend","keydown","keyup"],this.ctx.animations=new ct(this.w,this.ctx),this.ctx.axes=new Mt(this.w,this.ctx),this.ctx.core=new Oe(this.ctx.el,this.w,this.ctx),this.ctx.config=new _({}),this.ctx.data=new He(this.w,{resetGlobals:()=>this.ctx.core.resetGlobals(),isMultipleY:()=>this.ctx.core.isMultipleY()}),this.ctx.grid=new Ct(this.w,this.ctx),this.ctx.graphics=new gt(this.w,this.ctx),this.ctx.coreUtils=new P(this.w),this.ctx.crosshairs=new Et(this.w),this.ctx.events=new Lt(this.w,this.ctx),this.ctx.fill=new pt(this.w),this.ctx.localization=new Dt(this.w),this.ctx.options=new k,this.ctx.responsive=new Ft(this.w),this.ctx.series=new ce(this.w,{toggleDataSeries:(...t)=>{var e;return null==(e=this.ctx.legend)?void 0:e.legendHelpers.toggleDataSeries(...t)},revertDefaultAxisMinMax:()=>this.ctx.updateHelpers.revertDefaultAxisMinMax(),updateSeries:(...t)=>this.ctx.updateHelpers._updateSeries(...t)}),this.ctx.theme=new me(this.w),this.ctx.formatters=new w(this.w),this.ctx.titleSubtitle=new be(this.w),this.ctx.dimensions=new Ce(this.w,this.ctx),this.ctx.updateHelpers=new We(this.w,this.ctx),this.ctx.rendererController=new es(this.w,this.ctx),this.ctx.renderer=this.ctx.rendererController.active;const t=new Ke(this.w,this.ctx);this.w.globals.tooltip=t,Object.defineProperty(this.ctx,"tooltip",{get(){return this.w.globals.tooltip},configurable:!0}),this._initOptionalModules()}_initOptionalModules(){const e=t._featureRegistry,s=this.w,i=this.ctx,a=e.get("exports");i.exports=a?new a(s,i):null;const r=e.get("legend");i.legend=r?new r(s,i):null;const o=e.get("morphTypeChange");i.morphTypeChange=o?new o(s,i):null;const n=e.get("drilldown");i.drilldown=n?new n(s,i):null;const l=e.get("perspectives");i.perspectives=l?new l(s,i):null;const h=e.get("storyboard");i.storyboard=h?new h(s,i):null;const c=e.get("history");i.history=c?new c(s,i):null;const d=e.get("linkedViews");i.linkedViews=d?new d(s,i):null;const g=e.get("ink");i.ink=g?new g(s,i):null;const p=e.get("measure");i.measure=p?new p(s,i):null;const u=e.get("contextMenu");i.contextMenu=u?new u(s,i):null;const x=e.get("weave");i.weave=x?new x(s,i):null;const f=e.get("osThemeWatcher");i.osThemeWatcher=f?new f(s,i):null;const m=e.get("toolbar");Object.defineProperty(i,"toolbar",{get(){var t;return!this._toolbar&&m&&(this._toolbar=new m(s,this)),null!=(t=this._toolbar)?t:null},configurable:!0});const b=e.get("zoomPanSelection");Object.defineProperty(i,"zoomPanSelection",{get(){var t;return!this._zoomPanSelection&&b&&(this._zoomPanSelection=new b(s,this)),null!=(t=this._zoomPanSelection)?t:null},configurable:!0});const y=e.get("keyboardNavigation");Object.defineProperty(i,"keyboardNavigation",{get(){var t;return!this._keyboardNavigation&&y&&(this._keyboardNavigation=new y(s,this)),null!=(t=this._keyboardNavigation)?t:null},configurable:!0})}};h(fs,"_featureRegistry",new Map);let ms=fs;class bs{constructor(t){this.ctx=t,this.w=t.w}clear({isUpdating:t}){var e,s,i,a,r,o,n,l,h,c,d;null==(e=this.ctx.weave)||e.teardown(t),t||(this.w.globals.isDestroyed=!0),this.ctx._zoomPanSelection&&this.ctx._zoomPanSelection.destroy(),this.ctx._toolbar&&this.ctx._toolbar.destroy(),this.w.globals.resizeObserver&&"function"==typeof this.w.globals.resizeObserver.disconnect&&(this.w.globals.resizeObserver.disconnect(),this.w.globals.resizeObserver=null),wt.invalidateAll(this.w),t?(this.ctx._zoomPanSelection=null,this.ctx._toolbar=null,this.ctx._keyboardNavigation=null):(null==(s=this.ctx.perspectives)||s.teardown(),this.ctx.perspectives=null,null==(i=this.ctx.storyboard)||i.teardown(),this.ctx.storyboard=null,null==(a=this.ctx.history)||a.teardown(),this.ctx.history=null,null==(r=this.ctx.linkedViews)||r.teardown(),this.ctx.linkedViews=null,null==(o=this.ctx.ink)||o.teardown(),this.ctx.ink=null,null==(n=this.ctx.measure)||n.teardown(),this.ctx.measure=null,null==(l=this.ctx.contextMenu)||l.teardown(),this.ctx.contextMenu=null,null==(h=this.ctx.osThemeWatcher)||h.teardown(),this.ctx.osThemeWatcher=null,this.ctx.weave=null,null==(d=null==(c=this.ctx.rendererController)?void 0:c.teardown)||d.call(c),this.ctx.rendererController=null,this.ctx.renderer=null,this.ctx.drilldown=null,this.ctx.morphTypeChange=null,this.ctx.exports=null,this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx._zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx._toolbar=null,this.ctx.localization=null,this.ctx._keyboardNavigation=null,this.ctx.w.globals.tooltip=null),this.clearDomElements({isUpdating:t})}killSVG(t){t.each(function(){this.removeClass("*"),this.off()},!0),t.clear()}clearDomElements({isUpdating:t}){const e=this.w.dom;if(c.isBrowser()&&e.Paper){const s=e.Paper.node;s.parentNode&&s.parentNode.parentNode&&!t&&(s.parentNode.parentNode.style.minHeight="unset");const i=e.baseEl;if(i&&this.ctx.eventList.forEach(t=>{i.removeEventListener(t,this.ctx.events.documentEvent)}),null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(e.Paper),e.Paper.remove()}e.elWrap=null,e.elGraphical=null,e.elLegendWrap=null,e.elLegendForeign=null,e.baseEl=null,e.elGridRect=null,e.elGridRectMask=null,e.elGridRectBarMask=null,e.elGridRectMarkerMask=null,e.elForecastMask=null,e.elNonForecastMask=null,e.elDefs=null}}const ys="__apexcharts_plugins__";function ws(){const t=globalThis;return t[ys]||(t[ys]={}),t[ys]}const vs=new WeakMap;const As=class t{constructor(t,e){h(this,"core"),h(this,"responsive"),h(this,"axes"),h(this,"grid"),h(this,"graphics"),h(this,"coreUtils"),h(this,"crosshairs"),h(this,"events"),h(this,"fill"),h(this,"localization"),h(this,"options"),h(this,"series"),h(this,"theme"),h(this,"formatters"),h(this,"titleSubtitle"),h(this,"dimensions"),h(this,"updateHelpers"),h(this,"tooltip"),h(this,"data"),h(this,"animations"),h(this,"exports"),h(this,"legend"),h(this,"toolbar"),h(this,"zoomPanSelection"),h(this,"keyboardNavigation"),h(this,"annotations"),h(this,"morphTypeChange"),h(this,"timeScale"),h(this,"_keyboardNavigation"),h(this,"windowResizeHandler"),h(this,"parentResizeHandler"),h(this,"publicMethods",[]),h(this,"eventList",[]),h(this,"_renderPromise",null),h(this,"config"),h(this,"perspectives"),h(this,"storyboard"),h(this,"history"),h(this,"linkedViews"),h(this,"ink"),h(this,"measure"),h(this,"contextMenu"),h(this,"weave"),h(this,"renderer"),h(this,"rendererController"),this.opts=e,this.ctx=this,this.w=new E(e).init(),this.el=t,this.w.globals.cuid=b.randomId(),this.w.globals.chartID=this.w.config.chart.id?b.escapeString(this.w.config.chart.id):this.w.globals.cuid,lt(this.w);new ms(this).initModules(),this.lastUpdateOptions=null,this.create=this.create.bind(this),c.isBrowser()&&(this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this))}render(){var t,e;if(!(null==(e=null==(t=this.w)?void 0:t.config)?void 0:e.chart))return Promise.reject(new Error("ApexCharts: chart configuration is missing or invalid. Ensure the options object includes a `chart` property."));if(this._renderPromise)return this._renderPromise;const s=new Promise((t,e)=>{var s;if(b.elementExists(this.el)){void 0===Apex._chartInstances&&(Apex._chartInstances=[]),this.w.config.chart.id&&Apex._chartInstances.push({id:this.w.globals.chartID,group:this.w.config.chart.group,chart:this}),this.setLocale(this.w.config.chart.defaultLocale);const i=this.w.config.chart.events.beforeMount;if("function"==typeof i&&i(this,this.w),this.events.fireEvent("beforeMount",[this,this.w]),c.isBrowser()){window.addEventListener("resize",this.windowResizeHandler),function(t,e){if(c.isSSR())return;let s=!1;if(t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){const e=t.getBoundingClientRect();"none"!==t.style.display&&0!==e.width||(s=!0)}const i=new ResizeObserver(i=>{s&&e.call(t,i),s=!0});t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(t.children).forEach(t=>i.observe(t)):i.observe(t),vs.set(e,i)}(this.el.parentNode,this.parentResizeHandler);const t=this.el.getRootNode&&this.el.getRootNode(),e=b.is("ShadowRoot",t),i=this.el.ownerDocument;let a=e?t.getElementById("apexcharts-css"):i.getElementById("apexcharts-css");if(!a){a=m.createElementNS("http://www.w3.org/1999/xhtml","style"),a.id="apexcharts-css",a.textContent='@keyframes opaque {\n 0% {\n opacity: 0\n }\n\n to {\n opacity: 1\n }\n}\n\n@keyframes resizeanim {\n\n 0%,\n to {\n opacity: 0\n }\n}\n\n.apexcharts-canvas {\n position: relative;\n direction: ltr !important;\n user-select: none;\n /* Focus indicator colour. Themes override below. */\n --apexcharts-focus-color: #008FFB;\n}\n\n/* Dark theme & high-contrast: brighter focus colour for sufficient contrast. */\n.apexcharts-canvas .apexcharts-theme-dark,\n.apexcharts-theme-dark.apexcharts-canvas {\n --apexcharts-focus-color: #FFD500;\n}\n.apexcharts-canvas.apexcharts-high-contrast,\n.apexcharts-high-contrast.apexcharts-canvas {\n --apexcharts-focus-color: #FFFF00;\n}\n\n/* Visually-hidden aria-live status region (WCAG 4.1.3 Status Messages). */\n.apexcharts-sr-status {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Respect OS-level reduced-motion preference (WCAG 2.3.3). */\n@media (prefers-reduced-motion: reduce) {\n .apexcharts-canvas *,\n .apexcharts-canvas *::before,\n .apexcharts-canvas *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n }\n}\n\n.apexcharts-canvas ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 6px\n}\n\n.apexcharts-canvas ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(0, 0, 0, .5);\n box-shadow: 0 0 1px rgba(255, 255, 255, .5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5)\n}\n\n.apexcharts-inner {\n position: relative\n}\n\n.apexcharts-text tspan {\n font-family: inherit\n}\n\nrect.legend-mouseover-inactive,\n.legend-mouseover-inactive rect,\n.legend-mouseover-inactive path,\n.legend-mouseover-inactive circle,\n.legend-mouseover-inactive line,\n.legend-mouseover-inactive text.apexcharts-yaxis-title-text,\n.legend-mouseover-inactive text.apexcharts-yaxis-label {\n transition: .15s ease all;\n opacity: .2\n}\n\n/* Linked Views (#4): per-mark crossfilter dim. Applied to individual data\n marks (not whole series) whose x is outside the brushed range. Opacity is\n overridable per chart via the --apx-cf-dim custom property. */\n.apexcharts-crossfilter-dimmed {\n transition: opacity .25s ease;\n opacity: var(--apx-cf-dim, .2)\n}\n\n/* Linked Views (#4): default styling for the built-in crossfilter data table\n (cf.dataTable). Deliberately light so host styles can override. */\n.apexcharts-cf-table {\n border-collapse: collapse;\n width: 100%;\n font-size: 13px;\n}\n.apexcharts-cf-table caption {\n caption-side: bottom;\n text-align: right;\n padding: 6px 2px;\n font-size: 12px;\n opacity: .7\n}\n.apexcharts-cf-table th,\n.apexcharts-cf-table td {\n padding: 6px 10px;\n text-align: left;\n border-bottom: 1px solid rgba(0, 0, 0, .08)\n}\n.apexcharts-cf-table th {\n font-weight: 600;\n border-bottom-width: 2px\n}\n.apexcharts-cf-table tbody tr:hover {\n background: rgba(99, 102, 241, .06)\n}\n\n/* Measure ruler (#18): measure / delta ruler.\n Theme via these classes or the --apx-measure-* custom properties below\n (config `chart.measure.colors` overrides both). The ruler group also carries\n a direction class: apexcharts-measure-up | -down | -flat.\n Element classes:\n .apexcharts-measure-band shaded span band\n .apexcharts-measure-vline vertical guide lines\n .apexcharts-measure-line free-mode diagonal line\n .apexcharts-measure-label-bg readout box .apexcharts-measure-label text\n Colors are applied as SVG presentation attributes, so any rule you write on\n these classes overrides them. */\n.apexcharts-canvas {\n --apx-measure-up: #16a34a;\n --apx-measure-down: #dc2626;\n --apx-measure-neutral: #64748b;\n --apx-measure-guide: #94a3b8;\n}\n.apexcharts-measure-capture {\n cursor: crosshair;\n}\n\n/* Radial Actions (#chrome): right-click context menu. Theme via these classes\n or the --apx-menu-* custom properties. */\n.apexcharts-canvas {\n --apx-menu-bg: #ffffff;\n --apx-menu-fg: #1e293b;\n --apx-menu-border: #e2e8f0;\n --apx-menu-hover: #f1f5f9;\n --apx-menu-shadow: rgba(15, 23, 42, 0.18);\n}\n.apexcharts-context-menu {\n min-width: 168px;\n padding: 4px;\n border-radius: 8px;\n background: var(--apx-menu-bg);\n border: 1px solid var(--apx-menu-border);\n box-shadow: 0 6px 22px var(--apx-menu-shadow);\n font-family: Helvetica, Arial, sans-serif;\n font-size: 13px;\n z-index: 20;\n user-select: none;\n}\n.apexcharts-context-menu-item {\n display: block;\n width: 100%;\n box-sizing: border-box;\n text-align: left;\n padding: 7px 12px;\n border: 0;\n border-radius: 5px;\n background: transparent;\n color: var(--apx-menu-fg);\n font: inherit;\n cursor: pointer;\n}\n.apexcharts-context-menu-item:hover,\n.apexcharts-context-menu-item--active {\n background: var(--apx-menu-hover);\n}\n.apexcharts-context-menu-item:focus {\n outline: none;\n}\n\n/* Ink Layer (#7): the floating note editor card, opened by clicking an\n ink-managed annotation. Theme via these classes or the --apx-ink-* vars. */\n.apexcharts-canvas {\n --apx-ink-card-bg: #ffffff;\n --apx-ink-card-fg: #1e293b;\n --apx-ink-card-border: #e2e8f0;\n --apx-ink-card-hover: #f1f5f9;\n --apx-ink-card-accent: #6366f1;\n --apx-ink-card-shadow: rgba(15, 23, 42, 0.18);\n}\n.apexcharts-ink-card {\n position: absolute;\n z-index: 25;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px;\n border-radius: 8px;\n background: var(--apx-ink-card-bg);\n border: 1px solid var(--apx-ink-card-border);\n box-shadow: 0 6px 22px var(--apx-ink-card-shadow);\n font-family: Helvetica, Arial, sans-serif;\n font-size: 12px;\n color: var(--apx-ink-card-fg);\n user-select: none;\n}\n.apexcharts-ink-card-row {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n.apexcharts-ink-card input.apexcharts-ink-editor {\n flex: 1 1 auto;\n width: 150px;\n min-width: 0;\n box-sizing: border-box;\n padding: 4px 6px;\n font: inherit;\n color: inherit;\n background: transparent;\n border: 1px solid var(--apx-ink-card-border);\n border-radius: 5px;\n}\n.apexcharts-ink-card input.apexcharts-ink-editor:focus {\n outline: none;\n border-color: var(--apx-ink-card-accent);\n}\n.apexcharts-ink-btn {\n flex: 0 0 auto;\n width: 24px;\n height: 24px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: 0;\n border-radius: 5px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 12px;\n line-height: 1;\n cursor: pointer;\n}\n.apexcharts-ink-btn:hover,\n.apexcharts-ink-btn--active {\n background: var(--apx-ink-card-hover);\n}\n.apexcharts-ink-btn:focus-visible,\n.apexcharts-ink-swatch:focus-visible {\n outline: 2px solid var(--apx-ink-card-accent);\n outline-offset: 1px;\n}\n.apexcharts-ink-btn--bold {\n font-weight: 700;\n}\n.apexcharts-ink-btn--delete:hover {\n color: #dc2626;\n}\n.apexcharts-ink-swatch {\n flex: 0 0 auto;\n width: 16px;\n height: 16px;\n padding: 0;\n border: 1px solid rgba(100, 116, 139, 0.45);\n border-radius: 50%;\n cursor: pointer;\n}\n.apexcharts-ink-swatch--active {\n box-shadow:\n 0 0 0 2px var(--apx-ink-card-bg),\n 0 0 0 4px var(--apx-ink-card-accent);\n}\n.apexcharts-ink-sep {\n flex: 0 0 auto;\n width: 1px;\n height: 16px;\n margin: 0 2px;\n background: var(--apx-ink-card-border);\n}\n.apexcharts-ink-cardlabel {\n flex: 0 0 auto;\n font-size: 10px;\n letter-spacing: 0.4px;\n text-transform: uppercase;\n opacity: 0.65;\n margin-right: 2px;\n}\n.apexcharts-ink-marker-size {\n flex: 0 0 auto;\n min-width: 16px;\n text-align: center;\n font-variant-numeric: tabular-nums;\n}\n\n.apexcharts-legend-text {\n padding-left: 15px;\n margin-left: -15px;\n}\n\n.apexcharts-legend-series[role="button"]:focus {\n outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n outline-offset: 2px;\n}\n\n.apexcharts-legend-series[role="button"]:focus:not(:focus-visible) {\n outline: none;\n}\n\n.apexcharts-legend-series[role="button"]:focus-visible {\n outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n outline-offset: 2px;\n}\n\n.apexcharts-series-collapsed {\n opacity: 0\n}\n\n.apexcharts-canvas svg:focus:not(:focus-visible) {\n outline: none;\n}\n\n/* Keyboard navigation focus indicator on SVG data elements.\n SVG elements don\'t support CSS outline, so we use stroke. */\n.apexcharts-bar-area.apexcharts-keyboard-focused,\n.apexcharts-candlestick-area.apexcharts-keyboard-focused,\n.apexcharts-boxPlot-area.apexcharts-keyboard-focused,\n.apexcharts-rangebar-area.apexcharts-keyboard-focused,\n.apexcharts-pie-area.apexcharts-keyboard-focused,\n.apexcharts-heatmap-rect.apexcharts-keyboard-focused,\n.apexcharts-treemap-rect.apexcharts-keyboard-focused {\n stroke: var(--apexcharts-focus-color, #008FFB);\n stroke-width: 2;\n stroke-opacity: 1;\n}\n\n.apexcharts-tooltip {\n --apx-tt-bg: #ffffff;\n --apx-tt-border: rgba(15, 23, 42, 0.06);\n /* Layered shadow: tight inner contact + soft outer drop. The two Y\n * offsets are exposed as variables so they flip in sync with the\n * arrow when the tooltip is below the data point \u2014 see the\n * `[data-placement="bottom"]` rule further down. */\n --apx-tt-shadow-y-mid: 8px;\n --apx-tt-shadow-y-far: 16px;\n --apx-tt-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04), 0 var(--apx-tt-shadow-y-mid) 16px -6px rgba(15, 23, 42, 0.12), 0 var(--apx-tt-shadow-y-far) 36px -12px rgba(15, 23, 42, 0.18);\n --apx-tt-arrow-bg: var(--apx-tt-bg);\n /* Two stacked drop-shadows: the first is a tight contact halo for\n * edge definition against light chart backgrounds; the second is a\n * softer directional drop that lifts the arrow off the surface.\n * `--apx-tt-arrow-drop-y` is the Y offset of the directional drop;\n * a per-placement rule below flips it to negative when the tooltip\n * is below the data point (arrow on top) so the shadow always\n * casts outward instead of into the tooltip body. */\n --apx-tt-arrow-drop-y: 2px;\n --apx-tt-arrow-shadow: drop-shadow(0 0 0.5px rgba(15, 23, 42, 0.2)) drop-shadow(0 var(--apx-tt-arrow-drop-y) 4px rgba(15, 23, 42, 0.2));\n --apx-tt-color: #0f172a;\n --apx-tt-color-muted: rgba(15, 23, 42, 0.55);\n border-radius: 8px;\n background: var(--apx-tt-bg);\n border: 1px solid var(--apx-tt-border);\n box-shadow: var(--apx-tt-shadow);\n color: var(--apx-tt-color);\n cursor: default;\n font-size: 13px;\n left: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n display: flex;\n flex-direction: column;\n padding: 2px 0;\n white-space: nowrap;\n z-index: 12;\n transition: opacity .12s ease\n}\n\n/* While the tooltip is visible, smoothly animate position changes\n * between data points. Kept short (160 ms) and ease-out so it stays\n * responsive \u2014 too long would feel laggy when sweeping across many\n * points fast. The position transition is only attached after the\n * first paint (Position.applyTooltipPosition flips `data-positioned`\n * once the tooltip has been placed) so the *first* show doesn\'t slide\n * the tooltip in from the previously-stale (0,0) coordinates. */\n.apexcharts-tooltip.apexcharts-active {\n opacity: 1;\n transition: opacity .12s ease\n}\n.apexcharts-tooltip.apexcharts-active[data-positioned="true"] {\n transition: opacity .12s ease, left .16s ease-out, top .16s ease-out\n}\n\n.apexcharts-tooltip.apexcharts-theme-light {\n /* defaults already set above; class kept for backward-compat selectors */\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark {\n --apx-tt-bg: #1c1c1f;\n --apx-tt-border: rgba(255, 255, 255, 0.08);\n --apx-tt-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 var(--apx-tt-shadow-y-mid) 16px -6px rgba(0, 0, 0, 0.45), 0 var(--apx-tt-shadow-y-far) 36px -12px rgba(0, 0, 0, 0.55);\n --apx-tt-arrow-shadow: drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.55)) drop-shadow(0 var(--apx-tt-arrow-drop-y) 4px rgba(0, 0, 0, 0.45));\n --apx-tt-color: #f3f4f6;\n --apx-tt-color-muted: rgba(243, 244, 246, 0.55);\n}\n\n.apexcharts-tooltip * {\n font-family: inherit\n}\n\n.apexcharts-tooltip-title {\n padding: 8px 12px 4px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.01em;\n color: var(--apx-tt-color-muted);\n background: transparent;\n border-bottom: none;\n margin-bottom: 0\n}\n\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title,\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\n background: transparent;\n border-bottom: none\n}\n\n/* `fillSeriesColor`: each series-group already paints itself with the\n * series colour. Drop the glass body entirely (transparent bg, no\n * border, no backdrop-filter, no padding) and clip the coloured\n * series-group(s) to the tooltip\'s rounded corners so they fill the\n * shell edge-to-edge. Text inside the coloured group is forced to\n * white for contrast. */\n.apexcharts-tooltip.apexcharts-tooltip-fill-series {\n background: transparent;\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n border: none;\n padding: 0;\n overflow: hidden;\n color: #fff\n}\n\n.apexcharts-tooltip.apexcharts-tooltip-fill-series .apexcharts-tooltip-title {\n background: rgba(0, 0, 0, 0.22);\n color: #fff;\n opacity: 1;\n padding: 6px 12px\n}\n\n.apexcharts-tooltip.apexcharts-tooltip-fill-series .apexcharts-tooltip-series-group {\n color: #fff\n}\n\n/* Arrow connector \u2014 sits *entirely outside* the tooltip body. Shares\n * the body\'s solid fill so it reads as a single shape. `filter:\n * drop-shadow` traces the clipped triangle outline (a regular\n * `box-shadow` would be erased by the `clip-path`). */\n.apexcharts-tooltip-arrow {\n position: absolute;\n width: 7px;\n height: 14px;\n background: var(--apx-tt-arrow-bg);\n /* The variable already contains the full `drop-shadow(...) ...` filter\n * chain (stacked shadows) so it\'s applied raw. */\n -webkit-filter: var(--apx-tt-arrow-shadow);\n filter: var(--apx-tt-arrow-shadow);\n pointer-events: none;\n top: calc(var(--apx-tt-arrow-y, 50%) - 7px)\n}\n\n.apexcharts-tooltip[data-placement="right"] .apexcharts-tooltip-arrow {\n left: -7px;\n clip-path: polygon(0 50%, 100% 0, 100% 100%)\n}\n\n.apexcharts-tooltip[data-placement="left"] .apexcharts-tooltip-arrow {\n right: -7px;\n clip-path: polygon(100% 50%, 0 0, 0 100%)\n}\n\n/* Vertical arrow variants: tooltip is above/below the data point and the\n * arrow points down/up. The base rule above uses `--apx-tt-arrow-y` for\n * left/right placement; for top/bottom we re-orient the rectangle and\n * use `--apx-tt-arrow-x` (set by applyTooltipPosition). */\n.apexcharts-tooltip[data-placement="top"] .apexcharts-tooltip-arrow,\n.apexcharts-tooltip[data-placement="bottom"] .apexcharts-tooltip-arrow {\n width: 14px;\n height: 7px;\n top: auto;\n left: calc(var(--apx-tt-arrow-x, 50%) - 7px)\n}\n\n.apexcharts-tooltip[data-placement="top"] .apexcharts-tooltip-arrow {\n bottom: -7px;\n clip-path: polygon(50% 100%, 0 0, 100% 0)\n}\n\n.apexcharts-tooltip[data-placement="bottom"] .apexcharts-tooltip-arrow {\n top: -7px;\n clip-path: polygon(50% 0, 0 100%, 100% 100%)\n}\n\n/* When the tooltip is flipped below the data point (arrow on top\n * pointing up), the default downward-biased shadows leave the top\n * edge of both the body *and* the arrow undefined. Flipping every\n * Y offset to negative casts the entire elevation upward so the\n * shadow falls between the tooltip and the bar above. */\n.apexcharts-tooltip[data-placement="bottom"] {\n --apx-tt-shadow-y-mid: -8px;\n --apx-tt-shadow-y-far: -16px;\n --apx-tt-arrow-drop-y: -2px\n}\n\n.apexcharts-tooltip-text-goals-value,\n.apexcharts-tooltip-text-y-value,\n.apexcharts-tooltip-text-z-value {\n display: inline-block;\n margin-left: 5px;\n font-weight: 600\n}\n\n.apexcharts-tooltip-text-goals-label:empty,\n.apexcharts-tooltip-text-goals-value:empty,\n.apexcharts-tooltip-text-y-label:empty,\n.apexcharts-tooltip-text-y-value:empty,\n.apexcharts-tooltip-text-z-value:empty,\n.apexcharts-tooltip-title:empty {\n display: none\n}\n\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n padding: 6px 0 5px\n}\n\n.apexcharts-tooltip-goals-group,\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n display: flex\n}\n\n.apexcharts-tooltip-text-goals-label:not(:empty),\n.apexcharts-tooltip-text-goals-value:not(:empty) {\n margin-top: -6px\n}\n\n.apexcharts-tooltip-marker {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n width: 12px;\n height: 12px;\n margin-right: 6px;\n vertical-align: middle;\n color: inherit;\n}\n\n.apexcharts-tooltip-marker svg {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n.apexcharts-tooltip-series-group {\n padding: 4px 12px;\n display: none;\n gap: 8px;\n text-align: left;\n justify-content: left;\n align-items: center\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {\n opacity: 1\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active:last-child,\n.apexcharts-tooltip-series-group:last-child {\n padding-bottom: 8px\n}\n\n.apexcharts-tooltip-y-group {\n padding: 6px 0 5px\n}\n\n.apexcharts-custom-tooltip,\n.apexcharts-tooltip-box {\n padding: 4px 8px\n}\n\n.apexcharts-tooltip-boxPlot {\n display: flex;\n flex-direction: column-reverse\n}\n\n.apexcharts-tooltip-box>div {\n margin: 4px 0\n}\n\n.apexcharts-tooltip-box span.value {\n font-weight: 700\n}\n\n.apexcharts-tooltip-rangebar {\n padding: 5px 8px\n}\n\n.apexcharts-tooltip-rangebar .category {\n font-weight: 600;\n color: #777\n}\n\n.apexcharts-tooltip-rangebar .series-name {\n font-weight: 700;\n display: block;\n margin-bottom: 5px\n}\n\n/* X/Y axis tooltips \u2014 small popovers that label the crosshair on the\n * axes. Restyled to match the modern data-tooltip palette: solid white\n * body with a subtle border + soft drop-shadow, smaller font, rounded\n * corners. The arrows still use the CSS border-triangle technique\n * (cheap, crisp at small sizes); their colours flow from CSS variables\n * so light/dark themes only need one override per axis. */\n.apexcharts-xaxistooltip,\n.apexcharts-yaxistooltip {\n --apx-axt-bg: #ffffff;\n --apx-axt-border: rgba(15, 23, 42, 0.08);\n --apx-axt-color: #0f172a;\n --apx-axt-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.18), 0 1px 3px -1px rgba(15, 23, 42, 0.12);\n opacity: 0;\n pointer-events: none;\n color: var(--apx-axt-color);\n font-size: 12px;\n font-weight: 500;\n text-align: center;\n border-radius: 6px;\n position: absolute;\n z-index: 10;\n background: var(--apx-axt-bg);\n border: 1px solid var(--apx-axt-border);\n box-shadow: var(--apx-axt-shadow)\n}\n\n.apexcharts-xaxistooltip.apexcharts-theme-dark,\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\n --apx-axt-bg: #1c1c1f;\n --apx-axt-border: rgba(255, 255, 255, 0.1);\n --apx-axt-color: #f3f4f6;\n --apx-axt-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.55), 0 1px 3px -1px rgba(0, 0, 0, 0.45)\n}\n\n.apexcharts-xaxistooltip {\n padding: 4px 8px;\n transition: .15s ease all\n}\n\n.apexcharts-xaxistooltip:after,\n.apexcharts-xaxistooltip:before {\n left: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none\n}\n\n/* :before paints the 1px border outline of the triangle (slightly larger\n * than :after); :after sits inside and paints the fill \u2014 leaves a 1px\n * ring of :before visible at the edges. */\n.apexcharts-xaxistooltip:after {\n border-color: transparent;\n border-width: 5px;\n margin-left: -5px\n}\n\n.apexcharts-xaxistooltip:before {\n border-color: transparent;\n border-width: 6px;\n margin-left: -6px\n}\n\n.apexcharts-xaxistooltip-bottom:after,\n.apexcharts-xaxistooltip-bottom:before {\n bottom: 100%\n}\n\n.apexcharts-xaxistooltip-top:after,\n.apexcharts-xaxistooltip-top:before {\n top: 100%\n}\n\n.apexcharts-xaxistooltip-bottom:after {\n border-bottom-color: var(--apx-axt-bg)\n}\n\n.apexcharts-xaxistooltip-bottom:before {\n border-bottom-color: var(--apx-axt-border)\n}\n\n.apexcharts-xaxistooltip-top:after {\n border-top-color: var(--apx-axt-bg)\n}\n\n.apexcharts-xaxistooltip-top:before {\n border-top-color: var(--apx-axt-border)\n}\n\n.apexcharts-xaxistooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-yaxistooltip {\n padding: 3px 8px\n}\n\n.apexcharts-yaxistooltip:after,\n.apexcharts-yaxistooltip:before {\n top: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none\n}\n\n.apexcharts-yaxistooltip:after {\n border-color: transparent;\n border-width: 5px;\n margin-top: -5px\n}\n\n.apexcharts-yaxistooltip:before {\n border-color: transparent;\n border-width: 6px;\n margin-top: -6px\n}\n\n.apexcharts-yaxistooltip-left:after,\n.apexcharts-yaxistooltip-left:before {\n left: 100%\n}\n\n.apexcharts-yaxistooltip-right:after,\n.apexcharts-yaxistooltip-right:before {\n right: 100%\n}\n\n.apexcharts-yaxistooltip-left:after {\n border-left-color: var(--apx-axt-bg)\n}\n\n.apexcharts-yaxistooltip-left:before {\n border-left-color: var(--apx-axt-border)\n}\n\n.apexcharts-yaxistooltip-right:after {\n border-right-color: var(--apx-axt-bg)\n}\n\n.apexcharts-yaxistooltip-right:before {\n border-right-color: var(--apx-axt-border)\n}\n\n.apexcharts-yaxistooltip.apexcharts-active {\n opacity: 1\n}\n\n.apexcharts-yaxistooltip-hidden {\n display: none\n}\n\n.apexcharts-xcrosshairs,\n.apexcharts-ycrosshairs {\n pointer-events: none;\n opacity: 0;\n transition: .15s ease all\n}\n\n.apexcharts-xcrosshairs.apexcharts-active,\n.apexcharts-ycrosshairs.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-ycrosshairs-hidden {\n opacity: 0\n}\n\n.apexcharts-selection-rect {\n cursor: move\n}\n\n.svg_select_shape {\n stroke-width: 1;\n stroke-dasharray: 10 10;\n stroke: black;\n stroke-opacity: 0.1;\n pointer-events: none;\n fill: none;\n}\n\n.svg_select_handle {\n stroke-width: 3;\n stroke: black;\n fill: none;\n}\n\n.svg_select_handle_r {\n cursor: e-resize;\n}\n\n.svg_select_handle_l {\n cursor: w-resize;\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-zoom {\n cursor: crosshair\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-pan {\n cursor: move\n}\n\n.apexcharts-menu-icon,\n.apexcharts-pan-icon,\n.apexcharts-reset-icon,\n.apexcharts-selection-icon,\n.apexcharts-toolbar-custom-icon,\n.apexcharts-zoom-icon,\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n cursor: pointer;\n /* WCAG 2.5.8 Target Size (Minimum): 24\xd724 CSS px hit target. */\n width: 26px;\n height: 24px;\n line-height: 24px;\n color: #6e8192;\n text-align: center;\n /* Reset native <button> chrome \u2014 these are styled via SVG icons. */\n padding: 0;\n margin: 0;\n background: transparent;\n border: 0;\n border-radius: 5px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: background-color .12s ease, color .12s ease;\n}\n\n.apexcharts-menu-icon svg,\n.apexcharts-pan-icon svg,\n.apexcharts-reset-icon svg,\n.apexcharts-selection-icon svg,\n.apexcharts-zoom-icon svg,\n.apexcharts-zoomin-icon svg,\n.apexcharts-zoomout-icon svg {\n width: 18px;\n height: 18px;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon,\n.apexcharts-theme-dark .apexcharts-pan-icon,\n.apexcharts-theme-dark .apexcharts-reset-icon,\n.apexcharts-theme-dark .apexcharts-selection-icon,\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon,\n.apexcharts-theme-dark .apexcharts-zoom-icon,\n.apexcharts-theme-dark .apexcharts-zoomin-icon,\n.apexcharts-theme-dark .apexcharts-zoomout-icon {\n color: #d4d6dc\n}\n\n.apexcharts-canvas .apexcharts-pan-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected {\n background: rgba(0, 143, 251, 0.12);\n color: #008ffb\n}\n\n.apexcharts-theme-light .apexcharts-menu-icon:hover,\n.apexcharts-theme-light .apexcharts-pan-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-reset-icon:hover,\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover,\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover {\n background: rgba(15, 23, 42, 0.06);\n color: #1f2937\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon:hover,\n.apexcharts-theme-dark .apexcharts-pan-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-reset-icon:hover,\n.apexcharts-theme-dark .apexcharts-selection-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-zoom-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-zoomin-icon:hover,\n.apexcharts-theme-dark .apexcharts-zoomout-icon:hover {\n background: rgba(255, 255, 255, 0.08);\n color: #fff\n}\n\n.apexcharts-menu-icon,\n.apexcharts-selection-icon {\n position: relative\n}\n\n.apexcharts-toolbar {\n position: absolute;\n z-index: 11;\n display: inline-flex;\n align-items: center;\n gap: 1px;\n padding: 3px;\n border-radius: 8px;\n background: rgba(255, 255, 255, 0.85);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n}\n\n.apexcharts-theme-dark .apexcharts-toolbar {\n background: rgba(28, 28, 31, 0.82);\n}\n\n.apexcharts-menu {\n background: rgba(255, 255, 255, 0.95);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n position: absolute;\n top: calc(100% + 4px);\n border: 1px solid rgba(15, 23, 42, 0.08);\n border-radius: 8px;\n padding: 4px;\n right: 0;\n opacity: 0;\n min-width: 120px;\n transition: opacity .15s ease, transform .15s ease;\n transform: translateY(-2px);\n pointer-events: none;\n box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.12), 0 2px 4px -1px rgba(15, 23, 42, 0.06)\n}\n\n.apexcharts-menu.apexcharts-menu-open {\n opacity: 1;\n transform: translateY(0);\n pointer-events: all\n}\n\n.apexcharts-menu-item {\n padding: 6px 9px;\n font-size: 12px;\n border-radius: 5px;\n cursor: pointer\n}\n\n.apexcharts-theme-light .apexcharts-menu-item:hover {\n background: rgba(15, 23, 42, 0.06)\n}\n\n.apexcharts-theme-dark .apexcharts-menu {\n background: rgba(28, 28, 31, 0.92);\n border-color: rgba(255, 255, 255, 0.08);\n color: #f3f4f6;\n box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4)\n}\n\n.apexcharts-theme-dark .apexcharts-menu-item:hover {\n background: rgba(255, 255, 255, 0.08)\n}\n\n@media screen and (min-width:768px) {\n .apexcharts-canvas:hover .apexcharts-toolbar {\n opacity: 1\n }\n}\n\n/* Toolbar keyboard accessibility: show toolbar when any button inside it is focused */\n.apexcharts-toolbar:focus-within {\n opacity: 1\n}\n\n/* Focus indicator for toolbar icon buttons */\n.apexcharts-menu-icon:focus-visible,\n.apexcharts-pan-icon:focus-visible,\n.apexcharts-reset-icon:focus-visible,\n.apexcharts-selection-icon:focus-visible,\n.apexcharts-toolbar-custom-icon:focus-visible,\n.apexcharts-zoom-icon:focus-visible,\n.apexcharts-zoomin-icon:focus-visible,\n.apexcharts-zoomout-icon:focus-visible {\n outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n outline-offset: 1px;\n border-radius: 5px\n}\n\n/* Focus indicator for hamburger menu items */\n.apexcharts-menu-item:focus-visible {\n outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n outline-offset: -2px;\n background: #eee\n}\n\n.apexcharts-canvas .apexcharts-element-hidden,\n.apexcharts-datalabel.apexcharts-element-hidden,\n.apexcharts-hide .apexcharts-series-points {\n opacity: 0;\n}\n\n.apexcharts-hidden-element-shown {\n opacity: 1;\n transition: 0.25s ease all;\n}\n\n.apexcharts-datalabel,\n.apexcharts-datalabel-label,\n.apexcharts-datalabel-value,\n.apexcharts-datalabels,\n.apexcharts-pie-label,\n.apexcharts-pie-name-label,\n.apexcharts-pie-name-label-group,\n.apexcharts-pie-label-connector {\n cursor: default;\n pointer-events: none\n}\n\n.apexcharts-pie-label-connector {\n fill: none\n}\n\n.apexcharts-pie-label-delay {\n opacity: 0;\n animation-name: opaque;\n animation-duration: .3s;\n animation-fill-mode: forwards;\n animation-timing-function: ease\n}\n\n.apexcharts-radialbar-label {\n cursor: pointer;\n}\n\n.apexcharts-annotation-rect,\n.apexcharts-area-series .apexcharts-area,\n.apexcharts-gridline,\n.apexcharts-line,\n.apexcharts-point-annotation-label,\n.apexcharts-radar-series path:not(.apexcharts-marker),\n.apexcharts-radar-series polygon,\n.apexcharts-toolbar svg,\n.apexcharts-tooltip .apexcharts-marker,\n.apexcharts-xaxis-annotation-label,\n.apexcharts-yaxis-annotation-label,\n.apexcharts-zoom-rect,\n.no-pointer-events {\n pointer-events: none\n}\n\n.apexcharts-tooltip-active .apexcharts-marker {\n transition: .15s ease all\n}\n\n.apexcharts-radar-series .apexcharts-yaxis {\n pointer-events: none;\n}\n\n.resize-triggers {\n animation: 1ms resizeanim;\n visibility: hidden;\n opacity: 0;\n height: 100%;\n width: 100%;\n overflow: hidden\n}\n\n.contract-trigger:before,\n.resize-triggers,\n.resize-triggers>div {\n content: " ";\n display: block;\n position: absolute;\n top: 0;\n left: 0\n}\n\n.resize-triggers>div {\n height: 100%;\n width: 100%;\n background: #eee;\n overflow: auto\n}\n\n.contract-trigger:before {\n overflow: hidden;\n width: 200%;\n height: 200%\n}\n\n.apexcharts-bar-goals-markers {\n pointer-events: none\n}\n\n.apexcharts-bar-shadows {\n pointer-events: none\n}\n\n.apexcharts-rangebar-goals-markers {\n pointer-events: none\n}\n\n.apexcharts-drilldown-target {\n cursor: pointer\n}\n\n.apexcharts-breadcrumb {\n position: absolute;\n z-index: 11;\n display: inline-flex;\n align-items: center;\n gap: 2px;\n font-size: 12px;\n font-family: inherit;\n padding: 2px 4px\n}\n\n.apexcharts-breadcrumb-item {\n background: transparent;\n border: none;\n padding: 2px 6px;\n border-radius: 3px;\n font: inherit;\n color: inherit;\n cursor: pointer;\n line-height: 1.2\n}\n\n.apexcharts-breadcrumb-item:hover:not(.apexcharts-breadcrumb-current) {\n background: rgba(0, 0, 0, 0.08)\n}\n\n.apexcharts-breadcrumb-arrow {\n margin-right: 4px;\n font-weight: 600;\n user-select: none\n}\n\n.apexcharts-breadcrumb-current {\n cursor: default;\n font-weight: 600;\n opacity: 0.85\n}\n\n.apexcharts-breadcrumb-separator {\n opacity: 0.5;\n user-select: none\n}\n\n.apexcharts-theme-dark .apexcharts-breadcrumb-item:hover:not(.apexcharts-breadcrumb-current) {\n background: rgba(255, 255, 255, 0.12)\n}\n\n.apexcharts-disable-transitions * {\n transition: none !important;\n}';const r=(null==(s=this.opts.chart)?void 0:s.nonce)||this.w.config.chart.nonce;r&&a.setAttribute("nonce",r),e?t.prepend(a):!1!==this.w.config.chart.injectStyleSheet&&i.head.appendChild(a)}}const a=this.create(this.w.config.series,{});if(!a)return t(this);this.mount(a).then(()=>{"function"==typeof this.w.config.chart.events.mounted&&this.w.config.chart.events.mounted(this,this.w),this.events.fireEvent("mounted",[this,this.w]),t(a)}).catch(t=>{var s,i;const a=t instanceof Error?t:new Error(String(t)),r=a;r.chartId=null==(i=null==(s=this.w)?void 0:s.globals)?void 0:i.chartID,r.el=this.el,e(a)})}else e(new Error("Element not found"))});return this._renderPromise=s,s.catch(()=>{this._renderPromise===s&&(this._renderPromise=null)}),s}create(t,e){var s,i,a,r,o,n;const l=this.w;if(!this.core){new ms(this).initModules()}const h=this.w.globals;if(h.noData=!1,h.animationEnded=!1,!b.elementExists(this.el))return h.animationEnded=!0,null;if(this.responsive.checkResponsiveConfig(e),lt(l),l.config.xaxis.convertedCatToNumeric){new C(l.config).convertCatToNumericXaxis(l.config,this.ctx)}if(this.core.setupElements(),"treemap"===l.config.chart.type&&(l.config.grid.show=!1,l.config.yaxis[0].show=!1),0===h.svgWidth)return h.animationEnded=!0,null;let d=t;t.forEach((t,e)=>{t.hidden&&(d=this.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:e}))});const g=P.checkComboSeries(d,l.config.chart.type);h.comboCharts=g.comboCharts,h.comboBarCount=g.comboBarCount;const p=d.every(t=>t.data&&0===t.data.length);(0===d.length||p&&h.collapsedSeries.length<1)&&this.series.handleNoData(),c.isBrowser()&&this.events.setupEventHandlers();const u=this.data.parseData(d);this._writeParsedSeriesData(u.seriesData),this._writeParsedRangeData(u.rangeData),this._writeParsedCandleData(u.candleData),this._writeParsedLabelData(u.labelData),this._writeParsedAxisFlags(u.axisFlags),null==(s=this.rendererController)||s.resolve(),null==(i=this.weave)||i.dispatch("afterParse"),this.theme.init();new mt(this.w,this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),h.noData&&h.collapsedSeries.length!==l.seriesData.series.length&&!l.config.legend.showForSingleSeries||null==(a=this.legend)||a.init(),this.series.hasAllSeriesEqualX(),h.axisCharts&&(this.core.coreCalculations(),"category"!==l.config.xaxis.type&&this.formatters.setLabelFormatters(),this.ctx.toolbar&&(this.ctx.toolbar.minX=l.globals.minX,this.ctx.toolbar.maxX=l.globals.maxX)),this.formatters.heatmapLabelFormatters();new P(this.w).getLargestMarkerSize();const x=this.dimensions.plotCoords();this._writeLayoutCoords(x.layout);const f=this.core.xySettings();null==(r=this.weave)||r.dispatch("afterScales",{xyRatios:f}),this.grid.createGridMask();const m=this.core.plotChartType(d,f),y=new yt(this.w,this);y.bringForward(),l.config.dataLabels.background.enabled&&y.dataLabelsBackground(),this.core.shiftGraphPosition(),null==(n=null==(o=this.legend)?void 0:o.heatmapGradientLegend)||n.repositionToPlot(),l.globals.dataPoints>50&&l.dom.elWrap.classList.add("apexcharts-disable-transitions");return{elGraph:m,xyRatios:f,dimensions:{plot:{left:l.layout.translateX,top:l.layout.translateY,width:l.layout.gridWidth,height:l.layout.gridHeight}}}}mount(t=null){const e=this,s=e.w;return new Promise((i,a)=>{var r,o,n,l,h,d,g,p,u,x;if(null===e.el)return a(new Error("Not enough data to display or target element not found"));(null===t||s.globals.allSeriesCollapsed)&&e.series.handleNoData(),e.grid=new Ct(e.w,e);const f=e.grid.drawGrid(),m=ms._featureRegistry.get("annotations");if(e.annotations=m?new m(e.w,{theme:e.theme,timeScale:e.timeScale}):null,null==(r=e.annotations)||r.drawImageAnnos(),null==(o=e.annotations)||o.drawTextAnnos(),"back"===s.config.grid.position&&(f&&s.dom.elGraphical.add(f.el),(null==(n=null==f?void 0:f.elGridBorders)?void 0:n.node)&&s.dom.elGraphical.add(f.elGridBorders)),Array.isArray(t.elGraph))for(let e=0;e<t.elGraph.length;e++)s.dom.elGraphical.add(t.elGraph[e]);else s.dom.elGraphical.add(t.elGraph);"front"===s.config.grid.position&&(f&&s.dom.elGraphical.add(f.el),(null==(l=null==f?void 0:f.elGridBorders)?void 0:l.node)&&s.dom.elGraphical.add(f.elGridBorders)),"front"===s.config.xaxis.crosshairs.position&&e.crosshairs.drawXCrosshairs(),"front"===s.config.yaxis[0].crosshairs.position&&e.crosshairs.drawYCrosshairs(),"treemap"!==s.config.chart.type&&e.axes.drawAxis(s.config.chart.type,f);const b=new At(this.w,this.ctx,f),y=new _t(this.w,{theme:this.theme,timeScale:this.timeScale},f);if(null!==f&&(b.xAxisLabelCorrections(),y.setYAxisTextAlignments(),s.config.yaxis.map((t,e)=>{-1===s.globals.ignoreYAxisIndexes.indexOf(e)&&y.yAxisTitleRotate(e,t.opposite)})),null==(h=e.annotations)||h.drawAxesAnnotations(),!s.globals.noData){if(c.isBrowser()&&s.config.tooltip.enabled&&!s.globals.noData&&(null==(d=e.w.globals.tooltip)||d.drawTooltip(t.xyRatios)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.config.chart.accessibility.keyboard.navigation.enabled&&(null==(g=e.keyboardNavigation)||g.init()),c.isBrowser()&&s.globals.axisCharts&&(s.axisFlags.isXNumeric||s.config.xaxis.convertedCatToNumeric||s.axisFlags.isRangeBar))(s.config.chart.zoom.enabled||s.config.chart.selection&&s.config.chart.selection.enabled||s.config.chart.pan&&s.config.chart.pan.enabled)&&(null==(p=e.zoomPanSelection)||p.init({xyRatios:t.xyRatios}));else{const t=s.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(e=>{t[e]=!1})}s.config.chart.toolbar.show&&!s.globals.allSeriesCollapsed&&(null==(u=e.toolbar)||u.createToolbar())}null==(x=e.weave)||x.dispatch("draw",{pass:"full",xyRatios:null==t?void 0:t.xyRatios}),s.globals.memory.methodsToExec.length>0&&s.globals.memory.methodsToExec.forEach(t=>{t.method(t.params,!1,t.context)}),s.globals.axisCharts||s.globals.noData||e.core.resizeNonAxisCharts(),i(e)})}destroy(){var t;this._renderPromise=null,c.isBrowser()&&(window.removeEventListener("resize",this.windowResizeHandler),function(t,e){if(c.isSSR())return;const s=vs.get(e);s&&(s.disconnect(),vs.delete(e))}(this.el.parentNode,this.parentResizeHandler),clearTimeout(null!=(t=this.w.globals.resizeTimer)?t:void 0));const e=this.w.config.chart.id;e&&Array.isArray(Apex._chartInstances)&&Apex._chartInstances.forEach((t,s)=>{t.id===b.escapeString(e)&&Apex._chartInstances.splice(s,1)}),this._keyboardNavigation&&this._keyboardNavigation.destroy(),new bs(this.ctx).clear({isUpdating:!1})}updateOptions(t,e=!1,s=!0,i=!0,a=!0){const r=this.w;if(r.interact.selection=void 0,this.lastUpdateOptions){if(b.shallowEqual(this.lastUpdateOptions,t))return Promise.resolve(this);if(t.series&&this.lastUpdateOptions.series&&JSON.stringify(this.lastUpdateOptions.series)===JSON.stringify(t.series)){const e=n({},t),s=n({},this.lastUpdateOptions);if(delete e.series,delete s.series,b.shallowEqual(e,s))return Promise.resolve(this)}}return t.series&&(this.data.resetParsingFlags(),this.series.resetSeries(!1,!0,!1),t.series.length&&t.series[0].data&&(t.series=t.series.map((t,e)=>this.updateHelpers._extendSeries(t,e))),this.updateHelpers.revertDefaultAxisMinMax()),t.xaxis&&(t=this.updateHelpers.forceXAxisUpdate(t)),t.yaxis&&(t=this.updateHelpers.forceYAxisUpdate(t)),r.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),t.theme&&(t=this.theme.updateThemeOptions(t)),this.updateHelpers._updateOptions(t,e,s,i,a)}updateSeries(t=[],e=!0,s=!0){return this.data.resetParsingFlags(),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(t,e,s)}appendSeries(t,e=!0,s=!0){this.data.resetParsingFlags();const i=this.w.config.series.slice();return i.push(t),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(i,e,s)}appendData(t,e=!0){const s=this;s.data.resetParsingFlags(),s.w.globals.dataChanged=!0,s.series.getPreviousPaths();const i=s.w.config.series.slice();for(let e=0;e<i.length;e++)if(null!==t[e]&&void 0!==t[e]){const s=t[e],a=i[e];for(let t=0;t<s.data.length;t++)a.data.push(s.data[t])}return function(t,e){const s=e.config.chart.streaming;if(!s||!s.enabled)return;const i=s.maxPoints,a=e.config.xaxis.range,r=t=>null==t?null:Array.isArray(t)?"number"==typeof t[0]?t[0]:null:"object"==typeof t&&"number"==typeof t.x?t.x:null;t.forEach(t=>{var e;const s=null==t?void 0:t.data;if(!Array.isArray(s)||s.length<2)return;if("number"==typeof i&&i>0)return void(s.length>i&&(t.data=s.slice(s.length-i)));if(!a)return;const o=r(s[s.length-1]),n=r(s[0]);if(null==o||null==n||o<=n)return;const l=(o-n)/(s.length-1),h=o-a-2*l;let c=0;for(;c<s.length&&(null!=(e=r(s[c]))?e:h)<h;)c++;c>0&&(t.data=s.slice(c))})}(i,s.w),s.w.config.series=i,e&&(s.w.globals.initialSeries=b.clone(s.w.config.series)),this.update()}update(t){return new Promise((e,s)=>{if(this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(t))return e(this);this.lastUpdateOptions=b.clone(t),new bs(this.ctx).clear({isUpdating:!0});const i=this.create(this.w.config.series,null!=t?t:{});if(!i)return e(this);this.mount(i).then(()=>{var t;null==(t=this.morphTypeChange)||t.applyChromeFade(),function(t){const e=t.globals,s=e.prevChromeFrame;if(e.prevChromeFrame=null,!s||!e.axisCharts||!c.isBrowser())return;if(!Ot(t))return;if(!(t.seriesData.series||[]).some((e,s)=>null!==$t(t,s,!0)))return;const i=t.dom.baseEl;if(!b.elementExists(i))return;const a=Math.max(1,t.config.chart.animations.dynamicAnimation.speed||1),r=jt(t);try{const e=[...i.querySelectorAll(te)],o=function(t,e){if(!t||!e)return null;const s=t.max-t.min,i=e.max-e.min;return s>0&&i>0&&t.width>0&&e.width>0?{toNew:a=>(t.min+a/t.width*s-e.min)/i*e.width,toOld:a=>(e.min+a/e.width*i-t.min)/s*t.width}:null}(s.xScale,ie(t)),n=re(s.yAnchors,ae(t,e.map(t=>({pos:parseFloat(t.getAttribute("y")||"")}))));he(t,{newLabels:[...i.querySelectorAll(Qt)],oldLabels:s.xLabels,posAttr:"x",newLines:[...i.querySelectorAll(ee)],oldLines:s.vGrid,lineAttrs:["x1","x2"],duration:a,ease:r,project:o}),he(t,{newLabels:e,oldLabels:s.yLabels,posAttr:"y",newLines:[...i.querySelectorAll(se)],oldLines:s.hGrid,lineAttrs:["y1","y2"],duration:a,ease:r,project:n})}catch(t){}}(this.w),"function"==typeof this.w.config.chart.events.updated&&this.w.config.chart.events.updated(this,this.w),this.events.fireEvent("updated",[this,this.w]),this.w.globals.isDirty=!0,e(this)}).catch(t=>{s(t)})})}fastUpdate(t,e){return new Promise((s,i)=>{var a,r,o;try{const n=this.w,l=n.globals;l.shouldAnimate=t,l.dataChanged=!0,l.animationEnded=!1,wt.invalidateSelectors(n);const h=n.globals;h.maxY=-Number.MAX_VALUE,h.minY=Number.MIN_VALUE,h.minYArr=[],h.maxYArr=[],h.maxX=-Number.MAX_VALUE,h.minX=Number.MAX_VALUE,h.initialMaxX=-Number.MAX_VALUE,h.initialMinX=Number.MAX_VALUE,h.yAxisScale=[],h.xAxisScale=null,h.xAxisTicksPositions=[],h.xRange=0,h.yRange=[],h.zRange=0,h.xTickAmount=0,h.multiAxisTickAmount=0,h.pointsArray=[],h.barCanvasCoords=null,h.dataLabelsRects=[],h.lastDrawnDataLabelsIndexes=[],h.textRectsCache=new Map,h.domCache=new Map,h.cachedSelectors={},h.disableZoomIn=!1,h.disableZoomOut=!1,l.axisCharts&&(this.core.coreCalculations(),"category"!==n.config.xaxis.type&&this.formatters.setLabelFormatters());const d=this.core.xySettings(),g=JSON.stringify({y:(l.yAxisScale||[]).map(t=>t?t.result:null),xMin:l.minX,xMax:l.maxX});if(l.axisCharts&&null!=e&&g!==e)return this.update().then(()=>s(this)).catch(i);null==(a=this.weave)||a.dispatch("afterScales",{pass:"fast",xyRatios:d});const p=n.dom.elGraphical.node;p.querySelectorAll(".apexcharts-canvas-series-wrap, .apexcharts-series, .apexcharts-datalabels, .apexcharts-datalabels-background").forEach(t=>{var e;return null==(e=t.parentNode)?void 0:e.removeChild(t)});const u=this.core.plotChartType(n.config.series,d),x=p.querySelector(".apexcharts-grid"),f=Array.isArray(u)?u:[u];x&&"front"===n.config.grid.position?f.forEach(t=>{const e=t&&t.node?t.node:t;e&&p.insertBefore(e,x)}):f.forEach(t=>{n.dom.elGraphical.add(t)});const m=new yt(n,this);m.bringForward(),n.config.dataLabels.background.enabled&&m.dataLabelsBackground(),c.isBrowser()&&n.config.tooltip.enabled&&!l.noData&&(null==(r=n.globals.tooltip)||r.drawTooltip(d)),null==(o=this.weave)||o.dispatch("draw",{pass:"fast",xyRatios:d}),"function"==typeof n.config.chart.events.updated&&n.config.chart.events.updated(this,n),this.events.fireEvent("updated",[this,n]),l.isDirty=!0,s(this)}catch(t){i(t)}})}getSyncedCharts(){const t=this.getGroupedCharts();return t.splice(0,0,this),t}getGroupedCharts(){return Apex._chartInstances.filter(t=>this!==t.chart&&!!this.w.config.chart.group&&this.w.config.chart.group===t.group).map(t=>t.chart)}static getChartByID(t){const e=b.escapeString(t);if(!Apex._chartInstances)return;const s=Apex._chartInstances.filter(t=>t.id===e)[0];return s&&s.chart}static initOnLoad(){var e;const s=document.querySelectorAll("[data-apexcharts]");for(let i=0;i<s.length;i++){const a=s[i],r=JSON.parse(null!=(e=s[i].getAttribute("data-options"))?e:"");new t(a,r).render()}}static exec(t,e,...s){const i=this.getChartByID(t);if(!i)return;i.w.globals.isExecCalled=!0;let a=null;return-1!==i.publicMethods.indexOf(e)&&(a=i[e](...s)),a}static merge(t,e){return b.extend(t,e)}static getThemePalettes(){return{palette1:["#008FFB","#00A86F","#CA8501","#FF4560","#846DD5"],palette2:["#6978CB","#039DE2","#49A84D","#B39105","#D68000"],palette3:["#209FCC","#648291","#D4526E","#0FA783","#A19285"],palette4:["#2FA59D","#73A20B","#099DE1","#FD5D5D","#648291"],palette5:["#2B908F","#F56566","#2EAB16","#FA4443","#1EA2BD"],palette6:["#449DD1","#F86624","#EA3A4A","#9C63D1","#899E2A"],palette7:["#DF475B","#1B998B","#7E75B7","#F46036","#B1911B"],palette8:["#9C63D1","#F86624","#B38F04","#EA3A4A","#2FA2B3"],palette9:["#98776F","#A19285","#A8705E","#BA6560","#A0927F"],palette10:["#C91EFF","#A94BFD","#6C6AFE","#2983FF","#009ED8"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]}}static use(t){Ye(t)}static registerFeatures(t){ms.registerFeatures(t)}static registerPlugin(e){return function(t){t&&"string"==typeof t.name&&"function"==typeof t.setup&&(ws()[t.name]=t)}(e),t}static unregisterPlugin(e){return function(t){delete ws()[t]}(e),t}static registerRenderer(t,e){es.registerRenderer(t,e)}static registerSeriesType(e,s){const i=t._customSeriesFactory;return i&&s&&"function"==typeof s.renderItem?(a=e,Re()[a]&&!Be(e)||(Ye({[e]:i(e,s)}),function(t){ze().add(t)}(e)),t):t;var a}static unregisterSeriesType(e){return Be(e)&&function(t){delete Re()[t],ze().delete(t)}(e),t}static registerTheme(e,s){return function(t,e){t&&"string"==typeof t&&(null==e||"object"==typeof e&&!Array.isArray(e))&&(pe()[t]=e||{})}(e,s),t}static unregisterTheme(e){return function(t){t&&delete pe()[t]}(e),t}static registerEasing(e,s){return function(t,e){"string"==typeof t&&t&&"function"==typeof e&&et.set(t,e)}(e,s),t}static crossfilter(e){const s=t._crossfilterFactory;return s?s(e):null}static getCrossfilter(e){const s=t._crossfilterGet;return s?s(e):null}clearCrossfilter(){var t;null==(t=this.linkedViews)||t.clearGroup()}startMeasure(){var t;null==(t=this.measure)||t.startMeasure()}stopMeasure(){var t;null==(t=this.measure)||t.stopMeasure()}clearMeasures(){var t;null==(t=this.measure)||t.clearMeasures()}toggleSeries(t){return this.series.toggleSeries(t)}highlightSeriesOnLegendHover(t,e){return this.series.toggleSeriesOnHover(t,e)}showSeries(t){this.series.showSeries(t)}hideSeries(t){this.series.hideSeries(t)}highlightSeries(t){this.series.highlightSeries(t)}isSeriesHidden(t){return this.series.isSeriesHidden(t)}resetSeries(t=!0,e=!0){this.series.resetSeries(t,e)}addEventListener(t,e){this.events.addEventListener(t,e)}removeEventListener(t,e){this.events.removeEventListener(t,e)}addXaxisAnnotation(t,e=!0,s=void 0){var i;let a=this;s&&(a=s),null==(i=a.annotations)||i.addXaxisAnnotationExternal(t,e,a)}addYaxisAnnotation(t,e=!0,s=void 0){var i;let a=this;s&&(a=s),null==(i=a.annotations)||i.addYaxisAnnotationExternal(t,e,a)}addPointAnnotation(t,e=!0,s=void 0){var i;let a=this;s&&(a=s),null==(i=a.annotations)||i.addPointAnnotationExternal(t,e,a)}clearAnnotations(t=void 0){var e;let s=this;t&&(s=t),s.lastUpdateOptions=null,null==(e=s.annotations)||e.clearAnnotations(s)}removeAnnotation(t,e=void 0){var s;let i=this;e&&(i=e),i.lastUpdateOptions=null,null==(s=i.annotations)||s.removeAnnotation(i,t)}getChartArea(){return this.w.dom.baseEl.querySelector(".apexcharts-inner")}getSeriesTotalXRange(t,e){return this.coreUtils.getSeriesTotalsXRange(t,e)}getHighestValueInSeries(t=0){return new kt(this.w).getMinYMaxY(t).highestY}getLowestValueInSeries(t=0){return new kt(this.w).getMinYMaxY(t).lowestY}getSeriesTotal(){return this.w.globals.seriesTotals}getState(){const t=this.w,e=t.globals;return{series:t.seriesData.series,seriesNames:t.seriesData.seriesNames,colors:e.colors,labels:t.labelData.labels,seriesTotals:e.seriesTotals,seriesPercent:e.seriesPercent,seriesXvalues:e.seriesXvalues,seriesYvalues:e.seriesYvalues,minX:e.minX,maxX:e.maxX,minY:e.minY,maxY:e.maxY,minYArr:e.minYArr,maxYArr:e.maxYArr,minXDiff:e.minXDiff,dataPoints:e.dataPoints,xAxisScale:e.xAxisScale,yAxisScale:e.yAxisScale,xTickAmount:e.xTickAmount,isXNumeric:t.axisFlags.isXNumeric,seriesYAxisMap:e.seriesYAxisMap,seriesYAxisReverseMap:e.seriesYAxisReverseMap,svgWidth:e.svgWidth,svgHeight:e.svgHeight,gridWidth:t.layout.gridWidth,gridHeight:t.layout.gridHeight,selectedDataPoints:t.interact.selectedDataPoints,collapsedSeriesIndices:e.collapsedSeriesIndices,zoomed:t.interact.zoomed,seriesX:t.seriesData.seriesX,seriesZ:t.seriesData.seriesZ,seriesCandleO:t.candleData.seriesCandleO,seriesCandleH:t.candleData.seriesCandleH,seriesCandleM:t.candleData.seriesCandleM,seriesCandleL:t.candleData.seriesCandleL,seriesCandleC:t.candleData.seriesCandleC,seriesRangeStart:t.rangeData.seriesRangeStart,seriesRangeEnd:t.rangeData.seriesRangeEnd,seriesGoals:t.seriesData.seriesGoals}}toggleDataPointSelection(t,e){return this.updateHelpers.toggleDataPointSelection(t,e)}zoomX(t,e){var s;null==(s=this.ctx.toolbar)||s.zoomUpdateOptions(t,e)}setLocale(t){this.localization.setCurrentLocaleValues(t)}dataURI(t){if(!this.ctx.exports)throw new Error("apexcharts: Exports feature is not registered. Import apexcharts/features/exports.");return this.ctx.exports.dataURI(t)}getSvgString(t){if(!this.ctx.exports)throw new Error("apexcharts: Exports feature is not registered. Import apexcharts/features/exports.");return this.ctx.exports.getSvgString(t)}exportToCSV(t={}){if(!this.ctx.exports)throw new Error("apexcharts: Exports feature is not registered. Import apexcharts/features/exports.");return this.ctx.exports.exportToCSV(t)}paper(){return this.w.dom.Paper}getActiveRenderer(){return this.rendererController?this.rendererController.getActiveKind():"svg"}refreshTokens(){return this.lastUpdateOptions=null,this.update()}drillDown(t){if(!this.ctx.drilldown)throw new Error("apexcharts: Drilldown feature is not registered. Import apexcharts/features/drilldown.");return this.ctx.drilldown.drillDown(t)}drillUp(){if(!this.ctx.drilldown)throw new Error("apexcharts: Drilldown feature is not registered. Import apexcharts/features/drilldown.");return this.ctx.drilldown.drillUp()}drillToRoot(){if(!this.ctx.drilldown)throw new Error("apexcharts: Drilldown feature is not registered. Import apexcharts/features/drilldown.");return this.ctx.drilldown.drillToRoot()}_writeParsedSeriesData(t){Object.assign(this.w.seriesData,t)}_writeParsedRangeData(t){Object.assign(this.w.rangeData,t)}_writeParsedCandleData(t){Object.assign(this.w.candleData,t)}_writeParsedLabelData(t){Object.assign(this.w.labelData,t)}_writeParsedAxisFlags(t){Object.assign(this.w.axisFlags,t)}_writeLayoutCoords(t){Object.assign(this.w.layout,t)}_parentResizeCallback(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}_windowResize(){this.w.globals.resizeTimer=window.setTimeout(()=>{this.w.globals.resized=!0,this.w.globals.dataChanged=!1,this.ctx.update()},150)}_windowResizeHandler(){var t;clearTimeout(null!=(t=this.w.globals.resizeTimer)?t:void 0);let{redrawOnWindowResize:e}=this.w.config.chart;"function"==typeof e&&(e=e()),e&&this._windowResize()}};h(As,"perspectives",null);let Cs=As;const Ss=".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} ";class ks{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const s=parseFloat(t.getAttributeNS(null,"width")),i=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",s*e),t.setAttributeNS(null,"height",i*e),t.setAttributeNS(null,"viewBox","0 0 "+s+" "+i)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const s=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<s.length;t++){let i;try{i=e[t].toDataURL()}catch(t){continue}const a=s[t],r=document.createElementNS(F,"image");r.setAttribute("x",a.getAttribute("x")||"0"),r.setAttribute("y",a.getAttribute("y")||"0"),r.setAttribute("width",a.getAttribute("width")||"0"),r.setAttribute("height",a.getAttribute("height")||"0"),r.setAttribute("href",i),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i),a.parentNode&&a.parentNode.replaceChild(r,a)}}getSvgString(t){return new Promise(e=>{const s=this.w;let i=t||s.config.chart.toolbar.export.scale||s.config.chart.toolbar.export.width/s.globals.svgWidth;i||(i=1);const a=s.globals.svgWidth*i,r=s.globals.svgHeight*i,o=s.dom.elWrap.cloneNode(!0);o.style.width=a+"px",o.style.height=r+"px",this.inlineCanvasLayers(o);const n=(new XMLSerializer).serializeToString(o);let l="\n .apexcharts-tooltip, .apexcharts-toolbar, .apexcharts-xaxistooltip, .apexcharts-yaxistooltip, .apexcharts-xcrosshairs, .apexcharts-ycrosshairs, .apexcharts-zoom-rect, .apexcharts-selection-rect {\n display: none;\n }\n ";s.config.legend.show&&s.dom.elLegendWrap&&s.dom.elLegendWrap.children.length>0&&(l+=Ss);let h=`\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="${s.globals.svgWidth}px" height="${s.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${a}px; height:${r}px;">\n <style type="text/css">\n ${l}\n </style>\n ${n}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(h);1!==i&&this.scaleSvgNode(c,i),this.convertImagesToBase64(c).then(()=>{h=(new XMLSerializer).serializeToString(c),e(h.replace(/ /g," "))})})}convertImagesToBase64(t){const e=t.getElementsByTagName("image"),s=Array.from(e).map(t=>{const e=t.getAttributeNS("http://www.w3.org/1999/xlink","href");return e&&!e.startsWith("data:")?this.getBase64FromUrl(e).then(e=>{t.setAttributeNS("http://www.w3.org/1999/xlink","href",e)}).catch(t=>{}):Promise.resolve()});return Promise.all(s)}getBase64FromUrl(t){return c.isSSR()?Promise.resolve(t):new Promise((e,s)=>{const i=new Image;i.crossOrigin="Anonymous",i.onload=()=>{const t=document.createElement("canvas");t.width=i.width,t.height=i.height;const s=t.getContext("2d");s&&s.drawImage(i,0,0),e(t.toDataURL())},i.onerror=s,i.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const s=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(s))})})}dataURI(t){return c.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const s=this.w,i=t?t.scale||t.width/s.globals.svgWidth:1,a=document.createElement("canvas");a.width=s.globals.svgWidth*i,a.height=parseInt(s.dom.elWrap.style.height,10)*i;const r="transparent"!==s.config.chart.background&&s.config.chart.background?s.config.chart.background:"#fff",o=a.getContext("2d");o&&(o.fillStyle=r,o.fillRect(0,0,a.width*i,a.height*i),this.getSvgString(i).then(t=>{const s="data:image/svg+xml,"+encodeURIComponent(t),i=new Image;i.crossOrigin="anonymous",i.onload=()=>{o.drawImage(i,0,0);const t=a;if(t.msToBlob){const s=t.msToBlob();e({blob:s})}else{const t=a.toDataURL("image/png");e({imgURI:t})}},i.src=s}))})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,s=t?{scale:t}:e?{width:e}:void 0;this.dataURI(s).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:s=",",lineDelimiter:i="\n"}){const a=this.w;t||(t=a.config.series);let r=[];const o=[];let n="";const l=a.seriesData.series.map((t,e)=>-1===a.globals.collapsedSeriesIndices.indexOf(e)?t:[]),h=t=>"function"==typeof a.config.chart.toolbar.export.csv.categoryFormatter?a.config.chart.toolbar.export.csv.categoryFormatter(t):"datetime"===a.config.xaxis.type&&String(t).length>=10?new Date(t).toDateString():b.isNumber(t)?t:t.split(s).join(""),c=t=>"function"==typeof a.config.chart.toolbar.export.csv.valueFormatter?a.config.chart.toolbar.export.csv.valueFormatter(t):t,d=Math.max(...t.map(t=>t.data?t.data.length:0)),g=new He(this.w),p=new vt(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),u=t=>{let e="";if(a.globals.axisCharts){if("category"===a.config.xaxis.type||a.config.xaxis.convertedCatToNumeric)if(a.globals.isBarHorizontal){const s=a.formatters.yLabelFormatters[0],i=new ce(this.ctx.w).getActiveConfigSeriesIndex();e=s(a.labelData.labels[t],{seriesIndex:i,dataPointIndex:t,w:a})}else e=p.getLabel(a.labelData.labels,a.labelData.timescaleLabels,0,t).text;"datetime"===a.config.xaxis.type&&(a.config.xaxis.categories.length?e=a.config.xaxis.categories[t]:a.config.labels.length&&(e=a.config.labels[t]))}else e=a.config.labels[t];return null===e?"nullvalue":(Array.isArray(e)&&(e=e.join(" ")),b.isNumber(e)?e:e.split(s).join(""))},x=(e,i)=>{var n,p,x,f,m,b;if(r.length&&0===i&&o.push(r.join(s)),e.data){e.data=e.data.length&&e.data||[...Array(d)].map(()=>"");for(let d=0;d<e.data.length;d++){r=[];let y=u(d);if("nullvalue"!==y){if(y||(g.isFormatXY()?y=t[i].data[d].x:g.isFormat2DArray()&&(y=t[i].data[d]?t[i].data[d][0]:"")),0===i){r.push(h(y));for(let e=0;e<a.seriesData.series.length;e++){const s=g.isFormatXY()?null==(n=t[e].data[d])?void 0:n.y:l[e][d];r.push(c(s))}}("candlestick"===a.config.chart.type||e.type&&"candlestick"===e.type)&&(r.pop(),r.push(a.candleData.seriesCandleO[i][d]),r.push(a.candleData.seriesCandleH[i][d]),r.push(a.candleData.seriesCandleL[i][d]),r.push(a.candleData.seriesCandleC[i][d])),("boxPlot"===a.config.chart.type||e.type&&"boxPlot"===e.type)&&(r.pop(),r.push(a.candleData.seriesCandleO[i][d]),r.push(a.candleData.seriesCandleH[i][d]),r.push(a.candleData.seriesCandleM[i][d]),r.push(a.candleData.seriesCandleL[i][d]),r.push(a.candleData.seriesCandleC[i][d])),"rangeBar"===a.config.chart.type&&(r.pop(),r.push(a.rangeData.seriesRangeStart[i][d]),r.push(a.rangeData.seriesRangeEnd[i][d])),("violin"===a.config.chart.type||e.type&&"violin"===e.type)&&(r.pop(),r.push(null==(p=a.violinData.seriesViolinMin[i])?void 0:p[d]),r.push(null==(x=a.violinData.seriesViolinMax[i])?void 0:x[d]),r.push(null!=(b=null==(m=null==(f=a.violinData.seriesViolinPoints[i])?void 0:f[d])?void 0:m.length)?b:0)),r.length&&o.push(r.join(s))}}}};r.push(a.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===a.config.chart.type?(r.push("minimum"),r.push("q1"),r.push("median"),r.push("q3"),r.push("maximum")):"candlestick"===a.config.chart.type?(r.push("open"),r.push("high"),r.push("low"),r.push("close")):"rangeBar"===a.config.chart.type?(r.push("minimum"),r.push("maximum")):"violin"===a.config.chart.type?(r.push("minimum"),r.push("maximum"),r.push("observations")):t.map((t,e)=>{const i=(t.name?t.name:`series-${e}`)+"";a.globals.axisCharts&&r.push(i.split(s).join("")?i.split(s).join(""):`series-${e}`)}),a.globals.axisCharts||(r.push(a.config.chart.toolbar.export.csv.headerValue),o.push(r.join(s))),a.globals.allSeriesHasEqualX||!a.globals.axisCharts||a.config.xaxis.categories.length||a.config.labels.length?t.map((t,e)=>{a.globals.axisCharts?x(t,e):(r=[],r.push(h(a.labelData.labels[e])),r.push(c(l[e])),o.push(r.join(s)))}):(()=>{const e=new Set,i={};t.forEach((s,a)=>{null==s||s.data.forEach(s=>{let r,o;if(g.isFormatXY())r=s.x,o=s.y;else{if(!g.isFormat2DArray())return;r=s[0],o=s[1]}i[r]||(i[r]=Array(t.length).fill("")),i[r][a]=c(o),e.add(r)})}),r.length&&o.push(r.join(s)),Array.from(e).sort().forEach(t=>{o.push([h(t),i[t].join(s)])})})(),n+=o.join(i),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+n),e||a.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,s){if(c.isSSR())return;const i=document.createElement("a");i.href=t,i.download=(e||this.w.globals.chartID)+s,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}Cs.registerFeatures({exports:ks});let _s=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(c.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 s=document.createTextNode(Ss);return t.appendChild(s),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:s}=t.getBoundingClientRect();return{clwh:s,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 s,i,a;const r=this.w;if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let o=null,n=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(o=null!=(s=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?s:null,!o)return;n=parseInt(null!=(i=o.getAttribute("data:realIndex"))?i:"",10)}else{if(o=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!o)return;n=parseInt(null!=(a=o.getAttribute("rel"))?a:"",10)-1}if(e){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,s=t.csi;this.riseCollapsedSeries(e,s,n)})}else this.hideSeries({seriesEl:o,realIndex:n});if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const s=r.globals.collapsedSeriesIndices.includes(n)||r.globals.ancillaryCollapsedSeriesIndices.includes(n);e.setAttribute("aria-pressed",s?"true":"false");const i=e.querySelector(".apexcharts-legend-text"),a=i?i.textContent:r.seriesData.seriesNames[t],o=s?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${o}. Press Enter or Space to toggle.`)}}}else{const e=r.dom.Paper.findOne(` .apexcharts-series[rel='${t+1}'] path`),s=r.config.chart.type;if("pie"===s||"polarArea"===s||"donut"===s){const t=r.config.plotOptions.pie.donut.labels;new gt(this.w).pathMouseDown(e,null),this.lgCtx.printDataLabelsInner(e.node,t)}if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const s=r.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",s?"true":"false");const i=e.querySelector(".apexcharts-legend-text"),a=i?i.textContent:r.seriesData.seriesNames[t],o=s?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${o}. Press Enter or Space to toggle.`)}}}}getSeriesAfterCollapsing({realIndex:t}){var e;const s=this.w,i=s.globals,a=b.clone(s.config.series);if(i.axisCharts){const e=s.config.yaxis[i.seriesYAxisReverseMap[t]],r={index:t,data:a[t].data.slice(),type:a[t].type||s.config.chart.type};if(e&&e.show&&e.showAlways)i.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(i.ancillaryCollapsedSeries.push(r),i.ancillaryCollapsedSeriesIndices.push(t));else if(i.collapsedSeriesIndices.indexOf(t)<0){i.collapsedSeries.push(r),i.collapsedSeriesIndices.push(t);const e=i.risingSeries.indexOf(t);i.risingSeries.splice(e,1)}}else i.collapsedSeries.push({index:t,data:a[t],type:null!=(e=s.config.series[t].type)?e:"line"}),i.collapsedSeriesIndices.push(t);return i.allSeriesCollapsed=i.collapsedSeries.length+i.ancillaryCollapsedSeries.length===s.config.series.length,this._getSeriesBasedOnCollapsedState(a)}hideSeries({seriesEl:t,realIndex:e}){const s=this.w,i=this.getSeriesAfterCollapsing({realIndex:e}),a=t.childNodes;for(let t=0;t<a.length;t++)a[t].classList.contains("apexcharts-series-markers-wrap")&&(a[t].classList.contains("apexcharts-hide")?a[t].classList.remove("apexcharts-hide"):a[t].classList.add("apexcharts-hide"));this.lgCtx.updateSeries(i,s.config.chart.animations.dynamicAnimation.enabled)}riseCollapsedSeries(t,e,s){const i=this.w;let a=b.clone(i.config.series);if(t.length>0){for(let r=0;r<t.length;r++)t[r].index===s&&(i.globals.axisCharts?a[s].data=t[r].data.slice():a[s]=t[r].data,"number"!=typeof a[s]&&(a[s].hidden=!1),t.splice(r,1),e.splice(r,1),i.globals.risingSeries.push(s),r--);a=this._getSeriesBasedOnCollapsedState(a),this.lgCtx.updateSeries(a,i.config.chart.animations.dynamicAnimation.enabled)}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let s=0;return e.globals.axisCharts?t.forEach((i,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(a)<0||(t[a].data=[],s++)}):t.forEach((i,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0||(t[a]=0,s++)}),e.globals.allSeriesCollapsed=s===t.length,t}};const Ls="http://www.w3.org/2000/svg";class Ds{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._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.w.config.plotOptions.heatmap.colorScale.gradientLegend;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 isEnabled(t){var e,s,i,a;const r=null==(a=null==(i=null==(s=null==(e=null==t?void 0:t.config)?void 0:e.plotOptions)?void 0:s.heatmap)?void 0:i.colorScale)?void 0:a.gradientLegend;return!(!r||!r.enabled)}draw(){var t,e,s,i,a,r,o,n;const l=this.w,h=l.dom.elLegendWrap;if(!h)return;const c=l.config.plotOptions.heatmap.colorScale.gradientLegend,d=l.config.legend.position,g="left"===d||"right"===d,p=null!=(e=null==(t=c.arrow)?void 0:t.size)?e:8,u=p+4,x=c.showLabels?28:4,f=c.showLabels?20:4,b=c.showLabels?44:0,y=this._resolveStripLength(g?c.height:c.width,g),w=c.thickness,v=g?Math.max(w+u+4,b):y+2*x,A=g?y+2*f:w+u+4,C=(v-(w+u))/2,S=g?"left"===d?C:C+u:x,k=g?f:"top"===d?u:4,_=m.createElementNS(Ls,"svg");_.setAttribute("class","apexcharts-heatmap-gradient-legend"),_.setAttribute("width",String(v)),_.setAttribute("height",String(A)),_.setAttribute("overflow","visible");const L=m.createElementNS(Ls,"defs"),D=`apexcharts-heatmap-gradient-${l.globals.cuid}`,M=m.createElementNS(Ls,"linearGradient");M.setAttribute("id",D),g?(M.setAttribute("x1","0"),M.setAttribute("y1","1"),M.setAttribute("x2","0"),M.setAttribute("y2","0")):(M.setAttribute("x1","0"),M.setAttribute("y1","0"),M.setAttribute("x2","1"),M.setAttribute("y2","0"));const{min:E,max:P,stops:F,bands:T}=this._computeStops();this._min=E,this._max=P,F.forEach(t=>{const e=m.createElementNS(Ls,"stop");e.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),e.setAttribute("stop-color",t.color),M.appendChild(e)}),L.appendChild(M),_.appendChild(L);const I=m.createElementNS(Ls,"rect");if(I.setAttribute("x",String(S)),I.setAttribute("y",String(k)),I.setAttribute("width",String(g?w:y)),I.setAttribute("height",String(g?y:w)),I.setAttribute("rx","2"),I.setAttribute("fill",`url(#${D})`),_.appendChild(I),c.showLabels){const t=(null==(s=c.labelStyle)?void 0:s.colors)||(Array.isArray(l.config.legend.labels.colors)?l.config.legend.labels.colors[0]:l.config.legend.labels.colors)||l.config.chart.foreColor,e=(null==(i=c.labelStyle)?void 0:i.fontSize)||"11px",r=(null==(a=c.labelStyle)?void 0:a.fontFamily)||l.config.chart.fontFamily,o=this._getFormatter(),n=(s,i,a,o)=>{const n=m.createElementNS(Ls,"text");return n.setAttribute("x",String(i)),n.setAttribute("y",String(a)),n.setAttribute("text-anchor",o),n.setAttribute("dominant-baseline","middle"),n.setAttribute("fill",t),n.setAttribute("font-size",e),r&&n.setAttribute("font-family",r),n.textContent=String(s),n};if(g){const t=S+w/2;_.appendChild(n(o(E),t,k+y+10,"middle")),_.appendChild(n(o(P),t,k-10,"middle"))}else{const t=k+w/2;_.appendChild(n(o(E),S-6,t,"end")),_.appendChild(n(o(P),S+y+6,t,"start"))}}const X=(null==(r=c.arrow)?void 0:r.color)||l.config.chart.foreColor,R=this._buildArrow(p,X,d);if(_.appendChild(R),this.arrowEl=R,this._bandHitEls=[],l.config.legend.onItemHover.highlightDataSeries&&T.length>0&&T.forEach(t=>{const e=m.createElementNS(Ls,"rect");if(g){const s=k+y-t.p2*y,i=k+y-t.p1*y;e.setAttribute("x",String(S)),e.setAttribute("y",String(s)),e.setAttribute("width",String(w)),e.setAttribute("height",String(Math.max(0,i-s)))}else e.setAttribute("x",String(S+t.p1*y)),e.setAttribute("y",String(k)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*y))),e.setAttribute("height",String(w));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",_.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:g,position:d,stripX:S,stripY:k,stripLength:y,stripThickness:w,arrowSize:p,svgWidth:v,svgHeight:A},c.showHoverValue){const t=m.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(o=c.labelStyle)?void 0:o.fontSize)||"11px",t.style.fontFamily=(null==(n=c.labelStyle)?void 0:n.fontFamily)||l.config.chart.fontFamily||"",t.style.color=l.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-"+d),h.appendChild(_),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=_,this._applyWrapAlignment(h,d,g,v,A),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const s=this.w,i=e?s.globals.svgHeight||s.config.chart.height||300:s.globals.svgWidth||s.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,i*t/100)}const s=parseFloat(e);return Number.isFinite(s)?s:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,s,i,a){const r=this.w,o=r.config.plotOptions.heatmap.colorScale.gradientLegend.align||"center",n=12,l=r.globals.svgWidth||r.config.chart.width||600,h=r.globals.svgHeight||r.config.chart.height||300,c=r.config.legend.offsetX||0,d=r.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=i+"px",t.style.height=a+"px",t.style.right="auto",t.style.bottom="auto",s){const s=h-a-24;let r;r="start"===o?n:"end"===o?n+Math.max(0,s):n+Math.max(0,s)/2,t.style.top=r+d+"px",t.style.left="left"===e?n+c+"px":l-i-n+c+"px"}else{const s=l-i-24;let r;r="start"===o?n:"end"===o?n+Math.max(0,s):n+Math.max(0,s)/2,t.style.left=r+c+"px",t.style.top="top"===e?n+d+"px":h-a-n+d+"px"}}repositionToPlot(){var t,e;if(!c.isBrowser())return;const s=this.w,i=s.globals,a=s.dom.elLegendWrap;if(!a||!this._geom)return;if(!Number.isFinite(i.gridWidth)||!Number.isFinite(i.gridHeight))return;const{isVertical:r,position:o,svgWidth:n,svgHeight:l,stripX:h,stripY:d,stripThickness:g}=this._geom,p=s.config.plotOptions.heatmap.colorScale.gradientLegend.align||"center",u=s.config.legend.offsetX||0,x=s.config.legend.offsetY||0,f=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,b=f?f.getTitleSubtitleCoords("title").height+f.getTitleSubtitleCoords("subtitle").height:0,y=s.layout.xAxisHeight||0,w=(t,e)=>{const s=Math.max(0,t-e);return"start"===p?0:"end"===p?s:s/2};if(r){a.style.top=i.translateY+w(i.gridHeight,l)+x+"px";const t=(("left"===o?0:i.translateX+i.gridWidth)+("left"===o?i.translateX:i.svgWidth))/2;a.style.left=t-h-g/2+u+"px"}else{a.style.left=i.translateX+w(i.gridWidth,n)+u+"px";const t=(("top"===o?b:i.translateY+i.gridHeight+y)+("top"===o?i.translateY:i.svgHeight))/2;a.style.top=t-d-g/2+x+"px"}m.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,s=this.svgEl&&this.svgEl.querySelector("rect"),i=t.dom.baseEl.querySelector(".apexcharts-grid");if(!(e&&s&&i&&this._geom))return;const a=s.getBoundingClientRect(),r=i.getBoundingClientRect();if(!(a.width&&a.height&&r.width&&r.height))return;const{isVertical:o,position:n}=this._geom;if(o){const t="left"===n?r.left-a.right:a.left-r.right;if(t<16){const s=parseFloat(e.style.left)||0,i=16-t;e.style.left=s+("left"===n?-i:i)+"px"}}else{const t="top"===n?r.top-a.bottom:a.top-r.bottom;if(t<16){const s=parseFloat(e.style.top)||0,i=16-t;e.style.top=s+("top"===n?-i:i)+"px"}}}destroy(){var t,e,s,i,a,r,o;for(let s=0;s<this._bandHitEls.length;s++){const i=this._bandHitEls[s];null==(t=i.removeEventListener)||t.call(i,"mousemove",this._onBandEnter),null==(e=i.removeEventListener)||e.call(i,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(s=this.ctx)?void 0:s.events)try{null==(a=(i=this.ctx.events).removeEventListener)||a.call(i,"dataPointMouseEnter",this._onCellEnter),null==(o=(r=this.ctx.events).removeEventListener)||o.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(c.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,s,i,a;const r=this.w,o=t.currentTarget,n=parseInt(null!=(e=o.getAttribute("data:range-index"))?e:"-1",10);n<0||n===this._activeBandIndex||(this._activeBandIndex=n,null==(a=null==(i=null==(s=this.ctx)?void 0:s.events)?void 0:i.fireEvent)||a.call(i,"legendHover",[this.ctx,n,r]),new ce(r).highlightRangeInSeries(n,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,new ce(this.w).highlightRangeInSeries(t,"reset")}_attachHoverListeners(){var t,e;c.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,s;const i=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("heatmap"!==i.config.chart.type)return;const n=null==(s=null==(e=i.seriesData)?void 0:e.series)?void 0:s[r],l=null==n?void 0:n[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:s,stripX:i,stripY:a,stripLength:r,stripThickness:o,arrowSize:n}=this._geom,l=this._min,h=this._max-l;let c;if(c=0===h?.5:(t-l)/h,c<0&&(c=0),c>1&&(c=1),e){const t=a+r-c*r;let e,l;"left"===s?(e=i+o,l=e+n):(e=i,l=e-n);const h=[`${e},${t}`,`${l},${t-n/2}`,`${l},${t+n/2}`].join(" ");this.arrowEl.setAttribute("points",h)}else{const t=i+c*r;let e,l;"top"===s?(e=a+o,l=e+n):(e=a,l=e-n);const h=[`${t},${e}`,`${t-n/2},${l}`,`${t+n/2},${l}`].join(" ");this.arrowEl.setAttribute("points",h)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=a+r-c*r;"left"===s?this.hoverValueEl.style.left=`${i+o+n+8}px`:(this.hoverValueEl.style.left=i-n-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=i+c*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===s?`${a+o+n+8}px`:a-n-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,s){const i=m.createElementNS(Ls,"polygon");return i.setAttribute("fill",e),i.setAttribute("opacity","0"),i.setAttribute("class","apexcharts-heatmap-gradient-arrow"),i.setAttribute("points","0,0 0,0 0,0"),i.setAttribute("pointer-events","none"),i}_computeStops(){var t,e;const s=this.w,i=s.config.plotOptions.heatmap.colorScale,a=i.gradientLegend;let r=1/0,o=-1/0;const h=(null==(t=s.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 s=e[t];null==s||Number.isNaN(s)||(s<r&&(r=s),s>o&&(o=s))}}Number.isFinite(r)||(r=0),Number.isFinite(o)||(o=0);let c=r,d=o;void 0!==i.min&&(c=i.min<r?i.min:r),void 0!==i.max&&(d=i.max>o?i.max:o);const g=[],p=[];if(i.ranges&&i.ranges.length>0){const t=i.ranges.map((t,e)=>l(n({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,s=t[t.length-1].to;c=e,d=s;const a=s-e||1;t.forEach(t=>{const s=(t.from-e)/a,i=(t.to-e)/a;g.push({percent:(s+i)/2,color:t.color}),p.push({index:t._originalIndex,p1:s,p2:i})})}else{const t=s.globals.colors[0]||"#008FFB",i=new b,r=null!=(e=s.config.plotOptions.heatmap.shadeIntensity)?e:.5,o=s.globals.hasNegs,n=Math.max(2,a.stops||16);for(let e=0;e<n;e++){const a=e/(n-1),l=c+a*(d-c),h=Math.abs(d)+Math.abs(c),p=0===h?0:100*l/h;let u;u=o?s.config.plotOptions.heatmap.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,u>1&&(u=1),u<-1&&(u=-1);const x=s.config.plotOptions.heatmap.enableShades?i.shadeColor("dark"===s.config.theme.mode?-1*u:u,t):t;g.push({percent:a,color:x})}}return{min:c,max:d,stops:g,bands:p}}}Cs.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.printDataLabelsInner=(...t)=>{var s;return null==(s=e.pie)?void 0:s.printDataLabelsInner(...t)},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 _s(this)}init(){const t=this.w,e=t.globals,s=t.config;this.isBarsDistributed="bar"===s.chart.type&&s.plotOptions.bar.distributed&&1===s.series.length;const i=s.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===s.chart.type||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(i||!e.axisCharts)&&s.legend.show){const e=t.dom.elLegendWrap;for(;e.firstChild;)e.removeChild(e.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),"heatmap"===s.chart.type&&Ds.isEnabled(t)?(this.heatmapGradientLegend=new Ds(t,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===s.legend.position||"top"===s.legend.position?this.legendAlignHorizontal():"right"!==s.legend.position&&"left"!==s.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const s=this.w,i=m.createElement("span");i.classList.add("apexcharts-legend-marker");const a=s.config.legend.markers.shape||s.config.markers.shape;let r=a;Array.isArray(a)&&(r=a[t]);const o=Array.isArray(s.config.legend.markers.size)?parseFloat(s.config.legend.markers.size[t]):parseFloat(s.config.legend.markers.size),h=Array.isArray(s.config.legend.markers.offsetX)?parseFloat(s.config.legend.markers.offsetX[t]):parseFloat(s.config.legend.markers.offsetX),d=Array.isArray(s.config.legend.markers.offsetY)?parseFloat(s.config.legend.markers.offsetY[t]):parseFloat(s.config.legend.markers.offsetY),g=Array.isArray(s.config.legend.markers.strokeWidth)?parseFloat(s.config.legend.markers.strokeWidth[t]):parseFloat(s.config.legend.markers.strokeWidth),p=i.style;if(p.height=2*(o+g)+"px",p.width=2*(o+g)+"px",p.left=h+"px",p.top=d+"px",s.config.legend.markers.customHTML)p.background="transparent",p.color=e[t],Array.isArray(s.config.legend.markers.customHTML)?s.config.legend.markers.customHTML[t]&&(i.innerHTML=s.config.legend.markers.customHTML[t]()):i.innerHTML=s.config.legend.markers.customHTML();else{const a=new mt(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:t,strokeWidth:g,size:o}),h=(c.isBrowser()?window.SVG:global.SVG)().addTo(i).size("100%","100%"),d=new gt(this.w).drawMarker(0,0,l(n({},a),{pointFillColor:Array.isArray(e)?e[t]:a.pointFillColor,shape:r}));s.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%)"}),h.add(d)}return i}drawLegends(){var t;const e=this,s=this.w,i=s.dom.elLegendWrap,a=s.config.legend.fontFamily;let r=s.seriesData.seriesNames,o=s.config.legend.markers.fillColors?s.config.legend.markers.fillColors.slice():s.globals.colors.slice();if("heatmap"===s.config.chart.type){const t=s.config.plotOptions.heatmap.colorScale.ranges;r=t.map(t=>t.name?t.name:t.from+" - "+t.to),o=t.map(t=>t.color)}else this.isBarsDistributed&&(r=s.labelData.labels.slice());s.config.legend.customLegendItems.length&&(r=s.config.legend.customLegendItems);const n=s.formatters.legendFormatter,l=s.config.legend.inverseOrder,h=[];s.labelData.seriesGroups.length>1&&s.config.legend.clusterGroupedSeries&&s.labelData.seriesGroups.forEach((t,e)=>{h[e]=m.createElement("div"),h[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===s.config.legend.clusterGroupedSeriesOrientation?i.classList.add("apexcharts-legend-group-horizontal"):h[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?r.length-1:0;l?e>=0:e<=r.length-1;l?e--:e++){const l=n(r[e],{seriesIndex:e,w:s});let c=!1,d=!1;if(s.globals.collapsedSeries.length>0)for(let t=0;t<s.globals.collapsedSeries.length;t++)s.globals.collapsedSeries[t].index===e&&(c=!0);if(s.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<s.globals.ancillaryCollapsedSeriesIndices.length;t++)s.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const g=this.createLegendMarker({i:e,fillcolor:o});gt.setAttrs(g,{rel:e+1,"data:collapsed":c||d}),(c||d)&&g.classList.add("apexcharts-inactive-legend");const p=m.createElement("div");if(s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled){p.setAttribute("role","button"),p.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=c||d,s=e?"hidden":"visible";p.setAttribute("aria-label",`${t}, ${s}. Press Enter or Space to toggle.`),p.setAttribute("aria-pressed",e?"true":"false")}const u=m.createElement("span");u.classList.add("apexcharts-legend-text"),u.innerHTML=Array.isArray(l)?l.join(" "):l;let x=s.config.legend.labels.useSeriesColors?s.globals.colors[e]:Array.isArray(s.config.legend.labels.colors)?null==(t=s.config.legend.labels.colors)?void 0:t[e]:s.config.legend.labels.colors;x||(x=s.config.chart.foreColor),u.style.color=x,u.style.fontSize=s.config.legend.fontSize,u.style.fontWeight=s.config.legend.fontWeight,u.style.fontFamily=a||s.config.chart.fontFamily,gt.setAttrs(u,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":c||d}),p.appendChild(g),p.appendChild(u);const f=new P(this.w);if(!s.config.legend.showForZeroSeries){0===f.getSeriesTotalByIndex(e)&&f.seriesHaveSameValues(e)&&!f.isSeriesNull(e)&&-1===s.globals.collapsedSeriesIndices.indexOf(e)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-zero-series")}s.config.legend.showForNullSeries||f.isSeriesNull(e)&&-1===s.globals.collapsedSeriesIndices.indexOf(e)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-null-series"),h.length?s.labelData.seriesGroups.forEach((t,a)=>{var r,o;t.includes(null!=(o=null==(r=s.config.series[e])?void 0:r.name)?o:"")&&(i.appendChild(h[a]),h[a].appendChild(p))}):i.appendChild(p),i.classList.add(`apexcharts-align-${s.config.legend.horizontalAlign}`),i.classList.add("apx-legend-position-"+s.config.legend.position),p.classList.add("apexcharts-legend-series"),p.style.margin=`${s.config.legend.itemMargin.vertical}px ${s.config.legend.itemMargin.horizontal}px`,i.style.width=s.config.legend.width?s.config.legend.width+"px":"",i.style.height=s.config.legend.height?s.config.legend.height+"px":"",gt.setAttrs(p,{rel:e+1,seriesName:b.escapeString(r[e]),"data:collapsed":c||d}),(c||d)&&p.classList.add("apexcharts-inactive-legend"),s.config.legend.onItemClick.toggleDataSeries||p.classList.add("apexcharts-no-click")}s.dom.elWrap.addEventListener("click",e.onLegendClick,!0),s.config.legend.onItemHover.highlightDataSeries&&0===s.config.legend.customLegendItems.length&&(s.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),s.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const s=this.w,i=s.dom.elLegendWrap,a=i.clientHeight;let r=0,o=0;if("bottom"===s.config.legend.position)o=s.globals.svgHeight-Math.min(a,s.globals.svgHeight/2)-5;else if("top"===s.config.legend.position){const t=new Ce(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,s=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;o=(e>0?e-10:0)+(s>0?s-10:0)}i.style.position="absolute",r=r+t+s.config.legend.offsetX,o=o+e+s.config.legend.offsetY,i.style.left=r+"px",i.style.top=o+"px","right"===s.config.legend.position&&(i.style.left="auto",i.style.right=25+s.config.legend.offsetX+"px");["width","height"].forEach(t=>{i&&i.style[t]&&(i.style[t]=parseInt(String(s.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new Ce(this.w,this.ctx),s=e.dimHelpers.getTitleSubtitleCoords("title"),i=e.dimHelpers.getTitleSubtitleCoords("subtitle");let a=0;"top"===t.config.legend.position&&(a=s.height+i.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,a)}legendAlignVertical(){const t=this.w,e=this.legendHelpers.getLegendDimensions();let s=0;"left"===t.config.legend.position&&(s=20),"right"===t.config.legend.position&&(s=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(s,20)}onLegendHovered(t){var e;const s=this.w,i=t.target,a=i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker");if("heatmap"===s.config.chart.type||this.isBarsDistributed){if(a){const s=parseInt(null!=(e=i.getAttribute("rel"))?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,s,this.w]);const a=new ce(this.ctx.w);"mousemove"===t.type?a.highlightRangeInSeries(s,"highlight"):"mouseout"===t.type&&a.highlightRangeInSeries(s,"reset")}}else if(!i.classList.contains("apexcharts-inactive-legend")&&a){new ce(this.ctx.w).toggleSeriesOnHover(t,i)}}onLegendKeyDown(t){const e=this,s=this.w,i=t.target;if((i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))&&("Enter"===t.key||" "===t.key)){t.preventDefault();const a=i.getAttribute("rel");e.onLegendClick(t),null!==a&&s.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const t=s.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${a}"]`);t&&t.focus()})}}onLegendClick(t){var e;const s=this.w,i=t.target;if(!s.config.legend.customLegendItems.length&&(i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))){const t=parseInt(null!=(e=i.getAttribute("rel"))?e:"0",10)-1,a="true"===i.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const o=this.w.config.legend.markers.onClick;"function"==typeof o&&i.classList.contains("apexcharts-legend-marker")&&(o(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==s.config.chart.type&&"heatmap"!==s.config.chart.type&&!this.isBarsDistributed&&s.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,a)}}}});class Ms{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.elZoomReset=null,this.elMenuIcon=null,this.elMenu=null,this.elMenuItems=[],this.t=null}createToolbar(){const t=this.w,e=()=>m.createElementNS("http://www.w3.org/1999/xhtml","div"),s=()=>{const t=m.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},i=e();if(i.setAttribute("class","apexcharts-toolbar"),i.style.top=t.config.chart.toolbar.offsetY+"px",i.style.right=3-t.config.chart.toolbar.offsetX+"px",t.dom.elWrap.appendChild(i),this.elZoom=s(),this.elZoomIn=s(),this.elZoomOut=s(),this.elPan=s(),this.elSelection=s(),this.elZoomReset=s(),this.elMenuIcon=s(),this.elMenu=e(),this.elCustomIcons=[],this.t=t.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(s());const a=[],r=(e,s,i)=>{const r=e.toLowerCase();this.t[r]&&t.config.chart.zoom.enabled&&a.push({el:s,icon:"string"==typeof this.t[r]?this.t[r]:i,title:this.localeValues[e],class:`apexcharts-${r}-icon`})};r("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'),r("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 o=e=>{this.t[e]&&t.config.chart[e].enabled&&a.push({el:"zoom"===e?this.elZoom:this.elSelection,icon:"string"==typeof this.t[e]?this.t[e]:"zoom"===e?'<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"===e?"selectionZoom":"selection"],class:`apexcharts-${e}-icon`})};o("zoom"),o("selection"),this.t.pan&&t.config.chart.zoom.enabled&&a.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"}),r("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&&a.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++)a.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});a.forEach((t,e)=>{t.index&&b.moveIndexInArray(a,e,t.index)});for(let t=0;t<a.length;t++)gt.setAttrs(a[t].el,{class:a[t].class,title:a[t].title,"aria-label":a[t].title}),a[t].el.innerHTML=a[t].icon,i.appendChild(a[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!t.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!t.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!t.interact.panEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),this._createHamburgerMenu(i),t.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):t.interact.panEnabled?this.elPan.classList.add(this.selectedClass):t.interact.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),gt.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,gt.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,s,i,a,r,o,n;null==(t=this.elZoomReset)||t.addEventListener("click",this.handleZoomReset.bind(this)),null==(e=this.elSelection)||e.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),null==(s=this.elZoom)||s.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(i=this.elZoomIn)||i.addEventListener("click",this.handleZoomIn.bind(this)),null==(a=this.elZoomOut)||a.addEventListener("click",this.handleZoomOut.bind(this)),null==(r=this.elPan)||r.addEventListener("click",this.togglePanning.bind(this)),null==(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.elMenuIcon,...this.elCustomIcons].forEach(t=>{t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const s=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=s.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const i=t.querySelector(`.${e}`);i&&i.focus()})}})}),null==(n=this.elMenuIcon)||n.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",s=>{var i;if("ArrowDown"===s.key){s.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===s.key){s.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===s.key||"Tab"===s.key?(this._closeMenu(),null==(i=this.elMenuIcon)||i.focus(),"Tab"===s.key||s.preventDefault()):"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{e.ctx.toolbar.toggleOtherControls();const s="selection"===t?e.ctx.toolbar.elSelection:e.ctx.toolbar.elZoom,i="selection"===t?"selectionEnabled":"zoomEnabled";e.w.globals[i]=!e.w.globals[i],s.classList.contains(e.ctx.toolbar.selectedClass)?s.classList.remove(e.ctx.toolbar.selectedClass):s.classList.add(e.ctx.toolbar.selectedClass),s.setAttribute("aria-pressed",String(e.w.globals[i]))})}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"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,s="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),s&&s.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{t.ctx.toolbar.toggleOtherControls(),t.w.interact.panEnabled=!t.w.interact.panEnabled,t.ctx.toolbar.elPan.classList.contains(t.ctx.toolbar.selectedClass)?t.ctx.toolbar.elPan.classList.remove(t.ctx.toolbar.selectedClass):t.ctx.toolbar.elPan.classList.add(t.ctx.toolbar.selectedClass),t.ctx.toolbar.elPan.setAttribute("aria-pressed",String(t.w.interact.panEnabled))})}toggleOtherControls(){const t=this.w;t.interact.panEnabled=!1,t.interact.zoomEnabled=!1,t.interact.selectionEnabled=!1,this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom].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:s}=this._currentXRange();this.minX=e,this.maxX=s;const i=(e+s)/2,a=(e+i)/2,r=(s+i)/2,o=this._getNewMinXMaxX(a,r);t.interact.disableZoomIn||this.zoomUpdateOptions(o.minX,o.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:s}=this._currentXRange();if(this.minX=e,this.maxX=s,"datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const i=(e+s)/2,a=e-(i-e),r=s-(i-s),o=this._getNewMinXMaxX(a,r);t.interact.disableZoomOut||this.zoomUpdateOptions(o.minX,o.maxX)}_getNewMinXMaxX(t,e){const s=this.w.config.xaxis.convertedCatToNumeric;return{minX:s?Math.floor(t):t,maxX:s?Math.floor(e):e}}zoomUpdateOptions(t,e){const s=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(s.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=s.globals.dataPoints),e-t<2))return;let i={min:t,max:e};const a=this.getBeforeZoomRange(i,void 0);a&&(i=a.xaxis);const r={xaxis:i};if(!s.globals.initialConfig)return;const o=b.clone(s.globals.initialConfig.yaxis);s.config.chart.group||(r.yaxis=o),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(i,o)}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 s=null;return"function"==typeof this.ev.beforeZoom&&(s=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),s}toggleMenu(){window.setTimeout(()=>{var t,e,s;(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==(s=this.elMenuIcon)||s.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,s=new ks(this.w,this.ctx);switch(t){case"svg":s.exportToSVG();break;case"png":s.exportToPng();break;case"csv":s.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 s=e.config.chart.events.beforeResetZoom(t,e);s&&t.updateHelpers.revertDefaultAxisMinMax(s)}"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max});const s=t.ctx.series.emptyCollapsedSeries(b.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(s,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.elZoomReset=null,this.elMenuIcon=null}}Cs.registerFeatures({toolbar:Ms,zoomPanSelection:class extends Ms{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new gt(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend","wheel"],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",this.debounceTimer=null,this.debounceDelay=100,this.wheelDelay=400}init({xyRatios:t}){const e=this.w,s=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=e.dom.baseEl.querySelector(".apexcharts-grid"),this.constraints=new X(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 i;null==(i=this.hoverArea)||i.addEventListener(e,s.svgMouseEvents.bind(s,t),{capture:!1,passive:!0})}),e.config.chart.zoom.enabled&&e.config.chart.zoom.allowMouseWheelZoom&&this.hoverArea.addEventListener("wheel",s.mouseWheelEvent.bind(s),{capture:!1,passive:!1}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,s.momentumTouch.bind(s),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}svgMouseEvents(t,e){var s;const i=this.w,a=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const r=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,o=i.config.chart.toolbar.autoSelected;if(e.shiftKey?(this.shiftWasPressed=!0,a.enableZoomPanFromToolbar("pan"===o?"zoom":"pan")):this.shiftWasPressed&&(a.enableZoomPanFromToolbar(o),this.shiftWasPressed=!1),!e.target)return;const n=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(n.contains("apexcharts-legend-marker")||n.contains("apexcharts-legend-text")||l&&l.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){const t=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();if(!t)return;this.startX=this.clientX-t.left-i.globals.barPadForNumericAxis,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:r,xyRatios:t})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:r}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:r}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){var s;const i=this.w,a=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();a&&(this.w.interact.mousedown||e)&&(this.endX=this.clientX-a.left-i.globals.barPadForNumericAxis,this.endY=this.clientY-a.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}mouseWheelEvent(t){const e=this.w;t.preventDefault();const s=Date.now();s-e.interact.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.interact.lastWheelExecution=s),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{s-e.interact.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.interact.lastWheelExecution=s)},this.debounceDelay)}executeMouseWheelZoom(t){var e,s,i;const a=this.w;this.minX=a.axisFlags.isRangeBar?a.globals.minY:a.globals.minX,this.maxX=a.axisFlags.isRangeBar?a.globals.maxY:a.globals.maxX;const r=null==(e=this.gridRect)?void 0:e.getBoundingClientRect();if(!r)return;const o=(t.clientX-r.left)/r.width,n=this.minX,l=this.maxX,h=l-n;let c,d,g;if(t.deltaY<0){c=.5*h;const t=n+o*h;d=t-c/2,g=t+c/2}else c=1.5*h,d=n-c/2,g=l+c/2;if(!a.axisFlags.isRangeBar){const t=null!=(s=a.globals.dataReducerRawMinX)?s:a.globals.initialMinX,e=null!=(i=a.globals.dataReducerRawMaxX)?i:a.globals.initialMaxX;d=Math.max(d,t),g=Math.min(g,e);const r=a.globals.minXDiff>0&&isFinite(a.globals.minXDiff)?a.globals.minXDiff:0,o=Math.max(2*r,1e-6*(e-t));if(g-d<o){const t=(d+g)/2;d=t-o/2,g=t+o/2}}const p=this._getNewMinXMaxX(d,g);isNaN(p.minX)||isNaN(p.maxX)||this.zoomUpdateOptions(p.minX,p.maxX)}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,s,i,a)=>"l"===a||"r"===a?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{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(n({},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 s=(t.config.chart.selection.xaxis.min-t.globals.minX)/e.xRatio,i=t.layout.gridWidth-(t.globals.maxX-t.config.chart.selection.xaxis.max)/e.xRatio-s;t.axisFlags.isRangeBar&&(s=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,i=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const a={x:s,y:0,width:i,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(a),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:s,height:i,translateX:a=0,translateY:r=0}){const o=this.w,n=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==o.interact.selection){const h={transform:"translate("+a+", "+r+")"};o.interact.zoomEnabled&&this.dragged&&(s<0&&(s=1),n.attr({x:t,y:e,width:s,height:i,fill:o.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":o.config.chart.zoom.zoomedArea.fill.opacity,stroke:o.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":o.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":o.config.chart.zoom.zoomedArea.stroke.opacity}),gt.setAttrs(n.node,h)),o.interact.selectionEnabled&&(l.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,fill:o.config.chart.selection.fill.color,"fill-opacity":o.config.chart.selection.fill.opacity,stroke:o.config.chart.selection.stroke.color,"stroke-width":o.config.chart.selection.stroke.width,"stroke-dasharray":o.config.chart.selection.stroke.dashArray,"stroke-opacity":o.config.chart.selection.stroke.opacity}),gt.setAttrs(l.node,h))}}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){var s;const i=this.w,a=t,r=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();if(!r)return;const o=a.startX-1,h=a.startY;let c=!1,d=!1;const g=a.clientX-r.left-i.globals.barPadForNumericAxis,p=a.clientY-r.top;let u=g-o,x=p-h,f={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+o)>i.layout.gridWidth?u=i.layout.gridWidth-o:g<0&&(u=o),o>g&&(c=!0,u=Math.abs(u)),h>p&&(d=!0,x=Math.abs(x)),f="x"===e?{x:c?o-u:o,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:d?h-x:h,width:i.layout.gridWidth,height:x}:{x:c?o-u:o,y:d?h-x:h,width:u,height:x},f=l(n({},f),{translateX:i.layout.translateX,translateY:i.layout.translateY}),a.drawSelectionRect(f),a.selectionDragging("resizing"),f}selectionDragging(t,e){var s;const i=this.w;if(!e)return;e.preventDefault();const{handler:a,box:r}=e.detail,o=this.constraints;let{x:n,y:l}=r;n<o.x&&(n=o.x),l<o.y&&(l=o.y),r.x2>o.x2&&(n=o.x2-r.w),r.y2>o.y2&&(l=o.y2-r.h),a.move(n,l);const h=this.xyRatios,c=this.selectionRect;let d=0;"resizing"===t&&(d=30);const g=t=>parseFloat(c.node.getAttribute(t)),p={x:g("x"),y:g("y"),width:g("width"),height:g("height")};i.interact.selection=p;const u=i.config.chart.link,x=!(!u||!u.enabled&&"function"!=typeof u.dimension);("function"==typeof i.config.chart.events.selection||x)&&i.interact.selectionEnabled&&(clearTimeout(null!=(s=this.w.globals.selectionResizeTimer)?s:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{var t,e;const s=null==(t=this.gridRect)?void 0:t.getBoundingClientRect();if(!s)return;const a=c.node.getBoundingClientRect();let r,o,n,l;const d=a.left-s.left-i.globals.barPadForNumericAxis,g=a.right-s.left-i.globals.barPadForNumericAxis;if(i.axisFlags.isRangeBar)r=i.globals.yAxisScale[0].niceMin+d*h.invertedYRatio,o=i.globals.yAxisScale[0].niceMin+g*h.invertedYRatio,n=0,l=1;else{if(!i.globals.xAxisScale)return;r=i.globals.xAxisScale.niceMin+d*h.xRatio,o=i.globals.xAxisScale.niceMin+g*h.xRatio,n=i.globals.yAxisScale[0].niceMin+(s.bottom-a.bottom)*h.yRatio[0],l=i.globals.yAxisScale[0].niceMax-(a.top-s.top)*h.yRatio[0]}const p={xaxis:{min:r,max:o},yaxis:{min:n,max:l}};"function"==typeof i.config.chart.events.selection&&i.config.chart.events.selection(this.ctx,p),i.config.chart.brush.enabled&&void 0!==i.config.chart.events.brushScrolled&&i.config.chart.events.brushScrolled(this.ctx,p),null==(e=this.ctx.linkedViews)||e.onSourceSelection(p.xaxis)},d))}selectionDrawn({context:t,zoomtype:e}){var s,i,a;const r=this.w,o=t,n=this.xyRatios,l=this.ctx.toolbar,h=r.interact.zoomEnabled?o.zoomRect.node.getBoundingClientRect():o.selectionRect.node.getBoundingClientRect(),c=o.gridRect.getBoundingClientRect(),d=h.left-c.left-r.globals.barPadForNumericAxis,g=h.right-c.left-r.globals.barPadForNumericAxis,p=h.top-c.top,u=h.bottom-c.top;let x,f;if(r.axisFlags.isRangeBar)x=r.globals.yAxisScale[0].niceMin+d*n.invertedYRatio,f=r.globals.yAxisScale[0].niceMin+g*n.invertedYRatio;else{const t=null!=(i=null==(s=r.globals.xAxisScale)?void 0:s.niceMin)?i:0;x=t+d*n.xRatio,f=t+g*n.xRatio}const m=[],y=[];if(r.config.yaxis.forEach((t,e)=>{const s=r.globals.seriesYAxisMap[e][0],i=r.globals.yAxisScale[e].niceMax-n.yRatio[s]*p,a=r.globals.yAxisScale[e].niceMax-n.yRatio[s]*u;m.push(i),y.push(a)}),o.dragged&&(o.dragX>10||o.dragY>10)&&x!==f)if(r.interact.zoomEnabled){if(!r.globals.initialConfig)return;let t=b.clone(r.globals.initialConfig.yaxis),s=b.clone(r.globals.initialConfig.xaxis);if(r.interact.zoomed=!0,r.config.xaxis.convertedCatToNumeric&&(x=Math.floor(x),f=Math.floor(f),x<1&&(x=1,f=r.globals.dataPoints),f-x<2&&(f=x+1)),"xy"!==e&&"x"!==e||(s={min:x,max:f}),"xy"!==e&&"y"!==e||t.forEach((e,s)=>{t[s].min=y[s],t[s].max=m[s]}),l){const e=l.getBeforeZoomRange(s,t);e&&(s=e.xaxis?e.xaxis:s,t=e.yaxis?e.yaxis:t)}const i={xaxis:s};r.config.chart.group||(i.yaxis=t),o.ctx.updateHelpers._updateOptions(i,!1,o.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof r.config.chart.events.zoomed&&l.zoomCallback(s,t)}else if(r.interact.selectionEnabled){let t=null,s=null;if(s={min:x,max:f},"xy"===e||"y"===e){const e=b.clone(r.config.yaxis);t=e,e.forEach((t,s)=>{e[s].min=y[s],e[s].max=m[s]})}r.interact.selection=o.selection,"function"==typeof r.config.chart.events.selection&&r.config.chart.events.selection(o.ctx,{xaxis:s,yaxis:t}),null==(a=o.ctx.linkedViews)||a.onSourceSelection(s)}}panDragging({context:t}){var e;const s=this.w,i=t;if(void 0!==s.interact.lastClientPosition.x){const t=s.interact.lastClientPosition.x-i.clientX,a=(null!=(e=s.interact.lastClientPosition.y)?e:0)-i.clientY;Math.abs(t)>Math.abs(a)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(a)&&t<0?this.moveDirection="right":Math.abs(a)>Math.abs(t)&&a>0?this.moveDirection="up":Math.abs(a)>Math.abs(t)&&a<0&&(this.moveDirection="down")}s.interact.lastClientPosition={x:i.clientX,y:i.clientY};const a=s.axisFlags.isRangeBar?s.globals.minY:s.globals.minX,r=s.axisFlags.isRangeBar?s.globals.maxY:s.globals.maxX;i.panScrolled(a,r)}panScrolled(t,e){var s,i;const a=this.w,r=this.xyRatios;if(!a.globals.initialConfig)return;const o=b.clone(a.globals.initialConfig.yaxis);let n=r.xRatio,l=a.globals.minX,h=a.globals.maxX;if(a.axisFlags.isRangeBar&&(n=r.invertedYRatio,l=a.globals.minY,h=a.globals.maxY),"left"===this.moveDirection?(t=l+a.layout.gridWidth/15*n,e=h+a.layout.gridWidth/15*n):"right"===this.moveDirection&&(t=l-a.layout.gridWidth/15*n,e=h-a.layout.gridWidth/15*n),!a.axisFlags.isRangeBar){const r=null!=(s=a.globals.dataReducerRawMinX)?s:a.globals.initialMinX,o=null!=(i=a.globals.dataReducerRawMaxX)?i:a.globals.initialMaxX;(t<r||e>o)&&(t=l,e=h)}const c={xaxis:{min:t,max:e}};a.config.chart.group||(c.yaxis=o),this.updateScrolledChart(c,t,e)}updateScrolledChart(t,e,s){const i=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof i.config.chart.events.scrolled){const t={xaxis:{min:e,max:s}};i.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){const t=this.w.config.chart;return!!(t.zoom&&t.zoom.enabled&&t.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}_clampBounds(){var t,e;const s=this.w;return s.axisFlags.isRangeBar?null:{min:null!=(t=s.globals.dataReducerRawMinX)?t:s.globals.initialMinX,max:null!=(e=s.globals.dataReducerRawMaxX)?e:s.globals.initialMaxX}}_applyXRange(t,e,s){const i=this.w;if(!i.globals.initialConfig)return!1;const a=this._clampBounds();if(a){const s=e-t;t<a.min&&(e=(t=a.min)+s),e>a.max&&(t=(e=a.max)-s),t<a.min&&(t=a.min)}if(i.config.xaxis.convertedCatToNumeric&&((t=Math.floor(t))<1&&(t=1),(e=Math.floor(e))-t<2))return!1;if(!(e>t))return!1;const r={xaxis:{min:t,max:e}};return i.config.chart.group||(r.yaxis=b.clone(i.globals.initialConfig.yaxis)),s&&(i.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(r,!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:s}=this._currentXWindow(),i={xaxis:{min:e,max:s}};t.config.chart.events.scrolled(this.ctx,i),this.ctx.events.fireEvent("scrolled",i)}_pushSample(t,e){const s=this._m().samples;for(s.push({x:t,t:e});s.length>6;)s.shift()}momentumTouch(t){const e=this.w,s=this._m(),i=t.type;if("touchstart"===i){this._cancelInertia();const i=this._gridRect();if(!i)return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),s.busy=!0,s.panState=null,this._beginPinch(t,i);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){s.busy=!0,s.pinch=null;const i=t.touches[0],a=this._currentXWindow(),r=e.layout.gridWidth||1;s.panState={startX:i.clientX,startY:i.clientY,axis:null,minX0:a.min,maxX0:a.max,ratio0:(a.max-a.min)/r},s.samples=[{x:i.clientX,t:t.timeStamp}]}return}"touchmove"!==i?(s.pinch?t.touches.length<2&&this._endPinch():s.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=s.inertiaRAF||s.pinch||s.panState||(s.busy=!1))):s.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):s.panState&&1===t.touches.length&&this._movePan(t)}_beginPinch(t,e){const s=this.w,i=t.touches[0],a=t.touches[1],r=Math.hypot(a.clientX-i.clientX,a.clientY-i.clientY)||1,o=(i.clientX+a.clientX)/2-e.left-s.globals.barPadForNumericAxis,{min:n,max:l}=this._currentXWindow();this._m().pinch={d0:r,cx0:o,minX0:n,maxX0:l,gridWidth:s.layout.gridWidth||1}}_movePinch(t){const e=this.w,s=this._m().pinch;if(!s)return;const i=this._gridRect();if(!i)return;const a=t.touches[0],r=t.touches[1],o=Math.hypot(r.clientX-a.clientX,r.clientY-a.clientY)||1,n=(a.clientX+r.clientX)/2-i.left-e.globals.barPadForNumericAxis,l=s.maxX0-s.minX0,h=l*(s.d0/o);let c=s.minX0+s.cx0/s.gridWidth*l-n/s.gridWidth*h,d=c+h;const g=this._clampBounds();if(g){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,s=Math.max(2*t,1e-6*(g.max-g.min));if(d-c<s){const t=(c+d)/2;c=t-s/2,d=t+s/2}}this._applyXRange(c,d,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:s}=this._currentXWindow(),i={min:e,max:s},a=t.globals.initialConfig?b.clone(t.globals.initialConfig.yaxis):[],r=this.ctx.toolbar;r&&r.zoomCallback(i,a)}_movePan(t){const e=this._m(),s=e.panState,i=t.touches[0];if(!s.axis){const a=Math.abs(i.clientX-s.startX),r=Math.abs(i.clientY-s.startY);if(a<6&&r<6)return void this._pushSample(i.clientX,t.timeStamp);if(r>a)return e.busy=!1,void(e.panState=null);s.axis="x"}if("x"!==s.axis)return;t.preventDefault();const a=(i.clientX-s.startX)*s.ratio0;this._pushSample(i.clientX,t.timeStamp),this._applyXRange(s.minX0-a,s.maxX0-a,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let s=0;const i=t.samples;if(i.length>=2){const t=i[0],e=i[i.length-1],a=e.t-t.t;a>0&&(s=(e.x-t.x)/a)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(s)>.05?this._startInertia(s):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,s=this._m(),i=e.config.chart.pan&&e.config.chart.pan.friction,a="number"==typeof i?Math.min(Math.max(i,.5),.999):.92;let r=t,o=null;s.busy=!0;const n=t=>{if(e.globals.isDestroyed)return s.inertiaRAF=null,void(s.busy=!1);if(null==o)return o=t,void(s.inertiaRAF=requestAnimationFrame(n));const i=t-o;if(o=t,r*=Math.pow(a,i/16.6667),Math.abs(r)<.02)return s.inertiaRAF=null,s.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),h=e.layout.gridWidth||1,c=(l.max-l.min)/h,d=r*i*c,g=this._applyXRange(l.min-d,l.max-d,!1),p=this._clampBounds();if(!g||p&&(d>0&&g.minX<=p.min+1e-6*(p.max-p.min)||d<0&&g.maxX>=p.max-1e-6*(p.max-p.min)))return s.inertiaRAF=null,s.busy=!1,void this._fireScrolled();s.inertiaRAF=requestAnimationFrame(n)};s.inertiaRAF=requestAnimationFrame(n)}}});let Es=class{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var s,i;const a=this.w;if("vertical"===t.label.orientation){const r=null!==e?e:0,o=a.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${r}']`);if(null!==o){const e=o.getBBox();o.setAttribute("x",String(parseFloat(null!=(s=o.getAttribute("x"))?s:"0")-e.height+4));const a="top"===t.label.position?e.width:-e.width;o.setAttribute("y",String(parseFloat(null!=(i=o.getAttribute("y"))?i:"0")+a));const{x:r,y:n}=this.annoCtx.graphics.rotateAroundCenter(o);o.setAttribute("transform",`rotate(-90 ${r} ${n})`)}}}addBackgroundToAnno(t,e){const s=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const i=s.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const a=i.getBoundingClientRect(),r=i.getBBox(),o=a.width/r.width||1,n=t.getBoundingClientRect();let{left:l,right:h,top:c,bottom:d}=e.label.style.padding;"vertical"===e.label.orientation&&([c,d,l,h]=[l,h,c,d]);const g=(n.left-a.left)/o-l,p=(n.top-a.top)/o-c,u=this.annoCtx.graphics.drawRect(g-s.globals.barPadForNumericAxis,p,n.width/o+l+h,n.height/o+c+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&u.node.classList.add(e.id),u}annotationsBackground(){const t=this.w,e=(e,s,i)=>{const a=t.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${s}']`);if(a){const s=a.parentNode,i=this.addBackgroundToAnno(a,e);if(i){null==s||s.insertBefore(i.node,a);const r=a.getAttribute("x");null!==r&&nt(i,parseFloat(r),t),e.label.mouseEnter&&i.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&i.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&i.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,s)=>e(t,s,"xaxis")),t.config.annotations.yaxis.forEach((t,s)=>e(t,s,"yaxis")),t.config.annotations.points.forEach((t,s)=>e(t,s,"point"))}getY1Y2(t,e){var s,i;const a=this.w,r="y1"===t?e.y:e.y2;let o,n=!1;if(this.annoCtx.invertAxis){const t=a.config.xaxis.convertedCatToNumeric?a.labelData.categoryLabels:a.labelData.labels,i=t.indexOf(r),n=a.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${i+1})`);o=n?parseFloat(null!=(s=n.getAttribute("y"))?s:"0"):(a.layout.gridHeight/t.length-1)*(i+1)-a.globals.barHeight,void 0!==e.seriesIndex&&a.globals.barHeight&&(o-=a.globals.barHeight/2*(a.seriesData.series.length-1)-a.globals.barHeight*e.seriesIndex)}else{const t=a.globals.seriesYAxisMap[e.yAxisIndex][0],s=a.config.yaxis[e.yAxisIndex].logarithmic?new P(this.w).getLogVal(a.config.yaxis[e.yAxisIndex].logBase,r,t)/a.globals.yLogRatio[t]:(r-a.globals.minYArr[t])/(a.globals.yRange[t]/a.layout.gridHeight);o=a.layout.gridHeight-Math.min(Math.max(s,0),a.layout.gridHeight),n=s>a.layout.gridHeight||s<0,!e.marker||void 0!==e.y&&null!==e.y||(o=0),(null==(i=a.config.yaxis[e.yAxisIndex])?void 0:i.reversed)&&(o=s)}return"string"==typeof r&&r.includes("px")&&(o=parseFloat(r)),{yP:o,clipped:n}}getX1X2(t,e){const s=this.w,i="x1"===t?e.x:e.x2,a=this.annoCtx.invertAxis?s.globals.minY:s.globals.minX,r=this.annoCtx.invertAxis?s.globals.maxY:s.globals.maxX,o=this.annoCtx.invertAxis?s.globals.yRange[0]:s.globals.xRange;let n=!1,l=this.annoCtx.inversedReversedAxis?(r-i)/(o/s.layout.gridWidth):(i-a)/(o/s.layout.gridWidth);return"category"!==s.config.xaxis.type&&!s.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||s.axisFlags.dataFormatXNumeric||s.config.chart.sparkline.enabled||(l=this.getStringX(i)),"string"==typeof i&&i.includes("px")&&(l=parseFloat(i)),null==i&&e.marker&&(l=s.layout.gridWidth),void 0!==e.seriesIndex&&s.globals.barWidth&&!this.annoCtx.invertAxis&&(l-=s.globals.barWidth/2*(s.seriesData.series.length-1)-s.globals.barWidth*e.seriesIndex),"number"!=typeof l&&(l=0,n=!0),parseFloat(l.toFixed(10))>parseFloat(s.layout.gridWidth.toFixed(10))?(l=s.layout.gridWidth,n=!0):l<0&&(l=0,n=!0),{x:l,clipped:n}}getStringX(t){var e;const s=this.w;let i=t;if(s.config.xaxis.convertedCatToNumeric&&s.labelData.categoryLabels.length){const e=String(t);t=s.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const a=s.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),r=s.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${a+1})`);return r&&(i=parseFloat(null!=(e=r.getAttribute("x"))?e:"0")),i}};class Ps{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new Es(this.annoCtx)}addXaxisAnnotation(t,e,s){const i=this.w,a=this.helpers.getX1X2("x1",t);let r=a.x;const o=a.clipped;let n,l=!0;const h=t.label.text,c=t.strokeDashArray;if(b.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!o){const s=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,i.layout.gridHeight+t.offsetY,t.borderColor,c,t.borderWidth);e.appendChild(s.node),t.id&&s.node.classList.add(t.id),nt(s,r+t.offsetX,i)}}else{const s=this.helpers.getX1X2("x2",t);if(n=s.x,l=s.clipped,n<r){const t=r;r=n,n=t}const a=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,n-r,i.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,c);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id),nt(a,r+t.offsetX,i)}if(!o||!l){const a=this.annoCtx.graphics.getTextRects(h,t.label.style.fontSize),o="top"===t.label.position?4:"center"===t.label.position?i.layout.gridHeight/2+("vertical"===t.label.orientation?a.width/2:0):i.layout.gridHeight,n=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:o+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?a.width/2-12:-a.width/2:0),text:h,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});n.attr({rel:s}),e.appendChild(n.node),nt(n,r+t.label.offsetX,i),this.annoCtx.helpers.setOrientations(t,s)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,s)=>{this.addXaxisAnnotation(t,e.node,s)}),e}}class Fs{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new Es(this.annoCtx),this.axesUtils=new vt(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,s){const i=this.w,a=t.strokeDashArray;let r=this.helpers.getY1Y2("y1",t),o=r.yP;const n=r.clipped;let l,h=!0,c=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!n){c=!0;const s=this.annoCtx.graphics.drawLine(0+t.offsetX,o+t.offsetY,this._getYAxisAnnotationWidth(t),o+t.offsetY,t.borderColor,a,t.borderWidth);e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),l=r.yP,h=r.clipped,l>o){const t=o;o=l,l=t}if(!n||!h){c=!0;const s=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),o-l,0,t.fillColor,t.opacity,1,t.borderColor,a);s.node.classList.add("apexcharts-annotation-rect"),s.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`),e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}if(c){const a="right"===t.label.position?i.layout.gridWidth:"center"===t.label.position?i.layout.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:(null!=l?l:o)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:s}),e.appendChild(r.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let s=e.layout.gridWidth;return s=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),s+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,s)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,s)}),e}}class Ts{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new Es(this.annoCtx)}addPointAnnotation(t,e,s){const i=this.w;if(i.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const a=this.helpers.getX1X2("x1",t),r=a.x,o=a.clipped,n=this.helpers.getY1Y2("y1",t),l=n.yP,h=n.clipped;if(b.isNumber(r)&&!h&&!o){const a={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let o=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,l+t.marker.offsetY,a);e.appendChild(o.node),nt(o,r,i);const n=t.label.text?t.label.text:"",h=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:n,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:s}),e.appendChild(h.node),nt(h,r,i),t.customSVG.SVG){const s=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});s.attr({transform:`translate(${r+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),s.node.innerHTML=t.customSVG.SVG,e.appendChild(s.node)}if(t.image.path){const e=t.image.width?t.image.width:20,s=t.image.height?t.image.height:20;o=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:l+t.image.offsetY-s/2,width:e,height:s,path:t.image.path,appendTo:".apexcharts-point-annotations"})}t.mouseEnter&&o.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&o.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&o.node.addEventListener("click",t.click.bind(this,t))}}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,s)=>{this.addPointAnnotation(t,e.node,s)}),e}}Cs.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:s=null}={}){this.w=t,this.theme=e,this.timeScale=s,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new gt(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new Es(this),this.xAxisAnnotations=new Ps(this),this.yAxisAnnotations=new Fs(this),this.pointsAnnotations=new Ts(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&&t.globals.dataPoints){const e=this.yAxisAnnotations.drawYAxisAnnotations(),s=this.xAxisAnnotations.drawXAxisAnnotations(),i=this.pointsAnnotations.drawPointAnnotations(),a=t.config.chart.animations.enabled,r=[e,s,i],o=[s.node,e.node,i.node],n="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[n,!1,n];for(let e=0;e<3;e++)t.dom.elGraphical.add(r[e]),!a||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&o[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:o[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,s){this.xAxisAnnotations.addXaxisAnnotation(t,e,s)}addYaxisAnnotation(t,e,s){this.yAxisAnnotations.addYaxisAnnotation(t,e,s)}addPointAnnotation(t,e,s){this.pointsAnnotations.addPointAnnotation(t,e,s)}addText(t){const{x:e,y:s,text:i,textAnchor:a,foreColor:r,fontSize:o,fontFamily:n,fontWeight:l,cssClass:h,backgroundColor:c,borderWidth:d,strokeDashArray:g,borderRadius:p,borderColor:u,appendTo:x=".apexcharts-svg",paddingLeft:f=4,paddingRight:m=4,paddingBottom:b=2,paddingTop:y=2}=t,w=this.w,v=this.graphics.drawText({x:e,y:s,text:i,textAnchor:a||"start",fontSize:o||"12px",fontWeight:l||"regular",fontFamily:n||w.config.chart.fontFamily,foreColor:r||w.config.chart.foreColor,cssClass:h}),A=w.dom.baseEl.querySelector(x);A&&A.appendChild(v.node);const C=v.bbox();if(i){const t=this.graphics.drawRect(C.x-f,C.y-y,C.width+f+m,C.height+b+y,p,c||"transparent",1,d,u,g);A.insertBefore(t.node,v.node)}}addImage(t){const e=this.w,{path:s,x:i=0,y:a=0,width:r=20,height:o=20,appendTo:n=".apexcharts-svg"}=t,l=e.dom.Paper.image(s);l.size(r,o).move(i,a);const h=e.dom.baseEl.querySelector(n);return h&&h.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,s){return this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"xaxis",contextMethod:s.addXaxisAnnotation}),s}addYaxisAnnotationExternal(t,e,s){return this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"yaxis",contextMethod:s.addYaxisAnnotation}),s}addPointAnnotationExternal(t,e,s){return void 0===this.invertAxis&&(this.invertAxis=s.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"point",contextMethod:s.addPointAnnotation}),s}addAnnotationExternal({params:t,pushToMemory:e,context:s,type:i,contextMethod:a}){const r=s,o=r.w,n=o.dom.baseEl.querySelector(`.apexcharts-${i}-annotations`),l=n.childNodes.length+1,h=new k,c=Object.assign({},"xaxis"===i?h.xAxisAnnotation:"yaxis"===i?h.yAxisAnnotation:h.pointAnnotation),d=b.extend(c,t);switch(i){case"xaxis":this.addXaxisAnnotation(d,n,l);break;case"yaxis":this.addYaxisAnnotation(d,n,l);break;case"point":this.addPointAnnotation(d,n,l)}const g=o.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${l}']`),p=this.helpers.addBackgroundToAnno(g,d);return p&&n.insertBefore(p.node,g),e&&o.globals.memory.methodsToExec.push({context:r,id:d.id?d.id:b.randomId(),method:a,label:"addAnnotation",params:t}),s}clearAnnotations(t){const e=t.w,s=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(s,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const s=t.w,i=s.dom.baseEl.querySelectorAll(`.${e}`);i&&(s.globals.memory.methodsToExec.map((t,i)=>{t.id===e&&s.globals.memory.methodsToExec.splice(i,1)}),Object.keys(s.config.annotations).forEach(t=>{const i=s.config.annotations[t];Array.isArray(i)&&(s.config.annotations[t]=i.filter(t=>t.id!==e))}),Array.prototype.forEach.call(i,t=>{t.parentElement.removeChild(t)}))}}});Cs.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;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}),this.ctx.events.removeEventListener("legendClick",this._onLegendClick))}_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,s,i;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==(s=this.ctx.toolbar)||s.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.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,s=this.ctx.toolbar;if(!s)return;const i=Number(e.globals.minX),a=Number(e.globals.maxX);if(!isFinite(i)||!isFinite(a)||i===a)return;const r=.1*(a-i)*t;s.zoomUpdateOptions(i+r,a+r),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const s=this.w,i=s.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 a=this._getSeriesCount();let r=this.seriesIndex+t,o=0;for(;o<a&&(r<0&&(r=i?a-1:0),r>=a&&(r=i?0:a-1),s.globals.collapsedSeriesIndices.includes(r));)r+=t,o++;this.seriesIndex=r;const n=this._getDataPointCount(r);this.dataPointIndex>=n&&(this.dataPointIndex=n-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let s=this.dataPointIndex+e;s<0&&(s=i?t-1:0),s>=t&&(s=i?0:t-1),this.dataPointIndex=s,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,s=this._getDataPointCount(e);let i=this.dataPointIndex,a=0;if(Array.isArray(t.seriesData.series[e])){for(;a<s&&null===t.seriesData.series[e][i];)i=(i+1)%s,a++;this.dataPointIndex=i}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,s=this._getDataPointCount(e);let i=this.dataPointIndex,a=0;if(Array.isArray(t.seriesData.series[e])){for(;a<s&&null===t.seriesData.series[e][i];)i=(i-1+s)%s,a++;this.dataPointIndex=i}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,s=this.w,i=s.globals.tooltip;i&&i.ttItems&&(s.interact.capturedSeriesIndex=t,s.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,i))}_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 s=e.getElTooltip();s&&(s.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&s.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const i=e.getElXCrosshairs();i&&i.classList.remove("apexcharts-active")}_showTooltip(t,e,s){const i=this.w,a=i.config.chart.type,r=s.getElTooltip();if(!r)return;const o=s.getCachedDimensions();s.tooltipRect={x:0,y:0,ttWidth:o.ttWidth||0,ttHeight:o.ttHeight||0},this._setSyntheticEvent(t,e,s),i.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===a||"donut"===a||"polarArea"===a?this._showTooltipNonAxis(t,e,s,r):"radialBar"===a?this._showTooltipRadialBar(t,e,s,r):"heatmap"===a||"treemap"===a?this._showTooltipHeatTree(t,e,s,r,a):"bar"===a||"candlestick"===a||"boxPlot"===a||"violin"===a||"rangeBar"===a?this._showTooltipBar(t,e,s):this._showTooltipAxisLine(t,e,s)}_setSyntheticEvent(t,e,s){const i=this.w,a=i.config.chart.type;let r=0,o=0;const n=this._getFocusableElement(t,e);if(n){const t=n.getBoundingClientRect();r=t.left+t.width/2,o=t.top+t.height/2}else if(i.globals.pointsArray&&i.globals.pointsArray[t]&&i.globals.pointsArray[t][e]){const a=i.globals.pointsArray[t][e],n=s.getElGrid&&s.getElGrid();if(n){const t=n.getBoundingClientRect();r=t.left+(a[0]||0),o=t.top+(a[1]||0)}}else{const t=i.dom.Paper&&i.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,o=e.top+e.height/2}}if(("line"===a||"area"===a||"rangeArea"===a||"scatter"===a||"bubble"===a||"radar"===a)&&i.globals.pointsArray&&i.globals.pointsArray[t]&&i.globals.pointsArray[t][e]){const a=i.globals.pointsArray[t][e],n=s.getElGrid&&s.getElGrid();if(n){const t=n.getBoundingClientRect();r=t.left+(a[0]||0),o=t.top+(a[1]||0)}}s.e={type:"mousemove",clientX:r,clientY:o}}_showTooltipBar(t,e,s){var i,a,r,o;const h=this.w,c=s.tConfig.shared&&(s.tooltipUtil.isXoverlap(e)||h.globals.isBarHorizontal)&&s.tooltipUtil.isInitialSeriesSameLen(),d=null==(o=null==(r=null==(a=null==(i=h.rangeData.seriesRange)?void 0:i[t])?void 0:a[e])?void 0:r.y)?void 0:o[0];s.tooltipLabels.drawSeriesTexts(l(n(n({ttItems:s.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:c}));const g=`.apexcharts-series[data\\:realIndex='${t}']`,p=h.dom.Paper.findOne(`${g} path[j='${e}'], ${g} circle[j='${e}'], ${g} rect[j='${e}']`);if(p){this._leaveHoveredBar();new gt(this.w,this.ctx).pathMouseEnter(p,null),this._hoveredBarEl=p}if(h.globals.isBarHorizontal){const t=p&&p.node;if(t){const e=h.dom.elWrap.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.left-e.left,r=i.top-e.top,o=i.height,n=i.width,l=s.tooltipRect.ttWidth||0,c=r+o/2-(s.tooltipRect.ttHeight||0)/2;let d=a+n;a<(s.xyRatios&&null!=s.xyRatios.baseLineInvertedY?s.xyRatios.baseLineInvertedY:e.width/2)&&(d=a-l);const g=s.getElTooltip();g&&(g.style.left=d+"px",g.style.top=c+"px")}}else s.tooltipPosition.moveStickyTooltipOverBars(e,t)}_showTooltipAxisLine(t,e,s){const i=this.w,a=i.config.chart.type,r=s.tConfig.shared&&s.tooltipUtil.isXoverlap(e)&&s.tooltipUtil.isInitialSeriesSameLen();s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,j:e,shared:r});const o="scatter"===a||"bubble"===a,n=i.globals.markers.largestSize>0;o?this._showScatterBubblePoint(t,e,s):n?r?s.marker.enlargePoints(e):s.tooltipPosition.moveDynamicPointOnHover(e,t):r?s.tooltipPosition.moveDynamicPointsOnHover(e):s.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,s){const i=this.w.dom.baseEl;this._enlargedScatterMarker&&(s.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const a=i.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!a)return;const r=a.querySelector(`.apexcharts-marker[rel='${e}']`);r&&(s.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r)}_showTooltipNonAxis(t,e,s,i){var a,r;const o=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:e,shared:!1});const n=i.getBoundingClientRect(),l=n.width||s.tooltipRect.ttWidth||0,h=n.height||s.tooltipRect.ttHeight||0,c=o.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`);if(c){const t=parseFloat(null!=(a=c.getAttribute("data:cx"))?a:""),e=parseFloat(null!=(r=c.getAttribute("data:cy"))?r:"");if(!isNaN(t)&&!isNaN(e)){const s=o.dom.Paper.node.getBoundingClientRect(),a=o.dom.elWrap.getBoundingClientRect(),r=s.left-a.left,n=s.top-a.top;i.style.left=r+t-l/2+"px",i.style.top=n+e-h-10+"px"}}}_showTooltipRadialBar(t,e,s,i){var a;const r=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,shared:!1});const{ttWidth:o=0,ttHeight:n=0}=s.getCachedDimensions(),l=r.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(a=l.getAttribute("data:angle"))?a:"")||0,s=(r.config.plotOptions.radialBar.startAngle||0)+e/2,h=r.layout.gridWidth/2,c=r.layout.gridHeight/2,d=r.globals.radialSize||Math.min(r.layout.gridWidth,r.layout.gridHeight)/2,g=r.seriesData.series.length,p=d/Math.max(g,1),u=d-t*p,x=(u+(u-p))/2,f=b.polarToCartesian(h,c,x,s),m=f.x+(r.layout.translateX||0),y=f.y+(r.layout.translateY||0);i.style.left=m-o/2+"px",i.style.top=y-n-10+"px"}}_showTooltipHeatTree(t,e,s,i,a){var r,o;const n=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,j:e,shared:!1});const l=i.getBoundingClientRect(),h=l.width||s.tooltipRect.ttWidth||0,c=l.height||s.tooltipRect.ttHeight||0,d="heatmap"===a?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",g=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(g){const t=n.dom.elWrap.getBoundingClientRect(),e=g.getBoundingClientRect(),a=e.left-t.left,l=e.top-t.top,d=e.width,p=e.height,u=parseFloat(null!=(r=g.getAttribute("cx"))?r:""),x=parseFloat(null!=(o=g.getAttribute("width"))?o:"");s.tooltipPosition.moveXCrosshairs(u+x/2);let f=a+d+h/2;const m=l+p/2-c/2;a+d>n.layout.gridWidth/2&&(f=a-h/2),i.style.left=f+"px",i.style.top=m+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const s=this._getFocusableElement(t,e);if(s){s.classList.add("apexcharts-keyboard-focused"),s.setAttribute("role","img");const i=this._buildPointLabel(t,e);i&&s.setAttribute("aria-label",i),this._focusedEl=s}}_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 s,i,a,r,o,n,l,h;const c=this.w,d=c.config.chart.type,g=c.seriesData.seriesNames||[],p=c.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(i=(null==(s=c.labelData)?void 0:s.labels)&&c.labelData.labels[e])?i:"",a=Array.isArray(p)?p[e]:"";return t?`${t}: ${a}`:`${a}`}if("radialBar"===d){return`${g[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const u=g[t]||`Series ${t+1}`,x=(Array.isArray(p[t])?p[t]:[])[e];let f=null==x?"":String(x);const m=null==(r=null==(a=c.formatters)?void 0:a.yLabelFormatters)?void 0:r[t];if("function"==typeof m)try{f=m(x,{seriesIndex:t,dataPointIndex:e,w:c})}catch(t){}let b="";const y=null==(o=c.labelData)?void 0:o.categoryLabels,w=null==(l=null==(n=c.seriesData)?void 0:n.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 s=null==(h=c.formatters)?void 0:h.xLabelFormatter;if("function"==typeof s)try{b=String(s(w[e],{seriesIndex:t,dataPointIndex:e,w:c}))}catch(t){b=String(w[e])}else b=String(w[e])}return b?`${u}: ${f}, ${b}`:`${u}: ${f}`}_leaveHoveredBar(){if(this._hoveredBarEl){new gt(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const s=this.w,i=s.config.chart.type,a=s.dom.baseEl;if("pie"===i||"donut"===i||"polarArea"===i)return a.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===i)return a.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===i)return a.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===i)return a.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===i||"candlestick"===i||"boxPlot"===i||"violin"===i||"rangeBar"===i)return a.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return a.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,s=e.config.chart.type;if("pie"===s||"donut"===s||"polarArea"===s)return e.seriesData.series.length;const i=e.seriesData.series;return i[t]&&Array.isArray(i[t])?i[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,s=this.seriesIndex;if(!t.interact.zoomed)return;const i=t.seriesData.seriesX&&t.seriesData.seriesX[s];if(!i||!i.length)return;const a=e.minX,r=e.maxX;if(void 0===a||void 0===r)return;const o=i[this.dataPointIndex];if(o>=a&&o<=r)return;const n=i.length;for(let t=0;t<n;t++)if(i[t]>=a&&i[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,s=e.globals,i=this.seriesIndex,a=e.seriesData.seriesX&&e.seriesData.seriesX[i];if(!a||!a.length)return;const r=s.minX,o=s.maxX;if(void 0===r||void 0===o)return;const n=a.length;if(t>=0){for(let t=0;t<n;t++)if(a[t]>=r&&a[t]<=o)return void(this.dataPointIndex=t)}else for(let t=n-1;t>=0;t--)if(a[t]>=r&&a[t]<=o)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const s=this.w,i=s.globals;if(!s.interact.zoomed)return!0;const a=s.seriesData.seriesX&&s.seriesData.seriesX[t];if(!a)return!0;const r=a[e];return void 0===r||r>=i.minX&&r<=i.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const s=e.dom.baseEl;if(!s)return;const i=s.querySelector(".apexcharts-sr-status");i&&(i.textContent="",setTimeout(()=>{i.textContent=t},0))}}});const Is=new Set(["bar","funnel","pyramid"]),Xs=new Set(["pie","donut","polarArea","radialBar","gauge"]);function Rs(t){return Is.has(t)?"bar":Xs.has(t)?"radial":null}Cs.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null}canMorphTypes(t,e){if(t===e)return!1;const s=Rs(t),i=Rs(e);return!(!s||!i)}isCompatibleSeriesShape(t,e,s){if(!Array.isArray(s)||0===s.length)return!1;const i=Rs(t),a=Rs(e);return"radial"===a?!!s.every(t=>"number"==typeof t)||1===s.length&&s[0]&&"object"==typeof s[0]&&Array.isArray(s[0].data):"bar"===a?s.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==i&&null!==a}captureBeforeDestroy({fromType:t,toType:e,newSeries:s}){if(this._snapshot=null,!c.isBrowser())return!1;const i=this.w.config.chart.animations;if(!i||!1===i.enabled)return!1;if(i.chartTypeMorph&&!1===i.chartTypeMorph.enabled)return!1;if(i.respectReducedMotion&&ot())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,s))return!1;const a=this._captureFromDOM(t);if(!a.length)return!1;const r=this._buildMapping(a,t,e,s);return 0!==r.size&&(this._snapshot={fromType:t,toType:e,mapping:r,oldLayout:{translateX:this.w.layout.translateX||0,translateY:this.w.layout.translateY||0}},this.w.globals.previousPaths=[],!0)}_captureFromDOM(t){var e;const s=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!s)return[];const i=[],a=Rs(t);if("bar"===a){s.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const s=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]").forEach((t,e)=>{const a=t.getAttribute("pathTo")||t.getAttribute("d");a&&i.push({realIndex:s,j:e,d:a,fill:t.getAttribute("fill")})})})}else if("radial"===a)if("radialBar"===t||"gauge"===t){const t=this.w.layout.gridWidth/2,e=Math.min(this.w.layout.gridWidth,this.w.layout.gridHeight)/2;s.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(s=>{var a;const r=s.parentElement,o=parseInt(null!=(a=null==r?void 0:r.getAttribute("data:realIndex"))?a:"0",10),n=s.getAttribute("d");if(!n)return;const l=parseFloat(s.getAttribute("stroke-width")||"0"),h=l>1&&this._radialArcToFilledSegment(n,l,t,e)||n;i.push({realIndex:o,j:0,d:h,fill:s.getAttribute("stroke")})})}else{s.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const s=t.getAttribute("d");s&&i.push({realIndex:e,j:0,d:s,fill:t.getAttribute("fill")})})}return i}_radialArcToFilledSegment(t,e,s,i){const a=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!a)return null;const r=parseFloat(a[1]),o=parseFloat(a[2]),n=parseFloat(a[3]),l=parseInt(a[4],10),h=parseInt(a[5],10),c=parseFloat(a[6]),d=parseFloat(a[7]);if(!isFinite(n)||n<=0)return null;const g=e/2,p=n+g,u=Math.max(0,n-g),x=(t,e,a)=>{const r=t-s,o=e-i,n=Math.sqrt(r*r+o*o);if(0===n)return{x:s,y:i};const l=a/n;return{x:s+r*l,y:i+o*l}},f=x(r,o,p),m=x(c,d,p),b=x(r,o,u),y=x(c,d,u),w=h?0:1;return`M ${f.x} ${f.y} A ${p} ${p} 0 ${l} ${h} ${m.x} ${m.y} L ${y.x} ${y.y} A ${u} ${u} 0 ${l} ${w} ${b.x} ${b.y} Z`}buildRingSegmentPath(t,e,s,i,a,r){const o=i/2,n=s+o,l=Math.max(0,s-o),h=(a-90)*Math.PI/180,c=(r-90)*Math.PI/180,d=t+n*Math.cos(h),g=e+n*Math.sin(h),p=t+n*Math.cos(c),u=e+n*Math.sin(c),x=t+l*Math.cos(h),f=e+l*Math.sin(h),m=t+l*Math.cos(c),b=e+l*Math.sin(c),y=r>a?1:0,w=Math.abs(r-a)>180?1:0;return`M ${d} ${g} A ${n} ${n} 0 ${w} ${y} ${p} ${u} L ${m} ${b} A ${l} ${l} 0 ${w} ${1-y} ${x} ${f} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,s,i){const a=new Map,r=Rs(s),o=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("radial"===r)return o.forEach((t,e)=>{a.set(`${e}:0`,{d:t.d,fill:t.fill})}),a;if("bar"===r){const t=[];return(Array.isArray(i)?i:[]).forEach((e,s)=>{const i=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<i.length;e++)t.push({realIndex:s,j:e})}),o.forEach((e,s)=>{const i=t[s];i&&a.set(`${i.realIndex}:${i.j}`,{d:e.d,fill:e.fill})}),a}return a}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const s=this._snapshot.mapping.get(`${t}:${e}`);if(!s)return null;const i=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),a=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return 0===i&&0===a?s.d:this._translatePathD(s.d,i,a)}_translatePathD(t,e,s){if(0===e&&0===s)return t;return R(t).map(t=>{const i=t[0];return"Z"===i?"Z":"M"===i||"L"===i||"T"===i?`${i} ${t[1]+e} ${t[2]+s}`:"H"===i?`${i} ${t[1]+e}`:"V"===i?`${i} ${t[1]+s}`:"C"===i?`${i} ${t[1]+e} ${t[2]+s} ${t[3]+e} ${t[4]+s} ${t[5]+e} ${t[6]+s}`:"S"===i||"Q"===i?`${i} ${t[1]+e} ${t[2]+s} ${t[3]+e} ${t[4]+s}`:"A"===i?`${i} ${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]+e} ${t[7]+s}`:t.join(" ")}).join(" ")}getInitialFillFor(t,e){if(!this._snapshot)return null;const s=this._snapshot.mapping.get(`${t}:${e}`);return s?s.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||!c.isBrowser())return;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e)return;const s=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 ${s}ms ease-out`,m.requestAnimationFrame(()=>{t.style.opacity="1"}),setTimeout(()=>{t.style.transition="",t.style.opacity=""},s+80))})}),setTimeout(()=>this.cleanup(),s+100)}cleanup(){this._snapshot=null}}});const zs="http://www.w3.org/1999/xhtml";class Bs{constructor(t,e,s){this.w=t,this.ctx=e,this.drilldown=s}render(t){if(!c.isBrowser())return;const e=this.w,s=e.dom.elWrap;if(!s)return;const i=s.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i);const a=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!a||!1===a.show)return;if(0===this.drilldown.depth)return;const r=m.createElementNS(zs,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label","Drilldown breadcrumb"),this._position(r,a);const o=null!=a.separator?a.separator:" / ";t.forEach((e,s)=>{if(s>0){const t=m.createElementNS(zs,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=o,r.appendChild(t)}const i=this._label(e,s);if(s===t.length-1){const t=m.createElementNS(zs,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=i,r.appendChild(t)}else{const t=m.createElementNS(zs,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===s){const e=m.createElementNS(zs,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=m.createElementNS(zs,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=i,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(s)),r.appendChild(t)}}),s.appendChild(r)}_label(t,e){const s=this.w.config.drilldown.breadcrumb;let i;if(0===e)i=null!=s.rootLabel?s.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);i=e&&e.name||String(t)}return"function"==typeof s.formatter?s.formatter(i,{index:e,depth:this.drilldown.depth}):i}_position(t,e){const s=e.offsetX||0,i=e.offsetY||0;t.style.position="absolute",t.style.top=i+"px","top-right"===e.position?t.style.right=3-s+"px":t.style.left=s+"px"}}Cs.registerFeatures({drilldown:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.rootSnapshot=null,this._wired=!1,this.breadcrumb=new Bs(t,e,this),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),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)))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,s){const i=this._resolveChild(t);return i?this._drillInto(i,e,s):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,s):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 s=this.path[this.path.length-1],i=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const a=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(i),"up",{from:s,to:a})}_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,s){if(this.stack.length>=32)return Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const i=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:i,to:t.id,point:e,seriesIndex:s&&s.seriesIndex,dataPointIndex:s&&s.dataPointIndex})}_drillDownAsync(t,e,s){const i=this.w.config.drilldown.onDrillDown;let a;try{a=i({point:e,seriesIndex:s&&s.seriesIndex,dataPointIndex:s&&s.dataPointIndex})}catch(e){return this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}return Promise.resolve(a).then(t=>t&&t.data?this._drillInto(t,e,s):this.ctx,e=>(this._fire("drillDownError",{id:t,error:e}),this.ctx))}_snapshot(){const t=this.w.config,e=this._overrideFields(),s={series:b.clone(t.series)};return Array.isArray(t.labels)&&t.labels.length&&(s.labels=b.clone(t.labels)),s.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(s.xaxis=b.clone(t.xaxis)),e.has("yaxis")&&(s.yaxis=b.clone(t.yaxis)),e.has("colors")&&(s.colors=t.colors?b.clone(t.colors):void 0),e.has("plotOptions")&&(s.plotOptions=b.clone(t.plotOptions)),e.has("fill")&&(s.fill=b.clone(t.fill)),e.has("legend")&&(s.legend=b.clone(t.legend)),s}_overrideFields(){const t=new Set,e=this.w.config.drilldown&&this.w.config.drilldown.series||[];for(const s of e)s&&(s.xaxis&&t.add("xaxis"),s.yaxis&&t.add("yaxis"),s.colors&&t.add("colors"),s.plotOptions&&t.add("plotOptions"),s.fill&&t.add("fill"),s.legend&&t.add("legend"));return t}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const s={};return t.chart&&t.chart.type&&(s.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(s.stacked=t.chart.stacked),Object.keys(s).length&&(e.chart=s),t.xaxis&&(e.xaxis=t.xaxis),t.yaxis&&(e.yaxis=t.yaxis),t.colors&&(e.colors=t.colors),t.plotOptions&&(e.plotOptions=t.plotOptions),t.fill&&(e.fill=t.fill),t.legend&&(e.legend=t.legend),e}_viewFromSnapshot(t){const e={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(e.labels=t.labels),t.xaxis&&(e.xaxis=t.xaxis),t.yaxis&&(e.yaxis=t.yaxis),t.colors&&(e.colors=t.colors),t.plotOptions&&(e.plotOptions=t.plotOptions),t.fill&&(e.fill=t.fill),t.legend&&(e.legend=t.legend),e}_apply(t,e,s){const i=this.w;i.interact.selectedDataPoints=[],i.globals.collapsedSeries=[],i.globals.collapsedSeriesIndices=[],i.globals.ancillaryCollapsedSeries=[],i.globals.ancillaryCollapsedSeriesIndices=[],i.globals.allSeriesCollapsed=!1,i.globals.risingSeries=[];const a=(!i.config.drilldown.animation||!1!==i.config.drilldown.animation.enabled)&&!1!==i.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",s);const r=e=>this.ctx.updateOptions(t,!1,e,!1,!1),o=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",s),this.ctx);if(a&&this._zoomEnabled()){const t=this._triggerOrigin(s);if(t)return this._zoomDrill(t,e,()=>r(!1)).then(o)}return r(a).then(o)}_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(!c.isBrowser())return null;const e=this._svgNode(),s=this._markGroup();if(!e||!s||"function"!=typeof s.animate||"function"!=typeof e.getBoundingClientRect)return null;const i=e.getBoundingClientRect();let a=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(a=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),a&&"function"==typeof a.getBoundingClientRect){const t=a.getBoundingClientRect();return{x:t.left+t.width/2-i.left,y:t.top+t.height/2-i.top}}const r=s.getBoundingClientRect();return{x:r.left+r.width/2-i.left,y:r.top+r.height/2-i.top}}_zoomDrill(t,e,s){return i=this,a=null,r=function*(){const i=this._zoomDuration(),a="down"===e,r=Math.round(.55*i),o=a?"scale(1.03)":"scale(0.97)",n=a?"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`},h=this._markGroup();let c=null;if(h){l(h),c=h.animate([{transform:"scale(1)",opacity:1},{transform:o,opacity:0}],{duration:r,easing:"ease-in",fill:"forwards"});try{yield c.finished}catch(t){}}yield s();const d=this._markGroup();if(d){l(d),d.style.opacity="0",d.style.transform=n,c&&h===d&&c.cancel();const t=d.animate([{transform:n,opacity:0},{transform:"scale(1)",opacity:1}],{duration:i,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(g=d).style.transform="",g.style.opacity="",g.style.transformOrigin="",g.style.transformBox="",t.cancel()}var g},new Promise((t,e)=>{var s=t=>{try{n(r.next(t))}catch(t){e(t)}},o=t=>{try{n(r.throw(t))}catch(t){e(t)}},n=e=>e.done?t(e.value):Promise.resolve(e.value).then(s,o);n((r=r.apply(i,a)).next())});var i,a,r}_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 s=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof s&&s(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,s){if(!s)return;const i=this._pointAt(s.seriesIndex,s.dataPointIndex);return i&&"object"==typeof i&&null!=i.drilldown?this.drillDown(i.drilldown,i,s):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,i,s):void 0}_pointAt(t,e){const s=this.w.config.series;if(!Array.isArray(s)||null==t||null==e)return null;const i=s[t];return i&&Array.isArray(i.data)&&null!=i.data[e]?i.data[e]:null}_afterRender(){this.w.config.drilldown&&this.w.config.drilldown.enabled&&(this._markDrillableTargets(),this.breadcrumb.render(this.path))}_markDrillableTargets(){if(!c.isBrowser())return;const t=this.w,e=t.dom.baseEl,s=t.config.series;e&&Array.isArray(s)&&s.forEach((t,s)=>{const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;e.querySelectorAll(`[index="${s}"][j="${i}"]`).forEach(t=>t.classList.add("apexcharts-drilldown-target"))})})}}});function Ys(t,e){const s=null!=t,i=null!=e;return s||i?{min:s?t:null,max:i?e:null}:null}function Ns(t){return Array.isArray(t)?t.map(t=>Array.isArray(t)?t.slice():t):[]}function Os(t,e){return"function"==typeof t&&e?t===e.addXaxisAnnotation?"xaxis":t===e.addYaxisAnnotation?"yaxis":t===e.addPointAnnotation?"point":null:null}function Hs(t,e){const s=t.config.annotations?b.clone(t.config.annotations):null,i=[],a=t.globals.memory&&t.globals.memory.methodsToExec||[];for(const t of a){if(!t||"addAnnotation"!==t.label)continue;const s=Os(t.method,e);s&&i.push({kind:s,params:b.clone(t.params)})}return{static:s,dynamic:i}}function Ws(t){const e=t&&t.measure;if(!e||"function"!=typeof e.getPins)return null;const s=e.getPins();return Array.isArray(s)&&s.length?{pins:s}:null}function $s(t,e){var s,i;const a=t.config.xaxis||{},r=(Array.isArray(t.config.yaxis)?t.config.yaxis:t.config.yaxis?[t.config.yaxis]:[]).map(t=>Ys(t&&t.min,t&&t.max)),o=r.some(t=>null!==t),n=t.config.theme,l=e&&e.drilldown;return{v:1,window:{xaxis:Ys(a.min,a.max),yaxis:o?r:null},zoomed:!!t.interact.zoomed,collapsed:(t.globals.collapsedSeriesIndices||[]).slice(),ancillaryCollapsed:(t.globals.ancillaryCollapsedSeriesIndices||[]).slice(),selectedDataPoints:Ns(t.interact.selectedDataPoints),theme:n?{mode:null!=(s=n.mode)?s:null,palette:null!=(i=n.palette)?i:null}:null,locale:t.config.chart&&t.config.chart.defaultLocale||null,annotations:Hs(t,e),drill:l&&l.depth>0?{path:l.path.slice()}:null,measure:Ws(e)}}function js(t,e){if(!t||!e)return;const s=t.w;s.interact.zoomed=!!e.zoomed,function(t,e,s){const i=t.w,a=i.globals.seriesNames||[],r=new Set([...e||[],...s||[]]),o=new Set([...i.globals.collapsedSeriesIndices||[],...i.globals.ancillaryCollapsedSeriesIndices||[]]);for(let e=0;e<a.length;e++){const s=a[e];if(null==s)continue;const i=r.has(e),n=o.has(e);i&&!n?t.hideSeries(s):!i&&n&&t.showSeries(s)}}(t,e.collapsed,e.ancillaryCollapsed),e.annotations&&Array.isArray(e.annotations.dynamic)&&e.annotations.dynamic.forEach(e=>{const s=function(t){switch(t){case"xaxis":return"addXaxisAnnotation";case"yaxis":return"addYaxisAnnotation";case"point":return"addPointAnnotation";default:return null}}(e.kind);s&&"function"==typeof t[s]&&t[s](e.params,!0)}),function(t,e){Array.isArray(e)&&(t.w.interact.selectedDataPoints=Ns(e))}(t,e.selectedDataPoints),e.locale&&e.locale!==s.config.chart.defaultLocale&&t.setLocale(e.locale),t.measure&&"function"==typeof t.measure.setPins&&t.measure.setPins(e.measure&&e.measure.pins||[])}const Gs="apex";function Vs(t){return function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"utf-8").toString("base64");const e=(new TextEncoder).encode(t);let s="";for(let t=0;t<e.length;t++)s+=String.fromCharCode(e[t]);return btoa(s)}(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Us(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4;)e+="=";return function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"base64").toString("utf-8");const e=atob(t),s=new Uint8Array(e.length);for(let t=0;t<e.length;t++)s[t]=e.charCodeAt(t);return(new TextDecoder).decode(s)}(e)}class qs{constructor(t,e){this.w=t,this.ctx=e,this._saved=[],this._counter=0}capture(){const t={v:1,view:$s(this.w,this.ctx)},e=this._serializableDelta();return e&&Object.keys(e).length&&(t.options=e),t}_serializableDelta(){const t=this.w.config,e=t.chart&&t.chart.perspectives&&t.chart.perspectives.serializeOptions||["theme","xaxis","yaxis","title","subtitle"],s={};return e.forEach(e=>{if(void 0!==t[e]){const i=function(t){try{return JSON.parse(JSON.stringify(t))}catch(t){return}}(t[e]);void 0!==i&&(s[e]=i)}}),s}encode(t){const e=t||this.capture();return Vs(JSON.stringify(e))}decode(t){return qs.decode(t)}toURL(){if(!c.isBrowser())return"";const t=this.encode(this.capture()),e=new URL(window.location.href);return e.hash=`${Gs}=${t}`,e.toString()}apply(t,e={}){const s="string"==typeof t?qs.decode(t):t;if(!s||!s.view)return;const i=void 0===e.animate||e.animate,a=b.extend(s.options?b.clone(s.options):{},e.mergeOptions||{}),r=Object.keys(a).length?a:void 0;(this.w.config.chart.group?this.ctx.getSyncedCharts():[this.ctx]).forEach(t=>{!function(t,e,{animate:s=!0,mergeOptions:i}={}){var a,r;if(!t||!e)return;"number"==typeof e.v&&e.v,t.clearAnnotations();const o=i?b.clone(i):{},n=e.window&&e.window.xaxis;o.xaxis=Object.assign({},o.xaxis,n?{min:null!=(a=n.min)?a:void 0,max:null!=(r=n.max)?r:void 0}:{min:void 0,max:void 0});const l=e.window&&e.window.yaxis;if(Array.isArray(l)&&(o.yaxis=l.map(t=>{var e,s;return t?{min:null!=(e=t.min)?e:void 0,max:null!=(s=t.max)?s:void 0}:{}})),e.theme){const t={};null!=e.theme.mode&&(t.mode=e.theme.mode),null!=e.theme.palette&&(t.palette=e.theme.palette),Object.keys(t).length&&(o.theme=Object.assign({},o.theme,t))}e.annotations&&e.annotations.static&&(o.annotations=b.clone(e.annotations.static)),t.updateOptions(o,!1,s,!1,!1),js(t,e)}(t,s.view,{animate:i,mergeOptions:r})})}save(t){const e="perspective-"+ ++this._counter;return this._saved.push({id:e,name:t||e,token:this.capture()}),e}list(){return this._saved.map(t=>({id:t.id,name:t.name,token:t.token}))}delete(t){const e=this._saved.findIndex(e=>e.id===t);e>-1&&this._saved.splice(e,1)}teardown(){this._saved=[],this._counter=0}static decode(t){if("string"!=typeof t||!t)return null;try{const e=JSON.parse(Us(t));return e&&"object"==typeof e?1!==e.v?null:e:null}catch(t){return null}}static fromURL(t){try{const e=t||(c.isBrowser()?window.location.href:"");if(!e)return null;const s=new URL(e).hash.replace(/^#/,"");if(!s)return null;const i=s.split("&").map(t=>t.split("=")).find(t=>t[0]===Gs);return i&&null!=i[1]?qs.decode(decodeURIComponent(i[1])):null}catch(t){return null}}}Cs.registerFeatures({perspectives:qs}),Cs.perspectives={decode:t=>qs.decode(t),fromURL:t=>qs.fromURL(t)};Cs.registerFeatures({storyboard:class{constructor(t,e){this.w=t,this.ctx=e,this._beats=[],this._observer=null,this._activeIndex=-1,this._animate=!0,this._warnedNoPerspectives=!1}bind(t={}){var e;if(this.unbind(),!c.isBrowser())return 0;const s=this.ctx.el&&this.ctx.el.ownerDocument;if(!s||"undefined"==typeof IntersectionObserver)return 0;let i=null;if(t.scroller&&(i="string"==typeof t.scroller?s.querySelector(t.scroller):t.scroller),this._beats=this._resolveBeats(s,i,t.beats),!this._beats.length)return 0;this._animate=!1!==t.animate;const a=Math.min(Math.max(null!=(e=t.offset)?e:.5,0),1),r=+(100*a).toFixed(3),o=+(100-100*a).toFixed(3);return this._observer=new IntersectionObserver(t=>this._onIntersect(t),{root:i,rootMargin:`-${r}% 0px -${o}%`,threshold:0}),this._beats.forEach(t=>{var e;return null==(e=this._observer)?void 0:e.observe(t.el)}),this._beats.length}_resolveBeats(t,e,s){const i=[];if(Array.isArray(s))return s.forEach((e,s)=>{var a,r;if(!e)return;const o=e.el&&"object"==typeof e.el?e.el:e.selector?t.querySelector(e.selector):null;o&&i.push({el:o,key:null!=(r=null!=(a=e.key)?a:o.getAttribute("data-apex-beat"))?r:String(s),view:e.view,options:e.options,announce:e.announce,onEnter:"function"==typeof e.onEnter?e.onEnter:void 0})}),i;return(e||t).querySelectorAll("[data-apex-beat]").forEach((t,e)=>{i.push({el:t,key:t.getAttribute("data-apex-beat")||String(e),view:t.getAttribute("data-apex-view")||void 0,options:void 0,announce:t.getAttribute("data-apex-announce")||void 0,onEnter:void 0})}),i}_onIntersect(t){t.forEach(t=>{const e=this._beats.findIndex(e=>e.el===t.target);e<0||(t.isIntersecting?this._activate(e):e===this._activeIndex&&t.rootBounds&&t.boundingClientRect.top>=t.rootBounds.bottom&&e>0&&this._activate(e-1))})}_activate(t,e={}){var s,i;if(t===this._activeIndex)return;const a=this._beats[t];if(!a)return;const r=t>this._activeIndex?"down":"up";this._activeIndex=t;const o=(void 0!==e.animate?e.animate:this._animate)&&!ot();if(null!=a.view||a.options)if(this.ctx.perspectives){const t=null!=(s=a.view)?s:{},e="string"==typeof t||t.view?t:{view:this._normalizeView(t)};this.ctx.perspectives.apply(e,{animate:o,mergeOptions:a.options})}else this._warnedNoPerspectives||(this._warnedNoPerspectives=!0);const n={index:t,key:a.key,el:a.el,direction:r};a.onEnter&&a.onEnter(this.ctx,n),a.announce&&this._announce(a.announce),"function"==typeof this.w.config.chart.events.beatChange&&this.w.config.chart.events.beatChange(this.ctx,n),null==(i=this.ctx.events)||i.fireEvent("beatChange",[this.ctx,n])}_normalizeView(t){const e=t.annotations&&t.annotations.static||{};return l(n({},t),{annotations:{static:n({points:[],xaxis:[],yaxis:[],texts:[],images:[]},e),dynamic:t.annotations&&t.annotations.dynamic||[]}})}goTo(t,e={}){const s="number"==typeof t?t:this._beats.findIndex(e=>e.key===t);s>=0&&s<this._beats.length&&this._activate(s,e)}current(){if(this._activeIndex<0)return null;const t=this._beats[this._activeIndex];return{index:this._activeIndex,key:t?t.key:null}}unbind(){this._observer&&(this._observer.disconnect(),this._observer=null),this._beats=[],this._activeIndex=-1}teardown(){this.unbind()}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const s=e.dom.baseEl;if(!s)return;const i=s.querySelector(".apexcharts-sr-status");i&&(i.textContent="",setTimeout(()=>{i.textContent=t},0))}}});Cs.registerFeatures({history:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.pointer=-1,this.applying=!1,this._batching=!1,this._counter=0,this._coalesceTimer=null,this._settleTimer=null,this._pendingLabel=void 0,this._keydownTarget=null,this._pointerTarget=null,this._engaged=!1,this._wired=!1,this._readConfig(),this._onMounted=this._onMounted.bind(this),this._onUpdated=this._onUpdated.bind(this),this._onSelection=this._onSelection.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this.init()}_readConfig(){const t=this.w,e=t.config.chart&&t.config.chart.history||{};this.enabled=!!e.enabled,this.maxDepth=e.maxDepth>0?e.maxDepth:100,this.coalesceMs=null!=e.coalesceMs?e.coalesceMs:250,this.keyboard=!1!==e.keyboard}_syncConfig(){this._readConfig(),this.enabled&&this.keyboard?this._wireKeyboard():this._unwireKeyboard()}init(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onMounted),this.ctx.addEventListener("updated",this._onUpdated),this.ctx.addEventListener("scrolled",this._onUpdated),this.ctx.addEventListener("dataPointSelection",this._onSelection),this.enabled&&this.keyboard&&this._wireKeyboard())}_wireKeyboard(){if(this._keydownTarget)return;const t=this.ctx.el,e=t&&t.ownerDocument;c.isBrowser()&&e&&(e.addEventListener("keydown",this._onKeyDown),e.addEventListener("pointerdown",this._onPointerDown,!0),e.addEventListener("mousedown",this._onPointerDown,!0),this._keydownTarget=e,this._pointerTarget=e)}_unwireKeyboard(){this._keydownTarget&&(this._keydownTarget.removeEventListener("keydown",this._onKeyDown),this._keydownTarget=null),this._pointerTarget&&(this._pointerTarget.removeEventListener("pointerdown",this._onPointerDown,!0),this._pointerTarget.removeEventListener("mousedown",this._onPointerDown,!0),this._pointerTarget=null),this._engaged=!1}_onMounted(){this._syncConfig(),this.enabled&&0===this.stack.length&&this._commit("initial",!0)}_onUpdated(){this._syncConfig(),this.enabled&&(this.applying?this._refreshSettle():this._schedule("update"))}_onSelection(){this.enabled&&!this.applying&&this._schedule("selection")}_onPointerDown(t){const e=this.ctx.el;this._engaged=!!(e&&t.target&&e.contains(t.target))}_onKeyDown(t){if(!t.metaKey&&!t.ctrlKey)return;const e=(t.key||"").toLowerCase();if("z"!==e&&"y"!==e)return;const s=this.ctx.el;if(!s)return;const i=s.ownerDocument,a=i&&i.activeElement;if(function(t){if(!t)return!1;const e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||!0===t.isContentEditable}(a))return;if(!s.contains(a)&&!this._engaged)return;const r="y"===e||t.shiftKey;t.preventDefault(),r?this.redo():this.undo()}_schedule(t){this.applying||this._batching||!this.enabled||(this._pendingLabel=t,this.coalesceMs>0&&c.isBrowser()?(clearTimeout(this._coalesceTimer),this._coalesceTimer=setTimeout(()=>this._commit(this._pendingLabel),this.coalesceMs)):this._commit(t))}_commit(t,e){if(clearTimeout(this._coalesceTimer),this._coalesceTimer=null,!e&&(this.applying||this._batching))return;const s=this._capture(t),i=this.stack[this.pointer];if(!i||i.sig!==s.sig){for(this.pointer<this.stack.length-1&&this.stack.splice(this.pointer+1),this.stack.push(s),this.pointer=this.stack.length-1;this.stack.length>this.maxDepth;)this.stack.shift(),this.pointer--;this._emitChange()}}_capture(t){const e=$s(this.w,this.ctx),{config:s,seriesSig:i}=this._cloneConfigCOW();return{id:"hist-"+ ++this._counter,view:e,config:s,seriesSig:i,label:t||"change",at:c.isBrowser()?Date.now():0,origin:"local",sig:this._signature(e,s)}}_cloneConfigCOW(){const t=this.w,e=this.stack[this.pointer];let s,o=null;try{o=JSON.stringify(t.config.series)}catch(t){o=null}if(e&&null!==o&&e.seriesSig===o){const o=t.config,{series:n}=o,l=((t,e)=>{var s={};for(var o in t)a.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&i)for(var o of i(t))e.indexOf(o)<0&&r.call(t,o)&&(s[o]=t[o]);return s})(o,["series"]);s=b.clone(l),s.series=e.config.series}else s=b.clone(t.config);return{config:s,seriesSig:o}}_signature(t,e){try{return JSON.stringify(t)+"|"+JSON.stringify(e)}catch(t){return`nosig-${this._counter}`}}_restore(t,e){if(!t)return;let s;this.applying=!0;try{this.ctx.clearAnnotations(),s=this.ctx.updateOptions(b.clone(t.config),!1,e,!1,!1)}catch(t){throw this.applying=!1,t}Promise.resolve(s).then(()=>{js(this.ctx,t.view),this._refreshSettle(),this._emitChange()}).catch(()=>{this.applying=!1})}_refreshSettle(){c.isBrowser()?(clearTimeout(this._settleTimer),this._settleTimer=setTimeout(()=>{this.applying=!1},0)):this.applying=!1}snapshot(t){this.enabled&&!this.applying&&this._commit(t||"change")}undo(t=!0){this.canUndo()&&(this.pointer--,this._restore(this.stack[this.pointer],t))}redo(t=!0){this.canRedo()&&(this.pointer++,this._restore(this.stack[this.pointer],t))}canUndo(){return this.pointer>0}canRedo(){return this.pointer>-1&&this.pointer<this.stack.length-1}jump(t,e=!0){const s=this.stack.findIndex(e=>e.id===t);-1!==s&&s!==this.pointer&&(this.pointer=s,this._restore(this.stack[s],e))}clear(){clearTimeout(this._coalesceTimer),this._coalesceTimer=null;const t=this.stack[this.pointer];this.stack=t?[t]:[],this.pointer=this.stack.length-1,this._emitChange()}transaction(t,e={}){if("function"!=typeof t)return Promise.resolve();const s=this._batching;return this._batching=!0,Promise.resolve().then(()=>t()).finally(()=>{this._batching=s,s||this._commit(e.label||"transaction",!0)})}entries(){return this.stack.map(t=>({id:t.id,label:t.label,at:t.at}))}state(){return{canUndo:this.canUndo(),canRedo:this.canRedo(),index:this.pointer,length:this.stack.length}}_emitChange(){this.ctx.events.fireEvent("historyChange",[this.ctx,this.state()])}teardown(){var t,e,s,i,a,r,o,n;clearTimeout(this._coalesceTimer),clearTimeout(this._settleTimer),this._coalesceTimer=null,this._settleTimer=null,this._unwireKeyboard(),this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onMounted),null==(i=(s=this.ctx).removeEventListener)||i.call(s,"updated",this._onUpdated),null==(r=(a=this.ctx).removeEventListener)||r.call(a,"scrolled",this._onUpdated),null==(n=(o=this.ctx).removeEventListener)||n.call(o,"dataPointSelection",this._onSelection)),this.stack=[],this.pointer=-1,this._wired=!1}}});const Zs=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function Ks(t){const e={};return Zs.forEach(s=>{"function"==typeof t[s]&&(e[s]=t[s].bind(t))}),Object.freeze(e)}Cs.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=(s=t.name,ws()[s]||null);var s;if(!e)return;const i=null!=e.apiVersion?e.apiVersion:1;if(1!==Math.trunc(i))return;const a={def:e,options:Object.freeze(n({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};a.api=function(t,e){const s=t.ctx,i=t.w,a={name:e.def.name,version:1,get options(){return e.options},on(t,s){const i=e.handlers;return i.has(t)||i.set(t,[]),i.get(t).push(s),a},off(t,s){const i=e.handlers.get(t);if(i){const t=i.indexOf(s);t>-1&&i.splice(t,1)}return a},store:{},layer:s=>t._layer(e.def.name,s||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return i.config.theme.mode},get foreColor(){return i.config.chart.foreColor},seriesColor:t=>i.globals.colors[t],token:e=>t._token(e)}),chart:Ks(s),emit(t,i){s.events.fireEvent(`plugin:${e.def.name}:${t}`,[s,i])},get el(){return i.dom.baseEl}};return Object.freeze(a)}(this,a),this.active.push(a),this._guard(a,"setup",()=>e.setup(a.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 s=e&&e.pass||"full";let i=null;for(const e of this.active){if(e.disabled)continue;const a=e.handlers.get(t);if(!a||!a.length)continue;null===i&&(i=this._dataSnapshot(),this._lastData=i);const r={api:e.api,scales:this._currentScales,data:i,pass:s,hook:t};for(const s of a.slice())this._guard(e,t,()=>s(r))}}_guard(t,e,s){if(!t.disabled)try{s()}catch(e){t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0)}}_setScales(t){const e=this.w,s=e.globals,i=e.layout;if(!t||!s.axisCharts)return void(this._currentScales=null);const a=t.xRatio,r=t.yRatio||[],o=t=>null!=s.maxYArr[t]?s.maxYArr[t]:s.maxY,n=t=>null!=s.minYArr[t]?s.minYArr[t]:s.minY;this._currentScales={x:t=>i.translateX+(t-s.minX)/a,y:(t,e=0)=>i.translateY+(o(e)-t)/(t=>null!=r[t]?r[t]:r[0])(e),domainX:[s.minX,s.maxX],domainY:(t=0)=>[n(t),o(t)],gridWidth:i.gridWidth,gridHeight:i.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,s=t.seriesData.series||[],i=t.seriesData.seriesX||[];return s.map((t,s)=>{const a=i[s]||[],r=(t||[]).map((t,e)=>({x:null!=a[e]?a[e]:e,y:t}));return{name:e.seriesNames?e.seriesNames[s]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(s),color:e.colors?e.colors[s]:void 0,points:r}})}_token(t){const e=this.w,s=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return s.colors?s.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&s.colors?s.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:s=""}={}){let i=this._layers.get(t);if(!i){i=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${s}`.trim()});const a=this.w.dom.elGraphical.node;"behind"===e?a.insertBefore(i.node,a.firstChild):a.appendChild(i.node),i.node.setAttribute("aria-hidden","true"),this._layers.set(t,i)}return function(t,e){const s=e=>(e&&t.add(e),e),i={get node(){return t.node},path(t={}){const{d:i="",stroke:a="#000",width:r=1,fill:o="none",opacity:n=1,dash:l=0,className:h=""}=t;return s(e.drawPath({d:i,stroke:a,strokeWidth:r,fill:o,fillOpacity:"none"===o?0:n,strokeOpacity:n,strokeDashArray:l,classes:h}))},line(t={}){const{x1:i,y1:a,x2:r,y2:o,stroke:n="#000",width:l=1,dash:h=0}=t;return s(e.drawLine(i,a,r,o,n,h,l))},rect(t={}){const{x:i=0,y:a=0,w:r=0,h:o=0,r:n=0,fill:l="#000",stroke:h=null,opacity:c=1}=t;return s(e.drawRect(i,a,r,o,n,l,c,null!=h?1:null,h))},circle(t={}){const{cx:i=0,cy:a=0,r:r=0,fill:o="#000",stroke:n=null}=t;return s(e.drawCircle(r,{cx:i,cy:a,fill:o,stroke:n||"none"}))},text(t={}){const{x:i=0,y:a=0,text:r="",color:o,size:n,anchor:l="start",weight:h}=t;return s(e.drawText({x:i,y:a,text:r,textAnchor:l,fontSize:n,foreColor:o,fontWeight:h}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return i}};return i}(i,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 s=this.active[t],i=e.get(s.def.name);i?s.options=Object.freeze(n({},i.entry.options||{})):(this._guard(s,"destroy",()=>s.def.destroy&&s.def.destroy(s.api)),this.active.splice(t,1))}const s=new Set(this.active.map(t=>t.def.name)),i=[];e.forEach((t,e)=>{s.has(e)||i.push(t)}),i.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()}}});const Js={fill:"fill",stroke:"stroke","stroke-width":"strokeWidth","stroke-dasharray":"strokeDash","stroke-linecap":"lineCap","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","fill-rule":"fillRule"},Qs=Symbol("never"),ti={circle:0,square:1,rect:1,triangle:2,diamond:3,star:4,sparkle:5,cross:6,plus:7,line:8},ei=["circle","square","triangle","diamond","star","sparkle","cross","plus","line"],si={attr:()=>si,plot:()=>si,during:()=>si,after:t=>("function"==typeof t&&t(),si),animate:()=>si,delay:()=>si,loop:()=>si,finish:()=>si,stop:()=>si},ii={nodeName:"path",style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(){},getAttribute:()=>null,removeAttribute(){},hasAttribute:()=>!1,addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})},ai={__isCanvasMark:!0,node:{nodeName:"g",instance:null,style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(){},getAttribute:()=>null,removeAttribute(){},addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})},attr:()=>ai,add:()=>ai,addTo:()=>ai,remove:()=>ai,clear:()=>ai,css:()=>ai,hide:()=>ai,show:()=>ai,removeClass:()=>ai,animate:()=>si};class ri{constructor(t,e){this.__isCanvasMark=!0,this._g=t,this._i=e}get node(){return ii}attr(t,e){return"string"==typeof t?("fill"===t&&void 0!==e&&this._g._setMarkerFill(this._i,e),void 0===e?null:this):(t&&void 0!==t.fill&&this._g._setMarkerFill(this._i,t.fill),this)}add(t){return this}addTo(t){return this}remove(){return this}css(t){return this}fill(t){return void 0!==t&&this._g._setMarkerFill(this._i,t),this}stroke(t){return this}hide(){return this}show(){return this}removeClass(t){return this}animate(){return si}}class oi{constructor(t){this.__isCanvasMark=!0,this._cmd=t;const e=this;this.node={nodeName:t?t.tag:"g",instance:this,style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(t,s){e._applyAttr(t,s)},getAttribute:()=>null,removeAttribute(){},hasAttribute:()=>!1,addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})}}_applyAttr(t,e){const s=this._cmd;if(!s)return;const i=Js[t];void 0!==i&&(s[i]=e)}attr(t,e){if("string"==typeof t)return void 0===e?null:(this._applyAttr(t,e),this);for(const e in t)void 0!==t[e]&&this._applyAttr(e,t[e]);return this}add(t){return this}addTo(t){return this}remove(){return this}clear(){return this}css(t){return this}fill(t){return"object"==typeof t?this.attr(t):this.attr("fill",t)}stroke(t){return"object"==typeof t?(void 0!==t.color&&this.attr("stroke",t.color),void 0!==t.width&&this.attr("stroke-width",t.width),this):this.attr("stroke",t)}plot(t){return"string"==typeof t&&this._cmd&&"path"===this._cmd.tag&&(this._cmd.d=t),this}hide(){return this}show(){return this}removeClass(t){return this}bbox(){return{x:0,y:0,width:0,height:0}}animate(){return si}}class ni{constructor(t){this.w=t,this._g=new gt(t),this._list=[],this._mx=new Float64Array(16),this._my=new Float64Array(16),this._msize=new Float64Array(16),this._mshape=new Int16Array(16),this._mstyle=new Int32Array(16),this._msi=new Int32Array(16),this._mn=0,this._mcap=16,this._styles=[],this._styleMap=new Map,this._lf=Qs,this._ls=Qs,this._lsw=Qs,this._ld=Qs,this._lfo=Qs,this._lso=Qs,this._lid=-1,this._lofFill=Qs,this._lofBase=-1,this._lofId=-1}_resetStyleCache(){this._lf=Qs,this._ls=Qs,this._lsw=Qs,this._ld=Qs,this._lfo=Qs,this._lso=Qs,this._lid=-1,this._lofFill=Qs,this._lofBase=-1,this._lofId=-1}reset(){this._list=[],this._mn=0,this._styles=[],this._styleMap=new Map,this._resetStyleCache();const t=this.w.config.series||[];let e=16;for(let s=0;s<t.length;s++){const i=t[s]&&t[s].data;Array.isArray(i)&&(e+=i.length)}e=Math.ceil(1.15*e)+16,e>this._mcap&&this._allocMarkers(e)}_allocMarkers(t){this._mcap=t,this._mx=new Float64Array(t),this._my=new Float64Array(t),this._msize=new Float64Array(t),this._mshape=new Int16Array(t),this._mstyle=new Int32Array(t),this._msi=new Int32Array(t)}_growMarkers(){const t=2*this._mcap,e=new Float64Array(t);e.set(this._mx),this._mx=e;const s=new Float64Array(t);s.set(this._my),this._my=s;const i=new Float64Array(t);i.set(this._msize),this._msize=i;const a=new Int16Array(t);a.set(this._mshape),this._mshape=a;const r=new Int32Array(t);r.set(this._mstyle),this._mstyle=r;const o=new Int32Array(t);o.set(this._msi),this._msi=o,this._mcap=t}displayList(){return this._list}markerCount(){return this._mn}_internStyle(t,e,s,i,a,r){const o=`${t}|${e}|${s}|${i}|${a}|${r}`,n=this._styleMap.get(o);if(void 0!==n)return n;const l=this._styles.length;return this._styles.push({fill:t,stroke:e,strokeWidth:s,strokeDash:i,fillOpacity:a,strokeOpacity:r}),this._styleMap.set(o,l),l}_setMarkerFill(t,e){const s=this._mstyle[t];if(e===this._lofFill&&s===this._lofBase)return void(this._mstyle[t]=this._lofId);const i=this._styles[s];if(!i||i.fill===e)return this._lofFill=e,this._lofBase=s,void(this._lofId=s);const a=this._internStyle(e,i.stroke,i.strokeWidth,i.strokeDash,i.fillOpacity,i.strokeOpacity);this._mstyle[t]=a,this._lofFill=e,this._lofBase=s,this._lofId=a}markerStyle(t){return this._styles[this._mstyle[t]]}markerSeries(t){return this._msi[t]}shapeName(t){return ei[t]||"circle"}_cmd(t,e){const s={tag:t,z:e||0,fill:void 0,stroke:void 0,strokeWidth:void 0,strokeDash:void 0,lineCap:void 0,fillOpacity:void 0,strokeOpacity:void 0,fillRule:void 0};return this._list.push(s),s}group(t){return ai}drawMarker(t,e,s={}){var i;const a=this._markerStyleId(s);this._mn>=this._mcap&&this._growMarkers();const r=this._mn++;return this._mx[r]=t||0,this._my[r]="number"==typeof e?e:NaN,this._msize[r]=s.pSize||0,this._mshape[r]=null!=(i=ti[s.shape||"circle"])?i:0,this._mstyle[r]=a,this._msi[r]=null==s.seriesIndex?-1:s.seriesIndex,new ri(this,r)}_markerStyleId(t){const e=t.shape||"circle",s="line"===e||"plus"===e||"cross"===e,i=s?"none":t.pointFillColor,a=s?t.pointFillColor:t.pointStrokeColor,r=t.pointStrokeWidth,o=t.pointStrokeDashArray,n=t.pointFillOpacity,l=s?t.pointFillOpacity:t.pointStrokeOpacity;if(i===this._lf&&a===this._ls&&r===this._lsw&&o===this._ld&&n===this._lfo&&l===this._lso)return this._lid;const h=this._internStyle(i,a,r,o,n,l);return this._lf=i,this._ls=a,this._lsw=r,this._ld=o,this._lfo=n,this._lso=l,this._lid=h,h}renderPaths(t){const e=this._cmd("path",t.realIndex);return e.d=t.pathTo,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.fill=t.fill,e.lineCap=t.strokeLinecap,e.si=t.realIndex,this.w.globals.animationEnded=!0,new oi(e)}drawPath(t){const e=this._cmd("path",0);return e.d=t.d,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.fill=t.fill,e.fillOpacity=t.fillOpacity,e.strokeOpacity=t.strokeOpacity,e.lineCap=t.strokeLinecap,e.strokeDash=t.strokeDashArray,new oi(e)}drawLine(t,e,s,i,a="#a8a8a8",r=0,o=1){const n=this._cmd("line",0);return n.lx1=t,n.ly1=e,n.lx2=s,n.ly2=i,n.stroke=a,n.strokeDash=r,n.strokeWidth=o,new oi(n)}drawRect(t=0,e=0,s=0,i=0,a=0,r="#fefefe",o=1,n=null,l=null,h=0){const c=this._cmd("rect",0);return c.x1=t,c.y1=e,c.rw=s>0?s:0,c.rh=i>0?i:0,c.radius=a,c.fill=r,c.fillOpacity=o,null!=l&&(c.stroke=l,c.strokeWidth=null==n?1:n,c.strokeDash=h),new oi(c)}drawCircle(t,e=null){const s=this._cmd("circle",0);return s.r=t<0?0:t,e&&(s.cx=e.cx,s.cy=e.cy,void 0!==e.fill&&(s.fill=e.fill),void 0!==e.stroke&&(s.stroke=e.stroke)),new oi(s)}drawText(t){const e=this._cmd("text",0);return e.text=Array.isArray(t.text)?t.text.join(" "):t.text,e.tx=t.x,e.ty=t.y,e.textAnchor=t.textAnchor||"start",e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.foreColor,new oi(e)}markerPath(t,e,s,i){return this._g.getMarkerPath(t,e,ei[s]||"circle",i)}}const li=2*Math.PI;class hi{constructor(t){this.w=t,this._host=null,this._canvas=null,this._c2d=null,this._margin=0,this._dpr=1,this._dim=null,this._alpha=1}_seriesAlpha(t){const e=this._dim;return!e||null==e.active||e.active<0||null==t||t<0||t===e.active?1:null==e.opacity?.2:e.opacity}_plotDims(){var t;const e=Math.max(0,Math.ceil(this.w.layout.gridWidth||0)),s=Math.max(0,Math.ceil(this.w.layout.gridHeight||0)),i=(null==(t=this.w.globals.markers)?void 0:t.largestSize)||0;return{gw:e,gh:s,margin:Math.ceil(i+8)}}createHost(){const t=m.getWindow();this._dpr=Math.min(2,t&&t.devicePixelRatio||1);const{gw:e,gh:s,margin:i}=this._plotDims();this._margin=i;const a=e+2*i,r=s+2*i,o=m.createElementNS(F,"foreignObject");o.setAttribute("x",String(-i)),o.setAttribute("y",String(-i)),o.setAttribute("width",String(a)),o.setAttribute("height",String(r)),o.setAttribute("class","apexcharts-canvas-series"),o.style.overflow="visible";const n=m.createElement("canvas");return n.setAttribute("class","apexcharts-series-canvas"),n.width=Math.max(1,Math.round(a*this._dpr)),n.height=Math.max(1,Math.round(r*this._dpr)),n.style.width=a+"px",n.style.height=r+"px",n.style.pointerEvents="none",o.appendChild(n),this._canvas=n,this._c2d=n.getContext("2d"),this._host=new ss(o),this._host}getHost(){return this._host}clear(){this._c2d&&this._canvas&&(this._c2d.setTransform(1,0,0,1,0,0),this._c2d.clearRect(0,0,this._canvas.width,this._canvas.height))}_syncDpr(){if(!this._canvas)return;const t=m.getWindow(),e=Math.min(2,t&&t.devicePixelRatio||1);if(e===this._dpr)return;this._dpr=e;const s=parseFloat(this._canvas.style.width)||0,i=parseFloat(this._canvas.style.height)||0;this._canvas.width=Math.max(1,Math.round(s*e)),this._canvas.height=Math.max(1,Math.round(i*e))}paint(t,e,s=null){const i=this._c2d;if(!i)return;this._dim=s||null,this._syncDpr(),this.clear();const a=this._dpr,r=this._margin;if(i.setTransform(a,0,0,a,r*a,r*a),t.length){const e=t.length>1?t.map((t,e)=>[t,e]).sort((t,e)=>t[0].z===e[0].z?t[1]-e[1]:t[0].z-e[0].z).map(t=>t[0]):t;for(let t=0;t<e.length;t++){const s=e[t];this._alpha=this._dim?this._seriesAlpha(s.si):1,this._paintOne(i,s)}}this._paintMarkers(i,e),this._alpha=1}_paintMarkers(t,e){const s=e.markerCount();if(!s)return;const i=e._mx,a=e._my,r=e._msize,o=e._mshape,n=e._mstyle,l=!!this._dim;l||(this._alpha=1);let h=0;for(;h<s;){const c=n[h],d=o[h],g=e.markerStyle(h);if(g)if(0===d){const d=this._applyFill(t,g),p=this._applyStroke(t,g),u=null==g.fillOpacity?1:Number(g.fillOpacity),x=null==g.strokeOpacity?1:Number(g.strokeOpacity);let f=h;for(;f<s&&0===o[f]&&n[f]===c;){const s=r[f]||0,o=a[f];if(s>0&&o==o)if(t.beginPath(),t.arc(i[f],o,s,0,li),l){const s=this._seriesAlpha(e.markerSeries(f));d&&(t.globalAlpha=u*s,t.fill()),p&&(t.globalAlpha=x*s,t.stroke())}else d&&t.fill(),p&&t.stroke();f++}t.globalAlpha=1,h=f}else{const s=a[h];if(s==s&&r[h]>0){this._alpha=l?this._seriesAlpha(e.markerSeries(h)):1;try{const a=new Path2D(e.markerPath(i[h],s,d,r[h]));this._fillStrokePath(t,g,a)}catch(t){}}h++}else h++}}_paintOne(t,e){switch(e.tag){case"path":if(!e.d)return;if(!e.path2d)try{e.path2d=new Path2D(e.d)}catch(t){return}this._fillStrokePath(t,e,e.path2d);break;case"rect":{const s=new Path2D;e.radius&&"function"==typeof s.roundRect?s.roundRect(e.x1,e.y1,e.rw,e.rh,e.radius):s.rect(e.x1,e.y1,e.rw,e.rh),this._fillStrokePath(t,e,s);break}case"circle":if(!(e.r>0))return;t.beginPath(),t.arc(e.cx,e.cy,e.r,0,li),this._fillStroke(t,e);break;case"line":t.beginPath(),t.moveTo(e.lx1,e.ly1),t.lineTo(e.lx2,e.ly2),this._strokeOnly(t,e);break;case"text":{if(null==e.text)return;t.save(),t.globalAlpha=this._alpha,t.fillStyle=e.fill||"#000";const s=e.fontSize||"11px";t.font=`${"number"==typeof s?s+"px":s} ${e.fontFamily||"Helvetica, Arial, sans-serif"}`,t.textAlign="middle"===e.textAnchor?"center":"end"===e.textAnchor?"right":"left",t.fillText(String(e.text),e.tx,e.ty),t.restore();break}}}_fillStrokePath(t,e,s){this._applyFill(t,e)&&t.fill(s,"evenodd"===e.fillRule?"evenodd":"nonzero"),this._applyStroke(t,e)&&t.stroke(s),t.globalAlpha=1}_fillStroke(t,e){this._applyFill(t,e)&&t.fill(),this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}_strokeOnly(t,e){this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}_applyFill(t,e){const s=e.fill;return!(!s||"none"===s)&&(("string"!=typeof s||0!==s.indexOf("url("))&&(t.globalAlpha=(null==e.fillOpacity?1:Number(e.fillOpacity))*this._alpha,t.fillStyle=s,!0))}_applyStroke(t,e){const s=e.stroke,i=null==e.strokeWidth?1:Number(e.strokeWidth);if(!(s&&"none"!==s&&i>0))return!1;if("string"==typeof s&&0===s.indexOf("url("))return!1;t.globalAlpha=(null==e.strokeOpacity?1:Number(e.strokeOpacity))*this._alpha,t.strokeStyle=s,t.lineWidth=i,t.lineCap=e.lineCap||"butt";const a=e.strokeDash;return a&&0!==a?t.setLineDash(Array.isArray(a)?a:[Number(a)]):t.setLineDash([]),!0}toDataURL(){return this._canvas?this._canvas.toDataURL():null}destroy(){this._host=null,this._canvas=null,this._c2d=null}}class ci{constructor(t,e){this.w=t,this.ctx=e,this.kind="canvas",this._g=new ni(t),this._compositor=new hi(t)}beginSeries(){this._g.reset()}present(){const t=this._compositor.createHost();return this._compositor.paint(this._g.displayList(),this._g),t}clear(){this._compositor.clear()}group(t){return this._g.group(t)}drawPath(t){return this._g.drawPath(t)}drawLine(...t){return this._g.drawLine(...t)}drawRect(...t){return this._g.drawRect(...t)}drawCircle(t,e){return this._g.drawCircle(t,e)}drawMarker(t,e,s){return this._g.drawMarker(t,e,s)}renderPaths(t){return this._g.renderPaths(t)}drawText(t){return this._g.drawText(t)}supports(t){return"solidFill"===t||"dashArray"===t}hitTest(t,e){return null}restyle(t){this._compositor.paint(this._g.displayList(),this._g,t||null)}toBitmap(){const t=this._compositor.toDataURL();if(!t)return null;const e=this.w.globals,s=this.w.config.chart,i=this._compositor._margin;return{dataURL:t,x:(e.translateX||0)+(s.offsetX||0)-i,y:(e.translateY||0)+(s.offsetY||0)-i,w:(this.w.layout.gridWidth||0)+2*i,h:(this.w.layout.gridHeight||0)+2*i}}destroy(){this._compositor.destroy()}}Cs.registerRenderer("canvas",(t,e)=>new ci(t,e)),Cs._customSeriesFactory=function(t,e){const s=class{constructor(t,e,s){this.w=t,this.ctx=e,this.xyRatios=s,this._warned=!1}draw(t,s,i){var a,r;const o=this.w,n=new gt(o,this.ctx),l=xt(this.ctx,n),h=n.group({class:"apexcharts-marks-series"});return t.forEach((t,s)=>{var a;const r=Array.isArray(i)?i[s]:s,c=n.group({class:"apexcharts-series",rel:r+1,seriesName:b.escapeString(o.seriesData.seriesNames[r]),"data:realIndex":r}),d=this._scales(r,(o.seriesData.series[r]||[]).length),g=o.globals.colors[r],p=(null==(a=o.config.series[r])?void 0:a.data)||[],u=o.seriesData.seriesX[r]||[],x=o.seriesData.series[r]||[];o.globals.seriesXvalues[r]=[],o.globals.seriesYvalues[r]=[],void 0===o.globals.pointsArray[r]&&(o.globals.pointsArray[r]=[]);for(let t=0;t<x.length;t++){const s=x[t];if(null==s)continue;const i=u[t],a=d.xAt(t,i),n=d.y(s),h=this._api(l,c,r,t);try{e.renderItem({datum:p[t],x:a,y:n,scales:d,api:h,seriesIndex:r,dataPointIndex:t,color:g})}catch(t){this._warned||(this._warned=!0)}o.globals.seriesXvalues[r][t]=a,o.globals.seriesYvalues[r][t]=n,o.globals.pointsArray[r][t]=[a,n]}n.setupEventDelegation(c,".apexcharts-marks-mark"),h.add(c)}),null==(r=null==(a=this.ctx.animations)?void 0:a.animationCompleted)||r.call(a,h),h}_scales(t,e){var s,i,a,r;const o=this.w.globals,n=this.w.config,l=this.xyRatios.xRatio,h=this.xyRatios.yRatio,c=null!=(i=null==(s=o.seriesYAxisReverseMap)?void 0:s[t])?i:0,d=Array.isArray(h)?null!=(a=h[c])?a:h[0]:h,g=o.maxYArr,p=Array.isArray(g)&&g.length&&null!=(r=g[c])?r:o.maxY,u=o.gridWidth,x=o.gridHeight,f=!o.isXNumeric,m=e||o.dataPoints||1,b=m>0?u/m:u,y="on"===n.xaxis.tickPlacement,w=t=>(t-o.minX)/l,v=o.minXDiff||1;return{x:w,xAt:(t,e)=>f?y&&m>1?t/(m-1)*u:(t+.5)*b:w(e),y:t=>(p-t)/d,gridWidth:u,gridHeight:x,band:f?b:l?v/l:u}}_api(t,e,s,i){const a=t=>{if(t){try{t.node.setAttribute("index",String(s)),t.node.setAttribute("j",String(i)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var s,i,r,o,n,l,h,c,d;return a(t.drawPath({d:e.d||"",stroke:null!=(s=e.stroke)?s:"#000",strokeWidth:null!=(r=null!=(i=e.width)?i:e.strokeWidth)?r:1,fill:null!=(o=e.fill)?o:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(n=e.opacity)?n:1:0,strokeOpacity:null!=(c=null!=(h=e.strokeOpacity)?h:e.opacity)?c:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var s,i,r,o;return a(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(s=e.stroke)?s:"#000",null!=(i=e.dash)?i:0,null!=(o=null!=(r=e.width)?r:e.strokeWidth)?o:1))},rect:(e={})=>{var s,i,r,o,n,l,h,c;return a(t.drawRect(null!=(s=e.x)?s:0,null!=(i=e.y)?i:0,null!=(r=e.w)?r:0,null!=(o=e.h)?o:0,null!=(n=e.r)?n:0,null!=(l=e.fill)?l:"#000",null!=(h=e.opacity)?h:1,null!=e.stroke?null!=(c=e.strokeWidth)?c:1:null,e.stroke))},circle:(e={})=>{var s,i,r,o,n;return a(t.drawCircle(null!=(s=e.r)?s:0,{cx:null!=(i=e.cx)?i:0,cy:null!=(r=e.cy)?r:0,fill:null!=(o=e.fill)?o:"#000",stroke:e.stroke||"none","stroke-width":null!=(n=e.strokeWidth)?n:e.stroke?1:0}))},text:(e={})=>{var s,i,r,o;return a(t.drawText({x:null!=(s=e.x)?s:0,y:null!=(i=e.y)?i:0,text:null!=(r=e.text)?r:"",textAnchor:null!=(o=e.anchor)?o:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return s.dataType=e.dataType||"xy",s.yExtent="function"==typeof e.yExtent?e.yExtent:null,s};class di{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!c.isBrowser())return;const s=this._ensureMedia();s&&(this._applyToConfig(s),this._ensureListeners(s))}_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,s=()=>{const t=e._osThemeMedia;if(!t)return;const s={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?s.accessibility={colorBlindMode:"highContrast"}:s.accessibility={colorBlindMode:""},e.updateOptions({theme:s},!1,!0,!1)};di._add(t.dark,s),di._add(t.contrast,s),t.handler=s}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(di._remove(t.dark,t.handler),di._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))}}Cs.registerFeatures({osThemeWatcher:di});const gi="__apexcharts_crossfilters__";function pi(t){if(!Number.isFinite(t))return t;const e=Number(t.toPrecision(12));return Object.is(e,-0)?0:e}function ui(t){return"number"==typeof t&&Number.isFinite(t)}function xi(t){if("function"==typeof t)return t;if(t&&"object"==typeof t){if("string"==typeof t.sum){const e=t.sum;return t=>t.reduce((t,s)=>t+(Number(s[e])||0),0)}if("string"==typeof t.avg){const e=t.avg;return t=>t.length?t.reduce((t,s)=>t+(Number(s[e])||0),0)/t.length:0}if("string"==typeof t.min){const e=t.min;return t=>t.length?Math.min(...t.map(t=>Number(t[e])||0)):0}if("string"==typeof t.max){const e=t.max;return t=>t.length?Math.max(...t.map(t=>Number(t[e])||0)):0}}return t=>t.length}function fi(t,e){return"function"==typeof e?t.slice().sort(e):"asc"===e?t.slice().sort((t,e)=>t>e?1:t<e?-1:0):"desc"===e?t.slice().sort((t,e)=>t<e?1:t>e?-1:0):t}function mi(t,e){if(!ui(t))return-1;const s=e.length-1;if(t<e[0]||t>e[s])return-1;if(t===e[s])return s-1;for(let i=0;i<s;i++)if(t>=e[i]&&t<e[i+1])return i;return-1}class bi{constructor(t,e){this.id=t,this.records=Array.isArray(e)?e:[],this.dims=new Map,this._listeners=new Map}static _store(){const t=globalThis;return t[gi]||(t[gi]=new Map),t[gi]}static getOrCreate(t){if(!t||"string"!=typeof t.id)throw new Error("ApexCharts.crossfilter requires an { id } string.");const e=bi._store();let s=e.get(t.id);return s?(t.records&&s.setRecords(t.records),s):(s=new bi(t.id,t.records),e.set(t.id,s),s)}static get(t){return bi._store().get(t)||null}setRecords(t){return this.records=Array.isArray(t)?t:[],this.dims.forEach(t=>this._recomputeDomain(t)),this._emit("records",this.state()),this._emit("change",this.state()),this}registerDimension(t,e){if(!e||"function"!=typeof e.dimension)throw new Error(`crossfilter.registerDimension("${t}") needs a dimension function.`);const s=e.type||(e.bins?"range":"category"),i={accessor:e.dimension,reducer:xi(e.reduce),type:s,bins:e.bins,order:e.order,filter:null,labels:[],edges:null};return this.dims.set(t,i),this._recomputeDomain(i),null!=e.filter&&this._setFilterOn(i,e.filter),this}hasDimension(t){return this.dims.has(t)}removeDimension(t){return this.dims.delete(t),this}_recomputeDomain(t){if("matrix"===t.type){const e=function(t,e,s){const i=new Set,a=new Set,r=[],o=[];for(let s=0;s<t.length;s++){const n=e(t[s]);if(!n)continue;const l=n[0],h=n[1];null==l||i.has(l)||(i.add(l),r.push(l)),null==h||a.has(h)||(a.add(h),o.push(h))}return{xLabels:fi(r,s),yLabels:fi(o,s)}}(this.records,t.accessor,t.order);return t.xLabels=e.xLabels,t.yLabels=e.yLabels,void(t.edges=null)}if("range"===t.type)t.edges=function(t,e,s){if(s&&Array.isArray(s.thresholds)&&s.thresholds.length>=2){const t=Array.from(new Set(s.thresholds.filter(ui))).sort((t,e)=>t-e);return t.length>=2?t.map(pi):[0,1]}let i=1/0,a=-1/0;for(let s=0;s<t.length;s++){const r=e(t[s]);ui(r)&&(r<i&&(i=r),r>a&&(a=r))}if(i===1/0)return[0,1];if(i===a){const t=Math.abs(i)>0?Math.abs(i):1;return[pi(i),pi(i+t)]}if(s&&ui(s.width)&&s.width>0){const t=s.width,e=Math.floor(i/t)*t;let r=Math.ceil(a/t)*t;r<=e&&(r=e+t);const o=Math.max(1,Math.round((r-e)/t)),n=new Array(o+1);for(let s=0;s<=o;s++)n[s]=pi(e+s*t);return n}const r=s&&ui(s.count)&&s.count>=1?Math.floor(s.count):30,o=(a-i)/r,n=new Array(r+1);for(let t=0;t<=r;t++)n[t]=pi(i+t*o);return n[r]=pi(a),n}(this.records,t.accessor,t.bins),t.labels=t.edges.slice(0,-1);else if(t.labels=function(t,e,s){const i=new Set,a=[];for(let s=0;s<t.length;s++){const r=e(t[s]);null!=r&&(i.has(r)||(i.add(r),a.push(r)))}return fi(a,s)}(this.records,t.accessor,t.order),t.edges=null,t.filter instanceof Set){const e=new Set(t.labels);Array.from(t.filter).forEach(s=>{e.has(s)||t.filter.delete(s)})}}filter(t,e){const s=this.dims.get(t);return s?(this._setFilterOn(s,e),this._emit("change",this.state()),this):this}toggleKey(t,e){const s=this.dims.get(t);if(!s||"category"!==s.type)return this;s.filter instanceof Set||(s.filter=new Set);const i=s.filter;return i.has(e)?i.delete(e):i.add(e),0===i.size&&(s.filter=null),this._emit("change",this.state()),this}_setFilterOn(t,e){if(null==e)return void(t.filter=null);if("range"===t.type)return void(Array.isArray(e)&&2===e.length&&e.every(ui)?t.filter=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]:t.filter=null);const s=(Set,new Set(e));t.filter=s.size?s:null}clear(t){const e=this.dims.get(t);return e&&(e.filter=null),this._emit("change",this.state()),this}reset(){return this.dims.forEach(t=>{t.filter=null}),this._emit("change",this.state()),this}_hasFilter(t){return null!=t.filter&&(!(t.filter instanceof Set)||t.filter.size>0)}_passes(t,e){if(!this._hasFilter(t))return!0;const s=t.accessor(e);return t.filter instanceof Set?t.filter.has(s):!!ui(s)&&(s>=t.filter[0]&&s<=t.filter[1])}filteredRecords(t){const e=[];return this.dims.forEach((s,i)=>{i!==t&&this._hasFilter(s)&&e.push(s)}),0===e.length?this.records:this.records.filter(t=>e.every(e=>this._passes(e,t)))}filteredRows(){return this.filteredRecords(null)}aggregateFor(t){const e=this.dims.get(t);if(!e)return{type:"category",labels:[],values:[],keys:[]};const s=this.filteredRecords(t);if("matrix"===e.type){const t=new Map(e.xLabels.map((t,e)=>[t,e])),i=new Map(e.yLabels.map((t,e)=>[t,e])),a=e.yLabels.map(()=>e.xLabels.map(()=>[]));for(let r=0;r<s.length;r++){const o=e.accessor(s[r]);if(!o)continue;const n=t.get(o[0]),l=i.get(o[1]);null!=n&&null!=l&&a[l][n].push(s[r])}return{type:"matrix",xLabels:e.xLabels.slice(),yLabels:e.yLabels.slice(),matrix:a.map(t=>t.map(t=>e.reducer(t)))}}if("range"===e.type){const t=e.edges||[0,1],i=t.length-1,a=Array.from({length:i},()=>[]);for(let i=0;i<s.length;i++){const r=mi(e.accessor(s[i]),t);r>=0&&a[r].push(s[i])}return{type:"range",labels:t.slice(0,-1),values:a.map(t=>e.reducer(t)),keys:a.map((e,s)=>[t[s],t[s+1]]),edges:t}}const i=new Map;e.labels.forEach(t=>i.set(t,[]));for(let t=0;t<s.length;t++){const a=e.accessor(s[t]),r=i.get(a);r&&r.push(s[t])}return{type:"category",labels:e.labels.slice(),values:e.labels.map(t=>e.reducer(i.get(t)||[])),keys:e.labels.slice()}}aggregateAll(){const t={};return this.dims.forEach((e,s)=>{t[s]=this.aggregateFor(s)}),t}state(){const t={};return this.dims.forEach((e,s)=>{this._hasFilter(e)&&(t[s]=e.filter instanceof Set?Array.from(e.filter):e.filter.slice())}),{filters:t,filteredCount:this.filteredRows().length,total:this.records.length}}filterOf(t){const e=this.dims.get(t);return e&&this._hasFilter(e)?e.filter instanceof Set?new Set(e.filter):e.filter.slice():null}on(t,e){let s=this._listeners.get(t);return s||(s=new Set,this._listeners.set(t,s)),s.add(e),()=>this.off(t,e)}off(t,e){var s;return null==(s=this._listeners.get(t))||s.delete(e),this}_emit(t,e){var s;null==(s=this._listeners.get(t))||s.forEach(t=>{try{t(e)}catch(t){}})}_esc(t){return String(null==t?"":t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}_resolveColumns(t){if(Array.isArray(t)&&t.length)return t.map(t=>"string"==typeof t?{field:t,label:t}:{field:t.field,label:t.label||t.field,format:t.format});const e=this.records[0];return(e?Object.keys(e):[]).map(t=>({field:t,label:t}))}_tableHTML(t,e,s){const i="<thead><tr>"+t.map(t=>`<th>${this._esc(t.label)}</th>`).join("")+"</tr></thead>",a="<tbody>"+e.map(e=>"<tr>"+t.map(t=>{const s=e[t.field],i=t.format?t.format(s,e):s;return`<td>${this._esc(i)}</td>`}).join("")+"</tr>").join("")+"</tbody>";return`<table class="apexcharts-cf-table">${`<caption>${e.length} of ${s} rows</caption>`}${i}${a}</table>`}dataTable(t,e){if(!t)return{refresh(){},destroy(){}};const s=e||{},i=this._resolveColumns(s.columns),a=s.pageSize||0,r=s.page||0,o=()=>{const e=this.filteredRows(),s=a?e.slice(r*a,r*a+a):e;t.innerHTML=this._tableHTML(i,s,e.length)};o();const n=this.on("change",o);return{refresh:o,destroy:()=>{n(),t.innerHTML=""}}}destroy(){bi._store().delete(this.id),this.dims.clear(),this._listeners.clear(),this.records=[]}}const yi=[".apexcharts-bar-area",".apexcharts-candlestick-area",".apexcharts-boxPlot-area",".apexcharts-rangebar-area",".apexcharts-marker"].join(", "),wi=[".apexcharts-pie-area",".apexcharts-bar-area"].join(", "),vi="apexcharts-crossfilter-dimmed",Ai=["pie","donut","polarArea","radialBar"];Cs.registerFeatures({linkedViews:class{constructor(t,e){this.w=t,this.ctx=e,this._dimmed=!1,this._wired=!1,this._pending=!1,this._lastValues=null,this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onChange=this._onChange.bind(this),"filter"===this._mode()&&this._initEngine()}_mode(){const t=this.w.config.chart.link;return t&&"function"==typeof t.dimension?"filter":t&&t.enabled?"highlight":"off"}_enabled(){const t=this.w.config.chart.link;return!(!t||!t.enabled)}onSourceSelection(t){var e;const s=this._mode();if("off"===s)return;if(!t||null==t.min||null==t.max)return;const i=Math.min(t.min,t.max),a=Math.max(t.min,t.max);if("filter"===s){const t=this._cf();if(!t)return;return t.filter(this._chartId(),[i,a]),void this._fireFilterChange(t,[i,a])}this._group().forEach(t=>{var e;null==(e=null==t?void 0:t.linkedViews)||e.applyDim(i,a)});const r={xaxis:{min:i,max:a},sourceChartID:this.w.globals.chartID};"function"==typeof this.w.config.chart.events.crossFilter&&this.w.config.chart.events.crossFilter(this.ctx,r),null==(e=this.ctx.events)||e.fireEvent("crossFilter",[this.ctx,r])}_group(){const t="function"==typeof this.ctx.getGroupedCharts?this.ctx.getGroupedCharts():[];return[this.ctx,...t]}applyDim(t,e){if(!this._enabled())return;const s=this.w,i=s.dom.baseEl;if(!i)return;const a=s.config.chart.link.dimOpacity;s.dom.elWrap&&"number"==typeof a&&s.dom.elWrap.style.setProperty("--apx-cf-dim",String(a));const r=s.globals.seriesX||[];i.querySelectorAll(yi).forEach(s=>{const i=s.getAttribute("j");if(null===i)return;const a=parseInt(i,10),o=s.getAttribute("index"),n=null===o?0:parseInt(o,10),l=r[n]||r[0];if(!l)return;const h=l[a];null!=h&&s.classList.toggle(vi,h<t||h>e)}),this._dimmed=!0}clear(){const t=this.w.dom.baseEl;t&&(t.querySelectorAll("."+vi).forEach(t=>t.classList.remove(vi)),this._dimmed=!1)}clearGroup(){if("filter"===this._mode()){const t=this._cf();return void(t&&t.reset())}this._group().forEach(t=>{var e;return null==(e=null==t?void 0:t.linkedViews)?void 0:e.clear()})}_chartId(){return this.w.globals.chartID}_cf(){const t=this.w.config.chart.link,e=t&&(t.id||this.w.config.chart.group);return e?bi.get(e):null}_isPie(){return-1!==Ai.indexOf(this.w.config.chart.type)}_isHeatmap(){return"heatmap"===this.w.config.chart.type}_initEngine(){const t=this._cf(),e=this.w.config.chart.link;if(!t){e&&e.id||this.w.config.chart.group;return}const s=this._chartId();t.hasDimension(s)||t.registerDimension(s,{dimension:e.dimension,reduce:e.reduce,type:e.type||(this._isHeatmap()?"matrix":void 0),bins:e.bins,order:e.order}),this._injectSeries(t.aggregateFor(s)),this._wire(t)}_seriesFromAgg(t){if("matrix"===t.type)return t.yLabels.map((e,s)=>({name:String(e),data:t.xLabels.map((e,i)=>({x:String(e),y:t.matrix[s][i]}))}));if(this._isPie())return t.values.slice();const e=this.w.config.chart.link.seriesName||"Count";return"range"===t.type?[{name:e,data:t.labels.map((e,s)=>[e,t.values[s]])}]:[{name:e,data:t.values.slice()}]}_sigOf(t){return JSON.stringify(t.matrix||t.values)}_injectSeries(t){const e=this.w;this._lastValues=this._sigOf(t),e.config.series=this._seriesFromAgg(t),"matrix"!==t.type&&(this._isPie()?e.config.labels=t.labels.map(String):"category"===t.type&&(e.config.xaxis||(e.config.xaxis={}),e.config.xaxis.categories=t.labels.map(String)))}_wire(t){this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.on("change",this._onChange))}_onPointSelect(t,e,s){if("filter"!==this._mode()||!s||null==s.dataPointIndex)return;const i=this._cf();if(!i)return;const a=this._chartId(),r=i.aggregateFor(a);if("matrix"===r.type)return;const o=r.keys[s.dataPointIndex];null!=o&&(i.toggleKey(a,o),this._fireFilterChange(i,o))}_onChange(){"filter"!==this._mode()||this._pending||(this._pending=!0,Promise.resolve().then(()=>{this._pending=!1,this.w.globals.isDestroyed||this._applyAggregation()}))}_applyAggregation(){if("filter"!==this._mode())return;const t=this._cf();if(!t)return;const e=t.aggregateFor(this._chartId()),s=this._sigOf(e);s!==this._lastValues?(this._lastValues=s,this.ctx.updateSeries(this._seriesFromAgg(e),!0)):this._applySelfDim()}_afterRender(){"filter"===this._mode()&&this._applySelfDim()}_applySelfDim(){const t=this._cf();if(!t)return;const e=this.w,s=e.dom.baseEl;if(!s)return;const i=this._chartId(),a=t.filterOf(i),r=e.config.chart.link.dimOpacity;e.dom.elWrap&&"number"==typeof r&&e.dom.elWrap.style.setProperty("--apx-cf-dim",String(r));const o=a instanceof Set,n=Array.isArray(a),l=t.aggregateFor(i).keys;s.querySelectorAll(wi).forEach(t=>{const e=t.getAttribute("j");if(null===e)return;const s=l[parseInt(e,10)];let i=!1;o?i=!a.has(s):n&&Array.isArray(s)&&(i=s[1]<=a[0]||s[0]>=a[1]),t.classList.toggle(vi,i)}),this._dimmed=!!a}_fireFilterChange(t,e){var s;const i=l(n({},t.state()),{sourceChartID:this._chartId(),key:e}),a=this.w.config.chart.events;"function"==typeof a.filterChange&&a.filterChange(this.ctx,i),null==(s=this.ctx.events)||s.fireEvent("filterChange",[this.ctx,i])}teardown(){var t,e,s,i,a,r;if(this.clear(),this._wired){null==(e=(t=this.ctx).removeEventListener)||e.call(t,"dataPointSelection",this._onPointSelect),null==(i=(s=this.ctx).removeEventListener)||i.call(s,"mounted",this._afterRender),null==(r=(a=this.ctx).removeEventListener)||r.call(a,"updated",this._afterRender);const o=this._cf();o&&(o.off("change",this._onChange),o.removeDimension(this._chartId())),this._wired=!1}}}});const Ci=Cs;Ci._crossfilterFactory=t=>bi.getOrCreate(t),Ci._crossfilterGet=t=>bi.get(t);const Si=["point","xaxis","yaxis"],ki=[10,11,12,14,17,20],_i=["circle","square","diamond","triangle"],Li={circle:"\u25cf",square:"\u25a0",diamond:"\u25c6",triangle:"\u25b2"},Di=["#ffffff","#334155","#2563eb","#16a34a","#d97706","#dc2626"];class Mi{constructor(t,e){this.w=t,this.ctx=e,this._wired=!1,this._drag=null,this._editor=null,this._creating=!1,this._createSeq=0,this._attach=this._attach.bind(this),this._onRerender=this._onRerender.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onCreateClick=this._onCreateClick.bind(this),this._onDocDownEditor=this._onDocDownEditor.bind(this),(this._enabledGlobally()||this._hasDraggable()||this._paletteEnabled())&&this._wire()}_enabledGlobally(){const t=this.w.config.chart.ink;return!(!t||!t.enabled)}_paletteEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.palette)}_snapEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.snap)}_nearest(t,e){let s=t,i=1/0;for(let a=0;a<e.length;a++){const r=Math.abs(e[a]-t);r<i&&(i=r,s=e[a])}return s}_snapX(t){if(!this._snapEnabled()||"number"!=typeof t)return t;const e=this.w.globals.xAxisScale;return e&&Array.isArray(e.result)&&e.result.length?this._nearest(t,e.result):t}_snapY(t,e){if(!this._snapEnabled()||"number"!=typeof t)return t;const s=this.w.globals.yAxisScale,i=s&&s[e];return i&&Array.isArray(i.result)&&i.result.length?this._nearest(t,i.result):t}_annoList(t){const e=this.w.config.annotations;if(!e)return[];const s="point"===t?"points":t;return Array.isArray(e[s])?e[s]:[]}_isDraggable(t){return!!t&&(!0===t.draggable||!1!==t.draggable&&this._enabledGlobally())}_hasDraggable(){return Si.some(t=>this._annoList(t).some(t=>this._isDraggable(t)))}_wire(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onRerender),this.ctx.addEventListener("updated",this._onRerender))}_onRerender(){this._closeEditor(!1),this._attach()}_attach(){const t=this.w,e=t.dom.baseEl;e&&(Si.forEach(s=>{this._annoList(s).forEach((i,a)=>{this._isDraggable(i)&&(i.id||(i.id="apexcharts-ink-"+s+"-"+a+"-"+t.globals.chartID),e.querySelectorAll("."+i.id).forEach(t=>{t.__inkBound||(t.__inkBound=!0,t.style.cursor="move",t.classList.add("apexcharts-ink-draggable"),t.addEventListener("mousedown",t=>this._onDown(t,s,a)),t.addEventListener("touchstart",t=>this._onDown(t,s,a)),t.addEventListener("dblclick",t=>{t.preventDefault(),t.stopPropagation(),this._startEdit(s,a,{select:!0})}))}))})}),this._paletteEnabled()&&this._renderPalette())}_onDown(t,e,s){if(t.button&&0!==t.button)return;const i=this.w,a=i.dom.baseEl&&i.dom.baseEl.ownerDocument;if(!a)return;t.stopPropagation(),t.cancelable&&t.preventDefault();const r="touchstart"===t.type?t.touches[0]:t,o=i.dom.Paper&&i.dom.Paper.node,n=o&&o.getScreenCTM?o.getScreenCTM():null,l=this._annoList(e)[s];let h="move",c=null,d=0,g=0;if("xaxis"===e&&null!=l.x2&&(c=i.dom.baseEl.querySelector(".apexcharts-annotation-rect."+l.id),c)){const t=c.getBoundingClientRect();Math.abs(r.clientX-t.left)<=8?h="resize-x1":Math.abs(r.clientX-t.right)<=8&&(h="resize-x2"),d=parseFloat(c.getAttribute("x"))||0,g=parseFloat(c.getAttribute("width"))||0}this._drag={type:e,index:s,anno:l,els:Array.from(i.dom.baseEl.querySelectorAll("."+l.id)),mode:h,rect:c,origX:d,origW:g,startX:r.clientX,startY:r.clientY,scaleX:n&&n.a?n.a:1,scaleY:n&&n.d?n.d:1,dxPixel:0,dyPixel:0,moved:!1},a.addEventListener("mousemove",this._onMove),a.addEventListener("touchmove",this._onMove,{passive:!1}),a.addEventListener("mouseup",this._onUp),a.addEventListener("touchend",this._onUp)}_onMove(t){const e=this._drag;if(!e)return;t.cancelable&&t.preventDefault();const s="touchmove"===t.type?t.touches[0]:t;if(e.dxPixel=(s.clientX-e.startX)/e.scaleX,e.dyPixel=(s.clientY-e.startY)/e.scaleY,(Math.abs(e.dxPixel)>2||Math.abs(e.dyPixel)>2)&&(e.moved=!0),"move"===e.mode){const t=`translate(${e.dxPixel} ${e.dyPixel})`;e.els.forEach(e=>e.setAttribute("transform",t))}else e.rect&&("resize-x1"===e.mode?(e.rect.setAttribute("x",e.origX+e.dxPixel),e.rect.setAttribute("width",Math.max(1,e.origW-e.dxPixel))):"resize-x2"===e.mode&&e.rect.setAttribute("width",Math.max(1,e.origW+e.dxPixel)))}_onUp(){const t=this._drag;if(this._drag=null,this._teardownDocListeners(),!t||!t.moved)return void(t&&(t.els.forEach(t=>t.removeAttribute("transform")),this._startEdit(t.type,t.index)));const e=this._annoList(t.type)[t.index];e&&(this._applyDelta(t,e),t.els.forEach(t=>t.removeAttribute("transform")),this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:drag"),this._fireDragged(t.type,e,t.index))}_checkpoint(t){var e,s;null==(s=null==(e=this.ctx.history)?void 0:e.snapshot)||s.call(e,t)}_applyDelta(t,e){const s=this.w,i=s.layout.gridWidth?t.dxPixel*(s.globals.xRange/s.layout.gridWidth):0;if("point"===t.type){const{newX:i,newY:a}=this._invertPoint(e,t.dxPixel,t.dyPixel);if(e.x=this._snapX(i),null!=a){const t=e.yAxisIndex||0,i=s.globals.seriesYAxisMap;e.y=this._snapY(a,i&&i[t]?i[t][0]:0)}return}if("xaxis"!==t.type){if("yaxis"===t.type){const i=e.yAxisIndex||0,a=s.globals.seriesYAxisMap,r=a&&a[i]?a[i][0]:0,o=s.globals.yRange?s.globals.yRange[r]:null;if(null==o||!s.layout.gridHeight)return;const n=-t.dyPixel*(o/s.layout.gridHeight);"number"==typeof e.y2?("number"==typeof e.y&&(e.y+=n),e.y2+=n):"number"==typeof e.y&&(e.y=this._snapY(e.y+n,r))}}else{if("number"!=typeof e.x)return;if("move"===t.mode)"number"==typeof e.x2?(e.x+=i,e.x2+=i):e.x=this._snapX(e.x+i);else if("resize-x1"===t.mode||"resize-x2"===t.mode){const s=null==e.x2||e.x<=e.x2;("resize-x2"===t.mode?!s:s)?e.x=this._snapX(e.x+i):"number"==typeof e.x2&&(e.x2=this._snapX(e.x2+i))}}}_invertPoint(t,e,s){const i=this.w,a=("category"===i.config.xaxis.type||i.config.xaxis.convertedCatToNumeric)&&!i.axisFlags.dataFormatXNumeric;let r=t.x;!a&&"number"==typeof t.x&&i.layout.gridWidth&&(r=t.x+e*(i.globals.xRange/i.layout.gridWidth));let o=t.y;const n=t.yAxisIndex||0,l=i.globals.seriesYAxisMap,h=l&&l[n]?l[n][0]:0,c=i.globals.yRange?i.globals.yRange[h]:null,d=i.config.yaxis[n]&&i.config.yaxis[n].logarithmic;return"number"==typeof t.y&&null!=c&&!d&&i.layout.gridHeight&&(o=t.y-s*(c/i.layout.gridHeight)),{newX:r,newY:o}}_redrawAnno(t,e,s){const i=this.w.dom.baseEl,a=this.ctx.annotations;if(!i||!a)return;i.querySelectorAll("."+e.id).forEach(t=>t.remove());const r=i.querySelector(".apexcharts-"+t+"-annotations");if(!r)return;"point"===t&&a.pointsAnnotations?a.pointsAnnotations.addPointAnnotation(e,r,s):"xaxis"===t&&a.xAxisAnnotations?a.xAxisAnnotations.addXaxisAnnotation(e,r,s):"yaxis"===t&&a.yAxisAnnotations&&a.yAxisAnnotations.addYaxisAnnotation(e,r,s);const o=i.querySelector(".apexcharts-"+t+"-annotation-label."+e.id);if(o&&a.helpers&&e.label&&e.label.text){const t=a.helpers.addBackgroundToAnno(o,e);t&&o.parentNode&&o.parentNode.insertBefore(t.node,o)}this._attach()}_fireDragged(t,e,s){var i;const a={type:t,id:e.id,index:s,x:e.x,y:e.y};null!=e.x2&&(a.x2=e.x2),null!=e.y2&&(a.y2=e.y2);const r=this.w.config.chart.events;"function"==typeof r.annotationDragged&&r.annotationDragged(this.ctx,a),null==(i=this.ctx.events)||i.fireEvent("annotationDragged",[this.ctx,a])}startCreate(){if(this._creating)return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(this._creating=!0,t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0),this._syncPalette())}stopCreate(){if(!this._creating)return;this._creating=!1;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="",t.removeEventListener("click",this._onCreateClick,!0)),this._syncPalette()}_onCreateClick(t){if(!this._creating)return;t.preventDefault(),t.stopPropagation();const e=this._pixelToData(t.clientX,t.clientY);this.stopCreate(),e&&this.createAt(e.x,e.y)}createAt(t,e,s={}){const i=this.w;this._wire(),this._createSeq+=1;const a="apexcharts-ink-new-"+this._createSeq+"-"+i.globals.chartID,r=b.extend((new k).pointAnnotation,{x:t,y:e,id:a,draggable:!0,label:{text:s.text||"Note"}});i.config.annotations||(i.config.annotations={}),Array.isArray(i.config.annotations.points)||(i.config.annotations.points=[]),i.config.annotations.points.push(r);const o=i.config.annotations.points.length-1;return this._redrawAnno("point",r,o),this._checkpoint("ink:create"),this._fireCreated("point",r,o),this._startEdit("point",o,{select:!0}),r}createLineAt(t,e,s={}){const i=this.w;this._wire(),this._createSeq+=1;const a="apexcharts-ink-new-"+this._createSeq+"-"+i.globals.chartID,r="y"===t?"yaxis":"xaxis",o="yaxis"===r?(new k).yAxisAnnotation:(new k).xAxisAnnotation,n={id:a,draggable:!0,strokeDashArray:null!=s.strokeDashArray?s.strokeDashArray:4,label:{text:s.text||""}};s.color&&(n.borderColor=s.color,n.label.borderColor=s.color),"yaxis"===r?n.y=e:n.x=e;const l=b.extend(o,n);i.config.annotations||(i.config.annotations={}),Array.isArray(i.config.annotations[r])||(i.config.annotations[r]=[]),i.config.annotations[r].push(l);const h=i.config.annotations[r].length-1;return this._redrawAnno(r,l,h),this._checkpoint("ink:create"),this._fireCreated(r,l,h),!1!==s.select&&this._startEdit(r,h,{select:!0}),l}_pixelToData(t,e){const s=this.w,i=s.dom.baseEl&&s.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const a=i.getBoundingClientRect();if(!a.width||!a.height)return null;const r=(t-a.left)/a.width,o=(e-a.top)/a.height;let n=s.globals.minX+r*s.globals.xRange;const l=(s.globals.minYArr&&null!=s.globals.minYArr[0]?s.globals.minYArr[0]:s.globals.minY)+(1-o)*(s.globals.yRange&&null!=s.globals.yRange[0]?s.globals.yRange[0]:s.globals.maxY-s.globals.minY);return("category"===s.config.xaxis.type||s.config.xaxis.convertedCatToNumeric)&&!s.axisFlags.dataFormatXNumeric&&(n=Math.round(n)),{x:n,y:l}}_fireCreated(t,e,s){var i;const a={type:t,id:e.id,index:s};void 0!==e.x&&(a.x=e.x),void 0!==e.y&&(a.y=e.y);const r=this.w.config.chart.events;"function"==typeof r.annotationCreated&&r.annotationCreated(this.ctx,a),null==(i=this.ctx.events)||i.fireEvent("annotationCreated",[this.ctx,a])}_renderPalette(){const t=this.w.dom.elWrap;if(!t||t.querySelector(".apexcharts-ink-palette"))return;const e=t.ownerDocument,s=e.createElement("div");s.className="apexcharts-ink-palette";const i=s.style;i.position="absolute",i.top="6px",i.left="6px",i.zIndex="15";const a=e.createElement("button");a.type="button",a.className="apexcharts-ink-add",a.textContent="+ Note";const r=a.style;r.cursor="pointer",r.font="12px sans-serif",r.padding="4px 9px",r.borderRadius="5px",r.border="1px solid #6366f1",r.color="#4338ca",r.background="#fff",a.addEventListener("click",t=>{t.stopPropagation(),this._creating?this.stopCreate():this.startCreate()}),s.appendChild(a),t.appendChild(s),this._syncPalette()}_syncPalette(){const t=this.w.dom.elWrap,e=t&&t.querySelector(".apexcharts-ink-add");e&&(this._creating?(e.style.background="#6366f1",e.style.color="#fff",e.textContent="Click chart..."):(e.style.background="#fff",e.style.color="#4338ca",e.textContent="+ Note"))}_noteColors(){const t=this.w.config.chart.ink;return t&&Array.isArray(t.noteColors)&&t.noteColors.length?t.noteColors:Di}static _isLight(t){const e=String(t||"").replace("#",""),s=3===e.length?e.split("").map(t=>t+t).join(""):e,i=parseInt(s,16);if(isNaN(i)||6!==s.length)return!1;return(.299*(i>>16&255)+.587*(i>>8&255)+.114*(255&i))/255>.72}static _isBold(t){const e=t&&t.fontWeight;return"bold"===e||parseInt(String(e),10)>=600}_cardBtn(t,e,s,i,a,r){const o=t.createElement("button");return o.type="button",o.className="apexcharts-ink-btn"+(a?" "+a:""),o.title=s,o.setAttribute("aria-label",s),r?o.innerHTML=e:o.textContent=e,o.addEventListener("mousedown",t=>t.preventDefault()),o.addEventListener("click",t=>{t.stopPropagation(),i()}),o}_cardLabel(t,e){const s=t.createElement("span");return s.className="apexcharts-ink-cardlabel",s.textContent=e,s}_mkSwatch(t,e,s,i){const a=t.createElement("button");return a.type="button",a.className="apexcharts-ink-swatch"+(i?" "+i:""),a.title=e,a.setAttribute("aria-label","Color "+e),a.dataset.color=e,a.style.background=e,a.addEventListener("mousedown",t=>t.preventDefault()),a.addEventListener("click",t=>{t.stopPropagation(),s(e)}),a}_startEdit(t,e,s={}){const i=this.w,a=this._annoList(t)[e],r=i.dom.baseEl,o=i.dom.elWrap;if(!(a&&a.id&&r&&o))return;this._closeEditor(!1);const n=r.ownerDocument,l=n.createElement("div");l.className="apexcharts-ink-card",l.setAttribute("role","dialog"),l.setAttribute("aria-label","Edit note"),l.style.visibility="hidden";const h=n.createElement("div");h.className="apexcharts-ink-card-row";const c=n.createElement("input");c.type="text",c.className="apexcharts-ink-editor",c.placeholder="Note text",c.value=a.label&&a.label.text||"",h.appendChild(c),h.appendChild(this._cardBtn(n,'<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/></svg>',"Delete note",()=>this._deleteAnno(),"apexcharts-ink-btn--delete",!0)),l.appendChild(h);const d=n.createElement("div");d.className="apexcharts-ink-card-row","point"!==t&&d.appendChild(this._cardLabel(n,"Label")),this._noteColors().forEach(t=>{d.appendChild(this._mkSwatch(n,t,t=>this._applyColor(t)))});const g=n.createElement("span");if(g.className="apexcharts-ink-sep",d.appendChild(g),d.appendChild(this._cardBtn(n,"B","Bold",()=>this._toggleBold(),"apexcharts-ink-btn--bold")),d.appendChild(this._cardBtn(n,"A-","Smaller text",()=>this._stepFont(-1))),d.appendChild(this._cardBtn(n,"A+","Larger text",()=>this._stepFont(1))),l.appendChild(d),"point"!==t){const t=n.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(n,"Line")),this._noteColors().forEach(e=>{t.appendChild(this._mkSwatch(n,e,t=>this._applyLineColor(t),"apexcharts-ink-swatch--line"))}),l.appendChild(t)}if("point"===t){const t=n.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(n,"Marker")),t.appendChild(this._cardBtn(n,"-","Smaller marker",()=>this._stepMarker(-1)));const e=n.createElement("span");e.className="apexcharts-ink-marker-size",t.appendChild(e),t.appendChild(this._cardBtn(n,"+","Larger marker",()=>this._stepMarker(1))),t.appendChild(this._cardBtn(n,Li.circle,"Marker shape",()=>this._cycleShape(),"apexcharts-ink-btn--shape")),l.appendChild(t)}o.appendChild(l),this._editor={card:l,input:c,type:t,index:e},this._positionCard(),this._syncCard(),l.style.visibility="",c.focus(),s.select&&c.select(),l.addEventListener("keydown",t=>{"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this._closeEditor(!1)):"Enter"===t.key&&t.target===c&&(t.preventDefault(),this._closeEditor(!0))}),n.addEventListener("mousedown",this._onDocDownEditor,!0),n.addEventListener("touchstart",this._onDocDownEditor,!0)}_onDocDownEditor(t){const e=this._editor;e&&!e.card.contains(t.target)&&this._closeEditor(!0)}_positionCard(){const t=this._editor;if(!t)return;const e=this.w,s=e.dom.baseEl,i=e.dom.elWrap,a=this._annoList(t.type)[t.index];if(!s||!i||!a)return;const r=s.querySelector(".apexcharts-"+t.type+"-annotation-label."+a.id)||s.querySelector("."+a.id);if(!r)return;const o=i.getBoundingClientRect(),n=r.getBoundingClientRect(),l=t.card.offsetWidth,h=t.card.offsetHeight;let c=Math.round(n.left-o.left),d=Math.round(n.bottom-o.top)+8;d+h>i.clientHeight-4&&(d=Math.round(n.top-o.top)-h-8),c+l>i.clientWidth-4&&(c=i.clientWidth-l-4),t.card.style.left=Math.max(4,c)+"px",t.card.style.top=Math.max(4,d)+"px"}_syncCard(){const t=this._editor;if(!t)return;const e=this._annoList(t.type)[t.index];if(!e)return;const s=e.label&&e.label.style||{},i=String(s.background||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch:not(.apexcharts-ink-swatch--line)").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===i)});const a=String(e.borderColor||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch--line").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===a)});const r=t.card.querySelector(".apexcharts-ink-btn--bold");r&&r.classList.toggle("apexcharts-ink-btn--active",Mi._isBold(s));const o=e.marker||{},n=t.card.querySelector(".apexcharts-ink-marker-size");n&&(n.textContent=String("number"==typeof o.size?o.size:4));const l=t.card.querySelector(".apexcharts-ink-btn--shape");l&&(l.textContent=Li[o.shape]||Li.circle)}_commitTextOf(t){const e=this._annoList(t.type)[t.index];if(!e)return;const s=t.input.value;e.label||(e.label={}),e.label.text!==s&&(e.label.text=s,this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:edit"),this._fireEdited(t.type,e,t.index))}_closeEditor(t){const e=this._editor;if(!e)return;this._editor=null;const s=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;s&&(s.removeEventListener("mousedown",this._onDocDownEditor,!0),s.removeEventListener("touchstart",this._onDocDownEditor,!0)),e.card.parentNode&&e.card.parentNode.removeChild(e.card),t&&this._commitTextOf(e)}_applyStyle(t,e){const s=this._editor;if(!s)return;const i=this._annoList(s.type)[s.index];i&&(this._commitTextOf(s),i.label||(i.label={}),i.label.style||(i.label.style={}),e(i),this._redrawAnno(s.type,i,s.index),this._checkpoint(t),this._fireStyled(s.type,i,s.index),this._syncCard(),this._positionCard())}_applyColor(t){const e=this._editor;if(!e)return;const s=Mi._isLight(t);this._applyStyle("ink:style",i=>{i.label.style.background=t,i.label.style.color=s?"#334155":"#ffffff",i.label.borderColor=s?"#cbd5e1":t,"point"===e.type&&(i.marker||(i.marker={}),i.marker.strokeColor=s?"#334155":t,i.marker.fillColor=s?"#ffffff":t)})}_applyLineColor(t){const e=this._editor;e&&"point"!==e.type&&this._applyStyle("ink:style",e=>{e.borderColor=t,null==e.x2&&null==e.y2||(e.fillColor=t)})}_stepFont(t){this._applyStyle("ink:style",e=>{const s=parseFloat(e.label.style.fontSize)||11;let i=0;for(let t=1;t<ki.length;t++)Math.abs(ki[t]-s)<Math.abs(ki[i]-s)&&(i=t);i=Math.min(ki.length-1,Math.max(0,i+t)),e.label.style.fontSize=ki[i]+"px"})}_toggleBold(){this._applyStyle("ink:style",t=>{t.label.style.fontWeight=Mi._isBold(t.label.style)?400:700})}_stepMarker(t){this._applyStyle("ink:style",e=>{e.marker||(e.marker={});const s="number"==typeof e.marker.size?e.marker.size:4;e.marker.size=Math.min(14,Math.max(2,s+t))})}_cycleShape(){this._applyStyle("ink:style",t=>{t.marker||(t.marker={});const e=_i.indexOf(t.marker.shape);t.marker.shape=_i[(e+1)%_i.length]})}_deleteAnno(){const t=this._editor;if(!t)return;const e=this._annoList(t.type),s=e[t.index];if(this._closeEditor(!1),!s)return;const i=this.w.dom.baseEl;i&&s.id&&i.querySelectorAll("."+s.id).forEach(t=>t.remove()),e.splice(t.index,1);for(let s=t.index;s<e.length;s++)this._redrawAnno(t.type,e[s],s);this._checkpoint("ink:delete"),this._fireDeleted(t.type,s,t.index)}_fireEdited(t,e,s){var i;const a={type:t,id:e.id,index:s,text:e.label?e.label.text:""},r=this.w.config.chart.events;"function"==typeof r.annotationEdited&&r.annotationEdited(this.ctx,a),null==(i=this.ctx.events)||i.fireEvent("annotationEdited",[this.ctx,a])}_fireStyled(t,e,s){var i;const a={type:t,id:e.id,index:s,label:e.label,marker:e.marker},r=this.w.config.chart.events;"function"==typeof r.annotationStyled&&r.annotationStyled(this.ctx,a),null==(i=this.ctx.events)||i.fireEvent("annotationStyled",[this.ctx,a])}_fireDeleted(t,e,s){var i;const a={type:t,id:e.id,index:s},r=this.w.config.chart.events;"function"==typeof r.annotationDeleted&&r.annotationDeleted(this.ctx,a),null==(i=this.ctx.events)||i.fireEvent("annotationDeleted",[this.ctx,a])}_teardownDocListeners(){const t=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchend",this._onUp))}teardown(){var t,e,s,i;this._teardownDocListeners(),this._closeEditor(!1),this.stopCreate(),this._drag=null,this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onRerender),null==(i=(s=this.ctx).removeEventListener)||i.call(s,"updated",this._onRerender),this._wired=!1)}}Cs.registerFeatures({ink:Mi});Cs.registerFeatures({measure:class{constructor(t,e){this.w=t,this.ctx=e,this.graphics=new gt(t),this.pins=[],this.drag=null,this.armed=!1,this.persistent=!1,this.pane=null,this._seedActive=!1,this._onKeyDown=this._onKeyDown.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onDown=this._onDown.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onSeedDown=this._onSeedDown.bind(this),this._onSeedKey=this._onSeedKey.bind(this),this._afterRender=this._afterRender.bind(this),e.addEventListener("mounted",this._afterRender),e.addEventListener("updated",this._afterRender),this._bindKeys()}_cfg(){return this.w.config.chart.measure||{}}_enabled(){return this.w.globals.axisCharts&&!0===this._cfg().enabled}_mode(){return"free"===this._cfg().mode?"free":"span"}_snapToSeries(t){const e=(this.w.config.series||[])[0];if(!e)return null;const s=this._points(e.data||[]);if(!s.length)return null;let i=s[0],a=Math.abs(s[0].x-t);for(let e=1;e<s.length;e++){const r=Math.abs(s[e].x-t);r<a&&(a=r,i=s[e])}return i}_resolve(t){if("free"===this._mode())return t;const e=this._snapToSeries(t.x);if(!e)return t;const s=this._dataToGrid(e.x,e.y);return{x:e.x,y:e.y,gx:s.gx,gy:s.gy}}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_bindKeys(){if(this._keysBound)return;const t=this._doc();t&&(t.addEventListener("keydown",this._onKeyDown),t.addEventListener("keyup",this._onKeyUp),this._keysBound=!0)}_onKeyDown(t){if(!this._enabled()||this.persistent)return;const e=this._cfg().key||"m";t.key&&t.key.toLowerCase()===String(e).toLowerCase()?this._arm():"Escape"===t.key&&this._cancelDrag()}_onKeyUp(t){if(this.persistent)return;const e=this._cfg().key||"m";t.key&&t.key.toLowerCase()===String(e).toLowerCase()&&(this.drag||this._disarm())}startMeasure(){this._enabled()&&(this.persistent=!0,this._arm())}stopMeasure(){this.persistent=!1,this._cancelDrag(),this._disarm()}seedFromClient(t,e){if(!this._enabled())return;this._cancelDrag(),this._endSeed(!1);const s=this._project(t,e);this.drag={a:s,b:s},this._seedActive=!0;const i=this._doc();i&&(i.addEventListener("mousemove",this._onMove),i.addEventListener("touchmove",this._onMove,{passive:!1}),i.addEventListener("mousedown",this._onSeedDown,!0),i.addEventListener("touchstart",this._onSeedDown,!0),i.addEventListener("keydown",this._onSeedKey,!0)),this._renderLive()}_onSeedDown(t){if(!this._seedActive||!this.drag)return;t.preventDefault(),t.stopPropagation();const{cx:e,cy:s}=this._clientXY(t);this.drag.b=this._project(e,s),this._endSeed(!0)}_onSeedKey(t){"Escape"===t.key&&this._endSeed(!1)}_endSeed(t){var e,s;if(!this._seedActive)return;this._seedActive=!1;const i=this._doc();i&&(i.removeEventListener("mousemove",this._onMove),i.removeEventListener("touchmove",this._onMove),i.removeEventListener("mousedown",this._onSeedDown,!0),i.removeEventListener("touchstart",this._onSeedDown,!0),i.removeEventListener("keydown",this._onSeedKey,!0));const a=this.drag;if(this.drag=null,this._clearLive(),!t||!a)return;const r=this._resolve(a.a),o=this._resolve(a.b);if(Math.abs(r.gx-o.gx)<2&&Math.abs(r.gy-o.gy)<2)return;const n=this._mode();!1!==this._cfg().pinOnRelease&&(this.pins.push({xa:r.x,ya:r.y,xb:o.x,yb:o.y,mode:n}),this._renderPins(),null==(s=null==(e=this.ctx.history)?void 0:e.snapshot)||s.call(e,"measure")),this._fireMeasured(r,o)}clearMeasures(){var t,e;this.pins=[],this._renderPins(),null==(e=null==(t=this.ctx.history)?void 0:t.snapshot)||e.call(t,"clear measures")}getPins(){return this.pins.map(t=>({xa:t.xa,ya:t.ya,xb:t.xb,yb:t.yb,mode:"free"===t.mode?"free":"span"}))}setPins(t){this.pins=Array.isArray(t)?t.filter(t=>t&&isFinite(t.xa)&&isFinite(t.ya)&&isFinite(t.xb)&&isFinite(t.yb)).map(t=>({xa:+t.xa,ya:+t.ya,xb:+t.xb,yb:+t.yb,mode:"free"===t.mode?"free":"span"})):[],this._renderPins()}_points(t){const e=[];for(let s=0;s<t.length;s++){const i=t[s];let a,r;Array.isArray(i)?(a=+i[0],r=+i[1]):i&&"object"==typeof i?(a=+i.x,r=+i.y):(a=s,r=+i),isFinite(a)&&isFinite(r)&&e.push({x:a,y:r})}return e}_arm(){if(this.armed||!this._enabled())return;const t=this.w,e=t.dom.elGraphical;if(!e)return;this.armed=!0;const s=this.graphics.drawRect(0,0,t.layout.gridWidth,t.layout.gridHeight);s.node.setAttribute("class","apexcharts-measure-capture"),s.node.setAttribute("fill","transparent"),s.node.style.cursor="crosshair",s.node.style.pointerEvents="all",s.node.addEventListener("mousedown",this._onDown),s.node.addEventListener("touchstart",this._onDown,{passive:!1}),e.add(s),this.pane=s}_disarm(){if(this.armed=!1,this.pane){this.pane.node.removeEventListener("mousedown",this._onDown),this.pane.node.removeEventListener("touchstart",this._onDown);const t=this.pane.node;t.parentNode&&t.parentNode.removeChild(t),this.pane=null}}_clientXY(t){const e=t.touches&&t.touches[0]?t.touches[0]:t;return{cx:e.clientX,cy:e.clientY}}_gridRect(){const t=this.w.dom.baseEl.querySelector(".apexcharts-grid");return t?t.getBoundingClientRect():null}_yRange(){const t=this.w.globals,e=t.yAxisScale&&t.yAxisScale[0];return e&&isFinite(e.niceMin)&&isFinite(e.niceMax)&&e.niceMax!==e.niceMin?[e.niceMin,e.niceMax]:[t.minY,t.maxY]}_project(t,e){const s=this.w,i=this._gridRect(),a=s.layout.gridWidth,r=s.layout.gridHeight,o=t=>t<0?0:t>1?1:t,n=i?o((t-i.left)/i.width):0,l=i?o((e-i.top)/i.height):0,[h,c]=this._yRange();return{x:s.globals.minX+n*(s.globals.maxX-s.globals.minX),y:c-l*(c-h),gx:n*a,gy:l*r}}_dataToGrid(t,e){const s=this.w,i=s.layout.gridWidth,a=s.layout.gridHeight,r=s.globals.maxX-s.globals.minX||1,[o,n]=this._yRange(),l=n-o||1;return{gx:(t-s.globals.minX)/r*i,gy:a-(e-o)/l*a}}_onDown(t){if(!this.armed)return;t.preventDefault(),t.stopPropagation();const{cx:e,cy:s}=this._clientXY(t),i=this._project(e,s);this.drag={a:i,b:i};const a=this._doc();a&&(a.addEventListener("mousemove",this._onMove),a.addEventListener("mouseup",this._onUp),a.addEventListener("touchmove",this._onMove,{passive:!1}),a.addEventListener("touchend",this._onUp)),this._renderLive()}_onMove(t){if(!this.drag)return;t.cancelable&&t.preventDefault();const{cx:e,cy:s}=this._clientXY(t);this.drag.b=this._project(e,s),this._renderLive()}_onUp(t){var e,s;const i=this._doc();if(i&&(i.removeEventListener("mousemove",this._onMove),i.removeEventListener("mouseup",this._onUp),i.removeEventListener("touchmove",this._onMove),i.removeEventListener("touchend",this._onUp)),!this.drag)return;const a=this.drag.a,r=this.drag.b;if(this.drag=null,this._clearLive(),Math.abs(a.gx-r.gx)<2&&Math.abs(a.gy-r.gy)<2)return void(this.persistent||this._disarm());const o=this._mode(),n=this._resolve(a),l=this._resolve(r);!1!==this._cfg().pinOnRelease&&(this.pins.push({xa:n.x,ya:n.y,xb:l.x,yb:l.y,mode:o}),this._renderPins(),null==(s=null==(e=this.ctx.history)?void 0:e.snapshot)||s.call(e,"measure")),this._fireMeasured(n,l),this.persistent||this._disarm()}_cancelDrag(){const t=this._doc();t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("touchend",this._onUp)),this.drag=null,this._clearLive()}_stats(t,e){const s=e.x-t.x,i=e.y-t.y;return{dx:s,dy:i,pct:0!==t.y?i/Math.abs(t.y)*100:NaN,slope:0!==s?i/s:NaN}}_fmt(t){if(!isFinite(t))return"n/a";const e=Math.abs(t);return 0!==e&&(e<.01||e>=1e6)?t.toExponential(2):String(Math.round(100*t)/100)}_computedStyle(){if(!c.isBrowser())return null;const t=this.w.dom.elGraphical&&this.w.dom.elGraphical.node;if(!t||"function"!=typeof getComputedStyle)return null;try{return getComputedStyle(t)}catch(t){return null}}_resolveColor(t,e,s,i){if(t)return t;const a=void 0!==i?i:this._computedStyle();return(a?a.getPropertyValue(e).trim():"")||s}_colors(){const t=this._cfg().colors||{},e=this._computedStyle();return{up:this._resolveColor(t.up,"--apx-measure-up","#16a34a",e),down:this._resolveColor(t.down,"--apx-measure-down","#dc2626",e),neutral:this._resolveColor(t.neutral,"--apx-measure-neutral","#64748b",e),guide:this._resolveColor(t.guide,"--apx-measure-guide","#94a3b8",e)}}_dirColor(t){const e=this._colors();return 0===t?e.neutral:t>0?e.up:e.down}_dirClass(t){return 0===t?"apexcharts-measure-flat":t>0?"apexcharts-measure-up":"apexcharts-measure-down"}_fmtPct(t){if(!isFinite(t))return"n/a";const e=this._cfg().format&&this._cfg().format.percent;if("function"==typeof e)try{const s=e(t);if(null!=s)return String(s)}catch(t){}return(t>=0?"+":"")+this._fmt(t)+"%"}_label(t,e,s,i){const a=this._cfg().label;if("function"==typeof a){const r=a({from:{x:t.x,y:t.y},to:{x:e.x,y:e.y},dx:s.dx,dy:s.dy,percentChange:s.pct,slope:s.slope,mode:i});return Array.isArray(r)?r.map(String):[String(r)]}if("span"===i){const i=0===s.dy?"":s.dy>0?" \u2191":" \u2193",a=isFinite(s.pct)?"("+this._fmtPct(s.pct)+")":"";return[this._fmtY(s.dy)+" "+a+i,this._fmtX(t.x)+" to "+this._fmtX(e.x)]}return["\u0394x "+this._fmtDx(s.dx),"\u0394y "+this._fmtY(s.dy),this._fmtPct(s.pct)]}_fmtDx(t){if("datetime"===this.w.config.xaxis.type){const e=t/864e5;return Math.round(10*e)/10+"d"}return this._fmt(t)}_fmtY(t){const e=this._cfg().format&&this._cfg().format.y;if("function"==typeof e)try{const s=e(t);if(null!=s)return String(s)}catch(t){}const s=this.w.globals.yLabelFormatters&&this.w.globals.yLabelFormatters[0];if("function"==typeof s)try{const e=s(t,{seriesIndex:0,dataPointIndex:-1,w:this.w});if(null!=e&&""!==e)return String(e)}catch(t){}return this._fmt(t)}_fmtX(t){const e=this.w,s=this._cfg().format&&this._cfg().format.x;if("function"==typeof s)try{const e=s(t);if(null!=e)return String(e)}catch(t){}if("datetime"===e.config.xaxis.type){return new Date(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}const i=e.globals.xLabelFormatter;if("function"==typeof i)try{const s=i(t,{w:e});if(null!=s&&""!==s)return String(s)}catch(t){}return this._fmt(t)}_liveGroup(){const t=this.w;if(this._live&&this._live.node&&this._live.node.parentNode)return this._live;const e=this.graphics.group({class:"apexcharts-measure-live"});return e.node.style.pointerEvents="none",t.dom.elGraphical&&t.dom.elGraphical.add(e),this._live=e,e}_clearLive(){if(this._live&&this._live.node){const t=this._live.node;t.parentNode&&t.parentNode.removeChild(t)}this._live=null}_renderLive(){if(!this.drag)return;const t=this._liveGroup();for(;t.node.firstChild;)t.node.removeChild(t.node.firstChild);const e=this._resolve(this.drag.a),s=this._resolve(this.drag.b);this._drawRuler(t,e,s,!1,this._mode())}_renderPins(){const t=this.w,e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-measure-pins");if(e&&e.parentNode&&e.parentNode.removeChild(e),!this.pins.length||!t.dom.elGraphical)return;const s=this.graphics.group({class:"apexcharts-measure-pins"});s.node.style.pointerEvents="none",t.dom.elGraphical.add(s),this.pins.forEach(t=>{const e=l(n({},this._dataToGrid(t.xa,t.ya)),{x:t.xa,y:t.ya}),i=l(n({},this._dataToGrid(t.xb,t.yb)),{x:t.xb,y:t.yb});this._drawRuler(s,e,i,!0,t.mode||"span")})}_drawRuler(t,e,s,i,a){const r=this._stats(e,s),o=this.graphics.group({class:"apexcharts-measure-ruler "+this._dirClass(r.dy)+(i?" apexcharts-measure-pinned":"")});"free"===(a||this._mode())?this._drawFree(o,e,s,r):this._drawSpan(o,e,s,r),t.add(o)}_dot(t,e,s){if(!1===this._cfg().markers)return;const i=this.graphics.drawMarker(e.gx,e.gy,{pSize:4,shape:"circle",pointFillColor:s,pointFillOpacity:1,pointStrokeColor:"#fff",pointStrokeWidth:2,pointStrokeOpacity:1});t.add(i)}_readout(t,e,s,i,a,r,o){const n=this.graphics.drawRect(s,i,a,r,4);n.node.setAttribute("class","apexcharts-measure-label-bg"),n.attr({fill:"#ffffff","fill-opacity":.95,stroke:o,"stroke-width":1}),t.add(n);const l=this.graphics.drawText({x:s+9,y:i+15,text:e,textAnchor:"start",fontSize:"11px",foreColor:"#1e293b",cssClass:"apexcharts-measure-label"});t.add(l)}_drawSpan(t,e,s,i){const a=this.w,r=this._cfg(),o=a.layout.gridHeight,n=this._dirColor(i.dy),l=Math.min(e.gx,s.gx),h=Math.max(e.gx,s.gx);if(!1!==r.band){const e=this.graphics.drawRect(l,0,Math.max(0,h-l),o,0);e.node.setAttribute("class","apexcharts-measure-band"),e.attr({fill:n,"fill-opacity":.09,stroke:"none"}),t.add(e)}!1!==r.guides&&[e,s].forEach(e=>{const s=this.graphics.drawLine(e.gx,0,e.gx,o,this._colors().guide,4,1);s.node.setAttribute("class","apexcharts-measure-vline"),t.add(s)}),[e,s].forEach(e=>this._dot(t,e,n));const c=this._label(e,s,i,"span"),d=c.reduce((t,e)=>Math.max(t,e.length),0),g=Math.max(148,6.4*d),p=20+15*c.length;let u=(l+h)/2-g/2;u=Math.max(2,Math.min(u,a.layout.gridWidth-g-2)),this._readout(t,c,u,4,g,p,n)}_drawFree(t,e,s,i){const a=this._dirColor(i.dy),r=this.graphics.drawLine(e.gx,e.gy,s.gx,s.gy,a,0,2);r.node.setAttribute("class","apexcharts-measure-line"),t.add(r),[e,s].forEach(e=>this._dot(t,e,a));const o=this._label(e,s,i,"free"),n=o.reduce((t,e)=>Math.max(t,e.length),0),l=Math.max(72,6.2*n),h=16+15*o.length;let c=(e.gx+s.gx)/2+8,d=(e.gy+s.gy)/2-h/2;c=Math.max(2,Math.min(c,this.w.layout.gridWidth-l-2)),d=Math.max(2,Math.min(d,this.w.layout.gridHeight-h-2)),this._readout(t,o,c,d,l,h,a)}_fireMeasured(t,e){const s=this._stats(t,e),i={from:{x:t.x,y:t.y},to:{x:e.x,y:e.y},dx:s.dx,dy:s.dy,percentChange:s.pct,slope:s.slope},a=this.w.config.chart.events.measured;"function"==typeof a&&a(this.ctx,i),this.ctx.events.fireEvent("measured",[this.ctx,i])}_afterRender(){this._enabled()&&(this.pins.length&&this._renderPins(),this.persistent&&!this.pane&&this._arm())}teardown(){this._cancelDrag(),this._endSeed(!1),this._disarm();const t=this._doc();t&&this._keysBound&&(t.removeEventListener("keydown",this._onKeyDown),t.removeEventListener("keyup",this._onKeyUp)),this._keysBound=!1,this.pins=[]}}});Cs.registerFeatures({contextMenu:class{constructor(t,e){this.w=t,this.ctx=e,this.menu=null,this._items=[],this._focusIndex=-1,this._trigger=null,this._onContext=this._onContext.bind(this),this._onDocDown=this._onDocDown.bind(this),this._onKey=this._onKey.bind(this),this._afterRender=this._afterRender.bind(this),e.addEventListener("mounted",this._afterRender),e.addEventListener("updated",this._afterRender)}_cfg(){return this.w.config.chart.contextMenu||{}}_enabled(){return!0===this._cfg().enabled}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_afterRender(){if(this._detachTrigger(),this.close(),!this._enabled()||!c.isBrowser())return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.addEventListener("contextmenu",this._onContext),this._trigger=t)}_detachTrigger(){this._trigger&&(this._trigger.removeEventListener("contextmenu",this._onContext),this._trigger=null)}_onContext(t){this._enabled()&&(t.preventDefault(),this.open(t.clientX,t.clientY))}_clientToData(t,e){const s=this.w,i=s.dom.baseEl&&s.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const a=i.getBoundingClientRect();if(!a.width||!a.height)return null;const r=t=>t<0?0:t>1?1:t,o=r((t-a.left)/a.width),n=r((e-a.top)/a.height),l=s.globals.minX+o*(s.globals.maxX-s.globals.minX),h=s.globals.yAxisScale&&s.globals.yAxisScale[0],c=h&&isFinite(h.niceMin)?h.niceMin:s.globals.minY,d=h&&isFinite(h.niceMax)?h.niceMax:s.globals.maxY;return{x:l,y:d-n*(d-c)}}_resolveItems(t){const e=this._cfg(),s=Array.isArray(e.items)&&e.items.length?e.items:["annotate","xline","yline","measure"],i=e.labels||{},a=[];return s.forEach(e=>{if("string"==typeof e){if("annotate"===e)a.push({id:"annotate",label:i.annotate||"Add note here",run:()=>this._annotate(t)});else if("xline"===e)a.push({id:"xline",label:i.xline||"Annotate here",run:()=>this._line(t,"x")});else if("yline"===e)a.push({id:"yline",label:i.yline||"Mark this level",run:()=>this._line(t,"y")});else if("measure"===e){const e=this.ctx.measure;e&&this.w.config.chart.measure&&this.w.config.chart.measure.enabled&&a.push({id:"measure",label:i.measure||"Measure from here",run:()=>e.seedFromClient(t.clientX,t.clientY)})}}else e&&"object"==typeof e&&"function"==typeof e.onClick&&a.push({id:e.id||"custom",label:e.label||"Action",run:()=>e.onClick(this.ctx,t)})}),a}_annotate(t){if(null==t.x||null==t.y)return;const e=this._cfg(),s=this.ctx.ink;s&&"function"==typeof s.createAt?s.createAt(t.x,t.y,{text:e.noteText||"Note"}):this.ctx.addPointAnnotation({x:t.x,y:t.y,marker:{size:5},label:{text:e.noteText||"Note",style:{background:"#fff",color:"#334155"}}},!0)}_line(t,e){const s=this._cfg().line||{},i="x"===e?t.x:t.y;if(null==i)return;const a=this.ctx.ink;if(a&&"function"==typeof a.createLineAt)return void a.createLineAt(e,i,{text:s.text,strokeDashArray:s.strokeDashArray,color:s.color});const r={strokeDashArray:null!=s.strokeDashArray?s.strokeDashArray:4};s.text&&(r.label={text:s.text}),s.color&&(r.borderColor=s.color,r.label=b.extend(r.label||{},{borderColor:s.color})),"x"===e?this.ctx.addXaxisAnnotation(b.extend(r,{x:i}),!0):this.ctx.addYaxisAnnotation(b.extend(r,{y:i}),!0)}open(t,e){this.close();const s=this.w,i=s.dom.elWrap,a=this._doc();if(!i||!a)return;const r=this._clientToData(t,e),o=s.globals,n={x:r?r.x:null,y:r?r.y:null,seriesIndex:o.capturedSeriesIndex>=0?o.capturedSeriesIndex:null,dataPointIndex:o.capturedDataPointIndex>=0?o.capturedDataPointIndex:null,clientX:t,clientY:e},l=this._resolveItems(n);if(!l.length)return;this._items=l;const h=a.createElement("div");h.className="apexcharts-context-menu",h.setAttribute("role","menu"),h.style.position="absolute",h.style.visibility="hidden",l.forEach((t,e)=>{const s=a.createElement("button");s.type="button",s.className="apexcharts-context-menu-item",s.setAttribute("role","menuitem"),s.tabIndex=-1,s.textContent=t.label,s.addEventListener("click",t=>{t.stopPropagation(),this._activate(e)}),s.addEventListener("mouseenter",()=>this._focus(e)),h.appendChild(s)}),i.appendChild(h),this.menu=h;const c=i.getBoundingClientRect();let d=t-c.left,g=e-c.top;const p=h.offsetWidth,u=h.offsetHeight,x=Math.max(0,i.clientWidth-p),f=Math.max(0,i.clientHeight-u);d>x&&(d=x),g>f&&(g=f),h.style.left=Math.max(0,d)+"px",h.style.top=Math.max(0,g)+"px",h.style.visibility="visible",a.addEventListener("mousedown",this._onDocDown,!0),a.addEventListener("keydown",this._onKey,!0),this._focus(0)}_focus(t){if(!this.menu)return;const e=this.menu.querySelectorAll(".apexcharts-context-menu-item");this._focusIndex>=0&&e[this._focusIndex]&&e[this._focusIndex].classList.remove("apexcharts-context-menu-item--active"),this._focusIndex=t,e[t]&&(e[t].classList.add("apexcharts-context-menu-item--active"),"function"==typeof e[t].focus&&e[t].focus())}_activate(t){const e=this._items[t];this.close(),e&&e.run()}_onDocDown(t){this.menu&&this.menu.contains(t.target)||this.close()}_onKey(t){this.menu&&this._items.length&&("Escape"===t.key?(t.preventDefault(),this.close()):"ArrowDown"===t.key?(t.preventDefault(),this._focus((this._focusIndex+1)%this._items.length)):"ArrowUp"===t.key?(t.preventDefault(),this._focus((this._focusIndex-1+this._items.length)%this._items.length)):"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this._activate(this._focusIndex<0?0:this._focusIndex)))}close(){const t=this._doc();t&&(t.removeEventListener("mousedown",this._onDocDown,!0),t.removeEventListener("keydown",this._onKey,!0)),this.menu&&this.menu.parentNode&&this.menu.parentNode.removeChild(this.menu),this.menu=null,this._items=[],this._focusIndex=-1}teardown(){this.close(),this._detachTrigger()}}});class Ei{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){const{x:e,y:s,y1:i,y2:a,i:r,j:o,realIndex:h,columnGroupIndex:c,series:d,barHeight:g,barWidth:p,barXPosition:u,barYPosition:x,visibleSeries:f}=t,m=this.w,b=new gt(this.barCtx.w),y=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[h]:this.barCtx.strokeWidth;let w,v;m.axisFlags.isXNumeric&&!m.globals.isBarHorizontal?(w=e+p*(f+1),v=s+g*(f+1)-y):(w=e+p*f,v=s+g*f);let A=null,C=null,S=e,k=s,_={};const L=m.config.dataLabels,D=this.barCtx.barOptions.dataLabels,M=this.barCtx.barOptions.dataLabels.total;void 0!==x&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(v=x,k=x),void 0!==u&&this.barCtx.isVerticalGroupedRangeBar&&(w=u,S=u);const E=L.offsetX,P=L.offsetY;let F={width:0,height:0};if(m.config.dataLabels.enabled){const t=m.seriesData.series[r][o];F=b.getTextRects(m.config.dataLabels.formatter?m.config.dataLabels.formatter(t,l(n({},m),{seriesIndex:r,dataPointIndex:o,w:m})):m.formatters.yLabelFormatters[0](t),parseFloat(L.style.fontSize).toString())}const T={x:e,y:s,i:r,j:o,realIndex:h,columnGroupIndex:c,bcx:w,bcy:v,barHeight:g,barWidth:p,textRects:F,strokeWidth:y,dataLabelsX:S,dataLabelsY:k,dataLabelsConfig:L,barDataLabelsConfig:D,barTotalDataLabelsConfig:M,offX:E,offY:P};return _=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(T):this.calculateColumnsDataLabelsPosition(T),A=this.drawCalculatedDataLabels({x:_.dataLabelsX,y:_.dataLabelsY,val:this.barCtx.isRangeBar?[i,a]:"100%"===m.config.chart.stackType?d[h][o]:m.seriesData.series[h][o],i:h,j:o,barWidth:p,barHeight:g,textRects:F,dataLabelsConfig:L}),m.config.chart.stacked&&M.enabled&&(C=this.drawTotalDataLabels({x:_.totalDataLabelsX,y:_.totalDataLabelsY,barWidth:p,barHeight:g,realIndex:h,textAnchor:_.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:h,j:o}),dataLabelsConfig:L,barTotalDataLabelsConfig:M})),{dataLabelsPos:_,dataLabels:A,totalDataLabels:C}}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let i=this.barCtx.stackedSeriesTotals[e];return this.totalFormatter&&(i=this.totalFormatter(i,l(n({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),i}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,i,{i:a,j:r,realIndex:o,y:n,bcx:l,barWidth:h,barHeight:c,textRects:d,dataLabelsX:g,dataLabelsY:p,dataLabelsConfig:u,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:m,offX:b,offY:y}=t;const w=l;c=Math.abs(c);const v="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:A}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:r});l-=m/2;const C=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?g+=h/2:(g=e.axisFlags.isXNumeric?l-h/2+b:l-C+h/2+b,!e.config.chart.stacked&&A>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g-=h*A)),v){const t=2;g=g+d.height/2-m/2-t}const S=e.seriesData.series[a][r]<0;let k=n;switch(this.barCtx.isReversed&&(k=n+(S?c:-c)),x.position){case"center":p=v?S?k-c/2+y:k+c/2-y:S?k-c/2+d.height/2+y:k+c/2+d.height/2-y;break;case"bottom":p=v?S?k-c+y:k+c-y:S?k-c+d.height+m+y:k+c-d.height/2+m-y;break;case"top":p=v?S?k+y:k-y:S?k-d.height/2-y:k+d.height+y}let _=k;if(e.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{_=S?Math.max(t[r],_):Math.min(t[r],_)})}),this.barCtx.lastActiveBarSerieIndex===o&&f.enabled){const t=18,a=new gt(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),u.fontSize);s=S?_-a.height/2-y-f.offsetY+t:_+a.height+y+f.offsetY-t;const n=C;i=w+(e.axisFlags.isXNumeric?-h*e.globals.barGroups.length/2:e.globals.barGroups.length*h/2-(e.globals.barGroups.length-1)*h-n)+f.offsetX}return e.config.chart.stacked||(p<0?p=0+m:p+d.height/3>e.layout.gridHeight&&(p=e.layout.gridHeight-m)),{bcx:l,bcy:n,dataLabelsX:g,dataLabelsY:p,totalDataLabelsX:i,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const s=this.w;let{x:i,i:a,j:r,realIndex:o,bcy:n,barHeight:l,barWidth:h,textRects:c,dataLabelsX:d,strokeWidth:g,dataLabelsConfig:p,barDataLabelsConfig:u,barTotalDataLabelsConfig:x,offX:f,offY:m}=t;const b=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:y}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:r});let w,v,A;if(h=Math.abs(h),this.barCtx.isPyramid){w=n+l/2+m-(null!=(e=c.centerOffset)?e:0)}else w=n-(this.barCtx.isRangeBar?0:b)+l/2+c.height/2+m-3;!s.config.chart.stacked&&y>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(w-=l*y);let C="start";const S=s.seriesData.series[a][r]<0;let k=i;if(this.barCtx.isReversed&&(k=i+(S?-h:h),C=S?"start":"end"),this.barCtx.isPyramid)d=s.layout.gridWidth/2+f;else switch(u.position){case"center":d=S?k+h/2-f:Math.max(c.width/2,k-h/2)+f;break;case"bottom":d=S?k+h-g-f:k-h+g+f;break;case"top":d=S?k-g-f:k-g+f}let _=k;if(s.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{_=S?Math.min(t[r],_):Math.max(t[r],_)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){const t=new gt(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);S?(v=_-g-f-x.offsetX,C="end"):v=_+f+x.offsetX+(this.barCtx.isReversed?-(h+g):g),A=w-c.height/2+t.height/2+x.offsetY+g,s.globals.barGroups.length>1&&(A-=s.globals.barGroups.length/2*(l/2))}return s.config.chart.stacked||("start"===p.textAnchor?d-c.width<0?d=S?c.width+g:g:d+c.width>s.layout.gridWidth&&(d=S?s.layout.gridWidth-g:s.layout.gridWidth-c.width-g):"middle"===p.textAnchor?d-c.width/2<0?d=c.width/2+g:d+c.width/2>s.layout.gridWidth&&(d=s.layout.gridWidth-c.width/2-g):"end"===p.textAnchor&&(d<1?d=c.width+g:d+1>s.layout.gridWidth&&(d=s.layout.gridWidth-c.width-g))),{bcx:i,bcy:n,dataLabelsX:d,dataLabelsY:w,totalDataLabelsX:v,totalDataLabelsY:A,totalDataLabelsAnchor:C}}drawCalculatedDataLabels({x:t,y:e,val:s,i:i,j:a,textRects:r,barHeight:o,barWidth:h,dataLabelsConfig:c}){const d=this.w;let g="rotate(0)";"vertical"===d.config.plotOptions.bar.dataLabels.orientation&&(g=`rotate(-90, ${t}, ${e})`);const p=new yt(this.barCtx.w,this.barCtx.ctx),u=new gt(this.barCtx.w),x=c.formatter;let f=null;const m=d.globals.collapsedSeriesIndices.indexOf(i)>-1;if(c.enabled&&!m){f=u.group({class:"apexcharts-data-labels",transform:g});let m="";void 0!==s&&(m=x(s,l(n({},d),{seriesIndex:i,dataPointIndex:a,w:d}))),!s&&d.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(m="");const b=d.seriesData.series[i][a]<0,y=d.config.plotOptions.bar.dataLabels.position;if("vertical"===d.config.plotOptions.bar.dataLabels.orientation&&("top"===y&&(c.textAnchor=b?"end":"start"),"center"===y&&(c.textAnchor="middle"),"bottom"===y&&(c.textAnchor=b?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<u.getTextRects(m,parseFloat(c.style.fontSize).toString()).width&&(m="")}d.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(m=""):r.height/1.6>Math.abs(o)&&(m=""));const w=n({},c);this.barCtx.isHorizontal&&s<0&&("start"===c.textAnchor?w.textAnchor="end":"end"===c.textAnchor&&(w.textAnchor="start")),p.plotDataLabelsText({x:t,y:e,text:m,i:i,j:a,parent:f,dataLabelsConfig:w,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return f}drawTotalDataLabels({x:t,y:e,val:s,realIndex:i,textAnchor:a,barTotalDataLabelsConfig:r}){const o=new gt(this.barCtx.w);let n;return r.enabled&&void 0!==t&&void 0!==e&&this.barCtx.lastActiveBarSerieIndex===i&&(n=o.drawText({x:t,y:e,foreColor:r.style.color,text:s,textAnchor:a,fontFamily:r.style.fontFamily,fontSize:r.style.fontSize,fontWeight:r.style.fontWeight})),n}}let Pi=class{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s<t.length;s++)if(t[s].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let i=0;i<t[s].length;i++)e.seriesData.seriesX[s][i]>e.globals.minX&&e.seriesData.seriesX[s][i]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),b.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],e.globals.comboCharts||this.checkZeroSeries({series:t})}initialPositions(t){const e=this.w;let s,i,a,r,o,n,l,h,c=e.globals.dataPoints;this.barCtx.isRangeBar&&(c=e.labelData.labels.length);let d=this.barCtx.seriesLen;if(e.config.plotOptions.bar.rangeBarGroupRows&&(d=1),this.barCtx.isHorizontal)a=e.layout.gridHeight/c,o=a/d,e.axisFlags.isXNumeric&&(a=e.layout.gridHeight/this.barCtx.totalItems,o=a/this.barCtx.seriesLen),o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),i=(a-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),n=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio;e.globals.minXDiff&&.5!==e.globals.minXDiff&&e.globals.minXDiff/t>0&&(r=e.globals.minXDiff/t),n=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x}else s=e.globals.padHorizontal+b.noExponents(r-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=n,{x:s,y:i,yDivision:a,xDivision:r,barHeight:o,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,s,i){var a,r,o,n;const l=this.w,h=new pt(this.barCtx.w);let c=null;const d=this.barCtx.barOptions.distributed?s:e;let g=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(i=>{t[e][s]>=i.from&&t[e][s]<=i.to&&(c=i.color,g=!0)})}return{color:h.fillPath({seriesNumber:this.barCtx.barOptions.distributed?d:i,dataPointIndex:s,color:c,value:t[e][s],fillConfig:null==(a=l.config.series[e].data[s])?void 0:a.fill,fillType:(null==(o=null==(r=l.config.series[e].data[s])?void 0:r.fill)?void 0:o.type)?null==(n=l.config.series[e].data[s])?void 0:n.fill.type:Array.isArray(l.config.fill.type)?l.config.fill.type[i]:l.config.fill.type}),useRangeColor:g}}getStrokeWidth(t,e,s){let i=0;const a=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===a.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,a.config.stroke.show&&(this.barCtx.isNullValue||(i=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),i}createBorderRadiusArr(t){var e;const s=this.w,i=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,a=t.length,r=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:a},()=>Array(r).fill(i?"top":"none"));if(i)return o;const n=this.w.config.chart.type;for(let e=0;e<r;e++){const s=[],i=[];let l=0;for(let r=0;r<a;r++){const a=t[r][e];a>0?(s.push(r),l++):a<0&&(i.push(r),l++)}if(s.length>0&&0===i.length)if(1===s.length)o[s[0]][e]="bar"===n&&1===r?"top":"both";else{const t=s[0],i=s[s.length-1];for(const a of s)o[a][e]=a===t?"bar"===n&&1===r?"top":"bottom":a===i?"top":"none"}else if(i.length>0&&0===s.length)if(1===i.length)o[i[0]][e]="both";else{const t=Math.max(...i),s=Math.min(...i);for(const a of i)o[a][e]=a===t?"bottom":a===s?"top":"none"}else if(s.length>0&&i.length>0){const t=s[s.length-1];for(const i of s)o[i][e]=i===t?"top":"none";const a=Math.max(...i);for(const t of i)o[t][e]=t===a?"bottom":"none"}else if(1===l){o[s[0]||i[0]][e]="both"}}return o}barBackground({j:t,i:e,x1:s,x2:i,y1:a,y2:r,elSeries:o}){const n=this.w,l=new gt(this.barCtx.w),h=new ce(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==s?s:0,void 0!==a?a:0,void 0!==i?i:n.layout.gridWidth,void 0!==r?r:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:i,strokeWidth:a,isReversed:r,series:o,seriesGroup:n,realIndex:l,i:h,j:c,w:d}){var g,p,u;const x=new gt(this.barCtx.w);(a=Array.isArray(a)?a[l]:a)||(a=0);let f=t,m=e;(null==(g=d.config.series[l].data[c])?void 0:g.columnWidthOffset)&&(m=e-d.config.series[l].data[c].columnWidthOffset/2,f=t+d.config.series[l].data[c].columnWidthOffset);const b=a/2,y=m+b,w=m+f-b,v=(o[h][c]>=0?1:-1)*(r?-1:1);s+=.001-b*v,i+=.001+b*v;const A=x.line(w,s),C="around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z";let S=x.move(y,s)+x.line(y,i)+x.line(w,i)+A+C;"none"!==this.arrBorderRadius[l][c]&&(S=x.roundPathCorners(S,d.config.plotOptions.bar.borderRadius));let k=null;const _=null==(u=null==(p=this.barCtx.ctx)?void 0:p.morphTypeChange)?void 0:u.getInitialPathFor(l,c);if(_?k=_:d.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(l,c,S)),null==k&&(k=x.move(y,s)+x.line(y,s)+A+A+A+A+A+x.line(y,s)+C),d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[n],t.yArrj.push(i-b*v),t.yArrjF.push(Math.abs(s-i+a*v)),t.yArrjVal.push(this.barCtx.series[h][c])}return{pathTo:S,pathFrom:k}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:i,j:a,realIndex:r,strokeWidth:o,w:n}){var l,h;const c=new gt(this.barCtx.w),d=n.layout.gridWidth/2,g=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,p=g(s[i][a]),u=a===s[i].length-1,x="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=u?"taper"===x?0:p:g(s[i][a+1]);const m=o/2,b=t+m,y=t+e-m,w=d-p,v=d+p,A=d-f,C=d+f,S=c.move(w,b)+c.line(v,b)+c.line(C,y)+c.line(A,y)+" Z";let k=null;const _=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,a);return _?k=_:n.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,a,S)),null==k&&(k=c.move(d,b)+c.line(d,b)+c.line(d,y)+c.line(d,y)+" Z"),{pathTo:S,pathFrom:k,x:v,x1:w,barXPosition:d}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,i=e.layout.gridWidth,a=t.map(t=>Math.abs(Number(t)||0)),r=a.reduce((t,e)=>t+e,0);if(0===r||s<=0)return a.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=i/2;let n=0;const l=[];for(let t=0;t<a.length;t++){const e=n/r;n+=a[t];const i=n/r,h=e*s,c=i*s;l.push({y:h,height:c-h,topHalf:e*o,bottomHalf:i*o})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:i,realIndex:a,j:r,strokeWidth:o,w:n}){var l,h;const c=new gt(this.barCtx.w),d=n.layout.gridWidth/2,g=o/2,p=t+g,u=t+e-g,x=d-s,f=d+s,m=d-i,b=d+i,y=c.move(x,p)+c.line(f,p)+c.line(b,u)+c.line(m,u)+" Z";let w=null;const v=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(a,r);return v?w=v:n.globals.previousPaths.length>0&&(w=this.barCtx.getPreviousPath(a,r,y)),null==w&&(w=c.move(d,p)+c.line(d,p)+c.line(d,u)+c.line(d,u)+" Z"),{pathTo:y,pathFrom:w,x:f,x1:x,barXPosition:d}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:i,strokeWidth:a,isReversed:r,series:o,seriesGroup:n,realIndex:l,i:h,j:c,w:d}){var g,p,u;const x=new gt(this.barCtx.w);(a=Array.isArray(a)?a[l]:a)||(a=0);let f=t,m=e;(null==(g=d.config.series[l].data[c])?void 0:g.barHeightOffset)&&(f=t-d.config.series[l].data[c].barHeightOffset/2,m=e+d.config.series[l].data[c].barHeightOffset);const b=a/2,y=f+b,w=f+m-b,v=(o[h][c]>=0?1:-1)*(r?-1:1);s+=.001+b*v,i+=.001-b*v;const A=this.barCtx.isFunnel,C=A?(s+i)/2:s,S=x.line(s,w),k="around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z";let _=x.move(s,y)+x.line(i,y)+x.line(i,w)+S+k;"none"!==this.arrBorderRadius[l][c]&&(_=x.roundPathCorners(_,d.config.plotOptions.bar.borderRadius));let L=null;const D=null==(u=null==(p=this.barCtx.ctx)?void 0:p.morphTypeChange)?void 0:u.getInitialPathFor(l,c);if(D?L=D:d.globals.previousPaths.length>0&&(L=this.barCtx.getPreviousPath(l,c,_)),null==L){const t=A?x.line(C,w):S;L=x.move(C,y)+x.line(C,y)+t+t+t+t+t+x.line(C,y)+k}if(d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[n],t.xArrj.push(i+b*v),t.xArrjF.push(Math.abs(s-i-a*v)),t.xArrjVal.push(this.barCtx.series[h][c])}return{pathTo:_,pathFrom:L}}checkZeroSeries({series:t}){const e=this.w;for(let s=0;s<t.length;s++){let i=0;for(let a=0;a<t[e.globals.maxValsInArrayIndex].length;a++)i+=t[s][a];0===i&&this.barCtx.zeroSerieses.push(s)}}getXForValue(t,e,s=!0){let i=s?e:null;return null!=t&&(i=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),i}getYForValue(t,e,s,i=!0){let a=i?e:null;return null!=t&&(a=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),a}getGoalValues(t,e,s,i,a,r){const o=this.w,h=[],c=(i,a)=>{h.push({[t]:"x"===t?this.getXForValue(i,e,!1):this.getYForValue(i,s,r,!1),attrs:a})};if(o.seriesData.seriesGoals[i]&&o.seriesData.seriesGoals[i][a]&&Array.isArray(o.seriesData.seriesGoals[i][a])&&o.seriesData.seriesGoals[i][a].forEach(t=>{c(t.value,t)}),this.barCtx.barOptions.isDumbbell&&o.rangeData.seriesRange.length){const e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:o.globals.colors,s={strokeHeight:"x"===t?0:o.globals.markers.size[i],strokeWidth:"x"===t?o.globals.markers.size[i]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[i])?e[i][0]:e[i]};c(o.rangeData.seriesRangeStart[i][a],s),c(o.rangeData.seriesRangeEnd[i][a],l(n({},s),{strokeColor:Array.isArray(e[i])?e[i][1]:e[i]}))}return h}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:i,barWidth:a,barHeight:r}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(i)&&i.length>0))return null;const o=new gt(this.barCtx.w),n=o.group({className:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,i=e+s+r/2;l=o.drawLine(t.x,i-2*s,t.x,i,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),n.add(l)}}):Array.isArray(i)&&i.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:a/2,i=t+s+a/2;l=o.drawLine(i-2*s,e.y,i,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),n.add(l)}}),n}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:i,j:a}){const r=this.w,{x:o,x1:n,barYPosition:l}=t,{x:h,x1:c,barYPosition:d}=e,g=l+e.barHeight,p=new gt(this.barCtx.w),u=new b,x=p.move(n,g)+p.line(o,g)+p.line(h,d)+p.line(c,d)+p.line(n,g)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[i][a]?" Z":" z");return p.drawPath({d:x,fill:u.shadeColor(.5,b.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const i=this.w;let a=0,r=0;return(i.config.plotOptions.bar.horizontal?i.seriesData.series.map((t,e)=>e):(null==(s=i.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=i.globals.seriesPercent[s][e];o&&a++,s<t&&0===o&&r++}),{nonZeroColumns:a,zeroEncounters:r}}getGroupIndex(t){const e=this.w,s=e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1),i=this.barCtx.columnGroupIndices;let a=i.indexOf(s);return a<0&&(i.push(s),a=i.length-1),{groupIndex:s,columnGroupIndex:a}}};class Fi{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const i=new ce(this.w);this.lastActiveBarSerieIndex=i.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];const a=i.getBarSeriesIndices(),r=new P(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===a.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new Pi(this)}draw(t,e){var s,i;const a=this.w,r=new gt(this.w),o=new P(this.w);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const h=r.group({class:"apexcharts-bar-series apexcharts-plot-series"});a.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let o=0,c=0;o<t.length;o++,c++){let d,g;const p=[],u=[],x=a.globals.comboCharts?e[o]:o,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(x),m=r.group({class:"apexcharts-series",rel:o+1,seriesName:b.escapeString(a.seriesData.seriesNames[x]),"data:realIndex":x});ce.addCollapsedClassToSeries(this.w,m,x),t[o].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=a.globals.seriesYAxisReverseMap[x],this.translationsIndex=x);const y=this.translationsIndex;this.isReversed=a.config.yaxis[this.yaxisIndex]&&a.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[o]));const w=this.barHelpers.initialPositions(x),{y:v,yDivision:A,zeroW:C,x:S,xDivision:k,zeroH:_}=w;let L=w.barHeight,D=w.barWidth;g=v,d=S,this.isHorizontal||u.push(d+(null!=D?D:0)/2);const M=r.group({class:"apexcharts-datalabels","data:realIndex":x});a.globals.delayedElements.push({el:M.node,holdUntilComplete:this.isLengthTransition(x)}),M.node.classList.add("apexcharts-element-hidden");const E=r.group({class:"apexcharts-bar-goals-markers"}),P=r.group({class:"apexcharts-bar-shadows"});a.globals.delayedElements.push({el:P.node}),P.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[o].length;e++){const r=this.barHelpers.getStrokeWidth(o,e,x);let h=null;const w={indexes:{i:o,j:e,realIndex:x,translationsIndex:y,bc:c},x:d,y:g,strokeWidth:r,elSeries:m};this.isHorizontal?(h=this.drawBarPaths(l(n({},w),{barHeight:L,zeroW:C,yDivision:A})),D=this.series[o][e]/this.invertedYRatio):(h=this.drawColumnPaths(l(n({},w),{xDivision:k,barWidth:D,zeroH:_})),L=this.series[o][e]/this.yRatio[y]);const v=this.barHelpers.getPathFillColor(t,o,e,x);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(s=a.config.plotOptions.funnel)?void 0:s.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof v.color&&-1===(null==(i=v.color)?void 0:i.indexOf("url"))?v.color:b.hexToRgba(a.globals.colors[o]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:h,realIndex:x,j:e});if(P.add(t),a.config.chart.dropShadow.enabled){new dt(this.w).dropShadow(t,a.config.chart.dropShadow,x)}}this.pathArr.push(h);const S=this.barHelpers.drawGoalLine({barXPosition:h.barXPosition,barYPosition:h.barYPosition,goalX:h.goalX,goalY:h.goalY,barHeight:L,barWidth:D});S&&E.add(S),g=h.y,d=h.x,e>0&&u.push(d+(null!=D?D:0)/2),p.push(g),this.renderSeries(l(n({realIndex:x,pathFill:v.color},v.useRangeColor?{lineFill:v.color}:{}),{j:e,i:o,columnGroupIndex:f,pathFrom:h.pathFrom,pathTo:h.pathTo,strokeWidth:r,elSeries:m,x:d,y:g,series:t,barHeight:Math.abs(h.barHeight?h.barHeight:L),barWidth:Math.abs(h.barWidth?h.barWidth:D),elDataLabelsWrap:M,elGoalsMarkers:E,elBarShadows:P,visibleSeries:this.visibleI,type:"bar"}))}if(a.globals.seriesXvalues[x]=u,a.globals.seriesYvalues[x]=p,a.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[o].length;s++)e.push(Ht(a,x,s));qt({w:a,elSeries:m,record:this._prevRecord(x),newKeys:e,isHorizontal:this.isHorizontal,speed:a.config.chart.animations.dynamicAnimation.speed})}h.add(m)}return h}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:i,i:a,columnGroupIndex:r,pathFrom:o,pathTo:n,strokeWidth:l,elSeries:h,x:c,y:d,y1:g,y2:p,series:u,barHeight:x,barWidth:f,barXPosition:m,barYPosition:b,elDataLabelsWrap:y,elGoalsMarkers:w,elBarShadows:v,visibleSeries:A,type:C,classes:S}){var k;const _=this.w,L=new gt(this.w,this.ctx),D=xt(this.ctx,L);let M=!1;if(h._bindingsDelegated||(h._bindingsDelegated=!0,L.setupEventDelegation(h,`.apexcharts-${C}-area`)),!s){let e=function(t){const e=_.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:_.seriesData.series[t][i],dataPointIndex:i,w:_}):s};const a="function"==typeof _.globals.stroke.colors[t]?e(t):_.globals.stroke.colors[t];s=this.barOptions.distributed?_.globals.stroke.colors[i]:a}const E=new Ei(this).handleBarDataLabels({x:c,y:d,y1:g,y2:p,i:a,j:i,series:u,realIndex:t,columnGroupIndex:r,barHeight:x,barWidth:f,barXPosition:m,barYPosition:b,visibleSeries:A});_.globals.isBarHorizontal||(E.dataLabelsPos.dataLabelsX+Math.max(f,_.globals.barPadForNumericAxis)<0||E.dataLabelsPos.dataLabelsX-Math.max(f,_.globals.barPadForNumericAxis)>_.layout.gridWidth)&&(M=!0),_.config.series[a].data[i]&&_.config.series[a].data[i].strokeColor&&(s=_.config.series[a].data[i].strokeColor),this.isNullValue&&(e="none");const P=_.config.chart.animations,F=P.animateGradually;let T=0;if(F&&!1!==F.enabled&&!(_.globals.dataChanged&&this.isLengthTransition(t))){const t=_.globals.dataPoints||1,e=F.delay||0,s=Math.min(e,.5*P.speed/Math.max(1,t));let r=ht({style:"sequential",index:i,baseDelay:s});_.config.chart.stacked&&(r+=a*s*.5);T=r/(e||1)}if(!M){const r=!0===(null==(k=this.ctx.morphTypeChange)?void 0:k.isActive())?this.ctx.morphTypeChange.getSpeed():_.config.chart.animations.dynamicAnimation.speed,c=D.renderPaths({i:a,j:i,realIndex:t,pathFrom:o,pathTo:n,stroke:s,strokeWidth:l,strokeLineCap:_.config.stroke.lineCap,fill:e,animationDelay:T,initialSpeed:_.config.chart.animations.speed,dataChangeSpeed:r,className:`apexcharts-${C}-area ${S}`,chartType:C,bindEventsOnPaths:!1});c.attr("clip-path",`url(#gridRectBarMask${_.globals.cuid})`);const d=_.config.forecastDataPoints;d.count>0&&i>=_.globals.dataPoints-d.count&&(c.node.setAttribute("stroke-dasharray",d.dashArray),c.node.setAttribute("stroke-width",d.strokeWidth),c.node.setAttribute("fill-opacity",d.fillOpacity)),void 0!==g&&void 0!==p&&(c.attr("data-range-y1",g),c.attr("data-range-y2",p));new dt(this.w).setSelectionFilter(c,t,i),h.add(c),c.attr({cy:E.dataLabelsPos.bcy,cx:E.dataLabelsPos.bcx,j:i,val:_.seriesData.series[a][i],barHeight:x,barWidth:f,"data:pathKey":Ht(_,t,i)}),"canvas"===D.kind&&(_.globals.barCanvasCoords||(_.globals.barCanvasCoords={}),_.globals.barCanvasCoords[t]||(_.globals.barCanvasCoords[t]={}),_.globals.barCanvasCoords[t][i]={cx:E.dataLabelsPos.bcx,cy:E.dataLabelsPos.bcy,barWidth:f}),null!==E.dataLabels&&y.add(E.dataLabels),E.totalDataLabels&&y.add(E.totalDataLabels),h.add(y),w&&h.add(w),v&&h.add(v)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:r,yDivision:o,elSeries:n}){const l=this.w,h=t.i,c=t.j;let d;if(l.axisFlags.isXNumeric)d=(r=(l.seriesData.seriesX[h][c]-l.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:c});t>0&&(e=this.seriesLen*e/t),d=r+e*this.visibleI,d-=e*s}else d=r+e*this.visibleI;const g=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,p=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[c]:null,u=!!p;if(p)d=p.y,e=p.height;else if(this.isFunnel&&!g){const t=null!=i?i:0;i=t-(this.barHelpers.getXForValue(this.series[h][c],t)-t)/2}let x;return a=this.barHelpers.getXForValue(this.series[h][c],null!=i?i:0),x=p?this.barHelpers.getPyramidPaths({barYPosition:d,barHeight:e,topHalf:p.topHalf,bottomHalf:p.bottomHalf,realIndex:t.realIndex,j:c,strokeWidth:s,w:l}):g?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:d,barHeight:e,series:this.series,i:h,j:c,realIndex:t.realIndex,strokeWidth:s,w:l}):this.barHelpers.getBarpaths({barYPosition:d,barHeight:e,x1:i,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:c,w:l}),(g||u)&&(i=x.x1,a=x.x),l.axisFlags.isXNumeric||u||(r+=o),u&&(r=d),this.barHelpers.barBackground({j:c,i:h,y1:d-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:x.pathTo,pathFrom:x.pathFrom,x1:i,x:a,y:r,goalX:this.barHelpers.getGoalValues("x",i,null,h,c,0),barYPosition:d,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:r,strokeWidth:o,elSeries:n}){const l=this.w,h=t.realIndex,c=t.translationsIndex,d=t.i,g=t.j,p=t.bc;let u;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:g,realIndex:h,barWidth:a});e=t.x,u=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:d,j:g});t>0&&(a=this.seriesLen*a/t),u=e+a*this.visibleI,u-=a*s}else u=e+a*this.visibleI;s=this.barHelpers.getYForValue(this.series[d][g],r,c);const x=this.barHelpers.getColumnPaths({barXPosition:u,barWidth:a,y1:r,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:d,j:g,w:l});return l.axisFlags.isXNumeric||(e+=i),this.barHelpers.barBackground({bc:p,j:g,i:d,x1:u-o/2-a*this.visibleI,x2:a*this.seriesLen+o/2,elSeries:n}),{pathTo:x.pathTo,pathFrom:x.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,d,g,c),barXPosition:u,barWidth:a}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:i}){const a=this.w;let r=s;return a.seriesData.seriesX[s].length||(r=a.globals.maxValsInArrayIndex),b.isNumber(a.seriesData.seriesX[r][i])&&(t=(a.seriesData.seriesX[r][i]-a.globals.minX)/this.xRatio-e*this.seriesLen/2),{barXPosition:t+e*this.visibleI,x:t}}_prevRecord(t){const e=this.w;let s=null;for(let i=0;i<e.globals.previousPaths.length;i++){const a=e.globals.previousPaths[i];a.paths&&a.paths.length>0&&parseInt(a.realIndex,10)===parseInt(String(t),10)&&(s=a)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const i=this.w;let a=!1;if(Ot(i)&&i.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(s=null==(e=i.seriesData.series[t])?void 0:e.length)?s:0;if(r)if(r.paths.length!==o)a=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(Ht(i,t,s))){a=!0;break}}else a=o>0}return this._ltCache[t]=a,a}getPreviousPath(t,e,s){const i=this.w,a=this._prevRecord(t);if(!a)return Ot(i)?null:s;let r=null,o=!1;const n=this._prevKeyedPaths(t);if(n){const s=n.get(Ht(i,t,e));s?r=s.d:o=!0}else void 0!==a.paths[e]?r=a.paths[e].d:o=!0;return r&&Fi.pathCommandCount(r)===Fi.pathCommandCount(s)?r:o&&Ot(i)?null:s}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}function Ti({w:t,points:e,seedA:s,seedB:i,center:a,halfExtent:r,alongFn:o,isHorizontal:n,options:l,clampAt:h}){const c=l;if(!c||!1===c.show)return[];if(!e||!e.length)return[];const d=c.maxPoints||3e3,g=e.length>d?Math.ceil(e.length/d):1,p=null!=c.size?c.size:2.5,u=r*(null!=c.jitter?c.jitter:.5),x=!1!==c.constrainToViolin&&"function"==typeof h,f="square"===c.shape,m=c.colorScale,b=m&&Array.isArray(m.colors)&&m.colors.length>0,y=b?Math.max(2,m.steps||24):1,w=b&&null!=m.min?m.min:t.globals.minY,v=(b&&null!=m.max?m.max:t.globals.maxY)-w||1,A=b?new Array(y).fill(""):[""];for(let t=0;t<e.length;t+=g){const r=e[t],l=o(r);let c=2*(zi(7919*s+100003*i+t)-.5)*u;if(x){const t=h(r);c>t&&(c=t),c<-t&&(c=-t)}const d=n?l:a+c,g=n?a+c:l,m=f?Yi(d,g,p):Bi(d,g,p);if(b){let t=(r-w)/v;t<0&&(t=0),t>1&&(t=1),A[Math.round(t*(y-1))]+=m}else A[0]+=m}if(!b)return A[0]?[{fill:null,d:A[0]}]:[];const C=[];for(let t=0;t<y;t++)A[t]&&C.push({fill:Ri(m.colors,t/(y-1)),d:A[t]});return C}function Ii({graphics:t,w:e,elSeries:s,pointsByCat:i,options:a,distributed:r,realIndex:o,wrapClass:n,pointClass:l}){if(!a||!1===a.show||!i.length)return;const h=null!=a.opacity?a.opacity:.9,c=null!=a.strokeColor?a.strokeColor:"#fff",d=null!=a.strokeWidth?a.strokeWidth:1,g=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,p=t.group({class:g?`${n} apexcharts-element-hidden`:n});g&&e.globals.delayedElements.push({el:p.node}),i.forEach(({groups:s,j:i})=>{const n=r?e.globals.colors[i]:e.globals.colors[o],g=a.fillColor,u="series"===g?n:"series-dark"===g?Xi(n,.45):g||Xi(n,.45);s.forEach(s=>{const a=t.drawPath({d:s.d,fill:null!=s.fill?s.fill:u,stroke:d>0?c:"none",strokeWidth:d,fillOpacity:h,classes:l});a.attr("data:realIndex",o),a.attr("j",i),a.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),a.node.style.pointerEvents="none",p.add(a)})}),s.add(p)}function Xi(t,e){const s=b.parseHex(t);if(!s)return t;const i=Math.max(0,1-e);return`rgb(${Math.round(s[0]*i)},${Math.round(s[1]*i)},${Math.round(s[2]*i)})`}function Ri(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const s=Math.max(0,Math.min(1,e))*(t.length-1),i=Math.floor(s),a=s-i,r=b.parseHex(t[i])||[0,0,0],o=b.parseHex(t[Math.min(i+1,t.length-1)])||r,n=(t,e)=>Math.round(t+(e-t)*a);return`rgb(${n(r[0],o[0])},${n(r[1],o[1])},${n(r[2],o[2])})`}function zi(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function Bi(t,e,s){return`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${-2*s} 0 `}function Yi(t,e,s){return`M ${t-s} ${e-s} h ${2*s} v ${2*s} h ${-2*s} z `}class Ni extends Fi{draw(t,e,s){var i;const a=this.w,r=new gt(this.w),o=a.globals.comboCharts?e:a.config.chart.type,h=new pt(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=a.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new P(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const c=r.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let o,d;this.isBoxPlot="boxPlot"===a.config.chart.type||"boxPlot"===a.config.series[e].type;const g=[],p=[],u=a.globals.comboCharts?s[e]:e,{columnGroupIndex:x}=this.barHelpers.getGroupIndex(u),f=r.group({class:"apexcharts-series",seriesName:b.escapeString(a.seriesData.seriesNames[u]),rel:e+1,"data:realIndex":u});ce.addCollapsedClassToSeries(this.w,f,u),t[e].length>0&&(this.visibleI=this.visibleI+1);let m=0;this.yRatio.length>1&&(this.yaxisIndex=a.globals.seriesYAxisReverseMap[u][0],m=u);const y=this.barHelpers.initialPositions(u),{y:w,barHeight:v,yDivision:A,zeroW:C,x:S,barWidth:k,xDivision:_,zeroH:L}=y;d=w,o=S,p.push(o+(null!=k?k:0)/2);const D=r.group({class:"apexcharts-datalabels","data:realIndex":u}),M=r.group({class:"apexcharts-bar-goals-markers"}),E=this.isBoxPlot?this.boxOptions.points:null,P=[],F=a.layout.gridWidth,T=null!=k?k:0;for(let s=0;s<a.globals.dataPoints;s++){const r=this.barHelpers.getStrokeWidth(e,s,u);let c=null;const b={indexes:{i:e,j:s,realIndex:u,translationsIndex:m},x:o,y:d,strokeWidth:r,elSeries:f};if(c=this.isHorizontal?this.drawHorizontalBoxPaths(l(n({},b),{yDivision:A,barHeight:v,zeroW:C})):this.drawVerticalBoxPaths(l(n({},b),{xDivision:_,barWidth:k,zeroH:L,cullBounds:{lo:-T,hi:F+T}})),d=c.y,o=c.x,s>0&&p.push(o+(null!=k?k:0)/2),g.push(d),c.culled)continue;const y=this.barHelpers.drawGoalLine({barXPosition:c.barXPosition,barYPosition:c.barYPosition,goalX:c.goalX,goalY:c.goalY,barHeight:v,barWidth:k});if(y&&M.add(y),c.pathTo.forEach((i,n)=>{const l=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?c.color[n]:a.globals.stroke.colors[e],g=h.fillPath({seriesNumber:u,dataPointIndex:s,color:c.color[n],value:t[e][s]});this.renderSeries({realIndex:u,pathFill:g,lineFill:l,j:s,i:e,pathFrom:c.pathFrom,pathTo:i,strokeWidth:r,elSeries:f,x:o,y:d,series:t,columnGroupIndex:x,barHeight:v,barWidth:k,elDataLabelsWrap:D,elGoalsMarkers:M,visibleSeries:this.visibleI,type:a.config.chart.type})}),E&&!1!==E.show){const t=null==(i=a.candleData.seriesBoxPoints[u])?void 0:i[s];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,u);let i,r,o;if(this.isHorizontal){const t=this.invertedYRatio,s=null!=v?v:0,a=null!=C?C:0;i=c.barYPosition+s/2,r=s/2,o=s=>a+e(s)/t}else{const t=this.yRatio[m],s=null!=k?k:0,a=null!=L?L:0;i=c.barXPosition+s/2,r=s/2,o=s=>a-e(s)/t}const n=Ti({w:a,points:t,seedA:u,seedB:s,center:i,halfExtent:r,alongFn:o,isHorizontal:this.isHorizontal,options:E});n.length&&P.push({groups:n,j:s})}}}E&&Ii({graphics:r,w:a,elSeries:f,pointsByCat:P,options:E,distributed:a.config.plotOptions.bar.distributed,realIndex:u,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),a.globals.seriesXvalues[u]=p,a.globals.seriesYvalues[u]=g,c.add(f)}return c}drawVerticalBoxPaths({indexes:t,x:e,xDivision:s,barWidth:i,zeroH:a,strokeWidth:r,cullBounds:o=null}){var n,l;const h=this.w,c=new gt(this.w),d=t.i,g=t.j,{colors:p}=h.config.plotOptions.candlestick,{colors:u}=this.boxOptions,x=t.realIndex,f=t=>Array.isArray(t)?t[x]:t,m=f(p.upward),b=f(p.downward),y=this.yRatio[t.translationsIndex],w=this.getOHLCValue(x,g);let v=a,A=a,C=w.o<w.c?[m]:[b];this.isBoxPlot&&(C=[f(u.lower),f(u.upper)]);let S=Math.min(w.o,w.c),k=Math.max(w.o,w.c),_=w.m;h.axisFlags.isXNumeric&&(e=(h.seriesData.seriesX[x][g]-h.globals.minX)/this.xRatio-i/2);const L=e+i*this.visibleI;if(void 0===(null==(n=this.series[d])?void 0:n[g])||null===(null==(l=this.series[d])?void 0:l[g])?(S=a,k=a):(S=a-S/y,k=a-k/y,v=a-w.h/y,A=a-w.l/y,_=a-w.m/y),o&&(L+i<o.lo||L>o.hi))return{pathTo:null,pathFrom:null,x:h.axisFlags.isXNumeric?e:e+s,y:k,barXPosition:L,color:C,culled:!0};let D;if(this.isOHLC){const t=L+i/2,e=a-w.o/y,s=a-w.c/y;D=[c.move(t,v)+c.line(t,A)+c.move(t,e)+c.line(L,e)+c.move(t,s)+c.line(L+i,s)]}else D=this.isBoxPlot?[c.move(L,S)+c.line(L+i/2,S)+c.line(L+i/2,v)+c.line(L+i/4,v)+c.line(L+i-i/4,v)+c.line(L+i/2,v)+c.line(L+i/2,S)+c.line(L+i,S)+c.line(L+i,_)+c.line(L,_)+c.line(L,S+r/2),c.move(L,_)+c.line(L+i,_)+c.line(L+i,k)+c.line(L+i/2,k)+c.line(L+i/2,A)+c.line(L+i-i/4,A)+c.line(L+i/4,A)+c.line(L+i/2,A)+c.line(L+i/2,k)+c.line(L,k)+c.line(L,_)+"z"]:[c.move(L,k)+c.line(L+i/2,k)+c.line(L+i/2,v)+c.line(L+i/2,k)+c.line(L+i,k)+c.line(L+i,S)+c.line(L+i/2,S)+c.line(L+i/2,A)+c.line(L+i/2,S)+c.line(L,S)+c.line(L,k-r/2)];let M=null;return h.globals.previousPaths.length>0&&(M=this.getPreviousPath(x,g,D[0])),null==M&&(M=c.move(L+i/2,S)+c.move(L,S)),h.axisFlags.isXNumeric||(e+=s),{pathTo:D,pathFrom:M,x:e,y:k,goalY:this.barHelpers.getGoalValues("y",null,a,d,g,t.translationsIndex),barXPosition:L,color:C}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:s,barHeight:i,zeroW:a,strokeWidth:r}){var o,n;const l=this.w,h=new gt(this.w),c=t.i,d=t.j,g=t.realIndex,{colors:p}=l.config.plotOptions.candlestick,{colors:u}=this.boxOptions,x=t=>Array.isArray(t)?t[g]:t,f=this.invertedYRatio,m=this.getOHLCValue(g,d);let b=m.o<m.c?[x(p.upward)]:[x(p.downward)];this.isBoxPlot&&(b=[x(u.lower),x(u.upper)]);let y=a,w=a,v=Math.min(m.o,m.c),A=Math.max(m.o,m.c),C=m.m;l.axisFlags.isXNumeric&&(e=(l.seriesData.seriesX[g][d]-l.globals.minX)/this.invertedXRatio-i/2);const S=e+i*this.visibleI;void 0===(null==(o=this.series[c])?void 0:o[d])||null===(null==(n=this.series[c])?void 0:n[d])?(v=a,A=a):(v=a+v/f,A=a+A/f,y=a+m.h/f,w=a+m.l/f,C=a+m.m/f);const k=[h.move(v,S)+h.line(v,S+i/2)+h.line(y,S+i/2)+h.line(y,S+i/2-i/4)+h.line(y,S+i/2+i/4)+h.line(y,S+i/2)+h.line(v,S+i/2)+h.line(v,S+i)+h.line(C,S+i)+h.line(C,S)+h.line(v+r/2,S),h.move(C,S)+h.line(C,S+i)+h.line(A,S+i)+h.line(A,S+i/2)+h.line(w,S+i/2)+h.line(w,S+i-i/4)+h.line(w,S+i/4)+h.line(w,S+i/2)+h.line(A,S+i/2)+h.line(A,S)+h.line(C,S)+"z"];let _=null;return l.globals.previousPaths.length>0&&(_=this.getPreviousPath(g,d,k[0])),null==_&&(_=h.move(v,S+i/2)+h.move(v,S)),l.axisFlags.isXNumeric||(e+=s),{pathTo:k,pathFrom:_,x:A,y:e,goalX:this.barHelpers.getGoalValues("x",a,null,c,d,0),barYPosition:S,color:b}}getOHLCValue(t,e){const s=this.w,i=this.coreUtils,a=s=>s[t]&&null!=s[t][e]?i.getLogValAtSeriesIndex(s[t][e],t):0,r=a(s.candleData.seriesCandleH),o=a(s.candleData.seriesCandleO),n=a(s.candleData.seriesCandleM),l=a(s.candleData.seriesCandleC),h=a(s.candleData.seriesCandleL);return{o:this.isBoxPlot?r:o,h:this.isBoxPlot?o:r,m:n,l:this.isBoxPlot?l:h,c:this.isBoxPlot?h:l}}}const Oi=t=>{const e=function(t){const e=[];let s=t[0],i=t[1],a=e[0]=$i(s,i),r=1;for(let o=t.length-1;r<o;r++)s=i,i=t[r+1],e[r]=.5*(a+(a=$i(s,i)));return e[r]=a,e}(t),s=t.length-1,i=[];let a,r,o,n;for(let i=0;i<s;i++)o=$i(t[i],t[i+1]),Math.abs(o)<1e-6?e[i]=e[i+1]=0:(a=e[i]/o,r=e[i+1]/o,n=a*a+r*r,n>9&&(n=3*o/Math.sqrt(n),e[i]=n*a,e[i+1]=n*r));for(let a=0;a<=s;a++)n=(t[Math.min(s,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+e[a]*e[a])),i.push([n||0,e[a]*n||0]);return i},Hi=t=>{let e="";for(let s=0;s<t.length;s++){const i=t[s],a=i.length;a>4?(e+=`C${i[0]}, ${i[1]}`,e+=`, ${i[2]}, ${i[3]}`,e+=`, ${i[4]}, ${i[5]}`):a>2&&(e+=`S${i[0]}, ${i[1]}`,e+=`, ${i[2]}, ${i[3]}`)}return e},Wi={points(t){const e=Oi(t),s=t[1],i=t[0],a=[],r=e[1],o=e[0];a.push(i,[i[0]+o[0],i[1]+o[1],s[0]-r[0],s[1]-r[1],s[0],s[1]]);for(let s=2,i=e.length;s<i;s++){const i=t[s],r=e[s];a.push([i[0]-r[0],i[1]-r[1],i[0],i[1]])}return a},slice(t,e,s){const i=t.slice(e,s);if(e){if(s-e>1&&i[1].length<6){const t=i[0].length;i[1]=[2*i[0][t-2]-i[0][t-4],2*i[0][t-1]-i[0][t-3]].concat(i[1])}i[0]=i[0].slice(-2)}return i}};function $i(t,e){return(e[1]-t[1])/(e[0]-t[0])}function ji(t){const e=[];for(let s=0;s<t.length;s+=2)e.push(t[s+1],t[s]);return e}class Gi{constructor(t,e){this.ctx=e,this.w=t}checkColorRange(){const t=this.w;let e=!1;const s=t.config.plotOptions[t.config.chart.type];return s.colorScale.ranges.length>0&&s.colorScale.ranges.map(t=>{t.from<=0&&(e=!0)}),e}getShadeColor(t,e,s,i){const a=this.w;let r=1;const o=a.config.plotOptions[t].shadeIntensity,n=this.determineColor(t,e,s);a.globals.hasNegs||i?r=a.config.plotOptions[t].reverseNegativeShade?n.percent<0?n.percent/100*(1.25*o):(1-n.percent/100)*(1.25*o):n.percent<=0?1-(1+n.percent/100)*o:(1-n.percent/100)*o:(r=1-n.percent/100,"treemap"===t&&(r=(1-n.percent/100)*(1.25*o)));let l=n.color;const h=new b;if(a.config.plotOptions[t].enableShades)if("dark"===this.w.config.theme.mode){const t=h.shadeColor(-1*r,n.color);l=b.hexToRgba(b.isColorHex(t)?t:b.rgb2hex(t),a.config.fill.opacity)}else{const t=h.shadeColor(r,n.color);l=b.hexToRgba(b.isColorHex(t)?t:b.rgb2hex(t),a.config.fill.opacity)}return{color:l,colorProps:n}}determineColor(t,e,s){const i=this.w,a=i.seriesData.series[e][s],r=i.config.plotOptions[t];let o=r.colorScale.inverse?s:e;r.distributed&&"treemap"===i.config.chart.type&&(o=s);let n=i.globals.colors[o],l=null,h=Math.min(...i.seriesData.series[e]),c=Math.max(...i.seriesData.series[e]);r.distributed||"heatmap"!==t||(h=i.globals.minY,c=i.globals.maxY),void 0!==r.colorScale.min&&(h=r.colorScale.min<i.globals.minY?r.colorScale.min:i.globals.minY,c=r.colorScale.max>i.globals.maxY?r.colorScale.max:i.globals.maxY);const d=Math.abs(c)+Math.abs(h);let g=0===d?0:100*a/d;if(r.colorScale.ranges.length>0){r.colorScale.ranges.map(t=>{if(a>=t.from&&a<=t.to){n=t.color,l=t.foreColor?t.foreColor:null,h=t.from,c=t.to;const e=Math.abs(c)+Math.abs(h);g=0===e?0:100*a/e}})}return{color:n,foreColor:l,percent:g}}calculateDataLabels({text:t,x:e,y:s,i:i,j:a,colorProps:r,fontSize:o}){const n=this.w.config.dataLabels,l=new gt(this.w),h=new yt(this.w,this.ctx);let c=null;if(n.enabled){c=l.group({class:"apexcharts-data-labels"});const d=n.offsetX,g=n.offsetY,p=e+d,u=s+parseFloat(n.style.fontSize)/3+g;h.plotDataLabelsText({x:p,y:u,text:t,i:i,j:a,color:r.foreColor,parent:c,fontSize:o,dataLabelsConfig:n})}return c}}class Vi{constructor(t){this.w=t.w,this.lineCtx=t}sameValueSeriesFix(t,e){const s=this.w;if("gradient"===s.config.fill.type||"gradient"===s.config.fill.type[t]){if(new P(this.lineCtx.w).seriesHaveSameValues(t)){const s=e[t].slice();s[s.length-1]=s[s.length-1]+1e-6,e[t]=s}}return e}calculatePoints({series:t,realIndex:e,x:s,y:i,i:a,j:r,prevY:o}){const n=this.w,l=[],h=[];let c=this.lineCtx.categoryAxisCorrection+n.config.markers.offsetX;return n.axisFlags.isXNumeric&&(c=(n.seriesData.seriesX[e][0]-n.globals.minX)/this.lineCtx.xRatio+n.config.markers.offsetX),0===r&&(l.push(c),h.push(b.isNumber(t[a][0])?o+n.config.markers.offsetY:null)),l.push(s+n.config.markers.offsetX),h.push(b.isNumber(t[a][r+1])?i+n.config.markers.offsetY:null),{x:l,y:h}}checkPreviousPaths({pathFromLine:t,pathFromArea:e,realIndex:s}){const i=this.w;for(let a=0;a<i.globals.previousPaths.length;a++){const r=i.globals.previousPaths[a];("line"===r.type||"area"===r.type)&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(s,10)&&("line"===r.type?(this.lineCtx.appendPathFrom=!1,t=i.globals.previousPaths[a].paths[0].d):"area"===r.type&&(this.lineCtx.appendPathFrom=!1,e=i.globals.previousPaths[a].paths[0].d,i.config.stroke.show&&i.globals.previousPaths[a].paths[1]&&(t=i.globals.previousPaths[a].paths[1].d)))}return{pathFromLine:t,pathFromArea:e}}determineFirstPrevY({i:t,realIndex:e,series:s,prevY:i,lineYPosition:a,translationsIndex:r}){var o,n,l;const h=this.w,c=h.config.chart.stacked&&!h.globals.comboCharts||h.config.chart.stacked&&h.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(o=this.w.config.series[e])?void 0:o.type)||"column"===(null==(n=this.w.config.series[e])?void 0:n.type));if(void 0!==(null==(l=s[t])?void 0:l[0]))i=(a=c&&t>0?this.lineCtx.prevSeriesY[t-1][0]:this.lineCtx.zeroY)-s[t][0]/this.lineCtx.yRatio[r]+2*(this.lineCtx.isReversed?s[t][0]/this.lineCtx.yRatio[r]:0);else if(c&&t>0&&void 0===s[t][0])for(let e=t-1;e>=0;e--)if(null!==s[e][0]&&void 0!==s[e][0]){i=a=this.lineCtx.prevSeriesY[e][0];break}return{prevY:i,lineYPosition:a}}}class Ui{constructor(t,e,s,i){this.ctx=e,this.w=t,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.zRatio=0,this.baseLineY=[],this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||i,this.scatter=new bt(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new Vi(this),this.markers=new mt(this.w,this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0,this.xDivision=0,this.zeroY=0,this.areaBottomY=0,this.strokeWidth=0,this.isReversed=!1,this.appendPathFrom=!1,this.elSeries=null,this.elPointsMain=null,this.elDataLabelsWrap=null}draw(t,e,s,i){var a;const r=this.w,o=new gt(this.w),h=r.globals.comboCharts?e:r.config.chart.type,c=o.group({class:`apexcharts-${h}-series apexcharts-plot-series`}),d=new P(this.w);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,t=d.getLogSeries(t),this.yRatio=d.getLogYRatios(this.yRatio),this.prevSeriesY=[];const g=[];for(let e=0;e<t.length;e++){t=this.lineHelpers.sameValueSeriesFix(e,t);const a=r.globals.comboCharts?s[e]:e,o=this.yRatio.length>1?a:0;this._initSerieVariables(t,e,a);const c=[],d=[],p=[];let u=r.globals.padHorizontal+this.categoryAxisCorrection;const x=1,f=[],m=[];ce.addCollapsedClassToSeries(this.w,this.elSeries,a),r.axisFlags.isXNumeric&&r.seriesData.seriesX.length>0&&(u=(r.seriesData.seriesX[a][0]-r.globals.minX)/this.xRatio),p.push(u);const b=u;let y;const w=b;let v=this.zeroY,A=this.zeroY;const C=0;v=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:t,prevY:v,lineYPosition:C,translationsIndex:o}).prevY,"monotoneCubic"===r.config.stroke.curve&&null===t[e][0]?c.push(null):c.push(v);const S=v;let k;"rangeArea"===h&&(k=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:i,prevY:A,lineYPosition:C,translationsIndex:o}),A=k.prevY,y=A,d.push(null!==c[0]?A:null));const _=this._calculatePathsFrom({type:h,series:t,i:e,realIndex:a,translationsIndex:o,prevX:w,prevY:v,prevY2:A}),L=[c[0]],D=[d[0]],M={type:h,series:t,realIndex:a,translationsIndex:o,i:e,x:u,y:x,pX:b,pY:S,pathsFrom:_,linePaths:f,areaPaths:m,seriesIndex:s,lineYPosition:C,xArrj:p,yArrj:c,y2Arrj:d,seriesRangeEnd:i},E=this._iterateOverDataPoints(l(n({},M),{iterations:"rangeArea"===h?t[e].length-1:void 0,isRangeStart:!0}));if("rangeArea"===h){const t=this._calculatePathsFrom({series:i,i:e,realIndex:a,prevX:w,prevY:A}),s=this._iterateOverDataPoints(l(n({},M),{series:i,xArrj:[u],yArrj:L,y2Arrj:D,pY:y,areaPaths:E.areaPaths,pathsFrom:t,iterations:i[e].length-1,isRangeStart:!1})),r=E.linePaths.length/2;for(let t=0;t<r;t++)E.linePaths[t]=s.linePaths[t+r]+E.linePaths[t];E.linePaths.splice(r),E.pathFromLine=s.pathFromLine+E.pathFromLine}else/z\s*$/i.test(E.pathFromArea)||(E.pathFromArea+="z");this._handlePaths({type:h,realIndex:a,i:e,paths:E}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),g.push(this.elSeries)}if(void 0!==(null==(a=r.config.series[0])?void 0:a.zIndex)&&g.sort((t,e)=>Number(t.node.getAttribute("zIndex"))-Number(e.node.getAttribute("zIndex"))),r.config.chart.stacked)for(let t=g.length-1;t>=0;t--)c.add(g[t]);else for(let t=0;t<g.length;t++)c.add(g[t]);return c}_initSerieVariables(t,e,s){const i=this.w,a=new gt(this.w);this.xDivision=i.layout.gridWidth/(i.globals.dataPoints-("on"===i.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(i.config.stroke.width)?i.config.stroke.width[s]:i.config.stroke.width;let r=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[s],r=s),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.zeroY=i.layout.gridHeight-this.baseLineY[r]-(this.isReversed?i.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[r]:0),this.areaBottomY=this.zeroY,(this.zeroY>i.layout.gridHeight||"end"===i.config.plotOptions.area.fillTo)&&(this.areaBottomY=i.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const o=i.config.series[s];if(this.elSeries=a.group({class:"apexcharts-series",zIndex:void 0!==o.zIndex?o.zIndex:s,seriesName:b.escapeString(i.seriesData.seriesNames[s])}),this.elPointsMain=a.group({class:"apexcharts-series-markers-wrap","data:realIndex":s}),i.globals.hasNullValues){const t=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[i.layout.gridHeight+i.globals.markers.largestSize]},seriesIndex:e,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==t&&this.elPointsMain.add(t)}this.elDataLabelsWrap=a.group({class:"apexcharts-datalabels","data:realIndex":s});const n=t[e].length===i.globals.dataPoints;this.elSeries.attr({"data:longestSeries":n,rel:e+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom({type:t,series:e,i:s,realIndex:i,translationsIndex:a,prevX:r,prevY:o,prevY2:n}){const l=this.w,h=new gt(this.w);let c,d,g,p;if(null===e[s][0]){for(let t=0;t<e[s].length;t++)if(null!==e[s][t]){r=this.xDivision*t,o=this.zeroY-e[s][t]/this.yRatio[a],c=h.move(r,o),d=h.move(r,this.areaBottomY);break}}else c=h.move(r,o),"rangeArea"===t&&(c=h.move(r,n)+h.line(r,o)),d=h.move(r,this.areaBottomY)+h.line(r,o);if(g=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),p=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),l.globals.previousPaths.length>0){const t=this.lineHelpers.checkPreviousPaths({pathFromLine:g,pathFromArea:p,realIndex:i});g=t.pathFromLine,p=t.pathFromArea}return{prevX:r,prevY:o,linePath:c,areaPath:d,pathFromLine:g,pathFromArea:p}}_handlePaths({type:t,realIndex:e,i:s,paths:i}){var a,r,o,h,c,d,g;const p=this.w,u=new gt(this.w),x=xt(this.ctx,u),f=new pt(this.w);this.prevSeriesY.push(i.yArrj);let m=null;"line"!==t&&"area"!==t||!p.globals.dataChanged||(m=function(t,e,s,i){var a;const r=t.globals,o=r.prevStreamFrame;if(!o||!r.dataChanged||!(null==(a=t.axisFlags)?void 0:a.isXNumeric))return null;const n=o.seriesX[e],l=o.seriesY[e],h=t.seriesData.seriesX[e],c=t.seriesData.series[e];if(!(n&&l&&h&&c))return null;if(n.length<3||h.length<3)return null;let d=-1;for(let t=0;t<n.length;t++)if(n[t]===h[0]){d=t;break}if(-1===d)return null;const g=Math.min(n.length-d,h.length);if(g<2)return null;const p=h.length-g;if(0===d&&0===p)return null;for(let t=0;t<g;t++){if(n[d+t]!==h[t])return null;const e=l[d+t],s=c[t];if(e!==s&&(null!=e||null!=s))return null}const u=o.xPixels[e],x=o.yPixels[e];if(!u||!x)return null;let f=-1,m=-1;for(let t=0;t<g;t++)null!=u[d+t]&&null!=x[d+t]&&null!=s[t]&&null!=i[t]&&(-1===f&&(f=t),m=t);if(-1===f||m<=f)return null;const b=s[f],y=s[m],w=u[d+f],v=u[d+m];if(Math.abs(y-b)<1e-6)return null;const A=(v-w)/(y-b),C=w-A*b;if(!isFinite(A)||!isFinite(C))return null;if(Math.abs(A-1)>.02)return null;if(Math.abs(C)<.5)return null;let S=f,k=f;for(let t=f;t<=m;t++){const e=i[t];null!=e&&null!=x[d+t]&&(e<i[S]&&(S=t),e>i[k]&&(k=t))}let _=1,L=0;const D=i[S],M=i[k];if(Math.abs(M-D)>1e-6?(_=(x[d+k]-x[d+S])/(M-D),L=x[d+S]-_*D):L=x[d+S]-D,!isFinite(_)||!isFinite(L)||_<.2||_>5)return null;const E=Math.floor((f+m)/2);if(E!==f&&E!==m&&null!=s[E]&&null!=u[d+E]){const t=A*s[E]+C;if(Math.abs(t-u[d+E])>1.5)return null;if(null!=i[E]&&null!=x[d+E]){const t=_*i[E]+L;if(Math.abs(t-x[d+E])>1.5)return null}}return{ax:A,bx:C,ay:_,by:L}}(p,e,i.xArrj,i.yArrj));let b=null;m||"line"!==t&&"area"!==t||(b=Ut(p,{type:t,realIndex:e,pathFromLine:i.pathFromLine,pathFromArea:i.pathFromArea,linePaths:i.linePaths,areaPaths:i.areaPaths})),p.globals.seriesXvalues[e]=i.xArrj,p.globals.seriesYvalues[e]=i.yArrj;const y=p.config.forecastDataPoints;if(y.count>0&&"rangeArea"!==t){const t=p.globals.seriesXvalues[e][p.globals.seriesXvalues[e].length-y.count-1],s=u.drawRect(t,0,p.layout.gridWidth,p.layout.gridHeight,0);p.dom.elForecastMask.appendChild(s.node);const i=u.drawRect(0,0,t,p.layout.gridHeight,0);p.dom.elNonForecastMask.appendChild(i.node)}this.pointsChart?Vt(p,{elPointsMain:this.elPointsMain,realIndex:e,speed:p.config.chart.animations.dynamicAnimation.speed}):(p.globals.delayedElements.push({el:this.elPointsMain.node,index:e}),Vt(p,{elPointsMain:this.elPointsMain,realIndex:e,speed:p.config.chart.animations.dynamicAnimation.speed}),$t(p,e)&&(null==(a=this.elDataLabelsWrap)?void 0:a.node)&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),p.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0})));const w={i:s,realIndex:e,animationDelay:s,initialSpeed:p.config.chart.animations.speed,dataChangeSpeed:p.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${t}`};if("area"===t){const t=f.fillPath({seriesNumber:e});for(let e=0;e<i.areaPaths.length;e++){const s=x.renderPaths(l(n({},w),{pathFrom:m?It(i.areaPaths[e],m):null!=(o=null==(r=null==b?void 0:b.area)?void 0:r.from)?o:i.pathFromArea,pathTo:i.areaPaths[e],pathToInterp:null==(h=null==b?void 0:b.area)?void 0:h.toInterp,scrollMorph:!!m,stroke:"none",strokeWidth:0,strokeLineCap:null,fill:t}));this.elSeries.add(s)}}if(p.config.stroke.show&&!this.pointsChart){let a=null;if("line"===t)a=f.fillPath({seriesNumber:e,i:s});else if("solid"===p.config.stroke.fill.type)a=p.globals.stroke.colors[e];else{const t=p.config.fill;p.config.fill=p.config.stroke.fill,a=f.fillPath({seriesNumber:e,i:s}),p.config.fill=t}for(let s=0;s<i.linePaths.length;s++){let r=a;"rangeArea"===t&&(r=f.fillPath({seriesNumber:e}));const o=l(n({},w),{pathFrom:m?It(i.linePaths[s],m):null!=(d=null==(c=null==b?void 0:b.line)?void 0:c.from)?d:i.pathFromLine,pathTo:i.linePaths[s],pathToInterp:null==(g=null==b?void 0:b.line)?void 0:g.toInterp,scrollMorph:!!m,stroke:a,strokeWidth:this.strokeWidth,strokeLineCap:p.config.stroke.lineCap,fill:"rangeArea"===t?r:"none"}),h=x.renderPaths(o);if(this.elSeries.add(h),h.attr("fill-rule","evenodd"),y.count>0&&"rangeArea"!==t){const t=x.renderPaths(o);t.node.setAttribute("stroke-dasharray",y.dashArray),y.strokeWidth&&t.node.setAttribute("stroke-width",y.strokeWidth),this.elSeries.add(t),t.attr("clip-path",`url(#forecastMask${p.globals.cuid})`),h.attr("clip-path",`url(#nonForecastMask${p.globals.cuid})`)}}}}_iterateOverDataPoints({type:t,series:e,iterations:s,realIndex:i,translationsIndex:a,i:r,x:o,y:n,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:g,seriesIndex:p,lineYPosition:u,xArrj:x,yArrj:f,y2Arrj:m,isRangeStart:y,seriesRangeEnd:w}){var v,A;const C=this.w,S=new gt(this.w),k=this.yRatio;let{prevY:_,linePath:L,areaPath:D,pathFromLine:M,pathFromArea:E}=c;const P=b.isNumber(C.globals.minYArr[i])?C.globals.minYArr[i]:C.globals.minY;s||(s=C.globals.dataPoints>1?C.globals.dataPoints-1:C.globals.dataPoints);const F=(t,e)=>e-t/k[a]+2*(this.isReversed?t/k[a]:0);let T=n;const I=C.config.chart.stacked&&!C.globals.comboCharts||C.config.chart.stacked&&C.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(v=this.w.config.series[i])?void 0:v.type)||"column"===(null==(A=this.w.config.series[i])?void 0:A.type));let X=C.config.stroke.curve;Array.isArray(X)&&(X=Array.isArray(p)?X[p[r]]:X[r]);let R,z=0;const B=this.pointsChart?this._scatterJitterPx(i):null;for(let a=0;a<s&&0!==e[r].length;a++){const c=void 0===e[r][a+1]||null===e[r][a+1];if(C.axisFlags.isXNumeric){let t=C.seriesData.seriesX[i][a+1];void 0===C.seriesData.seriesX[i][a+1]&&(t=C.seriesData.seriesX[i][s-1]),o=(t-C.globals.minX)/this.xRatio}else o+=this.xDivision;if(I)if(r>0&&C.globals.collapsedSeries.length<C.config.series.length-1){const t=t=>{for(let e=t;e>0;e--){if(!(C.globals.collapsedSeriesIndices.indexOf((null==p?void 0:p[e])||e)>-1))return e;e--}return 0};u=this.prevSeriesY[t(r-1)][a+1]}else u=this.zeroY;else u=this.zeroY;c?n=F(P,u):(n=F(e[r][a+1],u),"rangeArea"===t&&(T=F(w[r][a+1],u)));let b=o,v=n;if(B){const t=100003*i+(a+1);B.x&&(b=o+2*(zi(7919*t+13)-.5)*B.x),B.y&&(v=n+2*(zi(6271*t+97)-.5)*B.y)}x.push(null===e[r][a+1]?null:b),!c||"smooth"!==C.config.stroke.curve&&"monotoneCubic"!==C.config.stroke.curve?(f.push(v),m.push(T)):(f.push(null),m.push(null));const A=this.lineHelpers.calculatePoints({series:e,x:b,y:v,realIndex:i,i:r,j:a,prevY:_}),k=this._createPaths({type:t,series:e,i:r,j:a,x:o,y:n,y2:T,xArrj:x,yArrj:f,y2Arrj:m,pX:l,pY:h,pathState:z,segmentStartX:R,linePath:L,areaPath:D,linePaths:d,areaPaths:g,curve:X,isRangeStart:y});g=k.areaPaths,d=k.linePaths,l=k.pX,h=k.pY,z=k.pathState,R=k.segmentStartX,D=k.areaPath,L=k.linePath,!this.appendPathFrom||C.globals.hasNullValues||"monotoneCubic"===X&&"rangeArea"===t||(M+=S.line(o,this.areaBottomY),E+=S.line(o,this.areaBottomY)),this.handleNullDataPoints(e,A,r,a,i),this._handleMarkersAndLabels({type:t,pointsPos:A,i:r,j:a,realIndex:i,isRangeStart:y})}return{yArrj:f,xArrj:x,pathFromArea:E,areaPaths:g,pathFromLine:M,linePaths:d,linePath:L,areaPath:D}}_handleMarkersAndLabels({type:t,pointsPos:e,isRangeStart:s,i:i,j:a,realIndex:r}){const o=this.w,n=new yt(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:r,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{!(!o.globals.dataChanged&&!o.globals.resized)&&o.seriesData.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");const t=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:r,j:a+1});null!==t&&this.elPointsMain.add(t)}const l=n.drawDataLabel({type:t,isRangeStart:s,pos:e,i:r,j:a+1});null!==l&&this.elDataLabelsWrap.add(l)}_scatterJitterPx(t){var e;const s=this.w,i=null==(e=s.config.plotOptions.scatter)?void 0:e.jitter;if(!i||!i.enabled||!i.x&&!i.y)return null;const a=s.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,r=this.yRatio.length>1?t:0,o=this.yRatio[r]?1/this.yRatio[r]:0;return{x:(i.x||0)*a,y:(i.y||0)*o}}_createPaths({type:t,series:e,i:s,j:i,x:a,y:r,xArrj:o,yArrj:n,y2:l,y2Arrj:h,pX:c,pY:d,pathState:g,segmentStartX:p,linePath:u,areaPath:x,linePaths:f,areaPaths:m,curve:b,isRangeStart:y}){const w=new gt(this.w),v=this.areaBottomY,A="rangeArea"===t,C="rangeArea"===t&&y;switch(b){case"monotoneCubic":{const t=y?n:h,a=(t,e)=>t.map((t,s)=>[t,e[s]]).filter(t=>null!==t[1]),r=t=>{const e=[];let s=0;return t.forEach(t=>{null!==t?s++:s>0&&(e.push(s),s=0)}),s>0&&e.push(s),e},l=(t,e)=>{const s=r(t),i=[];for(let t=0,a=0;t<s.length;a+=s[t++])i[t]=Wi.slice(e,a,a+s[t]);return i};switch(g){case 0:if(null===t[i+1])break;g=1;case 1:if(!(A?o.length===e[s].length:i===e[s].length-2))break;case 2:{const e=y?o:o.slice().reverse(),s=y?t:t.slice().reverse(),i=a(e,s),r=i.length>1?Wi.points(i):i;let n=[];A&&(C?m=i:n=m.reverse());let h=0,c=0;if(l(s,r).forEach(t=>{h++;const e=Hi(t),s=c;c+=t.length;const a=c-1;C?u=w.move(i[s][0],i[s][1])+e:A?u=w.move(n[s][0],n[s][1])+w.line(i[s][0],i[s][1])+e+w.line(n[a][0],n[a][1]):(u=w.move(i[s][0],i[s][1])+e,x=u+w.line(i[a][0],v)+w.line(i[s][0],v)+"z",m.push(x)),f.push(u)}),A&&h>1&&!C){const t=f.slice(h).reverse();f.splice(h),t.forEach(t=>f.push(t))}g=0;break}}break}case"smooth":{const t=.35*(a-c);if(null===e[s][i])g=0;else switch(g){case 0:if(p=c,u=C?w.move(c,h[i])+w.line(c,d):w.move(c,d),x=w.move(c,d),null===e[s][i+1]||void 0===e[s][i+1]){f.push(u),m.push(x);break}if(g=1,i<e[s].length-2){const e=w.curve(c+t,d,a-t,r,a,r);u+=e,x+=e;break}case 1:if(null===e[s][i+1])u+=C?w.line(c,l):w.move(c,d),x+=w.line(c,v)+w.line(p,v)+"z",f.push(u),m.push(x),g=-1;else{const o=w.curve(c+t,d,a-t,r,a,r);u+=o,x+=o,i>=e[s].length-2&&(C&&(u+=w.curve(a,r,a,r,a,l)+w.move(a,l)),x+=w.curve(a,r,a,r,a,v)+w.line(p,v)+"z",f.push(u),m.push(x),g=-1)}}c=a,d=r;break}default:{const t=(t,e,s)=>{let i="";switch(t){case"stepline":i=w.line(e,null,"H")+w.line(null,s,"V");break;case"linestep":i=w.line(null,s,"V")+w.line(e,null,"H");break;case"straight":i=w.line(e,s)}return i};if(null===e[s][i])g=0;else switch(g){case 0:if(p=c,u=C?w.move(c,h[i])+w.line(c,d):w.move(c,d),x=w.move(c,d),null===e[s][i+1]||void 0===e[s][i+1]){f.push(u),m.push(x);break}if(g=1,i<e[s].length-2){const e=t(b,a,r);u+=e,x+=e;break}case 1:if(null===e[s][i+1])u+=C?w.line(c,l):w.move(c,d),x+=w.line(c,v)+w.line(p,v)+"z",f.push(u),m.push(x),g=-1;else{const o=t(b,a,r);u+=o,x+=o,i>=e[s].length-2&&(C&&(u+=w.line(a,l)),x+=w.line(a,v)+w.line(p,v)+"z",f.push(u),m.push(x),g=-1)}}c=a,d=r;break}}return{linePaths:f,areaPaths:m,pX:c,pY:d,pathState:g,segmentStartX:p,linePath:u,areaPath:x}}handleNullDataPoints(t,e,s,i,a){const r=this.w;if(null===t[s][i]&&r.config.markers.showNullDataPoints||1===t[s].length){let t=this.strokeWidth-r.config.markers.strokeWidth/2;t>0||(t=0);const s=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:i+1,pSize:t,alwaysDrawMarker:!0});null!==s&&this.elPointsMain.add(s)}}}class qi{constructor(t){this.w=t}drawYAxisTexts(t,e,s,i){const a=this.w,r=a.config.yaxis[0],o=a.formatters.yLabelFormatters[0];return new gt(this.w).drawText({x:t+r.labels.offsetX,y:e+r.labels.offsetY,text:o(i,s),textAnchor:"middle",fontSize:r.labels.style.fontSize,fontFamily:r.labels.style.fontFamily,foreColor:Array.isArray(r.labels.style.colors)?r.labels.style.colors[s]:r.labels.style.colors})}getMaxLabelWidth(t,{fontSize:e,fontFamily:s}={}){const i=new gt(this.w);let a=0;return t.forEach(t=>{if(null==t||""===t)return;const r=i.getTextRects(`${t}`,e||"12px",s,"");a=Math.max(a,r.width)}),a}drawExternalLabel({lines:t,lineHeight:e,anchor:s,elbow:i,labelX:a,labelY:r,side:o,connector:n,style:l,foreColor:h}){const c=new gt(this.w),d=c.group({class:"apexcharts-pie-name-label-group"});if(n.show){const t=`M ${s.x} ${s.y} L ${i.x} ${i.y} L ${a} ${r}`,e=c.drawPath({d:t,stroke:n.color,strokeWidth:n.width,fill:"none",strokeLinecap:"round"});e.node.classList.add("apexcharts-pie-label-connector"),d.add(e)}const g="right"===o?a+4:a-4,p=t.length,u=r-(p-1)*e/2,x=c.drawText({x:g,y:u,text:1===p?t[0]:t,textAnchor:"right"===o?"start":"end",fontSize:l.fontSize,fontFamily:l.fontFamily,fontWeight:l.fontWeight,foreColor:h,dominantBaseline:"central",cssClass:"apexcharts-pie-name-label"});if(p>1){const t=x.node.getElementsByTagName("tspan");for(let s=0;s<t.length;s++)t[s].setAttribute("x",`${g}`),t[s].setAttribute("dy",0===s?"0":`${e}`)}return d.add(x),d}}class Zi{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=Math.min(t.layout.gridWidth,t.layout.gridHeight),this.centerY=this.defaultSize/2,this.centerX=t.layout.gridWidth/2,"radialBar"===t.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(t.config.plotOptions.pie.endAngle-t.config.plotOptions.pie.startAngle),this.initialAngle=t.config.plotOptions.pie.startAngle%this.fullAngle,t.globals.radialSize=this.defaultSize/2.05-t.config.stroke.width-(t.config.chart.sparkline.enabled?0:t.config.chart.dropShadow.blur),this.externalCfg=t.config.plotOptions.pie.dataLabels.external;const s=t.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||s.fontSize,fontFamily:this.externalCfg.fontFamily||s.fontFamily,fontWeight:this.externalCfg.fontWeight||s.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,t.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!t.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=t.globals.radialSize*parseInt(t.config.plotOptions.pie.donut.size,10)/100;const i=t.config.plotOptions.pie.customScale,a=t.layout.gridWidth/2,r=t.layout.gridHeight/2;this.translateX=a-a*i,this.translateY=r-r*i,this.dataLabelsGroup=new gt(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${i})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}getExternalLabelText(t){var e,s,i;const a=this.w,r=a.seriesData.seriesNames[t],o=this.externalCfg.formatter;return"function"==typeof o?o(r,{seriesIndex:t,percent:null==(s=null==(e=a.globals.seriesPercent)?void 0:e[t])?void 0:s[0],value:null==(i=a.globals.seriesTotals)?void 0:i[t],w:a}):null==r?"":`${r}`}getExternalLabelLines(t){const e=this.getExternalLabelText(t);return(Array.isArray(e)?e:`${null==e?"":e}`.split("\n")).map(t=>null==t?"":`${t}`)}reserveExternalLabelSpace(){const t=this.w,e=new qi(t),s=(t.seriesData.seriesNames||[]).map((t,e)=>this.getExternalLabelLines(e)),i=e.getMaxLabelWidth(s.flat(),{fontSize:this.externalLabelStyle.fontSize,fontFamily:this.externalLabelStyle.fontFamily});this.externalLabelMaxLines=s.reduce((t,e)=>Math.max(t,e.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const a=this.externalCfg.connector,r=this.externalLabelMaxLines*this.externalLabelLineH,o=i+(a.length||0)+(a.gap||0)+12,n=r/2+(a.gap||0)+6,l=Math.min(t.globals.radialSize,t.layout.gridWidth/2-o,t.layout.gridHeight/2-n);t.globals.radialSize=Math.max(l,.15*this.defaultSize),t.globals.pieExternalLabelMarginY=n;const h=t.config.chart.height?String(t.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?t.layout.gridHeight/2:t.globals.radialSize+n}draw(t){var e;const s=this.w,i=new gt(this.w),a=i.group({class:"apexcharts-pie"});if(s.globals.noData)return a;let r=0;for(let e=0;e<t.length;e++)r+=b.negToZero(t[e]);const o=[],n=i.group();0===r&&(r=1e-5),t.forEach(t=>{this.maxY=Math.max(this.maxY,t)}),s.config.yaxis[0].max&&(this.maxY=s.config.yaxis[0].max),"back"===s.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(a);for(let e=0;e<t.length;e++){const i=this.fullAngle*b.negToZero(t[e])/r;o.push(i),"polarArea"===this.chartType?(o[e]=this.fullAngle/t.length,this.sliceSizes.push(s.globals.radialSize*t[e]/this.maxY)):this.sliceSizes.push(s.globals.radialSize)}const l=!0===(null==(e=this.ctx.morphTypeChange)?void 0:e.isActive());if(s.globals.dataChanged&&!l){let t,e=0;for(let t=0;t<s.globals.previousPaths.length;t++)e+=b.negToZero(s.globals.previousPaths[t]);for(let i=0;i<s.globals.previousPaths.length;i++)t=this.fullAngle*b.negToZero(s.globals.previousPaths[i])/e,this.prevSectorAngleArr.push(t)}if(this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const t=i.drawCircle(this.donutSize);t.attr({cx:this.centerX,cy:this.centerY,fill:s.config.plotOptions.pie.donut.background?s.config.plotOptions.pie.donut.background:"transparent"}),n.add(t)}const h=this.drawArcs(o,t);if(this.sliceLabels.forEach(t=>{h.add(t)}),n.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${s.config.plotOptions.pie.customScale})`}),n.add(h),a.add(n),this.donutDataLabels.show){const t=this.initialAnim&&!s.globals.resized&&!s.globals.dataChanged&&this.animDur>0,e=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:t?0:this.donutDataLabels.show});if(t){const t=this.dataLabelsGroup.node;t.style.transition="opacity 280ms ease-out",setTimeout(()=>{t.style.opacity="1"},this.animDur)}a.add(e)}return"front"===s.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(a),a}drawArcs(t,e){var s,i;const a=this.w,r=new dt(this.w),o=new gt(this.w),n=new pt(this.w),l=o.group({class:"apexcharts-slices"});let h=this.initialAngle,d=this.initialAngle,g=this.initialAngle,p=this.initialAngle;this.strokeWidth=a.config.stroke.show?a.config.stroke.width:0;const u=!0===(null==(s=this.ctx.morphTypeChange)?void 0:s.isActive());for(let s=0;s<t.length;s++){const c=o.group({class:"apexcharts-series apexcharts-pie-series",seriesName:b.escapeString(a.seriesData.seriesNames[s]),rel:s+1,"data:realIndex":s});l.add(c),h=g,d=p,g=h+t[s],p=d+this.prevSectorAngleArr[s];const x=g<h?this.fullAngle+g-h:g-h,f=n.fillPath({seriesNumber:s,size:this.sliceSizes[s],value:e[s]}),m=u?this.ctx.morphTypeChange.getInitialPathFor(s,0):null,y=m||this.getChangedPath(d,p),w=o.drawPath({d:y,stroke:Array.isArray(this.lineColorArr)?null!=(i=this.lineColorArr[s])?i:this.lineColorArr[s%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:f,fillOpacity:a.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${s}`});if(w.attr({index:0,j:s}),r.setSelectionFilter(w,0,s),a.config.chart.dropShadow.enabled){const t=a.config.chart.dropShadow;r.dropShadow(w,t,s)}this.addListeners(w,this.donutDataLabels);let v={x:0,y:0};const A=(h+x/2)%this.fullAngle;let C={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(v=b.polarToCartesian(this.centerX,this.centerY,a.globals.radialSize/1.25+a.config.plotOptions.pie.dataLabels.offset,A),C=b.polarToCartesian(this.centerX,this.centerY,a.globals.radialSize/2,A)):"donut"===this.chartType&&(v=b.polarToCartesian(this.centerX,this.centerY,(a.globals.radialSize+this.donutSize)/2+a.config.plotOptions.pie.dataLabels.offset,A),C=b.polarToCartesian(this.centerX,this.centerY,(a.globals.radialSize+this.donutSize)/2,A)),gt.setAttrs(w.node,{"data:angle":x,"data:startAngle":h,"data:strokeWidth":this.strokeWidth,"data:value":e[s],"data:cx":C.x,"data:cy":C.y}),c.add(w);let S=0;if(!this.initialAnim||a.globals.resized||a.globals.dataChanged?this.animBeginArr.push(0):(S=x/this.fullAngle*a.config.chart.animations.speed,0===S&&(S=1),this.animDur=S+this.animDur,this.animBeginArr.push(this.animDur)),u&&m){const t=this.getPiePath({me:this,startAngle:h,angle:x,size:this.sliceSizes[s]}),e=this.ctx.morphTypeChange.getSpeed(),i=this.ctx.animations;w.node.setAttribute("data:pathOrig",t);const a=w.animate(e).plot(t,"polygons").attr({"stroke-width":this.strokeWidth});a&&"function"==typeof a.after?a.after(()=>i.animationCompleted(w)):i.animationCompleted(w)}else this.dynamicAnim&&a.globals.dataChanged?this.animatePaths(w,{size:this.sliceSizes[s],endAngle:g,startAngle:h,prevStartAngle:d,prevEndAngle:p,animateStartingPos:!0,i:s,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:a.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(w,{size:this.sliceSizes[s],endAngle:g,startAngle:h,i:s,totalItems:t.length-1,animBeginArr:this.animBeginArr,dur:S});if(a.config.plotOptions.pie.expandOnClick&&"polarArea"!==this.chartType&&w.node.addEventListener("mouseup",this.pieClicked.bind(this,s)),void 0!==a.interact.selectedDataPoints[0]&&a.interact.selectedDataPoints[0].indexOf(s)>-1)if(this.initialAnim&&!a.globals.resized&&!a.globals.dataChanged&&this.animDur>0){const t=this,e=s;setTimeout(()=>t.pieClicked(e),this.animDur)}else this.pieClicked(s);if(a.config.dataLabels.enabled){const e=v.x,i=v.y;let n=100*x/this.fullAngle+"%";if(0!==x&&a.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[s]){const t=a.config.dataLabels.formatter;void 0!==t&&(n=t(a.globals.seriesPercent[s][0],{seriesIndex:s,w:a}));const l=a.globals.dataLabels.style.colors[s],h=o.group({class:"apexcharts-datalabels"}),c=o.drawText({x:e,y:i,text:n,textAnchor:"middle",fontSize:a.config.dataLabels.style.fontSize,fontFamily:a.config.dataLabels.style.fontFamily,fontWeight:a.config.dataLabels.style.fontWeight,foreColor:l});if(h.add(c),a.config.dataLabels.dropShadow.enabled){const t=a.config.dataLabels.dropShadow;r.dropShadow(c,t)}c.node.classList.add("apexcharts-pie-label"),a.config.chart.animations.animate&&!1===a.globals.resized&&(c.node.classList.add("apexcharts-pie-label-delay"),c.node.style.animationDelay=a.config.chart.animations.speed/940+"s"),this.sliceLabels.push(h)}}if(this.showExternalLabels&&0!==x){const t=this.getExternalLabelLines(s);if(t.some(t=>""!==t)){const e=b.polarToCartesian(this.centerX,this.centerY,a.globals.radialSize,A),i=b.polarToCartesian(this.centerX,this.centerY,a.globals.radialSize+(this.externalCfg.connector.gap||0),A),r=i.x>=this.centerX,o=r?i.x+(this.externalCfg.connector.length||0):i.x-(this.externalCfg.connector.length||0);this.externalLabels.push({lines:t,anchor:e,elbow:i,side:r?"right":"left",labelX:o+parseFloat(this.externalCfg.offsetX||0),idealY:i.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||a.globals.colors[s],foreColor:this.externalCfg.color||a.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const t=c.isBrowser()&&(u||this.dynamicAnim&&a.globals.dataChanged||this.initialAnim&&!a.globals.resized&&!a.globals.dataChanged);this.externalLabels.forEach(e=>{const s=new qi(a).drawExternalLabel({lines:e.lines,lineHeight:this.externalLabelLineH,anchor:e.anchor,elbow:e.elbow,labelX:e.labelX,labelY:e.labelY,side:e.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:e.connectorColor},style:this.externalLabelStyle,foreColor:e.foreColor});t&&(s.node.classList.add("apexcharts-element-hidden"),a.globals.delayedElements.push({el:s.node})),l.add(s)})}return l}placeExternalLabels(){const t=this.w,e=this.externalLabelMaxLines*this.externalLabelLineH+2,s=this.centerY+t.globals.radialSize+t.globals.pieExternalLabelMarginY;["left","right"].forEach(t=>{const i=this.externalLabels.filter(e=>e.side===t).sort((t,e)=>t.idealY-e.idealY);i.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<i.length;t++)i[t].labelY-i[t-1].labelY<e&&(i[t].labelY=i[t-1].labelY+e);const a=i[i.length-1],r=a?a.labelY-s:0;if(r>0)for(let t=i.length-1;t>=0;t--)i[t].labelY-=r,t<i.length-1&&i[t+1].labelY-i[t].labelY<e&&(i[t].labelY=i[t+1].labelY-e)})}addListeners(t,e){const s=new gt(this.w);t.node.addEventListener("mouseenter",s.pathMouseEnter.bind(this,t)),t.node.addEventListener("mouseleave",s.pathMouseLeave.bind(this,t)),t.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),t.node.addEventListener("mousedown",s.pathMouseDown.bind(this,t)),this.donutDataLabels.total.showAlways||(t.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,t.node,e)))}animatePaths(t,e){const s=this.w;let i=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,a=i,r=e.startAngle;const o=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(r=e.prevEndAngle,a=e.prevEndAngle<e.prevStartAngle?this.fullAngle+e.prevEndAngle-e.prevStartAngle:e.prevEndAngle-e.prevStartAngle),e.i===s.config.series.length-1&&(i+o>this.fullAngle?e.endAngle=e.endAngle-(i+o):i+o<this.fullAngle&&(e.endAngle=e.endAngle+(this.fullAngle-(i+o)))),i===this.fullAngle&&(i=this.fullAngle-.01),this.animateArc(t,r,o,i,a,e)}animateArc(t,e,s,i,a,r){const o=this,n=this.w,l=new ct(this.w),h=r.size;let c;(isNaN(e)||isNaN(a))&&(e=s,a=i,r.dur=0);let d=i,g=s;const p=e<s?this.fullAngle+e-s:e-s;n.globals.dataChanged&&r.shouldSetPrevPaths&&r.prevEndAngle&&(c=o.getPiePath({me:o,startAngle:r.prevStartAngle,angle:r.prevEndAngle<r.prevStartAngle?this.fullAngle+r.prevEndAngle-r.prevStartAngle:r.prevEndAngle-r.prevStartAngle,size:h}),t.attr({d:c})),0!==r.dur?t.animate(r.dur,r.animBeginArr[r.i]).after(function(){"pie"!==o.chartType&&"donut"!==o.chartType&&"polarArea"!==o.chartType||this.animate(n.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":o.strokeWidth}),r.i===n.config.series.length-1&&l.animationCompleted(t)}).during(n=>{d=p+(i-p)*n,r.animateStartingPos&&(d=a+(i-a)*n,g=e-a+(s-(e-a))*n),c=o.getPiePath({me:o,startAngle:g,angle:d,size:h}),t.node.setAttribute("data:pathOrig",c),t.attr({d:c})}):(c=o.getPiePath({me:o,startAngle:g,angle:i,size:h}),r.isTrack||(n.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",c),t.attr({d:c,"stroke-width":o.strokeWidth}))}pieClicked(t){const e=this.w,s=this,i=s.sliceSizes[t]+(e.config.plotOptions.pie.expandOnClick?4:0),a=e.dom.Paper.findOne(`.apexcharts-${s.chartType.toLowerCase()}-slice-${t}`);if("true"===a.attr("data:pieClicked")){a.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner();const t=a.attr("data:pathOrig");return void a.attr({d:t})}{const s=e.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(s,t=>{t.setAttribute("data:pieClicked","false");const e=t.getAttribute("data:pathOrig");e&&t.setAttribute("d",e)}),e.interact.capturedDataPointIndex=t,a.attr("data:pieClicked","true")}const r=parseInt(a.attr("data:startAngle"),10),o=parseInt(a.attr("data:angle"),10),n=s.getPiePath({me:s,startAngle:r,angle:o,size:i});360!==o&&a.plot(n)}getChangedPath(t,e){let s="";return this.dynamicAnim&&this.w.globals.dataChanged&&(s=this.getPiePath({me:this,startAngle:t,angle:e-t,size:this.size})),s}getPiePath({me:t,startAngle:e,angle:s,size:i}){let a;const r=new gt(this.w),o=e,n=Math.PI*(o-90)/180;let l=s+e;Math.ceil(l)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(l=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(l)>this.fullAngle&&(l-=this.fullAngle);const h=Math.PI*(l-90)/180,c=t.centerX+i*Math.cos(n),d=t.centerY+i*Math.sin(n),g=t.centerX+i*Math.cos(h),p=t.centerY+i*Math.sin(h),u=b.polarToCartesian(t.centerX,t.centerY,t.donutSize,l),x=b.polarToCartesian(t.centerX,t.centerY,t.donutSize,o),f=s>180?1:0,m=["M",c,d,"A",i,i,0,f,1,g,p];return a="donut"===t.chartType?[...m,"L",u.x,u.y,"A",t.donutSize,t.donutSize,0,f,0,x.x,x.y,"L",c,d,"z"].join(" "):"pie"===t.chartType||"polarArea"===t.chartType?[...m,"L",t.centerX,t.centerY,"L",c,d].join(" "):[...m].join(" "),r.roundPathCorners(a,2*this.strokeWidth)}drawPolarElements(t){const e=this.w,s=new St(this.w),i=new gt(this.w),a=new qi(this.w),r=i.group(),o=i.group(),n=s.niceScale(0,Math.ceil(this.maxY),0),l=n.result.reverse(),h=n.result.length;this.maxY=n.niceMax;let c=e.globals.radialSize;const d=c/(h-1);for(let t=0;t<h-1;t++){const s=i.drawCircle(c);if(s.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":e.config.plotOptions.polarArea.rings.strokeWidth,stroke:e.config.plotOptions.polarArea.rings.strokeColor}),e.config.yaxis[0].show){const s=a.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(e.config.yaxis[0].labels.style.fontSize,10)/2,t,l[t]);o.add(s)}r.add(s),c-=d}this.drawSpokes(t),t.add(r),t.add(o)}renderInnerDataLabels(t,e,s){const i=this.w,a=new gt(this.w),r=e.total.show;t.node.innerHTML="",t.node.style.opacity=s.opacity;const o=s.centerX,n=this.donutDataLabels.total.label?s.centerY:s.centerY-s.centerY/6;let l,h;l=void 0===e.name.color?i.globals.colors[0]:e.name.color;let c=e.name.fontSize,d=e.name.fontFamily,g=e.name.fontWeight;h=void 0===e.value.color?i.config.chart.foreColor:e.value.color;const p=e.value.formatter;let u="",x="";if(r?(l=e.total.color,c=e.total.fontSize,d=e.total.fontFamily,g=e.total.fontWeight,x=this.donutDataLabels.total.label?e.total.label:"",u=e.total.formatter(i)):1===i.seriesData.series.length&&(u=p(i.seriesData.series[0],i),x=i.seriesData.seriesNames[0]),x&&(x=e.name.formatter(x,e.total.show,i)),e.name.show){const s=a.drawText({x:o,y:n+parseFloat(e.name.offsetY),text:x,textAnchor:"middle",foreColor:l,fontSize:c,fontWeight:g,fontFamily:d});s.node.classList.add("apexcharts-datalabel-label"),t.add(s)}if(e.value.show){const s=e.name.show?parseFloat(e.value.offsetY)+16:e.value.offsetY,i=a.drawText({x:o,y:n+s,text:u,textAnchor:"middle",foreColor:h,fontWeight:e.value.fontWeight,fontSize:e.value.fontSize,fontFamily:e.value.fontFamily});i.node.classList.add("apexcharts-datalabel-value"),t.add(i)}return t}printInnerLabels(t,e,s,i){const a=this.w;let r;i?r=void 0===t.name.color?a.globals.colors[parseInt(i.parentNode.getAttribute("rel"),10)-1]:t.name.color:a.seriesData.series.length>1&&t.total.show&&(r=t.total.color);const o=a.dom.baseEl.querySelector(".apexcharts-datalabel-label"),n=a.dom.baseEl.querySelector(".apexcharts-datalabel-value");s=(0,t.value.formatter)(s,a),i||"function"!=typeof t.total.formatter||(s=t.total.formatter(a));const l=e===t.total.label;if(e=this.donutDataLabels.total.label?t.name.formatter(e,l,a):"",null!==o&&(o.textContent=e),null!==n&&(n.textContent=s),null!==o){o.style.fill=r}}printDataLabelsInner(t,e){const s=this.w,i=t.getAttribute("data:value"),a=s.seriesData.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];s.seriesData.series.length>1&&this.printInnerLabels(e,a,i,t);const r=s.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==r){r.style.opacity="1"}}drawSpokes(t){const e=this.w,s=new gt(this.w),i=e.config.plotOptions.polarArea.spokes;if(0===i.strokeWidth)return;const a=[],r=360/e.seriesData.series.length;for(let t=0;t<e.seriesData.series.length;t++)a.push(b.polarToCartesian(this.centerX,this.centerY,e.globals.radialSize,e.config.plotOptions.pie.startAngle+r*t));a.forEach((e,a)=>{const r=s.drawLine(e.x,e.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[a]:i.connectorColors);t.add(r)})}revertDataLabelsInner(){const t=this.w;if(this.donutDataLabels.show){const e=t.dom.Paper.findOne(".apexcharts-datalabels-group"),s=this.renderInnerDataLabels(e,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});t.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(s)}}}function Ki(t,e){let s=0;for(let e=0;e<t.length;e++)s+=t[e];const i=e/s,a=new Array(t.length);for(let e=0;e<t.length;e++)a[e]=t[e]*i;return a}function Ji(t,e,s,i){const a=i*i,r=s*s;return Math.max(a*e/r,r/(a*t))}function Qi(t,e,s,i,a,r){if(0===t)return!0;return Ji(e,s,i,r)>=Ji(Math.min(e,a),Math.max(s,a),i+a,r)}function ta(t,e,s,i,a,r,o,n){if(o>=n){const o=i/n;let l=r;for(let i=0;i<s;i++){const s=e[i]/o;t.push([a,l,a+o,l+s]),l+=s}}else{const n=i/o;let l=a;for(let i=0;i<s;i++){const s=e[i]/n;t.push([l,r,l+s,r+n]),l+=s}}}function ea(t,e,s,i,a){const r=[],o=t.length;if(0===o)return r;const n=new Array(o);let l=0,h=0,c=1/0,d=-1/0,g=0;for(;g<o;){const o=Math.min(i,a),p=t[g];if(Qi(l,c,d,h,p,o))n[l]=p,l++,h+=p,p<c&&(c=p),p>d&&(d=p),g++;else{if(ta(r,n,l,h,e,s,i,a),i>=a){const t=h/a;e+=t,i-=t}else{const t=h/i;s+=t,a-=t}l=0,h=0,c=1/0,d=-1/0}}return l>0&&ta(r,n,l,h,e,s,i,a),r}const sa={generate:function(t,e,s){const i=t.length,a=new Array(i);for(let e=0;e<i;e++){let s=0;const i=t[e];for(let t=0;t<i.length;t++)s+=i[t];a[e]=s}const r=ea(Ki(a,e*s),0,0,e,s),o=new Array(i);for(let e=0;e<i;e++){const s=r[e],i=s[0],a=s[1],n=s[2]-i,l=s[3]-a;o[e]=ea(Ki(t[e],n*l),i,a,n,l)}return o}};Cs.use({line:Ui,area:Ui,scatter:Ui,bubble:Ui,rangeArea:Ui,bar:Fi,column:Fi,barStacked:class extends Fi{draw(t,e){const s=this.w;this.graphics=new gt(this.w),this.bar=new Fi(this.w,this.ctx,this.xyRatios);const i=new P(this.w);t=i.getLogSeries(t),this.yRatio=i.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===s.config.chart.stackType&&(t=s.globals.comboCharts?e.map(t=>s.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"});let r=0,o=0;for(let i=0,h=0;i<t.length;i++,h++){const c=s.globals.comboCharts?e[i]:i,{groupIndex:d,columnGroupIndex:g}=this.barHelpers.getGroupIndex(c);this.groupCtx=this[s.labelData.seriesGroups[d]];const p=[],u=[];let x=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[c][0],x=c),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let f=this.graphics.group({class:"apexcharts-series",seriesName:b.escapeString(s.seriesData.seriesNames[c]),rel:i+1,"data:realIndex":c});ce.addCollapsedClassToSeries(this.w,f,c);const m=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":c}),y=this.graphics.group({class:"apexcharts-bar-goals-markers"}),w=this.initialPositions(r,o,void 0,void 0,void 0,void 0,x),{xDivision:v,yDivision:A,zeroH:C,zeroW:S}=w;let k=w.barHeight,_=w.barWidth;o=w.y,r=w.x,s.globals.barHeight=k,s.globals.barWidth=_,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>C),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<s.globals.dataPoints;e++){const a=this.barHelpers.getStrokeWidth(i,e,c),b={indexes:{i:i,j:e,realIndex:c,translationsIndex:x,bc:h},strokeWidth:a,x:r,y:o,elSeries:f,columnGroupIndex:g,seriesGroup:s.labelData.seriesGroups[d]};let w=null;this.isHorizontal?(w=this.drawStackedBarPaths(l(n({},b),{zeroW:S,barHeight:k,yDivision:A})),_=this.series[i][e]/this.invertedYRatio):(w=this.drawStackedColumnPaths(l(n({},b),{xDivision:v,barWidth:_,zeroH:C})),k=this.series[i][e]/this.yRatio[x]);const L=this.barHelpers.drawGoalLine({barXPosition:w.barXPosition,barYPosition:w.barYPosition,goalX:w.goalX,goalY:w.goalY,barHeight:k,barWidth:_});L&&y.add(L),o=w.y,r=w.x,p.push(r),u.push(o);const D=this.barHelpers.getPathFillColor(t,i,e,c);let M="";const E=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y";("bottom"===this.barHelpers.arrBorderRadius[c][e]&&s.seriesData.series[c][e]>0||"top"===this.barHelpers.arrBorderRadius[c][e]&&s.seriesData.series[c][e]<0)&&(M=E),f=this.renderSeries(l(n({realIndex:c,pathFill:D.color},D.useRangeColor?{lineFill:D.color}:{}),{j:e,i:i,columnGroupIndex:g,pathFrom:w.pathFrom,pathTo:w.pathTo,strokeWidth:a,elSeries:f,x:r,y:o,series:t,barHeight:k,barWidth:_,elDataLabelsWrap:m,elGoalsMarkers:y,type:"bar",visibleSeries:g,classes:M}))}s.globals.seriesXvalues[c]=p,s.globals.seriesYvalues[c]=u,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),a.add(f)}return a}initialPositions(t,e,s,i,a,r,o){const n=this.w;let l,h;if(this.isHorizontal){i=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):i*parseInt(t,10)/100,r=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(i-l)/2}else{h=s=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth;n.axisFlags.isXNumeric&&n.globals.dataPoints>1?h=(s=n.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:-1===String(e).indexOf("%")?h=parseInt(e,10):h*=parseInt(e,10)/100,a=this.isReversed?this.baseLineY[o]:n.layout.gridHeight-this.baseLineY[o],t=n.globals.padHorizontal+(s-h)/2}const c=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:i,xDivision:s,barHeight:(null!=l?l:0)/c,barWidth:(null!=h?h:0)/c,zeroH:a,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:r,columnGroupIndex:o,seriesGroup:n,yDivision:l,elSeries:h}){var c,d,g,p,u;const x=this.w,f=r+o*e;let m;const b=t.i,y=t.j,w=t.realIndex,v=t.translationsIndex;let A=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)A+=this.groupCtx.prevXF[t][y];let C=b;if(x.config.series[w].name&&(C=n.indexOf(x.config.series[w].name)),C>0){let t=i;this.groupCtx.prevXVal[C-1][y]<0?t=(null==(c=this.series[b])?void 0:c[y])>=0?this.groupCtx.prevX[C-1][y]+A-2*(this.isReversed?A:0):this.groupCtx.prevX[C-1][y]:this.groupCtx.prevXVal[C-1][y]>=0&&(t=(null==(d=this.series[b])?void 0:d[y])>=0?this.groupCtx.prevX[C-1][y]:this.groupCtx.prevX[C-1][y]-A+2*(this.isReversed?A:0)),m=t}else m=i;a=null===(null==(g=this.series[b])?void 0:g[y])?m:m+(null==(p=this.series[b])?void 0:p[y])/this.invertedYRatio-2*(this.isReversed?(null==(u=this.series[b])?void 0:u[y])/this.invertedYRatio:0);const S=this.barHelpers.getBarpaths({barYPosition:f,barHeight:e,x1:m,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:n,i:b,j:y,w:x});return this.barHelpers.barBackground({j:y,i:b,y1:f,y2:e,elSeries:h}),r+=l,{pathTo:S.pathTo,pathFrom:S.pathFrom,goalX:this.barHelpers.getGoalValues("x",i,null,b,y,v),barXPosition:m,barYPosition:f,x:a,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:r,columnGroupIndex:o,seriesGroup:n,elSeries:l}){var h,c,d,g,p,u,x,f,m;const b=this.w,y=t.i,w=t.j,v=t.bc,A=t.realIndex,C=t.translationsIndex;if(b.axisFlags.isXNumeric){let t=b.seriesData.seriesX[A][w];t||(t=0),e=(t-b.globals.minX)/this.xRatio-a/2*b.globals.barGroups.length}const S=e+o*a;let k,_=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)_+=isNaN(this.groupCtx.prevYF[t][w])?0:this.groupCtx.prevYF[t][w];let L=y;if(n&&(L=n.indexOf(b.seriesData.seriesNames[A])),L>0&&!b.axisFlags.isXNumeric||L>0&&b.axisFlags.isXNumeric&&b.seriesData.seriesX[A-1][w]===b.seriesData.seriesX[A][w]){let t,e;const s=Math.min(this.yRatio.length+1,A+1);if(void 0!==this.groupCtx.prevY[L-1]&&this.groupCtx.prevY[L-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[L-t])?void 0:h[w])){e=this.groupCtx.prevY[L-t][w];break}for(let i=1;i<s;i++){if((null==(c=this.groupCtx.prevYVal[L-i])?void 0:c[w])<0){t=(null==(d=this.series[y])?void 0:d[w])>=0?e-_+2*(this.isReversed?_:0):e;break}if((null==(g=this.groupCtx.prevYVal[L-i])?void 0:g[w])>=0){t=(null==(p=this.series[y])?void 0:p[w])>=0?e:e+_-2*(this.isReversed?_:0);break}}void 0===t&&(t=b.layout.gridHeight),k=(null==(u=this.groupCtx.prevYF[0])?void 0:u.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,L).every(t=>t.every(t=>isNaN(t)))?r:t}else k=r;s=(null==(x=this.series[y])?void 0:x[w])?k-(null==(f=this.series[y])?void 0:f[w])/this.yRatio[C]+2*(this.isReversed?(null==(m=this.series[y])?void 0:m[w])/this.yRatio[C]:0):k;const D=this.barHelpers.getColumnPaths({barXPosition:S,barWidth:a,y1:k,y2:s,yRatio:this.yRatio[C],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:n,realIndex:t.realIndex,i:y,j:w,w:b});return this.barHelpers.barBackground({bc:v,j:w,i:y,x1:S,x2:a,elSeries:l}),{pathTo:D.pathTo,pathFrom:D.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,y,w,0),barXPosition:S,x:b.axisFlags.isXNumeric?e:e+i,y:s}}},rangeBar:class extends Fi{draw(t,e){var s,i,a,r,o,l,h,c,d;const g=this.w,p=new gt(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=g.rangeData.seriesRangeStart,this.seriesRangeEnd=g.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const u=p.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let x=0;x<t.length;x++){let f,m;const y=g.globals.comboCharts?e[x]:x,{columnGroupIndex:w}=this.barHelpers.getGroupIndex(y),v=p.group({class:"apexcharts-series",seriesName:b.escapeString(g.seriesData.seriesNames[y]),rel:x+1,"data:realIndex":y});ce.addCollapsedClassToSeries(this.w,v,y),t[x].length>0&&(this.visibleI=this.visibleI+1);let A=0;this.yRatio.length>1&&(this.yaxisIndex=g.globals.seriesYAxisReverseMap[y][0],A=y);const C=this.barHelpers.initialPositions(y),{y:S,zeroW:k,x:_,zeroH:L}=C;let D=null!=(s=C.barWidth)?s:0,M=null!=(i=C.barHeight)?i:0;const E=null!=(a=C.yDivision)?a:0,P=null!=(r=C.xDivision)?r:0;m=S,f=_;const F=p.group({class:"apexcharts-datalabels","data:realIndex":y}),T=p.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<g.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(x,e,y),i=this.seriesRangeStart[x][e],a=this.seriesRangeEnd[x][e];let r=null,p=null,u=null;const b={x:f,y:m,strokeWidth:s,elSeries:v};let S=this.seriesLen;if(g.config.plotOptions.bar.rangeBarGroupRows&&(S=1),void 0===(null==(o=g.config.series[x].data)?void 0:o[e]))break;if(this.isHorizontal){u=m+M*this.visibleI;const t=(E-M*S)/2;if(null==(h=null==(l=g.config.series[x].data)?void 0:l[e])?void 0:h.x){const s=this.detectOverlappingBars({i:x,j:e,barYPosition:u,srty:t,barHeight:M,yDivision:E,initPositions:C});M=s.barHeight,u=s.barYPosition}r=this.drawRangeBarPaths(n({indexes:{i:x,j:e,realIndex:y},barHeight:M,barYPosition:u,zeroW:k,yDivision:E,y1:i,y2:a},b)),D=r.barWidth}else{g.axisFlags.isXNumeric&&(f=(g.seriesData.seriesX[x][e]-g.globals.minX)/this.xRatio-D/2),p=f+D*this.visibleI;const t=(P-D*S)/2;if(null==(d=null==(c=g.config.series[x].data)?void 0:c[e])?void 0:d.x){const s=this.detectOverlappingBars({i:x,j:e,barXPosition:p,srtx:t,barWidth:D,xDivision:P,initPositions:C});D=s.barWidth,p=s.barXPosition}r=this.drawRangeColumnPaths(n({indexes:{i:x,j:e,realIndex:y,translationsIndex:A},barWidth:D,barXPosition:p,zeroH:L,xDivision:P},b)),M=r.barHeight}const _=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:u,goalX:r.goalX,goalY:r.goalY,barHeight:M,barWidth:D});_&&T.add(_),m=r.y,f=r.x;const I=this.barHelpers.getPathFillColor(t,x,e,y);this.renderSeries({realIndex:y,pathFill:I.color,lineFill:I.useRangeColor?I.color:g.globals.stroke.colors[y],j:e,i:x,x:f,y:m,y1:i,y2:a,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:s,elSeries:v,series:t,barHeight:M,barWidth:D,barXPosition:p,barYPosition:u,columnGroupIndex:w,elDataLabelsWrap:F,elGoalsMarkers:T,visibleSeries:this.visibleI,type:"rangebar"})}u.add(v)}return u}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:i,srty:a,srtx:r,barHeight:o,barWidth:n,yDivision:l,xDivision:h,initPositions:c}){var d,g,p,u;const x=this.w;let f=[];const m=null==(g=null==(d=x.config.series[t].data)?void 0:d[e])?void 0:g.rangeName,b=null==(u=null==(p=x.config.series[t].data)?void 0:p[e])?void 0:u.x,y=Array.isArray(b)?b.join(" "):b,w=x.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(y),v=x.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===y&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=x.config.plotOptions.bar.rangeBarGroupRows?a+l*w:a+o*this.visibleI+l*w,v>-1&&!x.config.plotOptions.bar.rangeBarOverlap&&(f=Array.from(x.rangeData.seriesRange[t][v].overlaps),f.indexOf(m)>-1&&(s=(o=c.barHeight/f.length)*this.visibleI+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+f.indexOf(m))+l*w))):(w>-1&&!x.labelData.timescaleLabels.length&&(i=x.config.plotOptions.bar.rangeBarGroupRows?r+h*w:r+n*this.visibleI+h*w),v>-1&&!x.config.plotOptions.bar.rangeBarOverlap&&(f=Array.from(x.rangeData.seriesRange[t][v].overlaps),f.indexOf(m)>-1&&(i=(n=c.barWidth/f.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+f.indexOf(m))+h*w))),{barYPosition:s,barXPosition:i,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:i,barXPosition:a,zeroH:r}){var o,n;const l=this.w,{i:h,j:c,realIndex:d,translationsIndex:g}=t,p=this.yRatio[g],u=this.getRangeValue(d,c);let x=Math.min(u.start,u.end),f=Math.max(u.start,u.end);void 0===(null==(o=this.series[h])?void 0:o[c])||null===(null==(n=this.series[h])?void 0:n[c])?x=r:(x=r-x/p,f=r-f/p);const m=Math.abs(f-x),b=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:i,y1:x,y2:f,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:d,i:d,j:c,w:l});if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:c,realIndex:d,barWidth:i});e=t.x,a=t.barXPosition}else e+=s;return{pathTo:b.pathTo,pathFrom:b.pathFrom,barHeight:m,x:e,y:u.start<0&&u.end<0?x:f,goalY:this.barHelpers.getGoalValues("y",null,r,h,c,g),barXPosition:a}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:i,yDivision:a,barHeight:r,barYPosition:o,zeroW:n}){const l=this.w,{realIndex:h,j:c}=t,d=this.preventBarOverflow(n+s/this.invertedYRatio),g=this.preventBarOverflow(n+i/this.invertedYRatio),p=this.getRangeValue(h,c),u=Math.abs(g-d),x=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:d,x2:g,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:c,w:l});return l.axisFlags.isXNumeric||(e+=a),{pathTo:x.pathTo,pathFrom:x.pathFrom,barWidth:u,x:p.start<0&&p.end<0?d:g,goalX:this.barHelpers.getGoalValues("x",n,null,h,c,0),y:e}}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}},candlestick:Ni,boxPlot:Ni,violin:class extends Fi{draw(t,e,s){const i=this.w,a=new gt(this.w),r=new pt(this.w);this.violinOptions=i.config.plotOptions.violin,this.pointsOptions=this.violinOptions.points,this.bandwidthScale=this.violinOptions.bandwidthScale||1,this.normalize=this.violinOptions.normalize||"individual",this.distributed=i.config.plotOptions.bar.distributed,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.coreUtils=new P(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const o=a.group({class:"apexcharts-violin-series apexcharts-plot-series"});for(let e=0;e<t.length;e++){let n,l;const h=[],c=[],d=i.globals.comboCharts?s[e]:e,{columnGroupIndex:g}=this.barHelpers.getGroupIndex(d),p=a.group({class:"apexcharts-series",seriesName:b.escapeString(i.seriesData.seriesNames[d]),rel:e+1,"data:realIndex":d});ce.addCollapsedClassToSeries(this.w,p,d),t[e].length>0&&(this.visibleI=this.visibleI+1);let u=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[d][0],u=d);const x=this.barHelpers.initialPositions(d),{y:f,barHeight:m,yDivision:y,zeroW:w,x:v,barWidth:A,xDivision:C,zeroH:S}=x;l=f,n=v,c.push(n+(null!=A?A:0)/2);const k=a.group({class:"apexcharts-datalabels","data:realIndex":d});if(this.seriesMaxWeight=0,"group"===this.normalize){(i.violinData.seriesViolinDensity[d]||[]).forEach(t=>{t&&t.maxWeight>this.seriesMaxWeight&&(this.seriesMaxWeight=t.maxWeight)})}const _=[];for(let s=0;s<i.globals.dataPoints;s++){const a=this.barHelpers.getStrokeWidth(e,s,d),o=this.isHorizontal?this.drawHorizontalViolin({indexes:{i:e,j:s,realIndex:d,translationsIndex:u},y:l,yDivision:y,barHeight:m,zeroW:w}):this.drawVerticalViolin({indexes:{i:e,j:s,realIndex:d,translationsIndex:u},x:n,xDivision:C,barWidth:A,zeroH:S});n=o.x,l=o.y,s>0&&c.push(o.center),h.push(o.alongRepresentative);const x=this.buildPointsSubPath({realIndex:d,j:s,center:o.center,halfExtent:o.halfExtent,alongFn:o.alongFn,density:o.density,maxWeight:o.maxWeight});x.length&&_.push({groups:x,j:s});const f=r.fillPath({seriesNumber:this.distributed?s:d,dataPointIndex:s,color:this.distributed?i.globals.colors[s]:void 0,value:t[e][s]});this.renderSeries({realIndex:d,pathFill:f,lineFill:i.globals.stroke.colors[d],j:s,i:e,pathFrom:o.pathFrom,pathTo:o.pathTo,strokeWidth:a,elSeries:p,x:n,y:l,series:t,columnGroupIndex:g,barHeight:m,barWidth:A,elDataLabelsWrap:k,visibleSeries:this.visibleI,type:"violin"});const b=p.node.querySelector(`path.apexcharts-violin-area[j='${s}']`);b&&isFinite(o.alongRepresentative)&&b.setAttribute(this.isHorizontal?"cx":"cy",`${o.alongRepresentative}`)}Ii({graphics:a,w:i,elSeries:p,pointsByCat:_,options:this.pointsOptions,distributed:this.distributed,realIndex:d,wrapClass:"apexcharts-violin-points-wrap",pointClass:"apexcharts-violin-points"}),i.globals.seriesXvalues[d]=c,i.globals.seriesYvalues[d]=h,o.add(p)}return o}drawVerticalViolin({indexes:t,x:e,xDivision:s,barWidth:i,zeroH:a}){var r;const o=this.w,{realIndex:n,j:l,translationsIndex:h}=t,c=this.yRatio[h];o.axisFlags.isXNumeric&&(e=(o.seriesData.seriesX[n][l]-o.globals.minX)/this.xRatio-i/2);const d=e+i*this.visibleI+i/2,g=i/2,p=this.getDensity(n,l),u=this.effectiveMaxWeight(p),x=t=>a-this.logVal(t,n)/c,f=this.buildBodyPath({nodes:p.nodes,center:d,halfExtent:g,maxWeight:u,vertical:!0,alongFn:x,collapsed:!1});let m=null;return o.globals.previousPaths.length>0&&(m=this.getPreviousPath(n,l,f)),null==m&&(m=this.buildBodyPath({nodes:p.nodes,center:d,halfExtent:g,maxWeight:u,vertical:!0,alongFn:x,collapsed:!0})),o.axisFlags.isXNumeric||(e+=s),{pathTo:f,pathFrom:m,x:e,y:a,center:d,halfExtent:g,alongFn:x,density:p,maxWeight:u,alongRepresentative:x(null!=(r=this.series[t.i][l])?r:0)}}drawHorizontalViolin({indexes:t,y:e,yDivision:s,barHeight:i,zeroW:a}){var r;const o=this.w,{realIndex:n,j:l}=t,h=this.invertedYRatio;o.axisFlags.isXNumeric&&(e=(o.seriesData.seriesX[n][l]-o.globals.minX)/this.invertedXRatio-i/2);const c=e+i*this.visibleI+i/2,d=i/2,g=this.getDensity(n,l),p=this.effectiveMaxWeight(g),u=t=>a+this.logVal(t,n)/h,x=this.buildBodyPath({nodes:g.nodes,center:c,halfExtent:d,maxWeight:p,vertical:!1,alongFn:u,collapsed:!1});let f=null;return o.globals.previousPaths.length>0&&(f=this.getPreviousPath(n,l,x)),null==f&&(f=this.buildBodyPath({nodes:g.nodes,center:c,halfExtent:d,maxWeight:p,vertical:!1,alongFn:u,collapsed:!0})),o.axisFlags.isXNumeric||(e+=s),{pathTo:x,pathFrom:f,x:a,y:e,center:c,halfExtent:d,alongFn:u,maxWeight:p,density:g,alongRepresentative:u(null!=(r=this.series[t.i][l])?r:0)}}getDensity(t,e){var s;const i=null==(s=this.w.violinData.seriesViolinDensity[t])?void 0:s[e];if(!i||!i.values.length)return{nodes:[],maxWeight:0};const a=i.values.map((t,e)=>e);a.sort((t,e)=>i.values[t]-i.values[e]);const r=[];let o=null;for(const t of a){const e=i.values[t];null!==o&&e===o||(r.push({v:e,w:i.weights[t]}),o=e)}return{nodes:r,maxWeight:i.maxWeight}}effectiveMaxWeight(t){return"group"===this.normalize&&this.seriesMaxWeight>0?this.seriesMaxWeight:t.maxWeight}buildBodyPath({nodes:t,center:e,halfExtent:s,maxWeight:i,vertical:a,alongFn:r,collapsed:o}){const n=new gt(this.w);if(0===t.length){const t=r(0);return a?n.move(e,t)+n.line(e,t):n.move(t,e)+n.line(t,e)}const l=t=>{if(o||i<=0)return 0;const e=t/i*s*this.bandwidthScale;return Math.min(s,Math.max(0,e))},h=[],c=[];for(let s=0;s<t.length;s++){const i=r(t[s].v),o=l(t[s].w);a?(h.push([e+o,i]),c.push([e-o,i])):(h.push([i,e+o]),c.push([i,e-o]))}return c.reverse(),this.smoothSegment(h,a,!1)+this.smoothSegment(c,a,!0)+"z"}smoothSegment(t,e,s){const i=new gt(this.w),a=t[0];let r=s?i.line(a[0],a[1]):i.move(a[0],a[1]);if(t.length<3||!this.strictlyMonotonic(t,e)){for(let e=1;e<t.length;e++)r+=i.line(t[e][0],t[e][1]);return r}const o=t.map(([t,s])=>e?[s,t]:[t,s]),n=Wi.points(o),l=e?n.map(ji):n;return r+=Hi(l),r}strictlyMonotonic(t,e){const s=e?1:0;for(let e=1;e<t.length;e++)if(t[e][s]===t[e-1][s])return!1;return!0}buildPointsSubPath({realIndex:t,j:e,center:s,halfExtent:i,alongFn:a,density:r,maxWeight:o}){var n;return Ti({w:this.w,points:null==(n=this.w.violinData.seriesViolinPoints[t])?void 0:n[e],seedA:t,seedB:e,center:s,halfExtent:i,alongFn:a,isHorizontal:this.isHorizontal,options:this.pointsOptions,clampAt:t=>this.halfWidthAtValue(t,r,i,o)})}halfWidthAtValue(t,e,s,i){const{nodes:a}=e,r=null!=i?i:e.maxWeight;if(!a.length||r<=0)return 0;const o=t=>Math.min(s,t/r*s*this.bandwidthScale);if(t<=a[0].v)return o(a[0].w);if(t>=a[a.length-1].v)return o(a[a.length-1].w);for(let e=1;e<a.length;e++)if(t<=a[e].v){const s=a[e-1],i=a[e],r=i.v===s.v?0:(t-s.v)/(i.v-s.v);return o(s.w+(i.w-s.w)*r)}return 0}logVal(t,e){return this.coreUtils.getLogValAtSeriesIndex(t,e)}},pie:Zi,donut:Zi,polarArea:Zi,radialBar:class extends Zi{constructor(t,e){super(t,e),this.ctx=e,this.w=t,this.animBeginArr=[0],this.animDur=0,this.startAngle=t.config.plotOptions.radialBar.startAngle,this.endAngle=t.config.plotOptions.radialBar.endAngle,this.totalAngle=Math.abs(t.config.plotOptions.radialBar.endAngle-t.config.plotOptions.radialBar.startAngle),this.trackStartAngle=t.config.plotOptions.radialBar.track.startAngle,this.trackEndAngle=t.config.plotOptions.radialBar.track.endAngle,this.barLabels=this.w.config.plotOptions.radialBar.barLabels,this.donutDataLabels=this.w.config.plotOptions.radialBar.dataLabels,this.radialDataLabels=this.donutDataLabels,this.trackStartAngle||(this.trackStartAngle=this.startAngle),this.trackEndAngle||(this.trackEndAngle=this.endAngle),360===this.endAngle&&(this.endAngle=359.99),this.margin=parseInt(t.config.plotOptions.radialBar.track.margin,10),this.onBarLabelClick=this.onBarLabelClick.bind(this)}draw(t){var e;const s=this.w,i=new gt(this.w),a=i.group({class:"apexcharts-radialbar"});if(s.globals.noData)return a;const r=i.group(),o=this.defaultSize/2,n=s.layout.gridWidth/2;let l=this.defaultSize/2.05;s.config.chart.sparkline.enabled||(l=l-s.config.stroke.width-s.config.chart.dropShadow.blur);const h=s.globals.fill.colors,d=s.config.plotOptions.radialBar,g=Array.isArray(d.bands)&&d.bands.length>0,p=g&&d.bandsStyle&&d.bandsStyle.hideTrackWhenPresent,u="needle"===d.shape;if(d.track.show&&!p){const e=this.drawTracks({size:l,centerX:n,centerY:o,colorArr:h,series:t});r.add(e)}if(g){const e=this.drawBands({size:l,centerX:n,centerY:o,series:t});r.add(e)}const x=this.drawArcs({size:l,centerX:n,centerY:o,colorArr:h,series:t,skipValueArc:u&&!(null==(e=d.needle)?void 0:e.showValueArc)});if(d.ticks&&d.ticks.show){const e=this.drawTicks({size:l,centerX:n,centerY:o,series:t});if(this.initialAnim&&!s.globals.dataChanged&&!s.globals.resized&&c.isBrowser()&&s.globals.shouldAnimate){const t=e.node;t.style.opacity="0",t.style.transition="opacity 280ms ease-out";const i=s.config.chart.animations.speed||800;setTimeout(()=>{t.style.opacity="1"},i)}r.add(e)}if(u){const e=this.drawNeedle({size:l,centerX:n,centerY:o,series:t});r.add(e)}let f=360;s.config.plotOptions.radialBar.startAngle<0&&(f=this.totalAngle);const m=(360-f)/360;if(s.globals.radialSize=l-l*m,this.radialDataLabels.value.show){const t=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);s.globals.radialSize+=t*m}return r.add(x.g),"front"===s.config.plotOptions.radialBar.hollow.position&&(x.g.add(x.elHollow),x.dataLabels&&x.g.add(x.dataLabels)),a.add(r),a}drawTracks(t){const e=this.w,s=new gt(this.w),i=s.group({class:"apexcharts-tracks"}),a=new dt(this.w),r=new pt(this.w),o=this.getStrokeWidth(t);t.size=t.size-o/2;for(let n=0;n<t.series.length;n++){const l=s.group({class:"apexcharts-radialbar-track apexcharts-track"});i.add(l),l.attr({rel:n+1}),t.size=t.size-o-this.margin;const h=e.config.plotOptions.radialBar.track,c=r.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(h.background)?h.background[n]:h.background,solid:!0}),d=this.trackStartAngle;let g=this.trackEndAngle;Math.abs(g)+Math.abs(d)>=360&&(g=360-Math.abs(this.startAngle)-.1);const p=s.drawPath({d:"",stroke:c,strokeWidth:o*parseInt(h.strokeWidth,10)/100,fill:"none",strokeOpacity:h.opacity,classes:"apexcharts-radialbar-area"});if(h.dropShadow.enabled){const t=h.dropShadow;a.dropShadow(p,t)}l.add(p),p.attr("id","apexcharts-radialbarTrack-"+n),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:g,startAngle:d,size:t.size,i:n,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return i}drawArcs(t){var e;const s=this.w,i=new gt(this.w),a=new pt(this.w),r=new dt(this.w),o=i.group(),n=this.getStrokeWidth(t);t.size=t.size-n/2;let l=s.config.plotOptions.radialBar.hollow.background;const h=t.size-n*t.series.length-this.margin*t.series.length-n*parseInt(s.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,c=h-s.config.plotOptions.radialBar.hollow.margin;void 0!==s.config.plotOptions.radialBar.hollow.image&&(l=this.drawHollowImage(t,o,h,l));const d=this.drawHollow({size:c,centerX:t.centerX,centerY:t.centerY,fill:l||"transparent"});if(s.config.plotOptions.radialBar.hollow.dropShadow.enabled){const t=s.config.plotOptions.radialBar.hollow.dropShadow;r.dropShadow(d,t)}let g=1;!this.radialDataLabels.total.show&&s.seriesData.series.length>1&&(g=0);let p=null;if(this.radialDataLabels.show){const e=s.dom.Paper.findOne(".apexcharts-datalabels-group");p=this.renderInnerDataLabels(e,this.radialDataLabels,{hollowSize:h,centerX:t.centerX,centerY:t.centerY,opacity:g})}"back"===s.config.plotOptions.radialBar.hollow.position&&(o.add(d),p&&o.add(p));let u=!1;s.config.plotOptions.radialBar.inverseOrder&&(u=!0);const x=!0===(null==(e=this.ctx.morphTypeChange)?void 0:e.isActive());for(let e=u?t.series.length-1:0;u?e>=0:e<t.series.length;u?e--:e++){const l=i.group({class:"apexcharts-series apexcharts-radial-series",seriesName:b.escapeString(s.seriesData.seriesNames[e])});o.add(l),l.attr({rel:e+1,"data:realIndex":e}),ce.addCollapsedClassToSeries(this.w,l,e),t.size=t.size-n-this.margin;const h=a.fillPath({seriesNumber:e,size:t.size,value:t.series[e]}),c=this.startAngle;let d;const g=s.config.plotOptions.radialBar,p="number"==typeof g.min?g.min:0,u="number"==typeof g.max?g.max:100,f=u===p?1:u-p,m=t=>{const e=Math.min(Math.max(t,p),u);return Math.max(0,(e-p)/f)},y=m(b.negToZero(t.series[e]));let w,v=Math.round(this.totalAngle*y)+this.startAngle;s.globals.dataChanged&&(d=this.startAngle,w=Math.round(this.totalAngle*m(b.negToZero(s.globals.previousPaths[e])))+d);Math.abs(v)+Math.abs(c)>360&&(v-=.01);Math.abs(w)+Math.abs(d)>360&&(w-=.01);const A=v-c,C=Array.isArray(s.config.stroke.dashArray)?s.config.stroke.dashArray[e]:s.config.stroke.dashArray,S=x?this.ctx.morphTypeChange.getInitialPathFor(e,0):null,k=x?this.ctx.morphTypeChange.getFromType():null,_=!!S&&("bar"===k||"funnel"===k||"pyramid"===k||"pie"===k||"donut"===k||"polarArea"===k),L=i.drawPath({d:S||"",stroke:_||t.skipValueArc?"transparent":h,strokeWidth:_||t.skipValueArc?0:n,fill:_?h:"none",fillOpacity:s.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+e,strokeDashArray:C}),D=c+A/2,M=b.polarToCartesian(t.centerX,t.centerY,t.size,D);if(gt.setAttrs(L.node,{"data:angle":A,"data:value":t.series[e],"data:cx":M.x,"data:cy":M.y}),s.config.chart.dropShadow.enabled){const t=s.config.chart.dropShadow;r.dropShadow(L,t,e)}if(r.setSelectionFilter(L,0,e),this.addListeners(L,this.radialDataLabels),l.add(L),L.attr({index:0,j:e}),this.barLabels.enabled){const a=b.polarToCartesian(t.centerX,t.centerY,t.size,c),r=this.barLabels.formatter(s.seriesData.seriesNames[e],{seriesIndex:e,w:s}),o=["apexcharts-radialbar-label"];this.barLabels.onClick||o.push("apexcharts-no-click");let n=this.barLabels.useSeriesColors?s.globals.colors[e]:s.config.chart.foreColor;n||(n=s.config.chart.foreColor);const h=a.x+this.barLabels.offsetX,d=a.y+this.barLabels.offsetY,g=i.drawText({x:h,y:d,text:r,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:n,cssClass:o.join(" ")});g.on("click",this.onBarLabelClick),g.attr({rel:e+1}),0!==c&&g.attr({"transform-origin":`${h} ${d}`,transform:`rotate(${c} 0 0)`}),l.add(g)}let E=0;if(!this.initialAnim||s.globals.resized||s.globals.dataChanged||(E=s.config.chart.animations.speed),s.globals.dataChanged&&(E=s.config.chart.animations.dynamicAnimation.speed),this.animDur=E/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur),x&&S){const e=this.ctx.morphTypeChange.getSpeed(),s=this.getPiePath({me:this,startAngle:c,angle:A,size:t.size});if(_){const i=this.ctx.morphTypeChange.buildRingSegmentPath(t.centerX,t.centerY,t.size,n,c,c+A);L.animate(e).plot(i,"polygons").after(function(){this.attr({d:s,fill:"none",stroke:t.skipValueArc?"transparent":h,"stroke-width":t.skipValueArc?0:n})})}else L.animate(e).plot(s,"polygons").attr({"stroke-width":n})}else this.animatePaths(L,{centerX:t.centerX,centerY:t.centerY,endAngle:v,startAngle:c,prevEndAngle:w,prevStartAngle:d,size:t.size,i:e,totalItems:2,animBeginArr:this.animBeginArr,dur:E,shouldSetPrevPaths:!0})}return{g:o,elHollow:d,dataLabels:p}}_angleAtValue(t){const e=this.w.config.plotOptions.radialBar,s="number"==typeof e.min?e.min:0,i="number"==typeof e.max?e.max:100,a=i===s?s+1:i,r=(Math.max(s,Math.min(a,Number(t)))-s)/(a-s);return this.startAngle+r*(this.endAngle-this.startAngle)}_describeArc(t,e,s,i,a){const r=b.polarToCartesian(t,e,s,a),o=b.polarToCartesian(t,e,s,i),n=a-i,l=Math.abs(n)>180?1:0;return`M ${r.x} ${r.y} A ${s} ${s} 0 ${l} 0 ${o.x} ${o.y}`}drawBands(t){const e=this.w,s=new gt(this.w),i=e.config.plotOptions.radialBar,a=i.bands||[],r=s.group({class:"apexcharts-gauge-bands"}),o=this.getStrokeWidth(t),n=t.size-o/2-o-this.margin,l=o*parseInt(i.bandsStyle.strokeWidth,10)/100,h="number"==typeof i.min?i.min:0,c="number"==typeof i.max?i.max:100,d=c===h?0:(i.bandsStyle.gap||0)*((this.endAngle-this.startAngle)/(c-h));for(let e=0;e<a.length;e++){const o=a[e];if(void 0===o.from||void 0===o.to)continue;const h=this._angleAtValue(o.from),c=this._angleAtValue(o.to),g=Math.min(h,c)+d/2,p=Math.max(h,c)-d/2;if(p-g<=0)continue;const u=s.drawPath({d:this._describeArc(t.centerX,t.centerY,n,g,p),stroke:o.color||"#ccc",strokeWidth:l,fill:"none",strokeLinecap:i.bandsStyle.linecap||"butt",classes:"apexcharts-gauge-band"});u.node.setAttribute("data-band-index",String(e)),r.add(u)}return r}drawTicks(t){var e,s,i,a;const r=this.w,o=new gt(this.w),n=r.config.plotOptions.radialBar,l=n.ticks,h=o.group({class:"apexcharts-gauge-ticks"}),c=this.getStrokeWidth(t),d=t.size-c/2-c-this.margin,g="number"==typeof n.min?n.min:0,p="number"==typeof n.max?n.max:100,u=Math.max(2,null!=(s=null==(e=l.major)?void 0:e.count)?s:11),x=Math.max(0,null!=(a=null==(i=l.minor)?void 0:i.count)?a:0),f=(e,s,i)=>{var a,r,n;const c=this._angleAtValue(e),g=null!=(a=s.length)?a:8,p="inside"===s.placement?d-g:d,u="inside"===s.placement?d:d+g,x=b.polarToCartesian(t.centerX,t.centerY,p,c),f=b.polarToCartesian(t.centerX,t.centerY,u,c),m=o.drawLine(x.x,x.y,f.x,f.y,s.color||(i?"#666":"#999"),0,s.width||(i?2:1));if(h.add(m),i&&(null==(r=l.labels)?void 0:r.show)){const i=("inside"===s.placement?p:u)+("inside"===s.placement?-1:1)*(null!=(n=l.labels.offset)?n:6),a=b.polarToCartesian(t.centerX,t.centerY,i,c),r="function"==typeof l.labels.formatter?l.labels.formatter(e):String(e),d=o.drawText({x:a.x,y:a.y,text:r,textAnchor:"middle",dominantBaseline:"middle",fontFamily:l.labels.fontFamily,fontSize:l.labels.fontSize,fontWeight:l.labels.fontWeight,foreColor:l.labels.color,cssClass:"apexcharts-gauge-tick-label"});h.add(d)}};for(let t=0;t<u;t++){if(f(g+t/(u-1)*(p-g),l.major||{},!0),t<u-1&&x>0)for(let e=1;e<=x;e++){f(g+(t+e/(x+1))/(u-1)*(p-g),l.minor||{},!1)}}return h}drawNeedle(t){var e,s,i,a,r;const o=this.w,n=new gt(this.w),l=o.config.plotOptions.radialBar.needle||{},h=n.group({class:"apexcharts-gauge-needle"});if(!t.series||0===t.series.length)return h;const d=this.getStrokeWidth(t),g=t.size-d/2-d-this.margin,p="string"==typeof l.length&&l.length.endsWith("%")?g*parseInt(l.length,10)/100:Number(l.length||.85*g),u=null!=(e=l.baseWidth)?e:4,x=null!=(s=l.tipWidth)?s:1,f=l.color||"#333",b=t.centerX,y=Number(null!=(i=l.offsetY)?i:0),w=t.centerY+y,v=`M ${b+u/2} ${w} A ${u/2} ${u/2} 0 0 1 ${b-u/2} ${w} L ${b-x/2} ${w-p} L ${b+x/2} ${w-p} Z`,A=n.drawPath({d:v,stroke:f,strokeWidth:0,fill:f,classes:"apexcharts-gauge-needle-shape"});h.add(A);const C=Number(t.series[0]),S=this._angleAtValue(C),k=this.initialAnim&&!o.globals.dataChanged&&!o.globals.resized,_=this.ctx,L="number"==typeof _._lastNeedleAngle?_._lastNeedleAngle:this.startAngle;_._lastNeedleAngle=S;if(c.isBrowser()&&o.globals.shouldAnimate&&(k||o.globals.dataChanged)&&L!==S){const t=h.node;t.setAttribute("transform-origin",`${b} ${w}`),t.setAttribute("transform",`rotate(${L})`);const e=(null==(a=l.animation)?void 0:a.duration)&&Number(l.animation.duration)||l.animationSpeed&&Number(l.animationSpeed)||(null==(r=o.config.chart.animations.dynamicAnimation)?void 0:r.speed)||o.config.chart.animations.speed||800,s=1.70158,i=s+1,n=k?t=>1+i*Math.pow(t-1,3)+s*Math.pow(t-1,2):t=>1-Math.pow(1-t,3),c=performance.now(),d=s=>{const i=Math.max(0,Math.min(1,(s-c)/e)),a=L+(S-L)*n(i);t.setAttribute("transform",`rotate(${a})`),i<1&&m.requestAnimationFrame(d)};m.requestAnimationFrame(d)}else h.attr({"transform-origin":`${b} ${w}`,transform:`rotate(${S})`});return h}drawHollow(t){var e;const s=new gt(this.w),i=this.w.config.plotOptions.radialBar.hollow,a=s.drawCircle(2*t.size),r={class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill};return(i.stroke||i.strokeDasharray)&&(r.stroke=i.stroke||"transparent",r["stroke-width"]=null!=(e=i.strokeWidth)?e:1,i.strokeDasharray&&(r["stroke-dasharray"]=i.strokeDasharray)),a.attr(r),a}drawHollowImage(t,e,s,i){const a=this.w,r=new pt(this.w),o=b.randomId(),n=a.config.plotOptions.radialBar.hollow.image;if(a.config.plotOptions.radialBar.hollow.imageClipped)r.clippedImgArea({width:s,height:s,image:n,patternID:`pattern${a.globals.cuid}${o}`}),i=`url(#pattern${a.globals.cuid}${o})`;else{const s=a.config.plotOptions.radialBar.hollow.imageWidth,i=a.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===s&&void 0===i){const s=a.dom.Paper.image(n,function(e){this.move(t.centerX-e.width/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-e.height/2+a.config.plotOptions.radialBar.hollow.imageOffsetY)});e.add(s)}else{const r=a.dom.Paper.image(n,function(){this.move(t.centerX-s/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-i/2+a.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(s,i)});e.add(r)}}return i}getStrokeWidth(t){const e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}onBarLabelClick(t){var e;const s=t.target,i=parseInt(null!=(e=s.getAttribute("rel"))?e:"",10)-1,a=this.barLabels.onClick,r=this.w;a&&a(r.seriesData.seriesNames[i],{w:r,seriesIndex:i})}},radar:class{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0,this.graphics=new gt(this.w),this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight<t.globals.svgWidth?t.layout.gridHeight:t.layout.gridWidth,this.isLog=t.config.yaxis[0].logarithmic,this.logBase=t.config.yaxis[0].logBase,this.coreUtils=new P(this.w),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,t.globals.maxY,0):t.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):t.globals.minY,this.polygons=t.config.plotOptions.radar.polygons,this.strokeWidth=t.config.stroke.show?t.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-t.config.chart.dropShadow.blur,t.config.xaxis.labels.show&&(this.size=this.size-t.layout.xAxisLabelsWidth/1.75),void 0!==t.config.plotOptions.radar.size&&(this.size=t.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.dataPointsLen=0,this.disAngle=0,this.yaxisLabelsTextsPos=[]}draw(t){const e=this.w,s=new pt(this.w),i=[],a=new yt(this.w,this.ctx);t.length&&(this.dataPointsLen=t[e.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;const r=e.layout.gridWidth/2,o=e.layout.gridHeight/2,h=r+e.config.plotOptions.radar.offsetX,c=o+e.config.plotOptions.radar.offsetY,d=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:`translate(${h||0}, ${c||0})`});let g=[],p=null,u=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((t,r)=>{const o=t.length===e.globals.dataPoints,h=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":o,seriesName:b.escapeString(e.seriesData.seriesNames[r]),rel:r+1,"data:realIndex":r});this.dataRadiusOfPercent[r]=[],this.dataRadius[r]=[],this.angleArr[r]=[],t.forEach((t,e)=>{const s=Math.abs(this.maxValue-this.minValue);t-=this.minValue,this.isLog&&(t=this.coreUtils.getLogVal(this.logBase,t,0)),this.dataRadiusOfPercent[r][e]=t/s,this.dataRadius[r][e]=this.dataRadiusOfPercent[r][e]*this.size,this.angleArr[r][e]=e*this.disAngle}),g=this.getDataPointsPos(this.dataRadius[r],this.angleArr[r]);const c=this.createPaths(g,{x:0,y:0});p=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),u=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":r}),e.globals.delayedElements.push({el:p.node,index:r});const d={i:r,realIndex:r,animationDelay:r,initialSpeed:e.config.chart.animations.speed,dataChangeSpeed:e.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:e.globals.stroke.colors[r],strokeLineCap:e.config.stroke.lineCap};let x=null;e.globals.previousPaths.length>0&&(x=this.getPreviousPath(r));for(let t=0;t<c.linePathsTo.length;t++){const i=this.graphics.renderPaths(l(n({},d),{pathFrom:null===x?c.linePathsFrom[t]:x,pathTo:c.linePathsTo[t],strokeWidth:Array.isArray(this.strokeWidth)?this.strokeWidth[r]:this.strokeWidth,fill:"none",drawShadow:!1}));h.add(i);const a=s.fillPath({seriesNumber:r}),o=this.graphics.renderPaths(l(n({},d),{pathFrom:null===x?c.areaPathsFrom[t]:x,pathTo:c.areaPathsTo[t],strokeWidth:0,fill:a,drawShadow:!1,drawMask:{type:"radial",cx:0,cy:0,r:this.size}}));if(e.config.chart.dropShadow.enabled){const t=new dt(this.w),s=e.config.chart.dropShadow;t.dropShadow(o,Object.assign({},s,{noUserSpaceOnUse:!0}),r)}h.add(o)}t.forEach((t,s)=>{const i=new mt(this.w,this.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:r,dataPointIndex:s}),o=this.graphics.drawMarker(g[s].x,g[s].y,i);o.attr("rel",s),o.attr("j",s),o.attr("index",r),o.node.setAttribute("default-marker-size",i.pSize);const l=this.graphics.group({class:"apexcharts-series-markers"});l&&l.add(o),p.add(l),h.add(p);const c=e.config.dataLabels;if(c.enabled){const t=c.formatter(e.seriesData.series[r][s],{seriesIndex:r,dataPointIndex:s,w:e});a.plotDataLabelsText({x:g[s].x,y:g[s].y,text:t,textAnchor:"middle",i:r,j:r,parent:u,offsetCorrection:!1,dataLabelsConfig:n({},c)})}h.add(u)}),i.push(h)}),this.drawPolygons({parent:d}),e.config.xaxis.labels.show){const t=this.drawXAxisTexts();d.add(t)}return i.forEach(t=>{d.add(t)}),d.add(this.yaxisLabels),d}drawPolygons(t){const e=this.w,{parent:s}=t,i=new qi(this.w),a=e.globals.yAxisScale[0].result.reverse(),r=a.length,o=[],n=this.size/(r-1);for(let t=0;t<r;t++)o[t]=n*t;o.reverse();const l=[],h=[];o.forEach((t,e)=>{const s=b.getPolygonPos(t,this.dataPointsLen);let i="";s.forEach((t,s)=>{if(0===e){const e=this.graphics.drawLine(t.x,t.y,0,0,Array.isArray(this.polygons.connectorColors)?this.polygons.connectorColors[s]:this.polygons.connectorColors);h.push(e)}0===s&&this.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),i+=t.x+","+t.y+" "}),l.push(i)}),l.forEach((t,i)=>{const a=this.polygons.strokeColors,r=this.polygons.strokeWidth,o=this.graphics.drawPolygon(t,Array.isArray(a)?a[i]:a,Array.isArray(r)?r[i]:r,e.globals.radarPolygons.fill.colors[i]);s.add(o)}),h.forEach(t=>{s.add(t)}),e.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((t,e)=>{const s=i.drawYAxisTexts(t.x,t.y,e,a[e]);this.yaxisLabels.add(s)})}drawXAxisTexts(){const t=this.w,e=t.config.xaxis.labels,s=this.graphics.group({class:"apexcharts-xaxis"}),i=b.getPolygonPos(this.size,this.dataPointsLen);return t.labelData.labels.forEach((a,r)=>{const o=t.config.xaxis.labels.formatter,l=new yt(this.w,this.ctx);if(i[r]){const h=this.getTextPos(i[r],this.size),c=o(a,{seriesIndex:-1,dataPointIndex:r,w:t});l.plotDataLabelsText({x:h.newX,y:h.newY,text:c,textAnchor:h.textAnchor,i:r,j:r,parent:s,className:"apexcharts-xaxis-label",color:Array.isArray(e.style.colors)&&e.style.colors[r]?e.style.colors[r]:"#a8a8a8",dataLabelsConfig:n({textAnchor:h.textAnchor,dropShadow:{enabled:!1}},e),offsetCorrection:!1}).on("click",e=>{if("function"==typeof t.config.chart.events.xAxisLabelClick){const s=Object.assign({},t,{labelIndex:r});t.config.chart.events.xAxisLabelClick(e,this.ctx,s)}})}}),s}createPaths(t,e){const s=[];let i=[];const a=[];let r=[];if(t.length){i=[this.graphics.move(e.x,e.y)],r=[this.graphics.move(e.x,e.y)];let o=this.graphics.move(t[0].x,t[0].y),n=this.graphics.move(t[0].x,t[0].y);t.forEach((e,s)=>{o+=this.graphics.line(e.x,e.y),n+=this.graphics.line(e.x,e.y),s===t.length-1&&(o+="Z",n+="Z")}),s.push(o),a.push(n)}return{linePathsFrom:i,linePathsTo:s,areaPathsFrom:r,areaPathsTo:a}}getTextPos(t,e){let s="middle",i=t.x,a=t.y;return Math.abs(t.x)>=10?t.x>0?(s="start",i+=10):t.x<0&&(s="end",i-=10):s="middle",Math.abs(t.y)>=e-10&&(t.y<0?a-=10:t.y>0&&(a+=10)),{textAnchor:s,newX:i,newY:a}}getPreviousPath(t){const e=this.w;let s=null;for(let i=0;i<e.globals.previousPaths.length;i++){const a=e.globals.previousPaths[i];a.paths.length>0&&parseInt(a.realIndex,10)===parseInt(String(t),10)&&void 0!==e.globals.previousPaths[i].paths[0]&&(s=e.globals.previousPaths[i].paths[0].d)}return s}getDataPointsPos(t,e,s=this.dataPointsLen){t=t||[],e=e||[];const i=[];for(let a=0;a<s;a++){const s={};s.x=t[a]*Math.sin(e[a]),s.y=-t[a]*Math.cos(e[a]),i.push(s)}return i}},heatmap:class{constructor(t,e,s){this.ctx=e,this.w=t,this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new Gi(t,e),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}draw(t){const e=this.w,s=new gt(this.w,this.ctx),i=s.group({class:"apexcharts-heatmap"});i.attr("clip-path",`url(#gridRectMask${e.globals.cuid})`);const a=e.layout.gridWidth/e.globals.dataPoints,r=e.layout.gridHeight/e.seriesData.series.length;let o=0,n=!1;this.negRange=this.helpers.checkColorRange();const l=t.slice();e.config.yaxis[0].reversed&&(n=!0,l.reverse());for(let h=n?0:l.length-1;n?h<l.length:h>=0;n?h++:h--){const n=s.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:b.escapeString(e.seriesData.seriesNames[h]),rel:h+1,"data:realIndex":h});if(ce.addCollapsedClassToSeries(this.w,n,h),s.setupEventDelegation(n,".apexcharts-heatmap-rect"),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;new dt(this.w).dropShadow(n,t,h)}let c=0;const d=e.config.plotOptions.heatmap.shadeIntensity;let g=0;for(let i=0;i<e.globals.dataPoints;i++){if(e.seriesData.seriesX.length&&!e.globals.allSeriesHasEqualX&&e.globals.minX+e.globals.minXDiff*i<e.seriesData.seriesX[h][g]){c+=a;continue}if(g>=l[h].length)break;const p=this.helpers.getShadeColor(e.config.chart.type,h,g,this.negRange);let u=p.color;const x=p.colorProps;if("image"===e.config.fill.type){u=new pt(this.w).fillPath({seriesNumber:h,dataPointIndex:g,opacity:e.globals.hasNegs?x.percent<0?1-(1+x.percent/100):d+x.percent/100:x.percent/100,patternID:b.randomId(),width:e.config.fill.image.width?e.config.fill.image.width:a,height:e.config.fill.image.height?e.config.fill.image.height:r})}const f=this.rectRadius,m=s.drawRect(c,o,a,r,f);if(m.attr({cx:c,cy:o}),m.node.classList.add("apexcharts-heatmap-rect"),n.add(m),m.attr({fill:u,i:h,index:h,j:g,val:t[h][g],"stroke-width":this.strokeWidth,stroke:e.config.plotOptions.heatmap.useFillColorAsStroke?u:e.globals.stroke.colors[0],color:u}),e.config.chart.animations.enabled&&!e.globals.dataChanged){let t=1;e.globals.resized||(t=e.config.chart.animations.speed),this.animateHeatMap(m,c,o,a,r,t,h,g)}if(e.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&e.globals.shouldAnimate){t=this.dynamicAnim.speed;let s=e.globals.previousPaths[h]&&e.globals.previousPaths[h][g]&&e.globals.previousPaths[h][g].color;s||(s="rgba(255, 255, 255, 0)"),this.animateHeatColor(m,b.isColorHex(s)?s:b.rgb2hex(s),b.isColorHex(u)?u:b.rgb2hex(u),t)}}const y=(0,e.config.dataLabels.formatter)(e.seriesData.series[h][g],{value:e.seriesData.series[h][g],seriesIndex:h,dataPointIndex:g,w:e}),w=this.helpers.calculateDataLabels({text:y,x:c+a/2,y:o+r/2,i:h,j:g,colorProps:x,series:l});null!==w&&n.add(w),c+=a,g++}o+=r,i.add(n)}const h=e.globals.yAxisScale[0].result.slice();return e.config.yaxis[0].reversed?h.unshift(""):h.push(""),e.globals.yAxisScale[0].result=h,i}animateHeatMap(t,e,s,i,a,r,o=0,n=0){const l=this.w,h=new ct(this.w),c=l.config.chart.animations.animateGradually;let d=0;if(c&&!1!==c.enabled){const t=((l.seriesData.series||[]).length||1)+(l.globals.dataPoints||1)-2;d=ht({style:"diagonal",index:n,row:o,col:n,baseDelay:Math.min(c.delay||0,.5*r/Math.max(1,t))})}h.animateRect(t,{x:e+i/2,y:s+a/2,width:0,height:0},{x:e,y:s,width:i,height:a},r,()=>{h.animationCompleted(t)},d)}animateHeatColor(t,e,s,i){t.attr({fill:e}).animate(i).attr({fill:s})}},treemap:class{constructor(t,e){this.ctx=e,this.w=t,this.strokeWidth=this.w.config.stroke.width,this.helpers=new Gi(t,e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}draw(t){const e=this.w,s=new gt(this.w,this.ctx),i=new pt(this.w),a=s.group({class:"apexcharts-treemap"});if(e.globals.noData)return a;const r=[];t.forEach(t=>{const e=t.map(t=>Math.abs(t));r.push(e)}),this.negRange=this.helpers.checkColorRange(),e.config.series.forEach((t,e)=>{t.data.forEach(t=>{Array.isArray(this.labels[e])||(this.labels[e]=[]),this.labels[e].push(t.x)})});return sa.generate(r,e.layout.gridWidth,e.layout.gridHeight).forEach((r,o)=>{var n;const l=s.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:b.escapeString(e.seriesData.seriesNames[o]),rel:o+1,"data:realIndex":o});if(s.setupEventDelegation(l,".apexcharts-treemap-rect"),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;new dt(this.w).dropShadow(a,t,o)}const h=s.group({class:"apexcharts-data-labels"}),c={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},d=e.config.chart.animations,g=d.animateGradually,p=g&&!1!==g.enabled,u=new Array(r.length).fill(0);if(p){const t=r.length||1,e=Math.min(g.delay||0,.5*d.speed/t);r.map((t,e)=>({j:e,area:(t[2]-t[0])*(t[3]-t[1])})).sort((t,e)=>e.area-t.area).forEach((t,s)=>{u[t.j]=s*e})}r.forEach((a,r)=>{const n=a[0],h=a[1],d=a[2],g=a[3];c.xMin=Math.min(c.xMin,n),c.yMin=Math.min(c.yMin,h),c.xMax=Math.max(c.xMax,d),c.yMax=Math.max(c.yMax,g);const p=this.helpers.getShadeColor(e.config.chart.type,o,r,this.negRange),x=p.color,f=i.fillPath({color:x,seriesNumber:o,dataPointIndex:r}),m=s.drawRect(n,h,d-n,g-h,e.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,e.config.plotOptions.treemap.useFillColorAsStroke?x:e.globals.stroke.colors[o]);m.attr({cx:n,cy:h,index:o,i:o,j:r,width:d-n,height:g-h,fill:f}),m.node.classList.add("apexcharts-treemap-rect");let b={x:n+(d-n)/2,y:h+(g-h)/2,width:0,height:0};const y={x:n,y:h,width:d-n,height:g-h};if(e.config.chart.animations.enabled&&!e.globals.dataChanged){let t=1;e.globals.resized||(t=e.config.chart.animations.speed),this.animateTreemap(m,b,y,t,u[r]||0)}if(e.globals.dataChanged){let t=1;this.dynamicAnim.enabled&&e.globals.shouldAnimate&&(t=this.dynamicAnim.speed,e.globals.previousPaths[o]&&e.globals.previousPaths[o][r]&&e.globals.previousPaths[o][r].rect&&(b=e.globals.previousPaths[o][r].rect),this.animateTreemap(m,b,y,t))}let w=this.getFontSize(a),v=e.config.dataLabels.formatter(this.labels[o][r],{value:e.seriesData.series[o][r],seriesIndex:o,dataPointIndex:r,w:e});"truncate"===e.config.plotOptions.treemap.dataLabels.format&&(w=parseInt(String(e.config.dataLabels.style.fontSize),10),v=this.truncateLabels(String(v),w,n,h,d,g));let A=null;e.seriesData.series[o][r]&&(A=this.helpers.calculateDataLabels({text:v,x:(n+d)/2,y:(h+g)/2+this.strokeWidth/2+w/3,i:o,j:r,colorProps:p,fontSize:w,series:t})),e.config.dataLabels.enabled&&A&&this.rotateToFitLabel(A,w,v,n,h,d,g),l.add(m),null!==A&&l.add(A)});const x=e.config.plotOptions.treemap.seriesTitle;if(e.config.series.length>1&&x&&x.show){const t=e.config.series[o].name||"";if(t&&c.xMin<1/0&&c.yMin<1/0){const{offsetX:i,offsetY:a,borderColor:r,borderWidth:o,borderRadius:h,style:d}=x,g=d.color||e.config.chart.foreColor,p={left:d.padding.left,right:d.padding.right,top:d.padding.top,bottom:d.padding.bottom},u=s.getTextRects(t,d.fontSize,d.fontFamily),f=u.width+p.left+p.right,m=u.height+p.top+p.bottom,b=c.xMin+(i||0),y=c.yMin+(a||0),w=s.drawRect(b,y,f,m,h,d.background,1,o,r),v=s.drawText({x:b+p.left,y:y+p.top+.75*(null!=(n=null==u?void 0:u.height)?n:0),text:t,fontSize:d.fontSize,fontFamily:d.fontFamily,fontWeight:d.fontWeight,foreColor:g,cssClass:d.cssClass||""});l.add(w),l.add(v)}}l.add(h),a.add(l)}),a}getFontSize(t){const e=this.w;const s=function t(e){let s,i=0;if(Array.isArray(e[0]))for(s=0;s<e.length;s++)i+=t(e[s]);else for(s=0;s<e.length;s++)i+=e[s].length;return i}(this.labels)/function t(e){let s,i=0;if(Array.isArray(e[0]))for(s=0;s<e.length;s++)i+=t(e[s]);else for(s=0;s<e.length;s++)i+=1;return i}(this.labels);return function(t,i){const a=t*i,r=Math.pow(a,.5);return Math.min(r/s,parseInt(e.config.dataLabels.style.fontSize,10))}(t[2]-t[0],t[3]-t[1])}rotateToFitLabel(t,e,s,i,a,r,o){const n=new gt(this.w),l=n.getTextRects(s,String(e));if(l.width+this.w.config.stroke.width+5>r-i&&l.width<=o-a){const e=n.rotateAroundCenter(t.node);t.node.setAttribute("transform",`rotate(-90 ${e.x} ${e.y}) translate(${l.height/3})`)}}truncateLabels(t,e,s,i,a,r){const o=new gt(this.w),n=o.getTextRects(t,String(e)).width+this.w.config.stroke.width+5>a-s&&r-i>a-s?r-i:a-s,l=o.getTextBasedOnMaxWidth({text:t,maxWidth:n,fontSize:e});return t.length!==l.length&&n/e<5?"":l}animateTreemap(t,e,s,i,a=0){const r=new ct(this.w);r.animateRect(t,e,s,i,()=>{r.animationCompleted(t)},a)}}}),module.exports=Cs;
|
|
5
|
+
"use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,n=(t,e)=>{for(var s in e||(e={}))a.call(e,s)&&o(t,s,e[s]);if(i)for(var s of i(e))r.call(e,s)&&o(t,s,e[s]);return t},l=(t,i)=>e(t,s(i)),h=(t,e,s)=>o(t,"symbol"!=typeof e?e+"":e,s);class c{static isSSR(){return"undefined"==typeof window||"undefined"==typeof document}static isBrowser(){return!this.isSSR()}static hasAPI(t){return!this.isSSR()&&void 0!==window[t]}static getApex(){return"undefined"!=typeof window&&window.Apex?window.Apex:"undefined"!=typeof global&&global.Apex?global.Apex:{}}}class d{constructor(t,e=null){this.nodeName=t,this.namespaceURI=e,this.attributes=new Map,this.children=[],this.textContent="",this.style={},this.classList=new g,this.parentNode=null,this._ssrWidth=void 0,this._ssrHeight=void 0,this._ssrMode=void 0}setAttribute(t,e){this.attributes.set(t,e)}getAttribute(t){return this.attributes.get(t)}removeAttribute(t){this.attributes.delete(t)}hasAttribute(t){return this.attributes.has(t)}appendChild(t){if(t&&t!==this){if(t.parentNode&&t.parentNode!==this)t.parentNode.removeChild(t);else if(t.parentNode===this){const e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1)}t.parentNode=this,this.children.push(t)}return t}removeChild(t){const e=this.children.indexOf(t);return-1!==e&&(this.children.splice(e,1),t.parentNode=null),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(t.parentNode&&t.parentNode!==this)t.parentNode.removeChild(t);else if(t.parentNode===this){const e=this.children.indexOf(t);-1!==e&&this.children.splice(e,1)}const s=this.children.indexOf(e);return-1!==s&&(t.parentNode=this,this.children.splice(s,0,t)),t}cloneNode(t=!1){const e=new d(this.nodeName,this.namespaceURI);return e.textContent=this.textContent,this.attributes.forEach((t,s)=>{e.attributes.set(s,t)}),Object.assign(e.style,this.style),t&&this.children.forEach(t=>{t.cloneNode&&e.appendChild(t.cloneNode(!0))}),e}getBoundingClientRect(){return{width:this._ssrWidth||0,height:this._ssrHeight||0,top:0,left:0,right:this._ssrWidth||0,bottom:this._ssrHeight||0,x:0,y:0}}getRootNode(){let t=this;for(;t.parentNode;)t=t.parentNode;return t}querySelector(){return null}querySelectorAll(){return[]}getElementsByClassName(){return[]}addEventListener(){}removeEventListener(){}get childNodes(){return this.children}toString(){let t="";if(this.attributes.forEach((e,s)=>{t+=` ${s}="${e}"`}),0===this.children.length&&!this.textContent)return`<${this.nodeName}${t}/>`;const e=this.children.map(t=>t.toString()).join("");return`<${this.nodeName}${t}>${this.textContent}${e}</${this.nodeName}>`}get innerHTML(){return this.children.map(t=>t.toString()).join("")}set innerHTML(t){this.children=[],this.textContent=t}get outerHTML(){return this.toString()}get isConnected(){return!0}}class g{constructor(){this.classes=new Set}add(...t){t.forEach(t=>this.classes.add(t))}remove(...t){t.forEach(t=>this.classes.delete(t))}contains(t){return this.classes.has(t)}toggle(t,e){return!0===e?(this.classes.add(t),!0):!1===e||this.classes.has(t)?(this.classes.delete(t),!1):(this.classes.add(t),!0)}toString(){return Array.from(this.classes).join(" ")}}class p{constructor(){this.SVGNS="http://www.w3.org/2000/svg",this.XLINKNS="http://www.w3.org/1999/xlink"}createElementNS(t,e){return new d(e,t)}createTextNode(t){const e={nodeName:"#text",nodeType:3,textContent:t,toString:()=>e.textContent};return e}querySelector(){return null}querySelectorAll(){return[]}getComputedStyle(){return{}}getBoundingClientRect(t){return t&&t.getBoundingClientRect?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}createXMLSerializer(){return{serializeToString:t=>t.toString?t.toString():""}}createDOMParser(){return{parseFromString(t,e){const s=new d("root");return s.innerHTML=t,{documentElement:s}}}}}let u=null,x=null,f=null;class m{static init(){c.isSSR()&&!u&&(u=new p)}static createElement(t){return c.isSSR()?(u||this.init(),u.createElementNS(null,t)):document.createElement(t)}static createElementNS(t,e){return c.isSSR()?(u||this.init(),u.createElementNS(t,e)):document.createElementNS(t,e)}static createTextNode(t){return c.isSSR()?(u||this.init(),u.createTextNode(t)):document.createTextNode(t)}static querySelector(t){return c.isSSR()?null:document.querySelector(t)}static querySelectorAll(t){return c.isSSR()?[]:document.querySelectorAll(t)}static getComputedStyle(t){return c.isSSR()?{}:window.getComputedStyle(t)}static matchMedia(t){if(c.isSSR()||"function"!=typeof window.matchMedia)return null;try{return window.matchMedia(t)}catch(t){return null}}static getBoundingClientRect(t){return c.isSSR()?(u||this.init(),u.getBoundingClientRect(t)):t?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}static getXMLSerializer(){return c.isSSR()?(u||this.init(),x||(x=u.createXMLSerializer()),x):(x||(x=new XMLSerializer),x)}static getDOMParser(){return c.isSSR()?(u||this.init(),f||(f=u.createDOMParser()),f):(f||(f=new DOMParser),f)}static addWindowEventListener(t,e,s){c.isBrowser()&&window.addEventListener(t,e,s)}static removeWindowEventListener(t,e,s){c.isBrowser()&&window.removeEventListener(t,e,s)}static requestAnimationFrame(t){return c.isBrowser()?window.requestAnimationFrame(t):(t(0),null)}static cancelAnimationFrame(t){c.isBrowser()&&t&&window.cancelAnimationFrame(t)}static elementExists(t){return!!t&&(c.isSSR()?!0===t._ssrMode||void 0!==t.nodeName:!!t.getRootNode&&(t.getRootNode({composed:!0})===document||t.isConnected))}static getWindow(){return c.isBrowser()?window:null}static getDocument(){return c.isBrowser()?document:null}static _getShim(){return u}static _resetShim(){u=null,x=null,f=null}}let b=class t{static isObject(t){return t&&"object"==typeof t&&!Array.isArray(t)}static is(t,e){return Object.prototype.toString.call(e)==="[object "+t+"]"}static isSafari(){return c.isBrowser()&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}static extend(t,e){const s=Object.assign({},t);return this.isObject(t)&&this.isObject(e)&&Object.keys(e).forEach(i=>{this.isObject(e[i])?i in t?s[i]=this.extend(t[i],e[i]):Object.assign(s,{[i]:e[i]}):Object.assign(s,{[i]:e[i]})}),s}static extendArray(e,s){const i=[];return e.map(e=>{i.push(t.extend(s,e))}),e=i}static monthMod(t){return t%12}static clone(t,e=new WeakMap,s=!1){if(null===t||"object"!=typeof t)return t;if(e.has(t))return e.get(t);let i;if(Array.isArray(t))if(s)i=t.slice();else{i=[],e.set(t,i);for(let s=0;s<t.length;s++)i[s]=this.clone(t[s],e,!1)}else if(t instanceof Date)i=new Date(t.getTime());else if(s)i=Object.assign({},t);else{i={},e.set(t,i);for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=this.clone(t[s],e,!1))}return i}static shallowClone(t){return null===t||"object"!=typeof t?t:Array.isArray(t)?t.slice():Object.assign({},t)}static shallowEqual(t,e){if(t===e)return!0;if(!t||!e)return!1;if("object"!=typeof t||"object"!=typeof e)return t===e;const s=Object.keys(t),i=Object.keys(e);if(s.length!==i.length)return!1;for(const i of s)if(t[i]!==e[i])return!1;return!0}static log10(t){return Math.log(t)/Math.LN10}static roundToBase10(t){return Math.pow(10,Math.floor(Math.log10(t)))}static roundToBase(t,e){return Math.pow(e,Math.floor(Math.log(t)/Math.log(e)))}static parseNumber(t){return"number"==typeof t||null===t?t:parseFloat(t)}static stripNumber(t,e=2){return Number.isInteger(t)?t:parseFloat(t.toPrecision(e))}static randomId(){return(Math.random()+1).toString(36).substring(4)}static noExponents(t){return t.toString().includes("e")?Math.round(t):t}static elementExists(t){return!(!t||!t.isConnected)}static isInShadowDOM(e){if(!e||!e.getRootNode)return!1;const s=e.getRootNode();return s&&s!==document&&t.is("ShadowRoot",s)}static getShadowRootHost(e){if(!t.isInShadowDOM(e))return null;return e.getRootNode().host||null}static getDimensions(t){if(!t)return[0,0];if(c.isSSR())return[t._ssrWidth||400,t._ssrHeight||300];let e;try{e=getComputedStyle(t,null)}catch(e){return[t.clientWidth||0,t.clientHeight||0]}let s=t.clientWidth,i=t.clientHeight;if(!s||!i){const e=t.getBoundingClientRect();s=s||e.width,i=i||e.height}return i-=parseFloat(e.paddingTop)+parseFloat(e.paddingBottom),s-=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight),[s,i]}static getBoundingClientRect(t){if(!t)return{top:0,right:0,bottom:0,left:0,width:0,height:0,x:0,y:0};if(c.isSSR())return m.getBoundingClientRect(t);const e=t.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:t.clientWidth,height:t.clientHeight,x:e.left,y:e.top}}static getLargestStringFromArr(t){return t.reduce((t,e)=>(Array.isArray(e)&&(e=e.reduce((t,e)=>t.length>e.length?t:e)),t.length>e.length?t:e),0)}static hexToRgba(t="#999999",e=.6){"#"!==t.substring(0,1)&&(t="#999999");const s=t.replace("#",""),i=s.match(new RegExp("(.{"+s.length/3+"})","g"))||[];for(let t=0;t<i.length;t++)i[t]=parseInt(1===i[t].length?i[t]+i[t]:i[t],16);return void 0!==e&&i.push(e),"rgba("+i.join(",")+")"}static getOpacityFromRGBA(t){return parseFloat(t.replace(/^.*,(.+)\)/,"$1"))}static parseHex(t){if("string"!=typeof t)return null;let e=t.trim().replace("#","");return 3===e.length&&(e=e.split("").map(t=>t+t).join("")),/^[0-9a-fA-F]{6}$/.test(e)?[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]:null}static relativeLuminance([t,e,s]){const i=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)};return.2126*i(t)+.7152*i(e)+.0722*i(s)}static getContrastRatio(e,s){const i=t.parseHex(e),a=t.parseHex(s);if(!i||!a)return 0;const r=t.relativeLuminance(i),o=t.relativeLuminance(a);return(Math.max(r,o)+.05)/(Math.min(r,o)+.05)}static rgb2hex(t){return(t=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===t.length?"#"+("0"+parseInt(t[1],10).toString(16)).slice(-2)+("0"+parseInt(t[2],10).toString(16)).slice(-2)+("0"+parseInt(t[3],10).toString(16)).slice(-2):""}shadeRGBColor(t,e){const s=e.split(","),i=t<0?0:255,a=t<0?-1*t:t,r=parseInt(s[0].slice(4),10),o=parseInt(s[1],10),n=parseInt(s[2],10);return"rgb("+(Math.round((i-r)*a)+r)+","+(Math.round((i-o)*a)+o)+","+(Math.round((i-n)*a)+n)+")"}shadeHexColor(t,e){const s=parseInt(e.slice(1),16),i=t<0?0:255,a=t<0?-1*t:t,r=s>>16,o=s>>8&255,n=255&s;return"#"+(16777216+65536*(Math.round((i-r)*a)+r)+256*(Math.round((i-o)*a)+o)+(Math.round((i-n)*a)+n)).toString(16).slice(1)}shadeColor(e,s){return t.isColorHex(s)?this.shadeHexColor(e,s):this.shadeRGBColor(e,s)}static isColorHex(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(t)}static isCSSVariable(t){if("string"!=typeof t)return!1;const e=t.trim();return e.startsWith("var(")&&e.endsWith(")")}static getThemeColor(e){if(!t.isCSSVariable(e))return e;if(c.isSSR())return e;const s=document.createElement("div");let i;s.style.cssText="position:fixed; left: -9999px; visibility:hidden;",s.style.color=e,document.body.appendChild(s);try{i=window.getComputedStyle(s).color}finally{s.parentNode&&s.parentNode.removeChild(s)}return i}static applyOpacityToColor(t,e){const s=Number(e);if(!Number.isFinite(s))return t;if(s<=0)return"transparent";if(s>=1)return t;return`color-mix(in srgb, ${t} ${Math.round(100*s)}%, transparent)`}static getPolygonPos(t,e){const s=[],i=2*Math.PI/e;for(let a=0;a<e;a++){const e={};e.x=t*Math.sin(a*i),e.y=-t*Math.cos(a*i),s.push(e)}return s}static polarToCartesian(t,e,s,i){const a=(i-90)*Math.PI/180;return{x:t+s*Math.cos(a),y:e+s*Math.sin(a)}}static escapeString(t,e="x"){let s=t.toString().slice();return s=s.replace(/[` ~!@#$%^&*()|+=?;:'",.<>{}[\]\\/]/gi,e),s}static negToZero(t){return t<0?0:t}static moveIndexInArray(t,e,s){if(s>=t.length){let e=s-t.length+1;for(;e--;)t.push(void 0)}return t.splice(s,0,t.splice(e,1)[0]),t}static extractNumber(t){return parseFloat(t.replace(/[^\d.]*/g,""))}static findAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}static setELstyles(t,e){for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t.style.key=e[s])}static preciseAddition(t,e){const s=(String(t).split(".")[1]||"").length,i=(String(e).split(".")[1]||"").length,a=Math.pow(10,Math.max(s,i));return(Math.round(t*a)+Math.round(e*a))/a}static isNumber(t){return!isNaN(t)&&parseFloat(String(Number(t)))===t&&!isNaN(parseInt(t,10))}static isFloat(t){return Number(t)===t&&t%1!=0}static isMsEdge(){if(c.isSSR())return!1;const t=window.navigator.userAgent,e=t.indexOf("Edge/");return e>0&&parseInt(t.substring(e+5,t.indexOf(".",e)),10)}static getGCD(t,e,s=7){let i=Math.pow(10,s-Math.floor(Math.log10(Math.max(t,e))));for(i>1?(t=Math.round(Math.abs(t)*i),e=Math.round(Math.abs(e)*i)):i=1;e;){const s=e;e=t%e,t=s}return t/i}static getPrimeFactors(t){const e=[];let s=2;for(;t>=2;)t%s==0?(e.push(s),t/=s):s++;return e}static mod(t,e,s=7){const i=Math.pow(10,s-Math.floor(Math.log10(Math.max(t,e))));return(t=Math.round(Math.abs(t)*i))%(e=Math.round(Math.abs(e)*i))/i}};class y{constructor(t){this.w=t,this.months31=[1,3,5,7,8,10,12],this.months30=[2,4,6,9,11],this.daysCntOfYear=[0,31,59,90,120,151,181,212,243,273,304,334]}isValidDate(t){return"number"!=typeof t&&!isNaN(this.parseDate(t))}getTimeStamp(t){if(!Date.parse(t))return t;return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toISOString().substr(0,25)).getTime():new Date(t).getTime()}getDate(t){return this.w.config.xaxis.labels.datetimeUTC?new Date(new Date(t).toUTCString()):new Date(t)}parseDate(t){const e=Date.parse(t);if(!isNaN(e))return this.getTimeStamp(t);let s=Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "));return s=this.getTimeStamp(s),s}parseDateWithTimezone(t){return Date.parse(t.replace(/-/g,"/").replace(/[a-z]+/gi," "))}formatDate(t,e){const s=this.w.globals.locale,i=this.w.config.xaxis.labels.datetimeUTC,a=["\0",...s.months],r=["\x01",...s.shortMonths],o=["\x02",...s.days],n=["\x03",...s.shortDays];function l(t,e=2){let s=t+"";for(;s.length<e;)s="0"+s;return s}const h=i?t.getUTCFullYear():t.getFullYear();e=(e=(e=e.replace(/(^|[^\\])yyyy+/g,"$1"+h)).replace(/(^|[^\\])yy/g,"$1"+h.toString().substr(2,2))).replace(/(^|[^\\])y/g,"$1"+h);const c=(i?t.getUTCMonth():t.getMonth())+1;e=(e=(e=(e=e.replace(/(^|[^\\])MMMM+/g,"$1"+a[0])).replace(/(^|[^\\])MMM/g,"$1"+r[0])).replace(/(^|[^\\])MM/g,"$1"+l(c))).replace(/(^|[^\\])M/g,"$1"+c);const d=i?t.getUTCDate():t.getDate();e=(e=(e=(e=e.replace(/(^|[^\\])dddd+/g,"$1"+o[0])).replace(/(^|[^\\])ddd/g,"$1"+n[0])).replace(/(^|[^\\])dd/g,"$1"+l(d))).replace(/(^|[^\\])d/g,"$1"+d);const g=i?t.getUTCHours():t.getHours(),p=g>12?g-12:0===g?12:g;e=(e=(e=(e=e.replace(/(^|[^\\])HH+/g,"$1"+l(g))).replace(/(^|[^\\])H/g,"$1"+g)).replace(/(^|[^\\])hh+/g,"$1"+l(p))).replace(/(^|[^\\])h/g,"$1"+p);const u=i?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\])mm+/g,"$1"+l(u))).replace(/(^|[^\\])m/g,"$1"+u);const x=i?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\])ss+/g,"$1"+l(x))).replace(/(^|[^\\])s/g,"$1"+x);let f=i?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+l(f,3)),f=Math.round(f/10),e=e.replace(/(^|[^\\])ff/g,"$1"+l(f)),f=Math.round(f/10);const m=g<12?"AM":"PM";e=(e=(e=e.replace(/(^|[^\\])f/g,"$1"+f)).replace(/(^|[^\\])TT+/g,"$1"+m)).replace(/(^|[^\\])T/g,"$1"+m.charAt(0));const b=m.toLowerCase();e=(e=e.replace(/(^|[^\\])tt+/g,"$1"+b)).replace(/(^|[^\\])t/g,"$1"+b.charAt(0));let y=-t.getTimezoneOffset(),w=i||!y?"Z":y>0?"+":"-";if(!i){y=Math.abs(y);const t=y%60;w+=l(Math.floor(y/60))+":"+l(t)}e=e.replace(/(^|[^\\])K/g,"$1"+w);const v=(i?t.getUTCDay():t.getDay())+1;return e=(e=(e=(e=(e=e.replace(new RegExp(o[0],"g"),o[v])).replace(new RegExp(n[0],"g"),n[v])).replace(new RegExp(a[0],"g"),a[c])).replace(new RegExp(r[0],"g"),r[c])).replace(/\\(.)/g,"$1")}getTimeUnitsfromTimestamp(t,e){const s=this.w;void 0!==s.config.xaxis.min&&(t=s.config.xaxis.min),void 0!==s.config.xaxis.max&&(e=s.config.xaxis.max);const i=this.getDate(t),a=this.getDate(e),r=this.formatDate(i,"yyyy MM dd HH mm ss fff").split(" "),o=this.formatDate(a,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(r[6],10),maxMillisecond:parseInt(o[6],10),minSecond:parseInt(r[5],10),maxSecond:parseInt(o[5],10),minMinute:parseInt(r[4],10),maxMinute:parseInt(o[4],10),minHour:parseInt(r[3],10),maxHour:parseInt(o[3],10),minDate:parseInt(r[2],10),maxDate:parseInt(o[2],10),minMonth:parseInt(r[1],10)-1,maxMonth:parseInt(o[1],10)-1,minYear:parseInt(r[0],10),maxYear:parseInt(o[0],10)}}isLeapYear(t){return t%4==0&&t%100!=0||t%400==0}calculcateLastDaysOfMonth(t,e,s){return this.determineDaysOfMonths(t,e)-s}determineDaysOfYear(t){let e=365;return this.isLeapYear(t)&&(e=366),e}determineRemainingDaysOfYear(t,e,s){let i=this.daysCntOfYear[e]+s;return e>1&&this.isLeapYear(t)&&i++,i}determineDaysOfMonths(t,e){let s=30;switch(t=b.monthMod(t),!0){case this.months30.indexOf(t)>-1:2===t&&(s=this.isLeapYear(e)?29:28);break;case this.months31.indexOf(t)>-1:default:s=31}return s}getDateFields(t,e){const s=new Date(t);return e?{year:s.getUTCFullYear(),month:s.getUTCMonth(),date:s.getUTCDate(),hour:s.getUTCHours(),minute:s.getUTCMinutes(),second:s.getUTCSeconds(),ms:s.getUTCMilliseconds(),weekday:s.getUTCDay()}:{year:s.getFullYear(),month:s.getMonth(),date:s.getDate(),hour:s.getHours(),minute:s.getMinutes(),second:s.getSeconds(),ms:s.getMilliseconds(),weekday:s.getDay()}}addInterval(t,e,s,i){const a=new Date(t);if(i)switch(e){case"year":a.setUTCFullYear(a.getUTCFullYear()+s);break;case"month":a.setUTCMonth(a.getUTCMonth()+s);break;case"week":a.setUTCDate(a.getUTCDate()+7*s);break;case"day":a.setUTCDate(a.getUTCDate()+s);break;case"hour":a.setUTCHours(a.getUTCHours()+s);break;case"minute":a.setUTCMinutes(a.getUTCMinutes()+s);break;case"second":a.setUTCSeconds(a.getUTCSeconds()+s)}else switch(e){case"year":a.setFullYear(a.getFullYear()+s);break;case"month":a.setMonth(a.getMonth()+s);break;case"week":a.setDate(a.getDate()+7*s);break;case"day":a.setDate(a.getDate()+s);break;case"hour":a.setHours(a.getHours()+s);break;case"minute":a.setMinutes(a.getMinutes()+s);break;case"second":a.setSeconds(a.getSeconds()+s)}return a.getTime()}ceilToBoundary(t,e,s,i){const a=new Date(t);if(i)switch(e){case"second":{const e=a.getUTCSeconds(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(i),a.getTime())}case"minute":{const e=a.getUTCMinutes(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(i),a.getTime())}case"hour":{const e=a.getUTCHours(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(i),a.getTime())}case"day":return 0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0),a.setUTCDate(a.getUTCDate()+1),a.getTime());case"week":{const e=6048e5,i=Date.UTC(1970,0,5);a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0);const r=a.getTime(),o=Math.ceil((r-i)/e),n=i+Math.ceil(o/s)*s*e;return n>=t?n:n+s*e}case"month":{const e=a.getUTCMonth(),i=Math.ceil(e/s)*s;return i===e&&1===a.getUTCDate()&&0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:(a.setUTCMilliseconds(0),a.setUTCSeconds(0),a.setUTCMinutes(0),a.setUTCHours(0),a.setUTCDate(1),a.setUTCMonth(i),a.getTime())}case"year":{const e=a.getUTCFullYear(),i=Math.ceil(e/s)*s;return i===e&&0===a.getUTCMonth()&&1===a.getUTCDate()&&0===a.getUTCHours()&&0===a.getUTCMinutes()&&0===a.getUTCSeconds()&&0===a.getUTCMilliseconds()?t:Date.UTC(i,0,1)}}else switch(e){case"second":{const e=a.getSeconds(),i=Math.ceil(e/s)*s;return i===e&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(i),a.getTime())}case"minute":{const e=a.getMinutes(),i=Math.ceil(e/s)*s;return i===e&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(i),a.getTime())}case"hour":{const e=a.getHours(),i=Math.ceil(e/s)*s;return i===e&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(i),a.getTime())}case"day":return 0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0),a.setDate(a.getDate()+1),a.getTime());case"week":{const e=6048e5,i=new Date(1970,0,5).getTime();a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0);const r=a.getTime(),o=Math.ceil((r-i)/e),n=i+Math.ceil(o/s)*s*e;return n>=t?n:n+s*e}case"month":{const e=a.getMonth(),i=Math.ceil(e/s)*s;return i===e&&1===a.getDate()&&0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:(a.setMilliseconds(0),a.setSeconds(0),a.setMinutes(0),a.setHours(0),a.setDate(1),a.setMonth(i),a.getTime())}case"year":{const e=a.getFullYear(),i=Math.ceil(e/s)*s;return i===e&&0===a.getMonth()&&1===a.getDate()&&0===a.getHours()&&0===a.getMinutes()&&0===a.getSeconds()&&0===a.getMilliseconds()?t:new Date(i,0,1).getTime()}}return t}isAtBoundary(t,e,s){const i=this.getDateFields(t,s);switch(e){case"year":return 0===i.month&&1===i.date&&0===i.hour&&0===i.minute&&0===i.second&&0===i.ms;case"month":return 1===i.date&&0===i.hour&&0===i.minute&&0===i.second&&0===i.ms;case"day":return 0===i.hour&&0===i.minute&&0===i.second&&0===i.ms;case"hour":return 0===i.minute&&0===i.second&&0===i.ms;case"minute":return 0===i.second&&0===i.ms;case"second":return 0===i.ms}return!1}}class w{constructor(t){this.w=t,this.tooltipKeyFormat="dd MMM"}xLabelFormat(t,e,s,i){const a=this.w;if("datetime"===a.config.xaxis.type&&void 0===a.config.xaxis.labels.formatter&&void 0===a.config.tooltip.x.formatter){const t=new y(this.w);return t.formatDate(t.getDate(e),a.config.tooltip.x.format)}return t(e,s,i)}defaultGeneralFormatter(t){return Array.isArray(t)?t.map(t=>t):t}defaultYFormatter(t,e){const s=this.w;if(b.isNumber(t))if(0!==s.globals.yValueDecimal)t=t.toFixed(void 0!==e.decimalsInFloat?e.decimalsInFloat:s.globals.yValueDecimal);else{const e=t.toFixed(0);t=Number(e)===t?e:t.toFixed(1)}return t}setLabelFormatters(){const t=this.w,e=t.formatters;return e.xaxisTooltipFormatter=t=>this.defaultGeneralFormatter(t),e.ttKeyFormatter=t=>this.defaultGeneralFormatter(t),e.ttZFormatter=t=>t,e.legendFormatter=t=>this.defaultGeneralFormatter(t),void 0!==t.config.xaxis.labels.formatter?e.xLabelFormatter=t.config.xaxis.labels.formatter:e.xLabelFormatter=e=>{if(b.isNumber(e)){if(!t.config.xaxis.convertedCatToNumeric&&"numeric"===t.config.xaxis.type){if(b.isNumber(t.config.xaxis.decimalsInFloat))return e.toFixed(t.config.xaxis.decimalsInFloat);{const s=t.globals.maxX-t.globals.minX;if(s>0){const t=s/10,i=Math.max(0,-Math.floor(Math.log10(t)));return e.toFixed(i)}return e.toFixed(0)}}if(t.globals.isBarHorizontal){if(t.globals.maxY-t.globals.minYArr<4)return e.toFixed(1)}return e.toFixed(0)}return e},"function"==typeof t.config.tooltip.x.formatter?e.ttKeyFormatter=t.config.tooltip.x.formatter:e.ttKeyFormatter=e.xLabelFormatter,"function"==typeof t.config.xaxis.tooltip.formatter&&(e.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||void 0!==t.config.tooltip.y.formatter)&&(e.ttVal=t.config.tooltip.y),void 0!==t.config.tooltip.z.formatter&&(e.ttZFormatter=t.config.tooltip.z.formatter),void 0!==t.config.legend.formatter&&(e.legendFormatter=t.config.legend.formatter),e.yLabelFormatters=[],t.config.yaxis.forEach((s,i)=>{if(void 0!==s.labels.formatter)e.yLabelFormatters[i]=s.labels.formatter;else if("violin"===t.config.chart.type){const s=t=>"number"==typeof t&&isFinite(t)?""+Math.round(100*t)/100:t;e.yLabelFormatters[i]=e=>t.globals.xyCharts?Array.isArray(e)?e.map(s):s(e):e}else e.yLabelFormatters[i]=e=>t.globals.xyCharts?Array.isArray(e)?e.map(t=>this.defaultYFormatter(t,s)):this.defaultYFormatter(e,s):e}),t.globals}heatmapLabelFormatters(){const t=this.w;if("heatmap"===t.config.chart.type){t.globals.yAxisScale[0].result=t.seriesData.seriesNames.slice();const e=t.seriesData.seriesNames.reduce((t,e)=>t.length>e.length?t:e,0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}}const v=({isTimeline:t,seriesIndex:e,dataPointIndex:s,y1:i,y2:a,w:r})=>{var o;let n=r.rangeData.seriesRangeStart[e][s],l=r.rangeData.seriesRangeEnd[e][s],h=r.labelData.labels[s],c=r.config.series[e].name?r.config.series[e].name:"";const d=r.formatters.ttKeyFormatter,g=r.config.tooltip.y.title.formatter,p={w:r,seriesIndex:e,dataPointIndex:s,start:n,end:l};if("function"==typeof g&&(c=g(c,p)),(null==(o=r.config.series[e].data[s])?void 0:o.x)&&(h=r.config.series[e].data[s].x),!t&&"datetime"===r.config.xaxis.type){h=new w(r).xLabelFormat(r.formatters.ttKeyFormatter,h,h,{i:void 0,dateFormatter:new y(r).formatDate,w:r})}"function"==typeof d&&(h=d(h,p)),Number.isFinite(i)&&Number.isFinite(a)&&(n=i,l=a);let u="",x="";const f=r.globals.colors[e];if(void 0===r.config.tooltip.x.formatter)if("datetime"===r.config.xaxis.type){const t=new y(r);u=t.formatDate(t.getDate(n),r.config.tooltip.x.format),x=t.formatDate(t.getDate(l),r.config.tooltip.x.format)}else u=n,x=l;else u=r.config.tooltip.x.formatter(n),x=r.config.tooltip.x.formatter(l);return{start:n,end:l,startVal:u,endVal:x,ylabel:h,color:f,seriesName:c}},A=t=>{let{color:e,seriesName:s,ylabel:i,start:a,end:r,seriesIndex:o,dataPointIndex:n}=t;const l=t.w.globals.tooltip.tooltipLabels.getFormatters(o);a=l.yLbFormatter(a),r=l.yLbFormatter(r);const h=l.yLbFormatter(t.w.seriesData.series[o][n]);let c="";const d=`<span class="value start-value">\n ${a}\n </span> <span class="separator">-</span> <span class="value end-value">\n ${r}\n </span>`;return c=t.w.globals.comboCharts?"rangeArea"===t.w.config.series[o].type||"rangeBar"===t.w.config.series[o].type?d:`<span>${h}</span>`:d,'<div class="apexcharts-tooltip-rangebar"><div> <span class="series-name" style="color: '+e+'">'+(s||"")+'</span></div><div> <span class="category">'+i+": </span> "+c+" </div></div>"};class C{constructor(t){this.opts=t}hideYAxis(){this.opts.yaxis[0].show=!1,this.opts.yaxis[0].title.text="",this.opts.yaxis[0].axisBorder.show=!1,this.opts.yaxis[0].axisTicks.show=!1,this.opts.yaxis[0].floating=!0}line(){return{dataLabels:{enabled:!1},stroke:{width:5,curve:"straight"},markers:{size:0,hover:{sizeOffset:6}},xaxis:{crosshairs:{width:1}}}}sparkline(t){this.hideYAxis();return b.extend(t,{grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},legend:{show:!1},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}},chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1}})}slope(){return this.hideYAxis(),{chart:{toolbar:{show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!0,formatter(t,e){const s=e.w.config.series[e.seriesIndex].name;return null!==t?s+": "+t:""},background:{enabled:!1},offsetX:-5},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{position:"top",labels:{style:{fontSize:14,fontWeight:900}},tooltip:{enabled:!1},crosshairs:{show:!1}},markers:{size:8,hover:{sizeOffset:1}},legend:{show:!1},tooltip:{shared:!1,intersect:!0,followCursor:!0},stroke:{width:5,curve:"straight"}}}bar(){return{chart:{stacked:!1},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{style:{colors:["#fff"]},background:{enabled:!1}},stroke:{width:0,lineCap:"square"},fill:{opacity:.85},legend:{markers:{shape:"square"}},tooltip:{shared:!1,intersect:!0},xaxis:{tooltip:{enabled:!1},tickPlacement:"between",crosshairs:{width:"barWidth",position:"back",fill:{type:"gradient"},dropShadow:{enabled:!1},stroke:{width:0}}}}}funnel(){return this.hideYAxis(),l(n({},this.bar()),{chart:{animations:{speed:800,animateGradually:{enabled:!1}}},plotOptions:{bar:{horizontal:!0,borderRadiusApplication:"around",borderRadius:0,dataLabels:{position:"center"}}},grid:{show:!1,padding:{left:0,right:0}},xaxis:{labels:{show:!1},tooltip:{enabled:!1},axisBorder:{show:!1},axisTicks:{show:!1}}})}pyramid(){return this.funnel()}gauge(){const t=this.radialBar();return l(n({},t),{plotOptions:{radialBar:{startAngle:-135,endAngle:135,hollow:{margin:0,size:"60%"},track:{background:"#e7e7e7",strokeWidth:"100%",margin:5},dataLabels:{name:{show:!1},value:{show:!0,fontSize:"32px",fontWeight:600,offsetY:8}}}}})}candlestick(){return{stroke:{width:1},fill:{opacity:1},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getBoxTooltip(s,t,e,["Open","High","","Low","Close"],"candlestick")},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}boxPlot(){return{chart:{animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getBoxTooltip(s,t,e,["Minimum","Q1","Median","Q3","Maximum"],"boxPlot")},markers:{size:7,strokeWidth:1,strokeColors:"#111"},xaxis:{crosshairs:{width:1}}}}violin(){return{chart:{zoom:{enabled:!1},animations:{dynamicAnimation:{enabled:!1}}},stroke:{width:1,colors:["#24292e"]},fill:{opacity:.7},dataLabels:{enabled:!1},tooltip:{shared:!0,custom:({seriesIndex:t,dataPointIndex:e,w:s})=>this._getViolinTooltip(s,t,e)},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}rangeBar(){return{chart:{animations:{animateGradually:!1}},stroke:{width:0,lineCap:"square"},plotOptions:{bar:{borderRadius:0,dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter(t,{seriesIndex:e,dataPointIndex:s,w:i}){const a=()=>{const t=i.rangeData.seriesRangeStart[e][s];return i.rangeData.seriesRangeEnd[e][s]-t};return i.globals.comboCharts?"rangeBar"===i.config.series[e].type||"rangeArea"===i.config.series[e].type?a():t:a()},background:{enabled:!1},style:{colors:["#fff"]}},markers:{size:10},tooltip:{shared:!1,followCursor:!0,custom:t=>t.w.config.plotOptions&&t.w.config.plotOptions.bar&&t.w.config.plotOptions.bar.horizontal?(t=>{const{color:e,seriesName:s,ylabel:i,startVal:a,endVal:r}=v(l(n({},t),{isTimeline:!0}));return A(l(n({},t),{color:e,seriesName:s,ylabel:i,start:a,end:r}))})(t):(t=>{const{color:e,seriesName:s,ylabel:i,start:a,end:r}=v(t);return A(l(n({},t),{color:e,seriesName:s,ylabel:i,start:a,end:r}))})(t)},xaxis:{tickPlacement:"between",tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}dumbbell(t){var e,s;return(null==(e=t.plotOptions.bar)?void 0:e.barHeight)||(t.plotOptions.bar.barHeight=2),(null==(s=t.plotOptions.bar)?void 0:s.columnWidth)||(t.plotOptions.bar.columnWidth=2),t}area(){return{stroke:{width:4,fill:{type:"solid",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}}},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}rangeArea(){return{stroke:{curve:"straight",width:0},fill:{type:"solid",opacity:.6},markers:{size:0},states:{hover:{filter:{type:"none"}},active:{filter:{type:"none"}}},tooltip:{intersect:!1,shared:!0,followCursor:!0,custom:t=>(t=>{const{color:e,seriesName:s,ylabel:i,start:a,end:r}=v(t);return A(l(n({},t),{color:e,seriesName:s,ylabel:i,start:a,end:r}))})(t)}}}brush(t){return b.extend(t,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}stacked100(t){t.dataLabels=t.dataLabels||{},t.dataLabels.formatter=t.dataLabels.formatter||void 0;const e=t.dataLabels.formatter;t.yaxis.forEach((e,s)=>{t.yaxis[s].min=0,t.yaxis[s].max=100});return"bar"===t.chart.type&&(t.dataLabels.formatter=e||function(t){return"number"==typeof t&&t?t.toFixed(0)+"%":t}),t}stackedBars(){const t=this.bar();return l(n({},t),{plotOptions:l(n({},t.plotOptions),{bar:l(n({},t.plotOptions.bar),{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}convertCatToNumeric(t){return t.xaxis.convertedCatToNumeric=!0,t}convertCatToNumericXaxis(t,e){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return b.isNumber(t)?Math.floor(t):t};const s=t.xaxis.labels.formatter;let i=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return e&&e.length&&(i=e.map(t=>Array.isArray(t)?t:String(t))),i&&i.length&&(t.xaxis.labels.formatter=function(t){return b.isNumber(t)?s(i[Math.floor(t)-1]):s(t)}),t.xaxis.categories=[],t.labels=[],t.xaxis.tickAmount=t.xaxis.tickAmount||"dataPoints",t}bubble(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}scatter(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:1,hover:{sizeOffset:2}}}}heatmap(){return{chart:{stacked:!1},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square"}},grid:{padding:{right:20}}}}treemap(){return{chart:{zoom:{enabled:!1}},dataLabels:{style:{fontSize:14,fontWeight:600,colors:["#fff"]}},stroke:{show:!0,width:2,colors:["#fff"]},legend:{show:!1},fill:{opacity:1,gradient:{stops:[0,100]}},tooltip:{followCursor:!0,x:{show:!1}},grid:{padding:{left:0,right:0}},xaxis:{crosshairs:{show:!1},tooltip:{enabled:!1}}}}pie(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:t=>t.toFixed(1)+"%",style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",stops:[0,100]}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}donut(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:t=>t.toFixed(1)+"%",style:{colors:["#fff"]},background:{enabled:!1},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"light",shadeIntensity:.35,stops:[80,100],opacityFrom:1,opacityTo:1}},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}polarArea(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:t=>t.toFixed(1)+"%",enabled:!1},stroke:{show:!0,width:2},fill:{opacity:.7},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}radar(){return this.opts.yaxis[0].labels.offsetY=this.opts.yaxis[0].labels.offsetY?this.opts.yaxis[0].labels.offsetY:6,{dataLabels:{enabled:!1,style:{fontSize:"11px"}},stroke:{width:2},markers:{size:5,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!1,intersect:!0,followCursor:!0},grid:{show:!1,padding:{left:0,right:0,top:0,bottom:0}},xaxis:{labels:{formatter:t=>t,style:{colors:["#a8a8a8"],fontSize:"11px"}},tooltip:{enabled:!1},crosshairs:{show:!1}}}}radialBar(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},stroke:{lineCap:"butt"},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0},grid:{padding:{left:0,right:0,top:0,bottom:0}}}}_getBoxTooltip(t,e,s,i,a){const r=t.candleData.seriesCandleO[e][s],o=t.candleData.seriesCandleH[e][s],n=t.candleData.seriesCandleM[e][s],l=t.candleData.seriesCandleL[e][s],h=t.candleData.seriesCandleC[e][s],c=t.config.series[e];return c.type&&c.type!==a?`<div class="apexcharts-custom-tooltip">\n ${c.name?c.name:"series-"+(e+1)}: <strong>${t.seriesData.series[e][s]}</strong>\n </div>`:`<div class="apexcharts-tooltip-box apexcharts-tooltip-${t.config.chart.type}"><div>${i[0]}: <span class="value">`+r+`</span></div><div>${i[1]}: <span class="value">`+o+"</span></div>"+(n?`<div>${i[2]}: <span class="value">`+n+"</span></div>":"")+`<div>${i[3]}: <span class="value">`+l+`</span></div><div>${i[4]}: <span class="value">`+h+"</span></div></div>"}_getViolinTooltip(t,e,s){var i,a,r;const o=null==(i=t.violinData.seriesViolinMin[e])?void 0:i[s],n=null==(a=t.violinData.seriesViolinMax[e])?void 0:a[s],l=(null==(r=t.violinData.seriesViolinPoints[e])?void 0:r[s])||[],h=t.config.series[e].name||"series-"+(e+1);return`<div class="apexcharts-tooltip-box apexcharts-tooltip-${t.config.chart.type}"><div class="apexcharts-tooltip-violin-name">${h}</div><div>Min: <span class="value">${o}</span></div><div>Max: <span class="value">${n}</span></div><div>Observations: <span class="value">${l.length}</span></div></div>`}}const S={name:"en",options:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],toolbar:{exportToSVG:"Download SVG",exportToPNG:"Download PNG",exportToCSV:"Download CSV",menu:"Menu",selection:"Selection",selectionZoom:"Selection Zoom",zoomIn:"Zoom In",zoomOut:"Zoom Out",pan:"Panning",reset:"Reset Zoom",measure:"Measure"}}};class k{constructor(){this.yAxis={show:!0,showAlways:!1,showForNullSeries:!0,seriesName:void 0,opposite:!1,reversed:!1,logarithmic:!1,logBase:10,tickAmount:void 0,stepSize:void 0,forceNiceScale:!1,alignZero:!1,max:void 0,min:void 0,floating:!1,decimalsInFloat:void 0,labels:{show:!0,showDuplicates:!1,minWidth:0,maxWidth:160,offsetX:0,offsetY:0,align:void 0,rotate:0,padding:20,style:{colors:[],fontSize:"11px",fontWeight:400,fontFamily:void 0,cssClass:""},formatter:void 0},axisBorder:{show:!1,color:"#e0e0e0",width:1,offsetX:0,offsetY:0},axisTicks:{show:!1,color:"#e0e0e0",width:6,offsetX:0,offsetY:0},title:{text:void 0,rotate:-90,offsetY:0,offsetX:0,style:{color:void 0,fontSize:"11px",fontWeight:900,fontFamily:void 0,cssClass:""}},tooltip:{enabled:!1,offsetX:0},crosshairs:{show:!0,position:"front",stroke:{color:"#b6b6b6",width:1,dashArray:0}}},this.pointAnnotation={id:void 0,x:0,y:null,yAxisIndex:0,seriesIndex:void 0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,marker:{size:4,fillColor:"#fff",strokeWidth:2,strokeColor:"#333",shape:"circle",offsetX:0,offsetY:0,cssClass:""},label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}},customSVG:{SVG:void 0,cssClass:void 0,offsetX:0,offsetY:0},image:{path:void 0,width:20,height:20,offsetX:0,offsetY:0}},this.yAxisAnnotation={id:void 0,y:0,y2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,width:"100%",yAxisIndex:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"end",position:"right",offsetX:0,offsetY:-3,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.xAxisAnnotation={id:void 0,x:0,x2:null,strokeDashArray:1,fillColor:"#c2c2c2",borderColor:"#c2c2c2",borderWidth:1,opacity:.3,offsetX:0,offsetY:0,label:{borderColor:"#c2c2c2",borderWidth:1,borderRadius:2,text:void 0,textAnchor:"middle",orientation:"vertical",position:"top",offsetX:0,offsetY:0,mouseEnter:void 0,mouseLeave:void 0,click:void 0,style:{background:"#fff",color:void 0,fontSize:"11px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:5,right:5,top:2,bottom:2}}}},this.text={x:0,y:0,text:"",textAnchor:"start",foreColor:void 0,fontSize:"13px",fontFamily:void 0,fontWeight:400,appendTo:".apexcharts-annotations",backgroundColor:"transparent",borderColor:"#c2c2c2",borderRadius:0,borderWidth:0,paddingLeft:4,paddingRight:4,paddingTop:2,paddingBottom:2}}init(){return{annotations:{yaxis:[this.yAxisAnnotation],xaxis:[this.xAxisAnnotation],points:[this.pointAnnotation],texts:[],images:[],shapes:[]},plugins:[],chart:{animations:{enabled:!0,speed:800,easing:"easeInOutSine",animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350,easing:void 0},chartTypeMorph:{enabled:!0,speed:600},respectReducedMotion:!0,largeDatasetThreshold:1e3},background:"",locales:[S],defaultLocale:"en",perspectives:{serializeOptions:["theme","xaxis","yaxis","title","subtitle"]},history:{enabled:!1,maxDepth:100,coalesceMs:250,keyboard:!0},renderer:"svg",rendererThreshold:8e3,layers:{series:"auto",grid:"svg",annotations:"svg",dataLabels:"svg"},dropShadow:{enabled:!1,enabledOnSeries:void 0,top:2,left:2,blur:4,color:"#000",opacity:.7},events:{animationEnd:void 0,beforeMount:void 0,mounted:void 0,updated:void 0,click:void 0,mouseMove:void 0,mouseLeave:void 0,xAxisLabelClick:void 0,legendClick:void 0,markerClick:void 0,selection:void 0,dataPointSelection:void 0,dataPointMouseEnter:void 0,dataPointMouseLeave:void 0,beforeZoom:void 0,beforeResetZoom:void 0,zoomed:void 0,scrolled:void 0,brushScrolled:void 0,crossFilter:void 0,filterChange:void 0,annotationDragged:void 0,annotationEdited:void 0,annotationCreated:void 0,annotationStyled:void 0,annotationDeleted:void 0,measured:void 0,keyDown:void 0,keyUp:void 0},foreColor:"#373d3f",fontFamily:"Helvetica, Arial, sans-serif",height:"auto",parentHeightOffset:15,redrawOnParentResize:!0,redrawOnWindowResize:!0,id:void 0,group:void 0,nonce:void 0,offsetX:0,offsetY:0,injectStyleSheet:!0,selection:{enabled:!1,type:"x",fill:{color:"#24292e",opacity:.1},stroke:{width:1,color:"#24292e",opacity:.4,dashArray:3},xaxis:{min:void 0,max:void 0},yaxis:{min:void 0,max:void 0}},sparkline:{enabled:!1},brush:{enabled:!1,autoScaleYaxis:!0,target:void 0,targets:void 0},link:{enabled:!1,mode:"highlight",dimOpacity:.2,id:void 0,dimension:void 0,reduce:void 0,type:void 0,bins:void 0,order:void 0,seriesName:void 0},ink:{enabled:!1,palette:!1,snap:!1,noteColors:void 0},measure:{enabled:!1,mode:"span",key:"m",pinOnRelease:!0,colors:{up:void 0,down:void 0,neutral:void 0,guide:void 0},band:!0,guides:!0,markers:!0,format:{x:void 0,y:void 0,percent:void 0},label:void 0},contextMenu:{enabled:!1,items:["annotate","xline","yline","measure"],labels:{annotate:void 0,xline:void 0,yline:void 0,measure:void 0},noteText:"Note",line:{text:"",strokeDashArray:4,color:void 0}},stacked:!1,stackOnlyBar:!0,stackType:"normal",streaming:{enabled:!1,maxPoints:void 0},toolbar:{show:!0,offsetX:0,offsetY:0,tools:{download:!0,selection:!0,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0,measure:!0,customIcons:[]},export:{csv:{filename:void 0,columnDelimiter:",",headerCategory:"category",headerValue:"value",categoryFormatter:void 0,valueFormatter:void 0},png:{filename:void 0},svg:{filename:void 0},scale:void 0,width:void 0},autoSelected:"zoom"},type:"line",width:"100%",zoom:{enabled:!0,type:"x",autoScaleYaxis:!1,allowMouseWheelZoom:!0,pinch:!0,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}},pan:{inertia:!0,friction:.92},accessibility:{enabled:!0,description:void 0,announcements:{enabled:!0},keyboard:{enabled:!0,navigation:{enabled:!0,wrapAround:!1}}},dataReducer:{enabled:!1,algorithm:"lttb",targetPoints:250,threshold:500}},parsing:{x:void 0,y:void 0},plotOptions:{line:{isSlopeChart:!1,colors:{threshold:0,colorAboveThreshold:void 0,colorBelowThreshold:void 0}},area:{fillTo:"origin"},bar:{horizontal:!1,columnWidth:"70%",barHeight:"70%",distributed:!1,borderRadius:0,borderRadiusApplication:"around",borderRadiusWhenStacked:"last",rangeBarOverlap:!0,rangeBarGroupRows:!1,hideZeroBarsWhenGrouped:!1,isDumbbell:!1,dumbbellColors:void 0,isFunnel:!1,isFunnel3d:!0,colors:{ranges:[],backgroundBarColors:[],backgroundBarOpacity:1,backgroundBarRadius:0},dataLabels:{position:"top",maxItems:100,hideOverflowingLabels:!0,orientation:"horizontal",total:{enabled:!1,formatter:void 0,offsetX:0,offsetY:0,style:{color:"#373d3f",fontSize:"12px",fontFamily:void 0,fontWeight:600}}}},bubble:{zScaling:!0,minBubbleRadius:void 0,maxBubbleRadius:void 0},scatter:{jitter:{enabled:!1,x:0,y:0,distributed:!1,maxPoints:5e3}},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"},points:{show:!1,shape:"circle",size:2.5,jitter:.5,maxPoints:3e3,opacity:.9,fillColor:"series-dark",strokeColor:"#fff",strokeWidth:1}},violin:{bandwidthScale:1,normalize:"individual",points:{show:!0,shape:"circle",size:2.5,jitter:.5,constrainToViolin:!0,maxPoints:3e3,opacity:.9,fillColor:"series-dark",strokeColor:"#fff",strokeWidth:1}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0,gradientLegend:{enabled:!1,width:"70%",height:"70%",thickness:12,align:"center",stops:16,showLabels:!0,showHoverValue:!0,labelStyle:{fontSize:"11px",fontFamily:void 0,colors:void 0},arrow:{size:8,color:void 0},formatter:void 0}}},funnel:{shape:"rectangle",lastShape:"flat"},treemap:{enableShades:!0,shadeIntensity:.5,distributed:!1,reverseNegativeShade:!1,useFillColorAsStroke:!1,borderRadius:4,dataLabels:{format:"scale"},colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0},seriesTitle:{show:!0,offsetY:1,offsetX:1,borderColor:"#000",borderWidth:1,borderRadius:2,style:{background:"rgba(0, 0, 0, 0.6)",color:"#fff",fontSize:"12px",fontFamily:void 0,fontWeight:400,cssClass:"",padding:{left:6,right:6,top:2,bottom:2}}}},radialBar:{inverseOrder:!1,startAngle:0,endAngle:360,offsetX:0,offsetY:0,shape:"arc",min:0,max:100,bands:[],bandsStyle:{strokeWidth:"40%",gap:0,hideTrackWhenPresent:!0},ticks:{show:!1,major:{count:11,length:10,width:2,color:"#666",placement:"outside"},minor:{count:4,length:5,width:1,color:"#999",placement:"outside"},labels:{show:!1,offset:6,fontSize:"11px",fontFamily:void 0,fontWeight:400,color:"#666",formatter:t=>String(t)}},needle:{color:"#333",length:"85%",baseWidth:4,tipWidth:1,offsetY:0,showValueArc:!1,animation:{enabled:!0,duration:800,easing:"ease-out"}},hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",stroke:void 0,strokeWidth:1,strokeDasharray:void 0,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},track:{show:!0,startAngle:void 0,endAngle:void 0,background:"#f2f2f2",strokeWidth:"97%",opacity:1,margin:5,dropShadow:{enabled:!1,top:0,left:0,blur:3,color:"#000",opacity:.5}},dataLabels:{show:!0,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:0,formatter:t=>t},value:{show:!0,fontSize:"14px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:16,formatter:t=>t+"%"},total:{show:!1,label:"Total",fontSize:"16px",fontWeight:600,fontFamily:void 0,color:void 0,formatter:t=>t.globals.seriesTotals.reduce((t,e)=>t+e,0)/t.seriesData.series.length+"%"}},barLabels:{enabled:!1,offsetX:0,offsetY:0,useSeriesColors:!0,fontFamily:void 0,fontWeight:600,fontSize:"16px",formatter:t=>t,onClick:void 0}},pie:{customScale:1,offsetX:0,offsetY:0,startAngle:0,endAngle:360,expandOnClick:!0,dataLabels:{offset:0,minAngleToShowLabel:10,external:{show:!1,offsetX:0,offsetY:0,fontSize:void 0,fontFamily:void 0,fontWeight:void 0,color:void 0,formatter:void 0,connector:{show:!0,width:1,color:void 0,length:16,gap:6}}},donut:{size:"65%",background:"transparent",labels:{show:!1,name:{show:!0,fontSize:"16px",fontFamily:void 0,fontWeight:600,color:void 0,offsetY:-10,formatter:t=>t},value:{show:!0,fontSize:"20px",fontFamily:void 0,fontWeight:400,color:void 0,offsetY:10,formatter:t=>t},total:{show:!1,showAlways:!1,label:"Total",fontSize:"16px",fontWeight:400,fontFamily:void 0,color:void 0,formatter:t=>t.globals.seriesTotals.reduce((t,e)=>t+e,0)}}}},polarArea:{rings:{strokeWidth:1,strokeColor:"#e8e8e8"},spokes:{strokeWidth:1,connectorColors:"#e8e8e8"}},radar:{size:void 0,offsetX:0,offsetY:0,polygons:{strokeWidth:1,strokeColors:"#e8e8e8",connectorColors:"#e8e8e8",fill:{colors:void 0}}}},colors:void 0,dataLabels:{enabled:!0,enabledOnSeries:void 0,formatter:t=>null!==t?t:"",textAnchor:"middle",distributed:!1,offsetX:0,offsetY:0,style:{fontSize:"12px",fontFamily:void 0,fontWeight:600,colors:void 0},background:{enabled:!0,foreColor:"#fff",backgroundColor:void 0,borderRadius:2,padding:4,opacity:.9,borderWidth:1,borderColor:"#fff",dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},dropShadow:{enabled:!1,top:1,left:1,blur:1,color:"#000",opacity:.8}},fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]},image:{src:[],width:void 0,height:void 0},pattern:{style:"squares",width:6,height:6,strokeWidth:2}},forecastDataPoints:{count:0,fillOpacity:.5,strokeWidth:void 0,dashArray:4},grid:{show:!0,borderColor:"#e0e0e0",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}},row:{colors:void 0,opacity:.5},column:{colors:void 0,opacity:.5},padding:{top:0,right:10,bottom:0,left:12}},labels:[],drilldown:{enabled:!1,series:[],breadcrumb:{show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0},animation:{enabled:!0,zoomFromPoint:!1,speed:260}},legend:{show:!0,showForSingleSeries:!1,showForNullSeries:!0,showForZeroSeries:!0,floating:!1,position:"bottom",horizontalAlign:"center",inverseOrder:!1,fontSize:"12px",fontFamily:void 0,fontWeight:400,width:void 0,height:void 0,formatter:void 0,tooltipHoverFormatter:void 0,offsetX:-20,offsetY:4,customLegendItems:[],clusterGroupedSeries:!0,clusterGroupedSeriesOrientation:"vertical",labels:{colors:void 0,useSeriesColors:!1},markers:{size:7,fillColors:void 0,strokeWidth:1,shape:void 0,offsetX:0,offsetY:0,customHTML:void 0,onClick:void 0},itemMargin:{horizontal:5,vertical:4},onItemClick:{toggleDataSeries:!0},onItemHover:{highlightDataSeries:!0}},markers:{discrete:[],size:0,colors:void 0,strokeColors:"#fff",strokeWidth:2,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,shape:"circle",offsetX:0,offsetY:0,showNullDataPoints:!0,onClick:void 0,onDblClick:void 0,hover:{size:void 0,sizeOffset:3}},noData:{text:void 0,align:"center",offsetX:0,offsetY:0,style:{color:void 0,fontSize:"14px",fontFamily:void 0}},responsive:[],series:void 0,states:{hover:{filter:{type:"lighten"}},active:{allowMultipleDataPointsSelection:!1,filter:{type:"darken"}}},title:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:0,floating:!1,style:{fontSize:"14px",fontWeight:900,fontFamily:void 0,color:void 0}},subtitle:{text:void 0,align:"left",margin:5,offsetX:0,offsetY:30,floating:!1,style:{fontSize:"12px",fontWeight:400,fontFamily:void 0,color:void 0}},stroke:{show:!0,curve:"smooth",lineCap:"butt",width:2,colors:void 0,dashArray:0,fill:{type:"solid",colors:void 0,opacity:.85,gradient:{shade:"dark",type:"horizontal",shadeIntensity:.5,gradientToColors:void 0,inverseColors:!0,opacityFrom:1,opacityTo:1,stops:[0,50,100],colorStops:[]}}},tooltip:{enabled:!0,enabledOnSeries:void 0,shared:!0,hideEmptySeries:!1,followCursor:!1,intersect:!1,inverseOrder:!1,arrow:!0,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily:void 0,background:void 0},onDatasetHover:{highlightDataSeries:!1},x:{show:!0,format:"dd MMM",formatter:void 0},y:{formatter:void 0,title:{formatter:t=>t?t+": ":""}},z:{formatter:void 0,title:"Size: "},marker:{show:!0,fillColors:void 0},items:{display:"flex"},fixed:{enabled:!1,position:"topRight",offsetX:0,offsetY:0}},xaxis:{type:"category",categories:[],convertedCatToNumeric:!1,offsetX:0,offsetY:0,overwriteCategories:void 0,labels:{show:!0,rotate:-45,rotateAlways:!1,hideOverlappingLabels:!0,trim:!1,minHeight:void 0,maxHeight:120,showDuplicates:!0,style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""},offsetX:0,offsetY:0,format:void 0,formatter:void 0,datetimeUTC:!0,datetimeFormatter:{year:"yyyy",month:"MMM",day:"dd MMM",hour:"HH:mm",minute:"HH:mm",second:"HH:mm:ss"}},group:{groups:[],style:{colors:[],fontSize:"12px",fontWeight:400,fontFamily:void 0,cssClass:""}},axisBorder:{show:!0,color:"#e0e0e0",width:"100%",height:1,offsetX:0,offsetY:0},axisTicks:{show:!0,color:"#e0e0e0",height:6,offsetX:0,offsetY:0},stepSize:void 0,tickAmount:void 0,tickPlacement:"on",min:void 0,max:void 0,range:void 0,floating:!1,decimalsInFloat:void 0,position:"bottom",title:{text:void 0,offsetX:0,offsetY:0,style:{color:void 0,fontSize:"12px",fontWeight:900,fontFamily:void 0,cssClass:""}},crosshairs:{show:!0,width:1,position:"back",opacity:.9,stroke:{color:"#b6b6b6",width:1,dashArray:3},fill:{type:"solid",color:"#B1B9C4",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}},dropShadow:{enabled:!1,left:0,top:0,blur:1,opacity:.8}},tooltip:{enabled:!1,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",tokens:!0,follow:!1,name:"",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65},accessibility:{colorBlindMode:""}}}}}class _{constructor(t){this.opts=t}init({responsiveOverride:t}){var e,s,i,a,r,o,n,l,h,d;let g=this.opts;const p=new k,u=new C(g);g=this.normalizeAliasedChartType(g),this.chartType=g.chart.type,g=this.extendYAxis(g),g=this.extendAnnotations(g);let x=p.init(),f={};if(g&&"object"==typeof g){let p={};const m=["line","area","bar","candlestick","boxPlot","violin","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"],y=g.chart.requestedType;p="funnel"===y||"pyramid"===y?u[y]():"gauge"===y?u.gauge():-1!==m.indexOf(g.chart.type)?u[g.chart.type]():u.line(),(null==(s=null==(e=g.plotOptions)?void 0:e.bar)?void 0:s.isFunnel)&&(p=u.funnel()),g.chart.stacked&&"bar"===g.chart.type&&(p=u.stackedBars()),(null==(i=g.chart.brush)?void 0:i.enabled)&&(p=u.brush(p)),(null==(r=null==(a=g.plotOptions)?void 0:a.line)?void 0:r.isSlopeChart)&&(p=u.slope()),g.chart.stacked&&"100%"===g.chart.stackType&&(g=u.stacked100(g)),(null==(n=null==(o=g.plotOptions)?void 0:o.bar)?void 0:n.isDumbbell)&&(g=u.dumbbell(g)),this.checkForDarkTheme(c.getApex()),this.checkForDarkTheme(g),g.xaxis=g.xaxis||c.getApex().xaxis||{},t||(g.xaxis.convertedCatToNumeric=!1),g=this.checkForCatToNumericXAxis(this.chartType,p,g),((null==(l=g.chart.sparkline)?void 0:l.enabled)||(null==(d=null==(h=c.getApex().chart)?void 0:h.sparkline)?void 0:d.enabled))&&(p=u.sparkline(p)),f=b.extend(x,p)}const m=b.extend(f,c.getApex());return x=b.extend(m,g),x=this.handleUserInputErrors(x),x}normalizeAliasedChartType(t){if(!t||!t.chart)return t;const e=t.chart.type;return"funnel"!==e&&"pyramid"!==e&&"gauge"!==e||(t.chart.requestedType=e,"funnel"===e||"pyramid"===e?(t.plotOptions=t.plotOptions||{},t.plotOptions.bar=t.plotOptions.bar||{},t.plotOptions.bar.isFunnel=!0,t.plotOptions.bar.horizontal=!0,t.chart.type="bar",t.plotOptions.bar.isPyramid="pyramid"===e):"gauge"===e&&(t.chart.type="radialBar")),t}checkForCatToNumericXAxis(t,e,s){var i,a,r,o,n;const l=new C(s),h=("bar"===t||"boxPlot"===t||"violin"===t)&&(null==(a=null==(i=s.plotOptions)?void 0:i.bar)?void 0:a.horizontal),c="pie"===t||"polarArea"===t||"donut"===t||"radar"===t||"radialBar"===t||"heatmap"===t,d="datetime"!==s.xaxis.type&&"numeric"!==s.xaxis.type,g=("scatter"===t||"bubble"===t)&&(null==(n=null==(o=null==(r=s.plotOptions)?void 0:r.scatter)?void 0:o.jitter)?void 0:n.enabled),p=s.xaxis.tickPlacement?s.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return h||c||g||!d||"between"===p||(s=l.convertCatToNumeric(s)),s}extendYAxis(t,e){const s=new k;(void 0===t.yaxis||!t.yaxis||Array.isArray(t.yaxis)&&0===t.yaxis.length)&&(t.yaxis={});const i=c.getApex();t.yaxis.constructor!==Array&&i.yaxis&&i.yaxis.constructor!==Array&&(t.yaxis=b.extend(t.yaxis,i.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[b.extend(s.yAxis,t.yaxis)]:t.yaxis=b.extendArray(t.yaxis,s.yAxis);let a=!1;t.yaxis.forEach(t=>{t.logarithmic&&(a=!0)});let r=t.series;return e&&!r&&(r=e.config.series),a&&r.length!==t.yaxis.length&&r.length&&(t.yaxis=r.map((e,i)=>{if(e.name||(r[i].name=`series-${i+1}`),t.yaxis[i])return t.yaxis[i].seriesName=r[i].name,t.yaxis[i];{const e=b.extend(s.yAxis,t.yaxis[0]);return e.show=!1,e}})),a&&r.length>1&&(r.length,t.yaxis.length),t}extendAnnotations(t){return void 0===t.annotations&&(t.annotations={},t.annotations.yaxis=[],t.annotations.xaxis=[],t.annotations.points=[]),t=this.extendYAxisAnnotations(t),t=this.extendXAxisAnnotations(t),t=this.extendPointAnnotations(t)}extendYAxisAnnotations(t){const e=new k;return t.annotations.yaxis=b.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}extendXAxisAnnotations(t){const e=new k;return t.annotations.xaxis=b.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}extendPointAnnotations(t){const e=new k;return t.annotations.points=b.extendArray(void 0!==t.annotations.points?t.annotations.points:[],e.pointAnnotation),t}checkForDarkTheme(t){t.theme&&"dark"===t.theme.mode&&(t.tooltip||(t.tooltip={}),"light"!==t.tooltip.theme&&(t.tooltip.theme="dark"),t.chart.foreColor||(t.chart.foreColor="#f6f7f8"),t.theme.palette||(t.theme.palette="palette4"))}handleUserInputErrors(t){const e=t;if(e.tooltip.shared&&e.tooltip.intersect)throw new Error("tooltip.shared cannot be enabled when tooltip.intersect is true. Turn off any other option by setting it to false.");if("bar"===e.chart.type&&e.plotOptions.bar.horizontal){if(e.yaxis.length>1)throw new Error("Multiple Y Axis for bars are not supported. Switch to column chart by setting plotOptions.bar.horizontal=false");e.yaxis[0].reversed&&(e.yaxis[0].opposite=!0),e.xaxis.tooltip.enabled=!1,e.yaxis[0].tooltip.enabled=!1,e.chart.zoom.enabled=!1}return"bar"!==e.chart.type&&"rangeBar"!==e.chart.type||e.tooltip.shared&&"barWidth"===e.xaxis.crosshairs.width&&e.series.length>1&&(e.xaxis.crosshairs.width="tickWidth"),"candlestick"!==e.chart.type&&"boxPlot"!==e.chart.type||e.yaxis[0].reversed&&(e.yaxis[0].reversed=!1),e}}const L=[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],M=[1,2,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,12,12,12,12,12,12,12,12,12,24];class D{initGlobalVars(t){t.series=[],t.seriesCandleO=[],t.seriesCandleH=[],t.seriesCandleM=[],t.seriesCandleL=[],t.seriesCandleC=[],t.seriesRangeStart=[],t.seriesRangeEnd=[],t.seriesRange=[],t.seriesPercent=[],t.seriesGoals=[],t.seriesX=[],t.seriesZ=[],t.seriesNames=[],t.seriesTotals=[],t.seriesLog=[],t.seriesColors=[],t.stackedSeriesTotals=[],t.seriesXvalues=[],t.seriesYvalues=[],t.dataWasParsed=!1,t.originalSeries=null,t.maxValsInArrayIndex=0,t.yValueDecimal=0,t.allSeriesHasEqualX=!0,t.labels=[],t.hasXaxisGroups=!1,t.groups=[],t.barGroups=[],t.lineGroups=[],t.areaGroups=[],t.hasSeriesGroups=!1,t.seriesGroups=[],t.categoryLabels=[],t.timescaleLabels=[],t.noLabelsProvided=!1,t.isXNumeric=!1,t.skipLastTimelinelabel=!1,t.skipFirstTimelinelabel=!1,t.isDataXYZ=!1,t.isMultiLineX=!1,t.isMultipleYAxis=!1,t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE,t.minYArr=[],t.maxYArr=[],t.maxX=-Number.MAX_VALUE,t.minX=Number.MAX_VALUE,t.initialMaxX=-Number.MAX_VALUE,t.initialMinX=Number.MAX_VALUE,t.maxDate=0,t.minDate=Number.MAX_VALUE,t.minZ=Number.MAX_VALUE,t.maxZ=-Number.MAX_VALUE,t.minXDiff=Number.MAX_VALUE,t.yAxisScale=[],t.xAxisScale=null,t.xAxisTicksPositions=[],t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0,t.multiAxisTickAmount=0,t.disableZoomIn=!1,t.disableZoomOut=!1,t.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.rotateXLabels=!1,t.overlappingXLabels=!1,t.radialSize=0,t.barHeight=0,t.barWidth=0,t.animationEnded=!1,t.isDestroyed=!1,t.bulkRevealScheduled=!1,t.resizeTimer=null,t.selectionResizeTimer=null,t.lastWheelExecution=0,t.delayedElements=[],t.pointsArray=[],t.barCanvasCoords=null,t.activeRenderer=null,t.dataLabelsRects=[],t.lastDrawnDataLabelsIndexes=[],t.textRectsCache=new Map,t.domCache=new Map,t.dimensionCache={},t.cachedSelectors={},t.seriesNS||this._attachNamespaces(t)}_attachNamespaces(t){const e=(e,s,i=s)=>{Object.defineProperty(e,i,{get:()=>t[s],set(e){t[s]=e},enumerable:!0,configurable:!0})},s={};e(s,"series","data");for(const t of["seriesNames","seriesX","seriesZ","seriesXvalues","seriesYvalues","seriesGoals","seriesLog","seriesColors","seriesPercent","seriesTotals","stackedSeriesTotals","seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC","seriesRangeStart","seriesRangeEnd","seriesRange","seriesYAxisMap","seriesYAxisReverseMap","seriesGroups","barGroups","lineGroups","areaGroups","originalSeries","collapsedSeries","collapsedSeriesIndices","ancillaryCollapsedSeries","ancillaryCollapsedSeriesIndices","allSeriesCollapsed","risingSeries","previousPaths","ignoreYAxisIndexes","labels","categoryLabels","timescaleLabels","groups"])e(s,t);Object.defineProperty(t,"seriesNS",{value:s,writable:!1,enumerable:!1,configurable:!0});const i={};for(const t of["minX","maxX","initialMinX","initialMaxX","minY","maxY","minYArr","maxYArr","minZ","maxZ","minDate","maxDate","minXDiff","xRange","yRange","zRange","xAxisScale","yAxisScale","xAxisTicksPositions","xTickAmount","multiAxisTickAmount","dataPoints","maxValsInArrayIndex","isXNumeric","isMultipleYAxis","isMultiLineX","isDataXYZ","dataFormatXNumeric","allSeriesHasEqualX","hasNullValues","dataWasParsed","hasXaxisGroups","hasSeriesGroups","skipFirstTimelinelabel","skipLastTimelinelabel","yValueDecimal","invalidLogScale","noLabelsProvided"])e(i,t);Object.defineProperty(t,"axes",{value:i,writable:!1,enumerable:!1,configurable:!0});const a={};for(const t of["svgWidth","svgHeight","gridWidth","gridHeight","translateX","translateY","translateXAxisX","translateXAxisY","translateYAxisX","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yAxisLabelsWidth","yAxisWidths","yLabelsCoords","yTitleCoords","padHorizontal","barPadForNumericAxis","rotateXLabels","scaleX","scaleY","radialSize","defaultLabels","overlappingXLabels"])e(a,t);Object.defineProperty(t,"layout",{value:a,writable:!1,enumerable:!1,configurable:!0});const r={};for(const t of["domCache","dimensionCache","cachedSelectors","textRectsCache","pointsArray","dataLabelsRects","lastDrawnDataLabelsIndexes","delayedElements","resizeTimer","selectionResizeTimer","resizeObserver"])e(r,t);Object.defineProperty(t,"cache",{value:r,writable:!1,enumerable:!1,configurable:!0})}globalVars(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},LINE_HEIGHT_RATIO:1.618,axisCharts:!0,isSlopeChart:t.plotOptions.line.isSlopeChart,comboCharts:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],ignoreYAxisIndexes:[],isDirty:!1,isExecCalled:!1,dataChanged:!1,resized:!1,invalidLogScale:!1,hasNullValues:!1,columnSeries:null,yaxis:null,total:0,shouldAnimate:!0,previousPaths:[],prevStreamFrame:null,prevChromeFrame:null,svgWidth:0,svgHeight:0,defaultLabels:!1,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateYAxisX:[],yAxisWidths:[],tooltip:null,resizeObserver:null,locale:{},memory:{methodsToExec:[]},niceScaleAllowedMagMsd:L,niceScaleDefaultTicks:M,seriesYAxisMap:[],seriesYAxisReverseMap:[],noData:!1}}init(t){const e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=b.extend({},t),e.initialSeries=b.clone(t.series),e.lastXAxis=b.clone(e.initialConfig.xaxis),e.lastYAxis=b.clone(e.initialConfig.yaxis),e}}class E{constructor(t){this.opts=t}init(){const t=new _(this.opts).init({responsiveOverride:!1}),e=(new D).init(t),s={config:t,globals:e,dom:{},interact:{zoomEnabled:"zoom"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.zoom&&t.chart.zoom.enabled,panEnabled:"pan"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.pan,selectionEnabled:"selection"===t.chart.toolbar.autoSelected&&t.chart.toolbar.tools.selection,measureEnabled:"measure"===t.chart.toolbar.autoSelected&&!!t.chart.toolbar.tools.measure&&!(!t.chart.measure||!t.chart.measure.enabled),zoomed:!1,selection:void 0,visibleXRange:void 0,selectedDataPoints:[],mousedown:!1,clientX:null,clientY:null,lastClientPosition:{},lastWheelExecution:0,capturedSeriesIndex:-1,capturedDataPointIndex:-1,disableZoomIn:!1,disableZoomOut:!1,isTouchDevice:!!c.isBrowser()&&("ontouchstart"in window||navigator.maxTouchPoints>0)},formatters:{xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,legendFormatter:void 0},candleData:{seriesCandleO:[],seriesCandleH:[],seriesCandleM:[],seriesCandleL:[],seriesCandleC:[],seriesBoxPoints:[]},rangeData:{seriesRangeStart:[],seriesRangeEnd:[],seriesRange:[]},violinData:{seriesViolinDensity:[],seriesViolinPoints:[],seriesViolinMin:[],seriesViolinMax:[]},labelData:{labels:[],categoryLabels:[],timescaleLabels:[],hasXaxisGroups:!1,groups:[],seriesGroups:[]},axisFlags:{isXNumeric:!1,dataFormatXNumeric:!1,isDataXYZ:!1,isRangeData:!1,isRangeBar:!1,isMultiLineX:!1,noLabelsProvided:!1,dataWasParsed:!1},seriesData:{series:[],seriesNames:[],seriesX:[],seriesZ:[],seriesColors:[],seriesGoals:[],stackedSeriesTotals:[],stackedSeriesTotalsByGroups:[]},layout:{gridHeight:0,gridWidth:0,translateX:0,translateY:0,translateXAxisX:0,translateXAxisY:0,rotateXLabels:!1,xAxisHeight:0,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yLabelsCoords:[],yTitleCoords:[]}};Object.defineProperty(e,"dom",{get:()=>s.dom,set(t){s.dom=t},enumerable:!1,configurable:!0});for(const t of["xLabelFormatter","yLabelFormatters","xaxisTooltipFormatter","ttKeyFormatter","ttVal","ttZFormatter","legendFormatter"])Object.defineProperty(e,t,{get:()=>s.formatters[t],set(e){s.formatters[t]=e},enumerable:!1,configurable:!0});for(const t of["zoomEnabled","panEnabled","selectionEnabled","zoomed","selection","visibleXRange","selectedDataPoints","mousedown","clientX","clientY","lastClientPosition","lastWheelExecution","capturedSeriesIndex","capturedDataPointIndex","disableZoomIn","disableZoomOut","isTouchDevice"])Object.defineProperty(e,t,{get:()=>s.interact[t],set(e){s.interact[t]=e},enumerable:!1,configurable:!0});for(const t of["gridHeight","gridWidth","translateX","translateY","translateXAxisX","translateXAxisY","rotateXLabels","xAxisHeight","xAxisLabelsHeight","xAxisGroupLabelsHeight","xAxisLabelsWidth","yLabelsCoords","yTitleCoords"])Object.defineProperty(e,t,{get:()=>s.layout[t],set(e){s.layout[t]=e},enumerable:!1,configurable:!0});for(const t of["series","seriesNames","seriesX","seriesZ","seriesColors","seriesGoals","stackedSeriesTotals","stackedSeriesTotalsByGroups"])Object.defineProperty(e,t,{get:()=>s.seriesData[t],set(e){s.seriesData[t]=e},enumerable:!1,configurable:!0});for(const t of["isXNumeric","dataFormatXNumeric","isDataXYZ","isRangeData","isRangeBar","isMultiLineX","noLabelsProvided","dataWasParsed"])Object.defineProperty(e,t,{get:()=>s.axisFlags[t],set(e){s.axisFlags[t]=e},enumerable:!1,configurable:!0});for(const t of["labels","categoryLabels","timescaleLabels","hasXaxisGroups","groups","seriesGroups"])Object.defineProperty(e,t,{get:()=>s.labelData[t],set(e){s.labelData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesRangeStart","seriesRangeEnd","seriesRange"])Object.defineProperty(e,t,{get:()=>s.rangeData[t],set(e){s.rangeData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesCandleO","seriesCandleH","seriesCandleM","seriesCandleL","seriesCandleC"])Object.defineProperty(e,t,{get:()=>s.candleData[t],set(e){s.candleData[t]=e},enumerable:!1,configurable:!0});for(const t of["seriesViolinDensity","seriesViolinPoints","seriesViolinMin","seriesViolinMax"])Object.defineProperty(e,t,{get:()=>s.violinData[t],set(e){s.violinData[t]=e},enumerable:!1,configurable:!0});return s}}class P{constructor(t){this.w=t}static checkComboSeries(t,e){let s=!1,i=0,a=0;return void 0===e&&(e="line"),t.length&&void 0!==t[0].type&&t.forEach(t=>{"bar"!==t.type&&"column"!==t.type&&"candlestick"!==t.type&&"boxPlot"!==t.type&&"violin"!==t.type||i++,void 0!==t.type&&t.type!==e&&a++}),a>0&&(s=!0),{comboBarCount:i,comboCharts:s}}getStackedSeriesTotals(t=[]){const e=this.w,s=[];if(0===e.seriesData.series.length)return s;for(let i=0;i<e.seriesData.series[e.globals.maxValsInArrayIndex].length;i++){let a=0;for(let s=0;s<e.seriesData.series.length;s++)void 0!==e.seriesData.series[s][i]&&-1===t.indexOf(s)&&(a+=e.seriesData.series[s][i]);s.push(a)}return s}getSeriesTotalByIndex(t=null){if(null===t)return this.w.config.series.reduce((t,e)=>t+e,0);{const e=this.w.seriesData.series[t];return Array.isArray(e)?e.reduce((t,e)=>t+e,0):null!=e?e:0}}getStackedSeriesTotalsByGroups(){const t=this.w,e=[];return t.labelData.seriesGroups.forEach(s=>{const i=[];t.config.series.forEach((e,a)=>{s.indexOf(t.seriesData.seriesNames[a])>-1&&i.push(a)});const a=t.seriesData.series.map((t,e)=>-1===i.indexOf(e)?e:-1).filter(t=>-1!==t);e.push(this.getStackedSeriesTotals(a))}),e}setSeriesYAxisMappings(){const t=this.w.globals,e=this.w.config;let s=[];const i=[],a=[],r=this.w.seriesData.series.length>e.yaxis.length||e.yaxis.some(t=>Array.isArray(t.seriesName));e.series.forEach((t,e)=>{a.push(e),i.push(null)}),e.yaxis.forEach((t,e)=>{s[e]=[]});const o=[];e.yaxis.forEach((t,i)=>{let n=!1;if(t.seriesName){let o=[];Array.isArray(t.seriesName)?o=t.seriesName:o.push(t.seriesName),o.forEach(t=>{e.series.forEach((e,o)=>{if(e.name===t){let t=o;i===o||r?(!r||a.indexOf(o)>-1)&&s[i].push([i,o]):(s[o].push([o,i]),t=i),n=!0,t=a.indexOf(t),-1!==t&&a.splice(t,1)}})})}n||o.push(i)}),s=s.map(t=>{const e=[];return t.forEach(t=>{i[t[1]]=t[0],e.push(t[1])}),e});let n=e.yaxis.length-1;for(let t=0;t<o.length&&(n=o[t],s[n]=[],a);t++){const t=a[0];a.shift(),s[n].push(t),i[t]=n}a.forEach(t=>{s[n].push(t),i[t]=n}),t.seriesYAxisMap=s.map(t=>t),t.seriesYAxisReverseMap=i.map(t=>t),t.seriesYAxisMap.forEach((t,s)=>{t.forEach(t=>{if(e.series[t]&&void 0===e.series[t].group){e.series[t].group="apexcharts-axis-".concat(s.toString())}})})}isSeriesNull(t=null){let e=[];const s=this.w.config.series;return e=null===t?s.filter(t=>null!==t):s[t]&&Array.isArray(s[t].data)?s[t].data.filter(t=>null!==t):null!==s[t]&&void 0!==s[t]?[s[t]]:[],0===e.length}seriesHaveSameValues(t){const e=this.w.seriesData.series[t];return!Array.isArray(e)||e.every((t,e,s)=>t===s[0])}getCategoryLabels(t){const e=this.w;let s=t.slice();return e.config.xaxis.convertedCatToNumeric&&(s=t.map(t=>e.config.xaxis.labels.formatter(t-e.globals.minX+1))),s}getLargestSeries(){const t=this.w;t.globals.maxValsInArrayIndex=t.seriesData.series.map(t=>t.length).indexOf(Math.max.apply(Math,t.seriesData.series.map(t=>t.length)))}getLargestMarkerSize(){const t=this.w;let e=0;return t.globals.markers.size.forEach(t=>{e=Math.max(e,t)}),t.config.markers.discrete&&t.config.markers.discrete.length&&t.config.markers.discrete.forEach(t=>{e=Math.max(e,t.size)}),e>0&&(t.config.markers.hover.size>0?e=t.config.markers.hover.size:e+=t.config.markers.hover.sizeOffset),t.globals.markers.largestSize=e,e}getSeriesTotals(){const t=this.w;t.globals.seriesTotals=t.seriesData.series.map(t=>{let e=0;if(Array.isArray(t))for(let s=0;s<t.length;s++)e+=t[s];else e+=t;return e})}getSeriesTotalsXRange(t,e){const s=this.w;return s.seriesData.series.map((i,a)=>{let r=0;for(let o=0;o<i.length;o++)s.seriesData.seriesX[a][o]>t&&s.seriesData.seriesX[a][o]<e&&(r+=i[o]);return r})}getPercentSeries(){const t=this.w;t.globals.seriesPercent=t.seriesData.series.map(e=>{const s=[];if(Array.isArray(e))for(let i=0;i<e.length;i++){const a=t.seriesData.stackedSeriesTotals[i];let r=0;a&&(r=100*e[i]/a),s.push(r)}else{const i=100*e/t.globals.seriesTotals.reduce((t,e)=>t+e,0);s.push(i)}return s})}getCalculatedRatios(){const t=this.w,e=t.globals,s=[];let i=0,a=0,r=0,o=0,n=[],l=.1,h=0;if(e.yRange=[],e.isMultipleYAxis)for(let t=0;t<e.minYArr.length;t++)e.yRange.push(Math.abs(e.minYArr[t]-e.maxYArr[t])),n.push(0);else e.yRange.push(Math.abs(e.minY-e.maxY));e.xRange=Math.abs(e.maxX-e.minX),e.zRange=Math.abs(e.maxZ-e.minZ);for(let t=0;t<e.yRange.length;t++)s.push(e.yRange[t]/this.w.layout.gridHeight);if(a=e.xRange/this.w.layout.gridWidth,i=e.yRange/this.w.layout.gridWidth,r=e.xRange/this.w.layout.gridHeight,o=e.zRange/this.w.layout.gridHeight*16,o||(o=1),e.minY!==Number.MIN_VALUE&&0!==Math.abs(e.minY)){e.hasNegs=!0}if(t.globals.seriesYAxisReverseMap.length>0){const r=(e,i)=>{const a=t.config.yaxis[t.globals.seriesYAxisReverseMap[i]],r=e<0?-1:1;return e=Math.abs(e),a.logarithmic&&(e=this.getBaseLog(a.logBase,e)),-r*e/s[i]};if(e.isMultipleYAxis){n=[];for(let t=0;t<s.length;t++)n.push(r(e.minYArr[t],t))}else n=[],n.push(r(e.minY,0)),e.minY!==Number.MIN_VALUE&&0!==Math.abs(e.minY)&&(l=-e.minY/i,h=e.minX/a)}else n=[],n.push(0),l=0,h=0;return{yRatio:s,invertedYRatio:i,zRatio:o,xRatio:a,invertedXRatio:r,baseLineInvertedY:l,baseLineY:n,baseLineX:h}}getLogSeries(t){const e=this.w;return e.globals.seriesLog=t.map((t,s)=>{const i=e.globals.seriesYAxisReverseMap[s];return e.config.yaxis[i]&&e.config.yaxis[i].logarithmic?t.map(t=>null===t?null:this.getLogVal(e.config.yaxis[i].logBase,t,s)):t}),e.globals.invalidLogScale?t:e.globals.seriesLog}getLogValAtSeriesIndex(t,e){if(null===t)return null;const s=this.w,i=s.globals.seriesYAxisReverseMap[e];return s.config.yaxis[i]&&s.config.yaxis[i].logarithmic?this.getLogVal(s.config.yaxis[i].logBase,t,e):t}getBaseLog(t,e){return Math.log(e)/Math.log(t)}getLogVal(t,e,s){if(e<=0)return 0;const i=this.w,a=0===i.globals.minYArr[s]?-1:this.getBaseLog(t,i.globals.minYArr[s]),r=(0===i.globals.maxYArr[s]?0:this.getBaseLog(t,i.globals.maxYArr[s]))-a;if(e<1)return e/r;return(this.getBaseLog(t,e)-a)/r}getLogYRatios(t){const e=this.w,s=this.w.globals,i=s;return i.yLogRatio=t.slice(),i.logYRange=s.yRange.map((t,a)=>{const r=e.globals.seriesYAxisReverseMap[a];if(e.config.yaxis[r]&&this.w.config.yaxis[r].logarithmic){let t=-Number.MAX_VALUE,r=Number.MIN_VALUE,o=1;return s.seriesLog.forEach((s,i)=>{s.forEach(s=>{e.config.yaxis[i]&&e.config.yaxis[i].logarithmic&&(t=Math.max(s,t),r=Math.min(s,r))})}),o=Math.pow(s.yRange[a],Math.abs(r-t)/s.yRange[a]),i.yLogRatio[a]=o/this.w.layout.gridHeight,o}}),i.invalidLogScale?t.slice():i.yLogRatio}static extendArrayProps(t,e,s){var i,a;return(null==e?void 0:e.yaxis)&&(e=t.extendYAxis(e,s)),(null==e?void 0:e.annotations)&&(e.annotations.yaxis&&(e=t.extendYAxisAnnotations(e)),(null==(i=null==e?void 0:e.annotations)?void 0:i.xaxis)&&(e=t.extendXAxisAnnotations(e)),(null==(a=null==e?void 0:e.annotations)?void 0:a.points)&&(e=t.extendPointAnnotations(e))),e}drawSeriesByGroup(t,e,s,i){const a=this.w,r=[];return t.series.length>0&&e.forEach(e=>{const o=[],n=[];t.i.forEach((s,i)=>{a.config.series[s].group===e&&(o.push(t.series[i]),n.push(s))}),o.length>0&&r.push(i.draw(o,s,n))}),r}}const F="http://www.w3.org/2000/svg";class T{constructor(t,e){"object"==typeof t?(this.x=t.x,this.y=t.y):(this.x=t||0,this.y=e||0)}transform(t){return t.apply(this)}clone(){return new T(this.x,this.y)}}class I{constructor(t,e,s,i,a,r){this.a=null!=t?t:1,this.b=null!=e?e:0,this.c=null!=s?s:0,this.d=null!=i?i:1,this.e=null!=a?a:0,this.f=null!=r?r:0}rotate(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return this.multiply(new I(s,i,-i,s,0,0))}scale(t,e){return this.multiply(new I(t,0,0,null!=e?e:t,0,0))}multiply(t){return new I(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)}apply(t){return new T(this.a*t.x+this.c*t.y+this.e,this.b*t.x+this.d*t.y+this.f)}}class X{constructor(t,e,s,i){this.x=t,this.y=e,this.w=s,this.h=i,this.width=s,this.height=i,this.x2=t+s,this.y2=e+i}}function R(t){if(!t||"string"!=typeof t)return[["M",0,0]];const e=[],s=/([MmLlHhVvCcSsQqTtAaZz])\s*/g,i=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;let a;const r=[],o=[];for(;null!==(a=s.exec(t));)r.push(a[1]),o.push(a.index);for(let s=0;s<r.length;s++){const a=o[s]+r[s].length,n=s+1<o.length?o[s+1]:t.length,l=t.substring(a,n),h=[];let c;for(i.lastIndex=0;null!==(c=i.exec(l));)h.push(parseFloat(c[0]));const d=r[s].toUpperCase();if("Z"===d)e.push(["Z"]);else if("M"===d||"L"===d||"T"===d)for(let t=0;t<h.length;t+=2)e.push([d,h[t],h[t+1]]);else if("H"===d)for(let t=0;t<h.length;t++)e.push([d,h[t]]);else if("V"===d)for(let t=0;t<h.length;t++)e.push([d,h[t]]);else if("C"===d)for(let t=0;t<h.length;t+=6)e.push([d,h[t],h[t+1],h[t+2],h[t+3],h[t+4],h[t+5]]);else if("S"===d||"Q"===d)for(let t=0;t<h.length;t+=4)e.push([d,h[t],h[t+1],h[t+2],h[t+3]]);else if("A"===d)for(let t=0;t<h.length;t+=7)e.push([d,h[t],h[t+1],h[t+2],h[t+3],h[t+4],h[t+5],h[t+6]])}return 0===e.length&&e.push(["M",0,0]),e}function z(t){let e=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEach(t=>{for(let r=1;r<t.length;r+=2)if(r+1<=t.length){const o=t[r],n=t[r+1];"number"==typeof o&&"number"==typeof n&&(o<e&&(e=o),o>i&&(i=o),n<s&&(s=n),n>a&&(a=n))}}),e===1/0?{x:0,y:0,width:0,height:0}:{x:e,y:s,width:i-e,height:a-s}}function B(t){return t.map(t=>t.join(" ")).join(" ")}function Y(t){switch(t[0]){case"z":case"Z":t[0]="L",t[1]=this.start[0],t[2]=this.start[1];break;case"H":t[0]="L",t[2]=this.pos[1];break;case"V":t[0]="L",t[2]=t[1],t[1]=this.pos[0];break;case"T":t[0]="Q",t[3]=t[1],t[4]=t[2],t[1]=this.reflection[1],t[2]=this.reflection[0];break;case"S":t[0]="C",t[6]=t[4],t[5]=t[3],t[4]=t[2],t[3]=t[1],t[2]=this.reflection[1],t[1]=this.reflection[0]}return t}function N(t){var e=t.length;return this.pos=[t[e-2],t[e-1]],-1!="SCQT".indexOf(t[0])&&(this.reflection=[2*this.pos[0]-t[e-4],2*this.pos[1]-t[e-3]]),t}function W(t){var e,s=[t];switch(t[0]){case"M":return this.pos=this.start=[t[1],t[2]],s;case"L":t[5]=t[3]=t[1],t[6]=t[4]=t[2],t[1]=this.pos[0],t[2]=this.pos[1];break;case"Q":t[6]=t[4],t[5]=t[3],t[4]=1*t[4]/3+2*t[2]/3,t[3]=1*t[3]/3+2*t[1]/3,t[2]=1*this.pos[1]/3+2*t[2]/3,t[1]=1*this.pos[0]/3+2*t[1]/3;break;case"A":s=function(t,e){var s,i,a,r,o,n,l,h,c,d,g,p,u,x,f,m,b,y,w,v,A,C,S,k,_,L,M=Math.abs(e[1]),D=Math.abs(e[2]),E=e[3]%360,P=e[4],F=e[5],X=e[6],R=e[7],z=new T(t[0],t[1]),B=new T(X,R),Y=[];if(0===M||0===D||z.x===B.x&&z.y===B.y)return[["C",z.x,z.y,B.x,B.y,B.x,B.y]];s=new T((z.x-B.x)/2,(z.y-B.y)/2).transform((new I).rotate(E)),(i=s.x*s.x/(M*M)+s.y*s.y/(D*D))>1&&(M*=i=Math.sqrt(i),D*=i);a=(new I).rotate(E).scale(1/M,1/D).rotate(-E),z=z.transform(a),B=B.transform(a),r=[B.x-z.x,B.y-z.y],n=r[0]*r[0]+r[1]*r[1],o=Math.sqrt(n),r[0]/=o,r[1]/=o,l=n<4?Math.sqrt(1-n/4):0,P===F&&(l*=-1);h=new T((B.x+z.x)/2+l*-r[1],(B.y+z.y)/2+l*r[0]),c=new T(z.x-h.x,z.y-h.y),d=new T(B.x-h.x,B.y-h.y),g=Math.acos(c.x/Math.sqrt(c.x*c.x+c.y*c.y)),c.y<0&&(g*=-1);p=Math.acos(d.x/Math.sqrt(d.x*d.x+d.y*d.y)),d.y<0&&(p*=-1);F&&g>p&&(p+=2*Math.PI);!F&&g<p&&(p-=2*Math.PI);for(x=Math.ceil(2*Math.abs(g-p)/Math.PI),m=[],b=g,u=(p-g)/x,f=4*Math.tan(u/4)/3,A=0;A<=x;A++)w=Math.cos(b),y=Math.sin(b),v=new T(h.x+w,h.y+y),m[A]=[new T(v.x+f*y,v.y-f*w),v,new T(v.x-f*y,v.y+f*w)],b+=u;for(m[0][0]=m[0][1].clone(),m[m.length-1][2]=m[m.length-1][1].clone(),a=(new I).rotate(E).scale(M,D).rotate(-E),A=0,C=m.length;A<C;A++)m[A][0]=m[A][0].transform(a),m[A][1]=m[A][1].transform(a),m[A][2]=m[A][2].transform(a);for(A=1,C=m.length;A<C;A++)S=(v=m[A-1][2]).x,k=v.y,_=(v=m[A][0]).x,L=v.y,X=(v=m[A][1]).x,R=v.y,Y.push(["C",S,k,_,L,X,R]);return Y}(null!=(e=this.pos)?e:[],t),t=s[0]}return t[0]="C",this.pos=[t[5],t[6]],this.reflection=[2*t[5]-t[3],2*t[6]-t[4]],s}function O(t,e){if(!1===e)return!1;for(var s=e,i=t.length;s<i;++s)if("M"==t[s][0])return s;return!1}function H(t,e,s,i,a,r){for(var o=t.slice(e,s||void 0),n=i.slice(a,r||void 0),l=0,h={pos:[0,0],start:[0,0]},c={pos:[0,0],start:[0,0]};o[l]=Y.call(h,o[l]),n[l]=Y.call(c,n[l]),o[l][0]!=n[l][0]||"M"==o[l][0]||"A"==o[l][0]&&(o[l][4]!=n[l][4]||o[l][5]!=n[l][5])?(Array.prototype.splice.apply(o,[l,1].concat(W.call(h,o[l]))),Array.prototype.splice.apply(n,[l,1].concat(W.call(c,n[l])))):(o[l]=N.call(h,o[l]),n[l]=N.call(c,n[l])),++l!=o.length||l!=n.length;)l==o.length&&o.push(["C",h.pos[0],h.pos[1],h.pos[0],h.pos[1],h.pos[0],h.pos[1]]),l==n.length&&n.push(["C",c.pos[0],c.pos[1],c.pos[0],c.pos[1],c.pos[0],c.pos[1]]);return{start:o,dest:n}}function $(t,e){var s=function(t,e){for(var s,i=R(t),a=R(e),r=0,o=0,n=!1,l=!1;!1!==r||!1!==o;){if(n=O(i,!1!==r&&r+1),l=O(a,!1!==o&&o+1),!1===r){const t=z(s.start);r=0==t.height||0==t.width?i.push(i[0])-1:i.push(["M",t.x+t.width/2,t.y+t.height/2])-1}if(!1===o){const t=z(s.dest);o=0==t.height||0==t.width?a.push(a[0])-1:a.push(["M",t.x+t.width/2,t.y+t.height/2])-1}s=H(i,r,n,a,o,l),i=i.slice(0,r).concat(s.start,!1===n?[]:i.slice(n)),a=a.slice(0,o).concat(s.dest,!1===l?[]:a.slice(l)),r=!1!==n&&r+s.start.length,o=!1!==l&&o+s.dest.length}return{start:i,dest:a}}(t,e),i=s.start,a=s.dest;return function(t){return B(i.map(function(e,s){return a[s].map(function(i,r){return 0===r?i:e[r]+(a[s][r]-e[r])*t})}))}}let j=null,G=null;function V(t,e){const s=new Array(e);if(!c.isBrowser()){const i=z(R(t)),a=i.x+i.width/2,r=i.y+i.height/2;for(let t=0;t<e;t++)s[t]={x:a,y:r};return s}j||(j=document.createElementNS("http://www.w3.org/2000/svg","svg"),j.setAttribute("width","0"),j.setAttribute("height","0"),j.setAttribute("style","position:absolute;width:0;height:0;visibility:hidden;pointer-events:none;"),G=document.createElementNS("http://www.w3.org/2000/svg","path"),j.appendChild(G),document.body.appendChild(j)),G.setAttribute("d",t||"M0 0");let i=0;try{i=G.getTotalLength()}catch(t){i=0}if(!i||!isFinite(i)){const i=z(R(t)),a=i.x+i.width/2,r=i.y+i.height/2;for(let t=0;t<e;t++)s[t]={x:a,y:r};return s}for(let t=0;t<e;t++)try{const a=G.getPointAtLength(t/e*i);s[t]={x:a.x,y:a.y}}catch(e){s[t]={x:0,y:0}}return s}function U(t){return-Math.cos(t*Math.PI)/2+.5}let q=U;function Z(t){if(!t||"string"!=typeof t)return null;if("#"===t[0]){let e=t.slice(1);3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const s=parseInt(e,16);return[s>>16&255,s>>8&255,255&s,1]}const e=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);return e?[+e[1],+e[2],+e[3],void 0!==e[4]?+e[4]:1]:null}function K(t,e,s){return`rgba(${Math.round(t[0]+(e[0]-t[0])*s)},${Math.round(t[1]+(e[1]-t[1])*s)},${Math.round(t[2]+(e[2]-t[2])*s)},${t[3]+(e[3]-t[3])*s})`}class J{constructor(t,e,s){this.el=t,this.duration=null!=e?e:300,this.delay=s||0,this._attrTarget=null,this._plotTarget=null,this._plotSnap=null,this._plotAlgorithm="commands",this._afterCb=null,this._duringCb=null,this._easing=null,this._next=null,this._root=null,this._scheduled=!1}ease(t){return"function"==typeof t&&(this._easing=t),this._schedule(),this}attr(t){return this._attrTarget=t,this._schedule(),this}plot(t,e,s){return this._plotTarget=t,e&&(this._plotAlgorithm=e),this._plotSnap=s||null,this._schedule(),this}after(t){return this._afterCb=t,this._schedule(),this}during(t){return this._duringCb=t,this._schedule(),this}animate(t,e){const s=new J(this.el,t,e);return this._next=s,s._root=this._root||this,s}_schedule(){const t=this._root||this;t._scheduled||(t._scheduled=!0,queueMicrotask(()=>t._executeChain()))}_executeChain(){const t=[];let e=this;for(;e;)t.push(e),e=e._next;let s=0;t.forEach(t=>{s+=t.delay,t._execute(s),s+=t.duration})}_execute(t){const e=this.el,s=this.duration;if(s<=1){const s=()=>{this._attrTarget&&e.attr(this._attrTarget),this._plotTarget&&e.plot(this._plotSnap||this._plotTarget),this._afterCb&&this._afterCb.call(e)};return void(t>0?setTimeout(s,t):s())}const i=()=>{const t={},i={},a={};if(this._attrTarget)for(const s of Object.keys(this._attrTarget)){const r=e.attr(s);t[s]=r;const o=Z(r),n=Z(String(this._attrTarget[s]));o&&n&&(i[s]=o,a[s]=n)}let r=null;if(this._plotTarget){const t=e.attr("d")||"";try{r="polygons"===this._plotAlgorithm?function(t,e,s=96){const i=V(t,s),a=V(e,s);let r=0,o=1/0;for(let t=0;t<s;t++){let e=0;for(let r=0;r<s;r++){const n=i[(r+t)%s],l=a[r],h=n.x-l.x,c=n.y-l.y;if(e+=h*h+c*c,e>=o)break}e<o&&(o=e,r=t)}const n=new Array(s);for(let t=0;t<s;t++)n[t]=i[(t+r)%s];return function(t){let e="";for(let i=0;i<s;i++){const s=n[i],r=a[i],o=s.x+(r.x-s.x)*t,l=s.y+(r.y-s.y)*t;e+=(0===i?"M":"L")+o.toFixed(3)+" "+l.toFixed(3)+" "}return e+"Z"}}(t,this._plotTarget):$(t,this._plotTarget)}catch(t){r=null}}const o=performance.now(),n=this._easing||q,l=h=>{const c=h-o,d=Math.min(c/s,1),g=n(d);if(this._attrTarget)if(d>=1)e.attr(this._attrTarget);else{const s={};for(const e of Object.keys(this._attrTarget))if(i[e]&&a[e])s[e]=K(i[e],a[e],g);else{const i=parseFloat(t[e]),a=parseFloat(this._attrTarget[e]);isNaN(i)||isNaN(a)||(s[e]=i+(a-i)*g)}e.attr(s)}r&&d<1&&e.attr("d",r(g)),this._duringCb&&this._duringCb(g),d<1?m.requestAnimationFrame(l):(this._plotTarget&&e.attr("d",this._plotSnap||this._plotTarget),this._afterCb&&this._afterCb.call(e))};m.requestAnimationFrame(l)};t>0?setTimeout(i,t):i()}}function Q(t){return-Math.cos(t*Math.PI)/2+.5}function tt(t,e,s,i){t=Math.min(Math.max(t,0),1),s=Math.min(Math.max(s,0),1);const a=3*t,r=3*(s-t)-a,o=1-a-r,n=3*e,l=3*(i-e)-n,h=1-n-l,c=t=>((o*t+r)*t+a)*t,d=t=>(3*o*t+2*r)*t+a;return t=>t<=0?0:t>=1?1:(t=>((h*t+l)*t+n)*t)((t=>{let e=t;for(let s=0;s<5;s++){const s=d(e);if(0===s)break;e-=(c(e)-t)/s}let s=0,i=1;if(e=t,e<s)return s;if(e>i)return i;for(;s<i;){const a=c(e);if(Math.abs(a-t)<1e-4)return e;t>a?s=e:i=e,e=(s+i)/2}return e})(t))}const et=new Map;function st(t){return"function"==typeof t?t:(e=t,Array.isArray(e)&&4===e.length&&e.every(t=>"number"==typeof t)?tt(t[0],t[1],t[2],t[3]):"string"==typeof t&&et.has(t)?et.get(t):Q);var e}et.set("linear",t=>t),et.set("easeInOutSine",Q),et.set("easeInSine",t=>1-Math.cos(t*Math.PI/2)),et.set("easeOutSine",t=>Math.sin(t*Math.PI/2)),et.set("easeInQuad",t=>t*t),et.set("easeOutQuad",t=>1-(1-t)*(1-t)),et.set("easeInOutQuad",t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2),et.set("easeInCubic",t=>t*t*t),et.set("easeOutCubic",t=>1-Math.pow(1-t,3)),et.set("easeInOutCubic",t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2),et.set("easeOutBack",t=>{const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}),et.set("easeInOutBack",t=>{const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2});const it="http://www.w3.org/2000/svg";function at(t){return 1-Math.pow(1-t,3)}let rt=null;function ot(){if(!c.isBrowser())return!1;try{return rt||(rt=window.matchMedia("(prefers-reduced-motion: reduce)")),!!rt.matches}catch(t){return!1}}function nt(t,e,s){if(!c.isBrowser())return!1;if(s.globals.dataChanged||s.globals.resized)return!1;const i=s.config.chart.animations;if(!i||!1===i.enabled)return!1;const a=s.config.chart.type;if("line"!==a&&"area"!==a&&"rangeArea"!==a)return!1;if(!(s.layout.gridWidth>0))return!1;const r=2*(i.speed||800),o=Math.max(0,Math.min(1,e/s.layout.gridWidth)),n=(1-Math.cbrt(1-o))*r,l=t.node.style;l.opacity="0";let h=null;const d=t=>{null===h&&(h=t),t-h>=n?l.opacity="":m.requestAnimationFrame(d)};return m.requestAnimationFrame(d),!0}function lt(t){const e=t.config.chart.animations;var s;e&&(!1!==e.respectReducedMotion&&ot()&&(e.enabled=!1,e.dynamicAnimation&&(e.dynamicAnimation.enabled=!1)),s=st(e.easing),q="function"==typeof s?s:U)}function ht(t){const e=t.style,s=t.index||0,i="number"==typeof t.baseDelay?t.baseDelay:40,a=t.row||0,r=t.col||0,o=t.groupIndex||0,n=t.perGroup||1,l=t.centerDistance||0;switch(e){case"none":return 0;case"diagonal":return(a+r)*i;case"group":return o*i+s%n*(i/4);case"centroid":return l*i*(s+1);default:return s*i}}class ct{constructor(t,e){this.w=t,this.ctx=e}animateLine(t,e,s,i){t.attr(e).animate(i).attr(s)}animateMarker(t,e,s,i){t.attr({opacity:0}).animate(e).attr({opacity:1}).after(()=>{i()})}animatePop(t,{speed:e,delay:s=0,onComplete:i}){const a=this.w;if(!c.isBrowser()||!a.globals.shouldAnimate||e<1)return void(i&&i());const r=t.node.style;r.transformBox="fill-box",r.transformOrigin="center",r.transform="scale(0)",r.opacity="0";const o=performance.now()+s,n=t=>{const s=Math.max(0,Math.min(1,(t-o)/e));r.transform=`scale(${function(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}(s)})`,r.opacity=String(Math.min(1,2*s)),s<1?m.requestAnimationFrame(n):(r.transform="",r.transformOrigin="",r.transformBox="",r.opacity="",i&&i())};m.requestAnimationFrame(n)}animateRect(t,e,s,i,a,r=0){t.attr(e).animate(i,r).attr(s).after(()=>a())}animatePathsGradually(t){const{el:e,realIndex:s,j:i,fill:a,pathFrom:r,pathTo:o,pathToInterp:n,speed:l,delay:h,scrollMorph:c}=t,d=this.w;let g=0;d.config.chart.animations.animateGradually.enabled&&(g=d.config.chart.animations.animateGradually.delay),d.config.chart.animations.dynamicAnimation.enabled&&d.globals.dataChanged&&"bar"!==d.config.chart.type&&(g=0),this.morphSVG(e,s,i,"line"!==d.config.chart.type||d.globals.comboCharts?a:"stroke",r,o,l,h*g,c,n)}revealBulk(t){const e=this.w;t.node.classList.add("apexcharts-element-hidden"),e.globals.delayedElements.push({el:t.node}),c.isBrowser()&&e.globals.shouldAnimate?e.globals.bulkRevealScheduled||(e.globals.bulkRevealScheduled=!0,m.requestAnimationFrame(()=>{e.globals.isDestroyed||(e.globals.bulkRevealScheduled=!1,this.animationCompleted(t))})):this.animationCompleted(t)}showDelayedElements(){this.w.globals.delayedElements.forEach(t=>{if(t.holdUntilComplete&&!this.w.globals.animationEnded)return;const e=t.el;e.classList.remove("apexcharts-element-hidden"),e.classList.add("apexcharts-hidden-element-shown")})}animationCompleted(t){const e=this.w;e.globals.animationEnded||(e.globals.animationEnded=!0,this.showDelayedElements(),"function"==typeof e.config.chart.events.animationEnd&&e.config.chart.events.animationEnd(this.ctx,{el:t,w:e}))}animateDraw(t,{realIndex:e,j:s,isFill:i,isLast:a,speed:r,delay:o,mask:n}){const l=this.w,h=this,d=()=>{a&&l.globals.shouldAnimate&&h.animationCompleted(t),h.showDelayedElements()};if(!c.isBrowser()||!l.globals.shouldAnimate||r<1)return void d();const g=t.node,p=()=>{const t=n&&"radial"===n.type,a=l.layout.gridWidth+8,h=n&&n.cx||0,c=n&&n.cy||0,p=(n&&n.r||l.layout.gridWidth/2)+4,u=`apexDrawMask${l.globals.cuid}-${e}-${null!=s?s:0}-${i?"f":"s"}`,x=m.createElementNS(it,"mask");let f;if(x.setAttribute("id",u),x.setAttribute("maskUnits","userSpaceOnUse"),t){const t=p;x.setAttribute("x",String(h-t)),x.setAttribute("y",String(c-t)),x.setAttribute("width",String(2*t)),x.setAttribute("height",String(2*t)),f=m.createElementNS(it,"circle"),f.setAttribute("cx",String(h)),f.setAttribute("cy",String(c)),f.setAttribute("r","0"),f.setAttribute("fill","#fff")}else x.setAttribute("x",String(-4)),x.setAttribute("y",String(-4)),x.setAttribute("width",String(a)),x.setAttribute("height",String(l.layout.gridHeight+8)),f=m.createElementNS(it,"rect"),f.setAttribute("x",String(-4)),f.setAttribute("y",String(-4)),f.setAttribute("width","0"),f.setAttribute("height",String(l.layout.gridHeight+8)),f.setAttribute("fill","#fff");x.appendChild(f),l.dom.elDefs.node.appendChild(x),g.setAttribute("mask",`url(#${u})`);const b=performance.now()+(o||0),y=e=>{if(l.globals.isDestroyed)return;const s=Math.max(0,Math.min(1,(e-b)/r)),i=at(s);t?f.setAttribute("r",String(i*p)):f.setAttribute("width",String(i*a)),s<1?m.requestAnimationFrame(y):(g.removeAttribute("mask"),x.parentNode&&x.parentNode.removeChild(x),d())};m.requestAnimationFrame(y)};m.requestAnimationFrame(()=>{if(l.globals.isDestroyed)return;if(i)return void p();const t=g.getAttribute("stroke-dasharray");if(!!t&&"0"!==t&&""!==t)return void p();let e=0;try{"function"==typeof g.getTotalLength&&(e=g.getTotalLength())}catch(t){e=0}e?(t=>{g.setAttribute("stroke-dasharray",String(t)),g.setAttribute("stroke-dashoffset",String(t));const e=performance.now()+(o||0),s=i=>{if(l.globals.isDestroyed)return;const a=Math.max(0,Math.min(1,(i-e)/r));g.setAttribute("stroke-dashoffset",String(t*(1-at(a)))),a<1?m.requestAnimationFrame(s):(g.removeAttribute("stroke-dasharray"),g.removeAttribute("stroke-dashoffset"),d())};m.requestAnimationFrame(s)})(e):d()})}morphSVG(t,e,s,i,a,r,o,n,l,h){var c,d;const g=this.w;a||(a=t.attr("pathFrom")),r||(r=t.attr("pathTo"));const p=()=>("radar"===g.config.chart.type&&(o=1),`M 0 ${g.layout.gridHeight}`);(!a||a.indexOf("undefined")>-1||a.indexOf("NaN")>-1)&&(a=p()),(!r.trim()||r.indexOf("undefined")>-1||r.indexOf("NaN")>-1)&&(r=p(),h=void 0),h&&(!h.trim()||h.indexOf("undefined")>-1||h.indexOf("NaN")>-1)&&(h=void 0),g.globals.shouldAnimate||(o=1);const u=!0===(null==(d=null==(c=this.ctx)?void 0:c.morphTypeChange)?void 0:d.isActive())?"polygons":"commands";let x=null;if(g.globals.dataChanged){const t=g.config.chart.animations.dynamicAnimation.easing;null!=t?x=st(t):l&&(x=st("linear"))}const f=t.plot(a).animate(1,n).plot(a).animate(o,n);x&&f.ease(x),f.plot(h||r,u,h?r:void 0).after(()=>{b.isNumber(s)?s===g.seriesData.series[g.globals.maxValsInArrayIndex].length-2&&g.globals.shouldAnimate&&this.animationCompleted(t):"none"!==i&&g.globals.shouldAnimate&&(!g.globals.comboCharts&&e===g.seriesData.series.length-1||g.globals.comboCharts)&&this.animationCompleted(t),this.showDelayedElements()})}}class dt{constructor(t){this.w=t}getDefaultFilter(t,e){const s=this.w;t.unfilter&&t.unfilter(!0),s.config.chart.dropShadow.enabled&&this.dropShadow(t,s.config.chart.dropShadow,e)}applyFilter(t,e,s){var i,a,r;const o=this.w;if(t.unfilter&&t.unfilter(!0),"none"===s)return void this.getDefaultFilter(t,e);const n=o.config.chart.dropShadow,l="lighten"===s?2:.3;t.filterWith&&(t.filterWith(t=>{t.colorMatrix({type:"matrix",values:`\n ${l} 0 0 0 0\n 0 ${l} 0 0 0\n 0 0 ${l} 0 0\n 0 0 0 1 0\n `,in:"SourceGraphic",result:"brightness"}),n.enabled&&this.addShadow(t,e,n,"brightness")}),n.noUserSpaceOnUse||null==(a=null==(i=t.filterer())?void 0:i.node)||a.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(r=t.filterer())?void 0:r.node))}addShadow(t,e,s,i){var a;const r=this.w;let{blur:o,top:n,left:l,color:h,opacity:c}=s;if(h=Array.isArray(h)?h[e]:h,(null==(a=r.config.chart.dropShadow.enabledOnSeries)?void 0:a.length)>0&&-1===r.config.chart.dropShadow.enabledOnSeries.indexOf(e))return t;t.offset({in:i,dx:l,dy:n,result:"offset"}),t.gaussianBlur({in:"offset",stdDeviation:o,result:"blur"}),t.flood({"flood-color":h,"flood-opacity":c,result:"flood"}),t.composite({in:"flood",in2:"blur",operator:"in",result:"shadow"}),t.merge(["shadow",i])}dropShadow(t,e,s=0){var i,a,r,o,n;const l=this.w;return t.unfilter&&t.unfilter(!0),b.isMsEdge()&&"radialBar"===l.config.chart.type||(null==(i=l.config.chart.dropShadow.enabledOnSeries)?void 0:i.length)>0&&-1===(null==(a=l.config.chart.dropShadow.enabledOnSeries)?void 0:a.indexOf(s))||t.filterWith&&(t.filterWith(t=>{this.addShadow(t,s,e,"SourceGraphic")}),e.noUserSpaceOnUse||null==(o=null==(r=t.filterer())?void 0:r.node)||o.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(n=t.filterer())?void 0:n.node)),t}setSelectionFilter(t,e,s){const i=this.w;if(void 0!==i.interact.selectedDataPoints[e]&&i.interact.selectedDataPoints[e].indexOf(s)>-1){t.node.setAttribute("selected",!0);const s=i.config.states.active.filter;"none"!==s&&this.applyFilter(t,e,s.type)}}_scaleFilterSize(t){if(!t)return;(e=>{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.setAttribute(s,e[s])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}class gt{constructor(t,e=null){this.w=t,this.ctx=e}roundPathCorners(t,e){function s(t,e,s){var a=e.x-t.x,r=e.y-t.y,o=Math.sqrt(a*a+r*r);return i(t,e,Math.min(1,s/o))}function i(t,e,s){return{x:t.x+(e.x-t.x)*s,y:t.y+(e.y-t.y)*s}}function a(t,e){t.length>2&&(t[t.length-2]=e.x,t[t.length-1]=e.y)}function r(t){return{x:parseFloat(t[t.length-2]),y:parseFloat(t[t.length-1])}}t.indexOf("NaN")>-1&&(t="");var o=t.split(/[,\s]/).reduce(function(t,e){var s=e.match(/^([a-zA-Z])(.+)/);return s?(t.push(s[1]),t.push(s[2])):t.push(e),t},[]).reduce(function(t,e){return parseFloat(e)==e&&t.length?t[t.length-1].push(e):t.push([e]),t},[]),n=[];if(o.length>1){var l=r(o[0]),h=null;"Z"==o[o.length-1][0]&&o[0].length>2&&(h=["L",l.x,l.y],o[o.length-1]=h),n.push(o[0]);for(var c=1;c<o.length;c++){var d=n[n.length-1],g=o[c],p=g==h?o[1]:o[c+1];if(p&&d&&d.length>2&&"L"==g[0]&&p.length>2&&"L"==p[0]){var u,x,f=r(d),m=r(g),b=r(p);u=s(m,f,e),x=s(m,b,e),a(g,u),g.origPoint=m,n.push(g);var y=i(u,m,.5),w=i(m,x,.5),v=["C",y.x,y.y,w.x,w.y,x.x,x.y];v.origPoint=m,n.push(v)}else n.push(g)}if(h){var A=r(n[n.length-1]);n.push(["Z"]),a(n[0],A)}}else n=o;return n.reduce(function(t,e){return t+e.join(" ")+" "},"")}drawLine(t,e,s,i,a="#a8a8a8",r=0,o=null,n="butt"){return this.w.dom.Paper.line().attr({x1:t,y1:e,x2:s,y2:i,stroke:a,"stroke-dasharray":r,"stroke-width":o,"stroke-linecap":n})}drawRect(t=0,e=0,s=0,i=0,a=0,r="#fefefe",o=1,n=null,l=null,h=0){const c=this.w.dom.Paper.rect();return c.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,rx:a,ry:a,opacity:o,"stroke-width":null!==n?n:0,stroke:null!==l?l:"none","stroke-dasharray":h}),c.node.setAttribute("fill",r),c}drawPolygon(t,e="#e1e1e1",s=1,i="none"){return this.w.dom.Paper.polygon(t).attr({fill:i,stroke:e,"stroke-width":s})}drawCircle(t,e=null){t<0&&(t=0);const s=this.w.dom.Paper.circle(2*t);return null!==e&&s.attr(e),s}drawPath({d:t="",stroke:e="#a8a8a8",strokeWidth:s=1,fill:i,fillOpacity:a=1,strokeOpacity:r=1,classes:o,strokeLinecap:n=null,strokeDashArray:l=0}){const h=this.w;null===n&&(n=h.config.stroke.lineCap),(t.indexOf("undefined")>-1||t.indexOf("NaN")>-1)&&(t=`M 0 ${h.layout.gridHeight}`);return h.dom.Paper.path(t).attr({fill:i,"fill-opacity":a,stroke:e,"stroke-opacity":r,"stroke-linecap":n,"stroke-width":s,"stroke-dasharray":l,class:o})}group(t=null){const e=this.w.dom.Paper.group();return null!==t&&e.attr(t),e}move(t,e){return["M",t,e].join(" ")}line(t,e,s=null){return"H"===s?[" H",t].join(" "):"V"===s?[" V",e].join(" "):[" L",t,e].join(" ")}curve(t,e,s,i,a,r){return["C",t,e,s,i,a,r].join(" ")}quadraticCurve(t,e,s,i){return["Q",t,e,s,i].join(" ")}arc(t,e,s,i,a,r,o,n=!1){let l="A";n&&(l="a");return[l,t,e,s,i,a,r,o].join(" ")}renderPaths({j:t,realIndex:e,pathFrom:s,pathTo:i,pathToInterp:a,stroke:r,strokeWidth:o,strokeLinecap:h,fill:c,animationDelay:d,initialSpeed:g,dataChangeSpeed:p,className:u,chartType:x,shouldClipToGrid:f=!0,bindEventsOnPaths:m=!0,drawShadow:b=!0,drawMask:y=null,scrollMorph:w=!1}){var v,A;const C=this.w,S=new dt(this.w),k=new ct(this.w,null!=(v=this.ctx)?v:void 0),_=this.w.config.chart.animations.enabled,L=_&&this.w.config.chart.animations.dynamicAnimation.enabled;if(s&&s.startsWith("M 0 0 ")&&i){const t=i.match(/^M\s+[\d.-]+\s+[\d.-]+/);t&&(s=s.replace(/^M\s+0\s+0/,t[0]))}let M;const D=!!(_&&!C.globals.resized||L&&C.globals.dataChanged&&C.globals.shouldAnimate),E="string"==typeof u&&(u.indexOf("apexcharts-line")>-1||u.indexOf("apexcharts-area")>-1||u.indexOf("apexcharts-rangeArea")>-1||u.indexOf("apexcharts-radar")>-1),P=!(!_||C.globals.resized||C.globals.dataChanged||!E),F=null!=(A=C.config.chart.animations.largeDatasetThreshold)?A:0,T=!!(D&&!P&&F>0&&C.globals.dataPoints>F),I=!(!("candlestick"===x||"boxPlot"===x)||!D||P||!C.globals.dataChanged),X=T||I;!D||P||X?(M=i,D||(C.globals.animationEnded=!0)):M=s;const R=C.config.stroke.dashArray;let z=0;z=Array.isArray(R)?R[e]:C.config.stroke.dashArray;const B=this.drawPath({d:M,stroke:r,strokeWidth:o,fill:c,fillOpacity:1,classes:u,strokeLinecap:h,strokeDashArray:z});B.attr("index",e),f&&("bar"===x&&!C.globals.isBarHorizontal||C.globals.comboCharts?B.attr({"clip-path":`url(#gridRectBarMask${C.globals.cuid})`}):B.attr({"clip-path":`url(#gridRectMask${C.globals.cuid})`})),C.config.chart.dropShadow.enabled&&b&&S.dropShadow(B,C.config.chart.dropShadow,e),m&&(B.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,B)),B.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,B)),B.node.addEventListener("mousedown",this.pathMouseDown.bind(this,B))),B.attr({pathTo:i,pathFrom:s});const Y={el:B,j:t,realIndex:e,pathFrom:s,pathTo:i,pathToInterp:a,fill:c,strokeWidth:o,delay:d,scrollMorph:w};if(!_||C.globals.resized||C.globals.dataChanged)!C.globals.resized&&C.globals.dataChanged||X||k.showDelayedElements();else if(P){const s=2*g,i="none"===r||0===o,a=C.seriesData.series.length,n=!!C.globals.comboCharts||e===a-1;k.animateDraw(B,{realIndex:e,j:t,isFill:i,isLast:n,speed:s,delay:0,mask:y})}else X||k.animatePathsGradually(l(n({},Y),{speed:g}));return C.globals.dataChanged&&L&&D&&!X&&k.animatePathsGradually(l(n({},Y),{speed:p})),X&&k.revealBulk(B),B}drawPattern(t,e,s,i="#a8a8a8",a=0){return this.w.dom.Paper.pattern(e,s,r=>{"horizontalLines"===t?r.line(0,0,s,0).stroke({color:i,width:a+1}):"verticalLines"===t?r.line(0,0,0,e).stroke({color:i,width:a+1}):"slantedLines"===t?r.line(0,0,e,s).stroke({color:i,width:a}):"squares"===t?r.rect(e,s).fill("none").stroke({color:i,width:a}):"circles"===t&&r.circle(e).fill("none").stroke({color:i,width:a})})}drawGradient(t,e,s,i,a,r=null,o=null,n=[],l=0){const h=this.w;let c;e.length<9&&0===e.indexOf("#")&&(e=b.hexToRgba(e,i)),s.length<9&&0===s.indexOf("#")&&(s=b.hexToRgba(s,a));let d=0,g=1,p=1,u=null;null!==o&&(d=void 0!==o[0]?o[0]/100:0,g=void 0!==o[1]?o[1]/100:1,p=void 0!==o[2]?o[2]/100:1,u=void 0!==o[3]?o[3]/100:null);const x=!("donut"!==h.config.chart.type&&"pie"!==h.config.chart.type&&"polarArea"!==h.config.chart.type&&"bubble"!==h.config.chart.type);if(c=n&&0!==n.length?h.dom.Paper.gradient(x?"radial":"linear",t=>{(Array.isArray(n[l])?n[l]:n).forEach(e=>{t.stop(e.offset/100,e.color,e.opacity)})}):h.dom.Paper.gradient(x?"radial":"linear",t=>{t.stop(d,e,i),t.stop(g,s,a),t.stop(p,s,a),null!==u&&t.stop(u,e,i)}),x){const t=h.layout.gridWidth/2,e=h.layout.gridHeight/2;"bubble"!==h.config.chart.type?c.attr({gradientUnits:"userSpaceOnUse",cx:t,cy:e,r:r}):c.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else"vertical"===t?c.from(0,0).to(0,1):"diagonal"===t?c.from(0,0).to(1,1):"horizontal"===t?c.from(0,1).to(1,1):"diagonal2"===t&&c.from(1,0).to(0,1);return c}getTextBasedOnMaxWidth({text:t,maxWidth:e,fontSize:s,fontFamily:i}){const a=this.getTextRects(t,s,i,""),r=a.width/t.length,o=Math.floor(e/r);return e<a.width?t.slice(0,o-3)+"...":t}drawText({x:t,y:e,text:s,textAnchor:i,fontSize:a,fontFamily:r,fontWeight:o,foreColor:l,opacity:h,maxWidth:c,cssClass:d="",isPlainText:g=!0,dominantBaseline:p="auto"}){const u=this.w;void 0===s&&(s="");let x=s;i||(i="start"),l&&l.length||(l=u.config.chart.foreColor),r=r||u.config.chart.fontFamily,o=o||"regular";const f={maxWidth:c,fontSize:a=a||"11px",fontFamily:r};let m;return Array.isArray(s)?m=u.dom.Paper.text(t=>{for(let e=0;e<s.length;e++)x=s[e],c&&(x=this.getTextBasedOnMaxWidth(n({text:s[e]},f))),0===e?t.tspan(x):t.tspan(x).newLine()}):(c&&(x=this.getTextBasedOnMaxWidth(n({text:s},f))),m=g?u.dom.Paper.plain(s):u.dom.Paper.text(t=>t.tspan(x))),m.attr({x:t,y:e,"text-anchor":i,"dominant-baseline":p,"font-size":a,"font-family":r,"font-weight":o,fill:l,class:"apexcharts-text "+d}),m.node.style.fontFamily=r,m.node.style.opacity=h,m}getMarkerPath(t,e,s,i){let a="";switch(s){case"cross":a=`M ${t-(i/=1.4)} ${e-i} L ${t+i} ${e+i} M ${t-i} ${e+i} L ${t+i} ${e-i}`;break;case"plus":a=`M ${t-(i/=1.12)} ${e} L ${t+i} ${e} M ${t} ${e-i} L ${t} ${e+i}`;break;case"star":case"sparkle":{let r=5;i*=1.15,"sparkle"===s&&(i/=1.1,r=4);const o=Math.PI/r;for(let s=0;s<=2*r;s++){const r=s*o,n=s%2==0?i:i/2;a+=(0===s?"M":"L")+(t+n*Math.sin(r))+","+(e-n*Math.cos(r))}a+="Z";break}case"triangle":a=`M ${t} ${e-i} \n L ${t+i} ${e+i} \n L ${t-i} ${e+i} \n Z`;break;case"square":case"rect":a=`M ${t-(i/=1.125)} ${e-i} \n L ${t+i} ${e-i} \n L ${t+i} ${e+i} \n L ${t-i} ${e+i} \n Z`;break;case"diamond":a=`M ${t} ${e-(i*=1.05)} \n L ${t+i} ${e} \n L ${t} ${e+i} \n L ${t-i} ${e} \n Z`;break;case"line":a=`M ${t-(i/=1.1)} ${e} \n L ${t+i} ${e}`;break;default:a=`M ${t}, ${e} \n m -${(i*=2)/2}, 0 \n a ${i/2},${i/2} 0 1,0 ${i},0 \n a ${i/2},${i/2} 0 1,0 -${i},0`}return a}drawMarkerShape(t,e,s,i,a){const r=this.drawPath({d:this.getMarkerPath(t,e,s,i),stroke:a.pointStrokeColor,strokeDashArray:a.pointStrokeDashArray,strokeWidth:a.pointStrokeWidth,fill:a.pointFillColor,fillOpacity:a.pointFillOpacity,strokeOpacity:a.pointStrokeOpacity});return r.attr({cx:t,cy:e,shape:a.shape,class:a.class?a.class:""}),r}drawMarker(t,e,s){t=t||0;let i=s.pSize||0;return b.isNumber(e)||(i=0,e=0),this.drawMarkerShape(t,e,null==s?void 0:s.shape,i,n(n({},s),"line"===s.shape||"plus"===s.shape||"cross"===s.shape?{pointStrokeColor:s.pointFillColor,pointStrokeOpacity:s.pointFillOpacity}:{}))}pathMouseEnter(t,e){var s,i;const a=this.w,r=new dt(this.w),o=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);if(!(isNaN(o)||isNaN(n)||("function"==typeof a.config.chart.events.dataPointMouseEnter&&a.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}),gt._fireEvent(a,"dataPointMouseEnter",[e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}]),"none"!==a.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"===a.config.states.hover.filter.type||a.interact.isTouchDevice))){const e=a.config.states.hover.filter;r.applyFilter(t,o,e.type)}}pathMouseLeave(t,e){var s,i;const a=this.w,r=new dt(this.w),o=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);isNaN(o)||isNaN(n)||("function"==typeof a.config.chart.events.dataPointMouseLeave&&a.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}),gt._fireEvent(a,"dataPointMouseLeave",[e,this.ctx,{seriesIndex:o,dataPointIndex:n,w:a}]),"none"!==a.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"!==a.config.states.hover.filter.type&&r.getDefaultFilter(t,o))}pathMouseDown(t,e){var s,i;const a=this.w,r=new dt(this.w),o=parseInt(null!=(s=t.node.getAttribute("index"))?s:"",10),n=parseInt(null!=(i=t.node.getAttribute("j"))?i:"",10);if(isNaN(o)||isNaN(n))return;const l=a.config.chart.link;if(!!(!l||"function"!=typeof l.dimension&&!l.enabled)){let e="false";if("true"===t.node.getAttribute("selected")){t.node.setAttribute("selected","false");const e=a.interact.selectedDataPoints[o].indexOf(n);e>-1&&a.interact.selectedDataPoints[o].splice(e,1)}else{if(!a.config.states.active.allowMultipleDataPointsSelection&&a.interact.selectedDataPoints.length>0){a.interact.selectedDataPoints=[];const t=a.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),e=a.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),s=t=>{Array.prototype.forEach.call(t,t=>{t.node.setAttribute("selected","false"),r.getDefaultFilter(t,o)})};s(t),s(e)}t.node.setAttribute("selected","true"),e="true",void 0===a.interact.selectedDataPoints[o]&&(a.interact.selectedDataPoints[o]=[]),a.interact.selectedDataPoints[o].push(n)}if("true"===e){const e=a.config.states.active.filter;if("none"!==e)r.applyFilter(t,o,e.type);else if("none"!==a.config.states.hover.filter&&!a.interact.isTouchDevice){const e=a.config.states.hover.filter;r.applyFilter(t,o,e.type)}}else if("none"!==a.config.states.active.filter.type)if("none"===a.config.states.hover.filter.type||a.interact.isTouchDevice)r.getDefaultFilter(t,o);else{const e=a.config.states.hover.filter;r.applyFilter(t,o,e.type)}}"function"==typeof a.config.chart.events.dataPointSelection&&a.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:o,dataPointIndex:n,w:a}),e&>._fireEvent(a,"dataPointSelection",[e,this.ctx,{selectedDataPoints:a.interact.selectedDataPoints,seriesIndex:o,dataPointIndex:n,w:a}])}rotateAroundCenter(t){let e={};t&&"function"==typeof t.getBBox&&(e=t.getBBox());return{x:e.x+e.width/2,y:e.y+e.height/2}}setupEventDelegation(t,e){let s=null;t.node.addEventListener("mouseover",i=>{const a=gt._findDelegateTarget(i.target,t.node,e);a&&a!==s&&(s&&s.instance&&this.pathMouseLeave(s.instance,i),s=a,a.instance&&this.pathMouseEnter(a.instance,i))}),t.node.addEventListener("mouseout",i=>{if(!s)return;(i.relatedTarget?gt._findDelegateTarget(i.relatedTarget,t.node,e):null)!==s&&(s&&s.instance&&this.pathMouseLeave(s.instance,i),s=null)}),t.node.addEventListener("mousedown",s=>{const i=gt._findDelegateTarget(s.target,t.node,e);i&&i.instance&&this.pathMouseDown(i.instance,s)})}static _fireEvent(t,e,s){const i=t.globals.events;if(!i||!Object.prototype.hasOwnProperty.call(i,e))return;const a=i[e];for(let t=0;t<a.length;t++)a[t].apply(null,s)}static _findDelegateTarget(t,e,s){for(;t&&t!==e&&t!==document;){if(t.matches&&t.matches(s))return t;t=t.parentNode}return null}static setAttrs(t,e){for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.setAttribute(s,e[s])}getTextRects(t,e,s,i,a=!0){const r=this.w,o=[t,e,s,i,a].join("\0"),n=r.globals.textRectsCache;if(n&&n.has(o))return n.get(o);const l=this.drawText({x:-200,y:-200,text:t,textAnchor:"start",fontSize:e,fontFamily:s,foreColor:"#fff",opacity:0});i&&l.attr("transform",i),r.dom.Paper.add(l);let h=l.bbox();const c=h.y;a||(h=l.node.getBoundingClientRect()),l.remove();const d={width:h.width,height:h.height,centerOffset:a?c+h.height/2- -200:0};return n&&n.set(o,d),d}placeTextWithEllipsis(t,e,s){if("function"==typeof t.getComputedTextLength&&(t.textContent=e,e.length>0&&t.getComputedTextLength()>=s/1.1)){for(let i=e.length-3;i>0;i-=3)if(t.getSubStringLength(0,i)<=s/1.1)return void(t.textContent=e.substring(0,i)+"...");t.textContent="."}}}class pt{constructor(t){this.w=t,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}clippedImgArea(t){const e=this.w,s=e.config,i=parseInt(String(e.layout.gridWidth),10),a=parseInt(String(e.layout.gridHeight),10),r=i>a?i:a,o=t.image;let n=0,l=0;void 0===t.width&&void 0===t.height?void 0!==s.fill.image.width&&void 0!==s.fill.image.height?(n=s.fill.image.width+1,l=s.fill.image.height):(n=r+1,l=r):(n=t.width,l=t.height);const h=m.createElementNS(F,"pattern");gt.setAttrs(h,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:n+"px",height:l+"px"});const d=m.createElementNS(F,"image");h.appendChild(d);const g=c.isBrowser()?window.SVG:global.SVG;d.setAttributeNS(g.xlink,"href",o),gt.setAttrs(d,{x:0,y:0,preserveAspectRatio:"none",width:n+"px",height:l+"px"}),d.style.opacity=t.opacity,e.dom.elDefs.node.appendChild(h)}getSeriesIndex(t){const e=this.w,s=e.config.chart.type;return("bar"===s||"rangeBar"===s)&&e.config.plotOptions.bar.distributed||"heatmap"===s||"treemap"===s?this.seriesIndex=t.seriesNumber:this.seriesIndex=t.seriesNumber%e.seriesData.series.length,this.seriesIndex}computeColorStops(t,e){const s=this.w;let i=null,a=null;for(const s of t)s>=e.threshold?(null===i||s>i)&&(i=s):(null===a||s<a)&&(a=s);null===i&&(i=e.threshold),null===a&&(a=e.threshold);let r=i-e.threshold+(e.threshold-a);0===r&&(r=1);let o=100-(e.threshold-a)/r*100;return o=Math.max(0,Math.min(o,100)),[{offset:o,color:e.colorAboveThreshold,opacity:s.config.fill.opacity},{offset:0,color:e.colorBelowThreshold,opacity:s.config.fill.opacity}]}fillPath(t){var e,s,i,a;const r=this.w;this.opts=t;const o=this.w.config;let n,l,h;this.seriesIndex=this.getSeriesIndex(t);const c=o.plotOptions.line.colors.colorAboveThreshold&&o.plotOptions.line.colors.colorBelowThreshold;let d=this.getFillColors()[this.seriesIndex];void 0!==r.seriesData.seriesColors[this.seriesIndex]&&(d=r.seriesData.seriesColors[this.seriesIndex]),"function"==typeof d&&(d=d({seriesIndex:this.seriesIndex,dataPointIndex:t.dataPointIndex,value:t.value,w:r}));const g=t.fillType?t.fillType:this.getFillType(this.seriesIndex);let p=Array.isArray(o.fill.opacity)?o.fill.opacity[this.seriesIndex]:o.fill.opacity;const u="gradient"===g||c;t.color&&(d=t.color);const x=r.config.series[this.seriesIndex];(null==(s=null==(e=null==x?void 0:x.data)?void 0:e[t.dataPointIndex])?void 0:s.fillColor)&&(d=null==(a=null==(i=null==x?void 0:x.data)?void 0:i[t.dataPointIndex])?void 0:a.fillColor),d||(d="#fff"),void 0!==t.opacity&&null!==t.opacity&&(p=t.opacity);let f=d;b.isCSSVariable(d)?f=b.applyOpacityToColor(d,p):-1===d.indexOf("rgb")?-1===d.indexOf("#")?f=d:d.length<9&&(f=b.hexToRgba(d,p)):d.indexOf("rgba")>-1?p=b.getOpacityFromRGBA(d):f=b.hexToRgba(b.rgb2hex(d),p);const m=b.isCSSVariable(d)?b.getThemeColor(d):d;if("pattern"===g&&(l=this.handlePatternFill({fillConfig:t.fillConfig,patternFill:l,fillColor:m,defaultColor:f})),u){const e=o.fill.gradient.colorStops?[...o.fill.gradient.colorStops]:[];let s=o.fill.gradient.type;c&&(e[this.seriesIndex]=this.computeColorStops(r.seriesData.series[this.seriesIndex],o.plotOptions.line.colors),s="vertical"),h=this.handleGradientFill({type:s,fillConfig:t.fillConfig,fillColor:m,fillOpacity:p,colorStops:e,i:this.seriesIndex})}if("image"===g){const e=o.fill.image.src,s=t.patternID?t.patternID:"",i=`pattern${r.globals.cuid}${t.seriesNumber+1}${s}`;-1===this.patternIDs.indexOf(i)&&(this.clippedImgArea({opacity:p,image:Array.isArray(e)?t.seriesNumber<e.length?e[t.seriesNumber]:e[0]:e,width:t.width?t.width:void 0,height:t.height?t.height:void 0,patternUnits:t.patternUnits,patternID:i}),this.patternIDs.push(i)),n=`url(#${i})`}else n=u?h:"pattern"===g?l:f;return t.solid&&(n=f),n}getFillType(t){const e=this.w;return Array.isArray(e.config.fill.type)?e.config.fill.type[t]:e.config.fill.type}getFillColors(){const t=this.w,e=t.config,s=this.opts;let i=[];return t.globals.comboCharts?"line"===t.config.series[this.seriesIndex].type?Array.isArray(t.globals.stroke.colors)?i=t.globals.stroke.colors:i.push(t.globals.stroke.colors):Array.isArray(t.globals.fill.colors)?i=t.globals.fill.colors:i.push(t.globals.fill.colors):"line"===e.chart.type?Array.isArray(t.globals.stroke.colors)?i=t.globals.stroke.colors:i.push(t.globals.stroke.colors):Array.isArray(t.globals.fill.colors)?i=t.globals.fill.colors:i.push(t.globals.fill.colors),void 0!==s.fillColors&&(i=[],Array.isArray(s.fillColors)?i=s.fillColors.slice():i.push(s.fillColors)),i}handlePatternFill({fillConfig:t,patternFill:e,fillColor:s,defaultColor:i}){let a=this.w.config.fill;t&&(a=t);const r=this.opts,o=new gt(this.w),n=Array.isArray(a.pattern.strokeWidth)?a.pattern.strokeWidth[this.seriesIndex]:a.pattern.strokeWidth,l=s;if(Array.isArray(a.pattern.style))if(void 0!==a.pattern.style[r.seriesNumber]){e=o.drawPattern(a.pattern.style[r.seriesNumber],a.pattern.width,a.pattern.height,l,n)}else e=i;else e=o.drawPattern(a.pattern.style,a.pattern.width,a.pattern.height,l,n);return e}handleGradientFill({type:t,fillColor:e,fillOpacity:s,fillConfig:i,colorStops:a,i:r}){let o=this.w.config.fill;i&&(o=n(n({},o),i));const l=this.opts,h=new gt(this.w),c=new b;t=t||o.gradient.type;let d,g=e,p=void 0===o.gradient.opacityFrom?s:Array.isArray(o.gradient.opacityFrom)?o.gradient.opacityFrom[r]:o.gradient.opacityFrom;g.indexOf("rgba")>-1&&(p=b.getOpacityFromRGBA(g));let u=void 0===o.gradient.opacityTo?s:Array.isArray(o.gradient.opacityTo)?o.gradient.opacityTo[r]:o.gradient.opacityTo;if(void 0===o.gradient.gradientToColors||0===o.gradient.gradientToColors.length)d="dark"===o.gradient.shade?c.shadeColor(-1*parseFloat(o.gradient.shadeIntensity),e.indexOf("rgb")>-1?b.rgb2hex(e):e):c.shadeColor(parseFloat(o.gradient.shadeIntensity),e.indexOf("rgb")>-1?b.rgb2hex(e):e);else if(o.gradient.gradientToColors[l.seriesNumber]){const t=o.gradient.gradientToColors[l.seriesNumber];d=t,t.indexOf("rgba")>-1&&(u=b.getOpacityFromRGBA(t))}else d=e;if(o.gradient.gradientFrom&&(g=o.gradient.gradientFrom),o.gradient.gradientTo&&(d=o.gradient.gradientTo),o.gradient.inverseColors){const t=g;g=d,d=t}return g.indexOf("rgb")>-1&&(g=b.rgb2hex(g)),d.indexOf("rgb")>-1&&(d=b.rgb2hex(d)),h.drawGradient(t,g,d,p,u,l.size,o.gradient.stops,a,r)}}const ut=["none","lighten","darken"];function xt(t,e){const s=t&&t.renderer;return s&&s.kind&&"svg"!==s.kind?s:e}function ft(t){var e,s;const i=t.config.fill&&t.config.fill.type,a=t=>"pattern"===t||"image"===t||"gradient"===t;if(Array.isArray(i)?i.some(a):a(i))return!0;const r=null==(s=null==(e=t.config.plotOptions)?void 0:e.line)?void 0:s.colors;if(r&&r.colorAboveThreshold&&r.colorBelowThreshold)return!0;const o=t.config.states||{},n=o.hover&&o.hover.filter&&o.hover.filter.type,l=o.active&&o.active.filter&&o.active.filter.type;return!(!n||ut.includes(n))||!(!l||ut.includes(l))}class mt{constructor(t,e){this.w=t,this.ctx=e,this._filters=new dt(this.w),this._graphics=new gt(this.w,this.ctx),this._seriesWrap=null,this._seriesWrapIndex=-1}resetSeriesWrapCache(){this._seriesWrap=null,this._seriesWrapIndex=-1}setGlobalMarkerSize(){const t=this.w;if(t.globals.markers.size=Array.isArray(t.config.markers.size)?t.config.markers.size:[t.config.markers.size],t.globals.markers.size.length>0){if(t.globals.markers.size.length<t.seriesData.series.length+1)for(let e=0;e<=t.seriesData.series.length;e++)void 0===t.globals.markers.size[e]&&t.globals.markers.size.push(t.globals.markers.size[0])}else t.globals.markers.size=t.config.series.map(()=>t.config.markers.size)}plotChartMarkers({pointsPos:t,seriesIndex:e,j:s,pSize:i,alwaysDrawMarker:a=!1,isVirtualPoint:r=!1}){const o=this.w,n=e,l=t;let h=null;const c=new gt(this.w),d=xt(this.ctx,c),g=o.config.markers.discrete&&o.config.markers.discrete.length;if(Array.isArray(l.x))for(let t=0;t<l.x.length;t++){let c,p=s,u=!b.isNumber(l.y[t]);0===o.globals.markers.largestSize&&o.globals.hasNullValues&&null!==o.seriesData.series[n][s+1]&&!r&&(u=!0),1===s&&0===t&&(p=0),1===s&&1===t&&(p=1);let x="apexcharts-marker";"line"!==o.config.chart.type&&"area"!==o.config.chart.type||o.globals.comboCharts||o.config.tooltip.intersect||(x+=" no-pointer-events");if((Array.isArray(o.config.markers.size)?o.globals.markers.size[e]>0:o.config.markers.size>0)||a||g){"canvas"===d.kind&&(void 0===o.globals.pointsArray[e]&&(o.globals.pointsArray[e]=[]),o.globals.pointsArray[e][p]=[l.x[t],l.y[t]]),u||(x+=` w${b.randomId()}`);const s=this.getMarkerConfig({cssClass:x,seriesIndex:e,dataPointIndex:p}),r=o.config.series[n];if(r.data[p]&&(r.data[p].fillColor&&(s.pointFillColor=r.data[p].fillColor),r.data[p].strokeColor&&(s.pointStrokeColor=r.data[p].strokeColor)),void 0!==i&&(s.pSize=i),(l.x[t]<-o.globals.markers.largestSize||l.x[t]>o.layout.gridWidth+o.globals.markers.largestSize||l.y[t]<-o.globals.markers.largestSize||l.y[t]>o.layout.gridHeight+o.globals.markers.largestSize)&&(s.pSize=0),!u){if((o.globals.markers.size[e]>0||a||g)&&!h){const t=!a&&!g;t&&this._seriesWrap&&this._seriesWrapIndex===e?h=this._seriesWrap:(h=d.group({class:t?"apexcharts-series-markers":""}),h.attr("clip-path",`url(#gridRectMarkerMask${o.globals.cuid})`),this.setupMarkerDelegation(h),t&&(this._seriesWrap=h,this._seriesWrapIndex=e))}c=d.drawMarker(l.x[t],l.y[t],s),c.attr("rel",p),c.attr("j",p),c.attr("index",e),c.node.setAttribute("default-marker-size",s.pSize),nt(c,l.x[t],o),this._filters.setSelectionFilter(c,e,p),h&&h.add(c)}}else void 0===o.globals.pointsArray[e]&&(o.globals.pointsArray[e]=[]),o.globals.pointsArray[e].push([l.x[t],l.y[t]])}return h}getMarkerConfig({cssClass:t,seriesIndex:e,dataPointIndex:s=null,radius:i=null,size:a=null,strokeWidth:r=null}){const o=this.w,n=this.getMarkerStyle(e);let l=null===a?o.globals.markers.size[e]:a;const h=o.config.markers;return null!==s&&h.discrete.length&&h.discrete.map(t=>{t.seriesIndex===e&&t.dataPointIndex===s&&(n.pointStrokeColor=t.strokeColor,n.pointFillColor=t.fillColor,l=t.size,n.pointShape=t.shape)}),{pSize:null===i?l:i,pRadius:null!==i?i:h.radius,pointStrokeWidth:null!==r?r:Array.isArray(h.strokeWidth)?h.strokeWidth[e]:h.strokeWidth,pointStrokeColor:n.pointStrokeColor,pointFillColor:n.pointFillColor,shape:n.pointShape||(Array.isArray(h.shape)?h.shape[e]:h.shape),class:t,pointStrokeOpacity:Array.isArray(h.strokeOpacity)?h.strokeOpacity[e]:h.strokeOpacity,pointStrokeDashArray:Array.isArray(h.strokeDashArray)?h.strokeDashArray[e]:h.strokeDashArray,pointFillOpacity:Array.isArray(h.fillOpacity)?h.fillOpacity[e]:h.fillOpacity,seriesIndex:e}}setupMarkerDelegation(t){const e=this.w,s=".apexcharts-marker";this._graphics.setupEventDelegation(t,s),t.node.addEventListener("click",i=>{if(e.config.markers.onClick){gt._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onClick(i)}}),t.node.addEventListener("dblclick",i=>{if(e.config.markers.onDblClick){gt._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onDblClick(i)}}),t.node.addEventListener("touchstart",e=>{const i=gt._findDelegateTarget(e.target,t.node,s);i&&i.instance&&this._graphics.pathMouseDown(i.instance,e)},{passive:!0})}addEvents(t){const e=this.w;t.node.addEventListener("mouseenter",this._graphics.pathMouseEnter.bind(this.ctx,t)),t.node.addEventListener("mouseleave",this._graphics.pathMouseLeave.bind(this.ctx,t)),t.node.addEventListener("mousedown",this._graphics.pathMouseDown.bind(this.ctx,t)),t.node.addEventListener("click",e.config.markers.onClick),t.node.addEventListener("dblclick",e.config.markers.onDblClick),t.node.addEventListener("touchstart",this._graphics.pathMouseDown.bind(this.ctx,t),{passive:!0})}getMarkerStyle(t){const e=this.w,s=e.globals.markers.colors,i=e.config.markers.strokeColor||e.config.markers.strokeColors;return{pointStrokeColor:Array.isArray(i)?i[t]:i,pointFillColor:Array.isArray(s)?s[t]:s}}}class bt{constructor(t,e){this.ctx=e,this.w=t,this.initialAnim=this.w.config.chart.animations.enabled,this.anim=new ct(this.w),this.filters=new dt(this.w),this.fill=new pt(this.w),this.markers=new mt(this.w,this.ctx),this.graphics=new gt(this.w),this._elPointsWrap=null,this._elPointsWrapParent=null,this._perSeries=null}draw(t,e,s){const i=this.w,a=this.graphics,r=xt(this.ctx,a),o=s.realIndex,n=s.pointsPos,l=s.zRatio,h=s.elParent;let c=this._elPointsWrap;if(c&&this._elPointsWrapParent===h||(c=r.group({class:`apexcharts-series-markers apexcharts-series-${i.config.chart.type}`}),c.attr("clip-path",`url(#gridRectMarkerMask${i.globals.cuid})`),this.markers.setupMarkerDelegation(c),h.add(c),this._elPointsWrap=c,this._elPointsWrapParent=h,this._perSeries=this._buildPerSeriesCache(o,r)),Array.isArray(n.x))for(let t=0;t<n.x.length;t++){let s=e+1,a=!0;0===e&&0===t&&(s=0),0===e&&1===t&&(s=1);let h=i.globals.markers.size[o];if(l!==1/0){const t=i.config.plotOptions.bubble;h=i.seriesData.seriesZ[o][s],t.zScaling&&(h/=l),t.minBubbleRadius&&h<t.minBubbleRadius&&(h=t.minBubbleRadius),t.maxBubbleRadius&&h>t.maxBubbleRadius&&(h=t.maxBubbleRadius)}const d=n.x[t],g=n.y[t];if(h=h||0,null!==g&&void 0!==i.seriesData.series[o][s]||(a=!1),a){const t=this.drawPoint(d,g,h,o,s,e);c.add(t),"canvas"===r.kind&&(void 0===i.globals.pointsArray[o]&&(i.globals.pointsArray[o]=[]),i.globals.pointsArray[o][s]=[d,g])}}}_buildPerSeriesCache(t,e){var s;const i=this.w;return{realIndex:t,emit:e,isBubble:"bubble"===i.config.chart.type||i.globals.comboCharts&&i.config.series[t]&&"bubble"===i.config.series[t].type,canCacheConfig:!i.config.markers.discrete.length,markerConfig:null,fillCacheable:void 0,fillCircle:void 0,dropShadowEnabled:i.config.chart.dropShadow.enabled,doInitialAnim:this.initialAnim&&!i.globals.dataChanged&&!i.globals.resized,jitter:null==(s=i.config.plotOptions.scatter)?void 0:s.jitter,anim:null}}drawPoint(t,e,s,i,a,r){var o;const n=this.w,l=i,h=this.anim,c=this.filters,d=this.fill,g=this.markers;let p=this._perSeries;p&&p.realIndex===i||(p=this._perSeries=this._buildPerSeriesCache(i,xt(this.ctx,this.graphics)));const u=p.emit;let x;p.canCacheConfig?(p.markerConfig||(p.markerConfig=g.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:l,dataPointIndex:a,radius:p.isBubble?s:null})),x=p.markerConfig,p.isBubble&&(x.pSize=s,x.pRadius=s)):x=g.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:l,dataPointIndex:a,radius:p.isBubble?s:null});const f=n.config.series[l].data[a];let m;void 0!==p.fillCircle?m=p.fillCircle:(m=d.fillPath({seriesNumber:i,dataPointIndex:a,color:x.pointFillColor,patternUnits:"objectBoundingBox",value:n.seriesData.series[i][r]}),void 0===p.fillCacheable&&(p.fillCacheable=p.canCacheConfig&&"solid"===d.getFillType(i)&&"string"==typeof x.pointFillColor&&!!x.pointFillColor),p.fillCacheable&&!(null==f?void 0:f.fillColor)&&(p.fillCircle=m));const b=u.drawMarker(t,e,x);(null==f?void 0:f.fillColor)&&(m=f.fillColor);const y=p.jitter;if((null==y?void 0:y.enabled)&&y.distributed&&n.globals.colors.length){const t=Math.round(null==(o=n.seriesData.seriesX[i])?void 0:o[a]);isNaN(t)||(m=n.globals.colors[t%n.globals.colors.length])}if(b.attr({fill:m}),p.dropShadowEnabled){const t=n.config.chart.dropShadow;c.dropShadow(b,t,i)}if(p.doInitialAnim){if(!p.anim){const t=n.config.chart.animations,e=n.globals.dataPoints||1,s=t.animateGradually,i=s&&!1!==s.enabled;p.anim={popSpeed:t.speed,baseDelay:i?Math.min(20,.5*t.speed/Math.max(1,e)):0}}const t=ht({style:p.anim.baseDelay>0?"sequential":"none",index:a,baseDelay:p.anim.baseDelay});h.animatePop(b,{speed:p.anim.popSpeed,delay:t,onComplete:()=>h.animationCompleted(b)})}else n.globals.animationEnded=!0;return b.attr({rel:a,j:a,index:i,"default-marker-size":x.pSize}),c.setSelectionFilter(b,i,a),b}centerTextInBubble(t){const e=this.w;return{y:t+=parseInt(e.config.dataLabels.style.fontSize,10)/4}}}class yt{constructor(t,e=null){this.w=t,this.ctx=e}dataLabelsCorrection(t,e,s,i,a,r,o){const n=this.w;let l=!1;const h=new gt(this.w).getTextRects(s,o),c=h.width,d=h.height;e<0&&(e=0),e>n.layout.gridHeight+d&&(e=n.layout.gridHeight+d/2),void 0===n.globals.dataLabelsRects[i]&&(n.globals.dataLabelsRects[i]=[]),n.globals.dataLabelsRects[i].push({x:t,y:e,width:c,height:d});const g=n.globals.dataLabelsRects[i].length-2,p=void 0!==n.globals.lastDrawnDataLabelsIndexes[i]?n.globals.lastDrawnDataLabelsIndexes[i][n.globals.lastDrawnDataLabelsIndexes[i].length-1]:0;if(void 0!==n.globals.dataLabelsRects[i][g]){const s=n.globals.dataLabelsRects[i][p];(t>s.x+s.width||e>s.y+s.height||e+d<s.y||t+c<s.x)&&(l=!0)}return(0===a||r)&&(l=!0),{x:t,y:e,textRects:h,drawnextLabel:l}}drawDataLabel({type:t,pos:e,i:s,j:i,isRangeStart:a,strokeWidth:r=2}){const o=this.w,n=new gt(this.w),l=o.config.dataLabels;let h=0,c=0,d=i,g=null;if(-1!==o.globals.collapsedSeriesIndices.indexOf(s)||!l.enabled||!Array.isArray(e.x))return g;g=n.group({class:"apexcharts-data-labels"});for(let n=0;n<e.x.length;n++)if(h=e.x[n]+l.offsetX,c=e.y[n]+l.offsetY+r,!isNaN(h)){1===i&&0===n&&(d=0),1===i&&1===n&&(d=1);let r=o.seriesData.series[s][d];"rangeArea"===t&&(r=a?o.rangeData.seriesRangeStart[s][d]:o.rangeData.seriesRangeEnd[s][d]);let l="";const p=t=>o.config.dataLabels.formatter(t,{seriesIndex:s,dataPointIndex:d,w:o});if("bubble"===o.config.chart.type){r=o.seriesData.seriesZ[s][d],l=p(r),c=e.y[n];c=new bt(this.w,this.ctx).centerTextInBubble(c).y}else void 0!==r&&(l=p(r));let u=o.config.dataLabels.textAnchor;o.globals.isSlopeChart&&(u=0===d?"end":d===o.config.series[s].data.length-1?"start":"middle"),this.plotDataLabelsText({x:h,y:c,text:l,i:s,j:d,parent:g,offsetCorrection:!0,dataLabelsConfig:o.config.dataLabels,textAnchor:u})}return g}plotDataLabelsText(t){const e=this.w,s=new gt(this.w);let{x:i,y:a,i:r,j:o,text:n,textAnchor:l,fontSize:h,parent:c,dataLabelsConfig:d,color:g,alwaysDrawDataLabel:p,offsetCorrection:u,className:x}=t,f=null;if(Array.isArray(e.config.dataLabels.enabledOnSeries)&&e.config.dataLabels.enabledOnSeries.indexOf(r)<0)return f;let m={x:i,y:a,drawnextLabel:!0,textRects:null};if(u&&(m=this.dataLabelsCorrection(i,a,n,r,o,p,parseInt(d.style.fontSize,10).toString())),e.interact.zoomed||(i=m.x,a=m.y),m.textRects){const t=e.globals.barPadForNumericAxis||0;(i<-(t+20)-m.textRects.width||i>e.layout.gridWidth+m.textRects.width+t+30)&&(n="")}let b=e.globals.dataLabels.style.colors[r];(("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||e.config.dataLabels.distributed)&&(b=e.globals.dataLabels.style.colors[o]),"function"==typeof b&&(b=b({series:e.seriesData.series,seriesIndex:r,dataPointIndex:o,w:e})),g&&(b=g);let y=d.offsetX,w=d.offsetY;if("bar"!==e.config.chart.type&&"rangeBar"!==e.config.chart.type||(y=0,w=0),e.globals.isSlopeChart&&(0!==o&&(y=-2*d.offsetX+5),0!==o&&o!==e.config.series[r].data.length-1&&(y=0)),m.drawnextLabel){if("middle"===l&&i===e.layout.gridWidth&&(l="end"),f=s.drawText({x:i+y,y:a+w,foreColor:b,textAnchor:l||d.textAnchor,text:n,fontSize:h||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||"normal"}),f.attr({class:x||"apexcharts-datalabel",cx:i,cy:a}),d.dropShadow.enabled){const t=d.dropShadow;new dt(this.w).dropShadow(f,t)}c.add(f),nt(f,i,e),void 0===e.globals.lastDrawnDataLabelsIndexes[r]&&(e.globals.lastDrawnDataLabelsIndexes[r]=[]),e.globals.lastDrawnDataLabelsIndexes[r].push(o)}return f}addBackgroundToDataLabel(t,e){const s=this.w,i=s.config.dataLabels.background,a=i.padding,r=i.padding/2,o=e.width,n=e.height,l=new gt(this.w).drawRect(e.x-a,e.y-r/2,o+2*a,n+r,i.borderRadius,"transparent"!==s.config.chart.background&&s.config.chart.background?s.config.chart.background:"#fff",i.opacity,i.borderWidth,i.borderColor);if(i.dropShadow.enabled){new dt(this.w).dropShadow(l,i.dropShadow)}return l}dataLabelsBackground(){var t;const e=this.w;if("bubble"===e.config.chart.type)return;const s=e.dom.baseEl.querySelectorAll(".apexcharts-datalabels text");for(let i=0;i<s.length;i++){const a=s[i],r=a.getBBox();let o=null;if(r.width&&r.height&&(o=this.addBackgroundToDataLabel(a,r)),o){null==(t=a.parentNode)||t.insertBefore(o.node,a);const s=e.config.dataLabels.background.backgroundColor||a.getAttribute("fill");e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged?o.animate().attr({fill:s}):o.attr({fill:s}),a.setAttribute("fill",e.config.dataLabels.background.foreColor);const i=a.getAttribute("cx");null!==i&&nt(o,parseFloat(i),e)}}}bringForward(){const t=this.w,e=t.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),s=t.dom.baseEl.querySelector(".apexcharts-plot-series:last-child");for(let t=0;t<e.length;t++)s&&s.insertBefore(e[t],s.nextSibling)}}class wt{static invalidateAll(t){t&&t.globals&&(t.globals.cachedSelectors&&(t.globals.cachedSelectors={}),t.globals.domCache&&t.globals.domCache.clear(),t.globals.dimensionCache={})}static invalidateDimensions(t){t&&t.globals&&(t.globals.dimensionCache={})}static invalidateSelectors(t){t&&t.globals&&t.globals.cachedSelectors&&(t.globals.cachedSelectors={})}static getCachedSelector(t,e,s){return t&&t.globals?(t.globals.cachedSelectors||(t.globals.cachedSelectors={}),t.globals.cachedSelectors[e]||(t.globals.cachedSelectors[e]=s()),t.globals.cachedSelectors[e]):s()}static getCachedDimension(t,e,s,i=1e3){if(!t||!t.globals)return s();t.globals.dimensionCache||(t.globals.dimensionCache={});const a=t.globals.dimensionCache[e],r=Date.now();if(a&&a.lastUpdate&&r-a.lastUpdate<i)return a.value;const o=s();return t.globals.dimensionCache[e]={value:o,lastUpdate:r},o}static cacheDOMElement(t,e,s){t&&t.globals&&(t.globals.domCache||(t.globals.domCache=new Map),t.globals.domCache.set(e,s))}static getCachedDOMElement(t,e){return t&&t.globals&&t.globals.domCache&&t.globals.domCache.get(e)||null}}class vt{constructor(t,{theme:e=null,timeScale:s=null}={}){this.w=t,this.theme=e,this.timeScale=s}getLabel(t,e,s,i,a=[],r="12px",o=!0){const n=this.w,l=void 0===t[i]?"":t[i];let h=l;const c=n.formatters.xLabelFormatter,d=n.config.xaxis.labels.formatter,g=new w(this.w),p=l;o&&(h=g.xLabelFormat(c,l,p,{i:i,dateFormatter:new y(this.w).formatDate,w:n}),void 0!==d&&(h=d(l,t[i],{i:i,dateFormatter:new y(this.w).formatDate,w:n}))),e.length>0?(s=e[i].position,h=e[i].value):"datetime"===n.config.xaxis.type&&void 0===d&&(h=""),void 0===h&&(h=""),h=Array.isArray(h)?h:h.toString();const u=new gt(this.w);let x={};x=n.layout.rotateXLabels&&o?u.getTextRects(h,parseInt(r,10).toString(),null,`rotate(${n.config.xaxis.labels.rotate} 0 0)`,!1):u.getTextRects(h,parseInt(r,10).toString());const f=!n.config.xaxis.labels.showDuplicates&&this.timeScale;return!Array.isArray(h)&&("NaN"===String(h)||a.indexOf(h)>=0&&f)&&(h=""),{x:s,text:h,textRect:x}}checkLabelBasedOnTickamount(t,e,s){const i=this.w;let a=i.config.xaxis.tickAmount;if("dataPoints"===a&&(a=Math.round(i.layout.gridWidth/120)),a>s)return e;return t%Math.round(s/(a+1))===0||(e.text=""),e}checkForOverflowingLabels(t,e,s,i,a){const r=this.w;if(0===t&&r.globals.skipFirstTimelinelabel&&(e.text=""),t===s-1&&r.globals.skipLastTimelinelabel&&(e.text=""),r.config.xaxis.labels.hideOverlappingLabels&&i.length>0){const t=a[a.length-1];if(r.config.xaxis.labels.trim&&"datetime"!==r.config.xaxis.type)return e;e.x<t.textRect.width/(r.layout.rotateXLabels?Math.abs(r.config.xaxis.labels.rotate)/12:1.01)+t.x&&(e.text="")}return e}checkForReversedLabels(t,e){const s=this.w;return s.config.yaxis[t]&&s.config.yaxis[t].reversed&&e.reverse(),e}yAxisAllSeriesCollapsed(t){const e=this.w.globals;return!e.seriesYAxisMap[t].some(t=>-1===e.collapsedSeriesIndices.indexOf(t))}translateYAxisIndex(t){const e=this.w,s=e.globals,i=e.config.yaxis;return e.seriesData.series.length>i.length||i.some(t=>Array.isArray(t.seriesName))?t:s.seriesYAxisReverseMap[t]}isYAxisHidden(t){const e=this.w,s=e.config.yaxis[t];if(!s.show||this.yAxisAllSeriesCollapsed(t))return!0;if(!s.showForNullSeries){const s=e.globals.seriesYAxisMap[t],i=new P(this.w);return s.every(t=>i.isSeriesNull(t))}return!1}getYAxisForeColor(t,e){var s;const i=this.w;return Array.isArray(t)&&i.globals.yAxisScale[e]&&(null==(s=this.theme)||s.pushExtraColors(t,i.globals.yAxisScale[e].result.length,!1)),t}drawYAxisTicks(t,e,s,i,a,r,o){const n=this.w,l=new gt(this.w);let h=n.layout.translateY+n.config.yaxis[a].labels.offsetY;if(n.globals.isBarHorizontal?h=0:"heatmap"===n.config.chart.type&&(h+=r/2),i.show&&e>0){!0===n.config.yaxis[a].opposite&&(t+=i.width);for(let a=e;a>=0;a--){const e=l.drawLine(t+s.offsetX-i.width+i.offsetX,h+i.offsetY,t+s.offsetX+i.offsetX,h+i.offsetY,i.color);o.add(e),h+=r}}}}class At{constructor(t,e,s){this.w=t,this.ctx=e,this.elgrid=s,this.axesUtils=new vt(t,{theme:e.theme,timeScale:e.timeScale}),this.xaxisLabels=t.labelData.labels.slice(),t.labelData.timescaleLabels.length>0&&!t.globals.isBarHorizontal&&(this.xaxisLabels=t.labelData.timescaleLabels.slice()),t.config.xaxis.overwriteCategories&&(this.xaxisLabels=t.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===t.config.xaxis.position?this.offY=0:this.offY=t.layout.gridHeight,this.offY=this.offY+t.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===t.config.chart.type&&t.config.plotOptions.bar.horizontal,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.xaxisBorderWidth=t.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=t.config.yaxis[0].axisBorder.width.toString()),String(this.xaxisBorderWidth).indexOf("%")>-1?this.xaxisBorderWidth=t.layout.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=t.config.xaxis.axisBorder.height,this.yaxis=t.config.yaxis[0]}drawXaxis(){const t=this.w,e=new gt(this.w),s=e.group({class:"apexcharts-xaxis",transform:`translate(${t.config.xaxis.offsetX}, ${t.config.xaxis.offsetY})`}),i=e.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${t.layout.translateXAxisX}, ${t.layout.translateXAxisY})`});s.add(i);let a=[];for(let t=0;t<this.xaxisLabels.length;t++)a.push(this.xaxisLabels[t]);if(this.drawXAxisLabelAndGroup(!0,e,i,a,t.axisFlags.isXNumeric,(t,e)=>e),t.labelData.hasXaxisGroups){const s=t.labelData.groups;a=[];for(let t=0;t<s.length;t++)a.push(s[t].title);const r={};t.config.xaxis.group.style&&(r.xaxisFontSize=t.config.xaxis.group.style.fontSize,r.xaxisFontFamily=t.config.xaxis.group.style.fontFamily,r.xaxisForeColors=t.config.xaxis.group.style.colors,r.fontWeight=t.config.xaxis.group.style.fontWeight,r.cssClass=t.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,e,i,a,!1,(t,e)=>s[t].cols*e,r)}if(void 0!==t.config.xaxis.title.text){const i=e.group({class:"apexcharts-xaxis-title"}),a=e.drawText({x:t.layout.gridWidth/2+t.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+("bottom"===t.config.xaxis.position?t.layout.xAxisLabelsHeight:-t.layout.xAxisLabelsHeight-10)+t.config.xaxis.title.offsetY,text:t.config.xaxis.title.text,textAnchor:"middle",fontSize:t.config.xaxis.title.style.fontSize,fontFamily:t.config.xaxis.title.style.fontFamily,fontWeight:t.config.xaxis.title.style.fontWeight,foreColor:t.config.xaxis.title.style.color,cssClass:"apexcharts-xaxis-title-text "+t.config.xaxis.title.style.cssClass});i.add(a),s.add(i)}if(t.config.xaxis.axisBorder.show){const i=t.globals.barPadForNumericAxis,a=e.drawLine(t.globals.padHorizontal+t.config.xaxis.axisBorder.offsetX-i,this.offY,this.xaxisBorderWidth+i,this.offY,t.config.xaxis.axisBorder.color,0,this.xaxisBorderHeight);this.elgrid&&this.elgrid.elGridBorders&&t.config.grid.show?this.elgrid.elGridBorders.add(a):s.add(a)}return s}drawXAxisLabelAndGroup(t,e,s,i,a,r,o={}){var n,l;const h=[],c=[],d=this.w,g=o.xaxisFontSize||this.xaxisFontSize,p=o.xaxisFontFamily||this.xaxisFontFamily,u=o.xaxisForeColors||this.xaxisForeColors,x=o.fontWeight||d.config.xaxis.labels.style.fontWeight,f=o.cssClass||d.config.xaxis.labels.style.cssClass;let b,y=d.globals.padHorizontal;const w=i.length;let v="category"===d.config.xaxis.type?d.globals.dataPoints:w;if(0===v&&w>v&&(v=w),a){const t=Math.max(Number(d.config.xaxis.tickAmount)||1,v>1?v-1:v);b=d.layout.gridWidth/Math.min(t,w-1),y=y+r(0,b)/2+d.config.xaxis.labels.offsetX}else b=d.layout.gridWidth/v,y=y+r(0,b)+d.config.xaxis.labels.offsetX;for(let a=0;a<=w-1;a++){let o=y-r(a,b)/2+d.config.xaxis.labels.offsetX;0===a&&1===w&&b/2===y&&1===v&&(o=d.layout.gridWidth/2);let A=this.axesUtils.getLabel(i,d.labelData.timescaleLabels,o,a,h,g,t),C=28;d.layout.rotateXLabels&&t&&(C=22),d.config.xaxis.title.text&&"top"===d.config.xaxis.position&&(C+=parseFloat(d.config.xaxis.title.style.fontSize)+2),t||(C=C+parseFloat(g)+(d.layout.xAxisLabelsHeight-d.layout.xAxisGroupLabelsHeight)+(d.layout.rotateXLabels?10:0));A=void 0!==d.config.xaxis.tickAmount&&"dataPoints"!==d.config.xaxis.tickAmount&&"datetime"!==d.config.xaxis.type?this.axesUtils.checkLabelBasedOnTickamount(a,A,w):this.axesUtils.checkForOverflowingLabels(a,A,w,h,c);const S=()=>t&&d.config.xaxis.convertedCatToNumeric?u[d.globals.minX+a-1]:u[a],k=(null!=(l=null==(n=A.textRect)?void 0:n.width)?l:0)/2,_=A.x+k<0;if(d.config.xaxis.labels.show&&!_){const i=e.drawText({x:A.x,y:this.offY+d.config.xaxis.labels.offsetY+C-("top"===d.config.xaxis.position?d.layout.xAxisHeight+d.config.xaxis.axisTicks.height-2:0),text:A.text,textAnchor:"middle",fontWeight:x,fontSize:g,fontFamily:p,foreColor:Array.isArray(u)?S():u,isPlainText:!1,cssClass:(t?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+f});if(s.add(i),i.on("click",t=>{if("function"==typeof d.config.chart.events.xAxisLabelClick){const e=Object.assign({},d,{labelIndex:a});d.config.chart.events.xAxisLabelClick(t,this.ctx,e)}}),t){const t=m.createElementNS(F,"title");t.textContent=Array.isArray(A.text)?A.text.join(" "):A.text,i.node.appendChild(t),""!==A.text&&(h.push(A.text),c.push(A))}}a<w-1&&(y+=r(a+1,b))}}drawXaxisInversed(t){const e=this.w,s=new gt(this.w),i=e.config.yaxis[0].opposite?e.globals.translateYAxisX[t]:0,a=s.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:t}),r=s.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+i+", 0)"});a.add(r);const o=[];if(e.config.yaxis[t].show)for(let t=0;t<this.xaxisLabels.length;t++)o.push(this.xaxisLabels[t]);const n=e.layout.gridHeight/o.length;let l=-n/2.2;const h=e.formatters.yLabelFormatters[0],c=e.config.yaxis[0].labels;if(c.show)for(let i=0;i<=o.length-1;i++){let a=void 0===o[i]?"":o[i];a=h(a,{seriesIndex:t,dataPointIndex:i,w:e});const d=this.axesUtils.getYAxisForeColor(c.style.colors,t),g=()=>Array.isArray(d)?d[i]:d;let p=0;Array.isArray(a)&&(p=a.length/2*parseInt(c.style.fontSize,10));let u=c.offsetX-15,x="end";this.yaxis.opposite&&(x="start"),"left"===e.config.yaxis[0].labels.align?(u=c.offsetX,x="start"):"center"===e.config.yaxis[0].labels.align?(u=c.offsetX,x="middle"):"right"===e.config.yaxis[0].labels.align&&(x="end");const f=s.drawText({x:u,y:l+n+c.offsetY-p,text:a,textAnchor:x,foreColor:g(),fontSize:c.style.fontSize,fontFamily:c.style.fontFamily,fontWeight:c.style.fontWeight,isPlainText:!1,cssClass:"apexcharts-yaxis-label "+c.style.cssClass,maxWidth:c.maxWidth});r.add(f),f.on("click",t=>{if("function"==typeof e.config.chart.events.xAxisLabelClick){const s=Object.assign({},e,{labelIndex:i});e.config.chart.events.xAxisLabelClick(t,this.ctx,s)}});const b=m.createElementNS(F,"title");if(b.textContent=Array.isArray(a)?a.join(" "):a,f.node.appendChild(b),0!==e.config.yaxis[t].labels.rotate){const i=s.rotateAroundCenter(f.node);f.node.setAttribute("transform",`rotate(${e.config.yaxis[t].labels.rotate} 0 ${i.y})`)}l+=n}if(void 0!==e.config.yaxis[0].title.text){const t=s.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+i+", 0)"}),r=s.drawText({x:e.config.yaxis[0].title.offsetX,y:e.layout.gridHeight/2+e.config.yaxis[0].title.offsetY,text:e.config.yaxis[0].title.text,textAnchor:"middle",foreColor:e.config.yaxis[0].title.style.color,fontSize:e.config.yaxis[0].title.style.fontSize,fontWeight:e.config.yaxis[0].title.style.fontWeight,fontFamily:e.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+e.config.yaxis[0].title.style.cssClass});t.add(r),a.add(t)}let d=0;this.isCategoryBarHorizontal&&e.config.yaxis[0].opposite&&(d=e.layout.gridWidth);const g=e.config.xaxis.axisBorder;if(g.show){const t=s.drawLine(e.globals.padHorizontal+g.offsetX+d,1+g.offsetY,e.globals.padHorizontal+g.offsetX+d,e.layout.gridHeight+g.offsetY,g.color,0);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(t):a.add(t)}return e.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(d,o.length,e.config.yaxis[0].axisBorder,e.config.yaxis[0].axisTicks,0,n,a),a}drawXaxisTicks(t,e,s){const i=this.w,a=t;if(t<0||t-2>i.layout.gridWidth)return;const r=this.offY+i.config.xaxis.axisTicks.offsetY;if(e=e+r+i.config.xaxis.axisTicks.height,"top"===i.config.xaxis.position&&(e=r-i.config.xaxis.axisTicks.height),i.config.xaxis.axisTicks.show){const o=new gt(this.w).drawLine(t+i.config.xaxis.axisTicks.offsetX,r+i.config.xaxis.offsetY,a+i.config.xaxis.axisTicks.offsetX,e+i.config.xaxis.offsetY,i.config.xaxis.axisTicks.color);s.add(o),o.node.classList.add("apexcharts-xaxis-tick")}}getXAxisTicksPositions(){const t=this.w,e=[],s=this.xaxisLabels.length;let i=t.globals.padHorizontal;if(t.labelData.timescaleLabels.length>0)for(let t=0;t<s;t++)i=this.xaxisLabels[t].position,e.push(i);else{const a=s;for(let s=0;s<a;s++){let s=a;t.axisFlags.isXNumeric&&"bar"!==t.config.chart.type&&(s-=1),i+=t.layout.gridWidth/s,e.push(i)}}return e}xAxisLabelCorrections(){var t,e,s;const i=this.w,a=new gt(this.w),r=i.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),o=i.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),n=i.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),l=i.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(i.layout.rotateXLabels||i.config.xaxis.labels.rotateAlways)for(let t=0;t<o.length;t++){const e=a.rotateAroundCenter(o[t]);e.y=e.y-1,e.x=e.x+1,o[t].setAttribute("transform",`rotate(${i.config.xaxis.labels.rotate} ${e.x} ${e.y})`),o[t].setAttribute("text-anchor","end"),null==r||r.setAttribute("transform","translate(0, -10)");const s=o[t].childNodes;i.config.xaxis.labels.trim&&Array.prototype.forEach.call(s,t=>{a.placeTextWithEllipsis(t,t.textContent,i.layout.xAxisLabelsHeight-("bottom"===i.config.legend.position?20:10))})}else{const t=i.layout.gridWidth/(i.labelData.labels.length+1);for(let e=0;e<o.length;e++){const s=o[e].childNodes;i.config.xaxis.labels.trim&&"datetime"!==i.config.xaxis.type&&Array.prototype.forEach.call(s,e=>{a.placeTextWithEllipsis(e,e.textContent,t)})}}if(n.length>0){const r=n[n.length-1].getBBox(),o=n[0].getBBox();r.x<-20&&(null==(t=n[n.length-1].parentNode)||t.removeChild(n[n.length-1])),o.x+o.width>i.layout.gridWidth&&!i.globals.isBarHorizontal&&(null==(e=n[0].parentNode)||e.removeChild(n[0]));for(let t=0;t<l.length;t++)a.placeTextWithEllipsis(l[t],null!=(s=l[t].textContent)?s:"",i.config.yaxis[0].labels.maxWidth-(i.config.yaxis[0].title.text?2*parseFloat(i.config.yaxis[0].title.style.fontSize):0)-15)}}}class Ct{constructor(t,e){this.w=t,this.ctx=e,this.xaxisLabels=t.labelData.labels.slice(),this.axesUtils=new vt(e.w,{theme:e.theme,timeScale:e.timeScale}),this.isRangeBar=t.rangeData.seriesRange.length&&t.globals.isBarHorizontal,t.labelData.timescaleLabels.length>0&&(this.xaxisLabels=t.labelData.timescaleLabels.slice())}drawGridArea(t=null){const e=this.w,s=new gt(this.w);t||(t=s.group({class:"apexcharts-grid"}));const i=s.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.layout.gridHeight,"transparent"),a=s.drawLine(e.globals.padHorizontal,e.layout.gridHeight,e.layout.gridWidth,e.layout.gridHeight,"transparent");return t.add(a),t.add(i),t}drawGrid(){if(this.w.globals.axisCharts){const t=this.renderGrid();return this.drawGridArea(t.el),t}return null}createGridMask(){const t=this.w,e=t.globals,s=new gt(this.w),i=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width,a=t=>{const e=m.createElementNS(F,"clipPath");return e.setAttribute("id",t),e};t.dom.elGridRectMask=a(`gridRectMask${e.cuid}`),t.dom.elGridRectBarMask=a(`gridRectBarMask${e.cuid}`),t.dom.elGridRectMarkerMask=a(`gridRectMarkerMask${e.cuid}`),t.dom.elForecastMask=a(`forecastMask${e.cuid}`),t.dom.elNonForecastMask=a(`nonForecastMask${e.cuid}`);let r=0,o=0;(["bar","rangeBar","candlestick","boxPlot","violin"].includes(t.config.chart.type)||t.globals.comboBarCount>0)&&t.axisFlags.isXNumeric&&!t.globals.isBarHorizontal&&(r=Math.max(t.config.grid.padding.left,e.barPadForNumericAxis),o=Math.max(t.config.grid.padding.right,e.barPadForNumericAxis)),t.dom.elGridRect=s.drawRect(-i/2-2,-i/2-2,t.layout.gridWidth+i+4,t.layout.gridHeight+i+4,0,"#fff"),t.dom.elGridRectBar=s.drawRect(-i/2-r-2,-i/2-2,t.layout.gridWidth+i+o+r+4,t.layout.gridHeight+i+4,0,"#fff");const n=t.globals.markers.largestSize;t.dom.elGridRectMarker=s.drawRect(Math.min(-i/2-r-2,-n),-n,t.layout.gridWidth+Math.max(i+o+r+4,2*n),t.layout.gridHeight+2*n,0,"#fff"),t.dom.elGridRectMask.appendChild(t.dom.elGridRect.node),t.dom.elGridRectBarMask.appendChild(t.dom.elGridRectBar.node),t.dom.elGridRectMarkerMask.appendChild(t.dom.elGridRectMarker.node);const l=t.dom.elDefs.node;l.appendChild(t.dom.elGridRectMask),l.appendChild(t.dom.elGridRectBarMask),l.appendChild(t.dom.elGridRectMarkerMask),l.appendChild(t.dom.elForecastMask),l.appendChild(t.dom.elNonForecastMask)}_drawGridLines({i:t,x1:e,y1:s,x2:i,y2:a,xCount:r,parent:o}){const n=this.w;if(!(0===t&&n.globals.skipFirstTimelinelabel||t===r-1&&n.globals.skipLastTimelinelabel&&!n.config.xaxis.labels.formatter||"radar"===n.config.chart.type)){n.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:r,parent:o});let l=0;if(n.labelData.hasXaxisGroups&&"between"===n.config.xaxis.tickPlacement){const e=n.labelData.groups;if(e){let s=0;for(let i=0;s<t&&i<e.length;i++)s+=e[i].cols;s===t&&(l=.6*n.layout.xAxisLabelsHeight)}}new At(this.w,this.ctx).drawXaxisTicks(e,l,n.dom.elGraphical)}}_drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:r,parent:o}){const n=this.w,l=o.node.classList.contains("apexcharts-gridlines-horizontal"),h=n.globals.barPadForNumericAxis,c=0===s&&0===a||0===e&&0===i||s===n.layout.gridHeight&&a===n.layout.gridHeight||n.globals.isBarHorizontal&&(0===t||t===r-1),d=new gt(this.w).drawLine(e-(l?h:0),s,i+(l?h:0),a,n.config.grid.borderColor,n.config.grid.strokeDashArray);d.node.classList.add("apexcharts-gridline"),c&&n.config.grid.show?this.elGridBorders.add(d):o.add(d)}_drawGridBandRect({c:t,x1:e,y1:s,x2:i,y2:a,type:r}){const o=this.w,n=new gt(this.w),l=o.globals.barPadForNumericAxis,h=o.config.grid[r].colors[t],c=n.drawRect(e-("row"===r?l:0),s,i+("row"===r?2*l:0),a,0,h,o.config.grid[r].opacity);this.elg.add(c),c.attr("clip-path",`url(#gridRectMask${o.globals.cuid})`),c.node.classList.add(`apexcharts-grid-${r}`)}_drawXYLines({xCount:t,tickAmount:e}){var s;const i=this.w,a=({xC:e,x1:s,y1:i,x2:a,y2:r})=>{for(let o=0;o<e;o++)s=this.xaxisLabels[o].position,a=this.xaxisLabels[o].position,this._drawGridLines({i:o,x1:s,y1:i,x2:a,y2:r,xCount:t,parent:this.elgridLinesV})},r=({xC:e,x1:s,y1:a,x2:r,y2:o})=>{for(let n=0;n<e+(i.axisFlags.isXNumeric?0:1);n++)0===n&&1===e&&1===i.globals.dataPoints&&(r=s=i.layout.gridWidth/2),this._drawGridLines({i:n,x1:s,y1:a,x2:r,y2:o,xCount:t,parent:this.elgridLinesV}),r=s+=i.layout.gridWidth/(i.axisFlags.isXNumeric?e-1:e)};if(i.config.grid.xaxis.lines.show||i.config.xaxis.axisTicks.show){const e=i.globals.padHorizontal,o=0;let n;const l=i.layout.gridHeight;i.labelData.timescaleLabels.length?a({xC:t,x1:e,y1:o,x2:n,y2:l}):(i.axisFlags.isXNumeric&&(t=null==(s=i.globals.xAxisScale)?void 0:s.result.length),r({xC:t,x1:e,y1:o,x2:n,y2:l}))}if(i.config.grid.yaxis.lines.show){const t=0;let s=0,a=0;const r=i.layout.gridWidth;let o=e+1;this.isRangeBar&&(o=i.labelData.labels.length);for(let n=0;n<o+(this.isRangeBar?1:0);n++)this._drawGridLine({i:n,xCount:o+(this.isRangeBar?1:0),x1:t,y1:s,x2:r,y2:a,parent:this.elgridLinesH}),s+=i.layout.gridHeight/(this.isRangeBar?o:e),a=s}}_drawInvertedXYLines({xCount:t}){const e=this.w;if(e.config.grid.xaxis.lines.show||e.config.xaxis.axisTicks.show){let s=e.globals.padHorizontal;const i=0;let a;const r=e.layout.gridHeight;for(let o=0;o<t+1;o++){e.config.grid.xaxis.lines.show&&this._drawGridLine({i:o,xCount:t+1,x1:s,y1:i,x2:a,y2:r,parent:this.elgridLinesV});new At(this.w,this.ctx).drawXaxisTicks(s,0,e.dom.elGraphical),s+=e.layout.gridWidth/t,a=s}}if(e.config.grid.yaxis.lines.show){const t=0;let s=0,i=0;const a=e.layout.gridWidth;for(let r=0;r<e.globals.dataPoints+1;r++)this._drawGridLine({i:r,xCount:e.globals.dataPoints+1,x1:t,y1:s,x2:a,y2:i,parent:this.elgridLinesH}),s+=e.layout.gridHeight/e.globals.dataPoints,i=s}}renderGrid(){var t,e,s;const i=this.w,a=i.globals,r=new gt(this.w);this.elg=r.group({class:"apexcharts-grid"}),this.elgridLinesH=r.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=r.group({class:"apexcharts-gridlines-vertical"}),this.elGridBorders=r.group({class:"apexcharts-grid-borders"}),this.elg.add(this.elgridLinesH),this.elg.add(this.elgridLinesV),i.config.grid.show||(this.elgridLinesV.hide(),this.elgridLinesH.hide(),this.elGridBorders.hide());let o=0;for(;o<a.seriesYAxisMap.length&&a.ignoreYAxisIndexes.includes(o);)o++;o===a.seriesYAxisMap.length&&(o=0);let n,l=a.yAxisScale[o].result.length-1;return!a.isBarHorizontal||this.isRangeBar?(n=this.xaxisLabels.length,this.isRangeBar&&(l=i.labelData.labels.length,i.config.xaxis.tickAmount&&i.config.xaxis.labels.formatter&&(n=i.config.xaxis.tickAmount),(null==(s=null==(e=null==(t=a.yAxisScale)?void 0:t[o])?void 0:e.result)?void 0:s.length)>0&&"datetime"!==i.config.xaxis.type&&(n=a.yAxisScale[o].result.length-1)),this._drawXYLines({xCount:n,tickAmount:l})):(n=l,l=a.xTickAmount,this._drawInvertedXYLines({xCount:n,tickAmount:l})),this.drawGridBands(n,l),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:i.layout.gridWidth/n}}drawGridBands(t,e){var s,i,a,r,o;const n=this.w,l=(t,s,i,a,r,o)=>{for(let l=0,h=0;l<s;l++,h++)h>=n.config.grid[t].colors.length&&(h=0),this._drawGridBandRect({c:h,x1:i,y1:a,x2:r,y2:o,type:t}),a+=n.layout.gridHeight/e};if((null==(s=n.config.grid.row.colors)?void 0:s.length)>0&&l("row",e,0,0,n.layout.gridWidth,n.layout.gridHeight/e),(null==(i=n.config.grid.column.colors)?void 0:i.length)>0){let e=n.globals.isBarHorizontal||"on"!==n.config.xaxis.tickPlacement||"category"!==n.config.xaxis.type&&!n.config.xaxis.convertedCatToNumeric?t:t-1;n.axisFlags.isXNumeric&&(e=(null!=(r=null==(a=n.globals.xAxisScale)?void 0:a.result.length)?r:1)-1);let s=n.globals.padHorizontal;const i=0;let l=n.globals.padHorizontal+n.layout.gridWidth/e;const h=n.layout.gridHeight;for(let a=0,r=0;a<t;a++,r++)r>=n.config.grid.column.colors.length&&(r=0),"datetime"===n.config.xaxis.type&&(s=this.xaxisLabels[a].position,l=((null==(o=this.xaxisLabels[a+1])?void 0:o.position)||n.layout.gridWidth)-this.xaxisLabels[a].position),this._drawGridBandRect({c:r,x1:s,y1:i,x2:l,y2:h,type:"column"}),s+=n.layout.gridWidth/e}}}class St{constructor(t){this.w=t,this.coreUtils=new P(this.w)}niceScale(t,e,s=0){const i=1e-11,a=this.w,r=a.globals;let o,n,l,h;r.isBarHorizontal?(o=a.config.xaxis,n=Math.max((r.svgWidth-100)/25,2)):(o=a.config.yaxis[s],n=Math.max((r.svgHeight-100)/15,2)),b.isNumber(n)||(n=10),l=void 0!==o.min&&null!==o.min,h=void 0!==o.max&&null!==o.min;let c=void 0!==o.stepSize&&null!==o.stepSize,d=void 0!==o.tickAmount&&null!==o.tickAmount,g=d?o.tickAmount:M[Math.min(Math.round(n/2),M.length-1)];if(r.isMultipleYAxis&&!d&&r.multiAxisTickAmount>0&&(g=r.multiAxisTickAmount,d=!0),g="dataPoints"===g?r.dataPoints-1:Math.abs(Math.round(g)),(t===Number.MIN_VALUE&&0===e||!b.isNumber(t)&&!b.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE)&&(t=b.isNumber(o.min)?o.min:0,e=b.isNumber(o.max)?o.max:t+g,r.allSeriesCollapsed=!1),t>e){const s=e;e=t,t=s}else t===e&&(t=0===t?0:t-1,e=0===e?2:e+1);const p=[];g<1&&(g=1);let u=g,x=Math.abs(e-t);!l&&t>0&&t/x<.15&&(t=0,l=!0),!h&&e<0&&-e/x<.15&&(e=0,h=!0),x=Math.abs(e-t);let f=x/u,m=f;const y=Math.floor(Math.log10(m)),w=Math.pow(10,y);let v=Math.ceil(m/w);if(v=L[0===r.yValueDecimal?0:1][v],m=v*w,f=m,r.isBarHorizontal&&o.stepSize&&"datetime"!==o.type?(f=o.stepSize,c=!0):c&&(f=o.stepSize),c&&o.forceNiceScale){const t=Math.floor(Math.log10(f));f*=Math.pow(10,y-t)}if(l&&h){let t=x/u;if(d)if(c)if(0!=b.mod(x,f)){const e=b.getGCD(f,t);f=t/e<10?e:t}else 0==b.mod(f,t)?f=t:(t=f,d=!1);else f=t;else if(c)0==b.mod(x,f)?t=f:f=t;else if(0==b.mod(x,f))t=f;else{u=Math.ceil(x/f),t=x/u;const e=b.getGCD(x,f);x/e<n&&(t=e),f=t}u=Math.round(x/f)}else{if(l||h){if(h)if(d)t=e-f*u;else{const s=t;t=f*Math.floor(t/f),Math.abs(e-t)/b.getGCD(x,f)>n&&(t=e-f*g,t+=f*Math.floor((s-t)/f))}else if(l)if(d)e=t+f*u;else{const s=e;e=f*Math.ceil(e/f),Math.abs(e-t)/b.getGCD(x,f)>n&&(e=t+f*g,e+=f*Math.ceil((s-e)/f))}}else if(r.isMultipleYAxis&&d){const s=f*Math.floor(t/f);let i=s+f*u;i<e&&(f*=2),i=e,e=(t=s)+f*u,x=Math.abs(e-t),t>0&&t<Math.abs(i-e)&&(t=0,e=f*u),e<0&&-e<Math.abs(s-t)&&(e=0,t=-f*u)}else t=f*Math.floor(t/f),e=f*Math.ceil(e/f);x=Math.abs(e-t),f=b.getGCD(x,f),u=Math.round(x/f)}if(d||l||h||(u=Math.ceil((x-i)/(f+i)),u>16&&b.getPrimeFactors(u).length<2&&u++),!d&&o.forceNiceScale&&0===r.yValueDecimal&&u>x&&(u=x,f=Math.round(x/u)),u>n&&(!d&&!c||o.forceNiceScale)){const t=b.getPrimeFactors(u),e=t.length-1;let s=u;t:for(var A=0;A<e;A++)for(var C=0;C<=e-A;C++){const i=Math.min(C+A,e);let a=s,r=1;for(var S=C;S<=i;S++)r*=t[S];if(a/=r,a<n){s=a;break t}}f=s===u?x:x/s,u=Math.round(x/f)}r.isMultipleYAxis&&0==r.multiAxisTickAmount&&r.ignoreYAxisIndexes.indexOf(s)<0&&(r.multiAxisTickAmount=u);let k=t-f;const _=f*i;do{k+=f,p.push(b.stripNumber(k,7))}while(e-k>_);return{result:p,niceMin:p[0],niceMax:p[p.length-1]}}linearScale(t,e,s=10,i=0,a=void 0){const r=Math.abs(e-t);let o=[];if(t===e)return o=[t],{result:o,niceMin:o[0],niceMax:o[o.length-1]};"dataPoints"===(s=this._adjustTicksForSmallRange(s,i,r))&&(s=this.w.globals.dataPoints-1);const n=s;a||(a=r/n);if(0!==a&&isFinite(a)){const t=Math.floor(Math.log10(Math.abs(a))),e=Math.max(2,2-t),s=Math.pow(10,e);a=Math.round((a+Number.EPSILON)*s)/s}let l=s===Number.MAX_VALUE?5:n;s===Number.MAX_VALUE&&(a=1);let h=t;for(;l>=0;)o.push(h),h=b.preciseAddition(h,a),l-=1;return{result:o,niceMin:o[0],niceMax:o[o.length-1]}}logarithmicScaleNice(t,e,s){e<=0&&(e=Math.max(t,s)),t<=0&&(t=Math.min(e,s));const i=[],a=Math.ceil(Math.log(e)/Math.log(s)+1);for(let e=Math.floor(Math.log(t)/Math.log(s));e<a;e++)i.push(Math.pow(s,e));return{result:i,niceMin:i[0],niceMax:i[i.length-1]}}logarithmicScale(t,e,s){e<=0&&(e=Math.max(t,s)),t<=0&&(t=Math.min(e,s));const i=[],a=Math.log(e)/Math.log(s),r=Math.log(t)/Math.log(s),o=a-r,n=Math.round(o),l=o/n;for(let t=0,e=r;t<n;t++,e+=l)i.push(Math.pow(s,e));return i.push(Math.pow(s,a)),{result:i,niceMin:t,niceMax:e}}_adjustTicksForSmallRange(t,e,s){let i=t;if(void 0!==e&&this.w.config.yaxis[e].labels.formatter&&void 0===this.w.config.yaxis[e].tickAmount){const t=Number(this.w.config.yaxis[e].labels.formatter(1));b.isNumber(t)&&0===this.w.globals.yValueDecimal&&(i=Math.ceil(s))}return i<t?i:t}setYScaleForIndex(t,e,s){const i=this.w.globals,a=this.w.config,r=i.isBarHorizontal?a.xaxis:a.yaxis[t];void 0===i.yAxisScale[t]&&(i.yAxisScale[t]=[]);const o=Math.abs(s-e);r.logarithmic&&o<=5&&(i.invalidLogScale=!0),r.logarithmic&&o>5?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=r.forceNiceScale?this.logarithmicScaleNice(e,s,r.logBase):this.logarithmicScale(e,s,r.logBase)):s!==-Number.MAX_VALUE&&b.isNumber(s)&&e!==Number.MAX_VALUE&&b.isNumber(e)?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=this.niceScale(e,s,t)):i.yAxisScale[t]=this.niceScale(Number.MIN_VALUE,0,t)}setXScale(t,e){const s=this.w,i=s.globals;if(e!==-Number.MAX_VALUE&&b.isNumber(e)){const a=i.xTickAmount;i.xAxisScale=this.linearScale(t,e,a,0,void 0===s.config.xaxis.max?s.config.xaxis.stepSize:void 0)}else i.xAxisScale=this.linearScale(0,10,10);return i.xAxisScale}scaleMultipleYAxes(){const t=this.w.config,e=this.w.globals;this.coreUtils.setSeriesYAxisMappings();const s=e.seriesYAxisMap,i=e.minYArr,a=e.maxYArr,r=[],o=!e.isBarHorizontal;if(e.allSeriesCollapsed=!0,e.barGroups=[],s.forEach((s,n)=>{const l=[];if(s.forEach(e=>{var s;const i=null==(s=t.series[e])?void 0:s.group;l.indexOf(i)<0&&l.push(i)}),s.length>0){let h,c,d=Number.MAX_VALUE,g=-Number.MAX_VALUE,p=d,u=g;if(t.chart.stacked){const i=new Array(e.dataPoints).fill(0),a=[],r=[],o=[];l.forEach(()=>{a.push(i.map(()=>Number.MIN_VALUE)),r.push(i.map(()=>Number.MIN_VALUE)),o.push(i.map(()=>Number.MIN_VALUE))});for(let i=0;i<s.length;i++){!h&&t.series[s[i]].type&&(h=t.series[s[i]].type);const d=s[i];c=t.series[d].group?t.series[d].group:"axis-".concat(n.toString());!(e.collapsedSeriesIndices.indexOf(d)<0&&e.ancillaryCollapsedSeriesIndices.indexOf(d)<0)||(e.allSeriesCollapsed=!1,l.forEach((e,s)=>{if(t.series[d].group===e)for(let t=0;t<this.w.seriesData.series[d].length;t++){const e=this.w.seriesData.series[d][t];e>=0?r[s][t]+=e:o[s][t]+=e,a[s][t]+=e,p=Math.min(p,e),u=Math.max(u,e)}})),"bar"!==h&&"column"!==h||e.barGroups.push(c)}h||(h=t.chart.type),"bar"===h||"column"===h?l.forEach((t,e)=>{d=Math.min(d,Math.min.apply(null,o[e])),g=Math.max(g,Math.max.apply(null,r[e]))}):(l.forEach((t,e)=>{p=Math.min(p,Math.min.apply(null,a[e])),u=Math.max(u,Math.max.apply(null,a[e]))}),d=p,g=u),d===Number.MIN_VALUE&&g===Number.MIN_VALUE&&(g=-Number.MAX_VALUE)}else for(let t=0;t<s.length;t++){const r=s[t];d=Math.min(d,i[r]),g=Math.max(g,a[r]);!(e.collapsedSeriesIndices.indexOf(r)<0&&e.ancillaryCollapsedSeriesIndices.indexOf(r)<0)||(e.allSeriesCollapsed=!1)}void 0!==t.yaxis[n].min&&(d="function"==typeof t.yaxis[n].min?t.yaxis[n].min(d):t.yaxis[n].min),void 0!==t.yaxis[n].max&&(g="function"==typeof t.yaxis[n].max?t.yaxis[n].max(g):t.yaxis[n].max),e.barGroups=e.barGroups.filter((t,e,s)=>s.indexOf(t)===e);const x=t.yaxis[n];o&&!0===x.alignZero&&!x.logarithmic&&void 0===x.min&&void 0===x.max&&e.ignoreYAxisIndexes.indexOf(n)<0&&b.isNumber(d)&&b.isNumber(g)?r.push({ai:n,minY:d,maxY:g}):(this.setYScaleForIndex(n,d,g),s.forEach(t=>{i[t]=e.yAxisScale[n].niceMin,a[t]=e.yAxisScale[n].niceMax}))}else this.setYScaleForIndex(n,0,-Number.MAX_VALUE)}),r.length>=2){r.forEach(t=>{this.setYScaleForIndex(t.ai,t.minY,t.maxY),s[t.ai].forEach(s=>{i[s]=e.yAxisScale[t.ai].niceMin,a[s]=e.yAxisScale[t.ai].niceMax})});let t=0;r.forEach(s=>{const i=e.yAxisScale[s.ai],a=i.niceMax-i.niceMin;if(a>0){const e=-i.niceMin/a;e>t&&(t=e)}}),t>1&&(t=1),t<0&&(t=0);const o=t=>{if(t<=0)return 1;const e=Math.floor(Math.log10(t)),s=Math.pow(10,e),i=t/s;let a;return a=i<=1+1e-9?1:i<=2+1e-9?2:i<=2.5+1e-9?2.5:i<=5+1e-9?5:10,a*s};r.forEach(r=>{const n=e.yAxisScale[r.ai];if(!n.result||n.result.length<2)return;const l=n.niceMax-n.niceMin;if(l<=0)return;const h=-n.niceMin/l;if(Math.abs(h-t)<=1e-9)return;const c=h<t&&t<1-1e-9,d=!c&&h>t&&t>1e-9;if(!c&&!d)return;const g=c?-t*n.niceMax/(1-t):n.niceMin,p=d?-n.niceMin*(1-t)/t:n.niceMax,u=p-g;if(u<=0)return;const x=Math.max(n.result.length,5),f=o(u/Math.max(x-1,1));if(f<=0)return;let m,y;if(c){m=Math.floor(g/f+1e-9)*f;const e=t>1e-9?m*(t-1)/t:n.niceMax,s=Math.max(e,n.niceMax);y=Math.ceil(s/f-1e-9)*f}else{y=Math.ceil(p/f-1e-9)*f;const e=t<1-1e-9?-t*y/(1-t):n.niceMin,s=Math.min(e,n.niceMin);m=Math.floor(s/f+1e-9)*f}n.result=[];for(let t=m;t<=y+1e-9*f;t=b.preciseAddition(t,f))n.result.push(b.stripNumber(t,7));n.niceMin=m,n.niceMax=y,s[r.ai].forEach(t=>{i[t]=n.niceMin,a[t]=n.niceMax})})}else if(1===r.length){const t=r[0];this.setYScaleForIndex(t.ai,t.minY,t.maxY),s[t.ai].forEach(s=>{i[s]=e.yAxisScale[t.ai].niceMin,a[s]=e.yAxisScale[t.ai].niceMax})}}}class kt{constructor(t){this.w=t,this.scales=new St(this.w)}init(){this.setYRange(),this.setXRange(),this.setZRange()}getMinYMaxY(t,e=Number.MAX_VALUE,s=-Number.MAX_VALUE,i=null){var a,r,o,n,l,h,c,d;const g=this.w.config,p=this.w.globals;let u=-Number.MAX_VALUE,x=Number.MIN_VALUE;null===i&&(i=t+1);const f=this.w.seriesData.series;let m=f,y=f;"candlestick"===g.chart.type?(m=this.w.candleData.seriesCandleL,y=this.w.candleData.seriesCandleH):"boxPlot"===g.chart.type?(m=this.w.candleData.seriesCandleO,y=this.w.candleData.seriesCandleC):"violin"===g.chart.type?(m=this.w.violinData.seriesViolinMin,y=this.w.violinData.seriesViolinMax):this.w.axisFlags.isRangeData&&(m=this.w.rangeData.seriesRangeStart,y=this.w.rangeData.seriesRangeEnd);let w=!1;if(this.w.seriesData.seriesX.length>=i){const t=null==(a=p.brushSource)?void 0:a.w.config.chart.brush;(g.chart.zoom.enabled&&g.chart.zoom.autoScaleYaxis||(null==t?void 0:t.enabled)&&(null==t?void 0:t.autoScaleYaxis))&&(w=!0)}for(let a=t;a<i;a++){p.dataPoints=Math.max(p.dataPoints,f[a].length);const t=g.series[a].type;this.w.labelData.categoryLabels.length&&(p.dataPoints=this.w.labelData.categoryLabels.filter(t=>void 0!==t).length),this.w.labelData.labels.length&&"datetime"!==g.xaxis.type&&0!==this.w.seriesData.series.reduce((t,e)=>t+e.length,0)&&(p.dataPoints=Math.max(p.dataPoints,this.w.labelData.labels.length));let i=0,v=f[a].length-1;if(w){if(g.xaxis.min)for(;i<v&&this.w.seriesData.seriesX[a][i]<g.xaxis.min;i++);if(g.xaxis.max)for(;v>i&&this.w.seriesData.seriesX[a][v]>g.xaxis.max;v--);}for(let g=i;g<=v&&g<this.w.seriesData.series[a].length;g++){let i=f[a][g];if(null!==i&&b.isNumber(i)){switch(void 0!==(null==(r=y[a])?void 0:r[g])&&(u=Math.max(u,y[a][g]),e=Math.min(e,y[a][g])),void 0!==(null==(o=m[a])?void 0:o[g])&&(e=Math.min(e,m[a][g]),s=Math.max(s,m[a][g])),t){case"candlestick":void 0!==this.w.candleData.seriesCandleC[a][g]&&(u=Math.max(u,this.w.candleData.seriesCandleH[a][g]),e=Math.min(e,this.w.candleData.seriesCandleL[a][g]));break;case"boxPlot":void 0!==this.w.candleData.seriesCandleC[a][g]&&(u=Math.max(u,this.w.candleData.seriesCandleC[a][g]),e=Math.min(e,this.w.candleData.seriesCandleO[a][g]));break;case"violin":void 0!==(null==(n=this.w.violinData.seriesViolinMax[a])?void 0:n[g])&&(u=Math.max(u,this.w.violinData.seriesViolinMax[a][g]),e=Math.min(e,this.w.violinData.seriesViolinMin[a][g]))}if(t&&"candlestick"!==t&&"boxPlot"!==t&&"violin"!==t&&"rangeArea"!==t&&"rangeBar"!==t&&(u=Math.max(u,this.w.seriesData.series[a][g]),e=Math.min(e,this.w.seriesData.series[a][g])),this.w.seriesData.seriesGoals[a]&&this.w.seriesData.seriesGoals[a][g]&&Array.isArray(this.w.seriesData.seriesGoals[a][g])&&this.w.seriesData.seriesGoals[a][g].forEach(t=>{u=Math.max(u,t.value),e=Math.min(e,t.value)}),"boxPlot"===this.w.config.chart.type||"boxPlot"===t){const t=null==(h=null==(l=this.w.candleData.seriesBoxPoints)?void 0:l[a])?void 0:h[g];if(t)for(let s=0;s<t.length;s++){const i=t[s];"number"==typeof i&&(u=Math.max(u,i),e=Math.min(e,i))}}s=u,i=b.noExponents(i),b.isFloat(i)&&(p.yValueDecimal=Math.max(p.yValueDecimal,i.toString().split(".")[1].length)),x>(null==(c=m[a])?void 0:c[g])&&(null==(d=m[a])?void 0:d[g])<0&&(x=m[a][g])}else p.hasNullValues=!0}"bar"!==t&&"column"!==t||(x<0&&u<0&&(u=0,s=Math.max(s,0)),x===Number.MIN_VALUE&&(x=0,e=Math.min(e,0)))}return"rangeBar"===g.chart.type&&this.w.rangeData.seriesRangeStart.length&&p.isBarHorizontal&&(x=e),"bar"===g.chart.type&&(x<0&&u<0&&(u=0),x===Number.MIN_VALUE&&(x=0)),{minY:x,maxY:u,lowestY:e,highestY:s}}setYRange(){const t=this.w.globals,e=this.w.config;t.maxY=-Number.MAX_VALUE,t.minY=Number.MIN_VALUE;let s,i=Number.MAX_VALUE;if(t.isMultipleYAxis){i=Number.MAX_VALUE;for(let e=0;e<this.w.seriesData.series.length;e++)s=this.getMinYMaxY(e),t.minYArr[e]=s.lowestY,t.maxYArr[e]=s.highestY,i=Math.min(i,s.lowestY)}if(s=this.getMinYMaxY(0,i,void 0,this.w.seriesData.series.length),"bar"===e.chart.type?(t.minY=s.minY,t.maxY=s.maxY):(t.minY=s.lowestY,t.maxY=s.highestY),i=s.lowestY,e.chart.stacked&&this._setStackedMinMax(),"line"===e.chart.type||"area"===e.chart.type||"scatter"===e.chart.type||"candlestick"===e.chart.type||"boxPlot"===e.chart.type||"violin"===e.chart.type||"rangeBar"===e.chart.type&&!t.isBarHorizontal?t.minY===Number.MIN_VALUE&&i!==-Number.MAX_VALUE&&i!==t.maxY&&(t.minY=i):t.minY=t.minY!==Number.MIN_VALUE?Math.min(s.minY,t.minY):s.minY,e.yaxis.forEach((e,s)=>{void 0!==e.max&&("number"==typeof e.max?t.maxYArr[s]=e.max:"function"==typeof e.max&&(t.maxYArr[s]=e.max(t.isMultipleYAxis?t.maxYArr[s]:t.maxY)),t.maxY=t.maxYArr[s]),void 0!==e.min&&("number"==typeof e.min?t.minYArr[s]=e.min:"function"==typeof e.min&&(t.minYArr[s]=e.min(t.isMultipleYAxis?t.minYArr[s]===Number.MIN_VALUE?0:t.minYArr[s]:t.minY)),t.minY=t.minYArr[s])}),t.isBarHorizontal){["min","max"].forEach(s=>{void 0!==e.xaxis[s]&&"number"==typeof e.xaxis[s]&&("min"===s?t.minY=e.xaxis[s]:t.maxY=e.xaxis[s])})}return t.isMultipleYAxis?(this.scales.scaleMultipleYAxes(),t.minY=i):(this.scales.setYScaleForIndex(0,t.minY,t.maxY),t.minY=t.yAxisScale[0].niceMin,t.maxY=t.yAxisScale[0].niceMax,t.minYArr[0]=t.minY,t.maxYArr[0]=t.maxY),t.barGroups=[],t.lineGroups=[],t.areaGroups=[],e.series.forEach(s=>{const i=s;switch(i.type||e.chart.type){case"bar":case"column":t.barGroups.push(i.group);break;case"line":t.lineGroups.push(i.group);break;case"area":t.areaGroups.push(i.group)}}),t.barGroups=t.barGroups.filter((t,e,s)=>s.indexOf(t)===e),t.lineGroups=t.lineGroups.filter((t,e,s)=>s.indexOf(t)===e),t.areaGroups=t.areaGroups.filter((t,e,s)=>s.indexOf(t)===e),{minY:t.minY,maxY:t.maxY,minYArr:t.minYArr,maxYArr:t.maxYArr,yAxisScale:t.yAxisScale}}setXRange(){const t=this.w.globals,e=this.w.config,s="numeric"===e.xaxis.type||"datetime"===e.xaxis.type||"category"===e.xaxis.type&&!this.w.axisFlags.noLabelsProvided||this.w.axisFlags.noLabelsProvided||this.w.axisFlags.isXNumeric,i=()=>{for(let e=0;e<this.w.seriesData.series.length;e++)if(this.w.labelData.labels[e])for(let s=0;s<this.w.labelData.labels[e].length;s++)null!==this.w.labelData.labels[e][s]&&b.isNumber(this.w.labelData.labels[e][s])&&(t.maxX=Math.max(t.maxX,this.w.labelData.labels[e][s]),t.initialMaxX=Math.max(t.maxX,this.w.labelData.labels[e][s]),t.minX=Math.min(t.minX,this.w.labelData.labels[e][s]),t.initialMinX=Math.min(t.minX,this.w.labelData.labels[e][s]))};if(this.w.axisFlags.isXNumeric&&i(),this.w.axisFlags.noLabelsProvided&&0===e.xaxis.categories.length&&(t.maxX=this.w.labelData.labels[this.w.labelData.labels.length-1],t.initialMaxX=this.w.labelData.labels[this.w.labelData.labels.length-1],t.minX=1,t.initialMinX=1),this.w.axisFlags.isXNumeric||this.w.axisFlags.noLabelsProvided||this.w.axisFlags.dataFormatXNumeric){let i=10;if(void 0===e.xaxis.tickAmount)i=Math.round(t.svgWidth/150),"numeric"===e.xaxis.type&&t.dataPoints<30&&(i=t.dataPoints-1),i>t.dataPoints&&0!==t.dataPoints&&(i=t.dataPoints-1);else if("dataPoints"===e.xaxis.tickAmount){if(this.w.seriesData.series.length>1&&(i=this.w.seriesData.series[t.maxValsInArrayIndex].length-1),this.w.axisFlags.isXNumeric){const e=Math.round(t.maxX-t.minX);e<30&&(i=e)}}else i=e.xaxis.tickAmount;if(t.xTickAmount=i,void 0!==e.xaxis.max&&"number"==typeof e.xaxis.max&&(t.maxX=e.xaxis.max),void 0!==e.xaxis.min&&"number"==typeof e.xaxis.min&&(t.minX=e.xaxis.min),void 0!==e.xaxis.range&&(t.minX=t.maxX-e.xaxis.range),t.minX!==Number.MAX_VALUE&&t.maxX!==-Number.MAX_VALUE)if(e.xaxis.convertedCatToNumeric&&!this.w.axisFlags.dataFormatXNumeric){const e=[];for(let s=t.minX-1;s<t.maxX;s++)e.push(s+1);t.xAxisScale={result:e,niceMin:e[0],niceMax:e[e.length-1]}}else t.xAxisScale=this.scales.setXScale(t.minX,t.maxX);else t.xAxisScale=this.scales.linearScale(0,i,i,0,e.xaxis.stepSize),this.w.axisFlags.noLabelsProvided&&this.w.labelData.labels.length>0&&(t.xAxisScale=this.scales.linearScale(1,this.w.labelData.labels.length,i-1,0,e.xaxis.stepSize),this.w.seriesData.seriesX=this.w.labelData.labels.slice());s&&(this.w.labelData.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&this.w.labelData.labels.length&&(t.xTickAmount=this.w.labelData.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}setZRange(){const t=this.w.globals;if(this.w.axisFlags.isDataXYZ)for(let e=0;e<this.w.seriesData.series.length;e++)if(void 0!==this.w.seriesData.seriesZ[e])for(let s=0;s<this.w.seriesData.seriesZ[e].length;s++)null!==this.w.seriesData.seriesZ[e][s]&&b.isNumber(this.w.seriesData.seriesZ[e][s])&&(t.maxZ=Math.max(t.maxZ,this.w.seriesData.seriesZ[e][s]),t.minZ=Math.min(t.minZ,this.w.seriesData.seriesZ[e][s]))}_handleSingleDataPoint(){const t=this.w.globals,e=this.w.config;if(t.minX===t.maxX){const s=new y(this.w);if("datetime"===e.xaxis.type){const i=s.getDate(t.minX);e.xaxis.labels.datetimeUTC?i.setUTCDate(i.getUTCDate()-2):i.setDate(i.getDate()-2),t.minX=new Date(i).getTime();const a=s.getDate(t.maxX);e.xaxis.labels.datetimeUTC?a.setUTCDate(a.getUTCDate()+2):a.setDate(a.getDate()+2),t.maxX=new Date(a).getTime()}else("numeric"===e.xaxis.type||"category"===e.xaxis.type&&!this.w.axisFlags.noLabelsProvided)&&(t.minX=t.minX-2,t.initialMinX=t.minX,t.maxX=t.maxX+2,t.initialMaxX=t.maxX)}}_getMinXDiff(){const t=this.w.globals;this.w.axisFlags.isXNumeric&&this.w.seriesData.seriesX.forEach(e=>{if(e.length){1===e.length&&e.push(this.w.seriesData.seriesX[t.maxValsInArrayIndex][this.w.seriesData.seriesX[t.maxValsInArrayIndex].length-1]);const s=e.slice();s.sort((t,e)=>t-e),s.forEach((e,i)=>{if(i>0){const a=e-s[i-1];a>0&&(t.minXDiff=Math.min(a,t.minXDiff))}}),1!==t.dataPoints&&t.minXDiff!==Number.MAX_VALUE||(t.minXDiff=.5)}})}_setStackedMinMax(){const t=this.w.globals;if(!this.w.seriesData.series.length)return;let e=this.w.labelData.seriesGroups;e.length||(e=[this.w.seriesData.seriesNames.map(t=>t)]);const s={},i={};e.forEach(e=>{s[e]=[],i[e]=[];this.w.config.series.map((t,s)=>e.indexOf(this.w.seriesData.seriesNames[s])>-1?s:null).filter(t=>null!==t).forEach(a=>{var r,o,n,l;for(let h=0;h<this.w.seriesData.series[t.maxValsInArrayIndex].length;h++){void 0===s[e][h]&&(s[e][h]=0,i[e][h]=0);(this.w.config.chart.stacked&&!t.comboCharts||this.w.config.chart.stacked&&t.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(o=null==(r=this.w.config.series)?void 0:r[a])?void 0:o.type)||"column"===(null==(l=null==(n=this.w.config.series)?void 0:n[a])?void 0:l.type)))&&null!==this.w.seriesData.series[a][h]&&b.isNumber(this.w.seriesData.series[a][h])&&(this.w.seriesData.series[a][h]>0?s[e][h]+=parseFloat(String(this.w.seriesData.series[a][h]))+1e-4:i[e][h]+=parseFloat(String(this.w.seriesData.series[a][h])))}})}),Object.entries(s).forEach(([e])=>{s[e].forEach((a,r)=>{t.maxY=Math.max(t.maxY,s[e][r]),t.minY=Math.min(t.minY,i[e][r])})})}}class _t{constructor(t,{theme:e=null,timeScale:s=null}={},i){this.w=t,this.elgrid=i,this.xaxisFontSize=t.config.xaxis.labels.style.fontSize,this.axisFontFamily=t.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=t.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===t.config.chart.type&&t.config.plotOptions.bar.horizontal,this.xAxisoffX="bottom"===t.config.xaxis.position?t.layout.gridHeight:0,this.drawnLabels=[],this.axesUtils=new vt(t,{theme:e,timeScale:s})}drawYaxis(t){const e=this.w,s=new gt(this.w),i=e.config.yaxis[t].labels.style,{fontSize:a,fontFamily:r,fontWeight:o}=i,n=s.group({class:"apexcharts-yaxis",rel:t,transform:`translate(${e.globals.translateYAxisX[t]}, 0)`});if(this.axesUtils.isYAxisHidden(t))return n;const l=s.group({class:"apexcharts-yaxis-texts-g"});n.add(l);const h=e.globals.yAxisScale[t].result.length-1,c=e.layout.gridHeight/h,d=e.formatters.yLabelFormatters[t],g=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());if(e.config.yaxis[t].labels.show){let n=e.layout.translateY+e.config.yaxis[t].labels.offsetY;e.globals.isBarHorizontal?n=0:"heatmap"===e.config.chart.type&&(n-=c/2),n+=parseInt(a,10)/3;let p=null;for(let u=h;u>=0;u--){const h=d(g[u],u,e);let x=e.config.yaxis[t].labels.padding;e.config.yaxis[t].opposite&&0!==e.config.yaxis.length&&(x*=-1);const f=this.getTextAnchor(e.config.yaxis[t].labels.align,e.config.yaxis[t].opposite),m=this.axesUtils.getYAxisForeColor(i.colors,t),b=Array.isArray(m)?m[u]:m,y=Array.from(e.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-label tspan`)).map(t=>t.textContent),w=s.drawText({x:x,y:n,text:y.includes(h)&&!e.config.yaxis[t].labels.showDuplicates?"":h,textAnchor:f,fontSize:a,fontFamily:r,fontWeight:o,maxWidth:e.config.yaxis[t].labels.maxWidth,foreColor:b,isPlainText:!1,cssClass:`apexcharts-yaxis-label ${i.cssClass}`});l.add(w),this.addTooltip(w,h),null===p&&(p=w),0!==e.config.yaxis[t].labels.rotate&&this.rotateLabel(s,w,p,e.config.yaxis[t].labels.rotate),n+=c}}return this.addYAxisTitle(s,n,t),this.addAxisBorder(s,n,t,h,c),n}getTextAnchor(t,e){return"left"===t?"start":"center"===t?"middle":"right"===t?"end":e?"start":"end"}addTooltip(t,e){const s=m.createElementNS(F,"title");s.textContent=Array.isArray(e)?e.join(" "):e,t.node.appendChild(s)}rotateLabel(t,e,s,i){const a=t.rotateAroundCenter(s.node),r=t.rotateAroundCenter(e.node);e.node.setAttribute("transform",`rotate(${i} ${a.x} ${r.y})`)}addYAxisTitle(t,e,s){const i=this.w;if(void 0!==i.config.yaxis[s].title.text){const a=t.group({class:"apexcharts-yaxis-title"}),r=i.config.yaxis[s].opposite?i.globals.translateYAxisX[s]:0,o=t.drawText({x:r,y:i.layout.gridHeight/2+i.layout.translateY+i.config.yaxis[s].title.offsetY,text:i.config.yaxis[s].title.text,textAnchor:"end",foreColor:i.config.yaxis[s].title.style.color,fontSize:i.config.yaxis[s].title.style.fontSize,fontWeight:i.config.yaxis[s].title.style.fontWeight,fontFamily:i.config.yaxis[s].title.style.fontFamily,cssClass:`apexcharts-yaxis-title-text ${i.config.yaxis[s].title.style.cssClass}`});a.add(o),e.add(a)}}addAxisBorder(t,e,s,i,a){const r=this.w,o=r.config.yaxis[s].axisBorder;let n=31+o.offsetX;if(r.config.yaxis[s].opposite&&(n=-31-o.offsetX),o.show){const s=t.drawLine(n,r.layout.translateY+o.offsetY-2,n,r.layout.gridHeight+r.layout.translateY+o.offsetY+2,o.color,0,o.width);e.add(s)}r.config.yaxis[s].axisTicks.show&&this.axesUtils.drawYAxisTicks(n,i,o,r.config.yaxis[s].axisTicks,s,a,e)}drawYaxisInversed(t){const e=this.w,s=new gt(this.w),i=s.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),a=s.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${e.layout.translateXAxisX}, ${e.layout.translateXAxisY})`});i.add(a);let r=e.globals.yAxisScale[t].result.length-1;const o=e.layout.gridWidth/r+.1;let n=o+e.config.xaxis.labels.offsetX;const l=e.formatters.xLabelFormatter;let h=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());const c=e.labelData.timescaleLabels;if(c.length>0&&(this.xaxisLabels=c.slice(),h=c.slice(),r=h.length),e.config.xaxis.labels.show)for(let i=c.length?0:r;c.length?i<c.length:i>=0;c.length?i++:i--){let r=null==l?void 0:l(h[i],i,e),d=e.layout.gridWidth+e.globals.padHorizontal-(n-o+e.config.xaxis.labels.offsetX);if(c.length){const t=this.axesUtils.getLabel(h,c,d,i,this.drawnLabels,this.xaxisFontSize);d=t.x,r=t.text,this.drawnLabels.push(t.text),0===i&&e.globals.skipFirstTimelinelabel&&(r=""),i===h.length-1&&e.globals.skipLastTimelinelabel&&(r="")}const g=s.drawText({x:d,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-("top"===e.config.xaxis.position?e.layout.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:r,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.axisFontFamily,fontWeight:e.config.xaxis.labels.style.fontWeight,isPlainText:!1,cssClass:`apexcharts-xaxis-label ${e.config.xaxis.labels.style.cssClass}`});a.add(g),this.addTooltip(g,r),n+=o}return this.inversedYAxisTitleText(i),this.inversedYAxisBorder(i),i}inversedYAxisBorder(t){const e=this.w,s=new gt(this.w),i=e.config.xaxis.axisBorder;if(i.show){let a=0;"bar"===e.config.chart.type&&e.axisFlags.isXNumeric&&(a-=15);const r=s.drawLine(e.globals.padHorizontal+a+i.offsetX,this.xAxisoffX,e.layout.gridWidth,this.xAxisoffX,i.color,0,i.height);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(r):t.add(r)}}inversedYAxisTitleText(t){const e=this.w,s=new gt(this.w);if(void 0!==e.config.xaxis.title.text){const i=s.group({class:"apexcharts-xaxis-title apexcharts-yaxis-title-inversed"}),a=s.drawText({x:e.layout.gridWidth/2+e.config.xaxis.title.offsetX,y:this.xAxisoffX+parseFloat(this.xaxisFontSize)+parseFloat(e.config.xaxis.title.style.fontSize)+e.config.xaxis.title.offsetY+20,text:e.config.xaxis.title.text,textAnchor:"middle",fontSize:e.config.xaxis.title.style.fontSize,fontFamily:e.config.xaxis.title.style.fontFamily,fontWeight:e.config.xaxis.title.style.fontWeight,foreColor:e.config.xaxis.title.style.color,cssClass:`apexcharts-xaxis-title-text ${e.config.xaxis.title.style.cssClass}`});i.add(a),t.add(i)}}yAxisTitleRotate(t,e){const s=this.w,i=new gt(this.w),a=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-texts-g`),r=a?a.getBoundingClientRect():{width:0,height:0},o=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-title text`),n=o?o.getBoundingClientRect():{width:0,height:0};if(o){const a=this.xPaddingForYAxisTitle(t,r,n,e);o.setAttribute("x",String(a.xPos-(e?10:0)));const l=i.rotateAroundCenter(o);o.setAttribute("transform",`rotate(${e?-1*s.config.yaxis[t].title.rotate:s.config.yaxis[t].title.rotate} ${l.x} ${l.y})`)}}xPaddingForYAxisTitle(t,e,s,i){const a=this.w;let r=0,o=10;return void 0===a.config.yaxis[t].title.text||t<0?{xPos:r,padd:0}:(i?r=e.width+a.config.yaxis[t].title.offsetX+s.width/2+o/2:(r=-1*e.width+a.config.yaxis[t].title.offsetX+o/2+s.width/2,a.globals.isBarHorizontal&&(o=25,r=-1*e.width-a.config.yaxis[t].title.offsetX-o)),{xPos:r,padd:o})}setYAxisXPosition(t,e){const s=this.w;let i=0,a=0,r=18,o=1;s.config.yaxis.length>1&&(this.multipleYs=!0),s.config.yaxis.forEach((n,l)=>{const h=s.globals.ignoreYAxisIndexes.includes(l)||!n.show||n.floating||0===t[l].width,c=t[l].width+e[l].width;n.opposite?s.globals.isBarHorizontal?(a=s.layout.gridWidth+s.layout.translateX-1,s.globals.translateYAxisX[l]=a-n.labels.offsetX):(a=s.layout.gridWidth+s.layout.translateX+o,h||(o+=c+20),s.globals.translateYAxisX[l]=a-n.labels.offsetX+20):(i=s.layout.translateX-r,h||(r+=c+20),s.globals.translateYAxisX[l]=i+n.labels.offsetX)})}setYAxisTextAlignments(){const t=this.w;Array.from(t.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach((e,s)=>{const i=t.config.yaxis[s];if(i&&!i.floating&&void 0!==i.labels.align){const e=t.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${s}'] .apexcharts-yaxis-texts-g`),a=Array.from(t.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${s}'] .apexcharts-yaxis-label`)),r=e.getBoundingClientRect();a.forEach(t=>{t.setAttribute("text-anchor",i.labels.align)}),"left"!==i.labels.align||i.opposite?"center"===i.labels.align?e.setAttribute("transform",`translate(${r.width/2*(i.opposite?1:-1)}, 0)`):"right"===i.labels.align&&i.opposite&&e.setAttribute("transform",`translate(${r.width}, 0)`):e.setAttribute("transform",`translate(-${r.width}, 0)`)}})}}class Lt{constructor(t,e){this.w=t,this.ctx=e,this.documentEvent=this.documentEvent.bind(this)}addEventListener(t,e){const s=this.w;Object.prototype.hasOwnProperty.call(s.globals.events,t)?s.globals.events[t].push(e):s.globals.events[t]=[e]}removeEventListener(t,e){const s=this.w;if(!Object.prototype.hasOwnProperty.call(s.globals.events,t))return;const i=s.globals.events[t].indexOf(e);-1!==i&&s.globals.events[t].splice(i,1)}fireEvent(t,e){const s=this.w;if(!Object.prototype.hasOwnProperty.call(s.globals.events,t))return;e&&e.length||(e=[]);const i=s.globals.events[t],a=i.length;for(let t=0;t<a;t++)i[t].apply(null,e)}setupEventHandlers(){const t=this.w,e=this.ctx,s=t.dom.baseEl.querySelector(t.globals.chartClass);this.ctx.eventList.forEach(i=>{null==s||s.addEventListener(i,s=>{const i=null===s.target.getAttribute("i")&&-1!==t.interact.capturedSeriesIndex?t.interact.capturedSeriesIndex:s.target.getAttribute("i"),a=null===s.target.getAttribute("j")&&-1!==t.interact.capturedDataPointIndex?t.interact.capturedDataPointIndex:s.target.getAttribute("j"),r=Object.assign({},t,{seriesIndex:t.globals.axisCharts?i:0,dataPointIndex:a});"keydown"===s.type?t.config.chart.accessibility.enabled&&t.config.chart.accessibility.keyboard.enabled&&(e.ctx.keyboardNavigation&&e.ctx.keyboardNavigation.handleKey(s),"function"==typeof t.config.chart.events.keyDown&&t.config.chart.events.keyDown(s,e,r),e.ctx.events.fireEvent("keydown",[s,e,r])):"keyup"===s.type?t.config.chart.accessibility.enabled&&t.config.chart.accessibility.keyboard.enabled&&("function"==typeof t.config.chart.events.keyUp&&t.config.chart.events.keyUp(s,e,r),e.ctx.events.fireEvent("keyup",[s,e,r])):"mousemove"===s.type||"touchmove"===s.type?"function"==typeof t.config.chart.events.mouseMove&&t.config.chart.events.mouseMove(s,e,r):"mouseleave"===s.type||"touchleave"===s.type?"function"==typeof t.config.chart.events.mouseLeave&&t.config.chart.events.mouseLeave(s,e,r):("mouseup"===s.type&&1===s.which||"touchend"===s.type)&&("function"==typeof t.config.chart.events.click&&t.config.chart.events.click(s,e,r),e.ctx.events.fireEvent("click",[s,e,r]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(e=>{t.dom.baseEl.addEventListener(e,this.documentEvent,{passive:!0})}),this.ctx.core.setupBrushHandler()}documentEvent(t){const e=this.w,s=t.target.className;if("click"===t.type){const t=e.dom.baseEl.querySelector(".apexcharts-menu");t&&t.classList.contains("apexcharts-menu-open")&&"apexcharts-menu-icon"!==s&&t.classList.remove("apexcharts-menu-open")}e.interact.clientX="touchmove"===t.type?t.touches[0].clientX:t.clientX,e.interact.clientY="touchmove"===t.type?t.touches[0].clientY:t.clientY}}class Mt{constructor(t){this.w=t}setCurrentLocaleValues(t){let e=this.w.config.chart.locales;const s=c.getApex();s.chart&&s.chart.locales&&s.chart.locales.length>0&&(e=this.w.config.chart.locales.concat(s.chart.locales));const i=e.filter(e=>e.name===t)[0];if(!i)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");{const t=b.extend(S,i);this.w.globals.locale=t.options}}}class Dt{constructor(t,e){this.w=t,this.ctx=e}drawAxis(t,e){const s=this.w.globals,i=this.w.config,a=new At(this.w,this.ctx,e),r=new _t(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale},e);if(s.axisCharts&&"radar"!==t){let t,e;s.isBarHorizontal?(e=r.drawYaxisInversed(0),t=a.drawXaxisInversed(0),this.w.dom.elGraphical.add(t),this.w.dom.elGraphical.add(e)):(t=a.drawXaxis(),this.w.dom.elGraphical.add(t),i.yaxis.map((t,i)=>{if(-1===s.ignoreYAxisIndexes.indexOf(i)&&(e=r.drawYaxis(i),this.w.dom.Paper.add(e),"back"===this.w.config.grid.position)){const t=this.w.dom.Paper.children()[1];t&&(t.remove(),this.w.dom.Paper.add(t))}}))}}}class Et{constructor(t){this.w=t}drawXCrosshairs(){const t=this.w,e=new gt(this.w),s=new dt(this.w),i=t.config.xaxis.crosshairs.fill.gradient,a=t.config.xaxis.crosshairs.dropShadow,r=t.config.xaxis.crosshairs.fill.type,o=i.colorFrom,n=i.colorTo,l=i.opacityFrom,h=i.opacityTo,c=i.stops,d=a.enabled,g=a.left,p=a.top,u=a.blur,x=a.color,f=a.opacity;let m=t.config.xaxis.crosshairs.fill.color;if(t.config.xaxis.crosshairs.show){"gradient"===r&&(m=e.drawGradient("vertical",o,n,l,h,null,c,[]));let i=e.drawRect();1===t.config.xaxis.crosshairs.width&&(i=e.drawLine(0,0,0,0));let a=t.layout.gridHeight;(!b.isNumber(a)||a<0)&&(a=0);let y=t.config.xaxis.crosshairs.width;(!b.isNumber(y)||Number(y)<0)&&(y=0),i.attr({class:"apexcharts-xcrosshairs",x:0,y:0,y2:a,width:y,height:a,fill:m,filter:"none","fill-opacity":t.config.xaxis.crosshairs.opacity,stroke:t.config.xaxis.crosshairs.stroke.color,"stroke-width":t.config.xaxis.crosshairs.stroke.width,"stroke-dasharray":t.config.xaxis.crosshairs.stroke.dashArray}),d&&(i=s.dropShadow(i,{left:g,top:p,blur:u,color:x,opacity:f})),t.dom.elGraphical.add(i)}}drawYCrosshairs(){const t=this.w,e=new gt(this.w),s=t.config.yaxis[0].crosshairs,i=t.globals.barPadForNumericAxis;if(t.config.yaxis[0].crosshairs.show){const a=e.drawLine(-i,0,t.layout.gridWidth+i,0,s.stroke.color,s.stroke.dashArray,s.stroke.width);a.attr({class:"apexcharts-ycrosshairs"}),t.dom.elGraphical.add(a)}const a=e.drawLine(-i,0,t.layout.gridWidth+i,0,s.stroke.color,0,0);a.attr({class:"apexcharts-ycrosshairs-hidden"}),t.dom.elGraphical.add(a)}}function Pt(t,e){if(!b.isObject(t)||!b.isObject(e))return void 0!==e?e:t;const s=n({},t);for(const i of Object.keys(e)){const a=e[i];void 0!==a&&(b.isObject(a)&&b.isObject(t[i])?s[i]=Pt(t[i],a):s[i]=a)}return s}class Ft{constructor(t){this.w=t,this._activeBreakpoint=null}checkResponsiveConfig(t){const e=this.w,s=e.config;if(0===s.responsive.length)return;const i=s.responsive.slice();i.sort((t,e)=>t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0).reverse();const a=new _({}),r=(t={})=>{var s;const r=i[0].breakpoint,o=c.isBrowser()?window.innerWidth>0?window.innerWidth:screen.width:0;if(o>r){if(null!==this._activeBreakpoint){if(!e.globals.initialConfig)return;const s=b.clone(e.globals.initialConfig);s.series=b.clone(e.config.series);const i=P.extendArrayProps(a,s,e);t=b.extend(i,t),this.overrideResponsiveOptions(t),this._activeBreakpoint=null}}else for(let r=0;r<i.length;r++)if(o<i[r].breakpoint){const o=(null==(s=i[r].options)?void 0:s.yaxis)?b.clone(i[r].options.yaxis):null;if(t=P.extendArrayProps(a,i[r].options,e),t=b.extend(e.config,t),Array.isArray(e.config.yaxis)&&o){const s=Array.isArray(o)?o:[o];t=l(n({},t),{yaxis:e.config.yaxis.map((t,e)=>Pt(t,s[e]))})}this.overrideResponsiveOptions(t),this._activeBreakpoint=i[r].breakpoint}};if(t){let s=P.extendArrayProps(a,t,e);s=b.extend(e.config,s),s=b.extend(s,t),r(s)}else r({})}overrideResponsiveOptions(t){const e=new _(t).init({responsiveOverride:!0});this.w.config=e}}const Tt=/[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi;function It(t,e){const{ax:s,bx:i,ay:a,by:r}=e,o=[],n=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g;let l;for(;null!==(l=n.exec(t));){const t=l[1].toUpperCase(),e=(l[2].match(Tt)||[]).map(parseFloat);if("Z"===t){o.push("z");continue}if("H"===t){for(const t of e)o.push(`H ${s*t+i}`);continue}if("V"===t){for(const t of e)o.push(`V ${a*t+r}`);continue}if("A"===t){for(let t=0;t+6<e.length;t+=7)o.push(`A ${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${s*e[t+5]+i} ${a*e[t+6]+r}`);continue}const n=[];for(let t=0;t+1<e.length;t+=2)n.push(`${s*e[t]+i} ${a*e[t+1]+r}`);n.length&&o.push(`${t} ${n.join(" ")}`)}return o.join(" ")}function Xt(t,e,s){if(!t||"string"!=typeof t)return null;const i=R(t);if(!i.length||"M"!==i[0][0])return null;for(let t=1;t<i.length;t++)if("M"===i[t][0])return null;let a=i,r=null;if(s){if(i.length<5)return null;if(r=i.slice(-3),a=i.slice(0,-3),"Z"!==r[2][0])return null;if("L"!==r[1][0])return null;if("L"!==r[0][0]&&"C"!==r[0][0])return null}else if("Z"===i[i.length-1][0])return null;if(a.length!==e||a.length<2)return null;const o=a[1][0];if("L"!==o&&"C"!==o)return null;for(let t=2;t<a.length;t++)if(a[t][0]!==o)return null;const n=a.map(t=>"C"===t[0]?[Number(t[5]),Number(t[6])]:[Number(t[1]),Number(t[2])]);for(const t of n)if(!isFinite(t[0])||!isFinite(t[1]))return null;return{body:a,closing:r,segType:o,anchors:n}}function Rt(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}function zt(t,e,s){const i=t,a=[e[1],e[2]],r=[e[3],e[4]],o=[e[5],e[6]],n=Rt(i,a,s),l=Rt(a,r,s),h=Rt(r,o,s),c=Rt(n,l,s),d=Rt(l,h,s),g=Rt(c,d,s);return{first:["C",n[0],n[1],c[0],c[1],g[0],g[1]],second:["C",d[0],d[1],h[0],h[1],o[0],o[1]],mid:g}}function Bt(t,e,s){const i=[e[1],e[2]],a=Rt(t,i,s);return{first:["L",a[0],a[1]],second:["L",i[0],i[1]],mid:a}}function Yt(t,e){const{body:s,closing:i,segType:a,anchors:r}=t,o=r.length,n=e.length,l=t=>"C"===a?["C",t[0],t[1],t[0],t[1],t[0],t[1]]:["L",t[0],t[1]],h=[["M",r[0][0],r[0][1]]];let c=0;for(;c<n&&0!==e[c];)c++;for(let t=1;t<=c;t++)h.push(l(r[0]));let d=c+1;for(let t=0;t<o-1;t++){let i=0;for(;d+i<n&&-1===e[d+i];)i++;const o=s[t+1];if(i){const e=i+1;let s=r[t],n=o;for(let t=0;t<i;t++){const i=1/(e-t),r="C"===a?zt(s,n,i):Bt(s,n,i);h.push(r.first),s=r.mid,n=r.second}h.push(n)}else h.push(o.slice());d+=i+1}for(;d<n;)h.push(l(r[o-1])),d++;return i&&i.forEach(t=>h.push(t.slice())),h}function Nt(t,e,s,i,a,r){const o=Xt(t,i,r);if(!o)return null;const n=Xt(e,a,r);if(!n)return null;if(o.segType!==n.segType)return null;if((o.closing||n.closing)&&(!o.closing||!n.closing||o.closing[0][0]!==n.closing[0][0]))return null;const l=s.map(t=>t.oldJ),h=s.map(t=>t.newJ);return{from:B(Yt(o,l)),toInterp:B(Yt(n,h))}}function Wt(t){var e;const s=t.config.chart.animations;if(!s||!1===s.enabled)return!1;if(!s.dynamicAnimation||!1===s.dynamicAnimation.enabled)return!1;const i=null!=(e=s.largeDatasetThreshold)?e:0;return!(i>0&&t.globals.dataPoints>i)&&!!(c.isBrowser()&&t.globals.dataChanged&&t.globals.shouldAnimate)}function Ot(t,e,s){var i,a,r,o;if(null==(i=t.axisFlags)?void 0:i.isXNumeric){const i=null==(r=null==(a=t.seriesData)?void 0:a.seriesX)?void 0:r[e];if(i&&i.length&&null!=i[s])return"x:"+i[s]}const n=null==(o=t.globals.labels)?void 0:o[s];return null!=n&&""!==String(n)?"c:"+(Array.isArray(n)?n.join(" "):String(n)):"j:"+s}function Ht(t){const e=new Map;return t.map(t=>{const s=e.get(t)||0;return e.set(t,s+1),0===s?t:`${t}#${s}`})}function $t(t,e,s=!1){var i,a;if(!Wt(t))return null;const r=t.globals.prevStreamFrame;if(!r)return null;const o=null==(i=r.seriesY)?void 0:i[e],n=null==(a=t.seriesData.series)?void 0:a[e];if(!Array.isArray(o)||!Array.isArray(n))return null;if(!o.length||!n.length)return null;const l=Ht(o.map((t,s)=>function(t,e,s){var i,a;if(t.isXNumeric){const a=null==(i=t.seriesX)?void 0:i[e];if(a&&a.length&&null!=a[s])return"x:"+a[s]}const r=null==(a=t.labels)?void 0:a[s];return null!=r&&""!==String(r)?"c:"+(Array.isArray(r)?r.join(" "):String(r)):"j:"+s}(r,e,s))),h=Ht(n.map((s,i)=>Ot(t,e,i))),c=function(t,e){const s=new Map;t.forEach((t,e)=>{s.has(t)||s.set(t,e)});const i=new Array(e.length),a=new Set;let r=-1,o=!0,n=t.length===e.length;e.forEach((t,e)=>{const l=s.has(t)&&!a.has(s.get(t))?s.get(t):-1;i[e]=l,-1!==l&&(a.add(l),l<r&&(o=!1),r=l),l!==e&&(n=!1)});const l=[];for(let e=0;e<t.length;e++)a.has(e)||l.push(e);return{toOld:i,exits:l,ordered:o,changed:!n}}(l,h);return c.ordered&&(c.changed||s)?{join:c,oldKeys:l,newKeys:h}:null}function jt(t){var e,s;const i=t.config.chart.animations;return st(null!=(s=null==(e=i.dynamicAnimation)?void 0:e.easing)?s:i.easing)}function Gt(t,e,s,i,a){const r=performance.now(),o=n=>{if(t.globals.isDestroyed)return;const l=Math.max(0,Math.min(1,(n-r)/e));i(s(l),l),l<1?m.requestAnimationFrame(o):a&&a()};m.requestAnimationFrame(o)}function Vt(t,{elPointsMain:e,realIndex:s,speed:i}){var a,r,o,n;if(!(null==e?void 0:e.node))return!1;const l=$t(t,s,!0);if(!l)return!1;const h=t.globals.prevStreamFrame;if(!h)return!1;const c=null==(a=h.xPixels)?void 0:a[s],d=null==(r=h.yPixels)?void 0:r[s];if(!c||!d)return!1;const g=e.node.querySelectorAll(".apexcharts-marker");if(!g.length)return!1;const p=(null==(o=t.globals.seriesXvalues)?void 0:o[s])||[],u=(null==(n=t.globals.seriesYvalues)?void 0:n[s])||[],x=jt(t),f=Math.max(1,i||1);return e.node.classList.remove("apexcharts-element-hidden"),g.forEach(e=>{var i,a,r,o,n,g,m,b,y;const w=parseInt(null!=(a=null!=(i=e.getAttribute("j"))?i:e.getAttribute("rel"))?a:"",10);if(!isFinite(w)||w<0||w>=l.join.toOld.length)return;const v=l.join.toOld[w],A=null!=p[w]&&null!=u[w]?[p[w],u[w]]:null;if(-1===v||!A){const s=e.style;return s.opacity="0",void Gt(t,f,x,t=>{s.opacity=String(t)},()=>{s.opacity=""})}const C=(null!=(r=c[v])?r:NaN)-A[0],S=(null!=(o=d[v])?o:NaN)-A[1];if(!isFinite(C)||!isFinite(S))return;const k=null!=(m=null==(g=null==(n=h.rPixels)?void 0:n[s])?void 0:g[v])?m:NaN,_=parseFloat(null!=(y=null!=(b=e.getAttribute("r"))?b:e.getAttribute("default-marker-size"))?y:""),L=isFinite(k)&&isFinite(_)&&_>0&&Math.abs(k-_)>.25;if(!(Math.abs(C)>=.5||Math.abs(S)>=.5)&&!L)return;const M=t=>{const s=C*(1-t),i=S*(1-t);if(L){const a=(k+(_-k)*t)/_;e.setAttribute("transform",`translate(${s+A[0]*(1-a)}, ${i+A[1]*(1-a)}) scale(${a})`)}else e.setAttribute("transform",`translate(${s}, ${i})`)};M(0),Gt(t,f,x,M,()=>{e.removeAttribute("transform")})}),!0}function Ut(t,{type:e,realIndex:s,pathFromLine:i,pathFromArea:a,linePaths:r,areaPaths:o}){var n,l;const h=$t(t,s);if(!h)return null;const{join:c,oldKeys:d,newKeys:g}=h,p=t.globals.prevStreamFrame;if(!p)return null;const u=null==(n=p.seriesY)?void 0:n[s],x=null==(l=t.seriesData.series)?void 0:l[s];if(u.length<2||x.length<2)return null;if(u.some(t=>null===t)||x.some(t=>null===t))return null;const f=function(t,e){const s=new Set(t.exits),i=[];let a=0;for(let e=0;e<t.toOld.length;e++){const r=t.toOld[e];if(-1!==r){for(;a<r;)s.has(a)&&i.push({oldJ:a,newJ:-1}),a++;i.push({oldJ:r,newJ:e}),a=r+1}else i.push({oldJ:-1,newJ:e})}for(;a<e;)s.has(a)&&i.push({oldJ:a,newJ:-1}),a++;return i}(c,d.length),m={};return Array.isArray(r)&&1===r.length&&i&&(m.line=Nt(i,r[0],f,d.length,g.length,!1)),"area"===e&&Array.isArray(o)&&1===o.length&&a&&(m.area=Nt(a,o[0],f,d.length,g.length,!0)),m.line||m.area?m:null}function qt({w:t,elSeries:e,record:s,newKeys:i,isHorizontal:a,speed:r}){var o;if(!Wt(t))return;if(!s||!Array.isArray(s.paths)||!(null==e?void 0:e.node))return;const n=new Set(i),l=s.paths.filter(t=>t&&t.d&&null!=t.key&&!n.has(t.key));if(!l.length)return;const h=new gt(t),c=null==(o=t.globals.colors)?void 0:o[parseInt(String(s.realIndex),10)];l.forEach(s=>{let i=s.fill||c||"#c8c8c8";0===String(i).indexOf("url(")&&(i=c||"#c8c8c8");const o=h.drawPath({d:s.d,stroke:"none",strokeWidth:0,fill:i,fillOpacity:1,classes:"apexcharts-bar-ghost"}),n=o.node;n.setAttribute("pointer-events","none"),o.attr("clip-path",`url(#gridRectBarMask${t.globals.cuid})`),e.node.insertBefore(n,e.node.firstChild);const l=function(t){const e=/^M\s*([+-]?[\d.eE]+)[\s,]+([+-]?[\d.eE]+)/.exec(t||"");if(!e)return null;const s=parseFloat(e[1]),i=parseFloat(e[2]);return isFinite(s)&&isFinite(i)?{x:s,y:i}:null}(s.d);let d=a?"left center":"center bottom";try{const t=n.getBBox();l&&t&&(d=a?Math.abs(l.x-t.x)<=Math.abs(l.x-(t.x+t.width))?"left center":"right center":Math.abs(l.y-(t.y+t.height))<=Math.abs(l.y-t.y)?"center bottom":"center top")}catch(t){}const g=n.style;g.transformBox="fill-box",g.transformOrigin=d;const p=Math.max(1,r||1),u=performance.now(),x=e=>{if(t.globals.isDestroyed||!n.parentNode)return;const s=Math.max(0,Math.min(1,(e-u)/p)),i=1-Math.pow(1-s,3),r=1-i;g.transform=a?`scaleX(${r})`:`scaleY(${r})`,g.opacity=String(1-i),s<1?m.requestAnimationFrame(x):n.parentNode.removeChild(n)};m.requestAnimationFrame(x)})}function Zt(t,e,s){return[...t.querySelectorAll(e)].map(t=>{var e,i,a;return{text:t.textContent||"",display:null!=(a=null!=(i=null==(e=t.querySelector("tspan"))?void 0:e.textContent)?i:t.textContent)?a:"",pos:parseFloat(t.getAttribute(s)||""),transform:t.getAttribute("transform")}})}function Kt(t,e,s){return[...t.querySelectorAll(e)].map(t=>parseFloat(t.getAttribute(s)||""))}const Jt=":not(.apexcharts-tick-ghost)",Qt=`.apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)${Jt}`,te=`.apexcharts-yaxis-texts-g text${Jt}`,ee=`.apexcharts-gridlines-vertical line${Jt}`,se=`.apexcharts-gridlines-horizontal line${Jt}`;function ie(t){var e,s;const i=t.globals;if(!(null==(e=t.axisFlags)?void 0:e.isXNumeric)||i.isBarHorizontal)return null;if(null==(s=t.config.xaxis)?void 0:s.reversed)return null;const a=i.minX,r=i.maxX,o=t.layout.gridWidth;return isFinite(a)&&isFinite(r)&&r>a&&o>0?{min:a,max:r,width:o}:null}function ae(t,e){var s;const i=t.globals;if(i.isBarHorizontal)return null;if(!Array.isArray(t.config.yaxis)||1!==t.config.yaxis.length)return null;if(null==(s=t.config.yaxis[0])?void 0:s.logarithmic)return null;const a=i.minY,r=i.maxY;if(!(isFinite(a)&&isFinite(r)&&r>a))return null;const o=e.map(t=>t.pos).filter(t=>isFinite(t));return o.length<2?null:{min:a,max:r,pLo:Math.max(...o),pHi:Math.min(...o)}}function re(t,e){if(!t||!e)return null;const s=t.pHi-t.pLo,i=e.pHi-e.pLo,a=t.max-t.min,r=e.max-e.min;if(!(s&&i&&a>0&&r>0))return null;return{toNew:o=>e.pLo+((e=>t.min+(e-t.pLo)/s*a)(o)-e.min)/r*i,toOld:o=>t.pLo+((t=>e.min+(t-e.pLo)/i*r)(o)-t.min)/a*s}}function oe(t,e,s,i){const a=e.style;a.opacity="0",Gt(t,s,i,t=>{a.opacity=String(t)},()=>{a.opacity=""})}function ne(t,e,s,i,a,r,o){s.forEach(t=>e.setAttribute(t,String(i))),Gt(t,r,o,t=>{const r=String(i+(a-i)*t);s.forEach(t=>e.setAttribute(t,r))},()=>{s.forEach(t=>e.setAttribute(t,String(a)))})}function le(t,{template:e,display:s,attrs:i,from:a,to:r,duration:o,ease:n}){const l=e.parentNode;if(!l)return;const h=e.cloneNode(!0);if(h.classList.add("apexcharts-tick-ghost"),h.setAttribute("pointer-events","none"),h.removeAttribute("id"),void 0!==s){const t=h.querySelector("tspan");t?t.textContent=s:h.textContent=s;const e=h.querySelector("title");e&&(e.textContent=s)}i.forEach(t=>h.setAttribute(t,String(a)));const c=h.style;c.opacity="1",l.appendChild(h),Gt(t,o,n,t=>{const e=String(a+(r-a)*t);i.forEach(t=>h.setAttribute(t,e)),c.opacity=String(1-t)},()=>{h.parentNode&&h.parentNode.removeChild(h)})}function he(t,{newLabels:e,oldLabels:s,posAttr:i,newLines:a,oldLines:r,lineAttrs:o,duration:h,ease:c,project:d}){const g=new Map;s.forEach((t,e)=>{g.has(t.text)||g.set(t.text,l(n({},t),{i:e}))});const p=new Set,u=a.length===e.length,x=r.length===s.length,f=s.map(t=>t.pos).concat(e.map(t=>parseFloat(t.getAttribute(i)||""))).filter(t=>isFinite(t)),m=Math.min(...f),b=Math.max(...f),y=Math.max(40,.25*(b-m)),w=t=>Math.max(m-y,Math.min(b+y,t));if(e.forEach((e,s)=>{const n=parseFloat(e.getAttribute(i)||""),l=g.get(e.textContent||""),x=u?a[s]:null;if(l&&p.add(l.i),l&&isFinite(l.pos)&&!l.transform&&!e.getAttribute("transform")){if(isFinite(n)&&!(Math.abs(l.pos-n)<.5)&&(ne(t,e,[i],l.pos,n,h,c),x)){const e=parseFloat(x.getAttribute(o[0])||""),s=r[l.i];isFinite(e)&&isFinite(s)&&ne(t,x,o,s,e,h,c)}}else if(!l){if(d&&isFinite(n)&&!e.getAttribute("transform")){const s=isFinite(d.toOld(n))?w(d.toOld(n)):NaN;isFinite(s)&&Math.abs(s-n)>.5&&(ne(t,e,[i],s,n,h,c),x&&ne(t,x,o,s,n,h,c))}oe(t,e,h,c),x&&oe(t,x,h,c)}}),!d||!e.length)return;let v=0;s.forEach((s,n)=>{if(p.has(n))return;if(!isFinite(s.pos)||s.transform)return;if(v>=20)return;const l=d.toNew(s.pos);!isFinite(l)||Math.abs(l-s.pos)<.5||(v++,le(t,{template:e[0],display:s.display,attrs:[i],from:s.pos,to:w(l),duration:h,ease:c}),x&&a.length&&isFinite(r[n])&&le(t,{template:a[0],attrs:o,from:r[n],to:w(d.toNew(r[n])),duration:h,ease:c}))})}class ce{constructor(t,{toggleDataSeries:e,revertDefaultAxisMinMax:s,updateSeries:i}={}){this.w=t,this._toggleDataSeries=e||null,this._revertDefaultAxisMinMax=s||null,this._updateSeries=i||null,this.legendInactiveClass="legend-mouseover-inactive"}clearSeriesCache(){const t=this.w;t.globals.cachedSelectors&&(delete t.globals.cachedSelectors.allSeriesEls,delete t.globals.cachedSelectors.highlightSeriesEls)}getAllSeriesEls(){const t=this.w,e="allSeriesEls";return t.globals.cachedSelectors[e]||(t.globals.cachedSelectors[e]=t.dom.baseEl.getElementsByClassName("apexcharts-series")),t.globals.cachedSelectors[e]}getSeriesByName(t){return this.w.dom.baseEl.querySelector(`.apexcharts-inner .apexcharts-series[seriesName='${b.escapeString(t)}']`)}isSeriesHidden(t){var e;const s=this.getSeriesByName(t),i=parseInt(null!=(e=s.getAttribute("data:realIndex"))?e:"0",10);return{isHidden:s.classList.contains("apexcharts-series-collapsed"),realIndex:i}}addCollapsedClassToSeries(t,e){ce.addCollapsedClassToSeries(this.w,t,e)}static addCollapsedClassToSeries(t,e,s){function i(t){for(let i=0;i<t.length;i++)t[i].index===s&&e.node.classList.add("apexcharts-series-collapsed")}i(t.globals.collapsedSeries),i(t.globals.ancillaryCollapsedSeries)}toggleSeries(t){var e;const s=this.isSeriesHidden(t);return null==(e=this._toggleDataSeries)||e.call(this,s.realIndex,s.isHidden),s.isHidden}showSeries(t){var e;const s=this.isSeriesHidden(t);s.isHidden&&(null==(e=this._toggleDataSeries)||e.call(this,s.realIndex,!0))}hideSeries(t){var e;const s=this.isSeriesHidden(t);s.isHidden||null==(e=this._toggleDataSeries)||e.call(this,s.realIndex,!1)}resetSeries(t=!0,e=!0,s=!0){var i,a;const r=this.w;this.clearSeriesCache();let o=b.clone(r.globals.initialSeries);r.globals.previousPaths=[],s?(r.globals.collapsedSeries=[],r.globals.ancillaryCollapsedSeries=[],r.globals.collapsedSeriesIndices=[],r.globals.ancillaryCollapsedSeriesIndices=[]):o=this.emptyCollapsedSeries(o),r.config.series=o,t&&(e&&(r.interact.zoomed=!1,null==(i=this._revertDefaultAxisMinMax)||i.call(this)),null==(a=this._updateSeries)||a.call(this,o,r.config.chart.animations.dynamicAnimation.enabled))}emptyCollapsedSeries(t){const e=this.w;for(let s=0;s<t.length;s++)e.globals.collapsedSeriesIndices.indexOf(s)>-1&&(t[s].data=[]);return t}canvasRestyle(t){const e=this.w.globals.activeRenderer;e&&"canvas"===e.kind&&"function"==typeof e.restyle&&e.restyle(t)}highlightSeries(t){var e;const s=this.w,i=this.getSeriesByName(t),a=parseInt(null!=(e=null==i?void 0:i.getAttribute("data:realIndex"))?e:"",10),r="highlightSeriesEls";let o=s.globals.cachedSelectors[r];o||(o=s.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),s.globals.cachedSelectors[r]=o);let n=null,l=null,h=null;if(s.globals.axisCharts||"radialBar"===s.config.chart.type)if(s.globals.axisCharts){n=s.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${a}']`),l=s.dom.baseEl.querySelector(`.apexcharts-datalabels[data\\:realIndex='${a}']`);const t=s.globals.seriesYAxisReverseMap[a];h=s.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}']`)}else n=s.dom.baseEl.querySelector(`.apexcharts-series[rel='${a+1}']`);else n=s.dom.baseEl.querySelector(`.apexcharts-series[rel='${a+1}'] path`);for(let t=0;t<o.length;t++){o[t].classList.add(this.legendInactiveClass)}if(n){if(!s.globals.axisCharts){const t=n.parentNode;null==t||t.classList.remove(this.legendInactiveClass)}n.classList.remove(this.legendInactiveClass),null!==l&&l.classList.remove(this.legendInactiveClass),null!==h&&h.classList.remove(this.legendInactiveClass)}else for(let t=0;t<o.length;t++){o[t].classList.remove(this.legendInactiveClass)}this.canvasRestyle(n&&!Number.isNaN(a)?{active:a,opacity:.2}:null)}toggleSeriesOnHover(t,e){const s=this.w;e||(e=t.target);const i=s.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if("mousemove"===t.type){const t=parseInt(e.getAttribute("rel"),10)-1;this.highlightSeries(s.seriesData.seriesNames[t])}else if("mouseout"===t.type){for(let t=0;t<i.length;t++)i[t].classList.remove(this.legendInactiveClass);this.canvasRestyle(null)}}highlightRangeInSeries(t,e){const s=this.w,i=s.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),a=t=>{for(let e=0;e<i.length;e++){const s=i[e].classList;"function"==typeof s[t]&&s[t](this.legendInactiveClass)}};if("reset"===e)return void a("remove");const r=s.config.plotOptions.heatmap.colorScale.ranges,o=r&&r[t];if(o){a("add");for(let t=0;t<i.length;t++){const e=Number(i[t].getAttribute("val"));e>=o.from&&e<=o.to&&i[t].classList.remove(this.legendInactiveClass)}}}getActiveConfigSeriesIndex(t="asc",e=[]){const s=this.w;let i=0;if(s.config.series.length>1){const a=s.config.series.map((t,i)=>t.data&&t.data.length>0&&-1===s.globals.collapsedSeriesIndices.indexOf(i)&&(!s.globals.comboCharts||0===e.length||e.length&&e.indexOf(s.config.series[i].type)>-1)?i:-1);for(let e="asc"===t?0:a.length-1;"asc"===t?e<a.length:e>=0;"asc"===t?e++:e--)if(-1!==a[e]){i=a[e];break}}return i}getBarSeriesIndices(){return this.w.globals.comboCharts?this.w.config.series.map((t,e)=>"bar"===t.type||"column"===t.type?e:-1).filter(t=>-1!==t):this.w.config.series.map((t,e)=>e)}getPreviousPaths(){var t,e,s,i;const a=this.w;if(function(t){var e,s,i;const a=t.globals;if(!a.axisCharts||!t.seriesData||!Array.isArray(t.seriesData.series)||0===t.seriesData.series.length)return void(a.prevStreamFrame=null);const r=[];(null==(s=null==(e=t.dom)?void 0:e.baseEl)?void 0:s.querySelectorAll)&&t.dom.baseEl.querySelectorAll(".apexcharts-marker").forEach(t=>{var e,s,i,a,o;const n=parseInt(null!=(e=t.getAttribute("index"))?e:"",10),l=parseInt(null!=(i=null!=(s=t.getAttribute("j"))?s:t.getAttribute("rel"))?i:"",10),h=parseFloat(null!=(o=null!=(a=t.getAttribute("r"))?a:t.getAttribute("default-marker-size"))?o:"");isFinite(n)&&isFinite(l)&&isFinite(h)&&((r[n]=r[n]||[])[l]=h)}),a.prevStreamFrame={seriesX:(t.seriesData.seriesX||[]).slice(),seriesY:t.seriesData.series.slice(),xPixels:(a.seriesXvalues||[]).slice(),yPixels:(a.seriesYvalues||[]).slice(),rPixels:r,labels:(a.labels||[]).slice(),isXNumeric:!!(null==(i=t.axisFlags)?void 0:i.isXNumeric)}}(a),function(t){const e=t.globals;if(e.prevChromeFrame=null,!e.axisCharts||!c.isBrowser())return;const s=t.dom.baseEl;if(b.elementExists(s))try{const i=Zt(s,te,"y");e.prevChromeFrame={xLabels:Zt(s,Qt,"x"),yLabels:i,vGrid:Kt(s,ee,"x1"),hGrid:Kt(s,se,"y1"),xScale:ie(t),yAnchors:ae(t,i)}}catch(t){e.prevChromeFrame=null}}(a),!a.globals.axisCharts)return void(a.globals.previousPaths=a.seriesData.series);if(!b.elementExists(a.dom.baseEl))return void(a.globals.previousPaths=[]);function r(t,e,s){const i=t[e].childNodes,r={type:s,paths:[],realIndex:t[e].getAttribute("data:realIndex")};for(let t=0;t<i.length;t++)if(i[t].hasAttribute("pathTo")){const e=i[t].getAttribute("pathTo");r.paths.push({d:e,key:i[t].getAttribute("data:pathKey"),fill:i[t].getAttribute("fill")})}a.globals.previousPaths.push(r)}a.globals.previousPaths=[];["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(t=>{const e=(s=t,a.dom.baseEl.querySelectorAll(`.apexcharts-${s}-series .apexcharts-series`));var s;for(let s=0;s<e.length;s++)r(e,s,t)});const o=a.dom.baseEl.querySelectorAll(`.apexcharts-${a.config.chart.type} .apexcharts-series`);if(o.length>0)for(let r=0;r<o.length;r++){const o=a.dom.baseEl.querySelectorAll(`.apexcharts-${a.config.chart.type} .apexcharts-series[data\\:realIndex='${r}'] rect`),n=[];for(let a=0;a<o.length;a++){const r=t=>o[a].getAttribute(t),l={x:parseFloat(null!=(t=r("x"))?t:"0"),y:parseFloat(null!=(e=r("y"))?e:"0"),width:parseFloat(null!=(s=r("width"))?s:"0"),height:parseFloat(null!=(i=r("height"))?i:"0")};n.push({rect:l,color:o[a].getAttribute("color")})}a.globals.previousPaths.push(n)}}clearPreviousPaths(){const t=this.w;t.globals.previousPaths=[],t.globals.allSeriesCollapsed=!1}handleNoData(){const t=this.w,e=t.config.noData,s=new gt(this.w);let i=t.globals.svgWidth/2,a=t.globals.svgHeight/2,r="middle";if(t.globals.noData=!0,t.globals.animationEnded=!0,"left"===e.align?(i=10,r="start"):"right"===e.align&&(i=t.globals.svgWidth-10,r="end"),"top"===e.verticalAlign?a=50:"bottom"===e.verticalAlign&&(a=t.globals.svgHeight-50),i+=e.offsetX,a=a+parseInt(e.style.fontSize,10)+2+e.offsetY,void 0!==e.text&&""!==e.text){const o=s.drawText({x:i,y:a,text:e.text,textAnchor:r,fontSize:e.style.fontSize,fontFamily:e.style.fontFamily,foreColor:e.style.color,opacity:1,cssClass:"apexcharts-text-nodata"});t.dom.Paper.add(o)}}setNullSeriesToZeroValues(t){const e=this.w;for(let s=0;s<t.length;s++)if(0===t[s].length)for(let i=0;i<t[e.globals.maxValsInArrayIndex].length;i++)t[s].push(0);return t}hasAllSeriesEqualX(){let t=!0;const e=this.w,s=this.filteredSeriesX();for(let e=0;e<s.length-1;e++)if(s[e][0]!==s[e+1][0]){t=!1;break}return e.globals.allSeriesHasEqualX=t,t}filteredSeriesX(){return this.w.seriesData.seriesX.map(t=>t.length>0?t:[])}}const de={accent:"--apx-accent",fore:"--apx-fore",grid:"--apx-grid",surface:"--apx-surface"};const ge="__apexcharts_themes__";function pe(){return globalThis[ge]}globalThis[ge]||(globalThis[ge]={});const ue="#373d3f",xe="#f6f7f8",fe="#e0e0e0";class me{constructor(t){this.w=t,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed(),this._tokens={},this._namedTheme=null}checkHeatmapDistributed(){const{chart:t,plotOptions:e}=this.w.config;return"treemap"===t.type&&e.treemap&&e.treemap.distributed||"heatmap"===t.type&&e.heatmap&&e.heatmap.distributed}checkBarDistributed(){const{chart:t,plotOptions:e}=this.w.config;return e.bar&&e.bar.distributed&&("bar"===t.type||"rangeBar"===t.type)}init(){this.setDefaultColors()}setDefaultColors(){var t;const e=this.w,s=new b;var i;this._namedTheme=(i=e.config.theme.name)&&pe()[i]||null,this._applyNamedThemeMode(),e.dom.elWrap.classList.add(`apexcharts-theme-${e.config.theme.mode||"light"}`),this._applyModeDefaults(),this._tokens=this._resolveTokens(),this.applyTokenChrome(this._tokens);const a=null==(t=e.config.theme.accessibility)?void 0:t.colorBlindMode;if(a){e.globals.colors=this.getColorBlindColors(a),this.applySeriesColors(e.seriesData.seriesColors,e.globals.colors);const t=e.globals.colors.slice();return this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],t),this.applyDataLabelsColors(t),this.applyRadarPolygonsColors(),this.applyMarkersColors(t),void("highContrast"===a&&e.dom.elWrap.classList.add("apexcharts-high-contrast"))}const r=[...e.config.colors||e.config.fill.colors||[]];e.globals.colors=this.getColors(r),this.applySeriesColors(e.seriesData.seriesColors,e.globals.colors),e.config.theme.monochrome.enabled&&(e.globals.colors=this.getMonochromeColors(e.config.theme.monochrome,e.seriesData.series,s));const o=e.globals.colors.slice();this.pushExtraColors(e.globals.colors),this.applyColorTypes(["fill","stroke"],o),this.applyDataLabelsColors(o),this.applyRadarPolygonsColors(),this.applyMarkersColors(o)}_applyModeDefaults(){const t=this.w,e=t.config.theme.mode;"dark"===e?(t.config.chart.foreColor===ue&&(t.config.chart.foreColor=xe),"palette1"===t.config.theme.palette&&(t.config.theme.palette="palette4"),t.config.tooltip&&"light"!==t.config.tooltip.theme&&(t.config.tooltip.theme="dark")):"light"===e&&(t.config.chart.foreColor===xe&&(t.config.chart.foreColor=ue),"palette4"===t.config.theme.palette&&(t.config.theme.palette="palette1"))}_applyNamedThemeMode(){const t=this._namedTheme;if(!t)return;const e=this.w.config.theme;t.mode&&!e.mode&&(e.mode=t.mode),!t.accessibility||!t.accessibility.colorBlindMode||e.accessibility&&e.accessibility.colorBlindMode||(e.accessibility=e.accessibility||{},e.accessibility.colorBlindMode=t.accessibility.colorBlindMode),t.monochrome&&t.monochrome.enabled&&!e.monochrome.enabled&&(e.monochrome=n(n({},e.monochrome),t.monochrome))}_resolveTokens(){const t=this._namedTheme&&this._namedTheme.tokens||{},e=this._shouldUseTokens()?function(t){if(!c.isBrowser())return{};const e=t.dom&&(t.dom.elWrap||t.dom.baseEl)||null;if(!e)return{};const s=m.getComputedStyle(e);if(!s||"function"!=typeof s.getPropertyValue)return{};const i=t=>{const e=s.getPropertyValue(t);return e?String(e).trim():""},a={};for(const t in de){const e=i(de[t]);e&&(a[t]=e)}const r=[];for(let t=1;t<=24;t++){const e=i(`--apx-series-${t}`);if(!e)break;r.push(e)}return r.length&&(a.series=r),a}(this.w):{};return n(n({},t),e)}_shouldUseTokens(){return!1!==this.w.config.theme.tokens}applyTokenChrome(t){if(!t)return;const e=this.w;if(!t.fore||e.config.chart.foreColor!==ue&&e.config.chart.foreColor!==xe||(e.config.chart.foreColor=t.fore),t.grid){e.config.grid.borderColor===fe&&(e.config.grid.borderColor=t.grid);const s=e=>{e&&(e.axisBorder&&e.axisBorder.color===fe&&(e.axisBorder.color=t.grid),e.axisTicks&&e.axisTicks.color===fe&&(e.axisTicks.color=t.grid))};s(e.config.xaxis),Array.isArray(e.config.yaxis)?e.config.yaxis.forEach(s):s(e.config.yaxis)}if(t.surface&&!e.config.chart.background){e.config.chart.background=t.surface;const s=e.dom.Paper&&e.dom.Paper.node;s&&s.style&&(s.style.background=t.surface)}}getColors(t){const e=this.w;return t&&0!==t.length?Array.isArray(t)&&t.length>0&&"function"==typeof t[0]?(this.isColorFn=!0,e.config.series.map((s,i)=>{const a=t[i]||t[0];return"function"==typeof a?a({value:e.globals.axisCharts?e.seriesData.series[i][0]||0:e.seriesData.series[i],seriesIndex:i,dataPointIndex:i,w:this.w}):a})):t:this.predefined()}applySeriesColors(t,e){t.forEach((t,s)=>{t&&(e[s]=t)})}getMonochromeColors(t,e,s){const{color:i,shadeIntensity:a,shadeTo:r}=t,o=this.isBarDistributed||this.isHeatmapDistributed?e[0].length*e.length:e.length,n=1/(o/a);let l=0;return Array.from({length:o},()=>{const t="dark"===r?s.shadeColor(-1*l,i):s.shadeColor(l,i);return l+=n,t})}applyColorTypes(t,e){const s=this.w;t.forEach(t=>{s.globals[t].colors=void 0===s.config[t].colors?this.isColorFn?s.config.colors:e:s.config[t].colors.slice(),this.pushExtraColors(s.globals[t].colors)})}applyDataLabelsColors(t){const e=this.w;e.globals.dataLabels.style.colors=void 0===e.config.dataLabels.style.colors?t:e.config.dataLabels.style.colors.slice(),this.pushExtraColors(e.globals.dataLabels.style.colors,50)}applyRadarPolygonsColors(){const t=this.w;t.globals.radarPolygons.fill.colors=void 0===t.config.plotOptions.radar.polygons.fill.colors?["dark"===t.config.theme.mode?"#343A3F":"none"]:t.config.plotOptions.radar.polygons.fill.colors.slice(),this.pushExtraColors(t.globals.radarPolygons.fill.colors,20)}applyMarkersColors(t){const e=this.w;e.globals.markers.colors=void 0===e.config.markers.colors?t:e.config.markers.colors.slice(),this.pushExtraColors(e.globals.markers.colors)}pushExtraColors(t,e,s=null){const i=this.w;let a=e||i.seriesData.series.length;if(null===s&&(s=this.isBarDistributed||this.isHeatmapDistributed||"heatmap"===i.config.chart.type&&i.config.plotOptions.heatmap&&i.config.plotOptions.heatmap.colorScale.inverse),s&&i.seriesData.series.length&&(a=i.seriesData.series[i.globals.maxValsInArrayIndex].length*i.seriesData.series.length),t.length<a){const e=a-t.length;for(let s=0;s<e;s++)t.push(t[s])}}getColorBlindColors(t){const e={palette1:["#008FFB","#00A86F","#CA8501","#FF4560","#846DD5"],palette2:["#6978CB","#039DE2","#49A84D","#B39105","#D68000"],palette3:["#209FCC","#648291","#D4526E","#0FA783","#A19285"],palette4:["#2FA59D","#73A20B","#099DE1","#FD5D5D","#648291"],palette5:["#2B908F","#F56566","#2EAB16","#FA4443","#1EA2BD"],palette6:["#449DD1","#F86624","#EA3A4A","#9C63D1","#899E2A"],palette7:["#DF475B","#1B998B","#7E75B7","#F46036","#B1911B"],palette8:["#9C63D1","#F86624","#B38F04","#EA3A4A","#2FA2B3"],palette9:["#98776F","#A19285","#A8705E","#BA6560","#A0927F"],palette10:["#C91EFF","#A94BFD","#6C6AFE","#2983FF","#009ED8"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]};return({deuteranopia:e.cvdDeuteranopia,protanopia:e.cvdProtanopia,tritanopia:e.cvdTritanopia,highContrast:e.highContrast}[t]||e.palette1).slice()}updateThemeOptions(t){t.chart=t.chart||{},t.tooltip=t.tooltip||{};const e=t.theme.mode,s="dark"===e?"palette4":"light"===e?"palette1":t.theme.palette||"palette1",i="dark"===e?"#f6f7f8":"light"===e?"#373d3f":t.chart.foreColor||"#373d3f";return t.tooltip.theme=e||"light",t.chart.foreColor=i,t.theme.palette=s,t}predefined(){const t={palette1:["#008FFB","#00A86F","#CA8501","#FF4560","#846DD5"],palette2:["#6978CB","#039DE2","#49A84D","#B39105","#D68000"],palette3:["#209FCC","#648291","#D4526E","#0FA783","#A19285"],palette4:["#2FA59D","#73A20B","#099DE1","#FD5D5D","#648291"],palette5:["#2B908F","#F56566","#2EAB16","#FA4443","#1EA2BD"],palette6:["#449DD1","#F86624","#EA3A4A","#9C63D1","#899E2A"],palette7:["#DF475B","#1B998B","#7E75B7","#F46036","#B1911B"],palette8:["#9C63D1","#F86624","#B38F04","#EA3A4A","#2FA2B3"],palette9:["#98776F","#A19285","#A8705E","#BA6560","#A0927F"],palette10:["#C91EFF","#A94BFD","#6C6AFE","#2983FF","#009ED8"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]},e=t[this.w.config.theme.palette]||t.palette1,s=this._tokens||{};if(Array.isArray(s.series)&&s.series.length)return s.series.slice();if(s.accent)return[s.accent,...e];const i=this._namedTheme;return i&&Array.isArray(i.palette)&&i.palette.length?i.palette.slice():e}}class be{constructor(t){this.w=t}draw(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}drawTitleSubtitle(t){const e=this.w,s="title"===t?e.config.title:e.config.subtitle;let i=e.globals.svgWidth/2,a=s.offsetY,r="middle";if("left"===s.align?(i=10,r="start"):"right"===s.align&&(i=e.globals.svgWidth-10,r="end"),i+=s.offsetX,a=a+parseInt(s.style.fontSize,10)+s.margin/2,void 0!==s.text){const o=new gt(this.w).drawText({x:i,y:a,text:s.text,textAnchor:r,fontSize:s.style.fontSize,fontFamily:s.style.fontFamily,fontWeight:s.style.fontWeight,foreColor:s.style.color,opacity:1});o.node.setAttribute("class",`apexcharts-${t}-text`),e.dom.Paper.add(o)}}}let ye=class{constructor(t){this.w=t.w,this.dCtx=t}getTitleSubtitleCoords(t){const e=this.w;let s=0,i=0;const a="title"===t?e.config.title.floating:e.config.subtitle.floating,r=e.dom.baseEl.querySelector(`.apexcharts-${t}-text`);if(null!==r&&!a){const t=r.getBoundingClientRect();s=t.width,i=e.globals.axisCharts?t.height+5:t.height}return{width:s,height:i}}getLegendsRect(){const t=this.w,e=t.dom.elLegendWrap;t.config.legend.height||"top"!==t.config.legend.position&&"bottom"!==t.config.legend.position||e&&(e.style.maxHeight=t.globals.svgHeight/2+"px");const s=Object.assign({},b.getBoundingClientRect(e));return null!==e&&!t.config.legend.floating&&t.config.legend.show?this.dCtx.lgRect={x:s.x,y:s.y,height:s.height,width:0===s.height?0:s.width}:this.dCtx.lgRect={x:0,y:0,height:0,width:0},"left"!==t.config.legend.position&&"right"!==t.config.legend.position||1.5*this.dCtx.lgRect.width>t.globals.svgWidth&&(this.dCtx.lgRect.width=t.globals.svgWidth/1.5),this.dCtx.lgRect}getDatalabelsRect(){const t=this.w,e=[];t.config.series.forEach((s,i)=>{s.data.forEach((s,a)=>{const r=(o=t.seriesData.series[i][a],t.config.dataLabels.formatter(o,{seriesIndex:i,dataPointIndex:a,w:t}));var o;e.push(r)})});const s=b.getLargestStringFromArr(e),i=new gt(this.w),a=t.config.dataLabels.style,r=i.getTextRects(s,parseInt(a.fontSize).toString(),a.fontFamily);return{width:1.05*r.width,height:r.height}}getLargestStringFromMultiArr(t,e){let s=t;if(this.w.axisFlags.isMultiLineX){const t=e.map(t=>Array.isArray(t)?t.length:1),i=Math.max(...t);s=e[t.indexOf(i)]}return s}};class we{constructor(t){this.w=t.w,this.dCtx=t}getxAxisLabelsCoords(){const t=this.w;let e,s=t.labelData.labels.slice();if(t.config.xaxis.convertedCatToNumeric&&0===s.length&&(s=t.labelData.categoryLabels),t.labelData.timescaleLabels.length>0){const s=this.getxAxisTimeScaleLabelsCoords();e={width:s.width,height:s.height},t.layout.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends="left"!==t.config.legend.position&&"right"!==t.config.legend.position||t.config.legend.floating?0:this.dCtx.lgRect.width;const i=t.formatters.xLabelFormatter;let a=b.getLargestStringFromArr(s),r=this.dCtx.dimHelpers.getLargestStringFromMultiArr(a,s);t.globals.isBarHorizontal&&(a=t.globals.yAxisScale[0].result.reduce((t,e)=>t.length>e.length?t:e,0),r=a);const o=new w(this.w),n=a;a=o.xLabelFormat(i,a,n,{i:void 0,dateFormatter:new y(this.w).formatDate,w:t}),r=o.xLabelFormat(i,r,n,{i:void 0,dateFormatter:new y(this.w).formatDate,w:t}),(t.config.xaxis.convertedCatToNumeric&&void 0===a||""===String(a).trim())&&(a="1",r=a);const l=new gt(this.w);let h=l.getTextRects(a,t.config.xaxis.labels.style.fontSize),c=h;if(a!==r&&(c=l.getTextRects(r,t.config.xaxis.labels.style.fontSize)),e={width:h.width>=c.width?h.width:c.width,height:h.height>=c.height?h.height:c.height},e.width*s.length>t.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==t.config.xaxis.labels.rotate||t.config.xaxis.labels.rotateAlways){if(!t.globals.isBarHorizontal){t.layout.rotateXLabels=!0;const s=e=>l.getTextRects(e,t.config.xaxis.labels.style.fontSize,t.config.xaxis.labels.style.fontFamily,`rotate(${t.config.xaxis.labels.rotate} 0 0)`,!1);h=s(a),a!==r&&(c=s(r)),e.height=(h.height>c.height?h.height:c.height)/1.5,e.width=h.width>c.width?h.width:c.width}}else t.layout.rotateXLabels=!1}return t.config.xaxis.labels.show||(e={width:0,height:0}),{width:e.width,height:e.height}}getxAxisGroupLabelsCoords(){var t;const e=this.w;if(!e.labelData.hasXaxisGroups)return{width:0,height:0};const s=(null==(t=e.config.xaxis.group.style)?void 0:t.fontSize)||e.config.xaxis.labels.style.fontSize,i=e.labelData.groups.map(t=>t.title);let a;const r=b.getLargestStringFromArr(i),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(r,i),n=new gt(this.w),l=n.getTextRects(r,s);let h=l;return r!==o&&(h=n.getTextRects(o,s)),a={width:l.width>=h.width?l.width:h.width,height:l.height>=h.height?l.height:h.height},e.config.xaxis.labels.show||(a={width:0,height:0}),{width:a.width,height:a.height}}getxAxisTitleCoords(){const t=this.w;let e=0,s=0;if(void 0!==t.config.xaxis.title.text){const i=new gt(this.w).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize);e=i.width,s=i.height}return{width:e,height:s}}getxAxisTimeScaleLabelsCoords(){const t=this.w;this.dCtx.timescaleLabels=t.labelData.timescaleLabels.slice();const e=this.dCtx.timescaleLabels.map(t=>t.value),s=e.reduce((t,e)=>void 0===t?0:t.length>e.length?t:e,0),i=new gt(this.w).getTextRects(s,t.config.xaxis.labels.style.fontSize);return 1.05*i.width*e.length>t.layout.gridWidth&&0!==t.config.xaxis.labels.rotate&&(t.globals.overlappingXLabels=!0),i}additionalPaddingXLabels(t){const e=this.w,s=e.globals,i=e.config,a=i.xaxis.type,r=t.width;s.skipLastTimelinelabel=!1,s.skipFirstTimelinelabel=!1;const o=e.config.yaxis[0].opposite&&e.globals.isBarHorizontal,n=t=>{if(this.dCtx.timescaleLabels&&this.dCtx.timescaleLabels.length){const a=this.dCtx.timescaleLabels[0],o=this.dCtx.timescaleLabels[this.dCtx.timescaleLabels.length-1].position+r/1.75-this.dCtx.yAxisWidthRight,n=a.position-r/1.75+this.dCtx.yAxisWidthLeft,l="right"===e.config.legend.position&&this.dCtx.lgRect.width>0?this.dCtx.lgRect.width:0;o>s.svgWidth-e.layout.translateX-l&&(s.skipLastTimelinelabel=!0),n<-(t.show&&!t.floating||"bar"!==i.chart.type&&"candlestick"!==i.chart.type&&"rangeBar"!==i.chart.type&&"boxPlot"!==i.chart.type&&"violin"!==i.chart.type?10:r/1.75)&&(s.skipFirstTimelinelabel=!0)}else"datetime"===a?this.dCtx.gridPad.right<r&&!e.layout.rotateXLabels&&(s.skipLastTimelinelabel=!0):"datetime"!==a&&this.dCtx.gridPad.right<r/2-this.dCtx.yAxisWidthRight&&!e.layout.rotateXLabels&&!e.config.xaxis.labels.trim&&(this.dCtx.xPadRight=r/2+1)},l=(t,e)=>{i.yaxis.length>1&&(t=>-1!==s.collapsedSeriesIndices.indexOf(t))(e)||n(t)};i.yaxis.forEach((t,e)=>{o?(this.dCtx.gridPad.left<r&&(this.dCtx.xPadLeft=r/2+1),this.dCtx.xPadRight=r/2+1):l(t,e)})}}class ve{constructor(t){this.w=t.w,this.dCtx=t}getyAxisLabelsCoords(){const t=this.w,e=[];let s=10;const i=new vt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale});return t.config.yaxis.map((a,r)=>{const o={seriesIndex:r,dataPointIndex:-1,w:t},n=t.globals.yAxisScale[r];let l=0;if(!i.isYAxisHidden(r)&&a.labels.show&&void 0!==a.labels.minWidth&&(l=a.labels.minWidth),!i.isYAxisHidden(r)&&a.labels.show&&n.result.length){const i=t.formatters.yLabelFormatters[r],h=n.niceMin===Number.MIN_VALUE?0:n.niceMin;let c=n.result.reduce((t,e)=>{var s,a;return(null==(s=String(i(t,o)))?void 0:s.length)>(null==(a=String(i(e,o)))?void 0:a.length)?t:e},h);c=i(c,o);let d=c;if(void 0!==c&&0!==c.length||(c=n.niceMax),1===String(c).length&&(c+=".0",d=c),t.globals.isBarHorizontal){s=0;const e=t.labelData.labels.slice();c=b.getLargestStringFromArr(e),c=i(c,{seriesIndex:r,dataPointIndex:-1,w:t}),d=this.dCtx.dimHelpers.getLargestStringFromMultiArr(c,e)}const g=new gt(this.w),p="rotate(".concat(a.labels.rotate," 0 0)"),u=g.getTextRects(c,a.labels.style.fontSize,a.labels.style.fontFamily,p,!1);let x=u;c!==d&&(x=g.getTextRects(d,a.labels.style.fontSize,a.labels.style.fontFamily,p,!1)),e.push({width:(l>x.width||l>u.width?l:x.width>u.width?x.width:u.width)+s,height:x.height>u.height?x.height:u.height})}else e.push({width:0,height:0})}),e}getyAxisTitleCoords(){const t=this.w,e=[];return t.config.yaxis.map(t=>{if(t.show&&void 0!==t.title.text){const s=new gt(this.w),i="rotate(".concat(t.title.rotate," 0 0)"),a=s.getTextRects(t.title.text,t.title.style.fontSize,t.title.style.fontFamily,i,!1);e.push({width:a.width,height:a.height})}else e.push({width:0,height:0})}),e}getTotalYAxisWidth(){const t=this.w;let e=0,s=0,i=0;const a=t.globals.yAxisScale.length>1?10:0,r=new vt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale}),o=(o,n)=>{const l=t.config.yaxis[n].floating;let h=0;o.width>0&&!l?(h=o.width+a,function(e){return t.globals.ignoreYAxisIndexes.indexOf(e)>-1}(n)&&(h=h-o.width-a)):h=l||r.isYAxisHidden(n)?0:5,t.config.yaxis[n].opposite?i+=h:s+=h,e+=h};return t.layout.yLabelsCoords.map((t,e)=>{o(t,e)}),t.layout.yTitleCoords.map((t,e)=>{o(t,e)}),t.globals.isBarHorizontal&&!t.config.yaxis[0].floating&&(e=t.layout.yLabelsCoords[0].width+t.layout.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=s,this.dCtx.yAxisWidthRight=i,e}}class Ae{constructor(t){this.w=t.w,this.dCtx=t}gridPadForColumnsInNumericAxis(t){const{w:e}=this,{config:s,globals:i}=e;if(i.noData||i.collapsedSeries.length+i.ancillaryCollapsedSeries.length===s.series.length)return 0;const a=t=>["bar","rangeBar","candlestick","boxPlot","violin"].includes(t),r=s.chart.type;let o=0,n=a(r)?s.series.length:1;i.comboBarCount>0&&(n=i.comboBarCount),i.collapsedSeries.forEach(t=>{a(t.type)&&(n-=1)}),s.chart.stacked&&(n=1);const l=a(r)||i.comboBarCount>0;let h=Math.abs(i.initialMaxX-i.initialMinX);if(l&&e.axisFlags.isXNumeric&&!i.isBarHorizontal&&n>0&&0!==h){h<=3&&(h=i.dataPoints);const e=h/t;let a=i.minXDiff&&i.minXDiff/e>0?i.minXDiff/e:0;a>t/2&&(a/=2),o=a*parseInt(s.plotOptions.bar.columnWidth,10)/100,o<1&&(o=1),i.barPadForNumericAxis=o}return o}gridPadFortitleSubtitle(){const{w:t}=this,{globals:e}=t;let s=this.dCtx.isSparkline||!e.axisCharts?0:10;["title","subtitle"].forEach(i=>{void 0!==t.config[i].text?s+=t.config[i].margin:s+=this.dCtx.isSparkline||!e.axisCharts?0:5}),!t.config.legend.show||"bottom"!==t.config.legend.position||t.config.legend.floating||e.axisCharts||(s+=10);const i=this.dCtx.dimHelpers.getTitleSubtitleCoords("title"),a=this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle");t.layout.gridHeight-=i.height+a.height+s,t.layout.translateY+=i.height+a.height+s}setGridXPosForDualYAxis(t,e){const{w:s}=this,i=new vt(this.w,{theme:this.dCtx.theme,timeScale:this.dCtx.timeScale});s.config.yaxis.forEach((a,r)=>{-1!==s.globals.ignoreYAxisIndexes.indexOf(r)||a.floating||i.isYAxisHidden(r)||(a.opposite&&(s.layout.translateX-=e[r].width+t[r].width+parseInt(a.labels.style.fontSize,10)/1.2+12),s.layout.translateX<2&&(s.layout.translateX=2))})}}class Ce{constructor(t,e){this.w=t,this.ctx=e,this.theme=e.theme,this.timeScale=e.timeScale,this.lgRect={},this.yAxisWidth=0,this.yAxisWidthLeft=0,this.yAxisWidthRight=0,this.xAxisHeight=0,this.isSparkline=this.w.config.chart.sparkline.enabled,this.dimHelpers=new ye(this),this.dimYAxis=new ve(this),this.dimXAxis=new we(this),this.dimGrid=new Ae(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0,this.datalabelsCoords={width:0,height:0},this.xAxisWidth=0,this.timescaleLabels=[]}plotCoords(){const t=this.w,e=t.globals;this.lgRect=this.dimHelpers.getLegendsRect(),this.datalabelsCoords={width:0,height:0};const s=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width;this.isSparkline&&((t.config.markers.discrete.length>0||t.config.markers.size>0)&&Object.entries(this.gridPad).forEach(([t,e])=>{this.gridPad[t]=Math.max(e,this.w.globals.markers.largestSize/1.5)}),this.gridPad.top=Math.max(s/2,this.gridPad.top),this.gridPad.bottom=Math.max(s/2,this.gridPad.bottom)),e.axisCharts?this.setDimensionsForAxisCharts():this.setDimensionsForNonAxisCharts(),this.dimGrid.gridPadFortitleSubtitle(),t.layout.gridHeight=t.layout.gridHeight-this.gridPad.top-this.gridPad.bottom,t.layout.gridWidth=t.layout.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;const i=this.dimGrid.gridPadForColumnsInNumericAxis(t.layout.gridWidth);return t.layout.gridWidth=t.layout.gridWidth-2*i,t.layout.translateX=t.layout.translateX+this.gridPad.left+this.xPadLeft+(i>0?i:0),t.layout.translateY=t.layout.translateY+this.gridPad.top,{layout:{gridHeight:t.layout.gridHeight,gridWidth:t.layout.gridWidth,translateX:t.layout.translateX,translateY:t.layout.translateY,translateXAxisX:t.layout.translateXAxisX,translateXAxisY:t.layout.translateXAxisY,rotateXLabels:t.layout.rotateXLabels,xAxisHeight:t.layout.xAxisHeight,xAxisLabelsHeight:t.layout.xAxisLabelsHeight,xAxisGroupLabelsHeight:t.layout.xAxisGroupLabelsHeight,xAxisLabelsWidth:t.layout.xAxisLabelsWidth,yLabelsCoords:t.layout.yLabelsCoords,yTitleCoords:t.layout.yTitleCoords}}}setDimensionsForAxisCharts(){const t=this.w,e=t.globals,s=this.dimYAxis.getyAxisLabelsCoords(),i=this.dimYAxis.getyAxisTitleCoords();e.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),t.layout.yLabelsCoords=[],t.layout.yTitleCoords=[],t.config.yaxis.map((e,a)=>{t.layout.yLabelsCoords.push({width:s[a].width,index:a}),t.layout.yTitleCoords.push({width:i[a].width,index:a})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();const a=this.dimXAxis.getxAxisLabelsCoords(),r=this.dimXAxis.getxAxisGroupLabelsCoords(),o=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(a,o,r),t.layout.translateXAxisY=t.layout.rotateXLabels?this.xAxisHeight/8:-4,t.layout.translateXAxisX=t.layout.rotateXLabels&&t.axisFlags.isXNumeric&&t.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,t.globals.isBarHorizontal&&(t.layout.rotateXLabels=!1,t.layout.translateXAxisY=parseInt(t.config.xaxis.labels.style.fontSize,10)/1.5*-1),t.layout.translateXAxisY=t.layout.translateXAxisY+t.config.xaxis.labels.offsetY,t.layout.translateXAxisX=t.layout.translateXAxisX+t.config.xaxis.labels.offsetX;let n=this.yAxisWidth,l=this.xAxisHeight;t.layout.xAxisLabelsHeight=this.xAxisHeight-o.height,t.layout.xAxisGroupLabelsHeight=t.layout.xAxisLabelsHeight-a.height,t.layout.xAxisLabelsWidth=this.xAxisWidth,t.layout.xAxisHeight=this.xAxisHeight;let h=10;("radar"===t.config.chart.type||this.isSparkline)&&(n=0,l=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||"treemap"===t.config.chart.type)&&(n=0,l=0,h=0),this.isSparkline||"treemap"===t.config.chart.type||this.dimXAxis.additionalPaddingXLabels(a);const c=()=>{t.layout.translateX=n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-this.lgRect.height-l-(this.isSparkline||"treemap"===t.config.chart.type?0:t.layout.rotateXLabels?10:15),t.layout.gridWidth=e.svgWidth-n-2*this.datalabelsCoords.width};switch("top"===t.config.xaxis.position&&(h=t.layout.xAxisHeight-t.config.xaxis.axisTicks.height-5),t.config.legend.position){case"bottom":t.layout.translateY=h,c();break;case"top":t.layout.translateY=this.lgRect.height+h,c();break;case"left":t.layout.translateY=h,t.layout.translateX=this.lgRect.width+n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-l-12,t.layout.gridWidth=e.svgWidth-this.lgRect.width-n-2*this.datalabelsCoords.width;break;case"right":t.layout.translateY=h,t.layout.translateX=n+this.datalabelsCoords.width,t.layout.gridHeight=e.svgHeight-l-12,t.layout.gridWidth=e.svgWidth-this.lgRect.width-n-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(i,s);new _t(this.w,{theme:this.theme,timeScale:this.timeScale}).setYAxisXPosition(s,i)}setDimensionsForNonAxisCharts(){const t=this.w,e=t.globals,s=t.config;let i=0;t.config.legend.show&&!t.config.legend.floating&&(i=20);const a="pie"===s.chart.type||"polarArea"===s.chart.type||"donut"===s.chart.type?"pie":"radialBar",r=s.plotOptions[a].offsetY,o=s.plotOptions[a].offsetX;if(!s.legend.show||s.legend.floating){t.layout.gridHeight=e.svgHeight;const s=t.dom.elWrap.getBoundingClientRect().width;return t.layout.gridWidth=Math.min(s,t.layout.gridHeight),t.layout.translateY=r,void(t.layout.translateX=o+(e.svgWidth-t.layout.gridWidth)/2)}switch(s.legend.position){case"bottom":t.layout.gridHeight=e.svgHeight-this.lgRect.height,t.layout.gridWidth=e.svgWidth,t.layout.translateY=r-10,t.layout.translateX=o+(e.svgWidth-t.layout.gridWidth)/2;break;case"top":t.layout.gridHeight=e.svgHeight-this.lgRect.height,t.layout.gridWidth=e.svgWidth,t.layout.translateY=this.lgRect.height+r+10,t.layout.translateX=o+(e.svgWidth-t.layout.gridWidth)/2;break;case"left":t.layout.gridWidth=e.svgWidth-this.lgRect.width-i,t.layout.gridHeight="auto"!==s.chart.height?e.svgHeight:t.layout.gridWidth,t.layout.translateY=r,t.layout.translateX=o+this.lgRect.width+i;break;case"right":t.layout.gridWidth=e.svgWidth-this.lgRect.width-i-5,t.layout.gridHeight="auto"!==s.chart.height?e.svgHeight:t.layout.gridWidth,t.layout.translateY=r,t.layout.translateX=o+10;break;default:throw new Error("Legend position not supported")}}conditionalChecksForAxisCoords(t,e,s){const i=this.w,a=i.labelData.hasXaxisGroups?2:1,r=s.height+t.height+e.height,o=i.axisFlags.isMultiLineX?1.2:1.618,n=i.layout.rotateXLabels?22:10,l=i.layout.rotateXLabels&&"bottom"===i.config.legend.position?10:0;this.xAxisHeight=r*o+a*n+l,this.xAxisWidth=t.width,this.xAxisHeight-e.height>i.config.xaxis.labels.maxHeight&&(this.xAxisHeight=i.config.xaxis.labels.maxHeight),i.config.xaxis.labels.minHeight&&this.xAxisHeight<i.config.xaxis.labels.minHeight&&(this.xAxisHeight=i.config.xaxis.labels.minHeight),i.config.xaxis.floating&&(this.xAxisHeight=0);let h=0,c=0;i.config.yaxis.forEach(t=>{h+=t.labels.minWidth,c+=t.labels.maxWidth}),this.yAxisWidth<h&&(this.yAxisWidth=h),this.yAxisWidth>c&&(this.yAxisWidth=c)}}const Se=1e3,ke=6e4,_e=36e5,Le=24*_e,Me=7*Le,De=30*Le,Ee=365*Le,Pe=10/86400,Fe=[{unit:"second",step:1,approxMs:Se},{unit:"second",step:5,approxMs:5e3},{unit:"second",step:15,approxMs:15e3},{unit:"second",step:30,approxMs:3e4},{unit:"minute",step:1,approxMs:ke},{unit:"minute",step:5,approxMs:3e5},{unit:"minute",step:15,approxMs:9e5},{unit:"minute",step:30,approxMs:18e5},{unit:"hour",step:1,approxMs:_e},{unit:"hour",step:3,approxMs:3*_e},{unit:"hour",step:6,approxMs:6*_e},{unit:"hour",step:12,approxMs:12*_e},{unit:"day",step:1,approxMs:Le},{unit:"day",step:2,approxMs:2*Le},{unit:"week",step:1,approxMs:Me},{unit:"week",step:2,approxMs:2*Me},{unit:"month",step:1,approxMs:De},{unit:"month",step:3,approxMs:7776e6},{unit:"month",step:6,approxMs:15552e6},{unit:"year",step:1,approxMs:Ee},{unit:"year",step:2,approxMs:63072e6},{unit:"year",step:5,approxMs:15768e7},{unit:"year",step:10,approxMs:31536e7},{unit:"year",step:25,approxMs:7884e8},{unit:"year",step:50,approxMs:15768e8},{unit:"year",step:100,approxMs:31536e8}];class Te{constructor(t,e){this.w=t,this.ctx=e,this.tickInterval=null,this.timeScaleArray=[],this.utc=t.config.xaxis.labels.datetimeUTC}calculateTimeScaleTicks(t,e){const s=this.w;if(s.globals.allSeriesCollapsed)return s.labelData.labels=[],s.labelData.timescaleLabels=[],this.timeScaleArray=[],[];const i=e-t,a=i/Le;s.interact.disableZoomIn=!1,s.interact.disableZoomOut=!1,a<Pe?s.interact.disableZoomIn=!0:a>5e4&&(s.interact.disableZoomOut=!0);const r=Number.isFinite(s.config.xaxis.tickAmount)?s.config.xaxis.tickAmount:10;this.tickInterval=function(t,e){(!Number.isFinite(e)||e<=0)&&(e=10);if(t<=0)return Fe[0];const s=t/e;let i=Fe[0],a=1/0;for(const t of Fe){const e=Math.abs(Math.log(t.approxMs/s));e<a&&(a=e,i=t)}return i}(i,r);const o=this.generateBaseTicks(t,e,this.tickInterval);return this.timeScaleArray=o,o}generateBaseTicks(t,e,s){const i=this.w,a=new y(i),r=this.utc,o=i.layout.gridWidth,n=e-t,l=[];let h=a.ceilToBoundary(t,s.unit,s.step,r),c=0;for(;h<=e&&c<5e3;){const e=a.getDateFields(h,r),i=n>0?(h-t)/n*o:0;l.push({timestamp:h,position:i,unit:s.unit,year:e.year,month:e.month+1,day:e.date,hour:e.hour,minute:e.minute,second:e.second,value:h}),h=a.addInterval(h,s.unit,s.step,r),c++}return l}recalcDimensionsBasedOnFormat(t){const e=this.w,s=this.formatDates(t),i=this.removeOverlappingTS(s);e.labelData.timescaleLabels=i.slice();const a=new Ce(this.w,this.ctx).plotCoords();this.ctx._writeLayoutCoords(a.layout)}formatDates(t){const e=this.w,s=new y(e),i=e.config.xaxis.labels.format,a=e.config.xaxis.labels.datetimeFormatter,r=this.utc,o=(t,e=2)=>String(t).padStart(e,"0"),n=i||this._effectiveFormat(t,a);return t.map(t=>{const e=s.getDate(t.timestamp),i=s.formatDate(e,n);return{dateString:`${t.year}-${o(t.month)}-${o(t.day)}T${o(t.hour)}:${o(t.minute)}:${o(t.second)}.000${r?"Z":""}`,position:t.position,value:i,unit:t.unit,year:t.year,month:t.month}})}_effectiveFormat(t,e){if(0===t.length)return e.day||"dd MMM";const s=this.tickInterval&&this.tickInterval.unit||t[0].unit,i=e["week"===s?"day":s]||e.day||"dd MMM",a=t[0],r=t[t.length-1],o=a.year!==r.year,n=o||a.month!==r.month||a.day!==r.day,l=/y/i.test(i),h=/M/.test(i),c=/d/i.test(i);if("month"===s||"week"===s)return o&&!l?i+" yyyy":i;if("day"===s)return o&&!l?i+" yyyy":i;if("hour"===s||"minute"===s||"second"===s){if(n&&!c&&!h){return(o?"dd MMM yyyy":"dd MMM")+" "+i}return i}return i}removeOverlappingTS(t){if(0===t.length)return[];const e=this.w,s=new gt(e);let i,a=!1;t[0].value&&t.every(e=>e.value.length===t[0].value.length)&&(a=!0,i=s.getTextRects(t[0].value,e.config.xaxis.labels.style.fontSize).width);let r=0;return t.map((o,n)=>{if(0===n)return o;if(!e.config.xaxis.labels.hideOverlappingLabels)return o;const l=a?i:s.getTextRects(t[r].value,e.config.xaxis.labels.style.fontSize).width,h=t[r].position;return o.position>h+l+10?(r=n,o):null}).filter(t=>null!==t)}}const Ie="__apexcharts_registry__",Xe="__apexcharts_custom_types__";function Re(){return globalThis[Ie]}function ze(){return globalThis[Xe]}function Be(t){return ze().has(t)}function Ye(t){Object.assign(Re(),t)}function Ne(t){const e=Re()[t];if(!e)throw new Error(`ApexCharts: chart type "${t}" is not registered. Import it via ApexCharts.use() or use the full apexcharts bundle.`);return e}globalThis[Ie]||(globalThis[Ie]={}),globalThis[Xe]||(globalThis[Xe]=new Set);class We{constructor(t,e,s){this.w=e,this.ctx=s,this.el=t}setupElements(){const{globals:t,config:e}=this.w,s=e.chart.type,i=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","violin","scatter","bubble"],a=[...i,"radar","heatmap","treemap"],r=!a.includes(s)&&!["pie","donut","polarArea","radialBar"].includes(s)&&Be(s);t.axisCharts=a.includes(s)||r,t.xyCharts=i.includes(s)||r,t.isBarHorizontal=["bar","rangeBar","boxPlot","violin"].includes(s)&&e.plotOptions.bar.horizontal,t.chartClass=`.apexcharts${t.chartID}`,this.w.dom.baseEl=this.el,this.w.dom.elWrap=m.createElementNS("http://www.w3.org/1999/xhtml","div"),gt.setAttrs(this.w.dom.elWrap,{id:t.chartClass.substring(1),class:`apexcharts-canvas ${t.chartClass.substring(1)}`}),this.el.appendChild(this.w.dom.elWrap);const o=globalThis.SVG;if(this.w.dom.Paper=o().addTo(this.w.dom.elWrap),this.w.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:`translate(${e.chart.offsetX}, ${e.chart.offsetY})`}),this.w.dom.Paper.node.style.background="dark"!==e.theme.mode||e.chart.background?"light"!==e.theme.mode||e.chart.background?e.chart.background:"#fff":"#343A3F",this.setSVGDimensions(),this.w.dom.elLegendForeign=m.createElementNS(F,"foreignObject"),gt.setAttrs(this.w.dom.elLegendForeign,{x:0,y:0,width:t.svgWidth,height:t.svgHeight}),this.w.dom.elLegendWrap=m.createElementNS("http://www.w3.org/1999/xhtml","div"),this.w.dom.elLegendWrap.classList.add("apexcharts-legend"),this.w.dom.elWrap.appendChild(this.w.dom.elLegendWrap),this.w.dom.Paper.node.appendChild(this.w.dom.elLegendForeign),e.chart.accessibility.enabled&&e.chart.accessibility.announcements.enabled){const t=m.createElement("div");t.className="apexcharts-sr-status",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),this.w.dom.elWrap.appendChild(t)}if(e.chart.accessibility.enabled){const t=this.getAccessibleChartLabel(),s=e.chart.accessibility.keyboard.enabled&&e.chart.accessibility.keyboard.navigation.enabled?"application":"img";if(this.w.dom.Paper.attr({role:s,"aria-label":t}),e.chart.accessibility.description){const t=m.createElementNS(F,"desc");t.textContent=e.chart.accessibility.description,this.w.dom.Paper.node.insertBefore(t,this.w.dom.elLegendForeign.nextSibling)}}this.w.dom.elGraphical=this.w.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),this.w.dom.elDefs=this.w.dom.Paper.defs(),this.w.dom.Paper.add(this.w.dom.elGraphical),this.w.dom.elGraphical.add(this.w.dom.elDefs)}plotChartType(t,e){const{w:s,ctx:i}=this,{config:a,globals:r}=s,o=i.renderer&&"canvas"===i.renderer.kind;o&&i.renderer.beginSeries();const n={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},bar:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},violin:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},l={},h=a.chart.type||"line";let c=null,d=0;this.w.seriesData.series.forEach((e,i)=>{var a,r;const o="column"===(null==(a=t[i])?void 0:a.type)?"bar":(null==(r=t[i])?void 0:r.type)||("column"===h?"bar":h),g=n;g[o]?("rangeArea"===o?(g[o].series.push(this.w.rangeData.seriesRangeStart[i]),g[o].seriesRangeEnd.push(this.w.rangeData.seriesRangeEnd[i])):g[o].series.push(e),g[o].i.push(i),"bar"===o&&(s.globals.columnSeries=n.bar)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(o)?c=o:Be(o)&&(l[o]||(l[o]={series:[],i:[]}),l[o].series.push(e),l[o].i.push(i)),h!==o&&"scatter"!==o&&d++}),d>0&&n.bar.series.length>0&&a.plotOptions.bar.horizontal&&(d-=n.bar.series.length,n.bar={series:[],i:[]},s.globals.columnSeries={series:[],i:[]}),r.comboCharts||(r.comboCharts=d>0);const g=n.line.series.length>0||n.area.series.length>0||n.scatter.series.length>0||n.bubble.series.length>0||n.rangeArea.series.length>0||!r.comboCharts&&["line","area","scatter","bubble","rangeArea"].includes(a.chart.type)?new(Ne("line"))(i.w,i,e):null,p=n.candlestick.series.length>0||n.boxPlot.series.length>0||!r.comboCharts&&["candlestick","boxPlot"].includes(a.chart.type)?new(Ne("candlestick"))(i.w,i,e):null,u=n.violin.series.length>0||!r.comboCharts&&"violin"===a.chart.type?new(Ne("violin"))(i.w,i,e):null,x=!r.comboCharts&&["pie","donut","polarArea"].includes(a.chart.type);i.pie=x?new(Ne("pie"))(i.w,i):null;const f=n.rangeBar.series.length>0||!r.comboCharts&&"rangeBar"===a.chart.type;i.rangeBar=f?new(Ne("rangeBar"))(i.w,i,e):null;let m=[];if(r.comboCharts){const t=new P(this.w);if(n.area.series.length>0&&m.push(...t.drawSeriesByGroup(n.area,r.areaGroups,"area",g)),n.bar.series.length>0)if(a.chart.stacked){const t=new(Ne("barStacked"))(i.w,i,e);m.push(t.draw(n.bar.series,n.bar.i))}else i.bar=new(Ne("bar"))(i.w,i,e),m.push(i.bar.draw(n.bar.series,n.bar.i));if(n.rangeArea.series.length>0&&m.push(g.draw(n.rangeArea.series,"rangeArea",n.rangeArea.i,n.rangeArea.seriesRangeEnd)),n.line.series.length>0&&m.push(...t.drawSeriesByGroup(n.line,r.lineGroups,"line",g)),n.candlestick.series.length>0&&m.push(p.draw(n.candlestick.series,"candlestick",n.candlestick.i)),n.boxPlot.series.length>0&&m.push(p.draw(n.boxPlot.series,"boxPlot",n.boxPlot.i)),n.violin.series.length>0&&m.push(u.draw(n.violin.series,"violin",n.violin.i)),n.rangeBar.series.length>0&&m.push(i.rangeBar.draw(n.rangeBar.series,n.rangeBar.i)),n.scatter.series.length>0){const t=new(Ne("line"))(i.w,i,e,!0);m.push(t.draw(n.scatter.series,"scatter",n.scatter.i))}if(n.bubble.series.length>0){const t=new(Ne("line"))(i.w,i,e,!0);m.push(t.draw(n.bubble.series,"bubble",n.bubble.i))}Object.keys(l).forEach(t=>{const s=l[t];if(s.series.length>0){const a=new(Ne(t))(i.w,i,e);m.push(a.draw(s.series,t,s.i))}})}else{const t=a.chart.type;switch(t){case"line":m=g.draw(this.w.seriesData.series,"line");break;case"area":m=g.draw(this.w.seriesData.series,"area");break;case"bar":if(a.chart.stacked){const t=new(Ne("barStacked"))(i.w,i,e);m=t.draw(this.w.seriesData.series)}else i.bar=new(Ne("bar"))(i.w,i,e),m=i.bar.draw(this.w.seriesData.series);break;case"candlestick":m=p.draw(this.w.seriesData.series,"candlestick");break;case"boxPlot":m=p.draw(this.w.seriesData.series,t);break;case"violin":m=u.draw(this.w.seriesData.series,"violin");break;case"rangeBar":m=i.rangeBar.draw(this.w.seriesData.series);break;case"rangeArea":m=g.draw(this.w.rangeData.seriesRangeStart,"rangeArea",void 0,this.w.rangeData.seriesRangeEnd);break;case"heatmap":{const t=new(Ne("heatmap"))(i.w,i,e);m=t.draw(this.w.seriesData.series);break}case"treemap":{const t=new(Ne("treemap"))(i.w,i);m=t.draw(this.w.seriesData.series);break}case"pie":case"donut":case"polarArea":m=i.pie.draw(this.w.seriesData.series);break;case"radialBar":{const t=new(Ne("radialBar"))(i.w,i);m=t.draw(this.w.seriesData.series);break}case"radar":{const t=new(Ne("radar"))(i.w,i);m=t.draw(this.w.seriesData.series);break}default:if(Be(t)){const s=new(Ne(t))(i.w,i,e);m=s.draw(this.w.seriesData.series,t)}else m=g.draw(this.w.seriesData.series)}}if(o){const t=i.renderer.present();if(t){const e=new gt(s).group({class:"apexcharts-canvas-series-wrap"});e.add(t);return(Array.isArray(m)?m:[m]).forEach(t=>{t&&e.add(t)}),e}}return m}setSVGDimensions(){var t;const{globals:e,config:s}=this.w;s.chart.width=s.chart.width||"100%",s.chart.height=s.chart.height||"auto";const i=s.chart.width,a=s.chart.height;e.svgWidth=NaN,e.svgHeight=NaN;let r=b.getDimensions(this.el);const o=i.toString().split(/[0-9]+/g).pop();"%"===o?b.isNumber(r[0])&&(0===r[0].width&&(r=b.getDimensions(this.el.parentNode)),e.svgWidth=r[0]*parseInt(i,10)/100):"px"!==o&&""!==o||(e.svgWidth=parseInt(i,10));const n=String(a).toString().split(/[0-9]+/g).pop();if("auto"!==a&&""!==a)if("%"===n){const t=b.getDimensions(this.el.parentNode);e.svgHeight=t[1]*parseInt(a,10)/100}else e.svgHeight=parseInt(a,10);else e.svgHeight=e.axisCharts?e.svgWidth/1.61:e.svgWidth/1.2;if(e.svgWidth=Math.max(e.svgWidth,0),e.svgHeight=Math.max(e.svgHeight,0),gt.setAttrs(this.w.dom.Paper.node,{width:e.svgWidth,height:e.svgHeight}),"%"!==n&&c.isBrowser()){const i=e.axisCharts&&(s.grid.show||s.dataLabels.enabled||s.xaxis.labels.show||s.xaxis.axisBorder.show||s.xaxis.axisTicks.show||s.yaxis.some(t=>t.show&&(t.labels.show||t.axisBorder.show||t.axisTicks.show))),a=s.chart.sparkline.enabled||!i?0:s.chart.parentHeightOffset,r=this.w.dom.Paper.node;(null==(t=r.parentNode)?void 0:t.parentNode)&&(r.parentNode.parentNode.style.minHeight=`${e.svgHeight+a}px`)}this.w.dom.elWrap.style.width=`${e.svgWidth}px`,this.w.dom.elWrap.style.height=`${e.svgHeight}px`}shiftGraphPosition(){const{globals:t}=this.w,{translateY:e,translateX:s}=t;gt.setAttrs(this.w.dom.elGraphical.node,{transform:`translate(${s}, ${e})`})}resizeNonAxisCharts(){var t,e,s,i,a,r;const{w:o}=this,n=o.config.chart.height?String(o.config.chart.height):"",l=""!==n&&"auto"!==n,h=n.includes("%");let d=0,g=o.config.chart.sparkline.enabled?1:15;g+=o.config.grid.padding.bottom,["top","bottom"].includes(o.config.legend.position)&&o.config.legend.show&&!o.config.legend.floating&&(d=(null!=(e=null==(t=this.ctx.legend)?void 0:t.legendHelpers.getLegendDimensions().clwh)?e:0)+7);const p=o.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"),u=o.globals.pieExternalLabelMarginY||0;let x=u>0?2*o.globals.radialSize+2*u:2.05*o.globals.radialSize;const f=Math.abs(o.config.plotOptions.radialBar.endAngle-o.config.plotOptions.radialBar.startAngle);if(p&&!o.config.chart.sparkline.enabled&&f<360){const t=b.getBoundingClientRect(this.w.dom.Paper.node);let e=1/0,n=-1/0;const l=s=>{var i,a,r,o;if(null==(i=s.classList)?void 0:i.contains("apexcharts-radialbar-hollow"))return;const h=null==(r=null==(a=s.tagName)?void 0:a.toLowerCase)?void 0:r.call(a);if("text"===h||"tspan"===h)return;const c=Array.from(null!=(o=s.children)?o:[]);if(c.length>0)return void c.forEach(t=>l(t));const d=b.getBoundingClientRect(s);if(d.bottom-d.top>0){const s=d.top-t.top,i=d.bottom-t.top;s<e&&(e=s),i>n&&(n=i)}};if(Array.from(null!=(s=p.children)?s:[]).forEach(t=>l(t)),Number.isFinite(e)||(e=0),!Number.isFinite(n)){const e=b.getBoundingClientRect(p);n=e.bottom-t.top}const u=Math.max(g,.2*o.globals.radialSize),f=Math.max(u-e,0);0!==f&&(o.layout.translateY=(null!=(i=o.layout.translateY)?i:0)+f,gt.setAttrs(this.w.dom.elGraphical.node,{transform:`translate(${null!=(a=o.layout.translateX)?a:0}, ${o.layout.translateY})`}),n+=f),x=n>0?n:2.05*o.globals.radialSize;const m=Math.max(u,e),y=Math.ceil(x+d+m),w=null!=(r=o.config.chart.offsetY)?r:0,v=y+Math.max(w,0);return void(h||(this.w.dom.elLegendForeign&&this.w.dom.elLegendForeign.setAttribute("height",String(v)),this.w.dom.elWrap.style.height=`${v}px`,gt.setAttrs(this.w.dom.Paper.node,{height:y}),c.isBrowser()&&(this.w.dom.Paper.node.parentNode.parentNode.style.minHeight=`${v}px`)))}const m=Math.ceil(x+this.w.layout.translateY+d+g);l||(this.w.dom.elLegendForeign&&this.w.dom.elLegendForeign.setAttribute("height",String(m)),this.w.dom.elWrap.style.height=`${m}px`,gt.setAttrs(this.w.dom.Paper.node,{height:m}),c.isBrowser()&&(this.w.dom.Paper.node.parentNode.parentNode.style.minHeight=`${m}px`))}coreCalculations(){new kt(this.w).init()}resetGlobals(){const t=()=>this.w.config.series.map(()=>[]),e=new D,{globals:s}=this.w,i={dataWasParsed:this.w.axisFlags.dataWasParsed,originalSeries:s.originalSeries};e.initGlobalVars(s),s.seriesXvalues=t(),s.seriesYvalues=t(),i.dataWasParsed&&(this.w.axisFlags.dataWasParsed=i.dataWasParsed,s.originalSeries=i.originalSeries)}isMultipleY(){return!!(Array.isArray(this.w.config.yaxis)&&this.w.config.yaxis.length>1)&&(this.w.globals.isMultipleYAxis=!0,!0)}xySettings(){const{w:t}=this;let e=null;if(t.globals.axisCharts){if("back"===t.config.xaxis.crosshairs.position&&new Et(this.w).drawXCrosshairs(),"back"===t.config.yaxis[0].crosshairs.position&&new Et(this.w).drawYCrosshairs(),"datetime"===t.config.xaxis.type&&void 0===t.config.xaxis.labels.formatter){this.ctx.timeScale=new Te(this.w,this.ctx);let e=[];isFinite(t.globals.minX)&&isFinite(t.globals.maxX)&&!t.globals.isBarHorizontal?e=this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minX,t.globals.maxX):t.globals.isBarHorizontal&&(e=this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minY,t.globals.maxY)),this.ctx.timeScale.recalcDimensionsBasedOnFormat(e)}e=new P(this.w).getCalculatedRatios()}return e}updateSourceChart(t){this.ctx.w.interact.selection=void 0,this.ctx.updateHelpers._updateOptions({chart:{selection:{xaxis:{min:t.w.globals.minX,max:t.w.globals.maxX}}}},!1,!1)}setupBrushHandler(){const{ctx:t,w:e}=this;if(e.config.chart.brush.enabled&&"function"!=typeof e.config.chart.events.selection){const s=Array.isArray(e.config.chart.brush.targets)?e.config.chart.brush.targets:[e.config.chart.brush.target];s.forEach(e=>{const s=t.constructor.getChartByID(e);s.w.globals.brushSource=this.ctx,"function"!=typeof s.w.config.chart.events.zoomed&&(s.w.config.chart.events.zoomed=()=>this.updateSourceChart(s)),"function"!=typeof s.w.config.chart.events.scrolled&&(s.w.config.chart.events.scrolled=()=>this.updateSourceChart(s))}),e.config.chart.events.selection=(e,i)=>{s.forEach(e=>{t.constructor.getChartByID(e).ctx.updateHelpers._updateOptions({xaxis:{min:i.xaxis.min,max:i.xaxis.max}},!1,!1,!1,!1)})}}}getAccessibleChartLabel(){const t=this.w,e=t.config;if(e.chart.accessibility&&e.chart.accessibility.description)return e.chart.accessibility.description;const s=e.chart.type,i=[];if(e.title.text)i.push(`${e.title.text}. ${s} chart`),e.subtitle.text&&i.push(e.subtitle.text);else{const a=Array.isArray(t.seriesData.seriesNames)&&t.seriesData.seriesNames.length?t.seriesData.seriesNames.filter(Boolean):Array.isArray(e.series)?e.series.map(t=>"object"==typeof t&&null!==t?t.name:null).filter(Boolean):[],r=t.seriesData.series.length||(e.series?e.series.length:0);a.length?i.push(`${s} chart with ${r} data series: ${a.join(", ")}`):i.push(`${s} chart with ${r} data series`)}return i.join(". ")}}class Oe{constructor(t,{resetGlobals:e=()=>{},isMultipleY:s=()=>{}}={}){this.w=t,this.resetGlobals=e,this.isMultipleY=s,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new P(this.w),this.activeSeriesIndex=0}getFirstDataPoint(){const t=this.w.config.series,e=new ce(this.w);this.activeSeriesIndex=e.getActiveConfigSeriesIndex();const s=t[this.activeSeriesIndex];return s&&s.data&&s.data.length>0&&null!==s.data[0]&&void 0!==s.data[0]?s.data[0]:null}isMultiFormat(){return this.isFormatXY()||this.isFormat2DArray()}isFormatXY(){var t;const e=this.getFirstDataPoint();if(!e||void 0===e.x)return!1;const s=null==(t=this.w.config.series[this.activeSeriesIndex])?void 0:t.data;if(s){const t=t=>t&&void 0!==t.x;for(let e=1;e<Math.min(3,s.length)&&!0===t(s[e]);e++);}return!0}isFormat2DArray(){const t=this.getFirstDataPoint();return t&&Array.isArray(t)}handleFormat2DArray(t,e){const s=this.w.config,i=t[e].data,a="boxPlot"===s.chart.type||"boxPlot"===s.series[e].type;for(let t=0;t<i.length;t++){const e=i[t],r=e[0],o=e[1],n=e[2];if(void 0!==o&&(Array.isArray(o)&&4===o.length&&!a?this.twoDSeries.push(b.parseNumber(o[3])):e.length>=5?this.twoDSeries.push(b.parseNumber(e[4])):this.twoDSeries.push(b.parseNumber(o)),this.w.axisFlags.dataFormatXNumeric=!0),"datetime"===s.xaxis.type){const t=new Date(r).getTime();this.twoDSeriesX.push(t)}else this.twoDSeriesX.push(r);void 0!==n&&(this.threeDSeries.push(n),this.w.axisFlags.isDataXYZ=!0)}}handleFormatXY(t,e){const s=this.w.config,i=this.w.globals,a=new y(this.w),r=t[e].data;let o=e;i.collapsedSeriesIndices.indexOf(e)>-1&&(o=this.activeSeriesIndex);const n=t[o].data;for(let t=0;t<r.length;t++){const s=r[t];if(void 0!==s.y){const t=Array.isArray(s.y)?b.parseNumber(s.y[s.y.length-1]):b.parseNumber(s.y);this.twoDSeries.push(t)}void 0===this.seriesGoals[e]&&(this.seriesGoals[e]=[]),void 0!==s.goals&&Array.isArray(s.goals)?this.seriesGoals[e].push(s.goals):this.seriesGoals[e].push(null),void 0!==s.z&&(this.threeDSeries.push(s.z),this.w.axisFlags.isDataXYZ=!0)}for(let t=0;t<n.length;t++){const e=n[t].x,r="string"==typeof e,o=Array.isArray(e),l=!o&&!!a.isValidDate(e);if(r||l)if(r||s.xaxis.convertedCatToNumeric){const t=i.isBarHorizontal&&this.w.axisFlags.isRangeData;"datetime"!==s.xaxis.type||t?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e),isNaN(e)||"category"===this.w.config.xaxis.type||"string"==typeof e||(this.w.axisFlags.isXNumeric=!0)):this.twoDSeriesX.push(a.parseDate(e))}else"datetime"===s.xaxis.type?this.twoDSeriesX.push(a.parseDate(e.toString())):(this.w.axisFlags.dataFormatXNumeric=!0,this.w.axisFlags.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(e)));else o?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e)):(this.w.axisFlags.isXNumeric=!0,this.w.axisFlags.dataFormatXNumeric=!0,this.twoDSeriesX.push(e))}}handleRangeData(t,e){let s={start:[],end:[],rangeUniques:[]};return this.isFormat2DArray()?s=this.handleRangeDataFormat("array",t,e):this.isFormatXY()&&(s=this.handleRangeDataFormat("xy",t,e)),this.w.rangeData.seriesRangeStart[e]=void 0===s.start?[]:s.start,this.w.rangeData.seriesRangeEnd[e]=void 0===s.end?[]:s.end,this.w.rangeData.seriesRange[e]=s.rangeUniques,this.w.rangeData.seriesRange.forEach(t=>{t&&t.forEach(t=>{const e=t.y,s=e.length;if(!(s<=1))for(let i=0;i<s;i++){const a=e[i],r=a.y1,o=a.y2;for(let n=i+1;n<s;n++){const s=e[n],i=s.y1;if(r<=s.y2&&i<=o){const e=t;e.overlaps.add(a.rangeName),e.overlaps.add(s.rangeName)}}}})}),s}handleCustomRangeData(t,e,s){const i=t[e].data||[],a=[],r=[];for(let t=0;t<i.length;t++){const e=i[t];let o,n;if("function"==typeof s){let i=s(e,t);Array.isArray(i)||(i=[i]);const a=i.map(t=>b.parseNumber(t)).filter(t=>null!==t&&!isNaN(t));o=a.length?Math.min(...a):null,n=a.length?Math.max(...a):null}else{const t=null==e?null:e.y;Array.isArray(t)?(o=b.parseNumber(t[0]),n=b.parseNumber(t[t.length-1])):o=n=b.parseNumber(t)}a.push(o),r.push(n)}this.w.rangeData.seriesRangeStart[e]=a,this.w.rangeData.seriesRangeEnd[e]=r}handleCandleStickBoxData(t,e){let s={o:[],h:[],m:[],l:[],c:[]};return this.isFormat2DArray()?s=this.handleCandleStickBoxDataFormat("array",t,e):this.isFormatXY()&&(s=this.handleCandleStickBoxDataFormat("xy",t,e)),this.w.candleData.seriesCandleO[e]=s.o,this.w.candleData.seriesCandleH[e]=s.h,this.w.candleData.seriesCandleM[e]=s.m,this.w.candleData.seriesCandleL[e]=s.l,this.w.candleData.seriesCandleC[e]=s.c,this.w.candleData.seriesBoxPoints[e]=s.points||[],s}handleViolinData(t,e){var s,i,a,r,o,n;const l=this.w,h=t[e].data,c=[],d=[],g=[],p=[],u=[];for(let t=0;t<h.length;t++){const e=h[t],l=null!=(a=null!=(i=null==(s=null==e?void 0:e.y)?void 0:s.density)?i:null==e?void 0:e[1])?a:[],x=null!=(n=null!=(o=null==(r=null==e?void 0:e.y)?void 0:r.points)?o:null==e?void 0:e[2])?n:[],f=[],m=[];let y=0,w=null,v=1/0,A=-1/0;for(let t=0;t<l.length;t++){const e=b.parseNumber(l[t][0]),s=b.parseNumber(l[t][1]);null!==e&&null!==s&&(f.push(e),m.push(s),s>y&&(y=s,w=e),e<v&&(v=e),e>A&&(A=e))}const C=[];for(let t=0;t<x.length;t++){const e=b.parseNumber(x[t]);null!==e&&(C.push(e),e<v&&(v=e),e>A&&(A=e))}c.push({values:f,weights:m,maxWeight:y}),d.push(C),g.push(v===1/0?0:v),p.push(A===-1/0?0:A),u.push(null!==w?w:C.length?C[Math.floor(C.length/2)]:0)}l.violinData.seriesViolinDensity[e]=c,l.violinData.seriesViolinPoints[e]=d,l.violinData.seriesViolinMin[e]=g,l.violinData.seriesViolinMax[e]=p,this.twoDSeries=u}handleRangeDataFormat(t,e,s){const i=[],a=[],r=new Map,o=[];if(e[s].data.forEach(t=>{if(!r.has(t.x)){const e={x:t.x,overlaps:new Set,y:[]};r.set(t.x,e),o.push(e)}}),"array"===t)for(let t=0;t<e[s].data.length;t++)Array.isArray(e[s].data[t])?(i.push(e[s].data[t][1][0]),a.push(e[s].data[t][1][1])):(i.push(e[s].data[t]),a.push(e[s].data[t]));else if("xy"===t)for(let t=0;t<e[s].data.length;t++){const o=Array.isArray(e[s].data[t].y),n=b.randomId(),l=e[s].data[t].x,h={y1:o?e[s].data[t].y[0]:e[s].data[t].y,y2:o?e[s].data[t].y[1]:e[s].data[t].y,rangeName:n};e[s].data[t].rangeName=n;const c=r.get(l);c&&c.y.push(h),i.push(h.y1),a.push(h.y2)}return{start:i,end:a,rangeUniques:o}}handleCandleStickBoxDataFormat(t,e,s){const i=this.w,a="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[s].type,r=[],o=[],n=[],l=[],h=[],c=[],d=e[s].data;let g;if("array"===t){g=a&&6===d[0].length||!a&&5===d[0].length?t=>t.slice(1):t=>Array.isArray(t[1])?t[1]:[]}else g=t=>Array.isArray(t.y)?t.y:[];for(let t=0;t<d.length;t++){const e=g(d[t]);e&&e.length>=2&&(r.push(e[0]),o.push(e[1]),a?(n.push(e[2]),l.push(e[3]),h.push(e[4])):(l.push(e[2]),h.push(e[3])));const s=d[t]&&d[t].points;c.push(Array.isArray(s)?s:[])}return{o:r,h:o,m:n,l:l,c:h,points:c}}parseDataAxisCharts(t){var e,s,i,a,r,o;const h=this.w.config,c=this.w.globals,d=new y(this.w),g=h.labels.length>0?h.labels.slice():h.xaxis.categories.slice();this.w.axisFlags.isRangeBar="rangeBar"===h.chart.type&&c.isBarHorizontal,this.w.labelData.hasXaxisGroups="category"===h.xaxis.type&&h.xaxis.group.groups.length>0,this.w.labelData.hasXaxisGroups&&(this.w.labelData.groups=h.xaxis.group.groups),t.forEach((t,e)=>{void 0!==t.name?this.w.seriesData.seriesNames.push(t.name):this.w.seriesData.seriesNames.push("series-"+parseInt(String(e+1),10))}),this.coreUtils.setSeriesYAxisMappings();const p=[],u=[...new Set(h.series.map(t=>t.group))];h.series.forEach((t,e)=>{const s=u.indexOf(t.group);p[s]||(p[s]=[]),p[s].push(this.w.seriesData.seriesNames[e])}),this.w.labelData.seriesGroups=p;const x=()=>{for(let t=0;t<g.length;t++)if("string"==typeof g[t]){if(!d.isValidDate(g[t]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");this.twoDSeriesX.push(d.parseDate(g[t]))}else this.twoDSeriesX.push(g[t])};for(let d=0;d<t.length;d++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],void 0===t[d].data)return;const p=h.chart.dataReducer,u=null==(s=null==(e=c.dataReducerRawSeries)?void 0:e[d])?void 0:s.data;if((null==p?void 0:p.enabled)&&this.isMultiFormat()&&Array.isArray(u)&&u.length>(null!=(i=p.threshold)?i:500)){const e=null!=(a=p.targetPoints)?a:250,s=h.xaxis.min,i=h.xaxis.max,c=null==s&&null==i?u:Oe.sliceByXRange(u,s,i);let g=c;if(c.length>e){const t=Array.isArray(c[0])?null==(o=c[0])?void 0:o[1]:null==(r=c[0])?void 0:r.y;Array.isArray(t)?4===t.length?g=Oe.ohlcAggregate(c,e):2===t.length&&(g=Oe.rangeAggregate(c,e)):g=Oe.lttbDownsample(c,e)}t[d]=l(n({},t[d]),{data:g})}"rangeBar"!==h.chart.type&&"rangeArea"!==h.chart.type&&"rangeBar"!==t[d].type&&"rangeArea"!==t[d].type||(this.w.axisFlags.isRangeData=!0,this.handleRangeData(t,d));const f=t[d].type||h.chart.type;if(Be(f)){const e=Ne(f),s=e&&e.yExtent;(e&&"rangeXY"===e.dataType||"function"==typeof s)&&(this.w.axisFlags.isRangeData=!0,this.handleCustomRangeData(t,d,s))}if(this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(t,d):this.isFormatXY()&&this.handleFormatXY(t,d),"candlestick"!==h.chart.type&&"candlestick"!==t[d].type&&"boxPlot"!==h.chart.type&&"boxPlot"!==t[d].type||this.handleCandleStickBoxData(t,d),"violin"!==h.chart.type&&"violin"!==t[d].type||this.handleViolinData(t,d),this.w.seriesData.series.push(this.twoDSeries),this.w.labelData.labels.push(this.twoDSeriesX),this.w.seriesData.seriesX.push(this.twoDSeriesX),this.w.seriesData.seriesGoals=this.seriesGoals,d!==this.activeSeriesIndex||this.fallbackToCategory||(this.w.axisFlags.isXNumeric=!0);else{"datetime"===h.xaxis.type?(this.w.axisFlags.isXNumeric=!0,x(),this.w.seriesData.seriesX.push(this.twoDSeriesX)):"numeric"===h.xaxis.type&&(this.w.axisFlags.isXNumeric=!0,g.length>0&&(this.twoDSeriesX=g,this.w.seriesData.seriesX.push(this.twoDSeriesX))),this.w.labelData.labels.push(this.twoDSeriesX);const e=t[d].data.map(t=>b.parseNumber(t));this.w.seriesData.series.push(e)}this.w.seriesData.seriesZ.push(this.threeDSeries),void 0!==t[d].color?this.w.seriesData.seriesColors.push(t[d].color):this.w.seriesData.seriesColors.push(void 0)}return this.w}parseDataNonAxisCharts(t){const e=this.w.config,s=Array.isArray(t)&&t.every(t=>"number"==typeof t)&&e.labels.length>0;Array.isArray(t)&&t.some(t=>t&&"object"==typeof t&&t.data||t&&"object"==typeof t&&t.parsing);if(s){this.w.seriesData.series=t.slice(),this.w.seriesData.seriesNames=e.labels.slice();for(let t=0;t<this.w.seriesData.series.length;t++)void 0===this.w.seriesData.seriesNames[t]&&this.w.seriesData.seriesNames.push("series-"+(t+1));return this.w}if(Array.isArray(t)&&t.every(t=>"number"==typeof t)){this.w.seriesData.series=t.slice(),this.w.seriesData.seriesNames=[];for(let t=0;t<this.w.seriesData.series.length;t++)this.w.seriesData.seriesNames.push(e.labels[t]||`series-${t+1}`);return this.w}const i=this.extractPieDataFromSeries(t);this.w.seriesData.series=i.values,this.w.seriesData.seriesNames=i.labels,"radialBar"===e.chart.type&&(this.w.seriesData.series=this.w.seriesData.series.map(t=>{const e=b.parseNumber(t);return e}));for(let t=0;t<this.w.seriesData.series.length;t++)void 0===this.w.seriesData.seriesNames[t]&&this.w.seriesData.seriesNames.push("series-"+(t+1));return this.w}resetParsingFlags(){const t=this.w;t.axisFlags.dataWasParsed=!1,t.globals.originalSeries=null,t.config.series&&t.config.series.forEach(t=>{t.__apexParsed&&delete t.__apexParsed})}extractPieDataFromSeries(t){const e=[],s=[];if(!Array.isArray(t))return{values:[],labels:[]};if(0===t.length)return{values:[],labels:[]};const i=t[0];return"object"==typeof i&&null!==i&&i.data?(this.extractPieDataFromSeriesObjects(t,e,s),{values:e,labels:s}):{values:[],labels:[]}}extractPieDataFromSeriesObjects(t,e,s){t.forEach((t,i)=>{t.data&&Array.isArray(t.data)&&t.data.forEach(t=>{"object"==typeof t&&null!==t&&void 0!==t.x&&void 0!==t.y&&(s.push(String(t.x)),e.push(b.parseNumber(t.y)))})})}handleExternalLabelsData(t){const e=this.w.config;if(e.xaxis.categories.length>0)this.w.labelData.labels=e.xaxis.categories;else if(e.labels.length>0)this.w.labelData.labels=e.labels.slice();else if(this.fallbackToCategory){if(this.w.labelData.labels=this.w.labelData.labels[0],this.w.rangeData.seriesRange.length){this.w.rangeData.seriesRange.map(t=>{t.forEach(t=>{this.w.labelData.labels.indexOf(t.x)<0&&t.x&&this.w.labelData.labels.push(t.x)})});const t=this.w.labelData.labels;if(t.length>0&&("number"==typeof t[0]||"string"==typeof t[0]))this.w.labelData.labels=[...new Set(t)];else{const e=new Map;for(const s of t){const t=JSON.stringify(s);e.has(t)||e.set(t,s)}this.w.labelData.labels=Array.from(e.values())}}if(e.xaxis.convertedCatToNumeric){new C(e).convertCatToNumericXaxis(e,this.w.seriesData.seriesX[0]),this._generateExternalLabels(t)}}else this._generateExternalLabels(t)}_generateExternalLabels(t){const e=this.w.globals,s=this.w.config;let i=[];if(e.axisCharts){if(this.w.seriesData.series.length>0)if(this.isFormatXY()){const t=s.series.map(t=>{const e=new Map;for(const s of t.data)e.has(s.x)||e.set(s.x,s);return Array.from(e.values())}),e=t.reduce((t,e,s,i)=>i[t].length>e.length?t:s,0);for(let s=0;s<t[e].length;s++)i.push(s+1)}else for(let t=0;t<this.w.seriesData.series[e.maxValsInArrayIndex].length;t++)i.push(t+1);this.w.seriesData.seriesX=[];for(let e=0;e<t.length;e++)this.w.seriesData.seriesX.push(i);this.w.globals.isBarHorizontal||(this.w.axisFlags.isXNumeric=!0)}if(0===i.length){i=e.axisCharts?[]:this.w.seriesData.series.map((t,e)=>e+1);for(let e=0;e<t.length;e++)this.w.seriesData.seriesX.push(i)}this.w.labelData.labels=i,s.xaxis.convertedCatToNumeric&&(this.w.labelData.categoryLabels=i.map(t=>s.xaxis.labels.formatter(t))),this.w.axisFlags.noLabelsProvided=!0}parseRawDataIfNeeded(t){const e=this.w.config,s=this.w.globals,i=e.parsing;if(this.w.axisFlags.dataWasParsed)return t;if(!i&&!t.some(t=>t.parsing))return t;const a=t.map((t,e)=>{var s,a,r;if(!t.data||!Array.isArray(t.data)||0===t.data.length)return t;const o={x:(null==(s=t.parsing)?void 0:s.x)||(null==i?void 0:i.x),y:(null==(a=t.parsing)?void 0:a.y)||(null==i?void 0:i.y),z:(null==(r=t.parsing)?void 0:r.z)||(null==i?void 0:i.z)};if(!o.x&&!o.y)return t;const h=t.data[0];if("object"==typeof h&&null!==h&&(Object.prototype.hasOwnProperty.call(h,"x")||Object.prototype.hasOwnProperty.call(h,"y"))||Array.isArray(h))return t;if(!o.x||!o.y||Array.isArray(o.y)&&0===o.y.length)return t;const c=t.data.map((t,e)=>{if("object"!=typeof t||null===t)return t;const s=this.getNestedValue(t,o.x);let i,a;if(Array.isArray(o.y)){const e=o.y.map(e=>this.getNestedValue(t,e));"bubble"===this.w.config.chart.type?(e.length,i=e[0]):i=e}else i=this.getNestedValue(t,o.y);o.z&&(a=this.getNestedValue(t,o.z));const r={x:s,y:i,z:void 0};if("bubble"===this.w.config.chart.type&&Array.isArray(o.y)&&2===o.y.length){const e=this.getNestedValue(t,o.y[1]);void 0!==e&&(r.z=e)}return void 0!==a&&(r.z=a),r});return l(n({},t),{data:c,__apexParsed:!0})});return this.w.axisFlags.dataWasParsed=!0,s.originalSeries||(s.originalSeries=b.clone(t)),a}getNestedValue(t,e){if(!t||"object"!=typeof t||!e)return;if(-1===e.indexOf("."))return t[e];const s=e.split(".");let i=t;for(let t=0;t<s.length;t++){if(null==i||"object"!=typeof i)return;i=i[s[t]]}return i}expandScatterJitterData(t){var e,s;const i=this.w.config,a="scatter"===i.chart.type||"bubble"===i.chart.type,r=null==(s=null==(e=i.plotOptions)?void 0:e.scatter)?void 0:s.jitter;if(!(a&&r&&r.enabled&&Array.isArray(t)))return t;if(!t.some(t=>Array.isArray(null==t?void 0:t.data)&&t.data.some(t=>t&&!Array.isArray(t)&&Array.isArray(t.y))))return"datetime"!==i.xaxis.type&&(Array.isArray(i.xaxis.categories)&&i.xaxis.categories.length?this._applyBandAxis(i.xaxis.categories.slice()):Array.isArray(i.xaxis._scatterBandLabels)&&i.xaxis._scatterBandLabels.length&&this._applyBandAxis(i.xaxis._scatterBandLabels)),t;const o=[],h=new Map;t.forEach(t=>{Array.isArray(null==t?void 0:t.data)&&t.data.forEach(t=>{if(t&&Array.isArray(t.y)){const e=String(t.x);h.has(e)||(h.set(e,o.length),o.push(t.x))}})});const c=r.maxPoints||5e3,d=t.map(t=>{if(!Array.isArray(null==t?void 0:t.data))return t;const e=[];return t.data.forEach(t=>{if(t&&Array.isArray(t.y)){const s=h.get(String(t.x)),i=t.y,a=i.length>c?Math.ceil(i.length/c):1;for(let t=0;t<i.length;t+=a){const a=b.parseNumber(i[t]);null!==a&&e.push({x:s,y:a})}}else if(t&&"object"==typeof t&&!Array.isArray(t)){const s=String(t.x);e.push({x:h.has(s)?h.get(s):t.x,y:t.y})}else e.push(t)}),l(n({},t),{data:e})});return this._applyBandAxis(o),d}_applyBandAxis(t){var e;const s=this.w.config.xaxis,i=t.length;if(!i)return;const a=s._scatterBand=s._scatterBand||{};if(s._scatterBandLabels=t.slice(),s.type="numeric",(null==(e=this.w.interact)?void 0:e.zoomed)&&"number"==typeof s.min&&"number"==typeof s.max&&isFinite(s.min)&&isFinite(s.max)){const t=t=>Math.max(0,Math.min(i-1,t));let e=t(Math.round(s.min+.49)),r=t(Math.round(s.max-.49));r<e&&(e=r=t(Math.round((s.min+s.max)/2))),s.min=e-1,s.max=r+1,s.tickAmount=r-e+2,a.min=!0,a.max=!0,a.tick=!0}else(null==s.min||a.min)&&(s.min=-1,a.min=!0),(null==s.max||a.max)&&(s.max=i,a.max=!0),(null==s.tickAmount||"dataPoints"===s.tickAmount||a.tick)&&(s.tickAmount=i+1,a.tick=!0);s.labels=s.labels||{};const r=s.labels.formatter;if("function"!=typeof r||r._scatterBand){const e=e=>{const s=Math.round(e);return Math.abs(e-s)<1e-6&&void 0!==t[s]?t[s]:""};e._scatterBand=!0,s.labels.formatter=e}}parseData(t){var e,s,i,a,r,o;const h=this.w,c=h.config,d=h.globals;if(t=this.parseRawDataIfNeeded(t),t=this.expandScatterJitterData(t),(null==(e=c.chart.dataReducer)?void 0:e.enabled)&&d.axisCharts&&!d.dataReducerRawSeries){d.dataReducerRawSeries=t.map(t=>({data:Array.isArray(null==t?void 0:t.data)?t.data.slice():null==t?void 0:t.data}));let e=1/0,o=-1/0;for(const n of t){const t=null==n?void 0:n.data;if(!Array.isArray(t)||0===t.length)continue;const l=!Array.isArray(t[0]),h=l?null==(s=t[0])?void 0:s.x:null==(i=t[0])?void 0:i[0],c=l?null==(a=t[t.length-1])?void 0:a.x:null==(r=t[t.length-1])?void 0:r[0];"number"==typeof h&&(e=Math.min(e,h)),"number"==typeof c&&(o=Math.max(o,c))}e!==1/0&&(d.dataReducerRawMinX=e,d.dataReducerRawMaxX=o)}if(c.series=t,d.dataReducerRawSeries&&(null==(o=c.chart.dataReducer)?void 0:o.enabled)){const e=d.dataReducerRawSeries;d.initialSeries=t.map((t,s)=>{var i,a,r;return l(n({},t),{data:null!=(r=null==(a=null==(i=e[s])?void 0:i.data)?void 0:a.slice())?r:t.data})})}else d.initialSeries=b.clone(t);if(this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.resetGlobals(),this.isMultipleY(),d.axisCharts?(this.parseDataAxisCharts(t),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(t),c.chart.stacked){const t=new ce(this.w);this.w.seriesData.series=t.setNullSeriesToZeroValues(this.w.seriesData.series)}this.coreUtils.getSeriesTotals(),d.axisCharts&&(this.w.seriesData.stackedSeriesTotals=this.coreUtils.getStackedSeriesTotals(),this.w.seriesData.stackedSeriesTotalsByGroups=this.coreUtils.getStackedSeriesTotalsByGroups()),this.coreUtils.getPercentSeries(),this.w.axisFlags.dataFormatXNumeric||this.w.axisFlags.isXNumeric&&("numeric"!==c.xaxis.type||0!==c.labels.length||0!==c.xaxis.categories.length)||this.handleExternalLabelsData(t);const g=this.coreUtils.getCategoryLabels(this.w.labelData.labels);for(let t=0;t<g.length;t++)if(Array.isArray(g[t])){this.w.axisFlags.isMultiLineX=!0;break}return{seriesData:{series:this.w.seriesData.series,seriesNames:this.w.seriesData.seriesNames,seriesX:this.w.seriesData.seriesX,seriesZ:this.w.seriesData.seriesZ,seriesColors:this.w.seriesData.seriesColors,seriesGoals:this.w.seriesData.seriesGoals,initialSeries:d.initialSeries,originalSeries:d.originalSeries,stackedSeriesTotals:this.w.seriesData.stackedSeriesTotals,stackedSeriesTotalsByGroups:this.w.seriesData.stackedSeriesTotalsByGroups,noLabelsProvided:this.w.axisFlags.noLabelsProvided},rangeData:{seriesRangeStart:this.w.rangeData.seriesRangeStart,seriesRangeEnd:this.w.rangeData.seriesRangeEnd,seriesRange:this.w.rangeData.seriesRange},candleData:{seriesCandleO:this.w.candleData.seriesCandleO,seriesCandleH:this.w.candleData.seriesCandleH,seriesCandleM:this.w.candleData.seriesCandleM,seriesCandleL:this.w.candleData.seriesCandleL,seriesCandleC:this.w.candleData.seriesCandleC,seriesBoxPoints:this.w.candleData.seriesBoxPoints},labelData:{labels:this.w.labelData.labels,categoryLabels:this.w.labelData.categoryLabels},axisFlags:{isXNumeric:this.w.axisFlags.isXNumeric,dataFormatXNumeric:this.w.axisFlags.dataFormatXNumeric,isDataXYZ:this.w.axisFlags.isDataXYZ,isRangeData:this.w.axisFlags.isRangeData,isRangeBar:this.w.axisFlags.isRangeBar,isMultiLineX:this.w.axisFlags.isMultiLineX,dataWasParsed:this.w.axisFlags.dataWasParsed,hasXaxisGroups:this.w.labelData.hasXaxisGroups,groups:this.w.labelData.groups,seriesGroups:this.w.labelData.seriesGroups}}}static sliceByXRange(t,e,s){const i=t.length;if(0===i)return t;const a=!Array.isArray(t[0])?t=>t.x:t=>t[0];let r=0;if(null!=e){let s=0,o=i-1;for(;s<=o;){const i=s+o>>1;a(t[i])<e?s=i+1:o=i-1}r=Math.max(0,s-1)}let o=i;if(null!=s){let e=0,r=i-1;for(;e<=r;){const i=e+r>>1;a(t[i])>s?r=i-1:e=i+1}o=Math.min(i,e+1)}return 0===r&&o===i?t.slice():t.slice(r,o)}static lttbDownsample(t,e){const s=t.length;if(e>=s||e<3)return t;const i=!Array.isArray(t[0]),a=i?t=>t.x:t=>t[0],r=i?t=>t.y:t=>t[1],o=[];o.push(t[0]);const n=(s-2)/(e-2);let l=0;for(let i=0;i<e-2;i++){const e=Math.floor((i+1)*n)+1,h=Math.min(Math.floor((i+2)*n)+1,s);let c=0,d=0;const g=h-e;for(let s=e;s<h;s++)c+=a(t[s]),d+=r(t[s]);c/=g,d/=g;const p=Math.floor(i*n)+1,u=Math.min(Math.floor((i+1)*n)+1,s),x=a(t[l]),f=r(t[l]);let m=-1,b=p;for(let e=p;e<u;e++){const s=.5*Math.abs((x-c)*(r(t[e])-f)-(x-a(t[e]))*(d-f));s>m&&(m=s,b=e)}o.push(t[b]),l=b}return o.push(t[s-1]),o}static ohlcAggregate(t,e){const s=t.length;if(e>=s||e<1)return t;const i=!Array.isArray(t[0]),a=i?t=>t.x:t=>t[0],r=i?t=>t.y:t=>t[1],o=i?(t,e)=>({x:t,y:e}):(t,e)=>[t,e],n=[],l=s/e;for(let i=0;i<e;i++){const h=Math.floor(i*l),c=i===e-1?s:Math.floor((i+1)*l);if(c<=h)continue;const d=r(t[h]),g=d[0];let p=d[1],u=d[2],x=d[3];for(let e=h+1;e<c;e++){const s=r(t[e]);s[1]>p&&(p=s[1]),s[2]<u&&(u=s[2]),x=s[3]}n.push(o(a(t[h]),[g,p,u,x]))}return n}static rangeAggregate(t,e){const s=t.length;if(e>=s||e<1)return t;const i=!Array.isArray(t[0]),a=i?t=>t.x:t=>t[0],r=i?t=>t.y:t=>t[1],o=i?(t,e)=>({x:t,y:e}):(t,e)=>[t,e],n=[],l=s/e;for(let i=0;i<e;i++){const h=Math.floor(i*l),c=i===e-1?s:Math.floor((i+1)*l);if(c<=h)continue;let d=1/0,g=-1/0;for(let e=h;e<c;e++){const s=r(t[e]);if(null!=s)for(let t=0;t<2;t++){const e=s[t];null!=e&&isFinite(e)&&(e<d&&(d=e),e>g&&(g=e))}}n.push(o(a(t[h]),d===1/0?[null,null]:[d,g]))}return n}excludeCollapsedSeriesInYAxis(){const t=this.w,e=[];t.globals.seriesYAxisMap.forEach((s,i)=>{let a=0;s.forEach(e=>{-1!==t.globals.collapsedSeriesIndices.indexOf(e)&&a++}),a>0&&a==s.length&&e.push(i)}),t.globals.ignoreYAxisIndexes=e.map(t=>t)}}class He{constructor(t,e){this.w=t,this.ctx=e}_updateOptions(t,e=!1,s=!0,i=!0,a=!1){return new Promise(r=>{let o=[this.ctx];i&&(o=this.ctx.getSyncedCharts()),this.w.globals.isExecCalled&&(o=[this.ctx],this.w.globals.isExecCalled=!1),o.forEach((i,n)=>{var l,h;const c=i.w;if(c.globals.shouldAnimate=s,e||(c.globals.resized=!0,c.globals.dataChanged=!0,s&&i.series.getPreviousPaths()),s&&t&&"object"==typeof t){const e=null==(l=null==t?void 0:t.chart)?void 0:l.type,s=c.config.chart.requestedType||c.config.chart.type;e&&e!==s&&(null==(h=i.morphTypeChange)||h.captureBeforeDestroy({fromType:s,toType:e,newSeries:t.series||c.config.series}))}if(t&&"object"==typeof t){i.config=new _(t);const e=t.chart&&t.chart.type,s="funnel"===e||"pyramid"===e||"gauge"===e,r=!!c.config.chart.requestedType;if(e&&!s&&r){t.chart=t.chart||{},t.chart.requestedType=e;const s=c.config.chart.requestedType;"funnel"!==s&&"pyramid"!==s||(t.plotOptions=t.plotOptions||{},t.plotOptions.bar=t.plotOptions.bar||{},void 0===t.plotOptions.bar.isFunnel&&(t.plotOptions.bar.isFunnel=!1),void 0===t.plotOptions.bar.isPyramid&&(t.plotOptions.bar.isPyramid=!1))}if(i.config.normalizeAliasedChartType(t),t=P.extendArrayProps(i.config,t,c),i.w.globals.chartID!==this.w.globals.chartID&&(delete t.series,delete t.yaxis),c.config=b.extend(c.config,t),a&&(c.globals.lastXAxis=t.xaxis?b.clone(t.xaxis):[],c.globals.lastYAxis=t.yaxis?b.clone(t.yaxis):[],c.globals.initialConfig=b.extend({},c.config),c.globals.initialSeries=b.clone(c.config.series),t.series)){for(let t=0;t<c.globals.collapsedSeriesIndices.length;t++){const e=c.config.series[c.globals.collapsedSeriesIndices[t]];c.globals.collapsedSeries[t].data=c.globals.axisCharts?e.data.slice():e}for(let t=0;t<c.globals.ancillaryCollapsedSeriesIndices.length;t++){const e=c.config.series[c.globals.ancillaryCollapsedSeriesIndices[t]];c.globals.ancillaryCollapsedSeries[t].data=c.globals.axisCharts?e.data.slice():e}i.series.emptyCollapsedSeries(c.config.series)}}return i.update(t).then(()=>{n===o.length-1&&r(i)})})})}_updateSeries(t,e,s=!1){return new Promise(i=>{const a=this.w;a.globals.shouldAnimate=e,a.globals.dataChanged=!0;const r=JSON.stringify({y:(a.globals.yAxisScale||[]).map(t=>t?t.result:null),xMin:a.globals.minX,xMax:a.globals.maxX});wt.invalidateSelectors(a),e&&this.ctx.series.getPreviousPaths();const o=a.config.series.length,n=a.config.series.map(t=>{var e,s;return null!=(s=null==(e=null==t?void 0:t.data)?void 0:e.length)?s:0});a.globals.dataReducerRawSeries=null,this.ctx.data.resetParsingFlags();const l=this.ctx.data.parseData(t);return this.ctx._writeParsedSeriesData(l.seriesData),this.ctx._writeParsedRangeData(l.rangeData),this.ctx._writeParsedCandleData(l.candleData),this.ctx._writeParsedLabelData(l.labelData),this.ctx._writeParsedAxisFlags(l.axisFlags),s&&(a.globals.initialConfig&&(a.globals.initialConfig.series=b.clone(a.config.series)),a.globals.initialSeries=b.clone(a.config.series)),this._canUseFastPath(t,o,n,a)?this.ctx.fastUpdate(e,r).then(()=>{i(this.ctx)}):this.ctx.update().then(()=>{i(this.ctx)})})}_canUseFastPath(t,e,s,i){return!!i.dom.elGraphical&&(!!i.globals.axisCharts&&(t.length===e&&(!t.some((t,e)=>{var i,a;return(null!=(a=null==(i=null==t?void 0:t.data)?void 0:i.length)?a:0)!==s[e]})&&(!(i.globals.collapsedSeries.length>0)&&(!(i.globals.ancillaryCollapsedSeries.length>0)&&(!(i.globals.risingSeries.length>0)&&(!i.globals.comboCharts&&!i.interact.zoomed)))))))}_extendSeries(t,e){const s=this.w,i=s.config.series[e];return l(n({},s.config.series[e]),{name:t.name?t.name:null==i?void 0:i.name,color:t.color?t.color:null==i?void 0:i.color,type:t.type?t.type:null==i?void 0:i.type,group:t.group?t.group:null==i?void 0:i.group,hidden:void 0!==t.hidden?t.hidden:null==i?void 0:i.hidden,data:t.data?t.data:null==i?void 0:i.data,zIndex:void 0!==t.zIndex?t.zIndex:e})}toggleDataPointSelection(t,e){const s=this.w;let i=null;const a=`.apexcharts-series[data\\:realIndex='${t}']`;if(s.globals.axisCharts?i=s.dom.Paper.findOne(`${a} path[j='${e}'], ${a} circle[j='${e}'], ${a} rect[j='${e}']`):void 0===e&&(i=s.dom.Paper.findOne(`${a} path[j='${t}']`),"pie"!==s.config.chart.type&&"polarArea"!==s.config.chart.type&&"donut"!==s.config.chart.type||this.ctx.pie.pieClicked(t)),!i)return null;new gt(this.w).pathMouseDown(i,null);return i.node?i.node:null}forceXAxisUpdate(t){const e=this.w;if(["min","max"].forEach(s=>{void 0!==t.xaxis[s]&&(e.config.xaxis[s]=t.xaxis[s],e.globals.lastXAxis[s]=t.xaxis[s])}),t.xaxis.categories&&t.xaxis.categories.length&&(e.config.xaxis.categories=t.xaxis.categories),e.config.xaxis.convertedCatToNumeric){const e=new C(t);t=e.convertCatToNumericXaxis(t,this.ctx)}return t}forceYAxisUpdate(t){return t.chart&&t.chart.stacked&&"100%"===t.chart.stackType&&(Array.isArray(t.yaxis)?t.yaxis.forEach((e,s)=>{t.yaxis[s].min=0,t.yaxis[s].max=100}):(t.yaxis.min=0,t.yaxis.max=100)),t}revertDefaultAxisMinMax(t){const e=this.w;let s=e.globals.lastXAxis,i=e.globals.lastYAxis;t&&t.xaxis&&(s=t.xaxis),t&&t.yaxis&&(i=t.yaxis);const a=s;e.config.xaxis.min=a.min,e.config.xaxis.max=a.max;const r=t=>{if(void 0!==i[t]){const s=i[t];e.config.yaxis[t].min=s.min,e.config.yaxis[t].max=s.max}};e.config.yaxis.map((t,s)=>{e.interact.zoomed||void 0!==i[s]?r(s):void 0!==this.ctx.opts.yaxis[s]&&(t.min=this.ctx.opts.yaxis[s].min,t.max=this.ctx.opts.yaxis[s].max)})}}class $e{constructor(t){this.w=t.w,this.ttCtx=t}getNearestValues({hoverArea:t,elGrid:e,clientX:s,clientY:i}){var a,r;const o=this.w,n=e.getBoundingClientRect(),l=n.width,h=n.height;let c=l/(o.globals.dataPoints-1);const d=h/o.globals.dataPoints,g=this.hasBars();!o.globals.comboCharts&&!g||o.config.xaxis.convertedCatToNumeric||(c=l/o.globals.dataPoints);const p=s-n.left-o.globals.barPadForNumericAxis,u=i-n.top;p<0||u<0||p>l||u>h?(t.classList.remove("hovering-zoom"),t.classList.remove("hovering-pan")):o.interact.zoomEnabled?(t.classList.remove("hovering-pan"),t.classList.add("hovering-zoom")):o.interact.panEnabled&&(t.classList.remove("hovering-zoom"),t.classList.add("hovering-pan"));let x=Math.round(p/c);const f=Math.floor(u/d);g&&!o.config.xaxis.convertedCatToNumeric&&(x=Math.ceil(p/c),x-=1);let m=null,y=null,w=o.globals.seriesXvalues.map(t=>t.filter(t=>b.isNumber(t)));const v=o.globals.seriesYvalues.map(t=>t.filter(t=>b.isNumber(t)));if(o.axisFlags.isXNumeric){const t=this.ttCtx.getElGrid();if(!t)return{hoverX:p,hoverY:u};const e=t.getBoundingClientRect(),s=p*(e.width/l),i=u*(e.height/h);y=this.closestInMultiArray(s,i,w,v),m=y.index,x=null!=(a=y.j)?a:0,null!==m&&o.globals.hasNullValues&&(w=o.globals.seriesXvalues[m],y=this.closestInArray(s,w),x=null!=(r=y.j)?r:0)}return o.interact.capturedSeriesIndex=null===m?-1:m,(!x||x<1)&&(x=0),o.globals.isBarHorizontal?o.interact.capturedDataPointIndex=f:o.interact.capturedDataPointIndex=x,{capturedSeries:m,j:o.globals.isBarHorizontal?f:x,hoverX:p,hoverY:u}}getFirstActiveXArray(t){const e=this.w;let s=0;const i=t.map((t,e)=>t.length>0?e:-1);for(let t=0;t<i.length;t++)if(-1!==i[t]&&-1===e.globals.collapsedSeriesIndices.indexOf(t)&&-1===e.globals.ancillaryCollapsedSeriesIndices.indexOf(t)){s=i[t];break}return s}closestInMultiArray(t,e,s,i){const a=this.w,r=t=>-1===a.globals.collapsedSeriesIndices.indexOf(t)&&-1===a.globals.ancillaryCollapsedSeriesIndices.indexOf(t),o=a.config.chart.type,n=!a.globals.comboCharts&&("line"===o||"area"===o);let l=1/0,h=null,c=null;if(a.globals.allSeriesHasEqualX){let a=1/0;for(let e=0;e<s.length;e++){if(!r(e))continue;const o=s[e],n=i[e],l=Math.min(o.length,n.length);for(let e=0;e<l;e++){const s=Math.abs(t-o[e]);s<a&&(a=s,c=e)}}if(null!==c)if(n){let a=1/0;for(let o=0;o<s.length;o++){if(!r(o))continue;const n=s[o],l=i[o],d=Math.min(n.length,l.length);if(d<2){const t=l[c];if("number"!=typeof t)continue;const s=Math.abs(e-t);s<a&&(a=s,h=o);continue}for(let s=0;s<d-1;s++){const i=this._distanceToSegment(t,e,n[s],l[s],n[s+1],l[s+1]);i.dist<a&&(a=i.dist,h=o)}}}else{let t=1/0;for(let a=0;a<s.length;a++){if(!r(a))continue;const s=i[a][c];if("number"!=typeof s)continue;const o=Math.abs(e-s);o<t&&(t=o,h=a)}}return{index:h,j:c}}for(let a=0;a<s.length;a++){if(!r(a))continue;const o=s[a],d=i[a],g=Math.min(o.length,d.length);if(n&&g>=2)for(let s=0;s<g-1;s++){const i=this._distanceToSegment(t,e,o[s],d[s],o[s+1],d[s+1]);i.dist<l&&(l=i.dist,h=a,c=i.t<.5?s:s+1)}else for(let s=0;s<g;s++){const i=t-o[s],r=e-d[s],n=Math.sqrt(i*i+r*r);n<l&&(l=n,h=a,c=s)}}return{index:h,j:c}}_distanceToSegment(t,e,s,i,a,r){const o=a-s,n=r-i,l=o*o+n*n;let h=0===l?0:((t-s)*o+(e-i)*n)/l;h<0?h=0:h>1&&(h=1);const c=t-(s+h*o),d=e-(i+h*n);return{dist:Math.sqrt(c*c+d*d),t:h}}closestInArray(t,e){const s=e[0];let i=null,a=Math.abs(t-s);for(let s=0;s<e.length;s++){const r=Math.abs(t-e[s]);r<a&&(a=r,i=s)}return{j:i}}isXoverlap(t){const e=[],s=this.w.seriesData.seriesX.filter(t=>void 0!==t[0]);if(s.length>0)for(let i=0;i<s.length-1;i++)void 0!==s[i][t]&&void 0!==s[i+1][t]&&s[i][t]!==s[i+1][t]&&e.push("unEqual");return 0===e.length}isInitialSeriesSameLen(){var t,e,s;let i=!0;const a=(null==(t=this.w.globals.initialSeries)?void 0:t.filter((t,e)=>{var s;return!(null==(s=this.w.globals.collapsedSeriesIndices)?void 0:s.includes(e))}))||[];for(let t=0;t<a.length-1;t++){if(!(null==(e=a[t])?void 0:e.data)||!(null==(s=a[t+1])?void 0:s.data))return!0;if(a[t].data.length!==a[t+1].data.length){i=!1;break}}return i}getBarsHeight(t){return[...t].reduce((t,e)=>t+e.getBBox().height,0)}getElMarkers(t){return"number"==typeof t?this.w.dom.baseEl.querySelectorAll(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers-wrap > *`):this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}getAllMarkers(t=!1){let e=[...this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap")];t&&(e=e.filter(t=>{const e=Number(t.getAttribute("data:realIndex"));return-1===this.w.globals.collapsedSeriesIndices.indexOf(e)})),e.sort((t,e)=>{var s=Number(t.getAttribute("data:realIndex")),i=Number(e.getAttribute("data:realIndex"));return i<s?1:i>s?-1:0});const s=[];return e.forEach(t=>{s.push(t.querySelector(".apexcharts-marker"))}),s}hasMarkers(t){return this.getElMarkers(t).length>0}getPathFromPoint(t,e){const s=Number(t.getAttribute("cx")),i=Number(t.getAttribute("cy")),a=t.getAttribute("shape");return new gt(this.w).getMarkerPath(s,i,a,e)}getElBars(){return this.w.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-violin-series, .apexcharts-rangebar-series")}hasBars(){return this.getElBars().length>0}getHoverMarkerSize(t){const e=this.w;let s=e.config.markers.hover.size;return void 0===s&&(s=e.globals.markers.size[t]+e.config.markers.hover.sizeOffset),s}toggleAllTooltipSeriesGroups(t){const e=this.w,s=this.ttCtx;0===s.allTooltipSeriesGroups.length&&(s.allTooltipSeriesGroups=e.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));const i=s.allTooltipSeriesGroups;for(let s=0;s<i.length;s++)"enable"===t?(i[s].classList.add("apexcharts-active"),i[s].style.display=e.config.tooltip.items.display):(i[s].classList.remove("apexcharts-active"),i[s].style.display="none")}}class je{constructor(t){this.w=t.w,this.ttCtx=t,this.tooltipUtil=new $e(t)}drawSeriesTexts({shared:t=!0,ttItems:e,i:s=0,j:i=null,y1:a,y2:r,e:o}){const n=this.w;void 0!==n.config.tooltip.custom?this.handleCustomTooltip({i:s,j:i,y1:a,y2:r,w:n}):this.toggleActiveInactiveSeries(t,s);const l=this.getValuesToPrint({i:s,j:i});this.printLabels({i:s,j:i,values:l,ttItems:e,shared:t,e:o});const h=this.ttCtx.getElTooltip();h&&(this.ttCtx.tooltipRect.ttWidth=h.getBoundingClientRect().width,this.ttCtx.tooltipRect.ttHeight=h.getBoundingClientRect().height)}printLabels({i:t,j:e,values:s,ttItems:i,shared:a,e:r}){const o=this.w,{xVal:n,zVal:l,xAxisTTVal:h}=s,c=o.seriesData.series.length,d=null!==e&&o.config.plotOptions.bar.distributed?o.globals.colors[e]:o.globals.colors[t];for(let s=0;s<c;s++){const g=o.config.tooltip.inverseOrder?c-1-s:s,p=this.computeSeriesRow({i:t,j:e,t:s,tIndex:g,shared:a,e:r,basePColor:d});this.DOMHandling({i:t,t:g,j:e,ttItems:i,values:{val:p.val,goalVals:p.goalVals,xVal:n,xAxisTTVal:h,zVal:l},seriesName:p.seriesName,shared:a,pColor:p.pColor})}}computeSeriesRow({i:t,j:e,tIndex:s,shared:i,e:a,basePColor:r}){const o=this.w;let h,c=this.getFormatters(t),d=r,g=[],p="treemap"===o.config.chart.type?c.yLbTitleFormatter(String(o.config.series[t].data[e].x),{series:o.seriesData.series,seriesIndex:t,dataPointIndex:e,w:o}):this.getSeriesName({fn:c.yLbTitleFormatter,index:t,seriesIndex:t,j:e});return o.globals.axisCharts&&(i?(c=this.getFormatters(s),p=this.getSeriesName({fn:c.yLbTitleFormatter,index:s,seriesIndex:t,j:e}),d=o.globals.colors[s],h=this.formatYValue(c,s,e),g=this.formatGoalVals(c,s,e)):(d=this.resolvePatternColor(a,d),h=this.formatYValue(c,t,e),g=this.formatGoalVals(c,t,e))),null===e&&(h=c.yLbFormatter(o.seriesData.series[t],l(n({},o),{seriesIndex:t,dataPointIndex:t}))),{seriesName:p,val:h,goalVals:g,pColor:d}}formatYValue(t,e,s){var i,a,r,o;const n=this.w;return n.axisFlags.isRangeData?t.yLbFormatter(null==(a=null==(i=n.rangeData.seriesRangeStart)?void 0:i[e])?void 0:a[s],{series:n.rangeData.seriesRangeStart,seriesIndex:e,dataPointIndex:s,w:n})+" - "+t.yLbFormatter(null==(o=null==(r=n.rangeData.seriesRangeEnd)?void 0:r[e])?void 0:o[s],{series:n.rangeData.seriesRangeEnd,seriesIndex:e,dataPointIndex:s,w:n}):t.yLbFormatter(n.seriesData.series[e][s],{series:n.seriesData.series,seriesIndex:e,dataPointIndex:s,w:n})}formatGoalVals(t,e,s){var i;const a=this.w,r=null==(i=a.seriesData.seriesGoals[e])?void 0:i[s];return Array.isArray(r)?r.map(i=>({attrs:i,val:t.yLbFormatter(i.value,{seriesIndex:e,dataPointIndex:s,w:a})})):[]}resolvePatternColor(t,e){var s,i,a;const r=this.w,o=null==(s=null==t?void 0:t.target)?void 0:s.getAttribute("fill");if(!o)return e;if(-1===o.indexOf("url"))return o;if(-1===o.indexOf("Pattern"))return e;const n=r.dom.baseEl.querySelector(o.substr(4).slice(0,-1));return null!=(a=null==(i=null==n?void 0:n.childNodes[0])?void 0:i.getAttribute("stroke"))?a:e}getFormatters(t){const e=this.w;let s,i=e.formatters.yLabelFormatters[t];return void 0!==e.formatters.ttVal?Array.isArray(e.formatters.ttVal)?(i=e.formatters.ttVal[t]&&e.formatters.ttVal[t].formatter,s=e.formatters.ttVal[t]&&e.formatters.ttVal[t].title&&e.formatters.ttVal[t].title.formatter):(i=e.formatters.ttVal.formatter,"function"==typeof e.formatters.ttVal.title.formatter&&(s=e.formatters.ttVal.title.formatter)):s=e.config.tooltip.y.title.formatter,"function"!=typeof i&&(i=e.formatters.yLabelFormatters[0]?e.formatters.yLabelFormatters[0]:function(t){return t}),"function"!=typeof s&&(s=function(t){return t?t+": ":""}),{yLbFormatter:i,yLbTitleFormatter:s}}getSeriesName({fn:t,index:e,seriesIndex:s,j:i}){const a=this.w;return t(String(a.seriesData.seriesNames[e]),{series:a.seriesData.series,seriesIndex:s,dataPointIndex:i,w:a})}DOMHandling({t:t,j:e,ttItems:s,values:i,seriesName:a,shared:r,pColor:o}){const n=this.w,l=this.ttCtx,{val:h,goalVals:c,xVal:d,xAxisTTVal:g,zVal:p}=i;if(!s||!s[t])return;let u=null;u=s[t].children,n.config.tooltip.fillSeriesColor&&(s[t].style.backgroundColor=o,u[0].style.display="none"),l.showTooltipTitle&&(null===l.tooltipTitle&&(l.tooltipTitle=n.dom.baseEl.querySelector(".apexcharts-tooltip-title")),l.tooltipTitle&&(l.tooltipTitle.innerHTML=d)),l.isXAxisTooltipEnabled&&l.xaxisTooltipText&&(l.xaxisTooltipText.innerHTML=""!==g?g:d);const x=s[t].querySelector(".apexcharts-tooltip-text-y-label");x&&(x.innerHTML=a||"");const f=s[t].querySelector(".apexcharts-tooltip-text-y-value");f&&(f.innerHTML=void 0!==h?h:""),u[0]&&u[0].classList.contains("apexcharts-tooltip-marker")&&(n.config.tooltip.marker.fillColors&&Array.isArray(n.config.tooltip.marker.fillColors)&&(o=n.config.tooltip.marker.fillColors[t]),n.config.tooltip.fillSeriesColor?u[0].style.backgroundColor=o:u[0].style.color=o),n.config.tooltip.marker.show||(u[0].style.display="none");const m=s[t].querySelector(".apexcharts-tooltip-text-goals-label"),b=s[t].querySelector(".apexcharts-tooltip-text-goals-value");if(c.length&&n.seriesData.seriesGoals[t]){const s=()=>{let t="<div>",e="<div>";c.forEach(s=>{t+=` <div style="display: flex"><span class="apexcharts-tooltip-marker" style="background-color: ${s.attrs.strokeColor}; height: 3px; border-radius: 0; top: 5px;"></span> ${s.attrs.name}</div>`,e+=`<div>${s.val}</div>`}),m.innerHTML=t+"</div>",b.innerHTML=e+"</div>"};r?n.seriesData.seriesGoals[t][e]&&Array.isArray(n.seriesData.seriesGoals[t][e])?s():(m.innerHTML="",b.innerHTML=""):s()}else m.innerHTML="",b.innerHTML="";if(null!==p){s[t].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=n.config.tooltip.z.title;s[t].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=void 0!==p?p:""}if(r&&u[0]){if(n.config.tooltip.hideEmptySeries){const e=s[t].querySelector(".apexcharts-tooltip-marker"),i=s[t].querySelector(".apexcharts-tooltip-text");0==parseFloat(h)?(e.style.display="none",i.style.display="none"):(e.style.display="block",i.style.display="block")}null==h||n.globals.ancillaryCollapsedSeriesIndices.indexOf(t)>-1||n.globals.collapsedSeriesIndices.indexOf(t)>-1||Array.isArray(l.tConfig.enabledOnSeries)&&-1===l.tConfig.enabledOnSeries.indexOf(t)?u[0].parentNode.style.display="none":u[0].parentNode.style.display=n.config.tooltip.items.display}else Array.isArray(l.tConfig.enabledOnSeries)&&-1===l.tConfig.enabledOnSeries.indexOf(t)&&(u[0].parentNode.style.display="none")}toggleActiveInactiveSeries(t,e){const s=this.w;if(t)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");const t=s.dom.baseEl.querySelector(`.apexcharts-tooltip-series-group-${e}`);if(t){const e=t;e.classList.add("apexcharts-active"),e.style.display=s.config.tooltip.items.display}}}getValuesToPrint({i:t,j:e}){var s,i,a,r,o,n,l,h;const c=this.w,d=c.seriesData.seriesX.map(t=>t.length>0?t:[]);let g="",p="",u=null,x=null;const f={series:c.seriesData.series,seriesIndex:t,dataPointIndex:e,w:c},m=c.formatters.ttZFormatter;if(null===e)x=c.seriesData.series[t];else if(c.axisFlags.isXNumeric&&"treemap"!==c.config.chart.type){if(g=d[t][e],0===d[t].length){g=d[this.tooltipUtil.getFirstActiveXArray(d)][e]}}else{g=new Oe(this.w).isFormatXY()?void 0!==c.config.series[t].data[e]?c.config.series[t].data[e].x:"":void 0!==c.labelData.labels[e]?c.labelData.labels[e]:""}const b=g;if(c.axisFlags.isXNumeric&&"datetime"===c.config.xaxis.type){g=new w(this.w).xLabelFormat(c.formatters.ttKeyFormatter,b,b,{i:void 0,dateFormatter:new y(this.w).formatDate,w:this.w})}else g=c.globals.isBarHorizontal?c.formatters.yLabelFormatters[0](b,f):null!=(a=null==(i=(s=c.formatters).xLabelFormatter)?void 0:i.call(s,b,f))?a:b;return void 0!==c.config.tooltip.x.formatter&&(g=null!=(n=null==(o=(r=c.formatters).ttKeyFormatter)?void 0:o.call(r,b,f))?n:b),c.seriesData.seriesZ.length>0&&c.seriesData.seriesZ[t].length>0&&(u=null==m?void 0:m(c.seriesData.seriesZ[t][e],c)),p="function"==typeof c.config.xaxis.tooltip.formatter?null==(h=(l=c.formatters).xaxisTooltipFormatter)?void 0:h.call(l,b,f):g,{val:Array.isArray(x)?x.join(" "):x,xVal:Array.isArray(g)?g.join(" "):g,xAxisTTVal:Array.isArray(p)?p.join(" "):p,zVal:u}}handleCustomTooltip({i:t,j:e,y1:s,y2:i,w:a}){const r=this.ttCtx.getElTooltip();let o=a.config.tooltip.custom;Array.isArray(o)&&o[t]&&(o=o[t]);const n=o({series:a.seriesData.series,seriesIndex:t,dataPointIndex:e,y1:s,y2:i,w:a});r&&("string"==typeof n||"number"==typeof n?r.innerHTML=String(n):(n instanceof Element||"string"==typeof n.nodeName)&&(r.innerHTML="",r.appendChild(n.cloneNode(!0))))}}class Ge{constructor(t){this.ttCtx=t,this.w=t.w}moveXCrosshairs(t,e=null){const s=this.ttCtx,i=this.w,a=s.getElXCrosshairs();let r=t-s.xcrosshairsWidth/2;const o=i.labelData.labels.slice().length;if(null!==e&&(r=i.layout.gridWidth/o*e),null===a||i.globals.isBarHorizontal||(a.setAttribute("x",String(r)),a.setAttribute("x1",String(r)),a.setAttribute("x2",String(r)),a.setAttribute("y2",String(i.layout.gridHeight)),a.classList.add("apexcharts-active")),r<0&&(r=0),r>i.layout.gridWidth&&(r=i.layout.gridWidth),s.isXAxisTooltipEnabled){let t=r;"tickWidth"!==i.config.xaxis.crosshairs.width&&"barWidth"!==i.config.xaxis.crosshairs.width||(t=r+s.xcrosshairsWidth/2),this.moveXAxisTooltip(t)}}moveYCrosshairs(t){const e=this.ttCtx;null!==e.ycrosshairs&>.setAttrs(e.ycrosshairs,{y1:t,y2:t}),null!==e.ycrosshairsHidden&>.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t})}moveXAxisTooltip(t){var e,s;const i=this.w,a=this.ttCtx;if(null!==a.xaxisTooltip&&0!==a.xcrosshairsWidth){a.xaxisTooltip.classList.add("apexcharts-active");const r=a.xaxisOffY+i.config.xaxis.tooltip.offsetY+i.layout.translateY+5+i.config.xaxis.offsetY;if(t-=a.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(t)){t+=i.layout.translateX;const o=new gt(this.w).getTextRects(null!=(s=null==(e=a.xaxisTooltipText)?void 0:e.innerHTML)?s:"",i.config.xaxis.labels.style.fontSize);a.xaxisTooltipText&&(a.xaxisTooltipText.style.minWidth=o.width+"px"),a.xaxisTooltip.style.left=t+"px",a.xaxisTooltip.style.top=r+"px"}}}moveYAxisTooltip(t){var e,s;const i=this.w,a=this.ttCtx;null===a.yaxisTTEls&&(a.yaxisTTEls=[...i.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")]);const r=parseInt(null!=(s=null==(e=a.ycrosshairsHidden)?void 0:e.getAttribute("y1"))?s:"0",10);let o=i.layout.translateY+r;if(a.yaxisTTEls){const e=a.yaxisTTEls[t].getBoundingClientRect(),s=e.height;let r;const n=i.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-texts-g`),l=i.dom.elWrap.getBoundingClientRect();if(n){const t=n.getBoundingClientRect();if(t.width>0){r=t.left+t.width/2-l.left-e.width/2}}if(null==r){const s=4;r=i.config.yaxis[t].opposite?i.globals.translateYAxisX[t]+s:i.globals.translateYAxisX[t]-e.width-s}o-=s/2,-1===i.globals.ignoreYAxisIndexes.indexOf(t)&&o>0&&o<i.layout.gridHeight?(a.yaxisTTEls[t].classList.add("apexcharts-active"),a.yaxisTTEls[t].style.top=o+"px",a.yaxisTTEls[t].style.left=r+i.config.yaxis[t].tooltip.offsetX+"px"):a.yaxisTTEls[t].classList.remove("apexcharts-active")}}moveTooltip(t,e,s=null){const i=this.ttCtx.getElTooltip();if(!i)return;const a=this.computeTooltipPosition(t,e,s);null!==a&&this.applyTooltipPosition(i,a)}computeTooltipPosition(t,e,s=null){var i,a,r,o,n,l,h;const c=this.w,d=this.ttCtx,g=d.tooltipRect,p=!!c.config.tooltip.arrow,u=null!==s?parseFloat(String(s)):1,x=g.ttHeight||0,f=g.ttWidth||0,m=parseFloat(String(t)),b=parseFloat(String(e));if(isNaN(m))return null;let y=m+u+5;const w=b+c.layout.translateY;let v=p?w-x/2+u/2:b+u/2,A="right";if(y>c.layout.gridWidth/2&&(y=y-f-u-10,A="left"),y>c.layout.gridWidth-f-10&&(y=c.layout.gridWidth-f),y<-20&&(y=-20),c.config.tooltip.followCursor){const t=d.getElGrid();if(!t)return null;const e=t.getBoundingClientRect();y=d.e.clientX-e.left,y>c.layout.gridWidth/2?(y-=f,A="left"):A="right",v=d.e.clientY+c.layout.translateY-e.top,v>c.layout.gridHeight/2&&(v-=x)}else if(!c.globals.isBarHorizontal)if(p){const t=c.layout.translateY,e=c.layout.translateY+c.layout.gridHeight;v+x>e&&(v=e-x),v<t&&(v=t)}else x/2+v>c.layout.gridHeight&&(v=c.layout.gridHeight-x+c.layout.translateY);if(isNaN(y))return null;y+=c.layout.translateX;const C=null==(a=null==(i=c.config)?void 0:i.chart)?void 0:a.accessibility;if((null==C?void 0:C.enabled)&&(null==(o=null==(r=null==C?void 0:C.keyboard)?void 0:r.navigation)?void 0:o.enabled)&&(null==(h=null==(l=null==(n=c.dom)?void 0:n.baseEl)?void 0:l.querySelector)?void 0:h.call(l,".apexcharts-keyboard-focused"))){const t=p?w:b,e=(u||1)+12,s=v,i=v+x;!isNaN(t)&&x>0&&s<t+e&&i>t-e&&(v=t-x-e,v<0&&(v=t+e))}let S=null;if(p&&x>0){const t=w-v,e=10,s=x-10;S=Math.max(e,Math.min(s,t))}return{x:y,y:v,placement:A,arrowY:S}}applyTooltipPosition(t,e){if(!t)return;const s="true"!==t.dataset.positioned;s&&(t.style.transitionProperty="none"),t.style.left=e.x+"px",t.style.top=e.y+"px",e.placement&&(t.dataset.placement=e.placement),null!=e.arrowY&&t.style.setProperty("--apx-tt-arrow-y",e.arrowY+"px"),null!=e.arrowX&&t.style.setProperty("--apx-tt-arrow-x",e.arrowX+"px"),s&&(t.offsetWidth,t.dataset.positioned="true",requestAnimationFrame(()=>{t.style.transitionProperty=""}))}moveMarkers(t,e){var s;const i=this.w,a=this.ttCtx;if(i.globals.markers.size[t]>0){const r=i.dom.baseEl.querySelectorAll(` .apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker`);for(let t=0;t<r.length;t++)parseInt(null!=(s=r[t].getAttribute("rel"))?s:"0",10)===e&&(a.marker.resetPointsSize(),a.marker.enlargeCurrentPoint(e,r[t]))}else a.marker.resetPointsSize(),this.moveDynamicPointOnHover(e,t)}moveDynamicPointOnHover(t,e){var s,i,a,r,o;const n=this.w,l=this.ttCtx;let h=0,c=0;const d=new gt(this.w),g=n.globals.pointsArray,p=l.tooltipUtil.getHoverMarkerSize(e),u=n.config.series[e].type;if(u&&("column"===u||"candlestick"===u||"boxPlot"===u||"violin"===u))return;h=null==(i=null==(s=g[e])?void 0:s[t])?void 0:i[0],c=(null==(r=null==(a=g[e])?void 0:a[t])?void 0:r[1])||0;const x=n.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${e}'] .apexcharts-series-markers path`);if(x&&c<n.layout.gridHeight&&c>0){const t=null!=(o=x.getAttribute("shape"))?o:"circle",e=d.getMarkerPath(h,c,t,1.5*p);x.setAttribute("d",e)}this.moveXCrosshairs(h),l.fixedTooltip||this.moveTooltip(h,c,p)}moveDynamicPointsOnHover(t){var e,s;const i=this.ttCtx,a=i.w;let r=0,o=0,n=0;const l=a.globals.pointsArray,h=new ce(this.w),c=new gt(this.w);n=h.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);const d=i.tooltipUtil.getHoverMarkerSize(n);if((null==(e=l[n])?void 0:e[t])&&(r=l[n][t][0],o=l[n][t][1]),isNaN(r))return;const g=i.tooltipUtil.getAllMarkers();if(g.length)for(let e=0;e<a.seriesData.series.length;e++){const i=l[e];if(a.globals.comboCharts&&void 0===i&&g.splice(e,0,null),g[e]&&i&&i.length){let i,o=l[e][t][1];g[e].setAttribute("cx",r);const n=null!=(s=g[e].getAttribute("shape"))?s:"circle";if("rangeArea"===a.config.chart.type&&!a.globals.comboCharts){const s=t+a.seriesData.series[e].length;i=l[e][s][1];o-=Math.abs(o-i)/2}if(null!==o&&!isNaN(o)&&o<a.layout.gridHeight+d&&o+d>0){const t=c.getMarkerPath(r,o,n,d);g[e].setAttribute("d",t)}else g[e].setAttribute("d","")}}this.moveXCrosshairs(r),i.fixedTooltip||this.moveTooltip(r,o||a.layout.gridHeight,d)}moveStickyTooltipOverBars(t,e){var s,i,a,r,o;const n=this.w,l=this.ttCtx;let h=n.globals.columnSeries?n.globals.columnSeries.length:n.seriesData.series.length;n.config.chart.stacked&&(h=n.globals.barGroups.length);let c=h>=2&&h%2==0?Math.floor(h/2):Math.floor(h/2)+1;if(n.globals.isBarHorizontal){c=new ce(this.w).getActiveConfigSeriesIndex("desc")+1}let d=n.dom.baseEl.querySelector(`.apexcharts-bar-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-candlestick-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-boxPlot-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-violin-series .apexcharts-series[rel='${c}'] path[j='${t}'], .apexcharts-rangebar-series .apexcharts-series[rel='${c}'] path[j='${t}']`);d||"number"!=typeof e||(d=n.dom.baseEl.querySelector(`.apexcharts-bar-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n .apexcharts-violin-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}'],\n .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}']`));let g=null;const p=n.globals.barCanvasCoords;if(!d&&p&&(g="number"==typeof e&&(null==(s=p[e])?void 0:s[t])||null,!g))for(const e in p)if(null==(i=p[e])?void 0:i[t]){g=p[e][t];break}let u=d?parseFloat(null!=(a=d.getAttribute("cx"))?a:"0"):g?g.cx:0,x=d?parseFloat(null!=(r=d.getAttribute("cy"))?r:"0"):g?g.cy:0;const f=d?parseFloat(null!=(o=d.getAttribute("barWidth"))?o:"0"):g?g.barWidth:0,m=l.getElGrid();if(!m)return;const b=m.getBoundingClientRect(),y=d&&(d.classList.contains("apexcharts-candlestick-area")||d.classList.contains("apexcharts-boxPlot-area"));if(n.axisFlags.isXNumeric){if(d&&!y){const e=this._datapointCenterXFromBars(t,b);null!=e?u=e:u-=h%2!=0?f/2:0}d&&y&&(u-=f/2)}else n.globals.isBarHorizontal||g||(u=l.xAxisTicksPositions[t-1]+l.dataPointsDividedWidth/2,isNaN(u)&&(u=l.xAxisTicksPositions[t]-l.dataPointsDividedWidth/2));if(n.globals.isBarHorizontal?x-=l.tooltipRect.ttHeight:n.config.tooltip.followCursor?x=l.e.clientY-b.top-l.tooltipRect.ttHeight/2:x+l.tooltipRect.ttHeight+15>n.layout.gridHeight&&(x=n.layout.gridHeight),n.globals.isBarHorizontal||this.moveXCrosshairs(u),!l.fixedTooltip){if(n.globals.isBarHorizontal&&!n.config.tooltip.followCursor){if(this.placeHorizontalSharedTooltip(t))return}this.moveTooltip(u,x||n.layout.gridHeight)}}_datapointCenterXFromBars(t,e){var s,i;const a=this.w,r=a.dom.baseEl.querySelectorAll(`.apexcharts-bar-series path[j='${t}'],.apexcharts-rangebar-series path[j='${t}']`);if(!r.length)return null;let o=1/0,n=-1/0;for(const t of r){const e=t.parentNode;if(null==(i=null==(s=null==e?void 0:e.classList)?void 0:s.contains)?void 0:i.call(s,"apexcharts-series-collapsed"))continue;const a=t.getBoundingClientRect();0===a.width&&0===a.height||(a.left<o&&(o=a.left),a.right>n&&(n=a.right))}return isFinite(o)?(o+n)/2-e.left-(a.globals.barPadForNumericAxis||0):null}placeHorizontalSharedTooltip(t){var e,s;const i=this.w,a=this.ttCtx,r=a.getElTooltip();if(!r)return!1;const o=a.getElGrid();if(!o)return!1;const n=o.getBoundingClientRect(),l=i.dom.baseEl.querySelectorAll(`.apexcharts-bar-series path[j='${t}'],.apexcharts-rangebar-series path[j='${t}'],.apexcharts-boxPlot-series path[j='${t}']`);if(!l.length)return!1;let h=1/0,c=-1/0,d=1/0,g=-1/0;for(const t of l){const i=t.parentNode;if(null==(s=null==(e=null==i?void 0:i.classList)?void 0:e.contains)?void 0:s.call(e,"apexcharts-series-collapsed"))continue;const a=t.getBoundingClientRect();0===a.width&&0===a.height||(a.left<h&&(h=a.left),a.right>c&&(c=a.right),a.top<d&&(d=a.top),a.bottom>g&&(g=a.bottom))}if(!isFinite(h))return!1;const p=a.tooltipRect.ttWidth||0,u=a.tooltipRect.ttHeight||0,x=(h+c)/2-n.left+i.layout.translateX,f=d-n.top+i.layout.translateY,m=g-n.top+i.layout.translateY,b=i.layout.translateY,y=i.layout.translateY+i.layout.gridHeight,w=i.layout.translateX,v=i.layout.translateX+i.layout.gridWidth;let A="top",C=f-u-7;if(C<b){const t=m+7;t+u<=y&&(A="bottom",C=t)}let S=x-p/2;S<w&&(S=w),S+p>v&&(S=v-p);const k=Math.max(10,Math.min(p-10,x-S));return this.applyTooltipPosition(r,{x:S,y:C,placement:A,arrowY:null,arrowX:k}),!0}}function Ve(t){const e=t=>`<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">${t}</svg>`;switch(t){case"square":case"rect":return e('<rect x="1" y="1" width="10" height="10" rx="1" fill="currentColor"/>');case"line":return e('<rect x="0" y="5" width="12" height="2" rx="1" fill="currentColor"/>');case"diamond":return e('<path d="M6 0.5 L11.5 6 L6 11.5 L0.5 6 Z" fill="currentColor"/>');case"triangle":return e('<path d="M6 1 L11.2 10.5 L0.8 10.5 Z" fill="currentColor"/>');case"cross":return e('<path d="M2 2 L10 10 M10 2 L2 10" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>');case"plus":return e('<path d="M6 1 L6 11 M1 6 L11 6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>');case"star":return e('<path d="M6 0.5 L7.5 4.4 L11.5 4.7 L8.4 7.2 L9.5 11.1 L6 8.9 L2.5 11.1 L3.6 7.2 L0.5 4.7 L4.5 4.4 Z" fill="currentColor"/>');case"sparkle":return e('<path d="M6 0.5 L7 5 L11.5 6 L7 7 L6 11.5 L5 7 L0.5 6 L5 5 Z" fill="currentColor"/>');default:return e('<circle cx="6" cy="6" r="5" fill="currentColor"/>')}}class Ue{constructor(t){this.w=t.w,this.ttCtx=t,this.ctx=t.ctx,this.tooltipPosition=new Ge(t)}drawDynamicPoints(){const t=this.w,e=new gt(this.w),s=new mt(this.w,this.ctx),i=[...t.dom.baseEl.querySelectorAll(".apexcharts-series")];t.config.chart.stacked&&i.sort((t,e)=>parseFloat(t.getAttribute("data:realIndex"))-parseFloat(e.getAttribute("data:realIndex")));for(let a=0;a<i.length;a++){const r=i[a].querySelector(".apexcharts-series-markers-wrap");if(null!==r){let i=`apexcharts-marker w${(Math.random()+1).toString(36).substring(4)}`;"line"!==t.config.chart.type&&"area"!==t.config.chart.type||t.globals.comboCharts||t.config.tooltip.intersect||(i+=" no-pointer-events");const a=s.getMarkerConfig({cssClass:i,seriesIndex:Number(r.getAttribute("data:realIndex"))}),o=e.drawMarker(0,0,a);o.node.setAttribute("default-marker-size",0);const n=m.createElementNS(F,"g");n.classList.add("apexcharts-series-markers"),n.appendChild(o.node),r.appendChild(n)}}}enlargeCurrentPoint(t,e,s=null,i=null){const a=this.w;"bubble"!==a.config.chart.type&&this.newPointSize(t,e);let r=e.getAttribute("cx"),o=e.getAttribute("cy");if(null!==s&&null!==i&&(r=s,o=i),this.tooltipPosition.moveXCrosshairs(r),!this.fixedTooltip){if("radar"===a.config.chart.type){const t=this.ttCtx.getElGrid();if(!t)return;const e=t.getBoundingClientRect();r=this.ttCtx.e.clientX-e.left}this.tooltipPosition.moveTooltip(r,o,a.config.markers.hover.size)}}enlargePoints(t){var e,s;const i=this.w,a=this,r=this.ttCtx,o=t,n=i.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker");let l=i.config.markers.hover.size;for(let t=0;t<n.length;t++){const h=n[t].getAttribute("rel"),c=n[t].getAttribute("index");if(void 0===l&&(l=i.globals.markers.size[c]+i.config.markers.hover.sizeOffset),o===parseInt(null!=h?h:"0",10)){a.newPointSize(o,n[t]);const i=null!=(e=n[t].getAttribute("cx"))?e:"0",h=null!=(s=n[t].getAttribute("cy"))?s:"0";a.tooltipPosition.moveXCrosshairs(parseFloat(i)),r.fixedTooltip||a.tooltipPosition.moveTooltip(parseFloat(i),parseFloat(h),l)}else a.oldPointSize(n[t])}}newPointSize(t,e){const s=this.w;let i=s.config.markers.hover.size;const a=0===t?e.parentNode.firstChild:e.parentNode.lastChild;if("0"!==a.getAttribute("default-marker-size")){const t=parseInt(a.getAttribute("index"),10);void 0===i&&(i=s.globals.markers.size[t]+s.config.markers.hover.sizeOffset),i<0&&(i=0);const r=this.ttCtx.tooltipUtil.getPathFromPoint(e,i);e.setAttribute("d",r)}}oldPointSize(t){const e=parseFloat(t.getAttribute("default-marker-size")),s=this.ttCtx.tooltipUtil.getPathFromPoint(t,e);t.setAttribute("d",s)}resetPointsSize(){var t;const e=this.w.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker");for(let s=0;s<e.length;s++){const i=parseFloat(null!=(t=e[s].getAttribute("default-marker-size"))?t:"0");if(b.isNumber(i)&&i>0){const t=this.ttCtx.tooltipUtil.getPathFromPoint(e[s],i);e[s].setAttribute("d",t)}else e[s].setAttribute("d","M0,0")}}}class qe{constructor(t){this.w=t.w;const e=this.w;this.ttCtx=t,this.isVerticalGroupedRangeBar=!e.globals.isBarHorizontal&&"rangeBar"===e.config.chart.type&&e.config.plotOptions.bar.rangeBarGroupRows}getAttr(t,e){var s;return parseFloat(null!=(s=t.target.getAttribute(e))?s:"")}handleHeatTreeTooltip({e:t,opt:e,x:s,y:i,type:a}){var r,o;const n=this.ttCtx,l=this.w;if(t.target.classList.contains(`apexcharts-${a}-rect`)){const a=this.getAttr(t,"i"),h=this.getAttr(t,"j"),c=this.getAttr(t,"cx"),d=this.getAttr(t,"cy"),g=this.getAttr(t,"width"),p=this.getAttr(t,"height");if(n.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:a,j:h,shared:!1,e:t}),l.interact.capturedSeriesIndex=a,l.interact.capturedDataPointIndex=h,s=c+n.tooltipRect.ttWidth/2+g,i=d+n.tooltipRect.ttHeight/2-p/2,n.tooltipPosition.moveXCrosshairs(c+g/2),s>l.layout.gridWidth/2&&(s=c-n.tooltipRect.ttWidth/2+g),n.w.config.tooltip.followCursor){const t=l.dom.elWrap.getBoundingClientRect();s=(null!=(r=l.interact.clientX)?r:0)-t.left-(s>l.layout.gridWidth/2?n.tooltipRect.ttWidth:0),i=(null!=(o=l.interact.clientY)?o:0)-t.top-(i>l.layout.gridHeight/2?n.tooltipRect.ttHeight:0)}}return{x:s,y:i}}handleMarkerTooltip({e:t,opt:e,x:s,y:i}){const a=this.w,r=this.ttCtx;let o,n;if(t.target.classList.contains("apexcharts-marker")){const l=parseInt(e.paths.getAttribute("cx"),10),h=parseInt(e.paths.getAttribute("cy"),10),c=parseFloat(e.paths.getAttribute("val"));if(n=parseInt(e.paths.getAttribute("rel"),10),o=parseInt(e.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,r.intersect){const t=b.findAncestor(e.paths,"apexcharts-series");t&&(o=parseInt(t.getAttribute("data:realIndex"),10))}r.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:o,j:n,shared:!r.showOnIntersect&&a.config.tooltip.shared,e:t}),"mouseup"===t.type&&r.markerClick(t,o,n),a.interact.capturedSeriesIndex=o,a.interact.capturedDataPointIndex=n;if(s=l,!!a.config.tooltip.arrow?i=h:(i=h+a.layout.translateY-1.4*r.tooltipRect.ttHeight,c<0&&(i=h)),r.w.config.tooltip.followCursor){const t=r.getElGrid();if(!t)return{x:s,y:i};const e=t.getBoundingClientRect();i=r.e.clientY+a.layout.translateY-e.top}r.marker.enlargeCurrentPoint(n,e.paths,s,i)}return{x:s,y:i}}handleBarTooltip({e:t,opt:e}){var s,i,a;const r=this.w,o=this.ttCtx,n=o.getElTooltip();let l,h=0,c=0,d=0,g=0;const p=this.getBarTooltipXY({e:t,opt:e});if(null===p.j&&0===p.barHeight&&0===p.barWidth)return;g=p.i;const u=p.j;if(r.interact.capturedSeriesIndex=g,r.interact.capturedDataPointIndex=null!==u?u:r.interact.capturedDataPointIndex,r.globals.isBarHorizontal&&o.tooltipUtil.hasBars()||!r.config.tooltip.shared?(c=p.x,d=p.y,l=Array.isArray(r.config.stroke.width)?r.config.stroke.width[g]:r.config.stroke.width,h=c):r.globals.comboCharts||r.config.tooltip.shared||(h/=2),isNaN(d)&&(d=r.globals.svgHeight-o.tooltipRect.ttHeight),c+o.tooltipRect.ttWidth>r.layout.gridWidth?c-=o.tooltipRect.ttWidth:c<0&&(c=0),o.w.config.tooltip.followCursor){if(!o.getElGrid())return}if(null===o.tooltip&&(o.tooltip=r.dom.baseEl.querySelector(".apexcharts-tooltip")),r.config.tooltip.shared||(r.globals.comboBarCount>0?o.tooltipPosition.moveXCrosshairs(h+l/2):o.tooltipPosition.moveXCrosshairs(h)),!o.fixedTooltip&&(!r.config.tooltip.shared||r.globals.isBarHorizontal&&o.tooltipUtil.hasBars())&&(d=d+r.layout.translateY-o.tooltipRect.ttHeight/2,n)){const t=o.tooltipRect.ttWidth||0,e=o.tooltipRect.ttHeight||0,l=!!r.config.tooltip.arrow,{barAnchorXInGrid:h,barAnchorYInGrid:g,barRectInGrid:u}=p,x=7,f=null==(s=o.getElGrid())?void 0:s.getBoundingClientRect(),m=r.dom.elWrap.getBoundingClientRect(),b=f?f.left-m.left:r.layout.translateX;let y,w=null,v=null,A=c+b,C=d;if(l&&r.globals.isBarHorizontal&&null!=u){const s=r.layout.translateY,i=r.layout.translateY+r.layout.gridHeight,a=b,o=b+r.layout.gridWidth,n=(u.left+u.right)/2+b,l=u.top+r.layout.translateY,h=u.bottom+r.layout.translateY;let c=l-e-x;if(y="top",c<s){const t=h+x;t+e<=i&&(y="bottom",c=t)}C=c,A=n-t/2,A<a&&(A=a),A+t>o&&(A=o-t),v=Math.max(10,Math.min(t-10,n-A))}else if(l&&null!=h&&null!=g){const s=h+b,o=b+r.layout.gridWidth/2,n=(null!=(i=null==u?void 0:u.left)?i:h)+b,l=(null!=(a=null==u?void 0:u.right)?a:h)+b;if(s<o?(y="right",A=l+x):(y="left",A=n-t-x),u){C=(u.top+u.bottom)/2+r.layout.translateY-e/2;const t=r.layout.translateY,s=r.layout.translateY+r.layout.gridHeight;C<t&&(C=t),C+e>s&&(C=s-e)}if(e>0&&u){const t=(u.top+u.bottom)/2+r.layout.translateY;w=Math.max(10,Math.min(e-10,t-C))}}o.tooltipPosition.applyTooltipPosition(n,{x:A,y:C,placement:y,arrowY:w,arrowX:v})}}getBarTooltipXY({e:t,opt:e}){const s=this.w;let i=null;const a=this.ttCtx;let r=0,o=0,n=0,l=0,h=0,c=null,d=null,g=null,p=null,u=null;const x=t.target.classList;if(x.contains("apexcharts-bar-area")||x.contains("apexcharts-candlestick-area")||x.contains("apexcharts-boxPlot-area")||x.contains("apexcharts-rangebar-area")){const x=t.target,f=x.getBoundingClientRect(),m=e.elGrid.getBoundingClientRect(),b=f.height;h=f.height;const y=f.width,w=parseInt(x.getAttribute("cx"),10),v=parseInt(x.getAttribute("cy"),10);c=w,d=v,l=parseFloat(x.getAttribute("barWidth"));const A=f.left-m.left,C=f.top-m.top,S=C+b/2;g=A+y/2,p=s.globals.isBarHorizontal?S:C,u={left:A,top:C,right:A+y,bottom:C+b};const k="touchmove"===t.type?t.touches[0].clientX:t.clientX;i=parseInt(x.getAttribute("j"),10),r=parseInt(x.parentNode.getAttribute("rel"),10)-1;const _=x.getAttribute("data-range-y1"),L=x.getAttribute("data-range-y2");s.globals.comboCharts&&(r=parseInt(x.parentNode.getAttribute("data:realIndex"),10));const M=t=>s.axisFlags.isXNumeric?w-y/2:this.isVerticalGroupedRangeBar?w+y/2:w-a.dataPointsDividedWidth+y/2,D=()=>v-a.dataPointsDividedHeight+b/2-a.tooltipRect.ttHeight/2;a.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:r,j:i,y1:_?parseInt(_,10):null,y2:L?parseInt(L,10):null,shared:!a.showOnIntersect&&s.config.tooltip.shared,e:t}),s.config.tooltip.followCursor?s.globals.isBarHorizontal?(o=k-m.left+15,n=D()):(o=M(o),n=t.clientY-m.top-a.tooltipRect.ttHeight/2-15):s.globals.isBarHorizontal?(o=w,a.xyRatios&&o<a.xyRatios.baseLineInvertedY&&(o=w-a.tooltipRect.ttWidth),n=D()):(o=M(o),n=v)}return{x:o,y:n,barHeight:h,barWidth:l,i:r,j:i,barCx:c,barCy:d,barAnchorXInGrid:g,barAnchorYInGrid:p,barRectInGrid:u}}}class Ze{constructor(t){this.w=t.w,this.ttCtx=t}drawXaxisTooltip(){const t=this.w,e=this.ttCtx,s="bottom"===t.config.xaxis.position;e.xaxisOffY=s?t.layout.gridHeight+1:-t.layout.xAxisHeight-t.config.xaxis.axisTicks.height+3;const i=s?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top",a=t.dom.elWrap;if(e.isXAxisTooltipEnabled){null===t.dom.baseEl.querySelector(".apexcharts-xaxistooltip")&&(e.xaxisTooltip=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.xaxisTooltip.setAttribute("class",i+" apexcharts-theme-"+t.config.tooltip.theme),a.appendChild(e.xaxisTooltip),e.xaxisTooltipText=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.xaxisTooltipText.classList.add("apexcharts-xaxistooltip-text"),e.xaxisTooltipText.style.fontFamily=t.config.xaxis.tooltip.style.fontFamily||t.config.chart.fontFamily,e.xaxisTooltipText.style.fontSize=t.config.xaxis.tooltip.style.fontSize,e.xaxisTooltip.appendChild(e.xaxisTooltipText))}}drawYaxisTooltip(){const t=this.w,e=this.ttCtx;for(let s=0;s<t.config.yaxis.length;s++){const i=t.config.yaxis[s].opposite||t.config.yaxis[s].crosshairs.opposite;e.yaxisOffX=i?t.layout.gridWidth+1:1;const a=i?`apexcharts-yaxistooltip apexcharts-yaxistooltip-${s} apexcharts-yaxistooltip-right`:`apexcharts-yaxistooltip apexcharts-yaxistooltip-${s} apexcharts-yaxistooltip-left`,r=t.dom.elWrap;null===t.dom.baseEl.querySelector(`.apexcharts-yaxistooltip apexcharts-yaxistooltip-${s}`)&&(e.yaxisTooltip=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.yaxisTooltip.setAttribute("class",a+" apexcharts-theme-"+t.config.tooltip.theme),r.appendChild(e.yaxisTooltip),0===s&&(e.yaxisTooltipText=[]),e.yaxisTooltipText[s]=m.createElementNS("http://www.w3.org/1999/xhtml","div"),e.yaxisTooltipText[s].classList.add("apexcharts-yaxistooltip-text"),e.yaxisTooltip.appendChild(e.yaxisTooltipText[s]))}}setXCrosshairWidth(){var t,e;const s=this.w,i=this.ttCtx,a=i.getElXCrosshairs();if(i.xcrosshairsWidth=parseInt(s.config.xaxis.crosshairs.width,10),s.globals.comboCharts){const t=s.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==t&&"barWidth"===s.config.xaxis.crosshairs.width){const s=parseFloat(null!=(e=t.getAttribute("barWidth"))?e:"0");i.xcrosshairsWidth=s}else if("tickWidth"===s.config.xaxis.crosshairs.width){const t=s.labelData.labels.length;i.xcrosshairsWidth=s.layout.gridWidth/t}}else if("tickWidth"===s.config.xaxis.crosshairs.width){const t=s.labelData.labels.length;i.xcrosshairsWidth=s.layout.gridWidth/t}else if("barWidth"===s.config.xaxis.crosshairs.width){const e=s.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==e){const s=parseFloat(null!=(t=e.getAttribute("barWidth"))?t:"0");i.xcrosshairsWidth=s}else i.xcrosshairsWidth=1}s.globals.isBarHorizontal&&(i.xcrosshairsWidth=0),null!==a&&i.xcrosshairsWidth>0&&a.setAttribute("width",String(i.xcrosshairsWidth))}handleYCrosshair(){const t=this.w,e=this.ttCtx;e.ycrosshairs=t.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),e.ycrosshairsHidden=t.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}drawYaxisTooltipText(t,e,s){const i=this.ttCtx,a=this.w,r=a.globals,o=r.seriesYAxisMap[t];if(i.yaxisTooltips[t]&&o.length>0){const n=a.formatters.yLabelFormatters[t],l=i.getElGrid();if(!l)return;const h=l.getBoundingClientRect(),c=o[0];let d=0;s.yRatio.length>1&&(d=c);const g=(e-h.top)*s.yRatio[d],p=r.maxYArr[c]-r.minYArr[c];let u=r.minYArr[c]+(p-g);a.config.yaxis[t].reversed&&(u=r.maxYArr[c]-(p-g)),i.tooltipPosition.moveYCrosshairs(e-h.top),i.yaxisTooltipText[t].innerHTML=n(u),i.tooltipPosition.moveYAxisTooltip(t)}}}class Ke{constructor(t,e){this.w=t,this.ctx=e,this.tConfig=t.config.tooltip,this.tooltipUtil=new $e(this),this.tooltipLabels=new je(this),this.tooltipPosition=new Ge(this),this.marker=new Ue(this),this.intersect=new qe(this),this.axesTooltip=new Ze(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.xaxisTooltipText=null,this.yaxisTooltip=null,this.yaxisTooltipText=null,this.yaxisTTEls=null,this.xaxisOffY=0,this.yaxisOffX=0,this.xcrosshairsWidth=0,this.ycrosshairs=null,this.ycrosshairsHidden=null,this.tooltip=null,this.e=null,this.isBarShared=!t.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now(),this.dimensionUpdateScheduled=!1,this.xyRatios=null,this.isXAxisTooltipEnabled=!1,this.yaxisTooltips=[],this.allTooltipSeriesGroups=[],this.xAxisTicksPositions=null,this.dataPointsDividedHeight=0,this.dataPointsDividedWidth=0,this.tooltipTitle=null,this.legendLabels=null,this.ttItems=null,this.seriesBound=null,this.seriesHoverTimeout=void 0,this.clientX=0,this.clientY=0,this.barSeriesHeight=0,this.tooltipRect={x:0,y:0,ttWidth:0,ttHeight:0}}setupDimensionCache(){const t=this.w,e=this.getElTooltip();e&&(this.updateDimensionCache(),"undefined"==typeof ResizeObserver||t.globals.resizeObserver||(t.globals.resizeObserver=new ResizeObserver(()=>{this.dimensionUpdateScheduled||(this.dimensionUpdateScheduled=!0,requestAnimationFrame(()=>{this.updateDimensionCache(),this.dimensionUpdateScheduled=!1}))}),t.globals.resizeObserver.observe(e)))}updateDimensionCache(){const t=this.w,e=this.getElTooltip();if(!e)return;const s=e.getBoundingClientRect();t.globals.dimensionCache.tooltip={width:s.width,height:s.height,lastUpdate:Date.now()}}getCachedDimensions(){const t=this.w;if(t.globals.dimensionCache.tooltip){const e=t.globals.dimensionCache.tooltip;if(Date.now()-e.lastUpdate<1e3)return{ttWidth:e.width,ttHeight:e.height}}this.updateDimensionCache();const e=t.globals.dimensionCache.tooltip;return e?{ttWidth:e.width,ttHeight:e.height}:{ttWidth:0,ttHeight:0}}getElTooltip(t){return t||(t=this),t.w.dom.baseEl?t.w.dom.baseEl.querySelector(".apexcharts-tooltip"):null}getElXCrosshairs(){return this.w.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}getElGrid(){return this.w.dom.baseEl.querySelector(".apexcharts-grid")}drawTooltip(t){const e=this.w;this.xyRatios=t,this.isXAxisTooltipEnabled=e.config.xaxis.tooltip.enabled&&e.globals.axisCharts,this.yaxisTooltips=e.config.yaxis.map(t=>!!(t.show&&t.tooltip.enabled&&e.globals.axisCharts)),this.allTooltipSeriesGroups=[],e.globals.axisCharts||(this.showTooltipTitle=!1);const s=this.getElTooltip();(null==s?void 0:s.parentNode)&&s.parentNode.removeChild(s),this.tooltipTitle=null;const i=m.createElementNS("http://www.w3.org/1999/xhtml","div");i.classList.add("apexcharts-tooltip"),e.config.tooltip.cssClass&&i.classList.add(e.config.tooltip.cssClass),i.classList.add(`apexcharts-theme-${this.tConfig.theme||"light"}`),this.tConfig.fillSeriesColor&&i.classList.add("apexcharts-tooltip-fill-series"),this.tConfig.style&&this.tConfig.style.background&&i.style.setProperty("--apx-tt-bg",this.tConfig.style.background);const a=this.tConfig.shared&&e.config.series.length>1&&!e.globals.isBarHorizontal;if(this.tConfig.arrow&&!this.tConfig.followCursor&&!this.tConfig.fixed.enabled&&!a&&!this.tConfig.fillSeriesColor&&e.globals.axisCharts){const t=m.createElementNS("http://www.w3.org/1999/xhtml","div");t.classList.add("apexcharts-tooltip-arrow"),i.appendChild(t)}if(e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&(i.setAttribute("role","tooltip"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),i.setAttribute("aria-hidden","true")),e.dom.elWrap.appendChild(i),e.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();const t=new At(this.w,this.ctx,void 0);this.xAxisTicksPositions=t.getXAxisTicksPositions()}if(!e.globals.comboCharts&&!this.tConfig.intersect&&"rangeBar"!==e.config.chart.type||this.tConfig.shared||(this.showOnIntersect=!0),0!==e.config.markers.size&&0!==e.globals.markers.largestSize||this.marker.drawDynamicPoints(),e.globals.collapsedSeries.length===e.seriesData.series.length)return;this.dataPointsDividedHeight=e.layout.gridHeight/e.globals.dataPoints,this.dataPointsDividedWidth=e.layout.gridWidth/e.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=m.createElementNS("http://www.w3.org/1999/xhtml","div"),this.tooltipTitle.classList.add("apexcharts-tooltip-title"),this.tooltipTitle.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,this.tooltipTitle.style.fontSize=this.tConfig.style.fontSize,i.appendChild(this.tooltipTitle));let r=e.seriesData.series.length;(e.globals.xyCharts||e.globals.comboCharts)&&this.tConfig.shared&&(r=this.showOnIntersect?1:e.seriesData.series.length),this.legendLabels=e.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(r),this.addSVGEvents(),this.setupDimensionCache()}createTTElements(t){const e=this.w,s=[],i=this.getElTooltip();if(!i)return s;for(let a=0;a<t;a++){const r=m.createElementNS("http://www.w3.org/1999/xhtml","div");r.classList.add("apexcharts-tooltip-series-group",`apexcharts-tooltip-series-group-${a}`),r.style.order=String(e.config.tooltip.inverseOrder?t-a:a+1);const o=m.createElementNS("http://www.w3.org/1999/xhtml","span");o.classList.add("apexcharts-tooltip-marker"),e.config.tooltip.fillSeriesColor?o.style.backgroundColor=e.globals.colors[a]:o.style.color=e.globals.colors[a];const n=e.config.markers.shape;let l=n;Array.isArray(n)&&(l=n[a]),o.setAttribute("shape",l),o.innerHTML=Ve(l),r.appendChild(o);const h=m.createElementNS("http://www.w3.org/1999/xhtml","div");h.classList.add("apexcharts-tooltip-text"),h.style.fontFamily=this.tConfig.style.fontFamily||e.config.chart.fontFamily,h.style.fontSize=this.tConfig.style.fontSize,["y","goals","z"].forEach(t=>{const e=m.createElementNS("http://www.w3.org/1999/xhtml","div");e.classList.add(`apexcharts-tooltip-${t}-group`);const s=m.createElementNS("http://www.w3.org/1999/xhtml","span");s.classList.add(`apexcharts-tooltip-text-${t}-label`),e.appendChild(s);const i=m.createElementNS("http://www.w3.org/1999/xhtml","span");i.classList.add(`apexcharts-tooltip-text-${t}-value`),e.appendChild(i),h.appendChild(e)}),r.appendChild(h),i.appendChild(r),s.push(r)}return s}addSVGEvents(){const t=this.w,e=t.config.chart.type,s=this.getElTooltip();if(!s)return;const i=!("bar"!==e&&"candlestick"!==e&&"boxPlot"!==e&&"violin"!==e&&"rangeBar"!==e),a="area"===e||"line"===e||"scatter"===e||"bubble"===e||"radar"===e,r=t.dom.Paper.node,o=this.getElGrid();o&&(this.seriesBound=o.getBoundingClientRect());const n=[],l=[],h={hoverArea:r,elGrid:o,tooltipEl:s,tooltipY:n,tooltipX:l,ttItems:this.ttItems};let c;if(t.globals.axisCharts&&(a?c=t.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):i?c=t.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-violin-area, .apexcharts-series .apexcharts-rangebar-area"):"heatmap"!==e&&"treemap"!==e||(c=t.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),c&&c.length))for(let t=0;t<c.length;t++)n.push(c[t].getAttribute("cy")),l.push(c[t].getAttribute("cx"));if(t.globals.xyCharts&&!this.showOnIntersect||t.globals.comboCharts&&!this.showOnIntersect||i&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([r],h);else if(i&&!t.globals.comboCharts||a&&this.showOnIntersect)this.addDatapointEventsListeners(h);else if(!t.globals.axisCharts||"heatmap"===e||"treemap"===e){const e=t.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(e,h)}if(this.showOnIntersect){const e=t.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");e.length>0&&this.addPathsEventListeners(e,h),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(h)}}drawFixedTooltipRect(){const t=this.w,e=this.getElTooltip();if(!e)return{x:0,y:0,ttWidth:0,ttHeight:0};const s=e.getBoundingClientRect(),i=s.width+10,a=s.height+10;let r=this.tConfig.fixed.offsetX,o=this.tConfig.fixed.offsetY;const n=this.tConfig.fixed.position.toLowerCase();return n.indexOf("right")>-1&&(r=r+t.globals.svgWidth-i+10),n.indexOf("bottom")>-1&&(o=o+t.globals.svgHeight-a-10),this.tooltipPosition.applyTooltipPosition(e,{x:r,y:o}),{x:r,y:o,ttWidth:i,ttHeight:a}}addDatapointEventsListeners(t){const e=this.w.dom.baseEl.querySelectorAll(".apexcharts-series-markers .apexcharts-marker, .apexcharts-bar-area, .apexcharts-candlestick-area, .apexcharts-boxPlot-area, .apexcharts-rangebar-area");this.addPathsEventListeners(e,t)}addPathsEventListeners(t,e){const s=this;for(let i=0;i<t.length;i++){const a={paths:t[i],tooltipEl:e.tooltipEl,tooltipY:e.tooltipY,tooltipX:e.tooltipX,elGrid:e.elGrid,hoverArea:e.hoverArea,ttItems:e.ttItems};["mousemove","mouseup","touchmove","mouseout","touchend"].map(e=>t[i].addEventListener(e,s.onSeriesHover.bind(s,a),{capture:!1,passive:!0}))}}onSeriesHover(t,e){const s=Date.now()-this.lastHoverTime;s>=20?this.seriesHover(t,e):(clearTimeout(this.seriesHoverTimeout),this.seriesHoverTimeout=setTimeout(()=>{this.seriesHover(t,e)},20-s))}seriesHover(t,e){this.lastHoverTime=Date.now();let s=[];const i=this.w,a=t=>{var e,s,i;const a=null==(i=null==(s=null==(e=null==t?void 0:t.w)?void 0:e.config)?void 0:s.chart)?void 0:i.link;return!(!a||"function"!=typeof a.dimension)};i.config.chart.group&&!a(this.ctx)&&(s=this.ctx.getGroupedCharts().filter(t=>!a(t))),i.globals.axisCharts&&(i.globals.minX===-1/0&&i.globals.maxX===1/0||0===i.globals.dataPoints)||(s.length?s.forEach(s=>{const i=this.getElTooltip(s),a={paths:t.paths,tooltipEl:i,tooltipY:t.tooltipY,tooltipX:t.tooltipX,elGrid:t.elGrid,hoverArea:t.hoverArea,ttItems:s.w.globals.tooltip.ttItems};s.w.globals.minX===this.w.globals.minX&&s.w.globals.maxX===this.w.globals.maxX&&s.w.globals.tooltip.seriesHoverByContext({chartCtx:s,ttCtx:s.w.globals.tooltip,opt:a,e:e})}):this.seriesHoverByContext({chartCtx:this.ctx,ttCtx:this.w.globals.tooltip,opt:t,e:e}))}seriesHoverByContext({chartCtx:t,ttCtx:e,opt:s,e:i}){const a=t.w;if(!this.getElTooltip(t))return;const r=e.getCachedDimensions();if(e.tooltipRect={x:0,y:0,ttWidth:r.ttWidth,ttHeight:r.ttHeight},e.e=i,e.tooltipUtil.hasBars()&&!a.globals.comboCharts&&!e.isBarShared&&this.tConfig.onDatasetHover.highlightDataSeries){new ce(t.w).toggleSeriesOnHover(i,i.target.parentNode)}a.globals.axisCharts?e.axisChartsTooltips({e:i,opt:s,tooltipRect:e.tooltipRect}):e.nonAxisChartsTooltips({e:i,opt:s,tooltipRect:e.tooltipRect}),e.fixedTooltip&&e.drawFixedTooltipRect()}axisChartsTooltips({e:t,opt:e}){var s;const i=this.w;let a,r;const o=e.elGrid.getBoundingClientRect(),n="touchmove"===t.type?t.touches[0].clientX:t.clientX,l="touchmove"===t.type?t.touches[0].clientY:t.clientY;if(this.clientY=l,this.clientX=n,i.interact.capturedSeriesIndex=-1,i.interact.capturedDataPointIndex=-1,l<o.top||l>o.top+o.height)return void this.handleMouseOut(e);if(Array.isArray(this.tConfig.enabledOnSeries)&&!i.config.tooltip.shared){const t=parseInt(e.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(t)<0)return void this.handleMouseOut(e)}const h=this.getElTooltip();if(!h)return;const c=this.getElXCrosshairs();let d=[];i.config.chart.group&&(d=this.ctx.getSyncedCharts());const g=i.globals.xyCharts||"bar"===i.config.chart.type&&!i.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||i.globals.comboCharts&&this.tooltipUtil.hasBars();if("mousemove"===t.type||"touchmove"===t.type||"mouseup"===t.type){if(i.globals.collapsedSeries.length+i.globals.ancillaryCollapsedSeries.length===i.seriesData.series.length)return;null!==c&&c.classList.add("apexcharts-active");const o=null==(s=this.yaxisTooltips)?void 0:s.filter(t=>!0===t),p=this.ycrosshairs;if(null!==p&&(null==o?void 0:o.length)&&p.classList.add("apexcharts-active"),g&&!this.showOnIntersect||d.length>1)this.handleStickyTooltip(t,n,l,e);else if("heatmap"===i.config.chart.type||"treemap"===i.config.chart.type){const s=this.intersect.handleHeatTreeTooltip({e:t,opt:e,x:a,y:r,type:i.config.chart.type});a=s.x,r=s.y,h.style.left=a+"px",h.style.top=r+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:t,opt:e}),this.tooltipUtil.hasMarkers(0)&&this.intersect.handleMarkerTooltip({e:t,opt:e,x:a,y:r});if(this.yaxisTooltips&&this.yaxisTooltips.length)for(let t=0;t<i.config.yaxis.length;t++)this.axesTooltip.drawYaxisTooltipText(t,l,this.xyRatios);i.dom.baseEl.classList.add("apexcharts-tooltip-active"),e.tooltipEl.classList.add("apexcharts-active"),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.announcements.enabled&&e.tooltipEl.removeAttribute("aria-hidden")}else"mouseout"!==t.type&&"touchend"!==t.type||this.handleMouseOut(e)}nonAxisChartsTooltips({e:t,opt:e,tooltipRect:s}){var i,a,r,o;const n=this.w,l=e.paths.getAttribute("rel"),h=this.getElTooltip();if(!h)return;const c=n.dom.elWrap.getBoundingClientRect();if("mousemove"===t.type||"touchmove"===t.type){let t,o;n.dom.baseEl.classList.add("apexcharts-tooltip-active"),h.classList.add("apexcharts-active"),n.config.chart.accessibility.enabled&&n.config.chart.accessibility.announcements.enabled&&h.removeAttribute("aria-hidden"),this.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:parseInt(l,10)-1,shared:!1});const d=e.paths.querySelector("path[data\\:cx]")||e.paths;if(n.config.tooltip.intersect&&d.hasAttribute("data:cx")&&d.hasAttribute("data:cy")){const e=n.dom.Paper.node.getBoundingClientRect();t=e.left-c.left+parseFloat(d.getAttribute("data:cx"))-s.ttWidth/2,o=e.top-c.top+parseFloat(d.getAttribute("data:cy"))-s.ttHeight-10}else t=(null!=(i=n.interact.clientX)?i:0)-c.left-s.ttWidth/2,o=(null!=(a=n.interact.clientY)?a:0)-c.top-s.ttHeight-10;if(h.style.left=t+"px",h.style.top=o+"px",n.config.legend.tooltipHoverFormatter){const t=n.config.legend.tooltipHoverFormatter,e=l-1,s=null==(r=this.legendLabels)?void 0:r[e];if(!s)return;const i=t(s.getAttribute("data:default-text"),{seriesIndex:e,dataPointIndex:e,w:n});s.innerHTML=i}}else"mouseout"!==t.type&&"touchend"!==t.type||(h.classList.remove("apexcharts-active"),n.dom.baseEl.classList.remove("apexcharts-tooltip-active"),n.config.legend.tooltipHoverFormatter&&(null==(o=this.legendLabels)||o.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(null!=e?e:"")})))}handleStickyTooltip(t,e,s,i){const a=this.w,r=this.tooltipUtil.getNearestValues({context:this,hoverArea:i.hoverArea,elGrid:i.elGrid,clientX:e,clientY:s}),o=r.j;let n=r.capturedSeries;null!==n&&a.globals.collapsedSeriesIndices.includes(null!=n?n:-1)&&(n=null);const l=i.elGrid.getBoundingClientRect();if(r.hoverX<0||r.hoverX>l.width)this.handleMouseOut(i);else if(null!==n)this.handleStickyCapturedSeries(t,null!=n?n:-1,i,null!=o?o:0);else if(this.tooltipUtil.isXoverlap(null!=o?o:0)||a.globals.isBarHorizontal){const e=a.seriesData.series.findIndex((t,e)=>!a.globals.collapsedSeriesIndices.includes(e));this.create(t,this,e,null!=o?o:0,i.ttItems)}}handleStickyCapturedSeries(t,e,s,i){const a=this.w;if(!this.tConfig.shared){if(null===a.seriesData.series[e][i])return void this.handleMouseOut(s)}if(void 0!==a.seriesData.series[e][i])this.tConfig.shared&&this.tooltipUtil.isXoverlap(i)&&this.tooltipUtil.isInitialSeriesSameLen()?this.create(t,this,e,i,s.ttItems):this.create(t,this,e,i,s.ttItems,!1);else if(this.tooltipUtil.isXoverlap(i)){const e=a.seriesData.series.findIndex((t,e)=>!a.globals.collapsedSeriesIndices.includes(e));this.create(t,this,e,i,s.ttItems)}}deactivateHoverFilter(){const t=this.w,e=new gt(this.w,this.ctx),s=t.dom.Paper.find(".apexcharts-bar-area");for(let t=0;t<s.length;t++)e.pathMouseLeave(s[t],void 0)}handleMouseOut(t){var e,s;const i=this.w,a=this.getElXCrosshairs();i.dom.baseEl.classList.remove("apexcharts-tooltip-active"),t.tooltipEl.classList.remove("apexcharts-active"),delete t.tooltipEl.dataset.positioned,i.config.chart.accessibility.enabled&&i.config.chart.accessibility.announcements.enabled&&t.tooltipEl.setAttribute("aria-hidden","true"),this.deactivateHoverFilter(),"bubble"!==i.config.chart.type&&this.marker.resetPointsSize(),null!==a&&a.classList.remove("apexcharts-active");const r=this.ycrosshairs;if(null!==r&&r.classList.remove("apexcharts-active"),this.isXAxisTooltipEnabled&&(null==(e=this.xaxisTooltip)||e.classList.remove("apexcharts-active")),this.yaxisTooltips&&this.yaxisTooltips.length){null===this.yaxisTTEls&&(this.yaxisTTEls=[...i.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")]);for(let t=0;t<this.yaxisTTEls.length;t++)this.yaxisTTEls[t].classList.remove("apexcharts-active")}i.config.legend.tooltipHoverFormatter&&(null==(s=this.legendLabels)||s.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(null!=e?e:"")}))}markerClick(t,e,s){const i=this.w;"function"==typeof i.config.chart.events.markerClick&&i.config.chart.events.markerClick(t,this.ctx,{seriesIndex:e,dataPointIndex:s,w:i}),this.ctx.events.fireEvent("markerClick",[t,this.ctx,{seriesIndex:e,dataPointIndex:s,w:i}])}_hasCustomSeries(){const t=this.w;if(Be(t.config.chart.type))return!0;return(t.config.series||[]).some(t=>t&&t.type&&Be(t.type))}create(t,e,s,i,a,r=null){var o,h,c,d,g,p,u,x,f,m,b,y,w,v,A,C,S,k,_,L,M;const D=this.w,E=e;"mouseup"===t.type&&this.markerClick(t,s,i),null===r&&(r=this.tConfig.shared);const P=this.tooltipUtil.hasMarkers(s),F="canvas"===(null==(h=null==(o=this.ctx)?void 0:o.renderer)?void 0:h.kind),T=F&&!this.tooltipUtil.hasBars(),I=!F&&!P&&!this.tooltipUtil.hasBars()&&this._hasCustomSeries(),X=T||I,R=this.tooltipUtil.getElBars(),z=()=>{D.globals.markers.largestSize>0&&!F?E.marker.enlargePoints(i):E.tooltipPosition.moveDynamicPointsOnHover(i)};if(D.config.legend.tooltipHoverFormatter){const t=D.config.legend.tooltipHoverFormatter,e=Array.from(null!=(c=this.legendLabels)?c:[]);e.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(null!=e?e:"")});for(let a=0;a<e.length;a++){const o=e[a],n=parseInt(null!=(d=o.getAttribute("i"))?d:"",10),l=decodeURIComponent(null!=(g=o.getAttribute("data:default-text"))?g:""),h=t(l,{seriesIndex:r?n:s,dataPointIndex:i,w:D});if(r)o.innerHTML=D.globals.collapsedSeriesIndices.indexOf(n)<0?h:l;else if(o.innerHTML=n===s?h:l,s===n)break}}const B=D.rangeData,Y=n(n({ttItems:a,i:s,j:i},void 0!==(null==(f=null==(x=null==(u=null==(p=B.seriesRange)?void 0:p[s])?void 0:u[i])?void 0:x.y[0])?void 0:f.y1)&&{y1:null==(w=null==(y=null==(b=null==(m=B.seriesRange)?void 0:m[s])?void 0:b[i])?void 0:y.y[0])?void 0:w.y1}),void 0!==(null==(S=null==(C=null==(A=null==(v=B.seriesRange)?void 0:v[s])?void 0:A[i])?void 0:C.y[0])?void 0:S.y2)&&{y2:null==(M=null==(L=null==(_=null==(k=B.seriesRange)?void 0:k[s])?void 0:_[i])?void 0:L.y[0])?void 0:M.y2});if(r){if(E.tooltipLabels.drawSeriesTexts(l(n({},Y),{shared:!this.showOnIntersect&&this.tConfig.shared})),P||X)z();else if(this.tooltipUtil.hasBars()&&(F&&E.tooltipPosition.moveStickyTooltipOverBars(i,s),this.barSeriesHeight=this.tooltipUtil.getBarsHeight([...R]),this.barSeriesHeight>0)){const t=new gt(this.w,this.ctx),e=D.dom.Paper.find(`.apexcharts-bar-area[j='${i}']`);this.deactivateHoverFilter();E.tooltipUtil.getAllMarkers(!0).length&&!this.barSeriesHeight&&z(),E.tooltipPosition.moveStickyTooltipOverBars(i,s);for(let s=0;s<e.length;s++)t.pathMouseEnter(e[s],void 0)}}else E.tooltipLabels.drawSeriesTexts(n({shared:!1},Y)),this.tooltipUtil.hasBars()&&E.tooltipPosition.moveStickyTooltipOverBars(i,s),P?E.tooltipPosition.moveMarkers(s,i):X&&E.tooltipPosition.moveDynamicPointOnHover(i,s)}}class Je{constructor(t,e){this.w=t,this.ctx=e,this.kind="svg"}beginSeries(){}present(){return null}clear(){}group(t){return this.ctx.graphics.group(t)}drawPath(t){return this.ctx.graphics.drawPath(t)}drawLine(...t){return this.ctx.graphics.drawLine(...t)}drawRect(...t){return this.ctx.graphics.drawRect(...t)}drawCircle(t,e){return this.ctx.graphics.drawCircle(t,e)}drawText(t){return this.ctx.graphics.drawText(t)}renderPaths(t){return this.ctx.graphics.renderPaths(t)}drawMarker(t,e,s={}){return this.ctx.graphics.drawMarker(t,e,s)}supports(t){return!0}hitTest(){return null}restyle(){}toBitmap(){return null}destroy(){}}const Qe="__apexcharts_renderers__";function ts(){const t=globalThis;return t[Qe]||(t[Qe]=new Map),t[Qe]}class es{static get _rendererRegistry(){return ts()}static registerRenderer(t,e){ts().set(t,e)}static unregisterRenderer(t){ts().delete(t)}constructor(t,e){this.w=t,this.ctx=e,this.svg=new Je(t,e),this.active=this.svg,this._activeKind="svg",this._instances={}}_desiredKind(){const t=this.w.config.chart,e=t.renderer||"svg";if(!c.isBrowser())return"svg";if("svg"===e)return"svg";if(ft(this.w))return"svg";if("canvas"===e)return"canvas";return function(t){const e=t.config.series||[],s=t.config.chart.type,i="scatter"===s||"bubble"===s,a=t.config.markers&&t.config.markers.size,r=Array.isArray(a)?a.some(t=>t>0):(a||0)>0,o=!(!t.config.dataLabels||!t.config.dataLabels.enabled);let n=0,l=0;return e.forEach(t=>{const e=Array.isArray(t.data)?t.data.length:0;e>l&&(l=e),(i||r)&&(n+=e),o&&(n+=e)}),l>=5e4&&(n=Math.max(n,l)),n}(this.w)>=(t.rendererThreshold||8e3)?"canvas":"svg"}resolve(){const t=this.w.config.chart.renderer||"svg",e=this._desiredKind();if("svg"!==e){const t=ts().get(e);if(t)return this._instances[e]||(this._instances[e]=t(this.w,this.ctx)),this.active=this._instances[e],this._activeKind=e,this.ctx.renderer=this.active,this.w.globals.activeRenderer=this.active,this._activeKind}else"canvas"===t&&ft(this.w);return this.active=this.svg,this._activeKind="svg",this.ctx.renderer=this.active,this.w.globals.activeRenderer=this.active,this._activeKind}getActiveKind(){return this._activeKind}teardown(){for(const t in this._instances){const e=this._instances[t];e&&"function"==typeof e.destroy&&e.destroy()}this._instances={},this.active=this.svg,this._activeKind="svg"}}class ss{constructor(t){this.node=t,t&&(t.instance=this),this._listeners=[],this._filter=null}attr(t,e){if("string"==typeof t&&void 0===e)return this.node.getAttribute(t);const s="string"==typeof t?{[t]:e}:t;for(const t in s){let e=s[t];null===e?this.node.removeAttribute(t):void 0!==e&&("number"==typeof e&&isNaN(e)&&(e=0),this.node.setAttribute(t,e))}if("text"===this.node.nodeName&&null!=s.x){const t=this.node.querySelectorAll("tspan[data-newline]");for(let e=0;e<t.length;e++)t[e].setAttribute("x",s.x)}return this}css(t){for(const e in t)this.node.style[e]=t[e];return this}fill(t){return"object"==typeof t?this.attr(t):this.attr("fill",t)}stroke(t){return"object"==typeof t?(void 0!==t.color&&this.attr("stroke",t.color),void 0!==t.width&&this.attr("stroke-width",t.width),void 0!==t.dasharray&&this.attr("stroke-dasharray",t.dasharray),void 0!==t.linecap&&this.attr("stroke-linecap",t.linecap),void 0!==t.opacity&&this.attr("stroke-opacity",t.opacity),this):this.attr("stroke",t)}size(t,e){return this.attr({width:t,height:e})}move(t,e){return this.attr({x:t,y:e})}center(t,e){if("g"===this.node.nodeName){const s=this.bbox(),i=t-(s.x+s.width/2),a=e-(s.y+s.height/2);return this.attr("transform",`translate(${i}, ${a})`)}return this.attr({cx:t,cy:e})}add(t){return t&&t.__isCanvasMark||this.node.appendChild(t.node||t),this}addTo(t){return(t.node||t).appendChild(this.node),this}remove(){return this.node.parentNode&&this.node.parentNode.removeChild(this.node),this}clear(){for(;this.node.firstChild;)this.node.removeChild(this.node.firstChild);return this}find(t){return Array.from(this.node.querySelectorAll(t)).map(t=>t.instance||new ss(t))}findOne(t){const e=this.node.querySelector(t);return e?e.instance||new ss(e):null}on(t,e){const s=t.split(".")[0];return this._listeners.push({event:t,eventType:s,handler:e}),this.node.addEventListener(s,e),this}off(t,e){if(t||e)if(t&&!e){const e=t.split(".")[0];this._listeners=this._listeners.filter(t=>t.eventType!==e||(this.node.removeEventListener(t.eventType,t.handler),!1))}else{const s=t.split(".")[0];this._listeners=this._listeners.filter(t=>t.eventType!==s||t.handler!==e||(this.node.removeEventListener(t.eventType,t.handler),!1))}else this._listeners.forEach(t=>{this.node.removeEventListener(t.eventType,t.handler)}),this._listeners=[];return this}each(t,e){return Array.from(this.node.children).forEach(s=>{const i=s.instance||new ss(s);t.call(i),e&&i.each(t,e)}),this}removeClass(t){return"*"===t?this.node.removeAttribute("class"):this.node.classList.remove(t),this}children(){return Array.from(this.node.childNodes).filter(t=>1===t.nodeType).map(t=>t.instance||new ss(t))}hide(){return this.node.style.display="none",this}show(){return this.node.style.display="",this}bbox(){if("function"==typeof this.node.getBBox)try{return this.node.getBBox()}catch(t){}return{x:0,y:0,width:0,height:0}}tspan(t){const e=m.createElementNS("http://www.w3.org/2000/svg","tspan");return e.textContent=t,this.node.appendChild(e),new ss(e)}plot(t){return"string"==typeof t&&this.attr("d",t),this}animate(){throw new Error("Animation module not loaded")}filterWith(){throw new Error("Filter module not loaded")}unfilter(t){return this._filter&&(this.node.removeAttribute("filter"),t&&this._filter.node&&this._filter.node.parentNode&&this._filter.node.parentNode.removeChild(this._filter.node),this._filter=null),this}filterer(){return this._filter}}let is=0;class as extends ss{constructor(t,e,s){const i="radial"===e?"radialGradient":"linearGradient";super(m.createElementNS(F,i)),this._id="SvgjsGradient"+ ++is,this.attr("id",this._id),"function"==typeof s&&s(new rs(this));let a=t.node.querySelector("defs");a||(a=m.createElementNS(F,"defs"),t.node.appendChild(a)),a.appendChild(this.node)}stop(t,e,s){const i=m.createElementNS(F,"stop");return i.setAttribute("offset",t),i.setAttribute("stop-color",e),void 0!==s&&i.setAttribute("stop-opacity",String(s)),this.node.appendChild(i),this}from(t,e){return this.attr({x1:t,y1:e})}to(t,e){return this.attr({x2:t,y2:e})}url(){return"url(#"+this._id+")"}toString(){return this.url()}valueOf(){return this.url()}fill(){return this.url()}}class rs{constructor(t){this.gradient=t}stop(t,e,s){return this.gradient.stop(t,e,s),this}}let os=0;class ns extends ss{constructor(t,e,s,i){if(super(m.createElementNS(F,"pattern")),this._id="SvgjsPattern"+ ++os,this.attr({id:this._id,width:e,height:s,patternUnits:"userSpaceOnUse"}),"function"==typeof i){i(new ls(this.node))}let a=t.node.querySelector("defs");a||(a=m.createElementNS(F,"defs"),t.node.appendChild(a)),a.appendChild(this.node)}url(){return"url(#"+this._id+")"}toString(){return this.url()}valueOf(){return this.url()}fill(){return this.url()}}class ls extends ss{line(t,e,s,i){const a=this._make("line");return void 0!==t&&a.attr({x1:t,y1:e,x2:s,y2:i}),a}rect(t,e){const s=this._make("rect");return void 0!==t&&s.attr({width:t,height:e}),s}circle(t){const e=this._make("circle");return void 0!==t&&e.attr({r:t/2,cx:t/2,cy:t/2}),e}path(t){const e=this._make("path");return t&&e.attr("d",t),e}polygon(t){const e=this._make("polygon");return t&&e.attr("points",t),e}group(){return this._makeContainer("g")}defs(){return this._makeContainer("defs")}plain(t){const e=m.createElementNS(F,"text");e.textContent=t;const s=new ss(e);return this.node.appendChild(e),s}text(t){const e=m.createElementNS(F,"text"),s=new ss(e);return this.node.appendChild(e),"function"==typeof t&&t(new hs(e)),s}image(t,e){const s=m.createElementNS(F,"image");s.setAttributeNS("http://www.w3.org/1999/xlink","href",t);const i=new ss(s);if(this.node.appendChild(s),"function"==typeof e){const s=new Image;s.onload=function(){i.size(s.width,s.height),e.call(i,{width:s.width,height:s.height})},s.src=t}return i}gradient(t,e){return new as(this,t,e)}pattern(t,e,s){return new ns(this,t,e,s)}_make(t){const e=m.createElementNS(F,t);return this.node.appendChild(e),new ss(e)}_makeContainer(t){const e=m.createElementNS(F,t);return this.node.appendChild(e),new ls(e)}}class hs{constructor(t){this.textNode=t}tspan(t){const e=m.createElementNS(F,"tspan");return e.textContent=t,this.textNode.appendChild(e),new cs(e,this.textNode)}}class cs{constructor(t,e){this.node=t,this.textNode=e}newLine(){return this.node.setAttribute("dy","1.1em"),this.node.dataset.newline="1",this}}let ds=0;class gs extends ss{constructor(){super(m.createElementNS(F,"filter")),this._id="SvgjsFilter"+ ++ds,this.attr("id",this._id)}size(t,e,s,i){return this.attr({width:t,height:e,x:s,y:i})}}class ps{constructor(t){this.filter=t}colorMatrix(t){return this._primitive("feColorMatrix",t)}offset(t){return this._primitive("feOffset",t)}gaussianBlur(t){return this._primitive("feGaussianBlur",t)}flood(t){return this._primitive("feFlood",t)}composite(t){return this._primitive("feComposite",t)}merge(t){const e=m.createElementNS(F,"feMerge");return t.forEach(t=>{const s=m.createElementNS(F,"feMergeNode");s.setAttribute("in",t),e.appendChild(s)}),this.filter.node.appendChild(e),new ss(e)}_primitive(t,e){const s=m.createElementNS(F,t);for(const t in e)s.setAttribute(t,e[t]);return this.filter.node.appendChild(s),new ss(s)}}var us;function xs(){const t=m.createElementNS(F,"svg"),e=new ls(t);return e.attr({xmlns:F}),e}(us=ss).prototype.filterWith=function(t){const e=new gs;this._filter=e;let s=this.node;for(;s&&"svg"!==s.nodeName;)s=s.parentNode;if(s){let t=s.querySelector("defs");t||(t=m.createElementNS(F,"defs"),s.insertBefore(t,s.firstChild)),t.appendChild(e.node)}return t(new ps(e)),this.attr("filter","url(#"+e._id+")"),this},us.prototype.unfilter=function(t){return this._filter&&(this.node.removeAttribute("filter"),t&&this._filter.node&&this._filter.node.parentNode&&this._filter.node.parentNode.removeChild(this._filter.node),this._filter=null),this},us.prototype.filterer=function(){return this._filter},function(t){t.prototype.animate=function(t,e){return new J(this,t,e)}}(ss),function(t){t.prototype.draggable=function(t){if(!1===t)return this._dragCleanup&&(this._dragCleanup(),this._dragCleanup=null),this;const e=this,s=t||{},i=t=>{if(t.button&&0!==t.button)return;t.stopPropagation();const i="touchstart"===t.type?t.touches[0]:t,a=e.node,r=parseFloat(a.getAttribute("x"))||0,o=parseFloat(a.getAttribute("y"))||0,n=i.clientX,l=i.clientY,h=a.ownerSVGElement;let d=null;h&&(d=h.getScreenCTM());const g=t=>{const e="touchmove"===t.type?t.touches[0]:t;let i=e.clientX-n,h=e.clientY-l;d&&(i/=d.a,h/=d.d);let c=r+i,g=o+h;const p=parseFloat(a.getAttribute("width"))||0,u=parseFloat(a.getAttribute("height"))||0;void 0!==s.minX&&c<s.minX&&(c=s.minX),void 0!==s.minY&&g<s.minY&&(g=s.minY),void 0!==s.maxX&&c+p>s.maxX&&(c=s.maxX-p),void 0!==s.maxY&&g+u>s.maxY&&(g=s.maxY-u);const x=new CustomEvent("dragmove",{detail:{handler:{move:function(t,e){a.setAttribute("x",t),a.setAttribute("y",e)}},box:{x:c,y:g,w:p,h:u,x2:c+p,y2:g+u}}});a.dispatchEvent(x)},p=()=>{c.isBrowser()&&(document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p))};c.isBrowser()&&(document.addEventListener("mousemove",g),document.addEventListener("touchmove",g),document.addEventListener("mouseup",p),document.addEventListener("touchend",p))};return e.node.addEventListener("mousedown",i),e.node.addEventListener("touchstart",i),e._dragCleanup=()=>{e.node.removeEventListener("mousedown",i),e.node.removeEventListener("touchstart",i)},e}}(ss),function(t){t.prototype.select=function(t){if(!1===t)return this._selectCleanup&&(this._selectCleanup(),this._selectCleanup=null),this;const e=this,{createHandle:s,updateHandle:i}=t,a=document.createElementNS(F,"g");a.setAttribute("class","svg_select_points");const r=e.node.parentNode;r&&r.appendChild(a);const o={},n=["t","b","l","r","lt","rt","lb","rb"];n.forEach((t,e)=>{const i=new ls(document.createElementNS(F,"g"));a.appendChild(i.node);const r=s(i,[0,0],e,[],t);o[t]={group:i,handle:r}});const l=()=>{const t=parseFloat(e.attr("x"))||0,s=parseFloat(e.attr("y"))||0,r=parseFloat(e.attr("width"))||0,l=parseFloat(e.attr("height"))||0,h=e.node.getAttribute("transform");h?a.setAttribute("transform",h):a.removeAttribute("transform");const c={t:[t+r/2,s],b:[t+r/2,s+l],l:[t,s+l/2],r:[t+r,s+l/2],lt:[t,s],rt:[t+r,s],lb:[t,s+l],rb:[t+r,s+l]};n.forEach(t=>{o[t]&&c[t]&&i(o[t].group,c[t])})};return l(),e._selectHandles=a,e._selectHandlesMap=o,e._updateSelectPositions=l,e._selectCleanup=()=>{a.parentNode&&a.parentNode.removeChild(a),e._selectHandles=null,e._selectHandlesMap=null,e._updateSelectPositions=null},e},t.prototype.resize=function(t){if(!1===t)return this._resizeCleanup&&(this._resizeCleanup(),this._resizeCleanup=null),this;const e=this,s=e._selectHandlesMap;if(!s)return e;const i=[],a=t=>{const a=s[t];if(!a||!a.group||!a.group.node)return;const r=a.group.node,o=s=>{if(s.button&&0!==s.button)return;s.stopPropagation();const i=("touchstart"===s.type?s.touches[0]:s).clientX,a=e.node.ownerSVGElement;let r=null;a&&(r=a.getScreenCTM());const o=parseFloat(e.attr("x"))||0,n=parseFloat(e.attr("width"))||0,l=s=>{let a=("touchmove"===s.type?s.touches[0]:s).clientX-i;r&&(a/=r.a);let l=o,h=n;"l"===t?(l=o+a,h=n-a):"r"===t&&(h=n+a),h<0&&(h=0),e.attr({x:l,width:h}),e._updateSelectPositions&&e._updateSelectPositions();const c=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(c)},h=()=>{c.isBrowser()&&(document.removeEventListener("mousemove",l),document.removeEventListener("touchmove",l),document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h));const t=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(t)};c.isBrowser()&&(document.addEventListener("mousemove",l),document.addEventListener("touchmove",l),document.addEventListener("mouseup",h),document.addEventListener("touchend",h))};r.addEventListener("mousedown",o),r.addEventListener("touchstart",o),i.push(()=>{r.removeEventListener("mousedown",o),r.removeEventListener("touchstart",o)})};return a("l"),a("r"),e._resizeCleanup=()=>{i.forEach(t=>t())},e}}(ss),xs.xlink="http://www.w3.org/1999/xlink",c.isBrowser()&&void 0===window.SVG&&(window.SVG=xs),c.isBrowser()?(void 0===window.SVG&&(window.SVG=xs),void 0===window.Apex&&(window.Apex={})):"undefined"!=typeof global&&(void 0===global.Apex&&(global.Apex={}),void 0===global.SVG&&(global.SVG=xs));const fs=class t{static registerFeatures(e){for(const[s,i]of Object.entries(e))t._featureRegistry.set(s,i)}constructor(t){this.ctx=t,this.w=t.w}initModules(){this.ctx.publicMethods=["updateOptions","updateSeries","appendData","appendSeries","isSeriesHidden","highlightSeries","toggleSeries","showSeries","hideSeries","setLocale","resetSeries","zoomX","toggleDataPointSelection","dataURI","exportToCSV","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","drillDown","drillUp","drillToRoot","paper","getActiveRenderer","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend","keydown","keyup"],this.ctx.animations=new ct(this.w,this.ctx),this.ctx.axes=new Dt(this.w,this.ctx),this.ctx.core=new We(this.ctx.el,this.w,this.ctx),this.ctx.config=new _({}),this.ctx.data=new Oe(this.w,{resetGlobals:()=>this.ctx.core.resetGlobals(),isMultipleY:()=>this.ctx.core.isMultipleY()}),this.ctx.grid=new Ct(this.w,this.ctx),this.ctx.graphics=new gt(this.w,this.ctx),this.ctx.coreUtils=new P(this.w),this.ctx.crosshairs=new Et(this.w),this.ctx.events=new Lt(this.w,this.ctx),this.ctx.fill=new pt(this.w),this.ctx.localization=new Mt(this.w),this.ctx.options=new k,this.ctx.responsive=new Ft(this.w),this.ctx.series=new ce(this.w,{toggleDataSeries:(...t)=>{var e;return null==(e=this.ctx.legend)?void 0:e.legendHelpers.toggleDataSeries(...t)},revertDefaultAxisMinMax:()=>this.ctx.updateHelpers.revertDefaultAxisMinMax(),updateSeries:(...t)=>this.ctx.updateHelpers._updateSeries(...t)}),this.ctx.theme=new me(this.w),this.ctx.formatters=new w(this.w),this.ctx.titleSubtitle=new be(this.w),this.ctx.dimensions=new Ce(this.w,this.ctx),this.ctx.updateHelpers=new He(this.w,this.ctx),this.ctx.rendererController=new es(this.w,this.ctx),this.ctx.renderer=this.ctx.rendererController.active;const t=new Ke(this.w,this.ctx);this.w.globals.tooltip=t,Object.defineProperty(this.ctx,"tooltip",{get(){return this.w.globals.tooltip},configurable:!0}),this._initOptionalModules()}_initOptionalModules(){const e=t._featureRegistry,s=this.w,i=this.ctx,a=e.get("exports");i.exports=a?new a(s,i):null;const r=e.get("legend");i.legend=r?new r(s,i):null;const o=e.get("morphTypeChange");i.morphTypeChange=o?new o(s,i):null;const n=e.get("drilldown");i.drilldown=n?new n(s,i):null;const l=e.get("perspectives");i.perspectives=l?new l(s,i):null;const h=e.get("storyboard");i.storyboard=h?new h(s,i):null;const c=e.get("history");i.history=c?new c(s,i):null;const d=e.get("linkedViews");i.linkedViews=d?new d(s,i):null;const g=e.get("ink");i.ink=g?new g(s,i):null;const p=e.get("measure");i.measure=p?new p(s,i):null;const u=e.get("contextMenu");i.contextMenu=u?new u(s,i):null;const x=e.get("weave");i.weave=x?new x(s,i):null;const f=e.get("osThemeWatcher");i.osThemeWatcher=f?new f(s,i):null;const m=e.get("toolbar");Object.defineProperty(i,"toolbar",{get(){var t;return!this._toolbar&&m&&(this._toolbar=new m(s,this)),null!=(t=this._toolbar)?t:null},configurable:!0});const b=e.get("zoomPanSelection");Object.defineProperty(i,"zoomPanSelection",{get(){var t;return!this._zoomPanSelection&&b&&(this._zoomPanSelection=new b(s,this)),null!=(t=this._zoomPanSelection)?t:null},configurable:!0});const y=e.get("keyboardNavigation");Object.defineProperty(i,"keyboardNavigation",{get(){var t;return!this._keyboardNavigation&&y&&(this._keyboardNavigation=new y(s,this)),null!=(t=this._keyboardNavigation)?t:null},configurable:!0})}};h(fs,"_featureRegistry",new Map);let ms=fs;class bs{constructor(t){this.ctx=t,this.w=t.w}clear({isUpdating:t}){var e,s,i,a,r,o,n,l,h,c,d;null==(e=this.ctx.weave)||e.teardown(t),t||(this.w.globals.isDestroyed=!0),this.ctx._zoomPanSelection&&this.ctx._zoomPanSelection.destroy(),this.ctx._toolbar&&this.ctx._toolbar.destroy(),this.w.globals.resizeObserver&&"function"==typeof this.w.globals.resizeObserver.disconnect&&(this.w.globals.resizeObserver.disconnect(),this.w.globals.resizeObserver=null),wt.invalidateAll(this.w),t?(this.ctx._zoomPanSelection=null,this.ctx._toolbar=null,this.ctx._keyboardNavigation=null):(null==(s=this.ctx.perspectives)||s.teardown(),this.ctx.perspectives=null,null==(i=this.ctx.storyboard)||i.teardown(),this.ctx.storyboard=null,null==(a=this.ctx.history)||a.teardown(),this.ctx.history=null,null==(r=this.ctx.linkedViews)||r.teardown(),this.ctx.linkedViews=null,null==(o=this.ctx.ink)||o.teardown(),this.ctx.ink=null,null==(n=this.ctx.measure)||n.teardown(),this.ctx.measure=null,null==(l=this.ctx.contextMenu)||l.teardown(),this.ctx.contextMenu=null,null==(h=this.ctx.osThemeWatcher)||h.teardown(),this.ctx.osThemeWatcher=null,this.ctx.weave=null,null==(d=null==(c=this.ctx.rendererController)?void 0:c.teardown)||d.call(c),this.ctx.rendererController=null,this.ctx.renderer=null,this.ctx.drilldown=null,this.ctx.morphTypeChange=null,this.ctx.exports=null,this.ctx.animations=null,this.ctx.axes=null,this.ctx.annotations=null,this.ctx.core=null,this.ctx.data=null,this.ctx.grid=null,this.ctx.series=null,this.ctx.responsive=null,this.ctx.theme=null,this.ctx.formatters=null,this.ctx.titleSubtitle=null,this.ctx.legend=null,this.ctx.dimensions=null,this.ctx.options=null,this.ctx.crosshairs=null,this.ctx._zoomPanSelection=null,this.ctx.updateHelpers=null,this.ctx._toolbar=null,this.ctx.localization=null,this.ctx._keyboardNavigation=null,this.ctx.w.globals.tooltip=null),this.clearDomElements({isUpdating:t})}killSVG(t){t.each(function(){this.removeClass("*"),this.off()},!0),t.clear()}clearDomElements({isUpdating:t}){const e=this.w.dom;if(c.isBrowser()&&e.Paper){const s=e.Paper.node;s.parentNode&&s.parentNode.parentNode&&!t&&(s.parentNode.parentNode.style.minHeight="unset");const i=e.baseEl;if(i&&this.ctx.eventList.forEach(t=>{i.removeEventListener(t,this.ctx.events.documentEvent)}),null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(e.Paper),e.Paper.remove()}e.elWrap=null,e.elGraphical=null,e.elLegendWrap=null,e.elLegendForeign=null,e.baseEl=null,e.elGridRect=null,e.elGridRectMask=null,e.elGridRectBarMask=null,e.elGridRectMarkerMask=null,e.elForecastMask=null,e.elNonForecastMask=null,e.elDefs=null}}const ys="__apexcharts_plugins__";function ws(){const t=globalThis;return t[ys]||(t[ys]={}),t[ys]}const vs=new WeakMap;const As=class t{constructor(t,e){h(this,"core"),h(this,"responsive"),h(this,"axes"),h(this,"grid"),h(this,"graphics"),h(this,"coreUtils"),h(this,"crosshairs"),h(this,"events"),h(this,"fill"),h(this,"localization"),h(this,"options"),h(this,"series"),h(this,"theme"),h(this,"formatters"),h(this,"titleSubtitle"),h(this,"dimensions"),h(this,"updateHelpers"),h(this,"tooltip"),h(this,"data"),h(this,"animations"),h(this,"exports"),h(this,"legend"),h(this,"toolbar"),h(this,"zoomPanSelection"),h(this,"keyboardNavigation"),h(this,"annotations"),h(this,"morphTypeChange"),h(this,"timeScale"),h(this,"_keyboardNavigation"),h(this,"windowResizeHandler"),h(this,"parentResizeHandler"),h(this,"publicMethods",[]),h(this,"eventList",[]),h(this,"_renderPromise",null),h(this,"config"),h(this,"perspectives"),h(this,"storyboard"),h(this,"history"),h(this,"linkedViews"),h(this,"ink"),h(this,"measure"),h(this,"contextMenu"),h(this,"weave"),h(this,"renderer"),h(this,"rendererController"),this.opts=e,this.ctx=this,this.w=new E(e).init(),this.el=t,this.w.globals.cuid=b.randomId(),this.w.globals.chartID=this.w.config.chart.id?b.escapeString(this.w.config.chart.id):this.w.globals.cuid,lt(this.w);new ms(this).initModules(),this.lastUpdateOptions=null,this.create=this.create.bind(this),c.isBrowser()&&(this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this))}render(){var t,e;if(!(null==(e=null==(t=this.w)?void 0:t.config)?void 0:e.chart))return Promise.reject(new Error("ApexCharts: chart configuration is missing or invalid. Ensure the options object includes a `chart` property."));if(this._renderPromise)return this._renderPromise;const s=new Promise((t,e)=>{var s;if(b.elementExists(this.el)){void 0===Apex._chartInstances&&(Apex._chartInstances=[]),this.w.config.chart.id&&Apex._chartInstances.push({id:this.w.globals.chartID,group:this.w.config.chart.group,chart:this}),this.setLocale(this.w.config.chart.defaultLocale);const i=this.w.config.chart.events.beforeMount;if("function"==typeof i&&i(this,this.w),this.events.fireEvent("beforeMount",[this,this.w]),c.isBrowser()){window.addEventListener("resize",this.windowResizeHandler),function(t,e){if(c.isSSR())return;let s=!1;if(t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){const e=t.getBoundingClientRect();"none"!==t.style.display&&0!==e.width||(s=!0)}const i=new ResizeObserver(i=>{s&&e.call(t,i),s=!0});t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(t.children).forEach(t=>i.observe(t)):i.observe(t),vs.set(e,i)}(this.el.parentNode,this.parentResizeHandler);const t=this.el.getRootNode&&this.el.getRootNode(),e=b.is("ShadowRoot",t),i=this.el.ownerDocument;let a=e?t.getElementById("apexcharts-css"):i.getElementById("apexcharts-css");if(!a){a=m.createElementNS("http://www.w3.org/1999/xhtml","style"),a.id="apexcharts-css",a.textContent='@keyframes opaque {\n 0% {\n opacity: 0\n }\n\n to {\n opacity: 1\n }\n}\n\n@keyframes resizeanim {\n\n 0%,\n to {\n opacity: 0\n }\n}\n\n.apexcharts-canvas {\n position: relative;\n direction: ltr !important;\n user-select: none;\n /* Focus indicator colour. Themes override below. */\n --apexcharts-focus-color: #008FFB;\n}\n\n/* Dark theme & high-contrast: brighter focus colour for sufficient contrast. */\n.apexcharts-canvas .apexcharts-theme-dark,\n.apexcharts-theme-dark.apexcharts-canvas {\n --apexcharts-focus-color: #FFD500;\n}\n.apexcharts-canvas.apexcharts-high-contrast,\n.apexcharts-high-contrast.apexcharts-canvas {\n --apexcharts-focus-color: #FFFF00;\n}\n\n/* Visually-hidden aria-live status region (WCAG 4.1.3 Status Messages). */\n.apexcharts-sr-status {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Respect OS-level reduced-motion preference (WCAG 2.3.3). */\n@media (prefers-reduced-motion: reduce) {\n .apexcharts-canvas *,\n .apexcharts-canvas *::before,\n .apexcharts-canvas *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n }\n}\n\n.apexcharts-canvas ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 6px\n}\n\n.apexcharts-canvas ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(0, 0, 0, .5);\n box-shadow: 0 0 1px rgba(255, 255, 255, .5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, .5)\n}\n\n.apexcharts-inner {\n position: relative\n}\n\n.apexcharts-text tspan {\n font-family: inherit\n}\n\nrect.legend-mouseover-inactive,\n.legend-mouseover-inactive rect,\n.legend-mouseover-inactive path,\n.legend-mouseover-inactive circle,\n.legend-mouseover-inactive line,\n.legend-mouseover-inactive text.apexcharts-yaxis-title-text,\n.legend-mouseover-inactive text.apexcharts-yaxis-label {\n transition: .15s ease all;\n opacity: .2\n}\n\n/* Linked Views (#4): per-mark crossfilter dim. Applied to individual data\n marks (not whole series) whose x is outside the brushed range. Opacity is\n overridable per chart via the --apx-cf-dim custom property. */\n.apexcharts-crossfilter-dimmed {\n transition: opacity .25s ease;\n opacity: var(--apx-cf-dim, .2)\n}\n\n/* Linked Views (#4): default styling for the built-in crossfilter data table\n (cf.dataTable). Deliberately light so host styles can override. */\n.apexcharts-cf-table {\n border-collapse: collapse;\n width: 100%;\n font-size: 13px;\n}\n.apexcharts-cf-table caption {\n caption-side: bottom;\n text-align: right;\n padding: 6px 2px;\n font-size: 12px;\n opacity: .7\n}\n.apexcharts-cf-table th,\n.apexcharts-cf-table td {\n padding: 6px 10px;\n text-align: left;\n border-bottom: 1px solid rgba(0, 0, 0, .08)\n}\n.apexcharts-cf-table th {\n font-weight: 600;\n border-bottom-width: 2px\n}\n.apexcharts-cf-table tbody tr:hover {\n background: rgba(99, 102, 241, .06)\n}\n\n/* Measure ruler (#18): measure / delta ruler.\n Theme via these classes or the --apx-measure-* custom properties below\n (config `chart.measure.colors` overrides both). The ruler group also carries\n a direction class: apexcharts-measure-up | -down | -flat.\n Element classes:\n .apexcharts-measure-band shaded span band\n .apexcharts-measure-vline vertical guide lines\n .apexcharts-measure-line free-mode diagonal line\n .apexcharts-measure-label-bg readout box .apexcharts-measure-label text\n Colors are applied as SVG presentation attributes, so any rule you write on\n these classes overrides them. */\n.apexcharts-canvas {\n --apx-measure-up: #16a34a;\n --apx-measure-down: #dc2626;\n --apx-measure-neutral: #64748b;\n --apx-measure-guide: #94a3b8;\n}\n.apexcharts-measure-capture {\n cursor: crosshair;\n}\n\n/* Radial Actions (#chrome): right-click context menu. Theme via these classes\n or the --apx-menu-* custom properties. */\n.apexcharts-canvas {\n --apx-menu-bg: #ffffff;\n --apx-menu-fg: #1e293b;\n --apx-menu-border: #e2e8f0;\n --apx-menu-hover: #f1f5f9;\n --apx-menu-shadow: rgba(15, 23, 42, 0.18);\n}\n.apexcharts-context-menu {\n min-width: 168px;\n padding: 4px;\n border-radius: 8px;\n background: var(--apx-menu-bg);\n border: 1px solid var(--apx-menu-border);\n box-shadow: 0 6px 22px var(--apx-menu-shadow);\n font-family: Helvetica, Arial, sans-serif;\n font-size: 13px;\n z-index: 20;\n user-select: none;\n}\n.apexcharts-context-menu-item {\n display: block;\n width: 100%;\n box-sizing: border-box;\n text-align: left;\n padding: 7px 12px;\n border: 0;\n border-radius: 5px;\n background: transparent;\n color: var(--apx-menu-fg);\n font: inherit;\n cursor: pointer;\n}\n.apexcharts-context-menu-item:hover,\n.apexcharts-context-menu-item--active {\n background: var(--apx-menu-hover);\n}\n.apexcharts-context-menu-item:focus {\n outline: none;\n}\n\n/* Ink Layer (#7): the floating note editor card, opened by clicking an\n ink-managed annotation. Theme via these classes or the --apx-ink-* vars. */\n.apexcharts-canvas {\n --apx-ink-card-bg: #ffffff;\n --apx-ink-card-fg: #1e293b;\n --apx-ink-card-border: #e2e8f0;\n --apx-ink-card-hover: #f1f5f9;\n --apx-ink-card-accent: #6366f1;\n --apx-ink-card-shadow: rgba(15, 23, 42, 0.18);\n}\n.apexcharts-ink-card {\n position: absolute;\n z-index: 25;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px;\n border-radius: 8px;\n background: var(--apx-ink-card-bg);\n border: 1px solid var(--apx-ink-card-border);\n box-shadow: 0 6px 22px var(--apx-ink-card-shadow);\n font-family: Helvetica, Arial, sans-serif;\n font-size: 12px;\n color: var(--apx-ink-card-fg);\n user-select: none;\n}\n.apexcharts-ink-card-row {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n.apexcharts-ink-card input.apexcharts-ink-editor {\n flex: 1 1 auto;\n width: 150px;\n min-width: 0;\n box-sizing: border-box;\n padding: 4px 6px;\n font: inherit;\n color: inherit;\n background: transparent;\n border: 1px solid var(--apx-ink-card-border);\n border-radius: 5px;\n}\n.apexcharts-ink-card input.apexcharts-ink-editor:focus {\n outline: none;\n border-color: var(--apx-ink-card-accent);\n}\n.apexcharts-ink-btn {\n flex: 0 0 auto;\n width: 24px;\n height: 24px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: 0;\n border-radius: 5px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 12px;\n line-height: 1;\n cursor: pointer;\n}\n.apexcharts-ink-btn:hover,\n.apexcharts-ink-btn--active {\n background: var(--apx-ink-card-hover);\n}\n.apexcharts-ink-btn:focus-visible,\n.apexcharts-ink-swatch:focus-visible {\n outline: 2px solid var(--apx-ink-card-accent);\n outline-offset: 1px;\n}\n.apexcharts-ink-btn--bold {\n font-weight: 700;\n}\n.apexcharts-ink-btn--delete:hover {\n color: #dc2626;\n}\n.apexcharts-ink-swatch {\n flex: 0 0 auto;\n width: 16px;\n height: 16px;\n padding: 0;\n border: 1px solid rgba(100, 116, 139, 0.45);\n border-radius: 50%;\n cursor: pointer;\n}\n.apexcharts-ink-swatch--active {\n box-shadow:\n 0 0 0 2px var(--apx-ink-card-bg),\n 0 0 0 4px var(--apx-ink-card-accent);\n}\n.apexcharts-ink-sep {\n flex: 0 0 auto;\n width: 1px;\n height: 16px;\n margin: 0 2px;\n background: var(--apx-ink-card-border);\n}\n.apexcharts-ink-cardlabel {\n flex: 0 0 auto;\n font-size: 10px;\n letter-spacing: 0.4px;\n text-transform: uppercase;\n opacity: 0.65;\n margin-right: 2px;\n}\n.apexcharts-ink-marker-size {\n flex: 0 0 auto;\n min-width: 16px;\n text-align: center;\n font-variant-numeric: tabular-nums;\n}\n\n.apexcharts-legend-text {\n padding-left: 15px;\n margin-left: -15px;\n}\n\n.apexcharts-legend-series[role="button"]:focus {\n outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n outline-offset: 2px;\n}\n\n.apexcharts-legend-series[role="button"]:focus:not(:focus-visible) {\n outline: none;\n}\n\n.apexcharts-legend-series[role="button"]:focus-visible {\n outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n outline-offset: 2px;\n}\n\n.apexcharts-series-collapsed {\n opacity: 0\n}\n\n.apexcharts-canvas svg:focus:not(:focus-visible) {\n outline: none;\n}\n\n/* Keyboard navigation focus indicator on SVG data elements.\n SVG elements don\'t support CSS outline, so we use stroke. */\n.apexcharts-bar-area.apexcharts-keyboard-focused,\n.apexcharts-candlestick-area.apexcharts-keyboard-focused,\n.apexcharts-boxPlot-area.apexcharts-keyboard-focused,\n.apexcharts-rangebar-area.apexcharts-keyboard-focused,\n.apexcharts-pie-area.apexcharts-keyboard-focused,\n.apexcharts-heatmap-rect.apexcharts-keyboard-focused,\n.apexcharts-treemap-rect.apexcharts-keyboard-focused {\n stroke: var(--apexcharts-focus-color, #008FFB);\n stroke-width: 2;\n stroke-opacity: 1;\n}\n\n.apexcharts-tooltip {\n --apx-tt-bg: #ffffff;\n --apx-tt-border: rgba(15, 23, 42, 0.06);\n /* Layered shadow: tight inner contact + soft outer drop. The two Y\n * offsets are exposed as variables so they flip in sync with the\n * arrow when the tooltip is below the data point \u2014 see the\n * `[data-placement="bottom"]` rule further down. */\n --apx-tt-shadow-y-mid: 8px;\n --apx-tt-shadow-y-far: 16px;\n --apx-tt-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04), 0 var(--apx-tt-shadow-y-mid) 16px -6px rgba(15, 23, 42, 0.12), 0 var(--apx-tt-shadow-y-far) 36px -12px rgba(15, 23, 42, 0.18);\n --apx-tt-arrow-bg: var(--apx-tt-bg);\n /* Two stacked drop-shadows: the first is a tight contact halo for\n * edge definition against light chart backgrounds; the second is a\n * softer directional drop that lifts the arrow off the surface.\n * `--apx-tt-arrow-drop-y` is the Y offset of the directional drop;\n * a per-placement rule below flips it to negative when the tooltip\n * is below the data point (arrow on top) so the shadow always\n * casts outward instead of into the tooltip body. */\n --apx-tt-arrow-drop-y: 2px;\n --apx-tt-arrow-shadow: drop-shadow(0 0 0.5px rgba(15, 23, 42, 0.2)) drop-shadow(0 var(--apx-tt-arrow-drop-y) 4px rgba(15, 23, 42, 0.2));\n --apx-tt-color: #0f172a;\n --apx-tt-color-muted: rgba(15, 23, 42, 0.55);\n border-radius: 8px;\n background: var(--apx-tt-bg);\n border: 1px solid var(--apx-tt-border);\n box-shadow: var(--apx-tt-shadow);\n color: var(--apx-tt-color);\n cursor: default;\n font-size: 13px;\n left: 0;\n top: 0;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n display: flex;\n flex-direction: column;\n padding: 2px 0;\n white-space: nowrap;\n z-index: 12;\n transition: opacity .12s ease\n}\n\n/* While the tooltip is visible, smoothly animate position changes\n * between data points. Kept short (160 ms) and ease-out so it stays\n * responsive \u2014 too long would feel laggy when sweeping across many\n * points fast. The position transition is only attached after the\n * first paint (Position.applyTooltipPosition flips `data-positioned`\n * once the tooltip has been placed) so the *first* show doesn\'t slide\n * the tooltip in from the previously-stale (0,0) coordinates. */\n.apexcharts-tooltip.apexcharts-active {\n opacity: 1;\n transition: opacity .12s ease\n}\n.apexcharts-tooltip.apexcharts-active[data-positioned="true"] {\n transition: opacity .12s ease, left .16s ease-out, top .16s ease-out\n}\n\n.apexcharts-tooltip.apexcharts-theme-light {\n /* defaults already set above; class kept for backward-compat selectors */\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark {\n --apx-tt-bg: #1c1c1f;\n --apx-tt-border: rgba(255, 255, 255, 0.08);\n --apx-tt-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 var(--apx-tt-shadow-y-mid) 16px -6px rgba(0, 0, 0, 0.45), 0 var(--apx-tt-shadow-y-far) 36px -12px rgba(0, 0, 0, 0.55);\n --apx-tt-arrow-shadow: drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.55)) drop-shadow(0 var(--apx-tt-arrow-drop-y) 4px rgba(0, 0, 0, 0.45));\n --apx-tt-color: #f3f4f6;\n --apx-tt-color-muted: rgba(243, 244, 246, 0.55);\n}\n\n.apexcharts-tooltip * {\n font-family: inherit\n}\n\n.apexcharts-tooltip-title {\n padding: 8px 12px 4px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.01em;\n color: var(--apx-tt-color-muted);\n background: transparent;\n border-bottom: none;\n margin-bottom: 0\n}\n\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title,\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\n background: transparent;\n border-bottom: none\n}\n\n/* `fillSeriesColor`: each series-group already paints itself with the\n * series colour. Drop the glass body entirely (transparent bg, no\n * border, no backdrop-filter, no padding) and clip the coloured\n * series-group(s) to the tooltip\'s rounded corners so they fill the\n * shell edge-to-edge. Text inside the coloured group is forced to\n * white for contrast. */\n.apexcharts-tooltip.apexcharts-tooltip-fill-series {\n background: transparent;\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n border: none;\n padding: 0;\n overflow: hidden;\n color: #fff\n}\n\n.apexcharts-tooltip.apexcharts-tooltip-fill-series .apexcharts-tooltip-title {\n background: rgba(0, 0, 0, 0.22);\n color: #fff;\n opacity: 1;\n padding: 6px 12px\n}\n\n.apexcharts-tooltip.apexcharts-tooltip-fill-series .apexcharts-tooltip-series-group {\n color: #fff\n}\n\n/* Arrow connector \u2014 sits *entirely outside* the tooltip body. Shares\n * the body\'s solid fill so it reads as a single shape. `filter:\n * drop-shadow` traces the clipped triangle outline (a regular\n * `box-shadow` would be erased by the `clip-path`). */\n.apexcharts-tooltip-arrow {\n position: absolute;\n width: 7px;\n height: 14px;\n background: var(--apx-tt-arrow-bg);\n /* The variable already contains the full `drop-shadow(...) ...` filter\n * chain (stacked shadows) so it\'s applied raw. */\n -webkit-filter: var(--apx-tt-arrow-shadow);\n filter: var(--apx-tt-arrow-shadow);\n pointer-events: none;\n top: calc(var(--apx-tt-arrow-y, 50%) - 7px)\n}\n\n.apexcharts-tooltip[data-placement="right"] .apexcharts-tooltip-arrow {\n left: -7px;\n clip-path: polygon(0 50%, 100% 0, 100% 100%)\n}\n\n.apexcharts-tooltip[data-placement="left"] .apexcharts-tooltip-arrow {\n right: -7px;\n clip-path: polygon(100% 50%, 0 0, 0 100%)\n}\n\n/* Vertical arrow variants: tooltip is above/below the data point and the\n * arrow points down/up. The base rule above uses `--apx-tt-arrow-y` for\n * left/right placement; for top/bottom we re-orient the rectangle and\n * use `--apx-tt-arrow-x` (set by applyTooltipPosition). */\n.apexcharts-tooltip[data-placement="top"] .apexcharts-tooltip-arrow,\n.apexcharts-tooltip[data-placement="bottom"] .apexcharts-tooltip-arrow {\n width: 14px;\n height: 7px;\n top: auto;\n left: calc(var(--apx-tt-arrow-x, 50%) - 7px)\n}\n\n.apexcharts-tooltip[data-placement="top"] .apexcharts-tooltip-arrow {\n bottom: -7px;\n clip-path: polygon(50% 100%, 0 0, 100% 0)\n}\n\n.apexcharts-tooltip[data-placement="bottom"] .apexcharts-tooltip-arrow {\n top: -7px;\n clip-path: polygon(50% 0, 0 100%, 100% 100%)\n}\n\n/* When the tooltip is flipped below the data point (arrow on top\n * pointing up), the default downward-biased shadows leave the top\n * edge of both the body *and* the arrow undefined. Flipping every\n * Y offset to negative casts the entire elevation upward so the\n * shadow falls between the tooltip and the bar above. */\n.apexcharts-tooltip[data-placement="bottom"] {\n --apx-tt-shadow-y-mid: -8px;\n --apx-tt-shadow-y-far: -16px;\n --apx-tt-arrow-drop-y: -2px\n}\n\n.apexcharts-tooltip-text-goals-value,\n.apexcharts-tooltip-text-y-value,\n.apexcharts-tooltip-text-z-value {\n display: inline-block;\n margin-left: 5px;\n font-weight: 600\n}\n\n.apexcharts-tooltip-text-goals-label:empty,\n.apexcharts-tooltip-text-goals-value:empty,\n.apexcharts-tooltip-text-y-label:empty,\n.apexcharts-tooltip-text-y-value:empty,\n.apexcharts-tooltip-text-z-value:empty,\n.apexcharts-tooltip-title:empty {\n display: none\n}\n\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n padding: 6px 0 5px\n}\n\n.apexcharts-tooltip-goals-group,\n.apexcharts-tooltip-text-goals-label,\n.apexcharts-tooltip-text-goals-value {\n display: flex\n}\n\n.apexcharts-tooltip-text-goals-label:not(:empty),\n.apexcharts-tooltip-text-goals-value:not(:empty) {\n margin-top: -6px\n}\n\n.apexcharts-tooltip-marker {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n width: 12px;\n height: 12px;\n margin-right: 6px;\n vertical-align: middle;\n color: inherit;\n}\n\n.apexcharts-tooltip-marker svg {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n.apexcharts-tooltip-series-group {\n padding: 4px 12px;\n display: none;\n gap: 8px;\n text-align: left;\n justify-content: left;\n align-items: center\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active .apexcharts-tooltip-marker {\n opacity: 1\n}\n\n.apexcharts-tooltip-series-group.apexcharts-active:last-child,\n.apexcharts-tooltip-series-group:last-child {\n padding-bottom: 8px\n}\n\n.apexcharts-tooltip-y-group {\n padding: 6px 0 5px\n}\n\n.apexcharts-custom-tooltip,\n.apexcharts-tooltip-box {\n padding: 4px 8px\n}\n\n.apexcharts-tooltip-boxPlot {\n display: flex;\n flex-direction: column-reverse\n}\n\n.apexcharts-tooltip-box>div {\n margin: 4px 0\n}\n\n.apexcharts-tooltip-box span.value {\n font-weight: 700\n}\n\n.apexcharts-tooltip-rangebar {\n padding: 5px 8px\n}\n\n.apexcharts-tooltip-rangebar .category {\n font-weight: 600;\n color: #777\n}\n\n.apexcharts-tooltip-rangebar .series-name {\n font-weight: 700;\n display: block;\n margin-bottom: 5px\n}\n\n/* X/Y axis tooltips \u2014 small popovers that label the crosshair on the\n * axes. Restyled to match the modern data-tooltip palette: solid white\n * body with a subtle border + soft drop-shadow, smaller font, rounded\n * corners. The arrows still use the CSS border-triangle technique\n * (cheap, crisp at small sizes); their colours flow from CSS variables\n * so light/dark themes only need one override per axis. */\n.apexcharts-xaxistooltip,\n.apexcharts-yaxistooltip {\n --apx-axt-bg: #ffffff;\n --apx-axt-border: rgba(15, 23, 42, 0.08);\n --apx-axt-color: #0f172a;\n --apx-axt-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.18), 0 1px 3px -1px rgba(15, 23, 42, 0.12);\n opacity: 0;\n pointer-events: none;\n color: var(--apx-axt-color);\n font-size: 12px;\n font-weight: 500;\n text-align: center;\n border-radius: 6px;\n position: absolute;\n z-index: 10;\n background: var(--apx-axt-bg);\n border: 1px solid var(--apx-axt-border);\n box-shadow: var(--apx-axt-shadow)\n}\n\n.apexcharts-xaxistooltip.apexcharts-theme-dark,\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\n --apx-axt-bg: #1c1c1f;\n --apx-axt-border: rgba(255, 255, 255, 0.1);\n --apx-axt-color: #f3f4f6;\n --apx-axt-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.55), 0 1px 3px -1px rgba(0, 0, 0, 0.45)\n}\n\n.apexcharts-xaxistooltip {\n padding: 4px 8px;\n transition: .15s ease all\n}\n\n.apexcharts-xaxistooltip:after,\n.apexcharts-xaxistooltip:before {\n left: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none\n}\n\n/* :before paints the 1px border outline of the triangle (slightly larger\n * than :after); :after sits inside and paints the fill \u2014 leaves a 1px\n * ring of :before visible at the edges. */\n.apexcharts-xaxistooltip:after {\n border-color: transparent;\n border-width: 5px;\n margin-left: -5px\n}\n\n.apexcharts-xaxistooltip:before {\n border-color: transparent;\n border-width: 6px;\n margin-left: -6px\n}\n\n.apexcharts-xaxistooltip-bottom:after,\n.apexcharts-xaxistooltip-bottom:before {\n bottom: 100%\n}\n\n.apexcharts-xaxistooltip-top:after,\n.apexcharts-xaxistooltip-top:before {\n top: 100%\n}\n\n.apexcharts-xaxistooltip-bottom:after {\n border-bottom-color: var(--apx-axt-bg)\n}\n\n.apexcharts-xaxistooltip-bottom:before {\n border-bottom-color: var(--apx-axt-border)\n}\n\n.apexcharts-xaxistooltip-top:after {\n border-top-color: var(--apx-axt-bg)\n}\n\n.apexcharts-xaxistooltip-top:before {\n border-top-color: var(--apx-axt-border)\n}\n\n.apexcharts-xaxistooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-yaxistooltip {\n padding: 3px 8px\n}\n\n.apexcharts-yaxistooltip:after,\n.apexcharts-yaxistooltip:before {\n top: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none\n}\n\n.apexcharts-yaxistooltip:after {\n border-color: transparent;\n border-width: 5px;\n margin-top: -5px\n}\n\n.apexcharts-yaxistooltip:before {\n border-color: transparent;\n border-width: 6px;\n margin-top: -6px\n}\n\n.apexcharts-yaxistooltip-left:after,\n.apexcharts-yaxistooltip-left:before {\n left: 100%\n}\n\n.apexcharts-yaxistooltip-right:after,\n.apexcharts-yaxistooltip-right:before {\n right: 100%\n}\n\n.apexcharts-yaxistooltip-left:after {\n border-left-color: var(--apx-axt-bg)\n}\n\n.apexcharts-yaxistooltip-left:before {\n border-left-color: var(--apx-axt-border)\n}\n\n.apexcharts-yaxistooltip-right:after {\n border-right-color: var(--apx-axt-bg)\n}\n\n.apexcharts-yaxistooltip-right:before {\n border-right-color: var(--apx-axt-border)\n}\n\n.apexcharts-yaxistooltip.apexcharts-active {\n opacity: 1\n}\n\n.apexcharts-yaxistooltip-hidden {\n display: none\n}\n\n.apexcharts-xcrosshairs,\n.apexcharts-ycrosshairs {\n pointer-events: none;\n opacity: 0;\n transition: .15s ease all\n}\n\n.apexcharts-xcrosshairs.apexcharts-active,\n.apexcharts-ycrosshairs.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-ycrosshairs-hidden {\n opacity: 0\n}\n\n.apexcharts-selection-rect {\n cursor: move\n}\n\n.svg_select_shape {\n stroke-width: 1;\n stroke-dasharray: 10 10;\n stroke: black;\n stroke-opacity: 0.1;\n pointer-events: none;\n fill: none;\n}\n\n.svg_select_handle {\n stroke-width: 3;\n stroke: black;\n fill: none;\n}\n\n.svg_select_handle_r {\n cursor: e-resize;\n}\n\n.svg_select_handle_l {\n cursor: w-resize;\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-zoom {\n cursor: crosshair\n}\n\n.apexcharts-svg.apexcharts-zoomable.hovering-pan {\n cursor: move\n}\n\n.apexcharts-menu-icon,\n.apexcharts-measure-icon,\n.apexcharts-pan-icon,\n.apexcharts-reset-icon,\n.apexcharts-selection-icon,\n.apexcharts-toolbar-custom-icon,\n.apexcharts-zoom-icon,\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n cursor: pointer;\n /* WCAG 2.5.8 Target Size (Minimum): 24\xd724 CSS px hit target. */\n width: 26px;\n height: 24px;\n line-height: 24px;\n color: #6e8192;\n text-align: center;\n /* Reset native <button> chrome \u2014 these are styled via SVG icons. */\n padding: 0;\n margin: 0;\n background: transparent;\n border: 0;\n border-radius: 5px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: background-color .12s ease, color .12s ease;\n}\n\n.apexcharts-menu-icon svg,\n.apexcharts-measure-icon svg,\n.apexcharts-pan-icon svg,\n.apexcharts-reset-icon svg,\n.apexcharts-selection-icon svg,\n.apexcharts-zoom-icon svg,\n.apexcharts-zoomin-icon svg,\n.apexcharts-zoomout-icon svg {\n width: 18px;\n height: 18px;\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon,\n.apexcharts-theme-dark .apexcharts-measure-icon,\n.apexcharts-theme-dark .apexcharts-pan-icon,\n.apexcharts-theme-dark .apexcharts-reset-icon,\n.apexcharts-theme-dark .apexcharts-selection-icon,\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon,\n.apexcharts-theme-dark .apexcharts-zoom-icon,\n.apexcharts-theme-dark .apexcharts-zoomin-icon,\n.apexcharts-theme-dark .apexcharts-zoomout-icon {\n color: #d4d6dc\n}\n\n.apexcharts-canvas .apexcharts-measure-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-pan-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected,\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected {\n background: rgba(0, 143, 251, 0.12);\n color: #008ffb\n}\n\n.apexcharts-theme-light .apexcharts-menu-icon:hover,\n.apexcharts-theme-light .apexcharts-measure-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-pan-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-reset-icon:hover,\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover,\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover {\n background: rgba(15, 23, 42, 0.06);\n color: #1f2937\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon:hover,\n.apexcharts-theme-dark .apexcharts-measure-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-pan-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-reset-icon:hover,\n.apexcharts-theme-dark .apexcharts-selection-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-zoom-icon:not(.apexcharts-selected):hover,\n.apexcharts-theme-dark .apexcharts-zoomin-icon:hover,\n.apexcharts-theme-dark .apexcharts-zoomout-icon:hover {\n background: rgba(255, 255, 255, 0.08);\n color: #fff\n}\n\n.apexcharts-menu-icon,\n.apexcharts-selection-icon {\n position: relative\n}\n\n.apexcharts-toolbar {\n position: absolute;\n z-index: 11;\n display: inline-flex;\n align-items: center;\n gap: 1px;\n padding: 3px;\n border-radius: 8px;\n background: rgba(255, 255, 255, 0.85);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n}\n\n.apexcharts-theme-dark .apexcharts-toolbar {\n background: rgba(28, 28, 31, 0.82);\n}\n\n.apexcharts-menu {\n background: rgba(255, 255, 255, 0.95);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n position: absolute;\n top: calc(100% + 4px);\n border: 1px solid rgba(15, 23, 42, 0.08);\n border-radius: 8px;\n padding: 4px;\n right: 0;\n opacity: 0;\n min-width: 120px;\n transition: opacity .15s ease, transform .15s ease;\n transform: translateY(-2px);\n pointer-events: none;\n box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.12), 0 2px 4px -1px rgba(15, 23, 42, 0.06)\n}\n\n.apexcharts-menu.apexcharts-menu-open {\n opacity: 1;\n transform: translateY(0);\n pointer-events: all\n}\n\n.apexcharts-menu-item {\n padding: 6px 9px;\n font-size: 12px;\n border-radius: 5px;\n cursor: pointer\n}\n\n.apexcharts-theme-light .apexcharts-menu-item:hover {\n background: rgba(15, 23, 42, 0.06)\n}\n\n.apexcharts-theme-dark .apexcharts-menu {\n background: rgba(28, 28, 31, 0.92);\n border-color: rgba(255, 255, 255, 0.08);\n color: #f3f4f6;\n box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4)\n}\n\n.apexcharts-theme-dark .apexcharts-menu-item:hover {\n background: rgba(255, 255, 255, 0.08)\n}\n\n@media screen and (min-width:768px) {\n .apexcharts-canvas:hover .apexcharts-toolbar {\n opacity: 1\n }\n}\n\n/* Toolbar keyboard accessibility: show toolbar when any button inside it is focused */\n.apexcharts-toolbar:focus-within {\n opacity: 1\n}\n\n/* Focus indicator for toolbar icon buttons */\n.apexcharts-menu-icon:focus-visible,\n.apexcharts-measure-icon:focus-visible,\n.apexcharts-pan-icon:focus-visible,\n.apexcharts-reset-icon:focus-visible,\n.apexcharts-selection-icon:focus-visible,\n.apexcharts-toolbar-custom-icon:focus-visible,\n.apexcharts-zoom-icon:focus-visible,\n.apexcharts-zoomin-icon:focus-visible,\n.apexcharts-zoomout-icon:focus-visible {\n outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n outline-offset: 1px;\n border-radius: 5px\n}\n\n/* Focus indicator for hamburger menu items */\n.apexcharts-menu-item:focus-visible {\n outline: 2px solid var(--apexcharts-focus-color, #008FFB);\n outline-offset: -2px;\n background: #eee\n}\n\n.apexcharts-canvas .apexcharts-element-hidden,\n.apexcharts-datalabel.apexcharts-element-hidden,\n.apexcharts-hide .apexcharts-series-points {\n opacity: 0;\n}\n\n.apexcharts-hidden-element-shown {\n opacity: 1;\n transition: 0.25s ease all;\n}\n\n.apexcharts-datalabel,\n.apexcharts-datalabel-label,\n.apexcharts-datalabel-value,\n.apexcharts-datalabels,\n.apexcharts-pie-label,\n.apexcharts-pie-name-label,\n.apexcharts-pie-name-label-group,\n.apexcharts-pie-label-connector {\n cursor: default;\n pointer-events: none\n}\n\n.apexcharts-pie-label-connector {\n fill: none\n}\n\n.apexcharts-pie-label-delay {\n opacity: 0;\n animation-name: opaque;\n animation-duration: .3s;\n animation-fill-mode: forwards;\n animation-timing-function: ease\n}\n\n.apexcharts-radialbar-label {\n cursor: pointer;\n}\n\n.apexcharts-annotation-rect,\n.apexcharts-area-series .apexcharts-area,\n.apexcharts-gridline,\n.apexcharts-line,\n.apexcharts-point-annotation-label,\n.apexcharts-radar-series path:not(.apexcharts-marker),\n.apexcharts-radar-series polygon,\n.apexcharts-toolbar svg,\n.apexcharts-tooltip .apexcharts-marker,\n.apexcharts-xaxis-annotation-label,\n.apexcharts-yaxis-annotation-label,\n.apexcharts-zoom-rect,\n.no-pointer-events {\n pointer-events: none\n}\n\n.apexcharts-tooltip-active .apexcharts-marker {\n transition: .15s ease all\n}\n\n.apexcharts-radar-series .apexcharts-yaxis {\n pointer-events: none;\n}\n\n.resize-triggers {\n animation: 1ms resizeanim;\n visibility: hidden;\n opacity: 0;\n height: 100%;\n width: 100%;\n overflow: hidden\n}\n\n.contract-trigger:before,\n.resize-triggers,\n.resize-triggers>div {\n content: " ";\n display: block;\n position: absolute;\n top: 0;\n left: 0\n}\n\n.resize-triggers>div {\n height: 100%;\n width: 100%;\n background: #eee;\n overflow: auto\n}\n\n.contract-trigger:before {\n overflow: hidden;\n width: 200%;\n height: 200%\n}\n\n.apexcharts-bar-goals-markers {\n pointer-events: none\n}\n\n.apexcharts-bar-shadows {\n pointer-events: none\n}\n\n.apexcharts-rangebar-goals-markers {\n pointer-events: none\n}\n\n.apexcharts-drilldown-target {\n cursor: pointer\n}\n\n.apexcharts-breadcrumb {\n position: absolute;\n z-index: 11;\n display: inline-flex;\n align-items: center;\n gap: 2px;\n font-size: 12px;\n font-family: inherit;\n padding: 2px 4px\n}\n\n.apexcharts-breadcrumb-item {\n background: transparent;\n border: none;\n padding: 2px 6px;\n border-radius: 3px;\n font: inherit;\n color: inherit;\n cursor: pointer;\n line-height: 1.2\n}\n\n.apexcharts-breadcrumb-item:hover:not(.apexcharts-breadcrumb-current) {\n background: rgba(0, 0, 0, 0.08)\n}\n\n.apexcharts-breadcrumb-arrow {\n margin-right: 4px;\n font-weight: 600;\n user-select: none\n}\n\n.apexcharts-breadcrumb-current {\n cursor: default;\n font-weight: 600;\n opacity: 0.85\n}\n\n.apexcharts-breadcrumb-separator {\n opacity: 0.5;\n user-select: none\n}\n\n.apexcharts-theme-dark .apexcharts-breadcrumb-item:hover:not(.apexcharts-breadcrumb-current) {\n background: rgba(255, 255, 255, 0.12)\n}\n\n.apexcharts-disable-transitions * {\n transition: none !important;\n}';const r=(null==(s=this.opts.chart)?void 0:s.nonce)||this.w.config.chart.nonce;r&&a.setAttribute("nonce",r),e?t.prepend(a):!1!==this.w.config.chart.injectStyleSheet&&i.head.appendChild(a)}}const a=this.create(this.w.config.series,{});if(!a)return t(this);this.mount(a).then(()=>{"function"==typeof this.w.config.chart.events.mounted&&this.w.config.chart.events.mounted(this,this.w),this.events.fireEvent("mounted",[this,this.w]),t(a)}).catch(t=>{var s,i;const a=t instanceof Error?t:new Error(String(t)),r=a;r.chartId=null==(i=null==(s=this.w)?void 0:s.globals)?void 0:i.chartID,r.el=this.el,e(a)})}else e(new Error("Element not found"))});return this._renderPromise=s,s.catch(()=>{this._renderPromise===s&&(this._renderPromise=null)}),s}create(t,e){var s,i,a,r,o,n;const l=this.w;if(!this.core){new ms(this).initModules()}const h=this.w.globals;if(h.noData=!1,h.animationEnded=!1,!b.elementExists(this.el))return h.animationEnded=!0,null;if(this.responsive.checkResponsiveConfig(e),lt(l),l.config.xaxis.convertedCatToNumeric){new C(l.config).convertCatToNumericXaxis(l.config,this.ctx)}if(this.core.setupElements(),"treemap"===l.config.chart.type&&(l.config.grid.show=!1,l.config.yaxis[0].show=!1),0===h.svgWidth)return h.animationEnded=!0,null;let d=t;t.forEach((t,e)=>{t.hidden&&(d=this.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:e}))});const g=P.checkComboSeries(d,l.config.chart.type);h.comboCharts=g.comboCharts,h.comboBarCount=g.comboBarCount;const p=d.every(t=>t.data&&0===t.data.length);(0===d.length||p&&h.collapsedSeries.length<1)&&this.series.handleNoData(),c.isBrowser()&&this.events.setupEventHandlers();const u=this.data.parseData(d);this._writeParsedSeriesData(u.seriesData),this._writeParsedRangeData(u.rangeData),this._writeParsedCandleData(u.candleData),this._writeParsedLabelData(u.labelData),this._writeParsedAxisFlags(u.axisFlags),null==(s=this.rendererController)||s.resolve(),null==(i=this.weave)||i.dispatch("afterParse"),this.theme.init();new mt(this.w,this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),h.noData&&h.collapsedSeries.length!==l.seriesData.series.length&&!l.config.legend.showForSingleSeries||null==(a=this.legend)||a.init(),this.series.hasAllSeriesEqualX(),h.axisCharts&&(this.core.coreCalculations(),"category"!==l.config.xaxis.type&&this.formatters.setLabelFormatters(),this.ctx.toolbar&&(this.ctx.toolbar.minX=l.globals.minX,this.ctx.toolbar.maxX=l.globals.maxX)),this.formatters.heatmapLabelFormatters();new P(this.w).getLargestMarkerSize();const x=this.dimensions.plotCoords();this._writeLayoutCoords(x.layout);const f=this.core.xySettings();null==(r=this.weave)||r.dispatch("afterScales",{xyRatios:f}),this.grid.createGridMask();const m=this.core.plotChartType(d,f),y=new yt(this.w,this);y.bringForward(),l.config.dataLabels.background.enabled&&y.dataLabelsBackground(),this.core.shiftGraphPosition(),null==(n=null==(o=this.legend)?void 0:o.heatmapGradientLegend)||n.repositionToPlot(),l.globals.dataPoints>50&&l.dom.elWrap.classList.add("apexcharts-disable-transitions");return{elGraph:m,xyRatios:f,dimensions:{plot:{left:l.layout.translateX,top:l.layout.translateY,width:l.layout.gridWidth,height:l.layout.gridHeight}}}}mount(t=null){const e=this,s=e.w;return new Promise((i,a)=>{var r,o,n,l,h,d,g,p,u,x;if(null===e.el)return a(new Error("Not enough data to display or target element not found"));(null===t||s.globals.allSeriesCollapsed)&&e.series.handleNoData(),e.grid=new Ct(e.w,e);const f=e.grid.drawGrid(),m=ms._featureRegistry.get("annotations");if(e.annotations=m?new m(e.w,{theme:e.theme,timeScale:e.timeScale}):null,null==(r=e.annotations)||r.drawImageAnnos(),null==(o=e.annotations)||o.drawTextAnnos(),"back"===s.config.grid.position&&(f&&s.dom.elGraphical.add(f.el),(null==(n=null==f?void 0:f.elGridBorders)?void 0:n.node)&&s.dom.elGraphical.add(f.elGridBorders)),Array.isArray(t.elGraph))for(let e=0;e<t.elGraph.length;e++)s.dom.elGraphical.add(t.elGraph[e]);else s.dom.elGraphical.add(t.elGraph);"front"===s.config.grid.position&&(f&&s.dom.elGraphical.add(f.el),(null==(l=null==f?void 0:f.elGridBorders)?void 0:l.node)&&s.dom.elGraphical.add(f.elGridBorders)),"front"===s.config.xaxis.crosshairs.position&&e.crosshairs.drawXCrosshairs(),"front"===s.config.yaxis[0].crosshairs.position&&e.crosshairs.drawYCrosshairs(),"treemap"!==s.config.chart.type&&e.axes.drawAxis(s.config.chart.type,f);const b=new At(this.w,this.ctx,f),y=new _t(this.w,{theme:this.theme,timeScale:this.timeScale},f);if(null!==f&&(b.xAxisLabelCorrections(),y.setYAxisTextAlignments(),s.config.yaxis.map((t,e)=>{-1===s.globals.ignoreYAxisIndexes.indexOf(e)&&y.yAxisTitleRotate(e,t.opposite)})),null==(h=e.annotations)||h.drawAxesAnnotations(),!s.globals.noData){if(c.isBrowser()&&s.config.tooltip.enabled&&!s.globals.noData&&(null==(d=e.w.globals.tooltip)||d.drawTooltip(t.xyRatios)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.config.chart.accessibility.keyboard.navigation.enabled&&(null==(g=e.keyboardNavigation)||g.init()),c.isBrowser()&&s.globals.axisCharts&&(s.axisFlags.isXNumeric||s.config.xaxis.convertedCatToNumeric||s.axisFlags.isRangeBar))(s.config.chart.zoom.enabled||s.config.chart.selection&&s.config.chart.selection.enabled||s.config.chart.pan&&s.config.chart.pan.enabled)&&(null==(p=e.zoomPanSelection)||p.init({xyRatios:t.xyRatios}));else{const t=s.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(e=>{t[e]=!1})}s.config.chart.toolbar.show&&!s.globals.allSeriesCollapsed&&(null==(u=e.toolbar)||u.createToolbar())}null==(x=e.weave)||x.dispatch("draw",{pass:"full",xyRatios:null==t?void 0:t.xyRatios}),s.globals.memory.methodsToExec.length>0&&s.globals.memory.methodsToExec.forEach(t=>{t.method(t.params,!1,t.context)}),s.globals.axisCharts||s.globals.noData||e.core.resizeNonAxisCharts(),i(e)})}destroy(){var t;this._renderPromise=null,c.isBrowser()&&(window.removeEventListener("resize",this.windowResizeHandler),function(t,e){if(c.isSSR())return;const s=vs.get(e);s&&(s.disconnect(),vs.delete(e))}(this.el.parentNode,this.parentResizeHandler),clearTimeout(null!=(t=this.w.globals.resizeTimer)?t:void 0));const e=this.w.config.chart.id;e&&Array.isArray(Apex._chartInstances)&&Apex._chartInstances.forEach((t,s)=>{t.id===b.escapeString(e)&&Apex._chartInstances.splice(s,1)}),this._keyboardNavigation&&this._keyboardNavigation.destroy(),new bs(this.ctx).clear({isUpdating:!1})}updateOptions(t,e=!1,s=!0,i=!0,a=!0){const r=this.w;if(r.interact.selection=void 0,this.lastUpdateOptions){if(b.shallowEqual(this.lastUpdateOptions,t))return Promise.resolve(this);if(t.series&&this.lastUpdateOptions.series&&JSON.stringify(this.lastUpdateOptions.series)===JSON.stringify(t.series)){const e=n({},t),s=n({},this.lastUpdateOptions);if(delete e.series,delete s.series,b.shallowEqual(e,s))return Promise.resolve(this)}}return t.series&&(this.data.resetParsingFlags(),this.series.resetSeries(!1,!0,!1),t.series.length&&t.series[0].data&&(t.series=t.series.map((t,e)=>this.updateHelpers._extendSeries(t,e))),this.updateHelpers.revertDefaultAxisMinMax()),t.xaxis&&(t=this.updateHelpers.forceXAxisUpdate(t)),t.yaxis&&(t=this.updateHelpers.forceYAxisUpdate(t)),r.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),t.theme&&(t=this.theme.updateThemeOptions(t)),this.updateHelpers._updateOptions(t,e,s,i,a)}updateSeries(t=[],e=!0,s=!0){return this.data.resetParsingFlags(),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(t,e,s)}appendSeries(t,e=!0,s=!0){this.data.resetParsingFlags();const i=this.w.config.series.slice();return i.push(t),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(i,e,s)}appendData(t,e=!0){const s=this;s.data.resetParsingFlags(),s.w.globals.dataChanged=!0,s.series.getPreviousPaths();const i=s.w.config.series.slice();for(let e=0;e<i.length;e++)if(null!==t[e]&&void 0!==t[e]){const s=t[e],a=i[e];for(let t=0;t<s.data.length;t++)a.data.push(s.data[t])}return function(t,e){const s=e.config.chart.streaming;if(!s||!s.enabled)return;const i=s.maxPoints,a=e.config.xaxis.range,r=t=>null==t?null:Array.isArray(t)?"number"==typeof t[0]?t[0]:null:"object"==typeof t&&"number"==typeof t.x?t.x:null;t.forEach(t=>{var e;const s=null==t?void 0:t.data;if(!Array.isArray(s)||s.length<2)return;if("number"==typeof i&&i>0)return void(s.length>i&&(t.data=s.slice(s.length-i)));if(!a)return;const o=r(s[s.length-1]),n=r(s[0]);if(null==o||null==n||o<=n)return;const l=(o-n)/(s.length-1),h=o-a-2*l;let c=0;for(;c<s.length&&(null!=(e=r(s[c]))?e:h)<h;)c++;c>0&&(t.data=s.slice(c))})}(i,s.w),s.w.config.series=i,e&&(s.w.globals.initialSeries=b.clone(s.w.config.series)),this.update()}update(t){return new Promise((e,s)=>{if(this.lastUpdateOptions&&JSON.stringify(this.lastUpdateOptions)===JSON.stringify(t))return e(this);this.lastUpdateOptions=b.clone(t),new bs(this.ctx).clear({isUpdating:!0});const i=this.create(this.w.config.series,null!=t?t:{});if(!i)return e(this);this.mount(i).then(()=>{var t;null==(t=this.morphTypeChange)||t.applyChromeFade(),function(t){const e=t.globals,s=e.prevChromeFrame;if(e.prevChromeFrame=null,!s||!e.axisCharts||!c.isBrowser())return;if(!Wt(t))return;if(!(t.seriesData.series||[]).some((e,s)=>null!==$t(t,s,!0)))return;const i=t.dom.baseEl;if(!b.elementExists(i))return;const a=Math.max(1,t.config.chart.animations.dynamicAnimation.speed||1),r=jt(t);try{const e=[...i.querySelectorAll(te)],o=function(t,e){if(!t||!e)return null;const s=t.max-t.min,i=e.max-e.min;return s>0&&i>0&&t.width>0&&e.width>0?{toNew:a=>(t.min+a/t.width*s-e.min)/i*e.width,toOld:a=>(e.min+a/e.width*i-t.min)/s*t.width}:null}(s.xScale,ie(t)),n=re(s.yAnchors,ae(t,e.map(t=>({pos:parseFloat(t.getAttribute("y")||"")}))));he(t,{newLabels:[...i.querySelectorAll(Qt)],oldLabels:s.xLabels,posAttr:"x",newLines:[...i.querySelectorAll(ee)],oldLines:s.vGrid,lineAttrs:["x1","x2"],duration:a,ease:r,project:o}),he(t,{newLabels:e,oldLabels:s.yLabels,posAttr:"y",newLines:[...i.querySelectorAll(se)],oldLines:s.hGrid,lineAttrs:["y1","y2"],duration:a,ease:r,project:n})}catch(t){}}(this.w),"function"==typeof this.w.config.chart.events.updated&&this.w.config.chart.events.updated(this,this.w),this.events.fireEvent("updated",[this,this.w]),this.w.globals.isDirty=!0,e(this)}).catch(t=>{s(t)})})}fastUpdate(t,e){return new Promise((s,i)=>{var a,r,o;try{const n=this.w,l=n.globals;l.shouldAnimate=t,l.dataChanged=!0,l.animationEnded=!1,wt.invalidateSelectors(n);const h=n.globals;h.maxY=-Number.MAX_VALUE,h.minY=Number.MIN_VALUE,h.minYArr=[],h.maxYArr=[],h.maxX=-Number.MAX_VALUE,h.minX=Number.MAX_VALUE,h.initialMaxX=-Number.MAX_VALUE,h.initialMinX=Number.MAX_VALUE,h.yAxisScale=[],h.xAxisScale=null,h.xAxisTicksPositions=[],h.xRange=0,h.yRange=[],h.zRange=0,h.xTickAmount=0,h.multiAxisTickAmount=0,h.pointsArray=[],h.barCanvasCoords=null,h.dataLabelsRects=[],h.lastDrawnDataLabelsIndexes=[],h.textRectsCache=new Map,h.domCache=new Map,h.cachedSelectors={},h.disableZoomIn=!1,h.disableZoomOut=!1,l.axisCharts&&(this.core.coreCalculations(),"category"!==n.config.xaxis.type&&this.formatters.setLabelFormatters());const d=this.core.xySettings(),g=JSON.stringify({y:(l.yAxisScale||[]).map(t=>t?t.result:null),xMin:l.minX,xMax:l.maxX});if(l.axisCharts&&null!=e&&g!==e)return this.update().then(()=>s(this)).catch(i);null==(a=this.weave)||a.dispatch("afterScales",{pass:"fast",xyRatios:d});const p=n.dom.elGraphical.node;p.querySelectorAll(".apexcharts-canvas-series-wrap, .apexcharts-series, .apexcharts-datalabels, .apexcharts-datalabels-background").forEach(t=>{var e;return null==(e=t.parentNode)?void 0:e.removeChild(t)});const u=this.core.plotChartType(n.config.series,d),x=p.querySelector(".apexcharts-grid"),f=Array.isArray(u)?u:[u];x&&"front"===n.config.grid.position?f.forEach(t=>{const e=t&&t.node?t.node:t;e&&p.insertBefore(e,x)}):f.forEach(t=>{n.dom.elGraphical.add(t)});const m=new yt(n,this);m.bringForward(),n.config.dataLabels.background.enabled&&m.dataLabelsBackground(),c.isBrowser()&&n.config.tooltip.enabled&&!l.noData&&(null==(r=n.globals.tooltip)||r.drawTooltip(d)),null==(o=this.weave)||o.dispatch("draw",{pass:"fast",xyRatios:d}),"function"==typeof n.config.chart.events.updated&&n.config.chart.events.updated(this,n),this.events.fireEvent("updated",[this,n]),l.isDirty=!0,s(this)}catch(t){i(t)}})}getSyncedCharts(){const t=this.getGroupedCharts();return t.splice(0,0,this),t}getGroupedCharts(){return Apex._chartInstances.filter(t=>this!==t.chart&&!!this.w.config.chart.group&&this.w.config.chart.group===t.group).map(t=>t.chart)}static getChartByID(t){const e=b.escapeString(t);if(!Apex._chartInstances)return;const s=Apex._chartInstances.filter(t=>t.id===e)[0];return s&&s.chart}static initOnLoad(){var e;const s=document.querySelectorAll("[data-apexcharts]");for(let i=0;i<s.length;i++){const a=s[i],r=JSON.parse(null!=(e=s[i].getAttribute("data-options"))?e:"");new t(a,r).render()}}static exec(t,e,...s){const i=this.getChartByID(t);if(!i)return;i.w.globals.isExecCalled=!0;let a=null;return-1!==i.publicMethods.indexOf(e)&&(a=i[e](...s)),a}static merge(t,e){return b.extend(t,e)}static getThemePalettes(){return{palette1:["#008FFB","#00A86F","#CA8501","#FF4560","#846DD5"],palette2:["#6978CB","#039DE2","#49A84D","#B39105","#D68000"],palette3:["#209FCC","#648291","#D4526E","#0FA783","#A19285"],palette4:["#2FA59D","#73A20B","#099DE1","#FD5D5D","#648291"],palette5:["#2B908F","#F56566","#2EAB16","#FA4443","#1EA2BD"],palette6:["#449DD1","#F86624","#EA3A4A","#9C63D1","#899E2A"],palette7:["#DF475B","#1B998B","#7E75B7","#F46036","#B1911B"],palette8:["#9C63D1","#F86624","#B38F04","#EA3A4A","#2FA2B3"],palette9:["#98776F","#A19285","#A8705E","#BA6560","#A0927F"],palette10:["#C91EFF","#A94BFD","#6C6AFE","#2983FF","#009ED8"],cvdDeuteranopia:["#0072B2","#E69F00","#56B4E9","#009E73","#F0E442","#D55E00","#CC79A7"],cvdProtanopia:["#0077BB","#EE7733","#009988","#EE3377","#BBBBBB","#33BBEE","#CC3311"],cvdTritanopia:["#CC3311","#009988","#EE7733","#0077BB","#EE3377","#BBBBBB","#33BBEE"],highContrast:["#005A9C","#C00000","#007A33","#6C3483","#7B3F00","#0097A7","#4A235A"]}}static use(t){Ye(t)}static registerFeatures(t){ms.registerFeatures(t)}static registerPlugin(e){return function(t){t&&"string"==typeof t.name&&"function"==typeof t.setup&&(ws()[t.name]=t)}(e),t}static unregisterPlugin(e){return function(t){delete ws()[t]}(e),t}static registerRenderer(t,e){es.registerRenderer(t,e)}static registerSeriesType(e,s){const i=t._customSeriesFactory;return i&&s&&"function"==typeof s.renderItem?(a=e,Re()[a]&&!Be(e)||(Ye({[e]:i(e,s)}),function(t){ze().add(t)}(e)),t):t;var a}static unregisterSeriesType(e){return Be(e)&&function(t){delete Re()[t],ze().delete(t)}(e),t}static registerTheme(e,s){return function(t,e){t&&"string"==typeof t&&(null==e||"object"==typeof e&&!Array.isArray(e))&&(pe()[t]=e||{})}(e,s),t}static unregisterTheme(e){return function(t){t&&delete pe()[t]}(e),t}static registerEasing(e,s){return function(t,e){"string"==typeof t&&t&&"function"==typeof e&&et.set(t,e)}(e,s),t}static crossfilter(e){const s=t._crossfilterFactory;return s?s(e):null}static getCrossfilter(e){const s=t._crossfilterGet;return s?s(e):null}clearCrossfilter(){var t;null==(t=this.linkedViews)||t.clearGroup()}startMeasure(){var t;null==(t=this.measure)||t.startMeasure()}stopMeasure(){var t;null==(t=this.measure)||t.stopMeasure()}clearMeasures(){var t;null==(t=this.measure)||t.clearMeasures()}toggleSeries(t){return this.series.toggleSeries(t)}highlightSeriesOnLegendHover(t,e){return this.series.toggleSeriesOnHover(t,e)}showSeries(t){this.series.showSeries(t)}hideSeries(t){this.series.hideSeries(t)}highlightSeries(t){this.series.highlightSeries(t)}isSeriesHidden(t){return this.series.isSeriesHidden(t)}resetSeries(t=!0,e=!0){this.series.resetSeries(t,e)}addEventListener(t,e){this.events.addEventListener(t,e)}removeEventListener(t,e){this.events.removeEventListener(t,e)}addXaxisAnnotation(t,e=!0,s=void 0){var i;let a=this;s&&(a=s),null==(i=a.annotations)||i.addXaxisAnnotationExternal(t,e,a)}addYaxisAnnotation(t,e=!0,s=void 0){var i;let a=this;s&&(a=s),null==(i=a.annotations)||i.addYaxisAnnotationExternal(t,e,a)}addPointAnnotation(t,e=!0,s=void 0){var i;let a=this;s&&(a=s),null==(i=a.annotations)||i.addPointAnnotationExternal(t,e,a)}clearAnnotations(t=void 0){var e;let s=this;t&&(s=t),s.lastUpdateOptions=null,null==(e=s.annotations)||e.clearAnnotations(s)}removeAnnotation(t,e=void 0){var s;let i=this;e&&(i=e),i.lastUpdateOptions=null,null==(s=i.annotations)||s.removeAnnotation(i,t)}getChartArea(){return this.w.dom.baseEl.querySelector(".apexcharts-inner")}getSeriesTotalXRange(t,e){return this.coreUtils.getSeriesTotalsXRange(t,e)}getHighestValueInSeries(t=0){return new kt(this.w).getMinYMaxY(t).highestY}getLowestValueInSeries(t=0){return new kt(this.w).getMinYMaxY(t).lowestY}getSeriesTotal(){return this.w.globals.seriesTotals}getState(){const t=this.w,e=t.globals;return{series:t.seriesData.series,seriesNames:t.seriesData.seriesNames,colors:e.colors,labels:t.labelData.labels,seriesTotals:e.seriesTotals,seriesPercent:e.seriesPercent,seriesXvalues:e.seriesXvalues,seriesYvalues:e.seriesYvalues,minX:e.minX,maxX:e.maxX,minY:e.minY,maxY:e.maxY,minYArr:e.minYArr,maxYArr:e.maxYArr,minXDiff:e.minXDiff,dataPoints:e.dataPoints,xAxisScale:e.xAxisScale,yAxisScale:e.yAxisScale,xTickAmount:e.xTickAmount,isXNumeric:t.axisFlags.isXNumeric,seriesYAxisMap:e.seriesYAxisMap,seriesYAxisReverseMap:e.seriesYAxisReverseMap,svgWidth:e.svgWidth,svgHeight:e.svgHeight,gridWidth:t.layout.gridWidth,gridHeight:t.layout.gridHeight,selectedDataPoints:t.interact.selectedDataPoints,collapsedSeriesIndices:e.collapsedSeriesIndices,zoomed:t.interact.zoomed,seriesX:t.seriesData.seriesX,seriesZ:t.seriesData.seriesZ,seriesCandleO:t.candleData.seriesCandleO,seriesCandleH:t.candleData.seriesCandleH,seriesCandleM:t.candleData.seriesCandleM,seriesCandleL:t.candleData.seriesCandleL,seriesCandleC:t.candleData.seriesCandleC,seriesRangeStart:t.rangeData.seriesRangeStart,seriesRangeEnd:t.rangeData.seriesRangeEnd,seriesGoals:t.seriesData.seriesGoals}}toggleDataPointSelection(t,e){return this.updateHelpers.toggleDataPointSelection(t,e)}zoomX(t,e){var s;null==(s=this.ctx.toolbar)||s.zoomUpdateOptions(t,e)}setLocale(t){this.localization.setCurrentLocaleValues(t)}dataURI(t){if(!this.ctx.exports)throw new Error("apexcharts: Exports feature is not registered. Import apexcharts/features/exports.");return this.ctx.exports.dataURI(t)}getSvgString(t){if(!this.ctx.exports)throw new Error("apexcharts: Exports feature is not registered. Import apexcharts/features/exports.");return this.ctx.exports.getSvgString(t)}exportToCSV(t={}){if(!this.ctx.exports)throw new Error("apexcharts: Exports feature is not registered. Import apexcharts/features/exports.");return this.ctx.exports.exportToCSV(t)}paper(){return this.w.dom.Paper}getActiveRenderer(){return this.rendererController?this.rendererController.getActiveKind():"svg"}refreshTokens(){return this.lastUpdateOptions=null,this.update()}drillDown(t){if(!this.ctx.drilldown)throw new Error("apexcharts: Drilldown feature is not registered. Import apexcharts/features/drilldown.");return this.ctx.drilldown.drillDown(t)}drillUp(){if(!this.ctx.drilldown)throw new Error("apexcharts: Drilldown feature is not registered. Import apexcharts/features/drilldown.");return this.ctx.drilldown.drillUp()}drillToRoot(){if(!this.ctx.drilldown)throw new Error("apexcharts: Drilldown feature is not registered. Import apexcharts/features/drilldown.");return this.ctx.drilldown.drillToRoot()}_writeParsedSeriesData(t){Object.assign(this.w.seriesData,t)}_writeParsedRangeData(t){Object.assign(this.w.rangeData,t)}_writeParsedCandleData(t){Object.assign(this.w.candleData,t)}_writeParsedLabelData(t){Object.assign(this.w.labelData,t)}_writeParsedAxisFlags(t){Object.assign(this.w.axisFlags,t)}_writeLayoutCoords(t){Object.assign(this.w.layout,t)}_parentResizeCallback(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}_windowResize(){this.w.globals.resizeTimer=window.setTimeout(()=>{this.w.globals.resized=!0,this.w.globals.dataChanged=!1,this.ctx.update()},150)}_windowResizeHandler(){var t;clearTimeout(null!=(t=this.w.globals.resizeTimer)?t:void 0);let{redrawOnWindowResize:e}=this.w.config.chart;"function"==typeof e&&(e=e()),e&&this._windowResize()}};h(As,"perspectives",null);let Cs=As;const Ss=".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} ";class ks{constructor(t,e){this.w=t,this.ctx=e}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){const s=parseFloat(t.getAttributeNS(null,"width")),i=parseFloat(t.getAttributeNS(null,"height"));t.setAttributeNS(null,"width",s*e),t.setAttributeNS(null,"height",i*e),t.setAttributeNS(null,"viewBox","0 0 "+s+" "+i)}inlineCanvasLayers(t){const e=this.w.dom.elWrap.querySelectorAll(".apexcharts-series-canvas");if(!e.length)return;const s=t.querySelectorAll(".apexcharts-canvas-series");for(let t=0;t<e.length&&t<s.length;t++){let i;try{i=e[t].toDataURL()}catch(t){continue}const a=s[t],r=document.createElementNS(F,"image");r.setAttribute("x",a.getAttribute("x")||"0"),r.setAttribute("y",a.getAttribute("y")||"0"),r.setAttribute("width",a.getAttribute("width")||"0"),r.setAttribute("height",a.getAttribute("height")||"0"),r.setAttribute("href",i),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i),a.parentNode&&a.parentNode.replaceChild(r,a)}}getSvgString(t){return new Promise(e=>{const s=this.w;let i=t||s.config.chart.toolbar.export.scale||s.config.chart.toolbar.export.width/s.globals.svgWidth;i||(i=1);const a=s.globals.svgWidth*i,r=s.globals.svgHeight*i,o=s.dom.elWrap.cloneNode(!0);o.style.width=a+"px",o.style.height=r+"px",this.inlineCanvasLayers(o);const n=(new XMLSerializer).serializeToString(o);let l="\n .apexcharts-tooltip, .apexcharts-toolbar, .apexcharts-xaxistooltip, .apexcharts-yaxistooltip, .apexcharts-xcrosshairs, .apexcharts-ycrosshairs, .apexcharts-zoom-rect, .apexcharts-selection-rect {\n display: none;\n }\n ";s.config.legend.show&&s.dom.elLegendWrap&&s.dom.elLegendWrap.children.length>0&&(l+=Ss);let h=`\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="${s.globals.svgWidth}px" height="${s.globals.svgHeight}px">\n <foreignObject width="100%" height="100%">\n <div xmlns="http://www.w3.org/1999/xhtml" style="width:${a}px; height:${r}px;">\n <style type="text/css">\n ${l}\n </style>\n ${n}\n </div>\n </foreignObject>\n </svg>\n `;const c=this.svgStringToNode(h);1!==i&&this.scaleSvgNode(c,i),this.convertImagesToBase64(c).then(()=>{h=(new XMLSerializer).serializeToString(c),e(h.replace(/ /g," "))})})}convertImagesToBase64(t){const e=t.getElementsByTagName("image"),s=Array.from(e).map(t=>{const e=t.getAttributeNS("http://www.w3.org/1999/xlink","href");return e&&!e.startsWith("data:")?this.getBase64FromUrl(e).then(e=>{t.setAttributeNS("http://www.w3.org/1999/xlink","href",e)}).catch(t=>{}):Promise.resolve()});return Promise.all(s)}getBase64FromUrl(t){return c.isSSR()?Promise.resolve(t):new Promise((e,s)=>{const i=new Image;i.crossOrigin="Anonymous",i.onload=()=>{const t=document.createElement("canvas");t.width=i.width,t.height=i.height;const s=t.getContext("2d");s&&s.drawImage(i,0,0),e(t.toDataURL())},i.onerror=s,i.src=t})}svgUrl(){return new Promise(t=>{this.getSvgString().then(e=>{const s=new Blob([e],{type:"image/svg+xml;charset=utf-8"});t(URL.createObjectURL(s))})})}dataURI(t){return c.isSSR()?Promise.resolve({imgURI:""}):new Promise(e=>{const s=this.w,i=t?t.scale||t.width/s.globals.svgWidth:1,a=document.createElement("canvas");a.width=s.globals.svgWidth*i,a.height=parseInt(s.dom.elWrap.style.height,10)*i;const r="transparent"!==s.config.chart.background&&s.config.chart.background?s.config.chart.background:"#fff",o=a.getContext("2d");o&&(o.fillStyle=r,o.fillRect(0,0,a.width*i,a.height*i),this.getSvgString(i).then(t=>{const s="data:image/svg+xml,"+encodeURIComponent(t),i=new Image;i.crossOrigin="anonymous",i.onload=()=>{o.drawImage(i,0,0);const t=a;if(t.msToBlob){const s=t.msToBlob();e({blob:s})}else{const t=a.toDataURL("image/png");e({imgURI:t})}},i.src=s}))})}exportToSVG(){this.svgUrl().then(t=>{this.triggerDownload(t,this.w.config.chart.toolbar.export.svg.filename,".svg")})}exportToPng(){const t=this.w.config.chart.toolbar.export.scale,e=this.w.config.chart.toolbar.export.width,s=t?{scale:t}:e?{width:e}:void 0;this.dataURI(s).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:s=",",lineDelimiter:i="\n"}){const a=this.w;t||(t=a.config.series);let r=[];const o=[];let n="";const l=a.seriesData.series.map((t,e)=>-1===a.globals.collapsedSeriesIndices.indexOf(e)?t:[]),h=t=>"function"==typeof a.config.chart.toolbar.export.csv.categoryFormatter?a.config.chart.toolbar.export.csv.categoryFormatter(t):"datetime"===a.config.xaxis.type&&String(t).length>=10?new Date(t).toDateString():b.isNumber(t)?t:t.split(s).join(""),c=t=>"function"==typeof a.config.chart.toolbar.export.csv.valueFormatter?a.config.chart.toolbar.export.csv.valueFormatter(t):t,d=Math.max(...t.map(t=>t.data?t.data.length:0)),g=new Oe(this.w),p=new vt(this.w,{theme:this.ctx.theme,timeScale:this.ctx.timeScale}),u=t=>{let e="";if(a.globals.axisCharts){if("category"===a.config.xaxis.type||a.config.xaxis.convertedCatToNumeric)if(a.globals.isBarHorizontal){const s=a.formatters.yLabelFormatters[0],i=new ce(this.ctx.w).getActiveConfigSeriesIndex();e=s(a.labelData.labels[t],{seriesIndex:i,dataPointIndex:t,w:a})}else e=p.getLabel(a.labelData.labels,a.labelData.timescaleLabels,0,t).text;"datetime"===a.config.xaxis.type&&(a.config.xaxis.categories.length?e=a.config.xaxis.categories[t]:a.config.labels.length&&(e=a.config.labels[t]))}else e=a.config.labels[t];return null===e?"nullvalue":(Array.isArray(e)&&(e=e.join(" ")),b.isNumber(e)?e:e.split(s).join(""))},x=(e,i)=>{var n,p,x,f,m,b;if(r.length&&0===i&&o.push(r.join(s)),e.data){e.data=e.data.length&&e.data||[...Array(d)].map(()=>"");for(let d=0;d<e.data.length;d++){r=[];let y=u(d);if("nullvalue"!==y){if(y||(g.isFormatXY()?y=t[i].data[d].x:g.isFormat2DArray()&&(y=t[i].data[d]?t[i].data[d][0]:"")),0===i){r.push(h(y));for(let e=0;e<a.seriesData.series.length;e++){const s=g.isFormatXY()?null==(n=t[e].data[d])?void 0:n.y:l[e][d];r.push(c(s))}}("candlestick"===a.config.chart.type||e.type&&"candlestick"===e.type)&&(r.pop(),r.push(a.candleData.seriesCandleO[i][d]),r.push(a.candleData.seriesCandleH[i][d]),r.push(a.candleData.seriesCandleL[i][d]),r.push(a.candleData.seriesCandleC[i][d])),("boxPlot"===a.config.chart.type||e.type&&"boxPlot"===e.type)&&(r.pop(),r.push(a.candleData.seriesCandleO[i][d]),r.push(a.candleData.seriesCandleH[i][d]),r.push(a.candleData.seriesCandleM[i][d]),r.push(a.candleData.seriesCandleL[i][d]),r.push(a.candleData.seriesCandleC[i][d])),"rangeBar"===a.config.chart.type&&(r.pop(),r.push(a.rangeData.seriesRangeStart[i][d]),r.push(a.rangeData.seriesRangeEnd[i][d])),("violin"===a.config.chart.type||e.type&&"violin"===e.type)&&(r.pop(),r.push(null==(p=a.violinData.seriesViolinMin[i])?void 0:p[d]),r.push(null==(x=a.violinData.seriesViolinMax[i])?void 0:x[d]),r.push(null!=(b=null==(m=null==(f=a.violinData.seriesViolinPoints[i])?void 0:f[d])?void 0:m.length)?b:0)),r.length&&o.push(r.join(s))}}}};r.push(a.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===a.config.chart.type?(r.push("minimum"),r.push("q1"),r.push("median"),r.push("q3"),r.push("maximum")):"candlestick"===a.config.chart.type?(r.push("open"),r.push("high"),r.push("low"),r.push("close")):"rangeBar"===a.config.chart.type?(r.push("minimum"),r.push("maximum")):"violin"===a.config.chart.type?(r.push("minimum"),r.push("maximum"),r.push("observations")):t.map((t,e)=>{const i=(t.name?t.name:`series-${e}`)+"";a.globals.axisCharts&&r.push(i.split(s).join("")?i.split(s).join(""):`series-${e}`)}),a.globals.axisCharts||(r.push(a.config.chart.toolbar.export.csv.headerValue),o.push(r.join(s))),a.globals.allSeriesHasEqualX||!a.globals.axisCharts||a.config.xaxis.categories.length||a.config.labels.length?t.map((t,e)=>{a.globals.axisCharts?x(t,e):(r=[],r.push(h(a.labelData.labels[e])),r.push(c(l[e])),o.push(r.join(s)))}):(()=>{const e=new Set,i={};t.forEach((s,a)=>{null==s||s.data.forEach(s=>{let r,o;if(g.isFormatXY())r=s.x,o=s.y;else{if(!g.isFormat2DArray())return;r=s[0],o=s[1]}i[r]||(i[r]=Array(t.length).fill("")),i[r][a]=c(o),e.add(r)})}),r.length&&o.push(r.join(s)),Array.from(e).sort().forEach(t=>{o.push([h(t),i[t].join(s)])})})(),n+=o.join(i),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+n),e||a.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,s){if(c.isSSR())return;const i=document.createElement("a");i.href=t,i.download=(e||this.w.globals.chartID)+s,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}Cs.registerFeatures({exports:ks});let _s=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){if(c.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 s=document.createTextNode(Ss);return t.appendChild(s),t}getLegendDimensions(){const t=this.w.dom.baseEl.querySelector(".apexcharts-legend");if(!t)return{clwh:0,clww:0};const{width:e,height:s}=t.getBoundingClientRect();return{clwh:s,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 s,i,a;const r=this.w;if(r.globals.axisCharts||"radialBar"===r.config.chart.type){r.globals.resized=!0;let o=null,n=null;if(r.globals.risingSeries=[],r.globals.axisCharts){if(o=null!=(s=Array.prototype.find.call(r.dom.baseEl.querySelectorAll(".apexcharts-series"),e=>e.getAttribute("data:realIndex")===String(t)))?s:null,!o)return;n=parseInt(null!=(i=o.getAttribute("data:realIndex"))?i:"",10)}else{if(o=r.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!o)return;n=parseInt(null!=(a=o.getAttribute("rel"))?a:"",10)-1}if(e){[{cs:r.globals.collapsedSeries,csi:r.globals.collapsedSeriesIndices},{cs:r.globals.ancillaryCollapsedSeries,csi:r.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{const e=t.cs,s=t.csi;this.riseCollapsedSeries(e,s,n)})}else this.hideSeries({seriesEl:o,realIndex:n});if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const s=r.globals.collapsedSeriesIndices.includes(n)||r.globals.ancillaryCollapsedSeriesIndices.includes(n);e.setAttribute("aria-pressed",s?"true":"false");const i=e.querySelector(".apexcharts-legend-text"),a=i?i.textContent:r.seriesData.seriesNames[t],o=s?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${o}. Press Enter or Space to toggle.`)}}}else{const e=r.dom.Paper.findOne(` .apexcharts-series[rel='${t+1}'] path`),s=r.config.chart.type;if("pie"===s||"polarArea"===s||"donut"===s){const t=r.config.plotOptions.pie.donut.labels;new gt(this.w).pathMouseDown(e,null),this.lgCtx.printDataLabelsInner(e.node,t)}if(r.config.chart.accessibility.enabled){const e=r.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const s=r.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",s?"true":"false");const i=e.querySelector(".apexcharts-legend-text"),a=i?i.textContent:r.seriesData.seriesNames[t],o=s?"hidden":"visible";e.setAttribute("aria-label",`${a}, ${o}. Press Enter or Space to toggle.`)}}}}getSeriesAfterCollapsing({realIndex:t}){var e;const s=this.w,i=s.globals,a=b.clone(s.config.series);if(i.axisCharts){const e=s.config.yaxis[i.seriesYAxisReverseMap[t]],r={index:t,data:a[t].data.slice(),type:a[t].type||s.config.chart.type};if(e&&e.show&&e.showAlways)i.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(i.ancillaryCollapsedSeries.push(r),i.ancillaryCollapsedSeriesIndices.push(t));else if(i.collapsedSeriesIndices.indexOf(t)<0){i.collapsedSeries.push(r),i.collapsedSeriesIndices.push(t);const e=i.risingSeries.indexOf(t);i.risingSeries.splice(e,1)}}else i.collapsedSeries.push({index:t,data:a[t],type:null!=(e=s.config.series[t].type)?e:"line"}),i.collapsedSeriesIndices.push(t);return i.allSeriesCollapsed=i.collapsedSeries.length+i.ancillaryCollapsedSeries.length===s.config.series.length,this._getSeriesBasedOnCollapsedState(a)}hideSeries({seriesEl:t,realIndex:e}){const s=this.w,i=this.getSeriesAfterCollapsing({realIndex:e}),a=t.childNodes;for(let t=0;t<a.length;t++)a[t].classList.contains("apexcharts-series-markers-wrap")&&(a[t].classList.contains("apexcharts-hide")?a[t].classList.remove("apexcharts-hide"):a[t].classList.add("apexcharts-hide"));this.lgCtx.updateSeries(i,s.config.chart.animations.dynamicAnimation.enabled)}riseCollapsedSeries(t,e,s){const i=this.w;let a=b.clone(i.config.series);if(t.length>0){for(let r=0;r<t.length;r++)t[r].index===s&&(i.globals.axisCharts?a[s].data=t[r].data.slice():a[s]=t[r].data,"number"!=typeof a[s]&&(a[s].hidden=!1),t.splice(r,1),e.splice(r,1),i.globals.risingSeries.push(s),r--);a=this._getSeriesBasedOnCollapsedState(a),this.lgCtx.updateSeries(a,i.config.chart.animations.dynamicAnimation.enabled)}}_getSeriesBasedOnCollapsedState(t){const e=this.w;let s=0;return e.globals.axisCharts?t.forEach((i,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0&&e.globals.ancillaryCollapsedSeriesIndices.indexOf(a)<0||(t[a].data=[],s++)}):t.forEach((i,a)=>{e.globals.collapsedSeriesIndices.indexOf(a)<0||(t[a]=0,s++)}),e.globals.allSeriesCollapsed=s===t.length,t}};const Ls="http://www.w3.org/2000/svg";class Ms{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._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.w.config.plotOptions.heatmap.colorScale.gradientLegend;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 isEnabled(t){var e,s,i,a;const r=null==(a=null==(i=null==(s=null==(e=null==t?void 0:t.config)?void 0:e.plotOptions)?void 0:s.heatmap)?void 0:i.colorScale)?void 0:a.gradientLegend;return!(!r||!r.enabled)}draw(){var t,e,s,i,a,r,o,n;const l=this.w,h=l.dom.elLegendWrap;if(!h)return;const c=l.config.plotOptions.heatmap.colorScale.gradientLegend,d=l.config.legend.position,g="left"===d||"right"===d,p=null!=(e=null==(t=c.arrow)?void 0:t.size)?e:8,u=p+4,x=c.showLabels?28:4,f=c.showLabels?20:4,b=c.showLabels?44:0,y=this._resolveStripLength(g?c.height:c.width,g),w=c.thickness,v=g?Math.max(w+u+4,b):y+2*x,A=g?y+2*f:w+u+4,C=(v-(w+u))/2,S=g?"left"===d?C:C+u:x,k=g?f:"top"===d?u:4,_=m.createElementNS(Ls,"svg");_.setAttribute("class","apexcharts-heatmap-gradient-legend"),_.setAttribute("width",String(v)),_.setAttribute("height",String(A)),_.setAttribute("overflow","visible");const L=m.createElementNS(Ls,"defs"),M=`apexcharts-heatmap-gradient-${l.globals.cuid}`,D=m.createElementNS(Ls,"linearGradient");D.setAttribute("id",M),g?(D.setAttribute("x1","0"),D.setAttribute("y1","1"),D.setAttribute("x2","0"),D.setAttribute("y2","0")):(D.setAttribute("x1","0"),D.setAttribute("y1","0"),D.setAttribute("x2","1"),D.setAttribute("y2","0"));const{min:E,max:P,stops:F,bands:T}=this._computeStops();this._min=E,this._max=P,F.forEach(t=>{const e=m.createElementNS(Ls,"stop");e.setAttribute("offset",`${(100*t.percent).toFixed(2)}%`),e.setAttribute("stop-color",t.color),D.appendChild(e)}),L.appendChild(D),_.appendChild(L);const I=m.createElementNS(Ls,"rect");if(I.setAttribute("x",String(S)),I.setAttribute("y",String(k)),I.setAttribute("width",String(g?w:y)),I.setAttribute("height",String(g?y:w)),I.setAttribute("rx","2"),I.setAttribute("fill",`url(#${M})`),_.appendChild(I),c.showLabels){const t=(null==(s=c.labelStyle)?void 0:s.colors)||(Array.isArray(l.config.legend.labels.colors)?l.config.legend.labels.colors[0]:l.config.legend.labels.colors)||l.config.chart.foreColor,e=(null==(i=c.labelStyle)?void 0:i.fontSize)||"11px",r=(null==(a=c.labelStyle)?void 0:a.fontFamily)||l.config.chart.fontFamily,o=this._getFormatter(),n=(s,i,a,o)=>{const n=m.createElementNS(Ls,"text");return n.setAttribute("x",String(i)),n.setAttribute("y",String(a)),n.setAttribute("text-anchor",o),n.setAttribute("dominant-baseline","middle"),n.setAttribute("fill",t),n.setAttribute("font-size",e),r&&n.setAttribute("font-family",r),n.textContent=String(s),n};if(g){const t=S+w/2;_.appendChild(n(o(E),t,k+y+10,"middle")),_.appendChild(n(o(P),t,k-10,"middle"))}else{const t=k+w/2;_.appendChild(n(o(E),S-6,t,"end")),_.appendChild(n(o(P),S+y+6,t,"start"))}}const X=(null==(r=c.arrow)?void 0:r.color)||l.config.chart.foreColor,R=this._buildArrow(p,X,d);if(_.appendChild(R),this.arrowEl=R,this._bandHitEls=[],l.config.legend.onItemHover.highlightDataSeries&&T.length>0&&T.forEach(t=>{const e=m.createElementNS(Ls,"rect");if(g){const s=k+y-t.p2*y,i=k+y-t.p1*y;e.setAttribute("x",String(S)),e.setAttribute("y",String(s)),e.setAttribute("width",String(w)),e.setAttribute("height",String(Math.max(0,i-s)))}else e.setAttribute("x",String(S+t.p1*y)),e.setAttribute("y",String(k)),e.setAttribute("width",String(Math.max(0,(t.p2-t.p1)*y))),e.setAttribute("height",String(w));e.setAttribute("fill","transparent"),e.setAttribute("class","apexcharts-heatmap-gradient-band"),e.setAttribute("data:range-index",String(t.index)),e.style.cursor="pointer",_.appendChild(e),this._bandHitEls.push(e)}),this._geom={isVertical:g,position:d,stripX:S,stripY:k,stripLength:y,stripThickness:w,arrowSize:p,svgWidth:v,svgHeight:A},c.showHoverValue){const t=m.createElement("div");t.classList.add("apexcharts-heatmap-gradient-legend-value"),t.style.position="absolute",t.style.fontSize=(null==(o=c.labelStyle)?void 0:o.fontSize)||"11px",t.style.fontFamily=(null==(n=c.labelStyle)?void 0:n.fontFamily)||l.config.chart.fontFamily||"",t.style.color=l.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-"+d),h.appendChild(_),this.hoverValueEl&&h.appendChild(this.hoverValueEl),this.svgEl=_,this._applyWrapAlignment(h,d,g,v,A),this._attachHoverListeners(),this._attachBandHoverListeners()}_resolveStripLength(t,e){const s=this.w,i=e?s.globals.svgHeight||s.config.chart.height||300:s.globals.svgWidth||s.config.chart.width||600;if("string"==typeof t){const e=t.trim();if(e.endsWith("%")){const t=parseFloat(e)||0;return Math.max(20,i*t/100)}const s=parseFloat(e);return Number.isFinite(s)?s:200}return"number"==typeof t&&Number.isFinite(t)?t:200}_applyWrapAlignment(t,e,s,i,a){const r=this.w,o=r.config.plotOptions.heatmap.colorScale.gradientLegend.align||"center",n=12,l=r.globals.svgWidth||r.config.chart.width||600,h=r.globals.svgHeight||r.config.chart.height||300,c=r.config.legend.offsetX||0,d=r.config.legend.offsetY||0;if(t.style.position="absolute",t.style.display="block",t.style.overflow="visible",t.style.padding="0",t.style.width=i+"px",t.style.height=a+"px",t.style.right="auto",t.style.bottom="auto",s){const s=h-a-24;let r;r="start"===o?n:"end"===o?n+Math.max(0,s):n+Math.max(0,s)/2,t.style.top=r+d+"px",t.style.left="left"===e?n+c+"px":l-i-n+c+"px"}else{const s=l-i-24;let r;r="start"===o?n:"end"===o?n+Math.max(0,s):n+Math.max(0,s)/2,t.style.left=r+c+"px",t.style.top="top"===e?n+d+"px":h-a-n+d+"px"}}repositionToPlot(){var t,e;if(!c.isBrowser())return;const s=this.w,i=s.globals,a=s.dom.elLegendWrap;if(!a||!this._geom)return;if(!Number.isFinite(i.gridWidth)||!Number.isFinite(i.gridHeight))return;const{isVertical:r,position:o,svgWidth:n,svgHeight:l,stripX:h,stripY:d,stripThickness:g}=this._geom,p=s.config.plotOptions.heatmap.colorScale.gradientLegend.align||"center",u=s.config.legend.offsetX||0,x=s.config.legend.offsetY||0,f=null==(e=null==(t=this.ctx)?void 0:t.dimensions)?void 0:e.dimHelpers,b=f?f.getTitleSubtitleCoords("title").height+f.getTitleSubtitleCoords("subtitle").height:0,y=s.layout.xAxisHeight||0,w=(t,e)=>{const s=Math.max(0,t-e);return"start"===p?0:"end"===p?s:s/2};if(r){a.style.top=i.translateY+w(i.gridHeight,l)+x+"px";const t=(("left"===o?0:i.translateX+i.gridWidth)+("left"===o?i.translateX:i.svgWidth))/2;a.style.left=t-h-g/2+u+"px"}else{a.style.left=i.translateX+w(i.gridWidth,n)+u+"px";const t=(("top"===o?b:i.translateY+i.gridHeight+y)+("top"===o?i.translateY:i.svgHeight))/2;a.style.top=t-d-g/2+x+"px"}m.requestAnimationFrame(()=>this._enforceMinPlotGap())}_enforceMinPlotGap(){const t=this.w,e=t.dom.elLegendWrap,s=this.svgEl&&this.svgEl.querySelector("rect"),i=t.dom.baseEl.querySelector(".apexcharts-grid");if(!(e&&s&&i&&this._geom))return;const a=s.getBoundingClientRect(),r=i.getBoundingClientRect();if(!(a.width&&a.height&&r.width&&r.height))return;const{isVertical:o,position:n}=this._geom;if(o){const t="left"===n?r.left-a.right:a.left-r.right;if(t<16){const s=parseFloat(e.style.left)||0,i=16-t;e.style.left=s+("left"===n?-i:i)+"px"}}else{const t="top"===n?r.top-a.bottom:a.top-r.bottom;if(t<16){const s=parseFloat(e.style.top)||0,i=16-t;e.style.top=s+("top"===n?-i:i)+"px"}}}destroy(){var t,e,s,i,a,r,o;for(let s=0;s<this._bandHitEls.length;s++){const i=this._bandHitEls[s];null==(t=i.removeEventListener)||t.call(i,"mousemove",this._onBandEnter),null==(e=i.removeEventListener)||e.call(i,"mouseout",this._onBandLeave)}if(this._bandHitEls=[],this._activeBandIndex=-1,null==(s=this.ctx)?void 0:s.events)try{null==(a=(i=this.ctx.events).removeEventListener)||a.call(i,"dataPointMouseEnter",this._onCellEnter),null==(o=(r=this.ctx.events).removeEventListener)||o.call(r,"dataPointMouseLeave",this._onCellLeave)}catch(t){}}_attachBandHoverListeners(){if(c.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,s,i,a;const r=this.w,o=t.currentTarget,n=parseInt(null!=(e=o.getAttribute("data:range-index"))?e:"-1",10);n<0||n===this._activeBandIndex||(this._activeBandIndex=n,null==(a=null==(i=null==(s=this.ctx)?void 0:s.events)?void 0:i.fireEvent)||a.call(i,"legendHover",[this.ctx,n,r]),new ce(r).highlightRangeInSeries(n,"highlight"))}_onBandLeave(){if(this._activeBandIndex<0)return;const t=this._activeBandIndex;this._activeBandIndex=-1,new ce(this.w).highlightRangeInSeries(t,"reset")}_attachHoverListeners(){var t,e;c.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,s;const i=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("heatmap"!==i.config.chart.type)return;const n=null==(s=null==(e=i.seriesData)?void 0:e.series)?void 0:s[r],l=null==n?void 0:n[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:s,stripX:i,stripY:a,stripLength:r,stripThickness:o,arrowSize:n}=this._geom,l=this._min,h=this._max-l;let c;if(c=0===h?.5:(t-l)/h,c<0&&(c=0),c>1&&(c=1),e){const t=a+r-c*r;let e,l;"left"===s?(e=i+o,l=e+n):(e=i,l=e-n);const h=[`${e},${t}`,`${l},${t-n/2}`,`${l},${t+n/2}`].join(" ");this.arrowEl.setAttribute("points",h)}else{const t=i+c*r;let e,l;"top"===s?(e=a+o,l=e+n):(e=a,l=e-n);const h=[`${t},${e}`,`${t-n/2},${l}`,`${t+n/2},${l}`].join(" ");this.arrowEl.setAttribute("points",h)}if(this.arrowEl.setAttribute("opacity","1"),this.hoverValueEl){const l=this._getFormatter();if(this.hoverValueEl.textContent=l(t),e){const t=a+r-c*r;"left"===s?this.hoverValueEl.style.left=`${i+o+n+8}px`:(this.hoverValueEl.style.left=i-n-8+"px",this.hoverValueEl.style.transform="translateX(-100%)"),this.hoverValueEl.style.top=t-9+"px"}else{const t=i+c*r;this.hoverValueEl.style.left=`${t}px`,this.hoverValueEl.style.transform="translateX(-50%)",this.hoverValueEl.style.top="top"===s?`${a+o+n+8}px`:a-n-18+"px"}this.hoverValueEl.style.opacity="1"}}_buildArrow(t,e,s){const i=m.createElementNS(Ls,"polygon");return i.setAttribute("fill",e),i.setAttribute("opacity","0"),i.setAttribute("class","apexcharts-heatmap-gradient-arrow"),i.setAttribute("points","0,0 0,0 0,0"),i.setAttribute("pointer-events","none"),i}_computeStops(){var t,e;const s=this.w,i=s.config.plotOptions.heatmap.colorScale,a=i.gradientLegend;let r=1/0,o=-1/0;const h=(null==(t=s.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 s=e[t];null==s||Number.isNaN(s)||(s<r&&(r=s),s>o&&(o=s))}}Number.isFinite(r)||(r=0),Number.isFinite(o)||(o=0);let c=r,d=o;void 0!==i.min&&(c=i.min<r?i.min:r),void 0!==i.max&&(d=i.max>o?i.max:o);const g=[],p=[];if(i.ranges&&i.ranges.length>0){const t=i.ranges.map((t,e)=>l(n({},t),{_originalIndex:e})).sort((t,e)=>t.from-e.from),e=t[0].from,s=t[t.length-1].to;c=e,d=s;const a=s-e||1;t.forEach(t=>{const s=(t.from-e)/a,i=(t.to-e)/a;g.push({percent:(s+i)/2,color:t.color}),p.push({index:t._originalIndex,p1:s,p2:i})})}else{const t=s.globals.colors[0]||"#008FFB",i=new b,r=null!=(e=s.config.plotOptions.heatmap.shadeIntensity)?e:.5,o=s.globals.hasNegs,n=Math.max(2,a.stops||16);for(let e=0;e<n;e++){const a=e/(n-1),l=c+a*(d-c),h=Math.abs(d)+Math.abs(c),p=0===h?0:100*l/h;let u;u=o?s.config.plotOptions.heatmap.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,u>1&&(u=1),u<-1&&(u=-1);const x=s.config.plotOptions.heatmap.enableShades?i.shadeColor("dark"===s.config.theme.mode?-1*u:u,t):t;g.push({percent:a,color:x})}}return{min:c,max:d,stops:g,bands:p}}}Cs.registerFeatures({legend:class{constructor(t,e){this.w=t,this.ctx=e,this.printDataLabelsInner=(...t)=>{var s;return null==(s=e.pie)?void 0:s.printDataLabelsInner(...t)},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 _s(this)}init(){const t=this.w,e=t.globals,s=t.config;this.isBarsDistributed="bar"===s.chart.type&&s.plotOptions.bar.distributed&&1===s.series.length;const i=s.legend.showForSingleSeries&&1===this.w.seriesData.series.length||this.isBarsDistributed||"heatmap"===s.chart.type||this.w.seriesData.series.length>1;if(this.legendHelpers.appendToForeignObject(),(i||!e.axisCharts)&&s.legend.show){const e=t.dom.elLegendWrap;for(;e.firstChild;)e.removeChild(e.firstChild);this.heatmapGradientLegend&&(this.heatmapGradientLegend.destroy(),this.heatmapGradientLegend=null),"heatmap"===s.chart.type&&Ms.isEnabled(t)?(this.heatmapGradientLegend=new Ms(t,this.ctx),this.heatmapGradientLegend.draw()):(this.drawLegends(),"bottom"===s.legend.position||"top"===s.legend.position?this.legendAlignHorizontal():"right"!==s.legend.position&&"left"!==s.legend.position||this.legendAlignVertical())}}createLegendMarker({i:t,fillcolor:e}){const s=this.w,i=m.createElement("span");i.classList.add("apexcharts-legend-marker");const a=s.config.legend.markers.shape||s.config.markers.shape;let r=a;Array.isArray(a)&&(r=a[t]);const o=Array.isArray(s.config.legend.markers.size)?parseFloat(s.config.legend.markers.size[t]):parseFloat(s.config.legend.markers.size),h=Array.isArray(s.config.legend.markers.offsetX)?parseFloat(s.config.legend.markers.offsetX[t]):parseFloat(s.config.legend.markers.offsetX),d=Array.isArray(s.config.legend.markers.offsetY)?parseFloat(s.config.legend.markers.offsetY[t]):parseFloat(s.config.legend.markers.offsetY),g=Array.isArray(s.config.legend.markers.strokeWidth)?parseFloat(s.config.legend.markers.strokeWidth[t]):parseFloat(s.config.legend.markers.strokeWidth),p=i.style;if(p.height=2*(o+g)+"px",p.width=2*(o+g)+"px",p.left=h+"px",p.top=d+"px",s.config.legend.markers.customHTML)p.background="transparent",p.color=e[t],Array.isArray(s.config.legend.markers.customHTML)?s.config.legend.markers.customHTML[t]&&(i.innerHTML=s.config.legend.markers.customHTML[t]()):i.innerHTML=s.config.legend.markers.customHTML();else{const a=new mt(this.ctx.w,this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${r}`,seriesIndex:t,strokeWidth:g,size:o}),h=(c.isBrowser()?window.SVG:global.SVG)().addTo(i).size("100%","100%"),d=new gt(this.w).drawMarker(0,0,l(n({},a),{pointFillColor:Array.isArray(e)?e[t]:a.pointFillColor,shape:r}));s.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%)"}),h.add(d)}return i}drawLegends(){var t;const e=this,s=this.w,i=s.dom.elLegendWrap,a=s.config.legend.fontFamily;let r=s.seriesData.seriesNames,o=s.config.legend.markers.fillColors?s.config.legend.markers.fillColors.slice():s.globals.colors.slice();if("heatmap"===s.config.chart.type){const t=s.config.plotOptions.heatmap.colorScale.ranges;r=t.map(t=>t.name?t.name:t.from+" - "+t.to),o=t.map(t=>t.color)}else this.isBarsDistributed&&(r=s.labelData.labels.slice());s.config.legend.customLegendItems.length&&(r=s.config.legend.customLegendItems);const n=s.formatters.legendFormatter,l=s.config.legend.inverseOrder,h=[];s.labelData.seriesGroups.length>1&&s.config.legend.clusterGroupedSeries&&s.labelData.seriesGroups.forEach((t,e)=>{h[e]=m.createElement("div"),h[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===s.config.legend.clusterGroupedSeriesOrientation?i.classList.add("apexcharts-legend-group-horizontal"):h[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?r.length-1:0;l?e>=0:e<=r.length-1;l?e--:e++){const l=n(r[e],{seriesIndex:e,w:s});let c=!1,d=!1;if(s.globals.collapsedSeries.length>0)for(let t=0;t<s.globals.collapsedSeries.length;t++)s.globals.collapsedSeries[t].index===e&&(c=!0);if(s.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<s.globals.ancillaryCollapsedSeriesIndices.length;t++)s.globals.ancillaryCollapsedSeriesIndices[t]===e&&(d=!0);const g=this.createLegendMarker({i:e,fillcolor:o});gt.setAttrs(g,{rel:e+1,"data:collapsed":c||d}),(c||d)&&g.classList.add("apexcharts-inactive-legend");const p=m.createElement("div");if(s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled){p.setAttribute("role","button"),p.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=c||d,s=e?"hidden":"visible";p.setAttribute("aria-label",`${t}, ${s}. Press Enter or Space to toggle.`),p.setAttribute("aria-pressed",e?"true":"false")}const u=m.createElement("span");u.classList.add("apexcharts-legend-text"),u.innerHTML=Array.isArray(l)?l.join(" "):l;let x=s.config.legend.labels.useSeriesColors?s.globals.colors[e]:Array.isArray(s.config.legend.labels.colors)?null==(t=s.config.legend.labels.colors)?void 0:t[e]:s.config.legend.labels.colors;x||(x=s.config.chart.foreColor),u.style.color=x,u.style.fontSize=s.config.legend.fontSize,u.style.fontWeight=s.config.legend.fontWeight,u.style.fontFamily=a||s.config.chart.fontFamily,gt.setAttrs(u,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":c||d}),p.appendChild(g),p.appendChild(u);const f=new P(this.w);if(!s.config.legend.showForZeroSeries){0===f.getSeriesTotalByIndex(e)&&f.seriesHaveSameValues(e)&&!f.isSeriesNull(e)&&-1===s.globals.collapsedSeriesIndices.indexOf(e)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-zero-series")}s.config.legend.showForNullSeries||f.isSeriesNull(e)&&-1===s.globals.collapsedSeriesIndices.indexOf(e)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&p.classList.add("apexcharts-hidden-null-series"),h.length?s.labelData.seriesGroups.forEach((t,a)=>{var r,o;t.includes(null!=(o=null==(r=s.config.series[e])?void 0:r.name)?o:"")&&(i.appendChild(h[a]),h[a].appendChild(p))}):i.appendChild(p),i.classList.add(`apexcharts-align-${s.config.legend.horizontalAlign}`),i.classList.add("apx-legend-position-"+s.config.legend.position),p.classList.add("apexcharts-legend-series"),p.style.margin=`${s.config.legend.itemMargin.vertical}px ${s.config.legend.itemMargin.horizontal}px`,i.style.width=s.config.legend.width?s.config.legend.width+"px":"",i.style.height=s.config.legend.height?s.config.legend.height+"px":"",gt.setAttrs(p,{rel:e+1,seriesName:b.escapeString(r[e]),"data:collapsed":c||d}),(c||d)&&p.classList.add("apexcharts-inactive-legend"),s.config.legend.onItemClick.toggleDataSeries||p.classList.add("apexcharts-no-click")}s.dom.elWrap.addEventListener("click",e.onLegendClick,!0),s.config.legend.onItemHover.highlightDataSeries&&0===s.config.legend.customLegendItems.length&&(s.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),s.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){const s=this.w,i=s.dom.elLegendWrap,a=i.clientHeight;let r=0,o=0;if("bottom"===s.config.legend.position)o=s.globals.svgHeight-Math.min(a,s.globals.svgHeight/2)-5;else if("top"===s.config.legend.position){const t=new Ce(this.w,this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,s=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;o=(e>0?e-10:0)+(s>0?s-10:0)}i.style.position="absolute",r=r+t+s.config.legend.offsetX,o=o+e+s.config.legend.offsetY,i.style.left=r+"px",i.style.top=o+"px","right"===s.config.legend.position&&(i.style.left="auto",i.style.right=25+s.config.legend.offsetX+"px");["width","height"].forEach(t=>{i&&i.style[t]&&(i.style[t]=parseInt(String(s.config.legend[t]),10)+"px")})}legendAlignHorizontal(){const t=this.w;t.dom.elLegendWrap.style.right="0";const e=new Ce(this.w,this.ctx),s=e.dimHelpers.getTitleSubtitleCoords("title"),i=e.dimHelpers.getTitleSubtitleCoords("subtitle");let a=0;"top"===t.config.legend.position&&(a=s.height+i.height+t.config.title.margin+t.config.subtitle.margin-10),this.setLegendWrapXY(20,a)}legendAlignVertical(){const t=this.w,e=this.legendHelpers.getLegendDimensions();let s=0;"left"===t.config.legend.position&&(s=20),"right"===t.config.legend.position&&(s=t.globals.svgWidth-e.clww-10),this.setLegendWrapXY(s,20)}onLegendHovered(t){var e;const s=this.w,i=t.target,a=i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker");if("heatmap"===s.config.chart.type||this.isBarsDistributed){if(a){const s=parseInt(null!=(e=i.getAttribute("rel"))?e:"0",10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,s,this.w]);const a=new ce(this.ctx.w);"mousemove"===t.type?a.highlightRangeInSeries(s,"highlight"):"mouseout"===t.type&&a.highlightRangeInSeries(s,"reset")}}else if(!i.classList.contains("apexcharts-inactive-legend")&&a){new ce(this.ctx.w).toggleSeriesOnHover(t,i)}}onLegendKeyDown(t){const e=this,s=this.w,i=t.target;if((i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))&&("Enter"===t.key||" "===t.key)){t.preventDefault();const a=i.getAttribute("rel");e.onLegendClick(t),null!==a&&s.config.legend.onItemClick.toggleDataSeries&&requestAnimationFrame(()=>{const t=s.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${a}"]`);t&&t.focus()})}}onLegendClick(t){var e;const s=this.w,i=t.target;if(!s.config.legend.customLegendItems.length&&(i.classList.contains("apexcharts-legend-series")||i.classList.contains("apexcharts-legend-text")||i.classList.contains("apexcharts-legend-marker"))){const t=parseInt(null!=(e=i.getAttribute("rel"))?e:"0",10)-1,a="true"===i.getAttribute("data:collapsed"),r=this.w.config.chart.events.legendClick;"function"==typeof r&&r(this.ctx,t,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,t,this.w]);const o=this.w.config.legend.markers.onClick;"function"==typeof o&&i.classList.contains("apexcharts-legend-marker")&&(o(this.ctx,t,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,t,this.w]));"treemap"!==s.config.chart.type&&"heatmap"!==s.config.chart.type&&!this.isBarsDistributed&&s.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(t,a)}}}});class Ds{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 s=this.w,i=()=>m.createElementNS("http://www.w3.org/1999/xhtml","div"),a=()=>{const t=m.createElementNS("http://www.w3.org/1999/xhtml","button");return t.setAttribute("type","button"),t},r=i();if(r.setAttribute("class","apexcharts-toolbar"),r.style.top=s.config.chart.toolbar.offsetY+"px",r.style.right=3-s.config.chart.toolbar.offsetX+"px",s.dom.elWrap.appendChild(r),this.elZoom=a(),this.elZoomIn=a(),this.elZoomOut=a(),this.elPan=a(),this.elSelection=a(),this.elMeasure=a(),this.elZoomReset=a(),this.elMenuIcon=a(),this.elMenu=i(),this.elCustomIcons=[],this.t=s.config.chart.toolbar.tools,Array.isArray(this.t.customIcons))for(let t=0;t<this.t.customIcons.length;t++)this.elCustomIcons.push(a());const o=[],n=(t,e,i)=>{const a=t.toLowerCase();this.t[a]&&s.config.chart.zoom.enabled&&o.push({el:e,icon:"string"==typeof this.t[a]?this.t[a]:i,title:this.localeValues[t],class:`apexcharts-${a}-icon`})};n("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'),n("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]&&s.config.chart[t].enabled&&o.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&&s.config.chart.zoom.enabled&&o.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&&s.config.chart.measure&&s.config.chart.measure.enabled&&o.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"}),n("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&&o.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++)o.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});o.forEach((t,e)=>{t.index&&b.moveIndexInArray(o,e,t.index)});for(let t=0;t<o.length;t++)gt.setAttrs(o[t].el,{class:o[t].class,title:o[t].title,"aria-label":o[t].title}),o[t].el.innerHTML=o[t].icon,r.appendChild(o[t].el);this.elZoom.parentNode&&this.elZoom.setAttribute("aria-pressed",String(!!s.interact.zoomEnabled)),this.elSelection.parentNode&&this.elSelection.setAttribute("aria-pressed",String(!!s.interact.selectionEnabled)),this.elPan.parentNode&&this.elPan.setAttribute("aria-pressed",String(!!s.interact.panEnabled)),this.elMeasure.parentNode&&this.elMeasure.setAttribute("aria-pressed",String(!!s.interact.measureEnabled)),this.elMenuIcon.parentNode&&(this.elMenuIcon.setAttribute("aria-haspopup","true"),this.elMenuIcon.setAttribute("aria-expanded","false")),this._createHamburgerMenu(r),s.interact.zoomEnabled?this.elZoom.classList.add(this.selectedClass):s.interact.panEnabled?this.elPan.classList.add(this.selectedClass):s.interact.selectionEnabled?this.elSelection.classList.add(this.selectedClass):s.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),gt.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,gt.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,s,i,a,r,o,n,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==(s=this.elZoom)||s.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),null==(i=this.elZoomIn)||i.addEventListener("click",this.handleZoomIn.bind(this)),null==(a=this.elZoomOut)||a.addEventListener("click",this.handleZoomOut.bind(this)),null==(r=this.elPan)||r.addEventListener("click",this.togglePanning.bind(this)),null==(o=this.elMeasure)||o.addEventListener("click",this.toggleMeasure.bind(this)),null==(n=this.elMenuIcon)||n.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 s=t.className;t.click(),requestAnimationFrame(()=>{const t=this.w.dom.baseEl;if(!t)return;const e=s.split(" ").find(t=>t.startsWith("apexcharts-"));if(!e)return;const i=t.querySelector(`.${e}`);i&&i.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",s=>{var i;if("ArrowDown"===s.key){s.preventDefault();(this.elMenuItems[e+1]||this.elMenuItems[0]).focus()}else if("ArrowUp"===s.key){s.preventDefault();(this.elMenuItems[e-1]||this.elMenuItems[this.elMenuItems.length-1]).focus()}else"Escape"===s.key||"Tab"===s.key?(this._closeMenu(),null==(i=this.elMenuIcon)||i.focus(),"Tab"===s.key||s.preventDefault()):"Enter"!==s.key&&" "!==s.key||(s.preventDefault(),t.click())})})}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{const s=e.ctx.toolbar,i="selection"===t?"selectionEnabled":"zoomEnabled",a=!!e.w.globals[i];s.toggleOtherControls();const r="selection"===t?s.elSelection:s.elZoom;a||(e.w.globals[i]=!0,r.classList.add(s.selectedClass)),r.setAttribute("aria-pressed",String(!!e.w.globals[i]))})}toggleMeasure(){var t,e,s,i;const a=this.w,r=!a.interact.measureEnabled;this.toggleOtherControls(),r&&(a.interact.measureEnabled=!0,null==(t=this.elMeasure)||t.classList.add(this.selectedClass),null==(s=null==(e=this.ctx.measure)?void 0:e.startMeasure)||s.call(e)),null==(i=this.elMeasure)||i.setAttribute("aria-pressed",String(a.interact.measureEnabled))}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.dom.baseEl.querySelector(".apexcharts-selection-icon")),this.elMeasure||(this.elMeasure=t.dom.baseEl.querySelector(".apexcharts-measure-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.interact.panEnabled=!0:this.w.interact.zoomEnabled=!0;const e="pan"===t?this.elPan:this.elZoom,s="pan"===t?this.elZoom:this.elPan;e&&e.classList.add(this.selectedClass),s&&s.classList.remove(this.selectedClass)}togglePanning(){this.ctx.getSyncedCharts().forEach(t=>{const e=t.ctx.toolbar,s=!!t.w.interact.panEnabled;e.toggleOtherControls(),s||(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,s;const i=this.w;i.interact.panEnabled=!1,i.interact.zoomEnabled=!1,i.interact.selectionEnabled=!1,i.interact.measureEnabled&&(i.interact.measureEnabled=!1,null==(e=null==(t=this.ctx.measure)?void 0:t.stopMeasure)||e.call(t),null==(s=this.elMeasure)||s.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:s}=this._currentXRange();this.minX=e,this.maxX=s;const i=(e+s)/2,a=(e+i)/2,r=(s+i)/2,o=this._getNewMinXMaxX(a,r);t.interact.disableZoomIn||this.zoomUpdateOptions(o.minX,o.maxX)}handleZoomOut(){const t=this.w,{minX:e,maxX:s}=this._currentXRange();if(this.minX=e,this.maxX=s,"datetime"===t.config.xaxis.type&&new Date(e).getUTCFullYear()<1e3)return;const i=(e+s)/2,a=e-(i-e),r=s-(i-s),o=this._getNewMinXMaxX(a,r);t.interact.disableZoomOut||this.zoomUpdateOptions(o.minX,o.maxX)}_getNewMinXMaxX(t,e){const s=this.w.config.xaxis.convertedCatToNumeric;return{minX:s?Math.floor(t):t,maxX:s?Math.floor(e):e}}zoomUpdateOptions(t,e){const s=this.w;if(void 0===t&&void 0===e)return void this.handleZoomReset();if(s.config.xaxis.convertedCatToNumeric&&(t<1&&(t=1,e=s.globals.dataPoints),e-t<2))return;let i={min:t,max:e};const a=this.getBeforeZoomRange(i,void 0);a&&(i=a.xaxis);const r={xaxis:i};if(!s.globals.initialConfig)return;const o=b.clone(s.globals.initialConfig.yaxis);s.config.chart.group||(r.yaxis=o),this.w.interact.zoomed=!0,this.ctx.updateHelpers._updateOptions(r,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(i,o)}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 s=null;return"function"==typeof this.ev.beforeZoom&&(s=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),s}toggleMenu(){window.setTimeout(()=>{var t,e,s;(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==(s=this.elMenuIcon)||s.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,s=new ks(this.w,this.ctx);switch(t){case"svg":s.exportToSVG();break;case"png":s.exportToPng();break;case"csv":s.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 s=e.config.chart.events.beforeResetZoom(t,e);s&&t.updateHelpers.revertDefaultAxisMinMax(s)}"function"==typeof e.config.chart.events.zoomed&&t.ctx.toolbar.zoomCallback({min:e.config.xaxis.min,max:e.config.xaxis.max});const s=t.ctx.series.emptyCollapsedSeries(b.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(s,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}}Cs.registerFeatures({toolbar:Ds,zoomPanSelection:class extends Ds{constructor(t,e){super(t,e),this.w=t,this.ctx=e,this.dragged=!1,this.graphics=new gt(this.w),this.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend","wheel"],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",this.debounceTimer=null,this.debounceDelay=100,this.wheelDelay=400}init({xyRatios:t}){const e=this.w,s=this;this.xyRatios=t,this.zoomRect=this.graphics.drawRect(0,0,0,0),this.selectionRect=this.graphics.drawRect(0,0,0,0),this.gridRect=e.dom.baseEl.querySelector(".apexcharts-grid"),this.constraints=new X(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 i;null==(i=this.hoverArea)||i.addEventListener(e,s.svgMouseEvents.bind(s,t),{capture:!1,passive:!0})}),e.config.chart.zoom.enabled&&e.config.chart.zoom.allowMouseWheelZoom&&this.hoverArea.addEventListener("wheel",s.mouseWheelEvent.bind(s),{capture:!1,passive:!1}),this._momentumEnabled()&&["touchstart","touchmove","touchend","touchcancel"].forEach(t=>{var e;null==(e=this.hoverArea)||e.addEventListener(t,s.momentumTouch.bind(s),{capture:!1,passive:!1})}))}destroy(){this.slDraggableRect&&(this.slDraggableRect.draggable(!1),this.slDraggableRect.off(),this.selectionRect.off()),this.selectionRect=null,this.zoomRect=null,this.gridRect=null}svgMouseEvents(t,e){var s;const i=this.w,a=this.ctx.toolbar;if(i.interact.momentum&&i.interact.momentum.busy)return;if(this._momentumEnabled()&&e.touches&&e.touches.length>1)return;const r=i.interact.zoomEnabled?i.config.chart.zoom.type:i.config.chart.selection.type,o=i.config.chart.toolbar.autoSelected;if("measure"!==o&&(e.shiftKey?(this.shiftWasPressed=!0,a.enableZoomPanFromToolbar("pan"===o?"zoom":"pan")):this.shiftWasPressed&&(a.enableZoomPanFromToolbar(o),this.shiftWasPressed=!1)),!e.target)return;const n=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(n.contains("apexcharts-legend-marker")||n.contains("apexcharts-legend-text")||l&&l.contains("apexcharts-toolbar"))){if(this.clientX="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientX:"touchend"===e.type?e.changedTouches[0].clientX:e.clientX,this.clientY="touchmove"===e.type||"touchstart"===e.type?e.touches[0].clientY:"touchend"===e.type?e.changedTouches[0].clientY:e.clientY,"mousedown"===e.type&&1===e.which||"touchstart"===e.type){const t=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();if(!t)return;this.startX=this.clientX-t.left-i.globals.barPadForNumericAxis,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:r,xyRatios:t})):(this.w.interact.mousedown&&i.interact.zoomEnabled||this.w.interact.mousedown&&i.interact.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:r}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:r}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){var s;const i=this.w,a=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();a&&(this.w.interact.mousedown||e)&&(this.endX=this.clientX-a.left-i.globals.barPadForNumericAxis,this.endY=this.clientY-a.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}mouseWheelEvent(t){const e=this.w;t.preventDefault();const s=Date.now();s-e.interact.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.interact.lastWheelExecution=s),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{s-e.interact.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.interact.lastWheelExecution=s)},this.debounceDelay)}executeMouseWheelZoom(t){var e,s,i;const a=this.w;this.minX=a.axisFlags.isRangeBar?a.globals.minY:a.globals.minX,this.maxX=a.axisFlags.isRangeBar?a.globals.maxY:a.globals.maxX;const r=null==(e=this.gridRect)?void 0:e.getBoundingClientRect();if(!r)return;const o=(t.clientX-r.left)/r.width,n=this.minX,l=this.maxX,h=l-n;let c,d,g;if(t.deltaY<0){c=.5*h;const t=n+o*h;d=t-c/2,g=t+c/2}else c=1.5*h,d=n-c/2,g=l+c/2;if(!a.axisFlags.isRangeBar){const t=null!=(s=a.globals.dataReducerRawMinX)?s:a.globals.initialMinX,e=null!=(i=a.globals.dataReducerRawMaxX)?i:a.globals.initialMaxX;d=Math.max(d,t),g=Math.min(g,e);const r=a.globals.minXDiff>0&&isFinite(a.globals.minXDiff)?a.globals.minXDiff:0,o=Math.max(2*r,1e-6*(e-t));if(g-d<o){const t=(d+g)/2;d=t-o/2,g=t+o/2}}const p=this._getNewMinXMaxX(d,g);isNaN(p.minX)||isNaN(p.maxX)||this.zoomUpdateOptions(p.minX,p.maxX)}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,s,i,a)=>"l"===a||"r"===a?t.circle(8).css({"stroke-width":1,stroke:"#333",fill:"#fff"}):t.circle(0),updateHandle:(t,e)=>t.center(e[0],e[1])}).resize().on("resize",()=>{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(n({},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 s=(t.config.chart.selection.xaxis.min-t.globals.minX)/e.xRatio,i=t.layout.gridWidth-(t.globals.maxX-t.config.chart.selection.xaxis.max)/e.xRatio-s;t.axisFlags.isRangeBar&&(s=(t.config.chart.selection.xaxis.min-t.globals.yAxisScale[0].niceMin)/e.invertedYRatio,i=(t.config.chart.selection.xaxis.max-t.config.chart.selection.xaxis.min)/e.invertedYRatio);const a={x:s,y:0,width:i,height:t.layout.gridHeight,translateX:t.layout.translateX,translateY:t.layout.translateY,selectionEnabled:!0};this.drawSelectionRect(a),this.makeSelectionRectDraggable(),"function"==typeof t.config.chart.events.selection&&t.config.chart.events.selection(this.ctx,{xaxis:{min:t.config.chart.selection.xaxis.min,max:t.config.chart.selection.xaxis.max},yaxis:{}})}}drawSelectionRect({x:t,y:e,width:s,height:i,translateX:a=0,translateY:r=0}){const o=this.w,n=this.zoomRect,l=this.selectionRect;if(this.dragged||null!==o.interact.selection){const h={transform:"translate("+a+", "+r+")"};o.interact.zoomEnabled&&this.dragged&&(s<0&&(s=1),n.attr({x:t,y:e,width:s,height:i,fill:o.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":o.config.chart.zoom.zoomedArea.fill.opacity,stroke:o.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":o.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":o.config.chart.zoom.zoomedArea.stroke.opacity}),gt.setAttrs(n.node,h)),o.interact.selectionEnabled&&(l.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,fill:o.config.chart.selection.fill.color,"fill-opacity":o.config.chart.selection.fill.opacity,stroke:o.config.chart.selection.stroke.color,"stroke-width":o.config.chart.selection.stroke.width,"stroke-dasharray":o.config.chart.selection.stroke.dashArray,"stroke-opacity":o.config.chart.selection.stroke.opacity}),gt.setAttrs(l.node,h))}}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){var s;const i=this.w,a=t,r=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();if(!r)return;const o=a.startX-1,h=a.startY;let c=!1,d=!1;const g=a.clientX-r.left-i.globals.barPadForNumericAxis,p=a.clientY-r.top;let u=g-o,x=p-h,f={translateX:i.layout.translateX,translateY:i.layout.translateY};return Math.abs(u+o)>i.layout.gridWidth?u=i.layout.gridWidth-o:g<0&&(u=o),o>g&&(c=!0,u=Math.abs(u)),h>p&&(d=!0,x=Math.abs(x)),f="x"===e?{x:c?o-u:o,y:0,width:u,height:i.layout.gridHeight}:"y"===e?{x:0,y:d?h-x:h,width:i.layout.gridWidth,height:x}:{x:c?o-u:o,y:d?h-x:h,width:u,height:x},f=l(n({},f),{translateX:i.layout.translateX,translateY:i.layout.translateY}),a.drawSelectionRect(f),a.selectionDragging("resizing"),f}selectionDragging(t,e){var s;const i=this.w;if(!e)return;e.preventDefault();const{handler:a,box:r}=e.detail,o=this.constraints;let{x:n,y:l}=r;n<o.x&&(n=o.x),l<o.y&&(l=o.y),r.x2>o.x2&&(n=o.x2-r.w),r.y2>o.y2&&(l=o.y2-r.h),a.move(n,l);const h=this.xyRatios,c=this.selectionRect;let d=0;"resizing"===t&&(d=30);const g=t=>parseFloat(c.node.getAttribute(t)),p={x:g("x"),y:g("y"),width:g("width"),height:g("height")};i.interact.selection=p;const u=i.config.chart.link,x=!(!u||!u.enabled&&"function"!=typeof u.dimension);("function"==typeof i.config.chart.events.selection||x)&&i.interact.selectionEnabled&&(clearTimeout(null!=(s=this.w.globals.selectionResizeTimer)?s:void 0),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{var t,e;const s=null==(t=this.gridRect)?void 0:t.getBoundingClientRect();if(!s)return;const a=c.node.getBoundingClientRect();let r,o,n,l;const d=a.left-s.left-i.globals.barPadForNumericAxis,g=a.right-s.left-i.globals.barPadForNumericAxis;if(i.axisFlags.isRangeBar)r=i.globals.yAxisScale[0].niceMin+d*h.invertedYRatio,o=i.globals.yAxisScale[0].niceMin+g*h.invertedYRatio,n=0,l=1;else{if(!i.globals.xAxisScale)return;r=i.globals.xAxisScale.niceMin+d*h.xRatio,o=i.globals.xAxisScale.niceMin+g*h.xRatio,n=i.globals.yAxisScale[0].niceMin+(s.bottom-a.bottom)*h.yRatio[0],l=i.globals.yAxisScale[0].niceMax-(a.top-s.top)*h.yRatio[0]}const p={xaxis:{min:r,max:o},yaxis:{min:n,max:l}};"function"==typeof i.config.chart.events.selection&&i.config.chart.events.selection(this.ctx,p),i.config.chart.brush.enabled&&void 0!==i.config.chart.events.brushScrolled&&i.config.chart.events.brushScrolled(this.ctx,p),null==(e=this.ctx.linkedViews)||e.onSourceSelection(p.xaxis)},d))}selectionDrawn({context:t,zoomtype:e}){var s,i,a;const r=this.w,o=t,n=this.xyRatios,l=this.ctx.toolbar,h=r.interact.zoomEnabled?o.zoomRect.node.getBoundingClientRect():o.selectionRect.node.getBoundingClientRect(),c=o.gridRect.getBoundingClientRect(),d=h.left-c.left-r.globals.barPadForNumericAxis,g=h.right-c.left-r.globals.barPadForNumericAxis,p=h.top-c.top,u=h.bottom-c.top;let x,f;if(r.axisFlags.isRangeBar)x=r.globals.yAxisScale[0].niceMin+d*n.invertedYRatio,f=r.globals.yAxisScale[0].niceMin+g*n.invertedYRatio;else{const t=null!=(i=null==(s=r.globals.xAxisScale)?void 0:s.niceMin)?i:0;x=t+d*n.xRatio,f=t+g*n.xRatio}const m=[],y=[];if(r.config.yaxis.forEach((t,e)=>{const s=r.globals.seriesYAxisMap[e][0],i=r.globals.yAxisScale[e].niceMax-n.yRatio[s]*p,a=r.globals.yAxisScale[e].niceMax-n.yRatio[s]*u;m.push(i),y.push(a)}),o.dragged&&(o.dragX>10||o.dragY>10)&&x!==f)if(r.interact.zoomEnabled){if(!r.globals.initialConfig)return;let t=b.clone(r.globals.initialConfig.yaxis),s=b.clone(r.globals.initialConfig.xaxis);if(r.interact.zoomed=!0,r.config.xaxis.convertedCatToNumeric&&(x=Math.floor(x),f=Math.floor(f),x<1&&(x=1,f=r.globals.dataPoints),f-x<2&&(f=x+1)),"xy"!==e&&"x"!==e||(s={min:x,max:f}),"xy"!==e&&"y"!==e||t.forEach((e,s)=>{t[s].min=y[s],t[s].max=m[s]}),l){const e=l.getBeforeZoomRange(s,t);e&&(s=e.xaxis?e.xaxis:s,t=e.yaxis?e.yaxis:t)}const i={xaxis:s};r.config.chart.group||(i.yaxis=t),o.ctx.updateHelpers._updateOptions(i,!1,o.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof r.config.chart.events.zoomed&&l.zoomCallback(s,t)}else if(r.interact.selectionEnabled){let t=null,s=null;if(s={min:x,max:f},"xy"===e||"y"===e){const e=b.clone(r.config.yaxis);t=e,e.forEach((t,s)=>{e[s].min=y[s],e[s].max=m[s]})}r.interact.selection=o.selection,"function"==typeof r.config.chart.events.selection&&r.config.chart.events.selection(o.ctx,{xaxis:s,yaxis:t}),null==(a=o.ctx.linkedViews)||a.onSourceSelection(s)}}panDragging({context:t}){var e;const s=this.w,i=t;if(void 0!==s.interact.lastClientPosition.x){const t=s.interact.lastClientPosition.x-i.clientX,a=(null!=(e=s.interact.lastClientPosition.y)?e:0)-i.clientY;Math.abs(t)>Math.abs(a)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(a)&&t<0?this.moveDirection="right":Math.abs(a)>Math.abs(t)&&a>0?this.moveDirection="up":Math.abs(a)>Math.abs(t)&&a<0&&(this.moveDirection="down")}s.interact.lastClientPosition={x:i.clientX,y:i.clientY};const a=s.axisFlags.isRangeBar?s.globals.minY:s.globals.minX,r=s.axisFlags.isRangeBar?s.globals.maxY:s.globals.maxX;i.panScrolled(a,r)}panScrolled(t,e){var s,i;const a=this.w,r=this.xyRatios;if(!a.globals.initialConfig)return;const o=b.clone(a.globals.initialConfig.yaxis);let n=r.xRatio,l=a.globals.minX,h=a.globals.maxX;if(a.axisFlags.isRangeBar&&(n=r.invertedYRatio,l=a.globals.minY,h=a.globals.maxY),"left"===this.moveDirection?(t=l+a.layout.gridWidth/15*n,e=h+a.layout.gridWidth/15*n):"right"===this.moveDirection&&(t=l-a.layout.gridWidth/15*n,e=h-a.layout.gridWidth/15*n),!a.axisFlags.isRangeBar){const r=null!=(s=a.globals.dataReducerRawMinX)?s:a.globals.initialMinX,o=null!=(i=a.globals.dataReducerRawMaxX)?i:a.globals.initialMaxX;(t<r||e>o)&&(t=l,e=h)}const c={xaxis:{min:t,max:e}};a.config.chart.group||(c.yaxis=o),this.updateScrolledChart(c,t,e)}updateScrolledChart(t,e,s){const i=this.w;if(this.ctx.updateHelpers._updateOptions(t,!1,!1),"function"==typeof i.config.chart.events.scrolled){const t={xaxis:{min:e,max:s}};i.config.chart.events.scrolled(this.ctx,t),this.ctx.events.fireEvent("scrolled",t)}}_momentumEnabled(){return this._pinchEnabled()||this._panInertiaEnabled()}_pinchEnabled(){const t=this.w.config.chart;return!!(t.zoom&&t.zoom.enabled&&t.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}_clampBounds(){var t,e;const s=this.w;return s.axisFlags.isRangeBar?null:{min:null!=(t=s.globals.dataReducerRawMinX)?t:s.globals.initialMinX,max:null!=(e=s.globals.dataReducerRawMaxX)?e:s.globals.initialMaxX}}_applyXRange(t,e,s){const i=this.w;if(!i.globals.initialConfig)return!1;const a=this._clampBounds();if(a){const s=e-t;t<a.min&&(e=(t=a.min)+s),e>a.max&&(t=(e=a.max)-s),t<a.min&&(t=a.min)}if(i.config.xaxis.convertedCatToNumeric&&((t=Math.floor(t))<1&&(t=1),(e=Math.floor(e))-t<2))return!1;if(!(e>t))return!1;const r={xaxis:{min:t,max:e}};return i.config.chart.group||(r.yaxis=b.clone(i.globals.initialConfig.yaxis)),s&&(i.interact.zoomed=!0),this.ctx.updateHelpers._updateOptions(r,!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:s}=this._currentXWindow(),i={xaxis:{min:e,max:s}};t.config.chart.events.scrolled(this.ctx,i),this.ctx.events.fireEvent("scrolled",i)}_pushSample(t,e){const s=this._m().samples;for(s.push({x:t,t:e});s.length>6;)s.shift()}momentumTouch(t){const e=this.w,s=this._m(),i=t.type;if("touchstart"===i){this._cancelInertia();const i=this._gridRect();if(!i)return;if(t.touches.length>=2&&this._pinchEnabled())t.preventDefault(),s.busy=!0,s.panState=null,this._beginPinch(t,i);else if(1===t.touches.length&&this._panInertiaEnabled()&&e.interact.panEnabled){s.busy=!0,s.pinch=null;const i=t.touches[0],a=this._currentXWindow(),r=e.layout.gridWidth||1;s.panState={startX:i.clientX,startY:i.clientY,axis:null,minX0:a.min,maxX0:a.max,ratio0:(a.max-a.min)/r},s.samples=[{x:i.clientX,t:t.timeStamp}]}return}"touchmove"!==i?(s.pinch?t.touches.length<2&&this._endPinch():s.panState&&0===t.touches.length&&this._endPan(),0===t.touches.length&&(e.interact.mousedown=!1,this.dragged=!1,null!=s.inertiaRAF||s.pinch||s.panState||(s.busy=!1))):s.pinch&&t.touches.length>=2?(t.preventDefault(),this._movePinch(t)):s.panState&&1===t.touches.length&&this._movePan(t)}_beginPinch(t,e){const s=this.w,i=t.touches[0],a=t.touches[1],r=Math.hypot(a.clientX-i.clientX,a.clientY-i.clientY)||1,o=(i.clientX+a.clientX)/2-e.left-s.globals.barPadForNumericAxis,{min:n,max:l}=this._currentXWindow();this._m().pinch={d0:r,cx0:o,minX0:n,maxX0:l,gridWidth:s.layout.gridWidth||1}}_movePinch(t){const e=this.w,s=this._m().pinch;if(!s)return;const i=this._gridRect();if(!i)return;const a=t.touches[0],r=t.touches[1],o=Math.hypot(r.clientX-a.clientX,r.clientY-a.clientY)||1,n=(a.clientX+r.clientX)/2-i.left-e.globals.barPadForNumericAxis,l=s.maxX0-s.minX0,h=l*(s.d0/o);let c=s.minX0+s.cx0/s.gridWidth*l-n/s.gridWidth*h,d=c+h;const g=this._clampBounds();if(g){const t=e.globals.minXDiff>0&&isFinite(e.globals.minXDiff)?e.globals.minXDiff:0,s=Math.max(2*t,1e-6*(g.max-g.min));if(d-c<s){const t=(c+d)/2;c=t-s/2,d=t+s/2}}this._applyXRange(c,d,!0)}_endPinch(){const t=this.w;this._m().pinch=null;const{min:e,max:s}=this._currentXWindow(),i={min:e,max:s},a=t.globals.initialConfig?b.clone(t.globals.initialConfig.yaxis):[],r=this.ctx.toolbar;r&&r.zoomCallback(i,a)}_movePan(t){const e=this._m(),s=e.panState,i=t.touches[0];if(!s.axis){const a=Math.abs(i.clientX-s.startX),r=Math.abs(i.clientY-s.startY);if(a<6&&r<6)return void this._pushSample(i.clientX,t.timeStamp);if(r>a)return e.busy=!1,void(e.panState=null);s.axis="x"}if("x"!==s.axis)return;t.preventDefault();const a=(i.clientX-s.startX)*s.ratio0;this._pushSample(i.clientX,t.timeStamp),this._applyXRange(s.minX0-a,s.maxX0-a,!1)}_endPan(){const t=this._m(),e=t.panState;t.panState=null;let s=0;const i=t.samples;if(i.length>=2){const t=i[0],e=i[i.length-1],a=e.t-t.t;a>0&&(s=(e.x-t.x)/a)}t.samples=[],e&&"x"===e.axis&&this._panInertiaEnabled()&&Math.abs(s)>.05?this._startInertia(s):(t.busy=!1,this._fireScrolled())}_startInertia(t){const e=this.w,s=this._m(),i=e.config.chart.pan&&e.config.chart.pan.friction,a="number"==typeof i?Math.min(Math.max(i,.5),.999):.92;let r=t,o=null;s.busy=!0;const n=t=>{if(e.globals.isDestroyed)return s.inertiaRAF=null,void(s.busy=!1);if(null==o)return o=t,void(s.inertiaRAF=requestAnimationFrame(n));const i=t-o;if(o=t,r*=Math.pow(a,i/16.6667),Math.abs(r)<.02)return s.inertiaRAF=null,s.busy=!1,void this._fireScrolled();const l=this._currentXWindow(),h=e.layout.gridWidth||1,c=(l.max-l.min)/h,d=r*i*c,g=this._applyXRange(l.min-d,l.max-d,!1),p=this._clampBounds();if(!g||p&&(d>0&&g.minX<=p.min+1e-6*(p.max-p.min)||d<0&&g.maxX>=p.max-1e-6*(p.max-p.min)))return s.inertiaRAF=null,s.busy=!1,void this._fireScrolled();s.inertiaRAF=requestAnimationFrame(n)};s.inertiaRAF=requestAnimationFrame(n)}}});let Es=class{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){var s,i;const a=this.w;if("vertical"===t.label.orientation){const r=null!==e?e:0,o=a.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${r}']`);if(null!==o){const e=o.getBBox();o.setAttribute("x",String(parseFloat(null!=(s=o.getAttribute("x"))?s:"0")-e.height+4));const a="top"===t.label.position?e.width:-e.width;o.setAttribute("y",String(parseFloat(null!=(i=o.getAttribute("y"))?i:"0")+a));const{x:r,y:n}=this.annoCtx.graphics.rotateAroundCenter(o);o.setAttribute("transform",`rotate(-90 ${r} ${n})`)}}}addBackgroundToAnno(t,e){const s=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const i=s.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const a=i.getBoundingClientRect(),r=i.getBBox(),o=a.width/r.width||1,n=t.getBoundingClientRect();let{left:l,right:h,top:c,bottom:d}=e.label.style.padding;"vertical"===e.label.orientation&&([c,d,l,h]=[l,h,c,d]);const g=(n.left-a.left)/o-l,p=(n.top-a.top)/o-c,u=this.annoCtx.graphics.drawRect(g-s.globals.barPadForNumericAxis,p,n.width/o+l+h,n.height/o+c+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&u.node.classList.add(e.id),u}annotationsBackground(){const t=this.w,e=(e,s,i)=>{const a=t.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${s}']`);if(a){const s=a.parentNode,i=this.addBackgroundToAnno(a,e);if(i){null==s||s.insertBefore(i.node,a);const r=a.getAttribute("x");null!==r&&nt(i,parseFloat(r),t),e.label.mouseEnter&&i.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&i.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&i.node.addEventListener("click",e.label.click.bind(this,e))}}};t.config.annotations.xaxis.forEach((t,s)=>e(t,s,"xaxis")),t.config.annotations.yaxis.forEach((t,s)=>e(t,s,"yaxis")),t.config.annotations.points.forEach((t,s)=>e(t,s,"point"))}getY1Y2(t,e){var s,i;const a=this.w,r="y1"===t?e.y:e.y2;let o,n=!1;if(this.annoCtx.invertAxis){const t=a.config.xaxis.convertedCatToNumeric?a.labelData.categoryLabels:a.labelData.labels,i=t.indexOf(r),n=a.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${i+1})`);o=n?parseFloat(null!=(s=n.getAttribute("y"))?s:"0"):(a.layout.gridHeight/t.length-1)*(i+1)-a.globals.barHeight,void 0!==e.seriesIndex&&a.globals.barHeight&&(o-=a.globals.barHeight/2*(a.seriesData.series.length-1)-a.globals.barHeight*e.seriesIndex)}else{const t=a.globals.seriesYAxisMap[e.yAxisIndex][0],s=a.config.yaxis[e.yAxisIndex].logarithmic?new P(this.w).getLogVal(a.config.yaxis[e.yAxisIndex].logBase,r,t)/a.globals.yLogRatio[t]:(r-a.globals.minYArr[t])/(a.globals.yRange[t]/a.layout.gridHeight);o=a.layout.gridHeight-Math.min(Math.max(s,0),a.layout.gridHeight),n=s>a.layout.gridHeight||s<0,!e.marker||void 0!==e.y&&null!==e.y||(o=0),(null==(i=a.config.yaxis[e.yAxisIndex])?void 0:i.reversed)&&(o=s)}return"string"==typeof r&&r.includes("px")&&(o=parseFloat(r)),{yP:o,clipped:n}}getX1X2(t,e){const s=this.w,i="x1"===t?e.x:e.x2,a=this.annoCtx.invertAxis?s.globals.minY:s.globals.minX,r=this.annoCtx.invertAxis?s.globals.maxY:s.globals.maxX,o=this.annoCtx.invertAxis?s.globals.yRange[0]:s.globals.xRange;let n=!1,l=this.annoCtx.inversedReversedAxis?(r-i)/(o/s.layout.gridWidth):(i-a)/(o/s.layout.gridWidth);return"category"!==s.config.xaxis.type&&!s.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||s.axisFlags.dataFormatXNumeric||s.config.chart.sparkline.enabled||(l=this.getStringX(i)),"string"==typeof i&&i.includes("px")&&(l=parseFloat(i)),null==i&&e.marker&&(l=s.layout.gridWidth),void 0!==e.seriesIndex&&s.globals.barWidth&&!this.annoCtx.invertAxis&&(l-=s.globals.barWidth/2*(s.seriesData.series.length-1)-s.globals.barWidth*e.seriesIndex),"number"!=typeof l&&(l=0,n=!0),parseFloat(l.toFixed(10))>parseFloat(s.layout.gridWidth.toFixed(10))?(l=s.layout.gridWidth,n=!0):l<0&&(l=0,n=!0),{x:l,clipped:n}}getStringX(t){var e;const s=this.w;let i=t;if(s.config.xaxis.convertedCatToNumeric&&s.labelData.categoryLabels.length){const e=String(t);t=s.labelData.categoryLabels.findIndex(t=>String(t)===e)+1}const a=s.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),r=s.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${a+1})`);return r&&(i=parseFloat(null!=(e=r.getAttribute("x"))?e:"0")),i}};class Ps{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new Es(this.annoCtx)}addXaxisAnnotation(t,e,s){const i=this.w,a=this.helpers.getX1X2("x1",t);let r=a.x;const o=a.clipped;let n,l=!0;const h=t.label.text,c=t.strokeDashArray;if(b.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!o){const s=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,i.layout.gridHeight+t.offsetY,t.borderColor,c,t.borderWidth);e.appendChild(s.node),t.id&&s.node.classList.add(t.id),nt(s,r+t.offsetX,i)}}else{const s=this.helpers.getX1X2("x2",t);if(n=s.x,l=s.clipped,n<r){const t=r;r=n,n=t}const a=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,n-r,i.layout.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,c);a.node.classList.add("apexcharts-annotation-rect"),a.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`),e.appendChild(a.node),t.id&&a.node.classList.add(t.id),nt(a,r+t.offsetX,i)}if(!o||!l){const a=this.annoCtx.graphics.getTextRects(h,t.label.style.fontSize),o="top"===t.label.position?4:"center"===t.label.position?i.layout.gridHeight/2+("vertical"===t.label.orientation?a.width/2:0):i.layout.gridHeight,n=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:o+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?a.width/2-12:-a.width/2:0),text:h,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-xaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});n.attr({rel:s}),e.appendChild(n.node),nt(n,r+t.label.offsetX,i),this.annoCtx.helpers.setOrientations(t,s)}}}drawXAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-xaxis-annotations"});return t.config.annotations.xaxis.map((t,s)=>{this.addXaxisAnnotation(t,e.node,s)}),e}}class Fs{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new Es(this.annoCtx),this.axesUtils=new vt(this.annoCtx.w,{theme:this.annoCtx.theme,timeScale:this.annoCtx.timeScale})}addYaxisAnnotation(t,e,s){const i=this.w,a=t.strokeDashArray;let r=this.helpers.getY1Y2("y1",t),o=r.yP;const n=r.clipped;let l,h=!0,c=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!n){c=!0;const s=this.annoCtx.graphics.drawLine(0+t.offsetX,o+t.offsetY,this._getYAxisAnnotationWidth(t),o+t.offsetY,t.borderColor,a,t.borderWidth);e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),l=r.yP,h=r.clipped,l>o){const t=o;o=l,l=t}if(!n||!h){c=!0;const s=this.annoCtx.graphics.drawRect(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),o-l,0,t.fillColor,t.opacity,1,t.borderColor,a);s.node.classList.add("apexcharts-annotation-rect"),s.attr("clip-path",`url(#gridRectMask${i.globals.cuid})`),e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}if(c){const a="right"===t.label.position?i.layout.gridWidth:"center"===t.label.position?i.layout.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:(null!=l?l:o)+t.label.offsetY-3,text:d,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,fontWeight:t.label.style.fontWeight,foreColor:t.label.style.color,cssClass:`apexcharts-yaxis-annotation-label ${t.label.style.cssClass} ${t.id?t.id:""}`});r.attr({rel:s}),e.appendChild(r.node)}}_getYAxisAnnotationWidth(t){const e=this.w;let s=e.layout.gridWidth;return s=t.width.indexOf("%")>-1?e.layout.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),s+t.offsetX}drawYAxisAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-yaxis-annotations"});return t.config.annotations.yaxis.forEach((t,s)=>{t.yAxisIndex=this.axesUtils.translateYAxisIndex(t.yAxisIndex),this.axesUtils.isYAxisHidden(t.yAxisIndex)&&this.axesUtils.yAxisAllSeriesCollapsed(t.yAxisIndex)||this.addYaxisAnnotation(t,e.node,s)}),e}}class Ts{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new Es(this.annoCtx)}addPointAnnotation(t,e,s){const i=this.w;if(i.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;const a=this.helpers.getX1X2("x1",t),r=a.x,o=a.clipped,n=this.helpers.getY1Y2("y1",t),l=n.yP,h=n.clipped;if(b.isNumber(r)&&!h&&!o){const a={pSize:t.marker.size,pointStrokeWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,pRadius:t.marker.radius,class:`apexcharts-point-annotation-marker ${t.marker.cssClass} ${t.id?t.id:""}`};let o=this.annoCtx.graphics.drawMarker(r+t.marker.offsetX,l+t.marker.offsetY,a);e.appendChild(o.node),nt(o,r,i);const n=t.label.text?t.label.text:"",h=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:l+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:n,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:s}),e.appendChild(h.node),nt(h,r,i),t.customSVG.SVG){const s=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});s.attr({transform:`translate(${r+t.customSVG.offsetX}, ${l+t.customSVG.offsetY})`}),s.node.innerHTML=t.customSVG.SVG,e.appendChild(s.node)}if(t.image.path){const e=t.image.width?t.image.width:20,s=t.image.height?t.image.height:20;o=this.annoCtx.addImage({x:r+t.image.offsetX-e/2,y:l+t.image.offsetY-s/2,width:e,height:s,path:t.image.path,appendTo:".apexcharts-point-annotations"})}t.mouseEnter&&o.node.addEventListener("mouseenter",t.mouseEnter.bind(this,t)),t.mouseLeave&&o.node.addEventListener("mouseleave",t.mouseLeave.bind(this,t)),t.click&&o.node.addEventListener("click",t.click.bind(this,t))}}drawPointAnnotations(){const t=this.w,e=this.annoCtx.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map((t,s)=>{this.addPointAnnotation(t,e.node,s)}),e}}Cs.registerFeatures({annotations:class{constructor(t,{theme:e=null,timeScale:s=null}={}){this.w=t,this.theme=e,this.timeScale=s,this.invertAxis=void 0,this.inversedReversedAxis=void 0,this.graphics=new gt(this.w),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new Es(this),this.xAxisAnnotations=new Ps(this),this.yAxisAnnotations=new Fs(this),this.pointsAnnotations=new Ts(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&&t.globals.dataPoints){const e=this.yAxisAnnotations.drawYAxisAnnotations(),s=this.xAxisAnnotations.drawXAxisAnnotations(),i=this.pointsAnnotations.drawPointAnnotations(),a=t.config.chart.animations.enabled,r=[e,s,i],o=[s.node,e.node,i.node],n="line"===t.config.chart.type||"area"===t.config.chart.type||"rangeArea"===t.config.chart.type,l=[n,!1,n];for(let e=0;e<3;e++)t.dom.elGraphical.add(r[e]),!a||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&!l[e]&&o[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:o[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,s){this.xAxisAnnotations.addXaxisAnnotation(t,e,s)}addYaxisAnnotation(t,e,s){this.yAxisAnnotations.addYaxisAnnotation(t,e,s)}addPointAnnotation(t,e,s){this.pointsAnnotations.addPointAnnotation(t,e,s)}addText(t){const{x:e,y:s,text:i,textAnchor:a,foreColor:r,fontSize:o,fontFamily:n,fontWeight:l,cssClass:h,backgroundColor:c,borderWidth:d,strokeDashArray:g,borderRadius:p,borderColor:u,appendTo:x=".apexcharts-svg",paddingLeft:f=4,paddingRight:m=4,paddingBottom:b=2,paddingTop:y=2}=t,w=this.w,v=this.graphics.drawText({x:e,y:s,text:i,textAnchor:a||"start",fontSize:o||"12px",fontWeight:l||"regular",fontFamily:n||w.config.chart.fontFamily,foreColor:r||w.config.chart.foreColor,cssClass:h}),A=w.dom.baseEl.querySelector(x);A&&A.appendChild(v.node);const C=v.bbox();if(i){const t=this.graphics.drawRect(C.x-f,C.y-y,C.width+f+m,C.height+b+y,p,c||"transparent",1,d,u,g);A.insertBefore(t.node,v.node)}}addImage(t){const e=this.w,{path:s,x:i=0,y:a=0,width:r=20,height:o=20,appendTo:n=".apexcharts-svg"}=t,l=e.dom.Paper.image(s);l.size(r,o).move(i,a);const h=e.dom.baseEl.querySelector(n);return h&&h.appendChild(l.node),l}addXaxisAnnotationExternal(t,e,s){return this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"xaxis",contextMethod:s.addXaxisAnnotation}),s}addYaxisAnnotationExternal(t,e,s){return this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"yaxis",contextMethod:s.addYaxisAnnotation}),s}addPointAnnotationExternal(t,e,s){return void 0===this.invertAxis&&(this.invertAxis=s.w.globals.isBarHorizontal),this.addAnnotationExternal({params:t,pushToMemory:e,context:s,type:"point",contextMethod:s.addPointAnnotation}),s}addAnnotationExternal({params:t,pushToMemory:e,context:s,type:i,contextMethod:a}){const r=s,o=r.w,n=o.dom.baseEl.querySelector(`.apexcharts-${i}-annotations`),l=n.childNodes.length+1,h=new k,c=Object.assign({},"xaxis"===i?h.xAxisAnnotation:"yaxis"===i?h.yAxisAnnotation:h.pointAnnotation),d=b.extend(c,t);switch(i){case"xaxis":this.addXaxisAnnotation(d,n,l);break;case"yaxis":this.addYaxisAnnotation(d,n,l);break;case"point":this.addPointAnnotation(d,n,l)}const g=o.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${l}']`),p=this.helpers.addBackgroundToAnno(g,d);return p&&n.insertBefore(p.node,g),e&&o.globals.memory.methodsToExec.push({context:r,id:d.id?d.id:b.randomId(),method:a,label:"addAnnotation",params:t}),s}clearAnnotations(t){const e=t.w,s=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(s,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const s=t.w,i=s.dom.baseEl.querySelectorAll(`.${e}`);i&&(s.globals.memory.methodsToExec.map((t,i)=>{t.id===e&&s.globals.memory.methodsToExec.splice(i,1)}),Object.keys(s.config.annotations).forEach(t=>{const i=s.config.annotations[t];Array.isArray(i)&&(s.config.annotations[t]=i.filter(t=>t.id!==e))}),Array.prototype.forEach.call(i,t=>{t.parentElement.removeChild(t)}))}}});Cs.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;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}),this.ctx.events.removeEventListener("legendClick",this._onLegendClick))}_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,s,i;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==(s=this.ctx.toolbar)||s.handleZoomOut(),this._announce("Zoomed out"));break;case"0":this._canZoom()&&this.w.interact.zoomed&&(t.preventDefault(),null==(i=this.ctx.toolbar)||i.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,s=this.ctx.toolbar;if(!s)return;const i=Number(e.globals.minX),a=Number(e.globals.maxX);if(!isFinite(i)||!isFinite(a)||i===a)return;const r=.1*(a-i)*t;s.zoomUpdateOptions(i+r,a+r),this._announce(t>0?"Panned right":"Panned left")}_move(t,e){const s=this.w,i=s.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 a=this._getSeriesCount();let r=this.seriesIndex+t,o=0;for(;o<a&&(r<0&&(r=i?a-1:0),r>=a&&(r=i?0:a-1),s.globals.collapsedSeriesIndices.includes(r));)r+=t,o++;this.seriesIndex=r;const n=this._getDataPointCount(r);this.dataPointIndex>=n&&(this.dataPointIndex=n-1)}if(0!==e){const t=this._getDataPointCount(this.seriesIndex);let s=this.dataPointIndex+e;s<0&&(s=i?t-1:0),s>=t&&(s=i?0:t-1),this.dataPointIndex=s,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,s=this._getDataPointCount(e);let i=this.dataPointIndex,a=0;if(Array.isArray(t.seriesData.series[e])){for(;a<s&&null===t.seriesData.series[e][i];)i=(i+1)%s,a++;this.dataPointIndex=i}}_skipNullBackward(){const t=this.w,e=this.seriesIndex,s=this._getDataPointCount(e);let i=this.dataPointIndex,a=0;if(Array.isArray(t.seriesData.series[e])){for(;a<s&&null===t.seriesData.series[e][i];)i=(i-1+s)%s,a++;this.dataPointIndex=i}}_showCurrentPoint(){const{seriesIndex:t,dataPointIndex:e}=this,s=this.w,i=s.globals.tooltip;i&&i.ttItems&&(s.interact.capturedSeriesIndex=t,s.interact.capturedDataPointIndex=e,this._applyFocusClass(t,e),this._showTooltip(t,e,i))}_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 s=e.getElTooltip();s&&(s.classList.remove("apexcharts-active"),t.config.chart.accessibility.enabled&&t.config.chart.accessibility.announcements.enabled&&s.setAttribute("aria-hidden","true")),t.dom.baseEl.classList.remove("apexcharts-tooltip-active");const i=e.getElXCrosshairs();i&&i.classList.remove("apexcharts-active")}_showTooltip(t,e,s){const i=this.w,a=i.config.chart.type,r=s.getElTooltip();if(!r)return;const o=s.getCachedDimensions();s.tooltipRect={x:0,y:0,ttWidth:o.ttWidth||0,ttHeight:o.ttHeight||0},this._setSyntheticEvent(t,e,s),i.dom.baseEl.classList.add("apexcharts-tooltip-active"),r.classList.add("apexcharts-active"),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.announcements.enabled&&r.removeAttribute("aria-hidden"),"pie"===a||"donut"===a||"polarArea"===a?this._showTooltipNonAxis(t,e,s,r):"radialBar"===a?this._showTooltipRadialBar(t,e,s,r):"heatmap"===a||"treemap"===a?this._showTooltipHeatTree(t,e,s,r,a):"bar"===a||"candlestick"===a||"boxPlot"===a||"violin"===a||"rangeBar"===a?this._showTooltipBar(t,e,s):this._showTooltipAxisLine(t,e,s)}_setSyntheticEvent(t,e,s){const i=this.w,a=i.config.chart.type;let r=0,o=0;const n=this._getFocusableElement(t,e);if(n){const t=n.getBoundingClientRect();r=t.left+t.width/2,o=t.top+t.height/2}else if(i.globals.pointsArray&&i.globals.pointsArray[t]&&i.globals.pointsArray[t][e]){const a=i.globals.pointsArray[t][e],n=s.getElGrid&&s.getElGrid();if(n){const t=n.getBoundingClientRect();r=t.left+(a[0]||0),o=t.top+(a[1]||0)}}else{const t=i.dom.Paper&&i.dom.Paper.node;if(t){const e=t.getBoundingClientRect();r=e.left+e.width/2,o=e.top+e.height/2}}if(("line"===a||"area"===a||"rangeArea"===a||"scatter"===a||"bubble"===a||"radar"===a)&&i.globals.pointsArray&&i.globals.pointsArray[t]&&i.globals.pointsArray[t][e]){const a=i.globals.pointsArray[t][e],n=s.getElGrid&&s.getElGrid();if(n){const t=n.getBoundingClientRect();r=t.left+(a[0]||0),o=t.top+(a[1]||0)}}s.e={type:"mousemove",clientX:r,clientY:o}}_showTooltipBar(t,e,s){var i,a,r,o;const h=this.w,c=s.tConfig.shared&&(s.tooltipUtil.isXoverlap(e)||h.globals.isBarHorizontal)&&s.tooltipUtil.isInitialSeriesSameLen(),d=null==(o=null==(r=null==(a=null==(i=h.rangeData.seriesRange)?void 0:i[t])?void 0:a[e])?void 0:r.y)?void 0:o[0];s.tooltipLabels.drawSeriesTexts(l(n(n({ttItems:s.ttItems,i:t,j:e},void 0!==(null==d?void 0:d.y1)&&{y1:d.y1}),void 0!==(null==d?void 0:d.y2)&&{y2:d.y2}),{shared:c}));const g=`.apexcharts-series[data\\:realIndex='${t}']`,p=h.dom.Paper.findOne(`${g} path[j='${e}'], ${g} circle[j='${e}'], ${g} rect[j='${e}']`);if(p){this._leaveHoveredBar();new gt(this.w,this.ctx).pathMouseEnter(p,null),this._hoveredBarEl=p}if(h.globals.isBarHorizontal){const t=p&&p.node;if(t){const e=h.dom.elWrap.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.left-e.left,r=i.top-e.top,o=i.height,n=i.width,l=s.tooltipRect.ttWidth||0,c=r+o/2-(s.tooltipRect.ttHeight||0)/2;let d=a+n;a<(s.xyRatios&&null!=s.xyRatios.baseLineInvertedY?s.xyRatios.baseLineInvertedY:e.width/2)&&(d=a-l);const g=s.getElTooltip();g&&(g.style.left=d+"px",g.style.top=c+"px")}}else s.tooltipPosition.moveStickyTooltipOverBars(e,t)}_showTooltipAxisLine(t,e,s){const i=this.w,a=i.config.chart.type,r=s.tConfig.shared&&s.tooltipUtil.isXoverlap(e)&&s.tooltipUtil.isInitialSeriesSameLen();s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,j:e,shared:r});const o="scatter"===a||"bubble"===a,n=i.globals.markers.largestSize>0;o?this._showScatterBubblePoint(t,e,s):n?r?s.marker.enlargePoints(e):s.tooltipPosition.moveDynamicPointOnHover(e,t):r?s.tooltipPosition.moveDynamicPointsOnHover(e):s.tooltipPosition.moveDynamicPointOnHover(e,t)}_showScatterBubblePoint(t,e,s){const i=this.w.dom.baseEl;this._enlargedScatterMarker&&(s.marker.oldPointSize(this._enlargedScatterMarker),this._enlargedScatterMarker=null);const a=i.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`);if(!a)return;const r=a.querySelector(`.apexcharts-marker[rel='${e}']`);r&&(s.marker.enlargeCurrentPoint(e,r),this._enlargedScatterMarker=r)}_showTooltipNonAxis(t,e,s,i){var a,r;const o=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:e,shared:!1});const n=i.getBoundingClientRect(),l=n.width||s.tooltipRect.ttWidth||0,h=n.height||s.tooltipRect.ttHeight||0,c=o.dom.baseEl.querySelector(`.apexcharts-pie-area[j='${e}']`);if(c){const t=parseFloat(null!=(a=c.getAttribute("data:cx"))?a:""),e=parseFloat(null!=(r=c.getAttribute("data:cy"))?r:"");if(!isNaN(t)&&!isNaN(e)){const s=o.dom.Paper.node.getBoundingClientRect(),a=o.dom.elWrap.getBoundingClientRect(),r=s.left-a.left,n=s.top-a.top;i.style.left=r+t-l/2+"px",i.style.top=n+e-h-10+"px"}}}_showTooltipRadialBar(t,e,s,i){var a;const r=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,shared:!1});const{ttWidth:o=0,ttHeight:n=0}=s.getCachedDimensions(),l=r.dom.baseEl.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if(l){const e=parseFloat(null!=(a=l.getAttribute("data:angle"))?a:"")||0,s=(r.config.plotOptions.radialBar.startAngle||0)+e/2,h=r.layout.gridWidth/2,c=r.layout.gridHeight/2,d=r.globals.radialSize||Math.min(r.layout.gridWidth,r.layout.gridHeight)/2,g=r.seriesData.series.length,p=d/Math.max(g,1),u=d-t*p,x=(u+(u-p))/2,f=b.polarToCartesian(h,c,x,s),m=f.x+(r.layout.translateX||0),y=f.y+(r.layout.translateY||0);i.style.left=m-o/2+"px",i.style.top=y-n-10+"px"}}_showTooltipHeatTree(t,e,s,i,a){var r,o;const n=this.w;s.tooltipLabels.drawSeriesTexts({ttItems:s.ttItems,i:t,j:e,shared:!1});const l=i.getBoundingClientRect(),h=l.width||s.tooltipRect.ttWidth||0,c=l.height||s.tooltipRect.ttHeight||0,d="heatmap"===a?"apexcharts-heatmap-rect":"apexcharts-treemap-rect",g=n.dom.baseEl.querySelector(`.${d}[i='${t}'][j='${e}']`);if(g){const t=n.dom.elWrap.getBoundingClientRect(),e=g.getBoundingClientRect(),a=e.left-t.left,l=e.top-t.top,d=e.width,p=e.height,u=parseFloat(null!=(r=g.getAttribute("cx"))?r:""),x=parseFloat(null!=(o=g.getAttribute("width"))?o:"");s.tooltipPosition.moveXCrosshairs(u+x/2);let f=a+d+h/2;const m=l+p/2-c/2;a+d>n.layout.gridWidth/2&&(f=a-h/2),i.style.left=f+"px",i.style.top=m+"px"}}_applyFocusClass(t,e){this._removeFocusClass();const s=this._getFocusableElement(t,e);if(s){s.classList.add("apexcharts-keyboard-focused"),s.setAttribute("role","img");const i=this._buildPointLabel(t,e);i&&s.setAttribute("aria-label",i),this._focusedEl=s}}_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 s,i,a,r,o,n,l,h;const c=this.w,d=c.config.chart.type,g=c.seriesData.seriesNames||[],p=c.seriesData.series||[];if("pie"===d||"donut"===d||"polarArea"===d){const t=null!=(i=(null==(s=c.labelData)?void 0:s.labels)&&c.labelData.labels[e])?i:"",a=Array.isArray(p)?p[e]:"";return t?`${t}: ${a}`:`${a}`}if("radialBar"===d){return`${g[t]||`Series ${t+1}`}: ${Array.isArray(p)?p[t]:""}`}const u=g[t]||`Series ${t+1}`,x=(Array.isArray(p[t])?p[t]:[])[e];let f=null==x?"":String(x);const m=null==(r=null==(a=c.formatters)?void 0:a.yLabelFormatters)?void 0:r[t];if("function"==typeof m)try{f=m(x,{seriesIndex:t,dataPointIndex:e,w:c})}catch(t){}let b="";const y=null==(o=c.labelData)?void 0:o.categoryLabels,w=null==(l=null==(n=c.seriesData)?void 0:n.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 s=null==(h=c.formatters)?void 0:h.xLabelFormatter;if("function"==typeof s)try{b=String(s(w[e],{seriesIndex:t,dataPointIndex:e,w:c}))}catch(t){b=String(w[e])}else b=String(w[e])}return b?`${u}: ${f}, ${b}`:`${u}: ${f}`}_leaveHoveredBar(){if(this._hoveredBarEl){new gt(this.w,this.ctx).pathMouseLeave(this._hoveredBarEl,null),this._hoveredBarEl=null}}_getFocusableElement(t,e){const s=this.w,i=s.config.chart.type,a=s.dom.baseEl;if("pie"===i||"donut"===i||"polarArea"===i)return a.querySelector(`.apexcharts-pie-area[j='${e}']`);if("heatmap"===i)return a.querySelector(`.apexcharts-heatmap-rect[i='${t}'][j='${e}']`);if("treemap"===i)return a.querySelector(`.apexcharts-treemap-rect[i='${t}'][j='${e}']`);if("radialBar"===i)return a.querySelector(`.apexcharts-radialbar-series[data\\:realIndex='${t}'] path`);if("bar"===i||"candlestick"===i||"boxPlot"===i||"violin"===i||"rangeBar"===i)return a.querySelector(`.apexcharts-series[data\\:realIndex='${t}'] path[j='${e}']`);return a.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,s=e.config.chart.type;if("pie"===s||"donut"===s||"polarArea"===s)return e.seriesData.series.length;const i=e.seriesData.series;return i[t]&&Array.isArray(i[t])?i[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,s=this.seriesIndex;if(!t.interact.zoomed)return;const i=t.seriesData.seriesX&&t.seriesData.seriesX[s];if(!i||!i.length)return;const a=e.minX,r=e.maxX;if(void 0===a||void 0===r)return;const o=i[this.dataPointIndex];if(o>=a&&o<=r)return;const n=i.length;for(let t=0;t<n;t++)if(i[t]>=a&&i[t]<=r)return void(this.dataPointIndex=t)}_snapToVisibleRangeInDirection(t){const e=this.w,s=e.globals,i=this.seriesIndex,a=e.seriesData.seriesX&&e.seriesData.seriesX[i];if(!a||!a.length)return;const r=s.minX,o=s.maxX;if(void 0===r||void 0===o)return;const n=a.length;if(t>=0){for(let t=0;t<n;t++)if(a[t]>=r&&a[t]<=o)return void(this.dataPointIndex=t)}else for(let t=n-1;t>=0;t--)if(a[t]>=r&&a[t]<=o)return void(this.dataPointIndex=t)}_isDataPointVisible(t,e){const s=this.w,i=s.globals;if(!s.interact.zoomed)return!0;const a=s.seriesData.seriesX&&s.seriesData.seriesX[t];if(!a)return!0;const r=a[e];return void 0===r||r>=i.minX&&r<=i.maxX}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const s=e.dom.baseEl;if(!s)return;const i=s.querySelector(".apexcharts-sr-status");i&&(i.textContent="",setTimeout(()=>{i.textContent=t},0))}}});const Is=new Set(["bar","funnel","pyramid"]),Xs=new Set(["pie","donut","polarArea","radialBar","gauge"]);function Rs(t){return Is.has(t)?"bar":Xs.has(t)?"radial":null}Cs.registerFeatures({morphTypeChange:class{constructor(t,e){this.w=t,this.ctx=e,this._snapshot=null}canMorphTypes(t,e){if(t===e)return!1;const s=Rs(t),i=Rs(e);return!(!s||!i)}isCompatibleSeriesShape(t,e,s){if(!Array.isArray(s)||0===s.length)return!1;const i=Rs(t),a=Rs(e);return"radial"===a?!!s.every(t=>"number"==typeof t)||1===s.length&&s[0]&&"object"==typeof s[0]&&Array.isArray(s[0].data):"bar"===a?s.every(t=>t&&"object"==typeof t&&Array.isArray(t.data)):null!==i&&null!==a}captureBeforeDestroy({fromType:t,toType:e,newSeries:s}){if(this._snapshot=null,!c.isBrowser())return!1;const i=this.w.config.chart.animations;if(!i||!1===i.enabled)return!1;if(i.chartTypeMorph&&!1===i.chartTypeMorph.enabled)return!1;if(i.respectReducedMotion&&ot())return!1;if(!this.canMorphTypes(t,e))return!1;if(!this.isCompatibleSeriesShape(t,e,s))return!1;const a=this._captureFromDOM(t);if(!a.length)return!1;const r=this._buildMapping(a,t,e,s);return 0!==r.size&&(this._snapshot={fromType:t,toType:e,mapping:r,oldLayout:{translateX:this.w.layout.translateX||0,translateY:this.w.layout.translateY||0}},this.w.globals.previousPaths=[],!0)}_captureFromDOM(t){var e;const s=null==(e=this.w.globals.dom)?void 0:e.baseEl;if(!s)return[];const i=[],a=Rs(t);if("bar"===a){s.querySelectorAll(".apexcharts-bar-series .apexcharts-series").forEach(t=>{var e;const s=parseInt(null!=(e=t.getAttribute("data:realIndex"))?e:"0",10);t.querySelectorAll("path[pathTo]").forEach((t,e)=>{const a=t.getAttribute("pathTo")||t.getAttribute("d");a&&i.push({realIndex:s,j:e,d:a,fill:t.getAttribute("fill")})})})}else if("radial"===a)if("radialBar"===t||"gauge"===t){const t=this.w.layout.gridWidth/2,e=Math.min(this.w.layout.gridWidth,this.w.layout.gridHeight)/2;s.querySelectorAll(".apexcharts-radial-series .apexcharts-radialbar-area").forEach(s=>{var a;const r=s.parentElement,o=parseInt(null!=(a=null==r?void 0:r.getAttribute("data:realIndex"))?a:"0",10),n=s.getAttribute("d");if(!n)return;const l=parseFloat(s.getAttribute("stroke-width")||"0"),h=l>1&&this._radialArcToFilledSegment(n,l,t,e)||n;i.push({realIndex:o,j:0,d:h,fill:s.getAttribute("stroke")})})}else{s.querySelectorAll(".apexcharts-pie-series .apexcharts-pie-area").forEach((t,e)=>{const s=t.getAttribute("d");s&&i.push({realIndex:e,j:0,d:s,fill:t.getAttribute("fill")})})}return i}_radialArcToFilledSegment(t,e,s,i){const a=t.match(/M\s*(-?[\d.]+)\s+(-?[\d.]+)\s+A\s*(-?[\d.]+)\s+(?:-?[\d.]+)\s+(?:-?[\d.]+)\s+(\d)\s+(\d)\s+(-?[\d.]+)\s+(-?[\d.]+)/);if(!a)return null;const r=parseFloat(a[1]),o=parseFloat(a[2]),n=parseFloat(a[3]),l=parseInt(a[4],10),h=parseInt(a[5],10),c=parseFloat(a[6]),d=parseFloat(a[7]);if(!isFinite(n)||n<=0)return null;const g=e/2,p=n+g,u=Math.max(0,n-g),x=(t,e,a)=>{const r=t-s,o=e-i,n=Math.sqrt(r*r+o*o);if(0===n)return{x:s,y:i};const l=a/n;return{x:s+r*l,y:i+o*l}},f=x(r,o,p),m=x(c,d,p),b=x(r,o,u),y=x(c,d,u),w=h?0:1;return`M ${f.x} ${f.y} A ${p} ${p} 0 ${l} ${h} ${m.x} ${m.y} L ${y.x} ${y.y} A ${u} ${u} 0 ${l} ${w} ${b.x} ${b.y} Z`}buildRingSegmentPath(t,e,s,i,a,r){const o=i/2,n=s+o,l=Math.max(0,s-o),h=(a-90)*Math.PI/180,c=(r-90)*Math.PI/180,d=t+n*Math.cos(h),g=e+n*Math.sin(h),p=t+n*Math.cos(c),u=e+n*Math.sin(c),x=t+l*Math.cos(h),f=e+l*Math.sin(h),m=t+l*Math.cos(c),b=e+l*Math.sin(c),y=r>a?1:0,w=Math.abs(r-a)>180?1:0;return`M ${d} ${g} A ${n} ${n} 0 ${w} ${y} ${p} ${u} L ${m} ${b} A ${l} ${l} 0 ${w} ${1-y} ${x} ${f} Z`}getFromType(){return this._snapshot?this._snapshot.fromType:null}_buildMapping(t,e,s,i){const a=new Map,r=Rs(s),o=t.slice().sort((t,e)=>t.realIndex-e.realIndex||t.j-e.j);if("radial"===r)return o.forEach((t,e)=>{a.set(`${e}:0`,{d:t.d,fill:t.fill})}),a;if("bar"===r){const t=[];return(Array.isArray(i)?i:[]).forEach((e,s)=>{const i=e&&Array.isArray(e.data)?e.data:[];for(let e=0;e<i.length;e++)t.push({realIndex:s,j:e})}),o.forEach((e,s)=>{const i=t[s];i&&a.set(`${i.realIndex}:${i.j}`,{d:e.d,fill:e.fill})}),a}return a}isActive(){return null!==this._snapshot}getInitialPathFor(t,e){if(!this._snapshot)return null;const s=this._snapshot.mapping.get(`${t}:${e}`);if(!s)return null;const i=this._snapshot.oldLayout.translateX-(this.w.layout.translateX||0),a=this._snapshot.oldLayout.translateY-(this.w.layout.translateY||0);return 0===i&&0===a?s.d:this._translatePathD(s.d,i,a)}_translatePathD(t,e,s){if(0===e&&0===s)return t;return R(t).map(t=>{const i=t[0];return"Z"===i?"Z":"M"===i||"L"===i||"T"===i?`${i} ${t[1]+e} ${t[2]+s}`:"H"===i?`${i} ${t[1]+e}`:"V"===i?`${i} ${t[1]+s}`:"C"===i?`${i} ${t[1]+e} ${t[2]+s} ${t[3]+e} ${t[4]+s} ${t[5]+e} ${t[6]+s}`:"S"===i||"Q"===i?`${i} ${t[1]+e} ${t[2]+s} ${t[3]+e} ${t[4]+s}`:"A"===i?`${i} ${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]+e} ${t[7]+s}`:t.join(" ")}).join(" ")}getInitialFillFor(t,e){if(!this._snapshot)return null;const s=this._snapshot.mapping.get(`${t}:${e}`);return s?s.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||!c.isBrowser())return;const e=null==(t=this.w.globals.dom)?void 0:t.baseEl;if(!e)return;const s=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 ${s}ms ease-out`,m.requestAnimationFrame(()=>{t.style.opacity="1"}),setTimeout(()=>{t.style.transition="",t.style.opacity=""},s+80))})}),setTimeout(()=>this.cleanup(),s+100)}cleanup(){this._snapshot=null}}});const zs="http://www.w3.org/1999/xhtml";class Bs{constructor(t,e,s){this.w=t,this.ctx=e,this.drilldown=s}render(t){if(!c.isBrowser())return;const e=this.w,s=e.dom.elWrap;if(!s)return;const i=s.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i);const a=e.config.drilldown&&e.config.drilldown.breadcrumb;if(!a||!1===a.show)return;if(0===this.drilldown.depth)return;const r=m.createElementNS(zs,"nav");r.setAttribute("class","apexcharts-breadcrumb"),r.setAttribute("aria-label","Drilldown breadcrumb"),this._position(r,a);const o=null!=a.separator?a.separator:" / ";t.forEach((e,s)=>{if(s>0){const t=m.createElementNS(zs,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=o,r.appendChild(t)}const i=this._label(e,s);if(s===t.length-1){const t=m.createElementNS(zs,"span");t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=i,r.appendChild(t)}else{const t=m.createElementNS(zs,"button");if(t.setAttribute("type","button"),t.setAttribute("class","apexcharts-breadcrumb-item"),0===s){const e=m.createElementNS(zs,"span");e.setAttribute("class","apexcharts-breadcrumb-arrow"),e.setAttribute("aria-hidden","true"),e.textContent="\u2190",t.appendChild(e)}const e=m.createElementNS(zs,"span");e.setAttribute("class","apexcharts-breadcrumb-label"),e.textContent=i,t.appendChild(e),t.addEventListener("click",()=>this.drilldown.drillToLevel(s)),r.appendChild(t)}}),s.appendChild(r)}_label(t,e){const s=this.w.config.drilldown.breadcrumb;let i;if(0===e)i=null!=s.rootLabel?s.rootLabel:"All";else{const e=(this.w.config.drilldown.series||[]).find(e=>e&&e.id===t);i=e&&e.name||String(t)}return"function"==typeof s.formatter?s.formatter(i,{index:e,depth:this.drilldown.depth}):i}_position(t,e){const s=e.offsetX||0,i=e.offsetY||0;t.style.position="absolute",t.style.top=i+"px","top-right"===e.position?t.style.right=3-s+"px":t.style.left=s+"px"}}Cs.registerFeatures({drilldown:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.rootSnapshot=null,this._wired=!1,this.breadcrumb=new Bs(t,e,this),this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),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)))}get path(){return["root",...this.stack.map(t=>t.id)]}get depth(){return this.stack.length}drillDown(t,e,s){const i=this._resolveChild(t);return i?this._drillInto(i,e,s):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(t,e,s):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 s=this.path[this.path.length-1],i=0===t?this.rootSnapshot:this.stack[t].restore;this.stack=this.stack.slice(0,t);const a=this.path[this.path.length-1];return this._apply(this._viewFromSnapshot(i),"up",{from:s,to:a})}_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,s){if(this.stack.length>=32)return Promise.resolve(this.ctx);this.rootSnapshot||(this.rootSnapshot=this._snapshot());const i=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:i,to:t.id,point:e,seriesIndex:s&&s.seriesIndex,dataPointIndex:s&&s.dataPointIndex})}_drillDownAsync(t,e,s){const i=this.w.config.drilldown.onDrillDown;let a;try{a=i({point:e,seriesIndex:s&&s.seriesIndex,dataPointIndex:s&&s.dataPointIndex})}catch(e){return this._fire("drillDownError",{id:t,error:e}),Promise.resolve(this.ctx)}return Promise.resolve(a).then(t=>t&&t.data?this._drillInto(t,e,s):this.ctx,e=>(this._fire("drillDownError",{id:t,error:e}),this.ctx))}_snapshot(){const t=this.w.config,e=this._overrideFields(),s={series:b.clone(t.series)};return Array.isArray(t.labels)&&t.labels.length&&(s.labels=b.clone(t.labels)),s.chart={type:t.chart.type,stacked:t.chart.stacked},e.has("xaxis")&&(s.xaxis=b.clone(t.xaxis)),e.has("yaxis")&&(s.yaxis=b.clone(t.yaxis)),e.has("colors")&&(s.colors=t.colors?b.clone(t.colors):void 0),e.has("plotOptions")&&(s.plotOptions=b.clone(t.plotOptions)),e.has("fill")&&(s.fill=b.clone(t.fill)),e.has("legend")&&(s.legend=b.clone(t.legend)),s}_overrideFields(){const t=new Set,e=this.w.config.drilldown&&this.w.config.drilldown.series||[];for(const s of e)s&&(s.xaxis&&t.add("xaxis"),s.yaxis&&t.add("yaxis"),s.colors&&t.add("colors"),s.plotOptions&&t.add("plotOptions"),s.fill&&t.add("fill"),s.legend&&t.add("legend"));return t}_viewFromChild(t){const e={};Array.isArray(t.series)?e.series=t.series:e.series=[{name:t.name||"",data:t.data}];const s={};return t.chart&&t.chart.type&&(s.type=t.chart.type),t.chart&&null!=t.chart.stacked&&(s.stacked=t.chart.stacked),Object.keys(s).length&&(e.chart=s),t.xaxis&&(e.xaxis=t.xaxis),t.yaxis&&(e.yaxis=t.yaxis),t.colors&&(e.colors=t.colors),t.plotOptions&&(e.plotOptions=t.plotOptions),t.fill&&(e.fill=t.fill),t.legend&&(e.legend=t.legend),e}_viewFromSnapshot(t){const e={series:t.series,chart:t.chart};return t.labels&&t.labels.length&&(e.labels=t.labels),t.xaxis&&(e.xaxis=t.xaxis),t.yaxis&&(e.yaxis=t.yaxis),t.colors&&(e.colors=t.colors),t.plotOptions&&(e.plotOptions=t.plotOptions),t.fill&&(e.fill=t.fill),t.legend&&(e.legend=t.legend),e}_apply(t,e,s){const i=this.w;i.interact.selectedDataPoints=[],i.globals.collapsedSeries=[],i.globals.collapsedSeriesIndices=[],i.globals.ancillaryCollapsedSeries=[],i.globals.ancillaryCollapsedSeriesIndices=[],i.globals.allSeriesCollapsed=!1,i.globals.risingSeries=[];const a=(!i.config.drilldown.animation||!1!==i.config.drilldown.animation.enabled)&&!1!==i.config.chart.animations.enabled;"down"===e&&this._fire("drillDownStart",s);const r=e=>this.ctx.updateOptions(t,!1,e,!1,!1),o=()=>(this._fire("down"===e?"drillDownEnd":"drillUp",s),this.ctx);if(a&&this._zoomEnabled()){const t=this._triggerOrigin(s);if(t)return this._zoomDrill(t,e,()=>r(!1)).then(o)}return r(a).then(o)}_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(!c.isBrowser())return null;const e=this._svgNode(),s=this._markGroup();if(!e||!s||"function"!=typeof s.animate||"function"!=typeof e.getBoundingClientRect)return null;const i=e.getBoundingClientRect();let a=null;if(t&&null!=t.seriesIndex&&null!=t.dataPointIndex&&this.w.dom.baseEl&&(a=this.w.dom.baseEl.querySelector(`[index="${t.seriesIndex}"][j="${t.dataPointIndex}"]`)),a&&"function"==typeof a.getBoundingClientRect){const t=a.getBoundingClientRect();return{x:t.left+t.width/2-i.left,y:t.top+t.height/2-i.top}}const r=s.getBoundingClientRect();return{x:r.left+r.width/2-i.left,y:r.top+r.height/2-i.top}}_zoomDrill(t,e,s){return i=this,a=null,r=function*(){const i=this._zoomDuration(),a="down"===e,r=Math.round(.55*i),o=a?"scale(1.03)":"scale(0.97)",n=a?"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`},h=this._markGroup();let c=null;if(h){l(h),c=h.animate([{transform:"scale(1)",opacity:1},{transform:o,opacity:0}],{duration:r,easing:"ease-in",fill:"forwards"});try{yield c.finished}catch(t){}}yield s();const d=this._markGroup();if(d){l(d),d.style.opacity="0",d.style.transform=n,c&&h===d&&c.cancel();const t=d.animate([{transform:n,opacity:0},{transform:"scale(1)",opacity:1}],{duration:i,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"});try{yield t.finished}catch(t){}(g=d).style.transform="",g.style.opacity="",g.style.transformOrigin="",g.style.transformBox="",t.cancel()}var g},new Promise((t,e)=>{var s=t=>{try{n(r.next(t))}catch(t){e(t)}},o=t=>{try{n(r.throw(t))}catch(t){e(t)}},n=e=>e.done?t(e.value):Promise.resolve(e.value).then(s,o);n((r=r.apply(i,a)).next())});var i,a,r}_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 s=this.w.config.chart.events&&this.w.config.chart.events[t];"function"==typeof s&&s(e,this.ctx,this.w),this.ctx.events.fireEvent(t,[e,this.ctx,this.w])}_onPointSelect(t,e,s){if(!s)return;const i=this._pointAt(s.seriesIndex,s.dataPointIndex);return i&&"object"==typeof i&&null!=i.drilldown?this.drillDown(i.drilldown,i,s):"function"==typeof this.w.config.drilldown.onDrillDown?this._drillDownAsync(null,i,s):void 0}_pointAt(t,e){const s=this.w.config.series;if(!Array.isArray(s)||null==t||null==e)return null;const i=s[t];return i&&Array.isArray(i.data)&&null!=i.data[e]?i.data[e]:null}_afterRender(){this.w.config.drilldown&&this.w.config.drilldown.enabled&&(this._markDrillableTargets(),this.breadcrumb.render(this.path))}_markDrillableTargets(){if(!c.isBrowser())return;const t=this.w,e=t.dom.baseEl,s=t.config.series;e&&Array.isArray(s)&&s.forEach((t,s)=>{const i=t&&Array.isArray(t.data)?t.data:null;i&&i.forEach((t,i)=>{if(!t||"object"!=typeof t||null==t.drilldown)return;e.querySelectorAll(`[index="${s}"][j="${i}"]`).forEach(t=>t.classList.add("apexcharts-drilldown-target"))})})}}});function Ys(t,e){const s=null!=t,i=null!=e;return s||i?{min:s?t:null,max:i?e:null}:null}function Ns(t){return Array.isArray(t)?t.map(t=>Array.isArray(t)?t.slice():t):[]}function Ws(t,e){return"function"==typeof t&&e?t===e.addXaxisAnnotation?"xaxis":t===e.addYaxisAnnotation?"yaxis":t===e.addPointAnnotation?"point":null:null}function Os(t,e){const s=t.config.annotations?b.clone(t.config.annotations):null,i=[],a=t.globals.memory&&t.globals.memory.methodsToExec||[];for(const t of a){if(!t||"addAnnotation"!==t.label)continue;const s=Ws(t.method,e);s&&i.push({kind:s,params:b.clone(t.params)})}return{static:s,dynamic:i}}function Hs(t){const e=t&&t.measure;if(!e||"function"!=typeof e.getPins)return null;const s=e.getPins();return Array.isArray(s)&&s.length?{pins:s}:null}function $s(t,e){var s,i;const a=t.config.xaxis||{},r=(Array.isArray(t.config.yaxis)?t.config.yaxis:t.config.yaxis?[t.config.yaxis]:[]).map(t=>Ys(t&&t.min,t&&t.max)),o=r.some(t=>null!==t),n=t.config.theme,l=e&&e.drilldown;return{v:1,window:{xaxis:Ys(a.min,a.max),yaxis:o?r:null},zoomed:!!t.interact.zoomed,collapsed:(t.globals.collapsedSeriesIndices||[]).slice(),ancillaryCollapsed:(t.globals.ancillaryCollapsedSeriesIndices||[]).slice(),selectedDataPoints:Ns(t.interact.selectedDataPoints),theme:n?{mode:null!=(s=n.mode)?s:null,palette:null!=(i=n.palette)?i:null}:null,locale:t.config.chart&&t.config.chart.defaultLocale||null,annotations:Os(t,e),drill:l&&l.depth>0?{path:l.path.slice()}:null,measure:Hs(e)}}function js(t,e){if(!t||!e)return;const s=t.w;s.interact.zoomed=!!e.zoomed,function(t,e,s){const i=t.w,a=i.globals.seriesNames||[],r=new Set([...e||[],...s||[]]),o=new Set([...i.globals.collapsedSeriesIndices||[],...i.globals.ancillaryCollapsedSeriesIndices||[]]);for(let e=0;e<a.length;e++){const s=a[e];if(null==s)continue;const i=r.has(e),n=o.has(e);i&&!n?t.hideSeries(s):!i&&n&&t.showSeries(s)}}(t,e.collapsed,e.ancillaryCollapsed),e.annotations&&Array.isArray(e.annotations.dynamic)&&e.annotations.dynamic.forEach(e=>{const s=function(t){switch(t){case"xaxis":return"addXaxisAnnotation";case"yaxis":return"addYaxisAnnotation";case"point":return"addPointAnnotation";default:return null}}(e.kind);s&&"function"==typeof t[s]&&t[s](e.params,!0)}),function(t,e){Array.isArray(e)&&(t.w.interact.selectedDataPoints=Ns(e))}(t,e.selectedDataPoints),e.locale&&e.locale!==s.config.chart.defaultLocale&&t.setLocale(e.locale),t.measure&&"function"==typeof t.measure.setPins&&t.measure.setPins(e.measure&&e.measure.pins||[])}const Gs="apex";function Vs(t){return function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"utf-8").toString("base64");const e=(new TextEncoder).encode(t);let s="";for(let t=0;t<e.length;t++)s+=String.fromCharCode(e[t]);return btoa(s)}(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Us(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4;)e+="=";return function(t){if("undefined"!=typeof Buffer)return Buffer.from(t,"base64").toString("utf-8");const e=atob(t),s=new Uint8Array(e.length);for(let t=0;t<e.length;t++)s[t]=e.charCodeAt(t);return(new TextDecoder).decode(s)}(e)}class qs{constructor(t,e){this.w=t,this.ctx=e,this._saved=[],this._counter=0}capture(){const t={v:1,view:$s(this.w,this.ctx)},e=this._serializableDelta();return e&&Object.keys(e).length&&(t.options=e),t}_serializableDelta(){const t=this.w.config,e=t.chart&&t.chart.perspectives&&t.chart.perspectives.serializeOptions||["theme","xaxis","yaxis","title","subtitle"],s={};return e.forEach(e=>{if(void 0!==t[e]){const i=function(t){try{return JSON.parse(JSON.stringify(t))}catch(t){return}}(t[e]);void 0!==i&&(s[e]=i)}}),s}encode(t){const e=t||this.capture();return Vs(JSON.stringify(e))}decode(t){return qs.decode(t)}toURL(){if(!c.isBrowser())return"";const t=this.encode(this.capture()),e=new URL(window.location.href);return e.hash=`${Gs}=${t}`,e.toString()}apply(t,e={}){const s="string"==typeof t?qs.decode(t):t;if(!s||!s.view)return;const i=void 0===e.animate||e.animate,a=b.extend(s.options?b.clone(s.options):{},e.mergeOptions||{}),r=Object.keys(a).length?a:void 0;(this.w.config.chart.group?this.ctx.getSyncedCharts():[this.ctx]).forEach(t=>{!function(t,e,{animate:s=!0,mergeOptions:i}={}){var a,r;if(!t||!e)return;"number"==typeof e.v&&e.v,t.clearAnnotations();const o=i?b.clone(i):{},n=e.window&&e.window.xaxis;o.xaxis=Object.assign({},o.xaxis,n?{min:null!=(a=n.min)?a:void 0,max:null!=(r=n.max)?r:void 0}:{min:void 0,max:void 0});const l=e.window&&e.window.yaxis;if(Array.isArray(l)&&(o.yaxis=l.map(t=>{var e,s;return t?{min:null!=(e=t.min)?e:void 0,max:null!=(s=t.max)?s:void 0}:{}})),e.theme){const t={};null!=e.theme.mode&&(t.mode=e.theme.mode),null!=e.theme.palette&&(t.palette=e.theme.palette),Object.keys(t).length&&(o.theme=Object.assign({},o.theme,t))}e.annotations&&e.annotations.static&&(o.annotations=b.clone(e.annotations.static)),t.updateOptions(o,!1,s,!1,!1),js(t,e)}(t,s.view,{animate:i,mergeOptions:r})})}save(t){const e="perspective-"+ ++this._counter;return this._saved.push({id:e,name:t||e,token:this.capture()}),e}list(){return this._saved.map(t=>({id:t.id,name:t.name,token:t.token}))}delete(t){const e=this._saved.findIndex(e=>e.id===t);e>-1&&this._saved.splice(e,1)}teardown(){this._saved=[],this._counter=0}static decode(t){if("string"!=typeof t||!t)return null;try{const e=JSON.parse(Us(t));return e&&"object"==typeof e?1!==e.v?null:e:null}catch(t){return null}}static fromURL(t){try{const e=t||(c.isBrowser()?window.location.href:"");if(!e)return null;const s=new URL(e).hash.replace(/^#/,"");if(!s)return null;const i=s.split("&").map(t=>t.split("=")).find(t=>t[0]===Gs);return i&&null!=i[1]?qs.decode(decodeURIComponent(i[1])):null}catch(t){return null}}}Cs.registerFeatures({perspectives:qs}),Cs.perspectives={decode:t=>qs.decode(t),fromURL:t=>qs.fromURL(t)};Cs.registerFeatures({storyboard:class{constructor(t,e){this.w=t,this.ctx=e,this._beats=[],this._observer=null,this._activeIndex=-1,this._animate=!0,this._warnedNoPerspectives=!1}bind(t={}){var e;if(this.unbind(),!c.isBrowser())return 0;const s=this.ctx.el&&this.ctx.el.ownerDocument;if(!s||"undefined"==typeof IntersectionObserver)return 0;let i=null;if(t.scroller&&(i="string"==typeof t.scroller?s.querySelector(t.scroller):t.scroller),this._beats=this._resolveBeats(s,i,t.beats),!this._beats.length)return 0;this._animate=!1!==t.animate;const a=Math.min(Math.max(null!=(e=t.offset)?e:.5,0),1),r=+(100*a).toFixed(3),o=+(100-100*a).toFixed(3);return this._observer=new IntersectionObserver(t=>this._onIntersect(t),{root:i,rootMargin:`-${r}% 0px -${o}%`,threshold:0}),this._beats.forEach(t=>{var e;return null==(e=this._observer)?void 0:e.observe(t.el)}),this._beats.length}_resolveBeats(t,e,s){const i=[];if(Array.isArray(s))return s.forEach((e,s)=>{var a,r;if(!e)return;const o=e.el&&"object"==typeof e.el?e.el:e.selector?t.querySelector(e.selector):null;o&&i.push({el:o,key:null!=(r=null!=(a=e.key)?a:o.getAttribute("data-apex-beat"))?r:String(s),view:e.view,options:e.options,announce:e.announce,onEnter:"function"==typeof e.onEnter?e.onEnter:void 0})}),i;return(e||t).querySelectorAll("[data-apex-beat]").forEach((t,e)=>{i.push({el:t,key:t.getAttribute("data-apex-beat")||String(e),view:t.getAttribute("data-apex-view")||void 0,options:void 0,announce:t.getAttribute("data-apex-announce")||void 0,onEnter:void 0})}),i}_onIntersect(t){t.forEach(t=>{const e=this._beats.findIndex(e=>e.el===t.target);e<0||(t.isIntersecting?this._activate(e):e===this._activeIndex&&t.rootBounds&&t.boundingClientRect.top>=t.rootBounds.bottom&&e>0&&this._activate(e-1))})}_activate(t,e={}){var s,i;if(t===this._activeIndex)return;const a=this._beats[t];if(!a)return;const r=t>this._activeIndex?"down":"up";this._activeIndex=t;const o=(void 0!==e.animate?e.animate:this._animate)&&!ot();if(null!=a.view||a.options)if(this.ctx.perspectives){const t=null!=(s=a.view)?s:{},e="string"==typeof t||t.view?t:{view:this._normalizeView(t)};this.ctx.perspectives.apply(e,{animate:o,mergeOptions:a.options})}else this._warnedNoPerspectives||(this._warnedNoPerspectives=!0);const n={index:t,key:a.key,el:a.el,direction:r};a.onEnter&&a.onEnter(this.ctx,n),a.announce&&this._announce(a.announce),"function"==typeof this.w.config.chart.events.beatChange&&this.w.config.chart.events.beatChange(this.ctx,n),null==(i=this.ctx.events)||i.fireEvent("beatChange",[this.ctx,n])}_normalizeView(t){const e=t.annotations&&t.annotations.static||{};return l(n({},t),{annotations:{static:n({points:[],xaxis:[],yaxis:[],texts:[],images:[]},e),dynamic:t.annotations&&t.annotations.dynamic||[]}})}goTo(t,e={}){const s="number"==typeof t?t:this._beats.findIndex(e=>e.key===t);s>=0&&s<this._beats.length&&this._activate(s,e)}current(){if(this._activeIndex<0)return null;const t=this._beats[this._activeIndex];return{index:this._activeIndex,key:t?t.key:null}}unbind(){this._observer&&(this._observer.disconnect(),this._observer=null),this._beats=[],this._activeIndex=-1}teardown(){this.unbind()}_announce(t){const e=this.w;if(!e.config.chart.accessibility.announcements.enabled)return;const s=e.dom.baseEl;if(!s)return;const i=s.querySelector(".apexcharts-sr-status");i&&(i.textContent="",setTimeout(()=>{i.textContent=t},0))}}});Cs.registerFeatures({history:class{constructor(t,e){this.w=t,this.ctx=e,this.stack=[],this.pointer=-1,this.applying=!1,this._batching=!1,this._counter=0,this._coalesceTimer=null,this._settleTimer=null,this._pendingLabel=void 0,this._keydownTarget=null,this._pointerTarget=null,this._engaged=!1,this._wired=!1,this._readConfig(),this._onMounted=this._onMounted.bind(this),this._onUpdated=this._onUpdated.bind(this),this._onSelection=this._onSelection.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this.init()}_readConfig(){const t=this.w,e=t.config.chart&&t.config.chart.history||{};this.enabled=!!e.enabled,this.maxDepth=e.maxDepth>0?e.maxDepth:100,this.coalesceMs=null!=e.coalesceMs?e.coalesceMs:250,this.keyboard=!1!==e.keyboard}_syncConfig(){this._readConfig(),this.enabled&&this.keyboard?this._wireKeyboard():this._unwireKeyboard()}init(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onMounted),this.ctx.addEventListener("updated",this._onUpdated),this.ctx.addEventListener("scrolled",this._onUpdated),this.ctx.addEventListener("dataPointSelection",this._onSelection),this.enabled&&this.keyboard&&this._wireKeyboard())}_wireKeyboard(){if(this._keydownTarget)return;const t=this.ctx.el,e=t&&t.ownerDocument;c.isBrowser()&&e&&(e.addEventListener("keydown",this._onKeyDown),e.addEventListener("pointerdown",this._onPointerDown,!0),e.addEventListener("mousedown",this._onPointerDown,!0),this._keydownTarget=e,this._pointerTarget=e)}_unwireKeyboard(){this._keydownTarget&&(this._keydownTarget.removeEventListener("keydown",this._onKeyDown),this._keydownTarget=null),this._pointerTarget&&(this._pointerTarget.removeEventListener("pointerdown",this._onPointerDown,!0),this._pointerTarget.removeEventListener("mousedown",this._onPointerDown,!0),this._pointerTarget=null),this._engaged=!1}_onMounted(){this._syncConfig(),this.enabled&&0===this.stack.length&&this._commit("initial",!0)}_onUpdated(){this._syncConfig(),this.enabled&&(this.applying?this._refreshSettle():this._schedule("update"))}_onSelection(){this.enabled&&!this.applying&&this._schedule("selection")}_onPointerDown(t){const e=this.ctx.el;this._engaged=!!(e&&t.target&&e.contains(t.target))}_onKeyDown(t){if(!t.metaKey&&!t.ctrlKey)return;const e=(t.key||"").toLowerCase();if("z"!==e&&"y"!==e)return;const s=this.ctx.el;if(!s)return;const i=s.ownerDocument,a=i&&i.activeElement;if(function(t){if(!t)return!1;const e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||!0===t.isContentEditable}(a))return;if(!s.contains(a)&&!this._engaged)return;const r="y"===e||t.shiftKey;t.preventDefault(),r?this.redo():this.undo()}_schedule(t){this.applying||this._batching||!this.enabled||(this._pendingLabel=t,this.coalesceMs>0&&c.isBrowser()?(clearTimeout(this._coalesceTimer),this._coalesceTimer=setTimeout(()=>this._commit(this._pendingLabel),this.coalesceMs)):this._commit(t))}_commit(t,e){if(clearTimeout(this._coalesceTimer),this._coalesceTimer=null,!e&&(this.applying||this._batching))return;const s=this._capture(t),i=this.stack[this.pointer];if(!i||i.sig!==s.sig){for(this.pointer<this.stack.length-1&&this.stack.splice(this.pointer+1),this.stack.push(s),this.pointer=this.stack.length-1;this.stack.length>this.maxDepth;)this.stack.shift(),this.pointer--;this._emitChange()}}_capture(t){const e=$s(this.w,this.ctx),{config:s,seriesSig:i}=this._cloneConfigCOW();return{id:"hist-"+ ++this._counter,view:e,config:s,seriesSig:i,label:t||"change",at:c.isBrowser()?Date.now():0,origin:"local",sig:this._signature(e,s)}}_cloneConfigCOW(){const t=this.w,e=this.stack[this.pointer];let s,o=null;try{o=JSON.stringify(t.config.series)}catch(t){o=null}if(e&&null!==o&&e.seriesSig===o){const o=t.config,{series:n}=o,l=((t,e)=>{var s={};for(var o in t)a.call(t,o)&&e.indexOf(o)<0&&(s[o]=t[o]);if(null!=t&&i)for(var o of i(t))e.indexOf(o)<0&&r.call(t,o)&&(s[o]=t[o]);return s})(o,["series"]);s=b.clone(l),s.series=e.config.series}else s=b.clone(t.config);return{config:s,seriesSig:o}}_signature(t,e){try{return JSON.stringify(t)+"|"+JSON.stringify(e)}catch(t){return`nosig-${this._counter}`}}_restore(t,e){if(!t)return;let s;this.applying=!0;try{this.ctx.clearAnnotations(),s=this.ctx.updateOptions(b.clone(t.config),!1,e,!1,!1)}catch(t){throw this.applying=!1,t}Promise.resolve(s).then(()=>{js(this.ctx,t.view),this._refreshSettle(),this._emitChange()}).catch(()=>{this.applying=!1})}_refreshSettle(){c.isBrowser()?(clearTimeout(this._settleTimer),this._settleTimer=setTimeout(()=>{this.applying=!1},0)):this.applying=!1}snapshot(t){this.enabled&&!this.applying&&this._commit(t||"change")}undo(t=!0){this.canUndo()&&(this.pointer--,this._restore(this.stack[this.pointer],t))}redo(t=!0){this.canRedo()&&(this.pointer++,this._restore(this.stack[this.pointer],t))}canUndo(){return this.pointer>0}canRedo(){return this.pointer>-1&&this.pointer<this.stack.length-1}jump(t,e=!0){const s=this.stack.findIndex(e=>e.id===t);-1!==s&&s!==this.pointer&&(this.pointer=s,this._restore(this.stack[s],e))}clear(){clearTimeout(this._coalesceTimer),this._coalesceTimer=null;const t=this.stack[this.pointer];this.stack=t?[t]:[],this.pointer=this.stack.length-1,this._emitChange()}transaction(t,e={}){if("function"!=typeof t)return Promise.resolve();const s=this._batching;return this._batching=!0,Promise.resolve().then(()=>t()).finally(()=>{this._batching=s,s||this._commit(e.label||"transaction",!0)})}entries(){return this.stack.map(t=>({id:t.id,label:t.label,at:t.at}))}state(){return{canUndo:this.canUndo(),canRedo:this.canRedo(),index:this.pointer,length:this.stack.length}}_emitChange(){this.ctx.events.fireEvent("historyChange",[this.ctx,this.state()])}teardown(){var t,e,s,i,a,r,o,n;clearTimeout(this._coalesceTimer),clearTimeout(this._settleTimer),this._coalesceTimer=null,this._settleTimer=null,this._unwireKeyboard(),this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onMounted),null==(i=(s=this.ctx).removeEventListener)||i.call(s,"updated",this._onUpdated),null==(r=(a=this.ctx).removeEventListener)||r.call(a,"scrolled",this._onUpdated),null==(n=(o=this.ctx).removeEventListener)||n.call(o,"dataPointSelection",this._onSelection)),this.stack=[],this.pointer=-1,this._wired=!1}}});const Zs=["updateOptions","updateSeries","appendData","appendSeries","toggleSeries","showSeries","hideSeries","highlightSeries","isSeriesHidden","zoomX","addXaxisAnnotation","addYaxisAnnotation","addPointAnnotation","clearAnnotations","removeAnnotation","dataURI","exportToCSV"];function Ks(t){const e={};return Zs.forEach(s=>{"function"==typeof t[s]&&(e[s]=t[s].bind(t))}),Object.freeze(e)}Cs.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=(s=t.name,ws()[s]||null);var s;if(!e)return;const i=null!=e.apiVersion?e.apiVersion:1;if(1!==Math.trunc(i))return;const a={def:e,options:Object.freeze(n({},t.options||{})),handlers:new Map,disabled:!1,failures:0,api:null};a.api=function(t,e){const s=t.ctx,i=t.w,a={name:e.def.name,version:1,get options(){return e.options},on(t,s){const i=e.handlers;return i.has(t)||i.set(t,[]),i.get(t).push(s),a},off(t,s){const i=e.handlers.get(t);if(i){const t=i.indexOf(s);t>-1&&i.splice(t,1)}return a},store:{},layer:s=>t._layer(e.def.name,s||{}),get scales(){return t._currentScales},get data(){return t._lastData||(t._lastData=t._dataSnapshot())},theme:Object.freeze({get mode(){return i.config.theme.mode},get foreColor(){return i.config.chart.foreColor},seriesColor:t=>i.globals.colors[t],token:e=>t._token(e)}),chart:Ks(s),emit(t,i){s.events.fireEvent(`plugin:${e.def.name}:${t}`,[s,i])},get el(){return i.dom.baseEl}};return Object.freeze(a)}(this,a),this.active.push(a),this._guard(a,"setup",()=>e.setup(a.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 s=e&&e.pass||"full";let i=null;for(const e of this.active){if(e.disabled)continue;const a=e.handlers.get(t);if(!a||!a.length)continue;null===i&&(i=this._dataSnapshot(),this._lastData=i);const r={api:e.api,scales:this._currentScales,data:i,pass:s,hook:t};for(const s of a.slice())this._guard(e,t,()=>s(r))}}_guard(t,e,s){if(!t.disabled)try{s()}catch(e){t.failures=(t.failures||0)+1,t.failures>=3&&(t.disabled=!0)}}_setScales(t){const e=this.w,s=e.globals,i=e.layout;if(!t||!s.axisCharts)return void(this._currentScales=null);const a=t.xRatio,r=t.yRatio||[],o=t=>null!=s.maxYArr[t]?s.maxYArr[t]:s.maxY,n=t=>null!=s.minYArr[t]?s.minYArr[t]:s.minY;this._currentScales={x:t=>i.translateX+(t-s.minX)/a,y:(t,e=0)=>i.translateY+(o(e)-t)/(t=>null!=r[t]?r[t]:r[0])(e),domainX:[s.minX,s.maxX],domainY:(t=0)=>[n(t),o(t)],gridWidth:i.gridWidth,gridHeight:i.gridHeight,ratios:t}}_dataSnapshot(){const t=this.w,e=t.globals,s=t.seriesData.series||[],i=t.seriesData.seriesX||[];return s.map((t,s)=>{const a=i[s]||[],r=(t||[]).map((t,e)=>({x:null!=a[e]?a[e]:e,y:t}));return{name:e.seriesNames?e.seriesNames[s]:void 0,hidden:(e.collapsedSeriesIndices||[]).includes(s),color:e.colors?e.colors[s]:void 0,points:r}})}_token(t){const e=this.w,s=e.globals;switch(t){case"foreColor":return e.config.chart.foreColor;case"background":return e.config.chart.background;case"accent":case"primary":return s.colors?s.colors[0]:void 0;default:return/^series-\d+$/.test(t)&&s.colors?s.colors[Number(t.split("-")[1])]:void 0}}_layer(t,{z:e="front",className:s=""}={}){let i=this._layers.get(t);if(!i){i=this.ctx.graphics.group({class:`apexcharts-plugin-${t} ${s}`.trim()});const a=this.w.dom.elGraphical.node;"behind"===e?a.insertBefore(i.node,a.firstChild):a.appendChild(i.node),i.node.setAttribute("aria-hidden","true"),this._layers.set(t,i)}return function(t,e){const s=e=>(e&&t.add(e),e),i={get node(){return t.node},path(t={}){const{d:i="",stroke:a="#000",width:r=1,fill:o="none",opacity:n=1,dash:l=0,className:h=""}=t;return s(e.drawPath({d:i,stroke:a,strokeWidth:r,fill:o,fillOpacity:"none"===o?0:n,strokeOpacity:n,strokeDashArray:l,classes:h}))},line(t={}){const{x1:i,y1:a,x2:r,y2:o,stroke:n="#000",width:l=1,dash:h=0}=t;return s(e.drawLine(i,a,r,o,n,h,l))},rect(t={}){const{x:i=0,y:a=0,w:r=0,h:o=0,r:n=0,fill:l="#000",stroke:h=null,opacity:c=1}=t;return s(e.drawRect(i,a,r,o,n,l,c,null!=h?1:null,h))},circle(t={}){const{cx:i=0,cy:a=0,r:r=0,fill:o="#000",stroke:n=null}=t;return s(e.drawCircle(r,{cx:i,cy:a,fill:o,stroke:n||"none"}))},text(t={}){const{x:i=0,y:a=0,text:r="",color:o,size:n,anchor:l="start",weight:h}=t;return s(e.drawText({x:i,y:a,text:r,textAnchor:l,fontSize:n,foreColor:o,fontWeight:h}))},clear(){const e=t.node;for(;e.firstChild;)e.removeChild(e.firstChild);return i}};return i}(i,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 s=this.active[t],i=e.get(s.def.name);i?s.options=Object.freeze(n({},i.entry.options||{})):(this._guard(s,"destroy",()=>s.def.destroy&&s.def.destroy(s.api)),this.active.splice(t,1))}const s=new Set(this.active.map(t=>t.def.name)),i=[];e.forEach((t,e)=>{s.has(e)||i.push(t)}),i.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()}}});const Js={fill:"fill",stroke:"stroke","stroke-width":"strokeWidth","stroke-dasharray":"strokeDash","stroke-linecap":"lineCap","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","fill-rule":"fillRule"},Qs=Symbol("never"),ti={circle:0,square:1,rect:1,triangle:2,diamond:3,star:4,sparkle:5,cross:6,plus:7,line:8},ei=["circle","square","triangle","diamond","star","sparkle","cross","plus","line"],si={attr:()=>si,plot:()=>si,during:()=>si,after:t=>("function"==typeof t&&t(),si),animate:()=>si,delay:()=>si,loop:()=>si,finish:()=>si,stop:()=>si},ii={nodeName:"path",style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(){},getAttribute:()=>null,removeAttribute(){},hasAttribute:()=>!1,addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})},ai={__isCanvasMark:!0,node:{nodeName:"g",instance:null,style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(){},getAttribute:()=>null,removeAttribute(){},addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})},attr:()=>ai,add:()=>ai,addTo:()=>ai,remove:()=>ai,clear:()=>ai,css:()=>ai,hide:()=>ai,show:()=>ai,removeClass:()=>ai,animate:()=>si};class ri{constructor(t,e){this.__isCanvasMark=!0,this._g=t,this._i=e}get node(){return ii}attr(t,e){return"string"==typeof t?("fill"===t&&void 0!==e&&this._g._setMarkerFill(this._i,e),void 0===e?null:this):(t&&void 0!==t.fill&&this._g._setMarkerFill(this._i,t.fill),this)}add(t){return this}addTo(t){return this}remove(){return this}css(t){return this}fill(t){return void 0!==t&&this._g._setMarkerFill(this._i,t),this}stroke(t){return this}hide(){return this}show(){return this}removeClass(t){return this}animate(){return si}}class oi{constructor(t){this.__isCanvasMark=!0,this._cmd=t;const e=this;this.node={nodeName:t?t.tag:"g",instance:this,style:{},classList:{add(){},remove(){},toggle(){},contains:()=>!1},setAttribute(t,s){e._applyAttr(t,s)},getAttribute:()=>null,removeAttribute(){},hasAttribute:()=>!1,addEventListener(){},removeEventListener(){},appendChild(){},getBBox:()=>({x:0,y:0,width:0,height:0})}}_applyAttr(t,e){const s=this._cmd;if(!s)return;const i=Js[t];void 0!==i&&(s[i]=e)}attr(t,e){if("string"==typeof t)return void 0===e?null:(this._applyAttr(t,e),this);for(const e in t)void 0!==t[e]&&this._applyAttr(e,t[e]);return this}add(t){return this}addTo(t){return this}remove(){return this}clear(){return this}css(t){return this}fill(t){return"object"==typeof t?this.attr(t):this.attr("fill",t)}stroke(t){return"object"==typeof t?(void 0!==t.color&&this.attr("stroke",t.color),void 0!==t.width&&this.attr("stroke-width",t.width),this):this.attr("stroke",t)}plot(t){return"string"==typeof t&&this._cmd&&"path"===this._cmd.tag&&(this._cmd.d=t),this}hide(){return this}show(){return this}removeClass(t){return this}bbox(){return{x:0,y:0,width:0,height:0}}animate(){return si}}class ni{constructor(t){this.w=t,this._g=new gt(t),this._list=[],this._mx=new Float64Array(16),this._my=new Float64Array(16),this._msize=new Float64Array(16),this._mshape=new Int16Array(16),this._mstyle=new Int32Array(16),this._msi=new Int32Array(16),this._mn=0,this._mcap=16,this._styles=[],this._styleMap=new Map,this._lf=Qs,this._ls=Qs,this._lsw=Qs,this._ld=Qs,this._lfo=Qs,this._lso=Qs,this._lid=-1,this._lofFill=Qs,this._lofBase=-1,this._lofId=-1}_resetStyleCache(){this._lf=Qs,this._ls=Qs,this._lsw=Qs,this._ld=Qs,this._lfo=Qs,this._lso=Qs,this._lid=-1,this._lofFill=Qs,this._lofBase=-1,this._lofId=-1}reset(){this._list=[],this._mn=0,this._styles=[],this._styleMap=new Map,this._resetStyleCache();const t=this.w.config.series||[];let e=16;for(let s=0;s<t.length;s++){const i=t[s]&&t[s].data;Array.isArray(i)&&(e+=i.length)}e=Math.ceil(1.15*e)+16,e>this._mcap&&this._allocMarkers(e)}_allocMarkers(t){this._mcap=t,this._mx=new Float64Array(t),this._my=new Float64Array(t),this._msize=new Float64Array(t),this._mshape=new Int16Array(t),this._mstyle=new Int32Array(t),this._msi=new Int32Array(t)}_growMarkers(){const t=2*this._mcap,e=new Float64Array(t);e.set(this._mx),this._mx=e;const s=new Float64Array(t);s.set(this._my),this._my=s;const i=new Float64Array(t);i.set(this._msize),this._msize=i;const a=new Int16Array(t);a.set(this._mshape),this._mshape=a;const r=new Int32Array(t);r.set(this._mstyle),this._mstyle=r;const o=new Int32Array(t);o.set(this._msi),this._msi=o,this._mcap=t}displayList(){return this._list}markerCount(){return this._mn}_internStyle(t,e,s,i,a,r){const o=`${t}|${e}|${s}|${i}|${a}|${r}`,n=this._styleMap.get(o);if(void 0!==n)return n;const l=this._styles.length;return this._styles.push({fill:t,stroke:e,strokeWidth:s,strokeDash:i,fillOpacity:a,strokeOpacity:r}),this._styleMap.set(o,l),l}_setMarkerFill(t,e){const s=this._mstyle[t];if(e===this._lofFill&&s===this._lofBase)return void(this._mstyle[t]=this._lofId);const i=this._styles[s];if(!i||i.fill===e)return this._lofFill=e,this._lofBase=s,void(this._lofId=s);const a=this._internStyle(e,i.stroke,i.strokeWidth,i.strokeDash,i.fillOpacity,i.strokeOpacity);this._mstyle[t]=a,this._lofFill=e,this._lofBase=s,this._lofId=a}markerStyle(t){return this._styles[this._mstyle[t]]}markerSeries(t){return this._msi[t]}shapeName(t){return ei[t]||"circle"}_cmd(t,e){const s={tag:t,z:e||0,fill:void 0,stroke:void 0,strokeWidth:void 0,strokeDash:void 0,lineCap:void 0,fillOpacity:void 0,strokeOpacity:void 0,fillRule:void 0};return this._list.push(s),s}group(t){return ai}drawMarker(t,e,s={}){var i;const a=this._markerStyleId(s);this._mn>=this._mcap&&this._growMarkers();const r=this._mn++;return this._mx[r]=t||0,this._my[r]="number"==typeof e?e:NaN,this._msize[r]=s.pSize||0,this._mshape[r]=null!=(i=ti[s.shape||"circle"])?i:0,this._mstyle[r]=a,this._msi[r]=null==s.seriesIndex?-1:s.seriesIndex,new ri(this,r)}_markerStyleId(t){const e=t.shape||"circle",s="line"===e||"plus"===e||"cross"===e,i=s?"none":t.pointFillColor,a=s?t.pointFillColor:t.pointStrokeColor,r=t.pointStrokeWidth,o=t.pointStrokeDashArray,n=t.pointFillOpacity,l=s?t.pointFillOpacity:t.pointStrokeOpacity;if(i===this._lf&&a===this._ls&&r===this._lsw&&o===this._ld&&n===this._lfo&&l===this._lso)return this._lid;const h=this._internStyle(i,a,r,o,n,l);return this._lf=i,this._ls=a,this._lsw=r,this._ld=o,this._lfo=n,this._lso=l,this._lid=h,h}renderPaths(t){const e=this._cmd("path",t.realIndex);return e.d=t.pathTo,t.pathToNumeric&&(e.nxs=t.pathToNumeric.xs,e.nys=t.pathToNumeric.ys,e.ncloseY=t.pathToNumeric.closeY),e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.fill=t.fill,e.lineCap=t.strokeLinecap,e.si=t.realIndex,this.w.globals.animationEnded=!0,new oi(e)}drawPath(t){const e=this._cmd("path",0);return e.d=t.d,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.fill=t.fill,e.fillOpacity=t.fillOpacity,e.strokeOpacity=t.strokeOpacity,e.lineCap=t.strokeLinecap,e.strokeDash=t.strokeDashArray,new oi(e)}drawLine(t,e,s,i,a="#a8a8a8",r=0,o=1){const n=this._cmd("line",0);return n.lx1=t,n.ly1=e,n.lx2=s,n.ly2=i,n.stroke=a,n.strokeDash=r,n.strokeWidth=o,new oi(n)}drawRect(t=0,e=0,s=0,i=0,a=0,r="#fefefe",o=1,n=null,l=null,h=0){const c=this._cmd("rect",0);return c.x1=t,c.y1=e,c.rw=s>0?s:0,c.rh=i>0?i:0,c.radius=a,c.fill=r,c.fillOpacity=o,null!=l&&(c.stroke=l,c.strokeWidth=null==n?1:n,c.strokeDash=h),new oi(c)}drawCircle(t,e=null){const s=this._cmd("circle",0);return s.r=t<0?0:t,e&&(s.cx=e.cx,s.cy=e.cy,void 0!==e.fill&&(s.fill=e.fill),void 0!==e.stroke&&(s.stroke=e.stroke)),new oi(s)}drawText(t){const e=this._cmd("text",0);return e.text=Array.isArray(t.text)?t.text.join(" "):t.text,e.tx=t.x,e.ty=t.y,e.textAnchor=t.textAnchor||"start",e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.foreColor,new oi(e)}markerPath(t,e,s,i){return this._g.getMarkerPath(t,e,ei[s]||"circle",i)}}const li=2*Math.PI;class hi{constructor(t){this.w=t,this._host=null,this._canvas=null,this._c2d=null,this._margin=0,this._dpr=1,this._dim=null,this._alpha=1,this._unitPaths=new Map,this._markerBatches=0}markerBatchCount(){return this._markerBatches}_seriesAlpha(t){const e=this._dim;return!e||null==e.active||e.active<0||null==t||t<0||t===e.active?1:null==e.opacity?.2:e.opacity}_plotDims(){var t;const e=Math.max(0,Math.ceil(this.w.layout.gridWidth||0)),s=Math.max(0,Math.ceil(this.w.layout.gridHeight||0)),i=(null==(t=this.w.globals.markers)?void 0:t.largestSize)||0;return{gw:e,gh:s,margin:Math.ceil(i+8)}}createHost(){const t=m.getWindow();this._dpr=Math.min(2,t&&t.devicePixelRatio||1);const{gw:e,gh:s,margin:i}=this._plotDims();this._margin=i;const a=e+2*i,r=s+2*i,o=m.createElementNS(F,"foreignObject");o.setAttribute("x",String(-i)),o.setAttribute("y",String(-i)),o.setAttribute("width",String(a)),o.setAttribute("height",String(r)),o.setAttribute("class","apexcharts-canvas-series"),o.style.overflow="visible";const n=m.createElement("canvas");return n.setAttribute("class","apexcharts-series-canvas"),n.width=Math.max(1,Math.round(a*this._dpr)),n.height=Math.max(1,Math.round(r*this._dpr)),n.style.width=a+"px",n.style.height=r+"px",n.style.pointerEvents="none",o.appendChild(n),this._canvas=n,this._c2d=n.getContext("2d"),this._host=new ss(o),this._host}getHost(){return this._host}clear(){this._c2d&&this._canvas&&(this._c2d.setTransform(1,0,0,1,0,0),this._c2d.clearRect(0,0,this._canvas.width,this._canvas.height))}_syncDpr(){if(!this._canvas)return;const t=m.getWindow(),e=Math.min(2,t&&t.devicePixelRatio||1);if(e===this._dpr)return;this._dpr=e;const s=parseFloat(this._canvas.style.width)||0,i=parseFloat(this._canvas.style.height)||0;this._canvas.width=Math.max(1,Math.round(s*e)),this._canvas.height=Math.max(1,Math.round(i*e))}paint(t,e,s=null){const i=this._c2d;if(!i)return;this._dim=s||null,this._syncDpr(),this.clear();const a=this._dpr,r=this._margin;if(i.setTransform(a,0,0,a,r*a,r*a),t.length){const e=t.length>1?t.map((t,e)=>[t,e]).sort((t,e)=>t[0].z===e[0].z?t[1]-e[1]:t[0].z-e[0].z).map(t=>t[0]):t;for(let t=0;t<e.length;t++){const s=e[t];this._alpha=this._dim?this._seriesAlpha(s.si):1,this._paintOne(i,s)}}this._paintMarkers(i,e),this._alpha=1}_unitPath(t,e,s){const i=e+"|"+s;let a=this._unitPaths.get(i);if(void 0===a){try{a=new Path2D(t.markerPath(0,0,e,s))}catch(t){a=null}this._unitPaths.set(i,a)}return a}_paintMarkers(t,e){this._markerBatches=0;const s=e.markerCount();if(!s)return;const i=e._mx,a=e._my,r=e._msize,o=e._mshape,n=e._mstyle,l=!!this._dim;l||(this._alpha=1);let h=0;for(;h<s;){const c=n[h],d=o[h],g=e.markerStyle(h);if(!g){h++;continue}const p=this._applyFill(t,g),u=this._applyStroke(t,g);this._markerBatches++;const x=null==g.fillOpacity?1:Number(g.fillOpacity),f=null==g.strokeOpacity?1:Number(g.strokeOpacity);if(0===d){let d=h;for(;d<s&&0===o[d]&&n[d]===c;){const s=r[d]||0,o=a[d];if(s>0&&o==o)if(t.beginPath(),t.arc(i[d],o,s,0,li),l){const s=this._seriesAlpha(e.markerSeries(d));p&&(t.globalAlpha=x*s,t.fill()),u&&(t.globalAlpha=f*s,t.stroke())}else p&&t.fill(),u&&t.stroke();d++}t.globalAlpha=1,h=d}else{const g=this._dpr,m=this._margin;let b=h;for(;b<s&&o[b]===d&&n[b]===c;){const s=a[b],o=r[b];if(s==s&&o>0){const a=this._unitPath(e,d,o);if(a){t.setTransform(g,0,0,g,(m+i[b])*g,(m+s)*g);const r=l?this._seriesAlpha(e.markerSeries(b)):1;p&&(t.globalAlpha=x*r,t.fill(a)),u&&(t.globalAlpha=f*r,t.stroke(a))}}b++}t.setTransform(g,0,0,g,m*g,m*g),t.globalAlpha=1,h=b}}}_paintNumericPath(t,e){const s=e.nxs,i=e.nys,a=s.length;if(a){t.beginPath(),t.moveTo(s[0],i[0]);for(let e=1;e<a;e++)t.lineTo(s[e],i[e]);null!=e.ncloseY&&(t.lineTo(s[a-1],e.ncloseY),t.lineTo(s[0],e.ncloseY),t.closePath()),this._applyFill(t,e)&&t.fill("evenodd"===e.fillRule?"evenodd":"nonzero"),this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}}_paintOne(t,e){switch(e.tag){case"path":if(e.nxs){this._paintNumericPath(t,e);break}if(!e.d)return;if(!e.path2d)try{e.path2d=new Path2D(e.d)}catch(t){return}this._fillStrokePath(t,e,e.path2d);break;case"rect":{const s=new Path2D;e.radius&&"function"==typeof s.roundRect?s.roundRect(e.x1,e.y1,e.rw,e.rh,e.radius):s.rect(e.x1,e.y1,e.rw,e.rh),this._fillStrokePath(t,e,s);break}case"circle":if(!(e.r>0))return;t.beginPath(),t.arc(e.cx,e.cy,e.r,0,li),this._fillStroke(t,e);break;case"line":t.beginPath(),t.moveTo(e.lx1,e.ly1),t.lineTo(e.lx2,e.ly2),this._strokeOnly(t,e);break;case"text":{if(null==e.text)return;t.save(),t.globalAlpha=this._alpha,t.fillStyle=e.fill||"#000";const s=e.fontSize||"11px";t.font=`${"number"==typeof s?s+"px":s} ${e.fontFamily||"Helvetica, Arial, sans-serif"}`,t.textAlign="middle"===e.textAnchor?"center":"end"===e.textAnchor?"right":"left",t.fillText(String(e.text),e.tx,e.ty),t.restore();break}}}_fillStrokePath(t,e,s){this._applyFill(t,e)&&t.fill(s,"evenodd"===e.fillRule?"evenodd":"nonzero"),this._applyStroke(t,e)&&t.stroke(s),t.globalAlpha=1}_fillStroke(t,e){this._applyFill(t,e)&&t.fill(),this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}_strokeOnly(t,e){this._applyStroke(t,e)&&t.stroke(),t.globalAlpha=1}_applyFill(t,e){const s=e.fill;return!(!s||"none"===s)&&(("string"!=typeof s||0!==s.indexOf("url("))&&(t.globalAlpha=(null==e.fillOpacity?1:Number(e.fillOpacity))*this._alpha,t.fillStyle=s,!0))}_applyStroke(t,e){const s=e.stroke,i=null==e.strokeWidth?1:Number(e.strokeWidth);if(!(s&&"none"!==s&&i>0))return!1;if("string"==typeof s&&0===s.indexOf("url("))return!1;t.globalAlpha=(null==e.strokeOpacity?1:Number(e.strokeOpacity))*this._alpha,t.strokeStyle=s,t.lineWidth=i,t.lineCap=e.lineCap||"butt";const a=e.strokeDash;return a&&0!==a?t.setLineDash(Array.isArray(a)?a:[Number(a)]):t.setLineDash([]),!0}toDataURL(){return this._canvas?this._canvas.toDataURL():null}destroy(){this._host=null,this._canvas=null,this._c2d=null,this._unitPaths.clear()}}class ci{constructor(t,e){this.w=t,this.ctx=e,this.kind="canvas",this._g=new ni(t),this._compositor=new hi(t)}beginSeries(){this._g.reset()}present(){const t=this._compositor.createHost();return this._compositor.paint(this._g.displayList(),this._g),t}clear(){this._compositor.clear()}group(t){return this._g.group(t)}drawPath(t){return this._g.drawPath(t)}drawLine(...t){return this._g.drawLine(...t)}drawRect(...t){return this._g.drawRect(...t)}drawCircle(t,e){return this._g.drawCircle(t,e)}drawMarker(t,e,s){return this._g.drawMarker(t,e,s)}renderPaths(t){return this._g.renderPaths(t)}drawText(t){return this._g.drawText(t)}supports(t){return"solidFill"===t||"dashArray"===t}hitTest(t,e){return null}restyle(t){this._compositor.paint(this._g.displayList(),this._g,t||null)}toBitmap(){const t=this._compositor.toDataURL();if(!t)return null;const e=this.w.globals,s=this.w.config.chart,i=this._compositor._margin;return{dataURL:t,x:(e.translateX||0)+(s.offsetX||0)-i,y:(e.translateY||0)+(s.offsetY||0)-i,w:(this.w.layout.gridWidth||0)+2*i,h:(this.w.layout.gridHeight||0)+2*i}}destroy(){this._compositor.destroy()}}Cs.registerRenderer("canvas",(t,e)=>new ci(t,e)),Cs._customSeriesFactory=function(t,e){const s=class{constructor(t,e,s){this.w=t,this.ctx=e,this.xyRatios=s,this._warned=!1}draw(t,s,i){var a,r;const o=this.w,n=new gt(o,this.ctx),l=xt(this.ctx,n),h=n.group({class:"apexcharts-marks-series"});return t.forEach((t,s)=>{var a;const r=Array.isArray(i)?i[s]:s,c=n.group({class:"apexcharts-series",rel:r+1,seriesName:b.escapeString(o.seriesData.seriesNames[r]),"data:realIndex":r}),d=this._scales(r,(o.seriesData.series[r]||[]).length),g=o.globals.colors[r],p=(null==(a=o.config.series[r])?void 0:a.data)||[],u=o.seriesData.seriesX[r]||[],x=o.seriesData.series[r]||[];o.globals.seriesXvalues[r]=[],o.globals.seriesYvalues[r]=[],void 0===o.globals.pointsArray[r]&&(o.globals.pointsArray[r]=[]);for(let t=0;t<x.length;t++){const s=x[t];if(null==s)continue;const i=u[t],a=d.xAt(t,i),n=d.y(s),h=this._api(l,c,r,t);try{e.renderItem({datum:p[t],x:a,y:n,scales:d,api:h,seriesIndex:r,dataPointIndex:t,color:g})}catch(t){this._warned||(this._warned=!0)}o.globals.seriesXvalues[r][t]=a,o.globals.seriesYvalues[r][t]=n,o.globals.pointsArray[r][t]=[a,n]}n.setupEventDelegation(c,".apexcharts-marks-mark"),h.add(c)}),null==(r=null==(a=this.ctx.animations)?void 0:a.animationCompleted)||r.call(a,h),h}_scales(t,e){var s,i,a,r;const o=this.w.globals,n=this.w.config,l=this.xyRatios.xRatio,h=this.xyRatios.yRatio,c=null!=(i=null==(s=o.seriesYAxisReverseMap)?void 0:s[t])?i:0,d=Array.isArray(h)?null!=(a=h[c])?a:h[0]:h,g=o.maxYArr,p=Array.isArray(g)&&g.length&&null!=(r=g[c])?r:o.maxY,u=o.gridWidth,x=o.gridHeight,f=!o.isXNumeric,m=e||o.dataPoints||1,b=m>0?u/m:u,y="on"===n.xaxis.tickPlacement,w=t=>(t-o.minX)/l,v=o.minXDiff||1;return{x:w,xAt:(t,e)=>f?y&&m>1?t/(m-1)*u:(t+.5)*b:w(e),y:t=>(p-t)/d,gridWidth:u,gridHeight:x,band:f?b:l?v/l:u}}_api(t,e,s,i){const a=t=>{if(t){try{t.node.setAttribute("index",String(s)),t.node.setAttribute("j",String(i)),t.node.classList.add("apexcharts-marks-mark")}catch(t){}e.add(t)}return t};return{path:(e={})=>{var s,i,r,o,n,l,h,c,d;return a(t.drawPath({d:e.d||"",stroke:null!=(s=e.stroke)?s:"#000",strokeWidth:null!=(r=null!=(i=e.width)?i:e.strokeWidth)?r:1,fill:null!=(o=e.fill)?o:"none",fillOpacity:null!=(l=e.fillOpacity)?l:e.fill&&"none"!==e.fill?null!=(n=e.opacity)?n:1:0,strokeOpacity:null!=(c=null!=(h=e.strokeOpacity)?h:e.opacity)?c:1,strokeDashArray:null!=(d=e.dash)?d:0,strokeLinecap:e.lineCap}))},line:(e={})=>{var s,i,r,o;return a(t.drawLine(e.x1,e.y1,e.x2,e.y2,null!=(s=e.stroke)?s:"#000",null!=(i=e.dash)?i:0,null!=(o=null!=(r=e.width)?r:e.strokeWidth)?o:1))},rect:(e={})=>{var s,i,r,o,n,l,h,c;return a(t.drawRect(null!=(s=e.x)?s:0,null!=(i=e.y)?i:0,null!=(r=e.w)?r:0,null!=(o=e.h)?o:0,null!=(n=e.r)?n:0,null!=(l=e.fill)?l:"#000",null!=(h=e.opacity)?h:1,null!=e.stroke?null!=(c=e.strokeWidth)?c:1:null,e.stroke))},circle:(e={})=>{var s,i,r,o,n;return a(t.drawCircle(null!=(s=e.r)?s:0,{cx:null!=(i=e.cx)?i:0,cy:null!=(r=e.cy)?r:0,fill:null!=(o=e.fill)?o:"#000",stroke:e.stroke||"none","stroke-width":null!=(n=e.strokeWidth)?n:e.stroke?1:0}))},text:(e={})=>{var s,i,r,o;return a(t.drawText({x:null!=(s=e.x)?s:0,y:null!=(i=e.y)?i:0,text:null!=(r=e.text)?r:"",textAnchor:null!=(o=e.anchor)?o:"start",fontSize:e.size,foreColor:e.color,fontWeight:e.weight}))}}}};return s.dataType=e.dataType||"xy",s.yExtent="function"==typeof e.yExtent?e.yExtent:null,s};class di{constructor(t,e){if(this.w=t,this.ctx=e,"os"!==t.config.theme.follow||!c.isBrowser())return;const s=this._ensureMedia();s&&(this._applyToConfig(s),this._ensureListeners(s))}_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,s=()=>{const t=e._osThemeMedia;if(!t)return;const s={mode:t.dark&&t.dark.matches?"dark":"light"};t.contrast&&t.contrast.matches?s.accessibility={colorBlindMode:"highContrast"}:s.accessibility={colorBlindMode:""},e.updateOptions({theme:s},!1,!0,!1)};di._add(t.dark,s),di._add(t.contrast,s),t.handler=s}teardown(){const t=this.ctx._osThemeMedia;t&&(t.handler&&(di._remove(t.dark,t.handler),di._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))}}Cs.registerFeatures({osThemeWatcher:di});const gi="__apexcharts_crossfilters__";function pi(t){if(!Number.isFinite(t))return t;const e=Number(t.toPrecision(12));return Object.is(e,-0)?0:e}function ui(t){return"number"==typeof t&&Number.isFinite(t)}function xi(t){if("function"==typeof t)return t;if(t&&"object"==typeof t){if("string"==typeof t.sum){const e=t.sum;return t=>t.reduce((t,s)=>t+(Number(s[e])||0),0)}if("string"==typeof t.avg){const e=t.avg;return t=>t.length?t.reduce((t,s)=>t+(Number(s[e])||0),0)/t.length:0}if("string"==typeof t.min){const e=t.min;return t=>t.length?Math.min(...t.map(t=>Number(t[e])||0)):0}if("string"==typeof t.max){const e=t.max;return t=>t.length?Math.max(...t.map(t=>Number(t[e])||0)):0}}return t=>t.length}function fi(t,e){return"function"==typeof e?t.slice().sort(e):"asc"===e?t.slice().sort((t,e)=>t>e?1:t<e?-1:0):"desc"===e?t.slice().sort((t,e)=>t<e?1:t>e?-1:0):t}function mi(t,e){if(!ui(t))return-1;const s=e.length-1;if(t<e[0]||t>e[s])return-1;if(t===e[s])return s-1;for(let i=0;i<s;i++)if(t>=e[i]&&t<e[i+1])return i;return-1}function bi(t){const e=[];for(let s=0;s<t.length-1;s++)e.push(pi((t[s]+t[s+1])/2));return e}class yi{constructor(t,e){this.id=t,this.records=Array.isArray(e)?e:[],this.dims=new Map,this._listeners=new Map}static _store(){const t=globalThis;return t[gi]||(t[gi]=new Map),t[gi]}static getOrCreate(t){if(!t||"string"!=typeof t.id)throw new Error("ApexCharts.crossfilter requires an { id } string.");const e=yi._store();let s=e.get(t.id);return s?(t.records&&s.setRecords(t.records),s):(s=new yi(t.id,t.records),e.set(t.id,s),s)}static get(t){return yi._store().get(t)||null}setRecords(t){return this.records=Array.isArray(t)?t:[],this.dims.forEach(t=>this._recomputeDomain(t)),this._emit("records",this.state()),this._emit("change",this.state()),this}registerDimension(t,e){if(!e||"function"!=typeof e.dimension)throw new Error(`crossfilter.registerDimension("${t}") needs a dimension function.`);const s=e.type||(e.bins?"range":"category"),i={accessor:e.dimension,reducer:xi(e.reduce),type:s,bins:e.bins,order:e.order,filter:null,labels:[],edges:null};return this.dims.set(t,i),this._recomputeDomain(i),null!=e.filter&&this._setFilterOn(i,e.filter),this}hasDimension(t){return this.dims.has(t)}removeDimension(t){return this.dims.delete(t),this}_recomputeDomain(t){if("matrix"===t.type){const e=function(t,e,s){const i=new Set,a=new Set,r=[],o=[];for(let s=0;s<t.length;s++){const n=e(t[s]);if(!n)continue;const l=n[0],h=n[1];null==l||i.has(l)||(i.add(l),r.push(l)),null==h||a.has(h)||(a.add(h),o.push(h))}return{xLabels:fi(r,s),yLabels:fi(o,s)}}(this.records,t.accessor,t.order);return t.xLabels=e.xLabels,t.yLabels=e.yLabels,void(t.edges=null)}if("range"===t.type)t.edges=function(t,e,s){if(s&&Array.isArray(s.thresholds)&&s.thresholds.length>=2){const t=Array.from(new Set(s.thresholds.filter(ui))).sort((t,e)=>t-e);return t.length>=2?t.map(pi):[0,1]}let i=1/0,a=-1/0;for(let s=0;s<t.length;s++){const r=e(t[s]);ui(r)&&(r<i&&(i=r),r>a&&(a=r))}if(i===1/0)return[0,1];if(i===a){const t=Math.abs(i)>0?Math.abs(i):1;return[pi(i),pi(i+t)]}if(s&&ui(s.width)&&s.width>0){const t=s.width,e=Math.floor(i/t)*t;let r=Math.ceil(a/t)*t;r<=e&&(r=e+t);const o=Math.max(1,Math.round((r-e)/t)),n=new Array(o+1);for(let s=0;s<=o;s++)n[s]=pi(e+s*t);return n}const r=s&&ui(s.count)&&s.count>=1?Math.floor(s.count):30,o=(a-i)/r,n=new Array(r+1);for(let t=0;t<=r;t++)n[t]=pi(i+t*o);return n[r]=pi(a),n}(this.records,t.accessor,t.bins),t.labels=bi(t.edges);else if(t.labels=function(t,e,s){const i=new Set,a=[];for(let s=0;s<t.length;s++){const r=e(t[s]);null!=r&&(i.has(r)||(i.add(r),a.push(r)))}return fi(a,s)}(this.records,t.accessor,t.order),t.edges=null,t.filter instanceof Set){const e=new Set(t.labels);Array.from(t.filter).forEach(s=>{e.has(s)||t.filter.delete(s)})}}filter(t,e){const s=this.dims.get(t);return s?(this._setFilterOn(s,e),this._emit("change",this.state()),this):this}toggleKey(t,e){const s=this.dims.get(t);if(!s||"category"!==s.type)return this;s.filter instanceof Set||(s.filter=new Set);const i=s.filter;return i.has(e)?i.delete(e):i.add(e),0===i.size&&(s.filter=null),this._emit("change",this.state()),this}_setFilterOn(t,e){if(null==e)return void(t.filter=null);if("range"===t.type)return void(Array.isArray(e)&&2===e.length&&e.every(ui)?t.filter=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]:t.filter=null);const s=(Set,new Set(e));t.filter=s.size?s:null}clear(t){const e=this.dims.get(t);return e&&(e.filter=null),this._emit("change",this.state()),this}reset(){return this.dims.forEach(t=>{t.filter=null}),this._emit("change",this.state()),this}_hasFilter(t){return null!=t.filter&&(!(t.filter instanceof Set)||t.filter.size>0)}_passes(t,e){if(!this._hasFilter(t))return!0;const s=t.accessor(e);return t.filter instanceof Set?t.filter.has(s):!!ui(s)&&(s>=t.filter[0]&&s<=t.filter[1])}filteredRecords(t){const e=[];return this.dims.forEach((s,i)=>{i!==t&&this._hasFilter(s)&&e.push(s)}),0===e.length?this.records:this.records.filter(t=>e.every(e=>this._passes(e,t)))}filteredRows(){return this.filteredRecords(null)}aggregateFor(t){const e=this.dims.get(t);if(!e)return{type:"category",labels:[],values:[],keys:[]};const s=this.filteredRecords(t);if("matrix"===e.type){const t=new Map(e.xLabels.map((t,e)=>[t,e])),i=new Map(e.yLabels.map((t,e)=>[t,e])),a=e.yLabels.map(()=>e.xLabels.map(()=>[]));for(let r=0;r<s.length;r++){const o=e.accessor(s[r]);if(!o)continue;const n=t.get(o[0]),l=i.get(o[1]);null!=n&&null!=l&&a[l][n].push(s[r])}return{type:"matrix",xLabels:e.xLabels.slice(),yLabels:e.yLabels.slice(),matrix:a.map(t=>t.map(t=>e.reducer(t)))}}if("range"===e.type){const t=e.edges||[0,1],i=t.length-1,a=Array.from({length:i},()=>[]);for(let i=0;i<s.length;i++){const r=mi(e.accessor(s[i]),t);r>=0&&a[r].push(s[i])}return{type:"range",labels:bi(t),values:a.map(t=>e.reducer(t)),keys:a.map((e,s)=>[t[s],t[s+1]]),edges:t}}const i=new Map;e.labels.forEach(t=>i.set(t,[]));for(let t=0;t<s.length;t++){const a=e.accessor(s[t]),r=i.get(a);r&&r.push(s[t])}return{type:"category",labels:e.labels.slice(),values:e.labels.map(t=>e.reducer(i.get(t)||[])),keys:e.labels.slice()}}aggregateAll(){const t={};return this.dims.forEach((e,s)=>{t[s]=this.aggregateFor(s)}),t}state(){const t={};return this.dims.forEach((e,s)=>{this._hasFilter(e)&&(t[s]=e.filter instanceof Set?Array.from(e.filter):e.filter.slice())}),{filters:t,filteredCount:this.filteredRows().length,total:this.records.length}}filterOf(t){const e=this.dims.get(t);return e&&this._hasFilter(e)?e.filter instanceof Set?new Set(e.filter):e.filter.slice():null}on(t,e){let s=this._listeners.get(t);return s||(s=new Set,this._listeners.set(t,s)),s.add(e),()=>this.off(t,e)}off(t,e){var s;return null==(s=this._listeners.get(t))||s.delete(e),this}_emit(t,e){var s;null==(s=this._listeners.get(t))||s.forEach(t=>{try{t(e)}catch(t){}})}_esc(t){return String(null==t?"":t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}_resolveColumns(t){if(Array.isArray(t)&&t.length)return t.map(t=>"string"==typeof t?{field:t,label:t}:{field:t.field,label:t.label||t.field,format:t.format});const e=this.records[0];return(e?Object.keys(e):[]).map(t=>({field:t,label:t}))}_tableHTML(t,e,s){const i="<thead><tr>"+t.map(t=>`<th>${this._esc(t.label)}</th>`).join("")+"</tr></thead>",a="<tbody>"+e.map(e=>"<tr>"+t.map(t=>{const s=e[t.field],i=t.format?t.format(s,e):s;return`<td>${this._esc(i)}</td>`}).join("")+"</tr>").join("")+"</tbody>";return`<table class="apexcharts-cf-table">${`<caption>${e.length} of ${s} rows</caption>`}${i}${a}</table>`}dataTable(t,e){if(!t)return{refresh(){},destroy(){}};const s=e||{},i=this._resolveColumns(s.columns),a=s.pageSize||0,r=s.page||0,o=()=>{const e=this.filteredRows(),s=a?e.slice(r*a,r*a+a):e;t.innerHTML=this._tableHTML(i,s,e.length)};o();const n=this.on("change",o);return{refresh:o,destroy:()=>{n(),t.innerHTML=""}}}destroy(){yi._store().delete(this.id),this.dims.clear(),this._listeners.clear(),this.records=[]}}const wi=[".apexcharts-bar-area",".apexcharts-candlestick-area",".apexcharts-boxPlot-area",".apexcharts-rangebar-area",".apexcharts-marker"].join(", "),vi=[".apexcharts-pie-area",".apexcharts-bar-area"].join(", "),Ai="apexcharts-crossfilter-dimmed",Ci=["pie","donut","polarArea","radialBar"];Cs.registerFeatures({linkedViews:class{constructor(t,e){this.w=t,this.ctx=e,this._dimmed=!1,this._wired=!1,this._pending=!1,this._lastValues=null,this._onPointSelect=this._onPointSelect.bind(this),this._afterRender=this._afterRender.bind(this),this._onChange=this._onChange.bind(this),"filter"===this._mode()&&this._initEngine()}_mode(){const t=this.w.config.chart.link;return t&&"function"==typeof t.dimension?"filter":t&&t.enabled?"highlight":"off"}_enabled(){const t=this.w.config.chart.link;return!(!t||!t.enabled)}onSourceSelection(t){var e;const s=this._mode();if("off"===s)return;if(!t||null==t.min||null==t.max)return;let i=Math.min(t.min,t.max),a=Math.max(t.min,t.max);const r=this.w.globals.minX,o=this.w.globals.maxX;if(isFinite(r)&&isFinite(o)&&o>r){const t=1e-6*(o-r);i-r<=t&&(i=r),o-a<=t&&(a=o)}if("filter"===s){const t=this._cf();if(!t)return;return t.filter(this._chartId(),[i,a]),void this._fireFilterChange(t,[i,a])}this._group().forEach(t=>{var e;null==(e=null==t?void 0:t.linkedViews)||e.applyDim(i,a)});const n={xaxis:{min:i,max:a},sourceChartID:this.w.globals.chartID};"function"==typeof this.w.config.chart.events.crossFilter&&this.w.config.chart.events.crossFilter(this.ctx,n),null==(e=this.ctx.events)||e.fireEvent("crossFilter",[this.ctx,n])}_group(){const t="function"==typeof this.ctx.getGroupedCharts?this.ctx.getGroupedCharts():[];return[this.ctx,...t]}applyDim(t,e){if(!this._enabled())return;const s=this.w,i=s.dom.baseEl;if(!i)return;const a=s.config.chart.link.dimOpacity;s.dom.elWrap&&"number"==typeof a&&s.dom.elWrap.style.setProperty("--apx-cf-dim",String(a));const r=s.globals.seriesX||[];i.querySelectorAll(wi).forEach(s=>{const i=s.getAttribute("j");if(null===i)return;const a=parseInt(i,10),o=s.getAttribute("index"),n=null===o?0:parseInt(o,10),l=r[n]||r[0];if(!l)return;const h=l[a];null!=h&&s.classList.toggle(Ai,h<t||h>e)}),this._dimmed=!0}clear(){const t=this.w.dom.baseEl;t&&(t.querySelectorAll("."+Ai).forEach(t=>t.classList.remove(Ai)),this._dimmed=!1)}clearGroup(){if("filter"===this._mode()){const t=this._cf();return void(t&&t.reset())}this._group().forEach(t=>{var e;return null==(e=null==t?void 0:t.linkedViews)?void 0:e.clear()})}_chartId(){return this.w.globals.chartID}_cf(){const t=this.w.config.chart.link,e=t&&(t.id||this.w.config.chart.group);return e?yi.get(e):null}_isPie(){return-1!==Ci.indexOf(this.w.config.chart.type)}_isHeatmap(){return"heatmap"===this.w.config.chart.type}_initEngine(){const t=this._cf(),e=this.w.config.chart.link;if(!t){e&&e.id||this.w.config.chart.group;return}const s=this._chartId();t.hasDimension(s)||t.registerDimension(s,{dimension:e.dimension,reduce:e.reduce,type:e.type||(this._isHeatmap()?"matrix":void 0),bins:e.bins,order:e.order}),this._injectSeries(t.aggregateFor(s)),this._wire(t)}_seriesFromAgg(t){if("matrix"===t.type)return t.yLabels.map((e,s)=>({name:String(e),data:t.xLabels.map((e,i)=>({x:String(e),y:t.matrix[s][i]}))}));if(this._isPie())return t.values.slice();const e=this.w.config.chart.link.seriesName||"Count";return"range"===t.type?[{name:e,data:t.labels.map((e,s)=>[e,t.values[s]])}]:[{name:e,data:t.values.slice()}]}_sigOf(t){return JSON.stringify(t.matrix||t.values)}_injectSeries(t){const e=this.w;this._lastValues=this._sigOf(t),e.config.series=this._seriesFromAgg(t),"matrix"!==t.type&&(this._isPie()?e.config.labels=t.labels.map(String):"category"===t.type&&(e.config.xaxis||(e.config.xaxis={}),e.config.xaxis.categories=t.labels.map(String)))}_wire(t){this._wired||(this._wired=!0,this.ctx.addEventListener("dataPointSelection",this._onPointSelect),this.ctx.addEventListener("mounted",this._afterRender),this.ctx.addEventListener("updated",this._afterRender),t.on("change",this._onChange))}_onPointSelect(t,e,s){if("filter"!==this._mode()||!s||null==s.dataPointIndex)return;const i=this._cf();if(!i)return;const a=this._chartId(),r=i.aggregateFor(a);if("matrix"===r.type)return;const o=r.keys[s.dataPointIndex];null!=o&&(i.toggleKey(a,o),this._fireFilterChange(i,o))}_onChange(){"filter"!==this._mode()||this._pending||(this._pending=!0,Promise.resolve().then(()=>{this._pending=!1,this.w.globals.isDestroyed||this._applyAggregation()}))}_applyAggregation(){if("filter"!==this._mode())return;const t=this._cf();if(!t)return;const e=t.aggregateFor(this._chartId()),s=this._sigOf(e);s!==this._lastValues?(this._lastValues=s,this.ctx.updateSeries(this._seriesFromAgg(e),!0)):this._applySelfDim()}_afterRender(){"filter"===this._mode()&&this._applySelfDim()}_applySelfDim(){const t=this._cf();if(!t)return;const e=this.w,s=e.dom.baseEl;if(!s)return;const i=this._chartId(),a=t.filterOf(i),r=e.config.chart.link.dimOpacity;e.dom.elWrap&&"number"==typeof r&&e.dom.elWrap.style.setProperty("--apx-cf-dim",String(r));const o=a instanceof Set,n=Array.isArray(a),l=t.aggregateFor(i).keys;s.querySelectorAll(vi).forEach(t=>{const e=t.getAttribute("j");if(null===e)return;const s=l[parseInt(e,10)];let i=!1;o?i=!a.has(s):n&&Array.isArray(s)&&(i=s[1]<=a[0]||s[0]>=a[1]),t.classList.toggle(Ai,i)}),this._dimmed=!!a}_fireFilterChange(t,e){var s;const i=l(n({},t.state()),{sourceChartID:this._chartId(),key:e}),a=this.w.config.chart.events;"function"==typeof a.filterChange&&a.filterChange(this.ctx,i),null==(s=this.ctx.events)||s.fireEvent("filterChange",[this.ctx,i])}teardown(){var t,e,s,i,a,r;if(this.clear(),this._wired){null==(e=(t=this.ctx).removeEventListener)||e.call(t,"dataPointSelection",this._onPointSelect),null==(i=(s=this.ctx).removeEventListener)||i.call(s,"mounted",this._afterRender),null==(r=(a=this.ctx).removeEventListener)||r.call(a,"updated",this._afterRender);const o=this._cf();o&&(o.off("change",this._onChange),o.removeDimension(this._chartId())),this._wired=!1}}}});const Si=Cs;Si._crossfilterFactory=t=>yi.getOrCreate(t),Si._crossfilterGet=t=>yi.get(t);const ki=["point","xaxis","yaxis"],_i=[10,11,12,14,17,20],Li=["circle","square","diamond","triangle"],Mi={circle:"\u25cf",square:"\u25a0",diamond:"\u25c6",triangle:"\u25b2"},Di=["#ffffff","#334155","#2563eb","#16a34a","#d97706","#dc2626"];class Ei{constructor(t,e){this.w=t,this.ctx=e,this._wired=!1,this._drag=null,this._editor=null,this._creating=!1,this._createSeq=0,this._attach=this._attach.bind(this),this._onRerender=this._onRerender.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onCreateClick=this._onCreateClick.bind(this),this._onDocDownEditor=this._onDocDownEditor.bind(this),(this._enabledGlobally()||this._hasDraggable()||this._paletteEnabled())&&this._wire()}_enabledGlobally(){const t=this.w.config.chart.ink;return!(!t||!t.enabled)}_paletteEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.palette)}_snapEnabled(){const t=this.w.config.chart.ink;return!(!t||!t.snap)}_nearest(t,e){let s=t,i=1/0;for(let a=0;a<e.length;a++){const r=Math.abs(e[a]-t);r<i&&(i=r,s=e[a])}return s}_snapX(t){if(!this._snapEnabled()||"number"!=typeof t)return t;const e=this.w.globals.xAxisScale;return e&&Array.isArray(e.result)&&e.result.length?this._nearest(t,e.result):t}_snapY(t,e){if(!this._snapEnabled()||"number"!=typeof t)return t;const s=this.w.globals.yAxisScale,i=s&&s[e];return i&&Array.isArray(i.result)&&i.result.length?this._nearest(t,i.result):t}_annoList(t){const e=this.w.config.annotations;if(!e)return[];const s="point"===t?"points":t;return Array.isArray(e[s])?e[s]:[]}_isDraggable(t){return!!t&&(!0===t.draggable||!1!==t.draggable&&this._enabledGlobally())}_hasDraggable(){return ki.some(t=>this._annoList(t).some(t=>this._isDraggable(t)))}_wire(){this._wired||(this._wired=!0,this.ctx.addEventListener("mounted",this._onRerender),this.ctx.addEventListener("updated",this._onRerender))}_onRerender(){this._closeEditor(!1),this._attach()}_attach(){const t=this.w,e=t.dom.baseEl;e&&(ki.forEach(s=>{this._annoList(s).forEach((i,a)=>{this._isDraggable(i)&&(i.id||(i.id="apexcharts-ink-"+s+"-"+a+"-"+t.globals.chartID),e.querySelectorAll("."+i.id).forEach(t=>{t.__inkBound||(t.__inkBound=!0,t.style.cursor="move",t.classList.add("apexcharts-ink-draggable"),t.addEventListener("mousedown",t=>this._onDown(t,s,a)),t.addEventListener("touchstart",t=>this._onDown(t,s,a)),t.addEventListener("dblclick",t=>{t.preventDefault(),t.stopPropagation(),this._startEdit(s,a,{select:!0})}))}))})}),this._paletteEnabled()&&this._renderPalette())}_onDown(t,e,s){if(t.button&&0!==t.button)return;const i=this.w,a=i.dom.baseEl&&i.dom.baseEl.ownerDocument;if(!a)return;t.stopPropagation(),t.cancelable&&t.preventDefault();const r="touchstart"===t.type?t.touches[0]:t,o=i.dom.Paper&&i.dom.Paper.node,n=o&&o.getScreenCTM?o.getScreenCTM():null,l=this._annoList(e)[s];let h="move",c=null,d=0,g=0;if("xaxis"===e&&null!=l.x2&&(c=i.dom.baseEl.querySelector(".apexcharts-annotation-rect."+l.id),c)){const t=c.getBoundingClientRect();Math.abs(r.clientX-t.left)<=8?h="resize-x1":Math.abs(r.clientX-t.right)<=8&&(h="resize-x2"),d=parseFloat(c.getAttribute("x"))||0,g=parseFloat(c.getAttribute("width"))||0}this._drag={type:e,index:s,anno:l,els:Array.from(i.dom.baseEl.querySelectorAll("."+l.id)),mode:h,rect:c,origX:d,origW:g,startX:r.clientX,startY:r.clientY,scaleX:n&&n.a?n.a:1,scaleY:n&&n.d?n.d:1,dxPixel:0,dyPixel:0,moved:!1},a.addEventListener("mousemove",this._onMove),a.addEventListener("touchmove",this._onMove,{passive:!1}),a.addEventListener("mouseup",this._onUp),a.addEventListener("touchend",this._onUp)}_onMove(t){const e=this._drag;if(!e)return;t.cancelable&&t.preventDefault();const s="touchmove"===t.type?t.touches[0]:t;if(e.dxPixel=(s.clientX-e.startX)/e.scaleX,e.dyPixel=(s.clientY-e.startY)/e.scaleY,(Math.abs(e.dxPixel)>2||Math.abs(e.dyPixel)>2)&&(e.moved=!0),"move"===e.mode){const t=`translate(${e.dxPixel} ${e.dyPixel})`;e.els.forEach(e=>e.setAttribute("transform",t))}else e.rect&&("resize-x1"===e.mode?(e.rect.setAttribute("x",e.origX+e.dxPixel),e.rect.setAttribute("width",Math.max(1,e.origW-e.dxPixel))):"resize-x2"===e.mode&&e.rect.setAttribute("width",Math.max(1,e.origW+e.dxPixel)))}_onUp(){const t=this._drag;if(this._drag=null,this._teardownDocListeners(),!t||!t.moved)return void(t&&(t.els.forEach(t=>t.removeAttribute("transform")),this._startEdit(t.type,t.index)));const e=this._annoList(t.type)[t.index];e&&(this._applyDelta(t,e),t.els.forEach(t=>t.removeAttribute("transform")),this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:drag"),this._fireDragged(t.type,e,t.index))}_checkpoint(t){var e,s;null==(s=null==(e=this.ctx.history)?void 0:e.snapshot)||s.call(e,t)}_applyDelta(t,e){const s=this.w,i=s.layout.gridWidth?t.dxPixel*(s.globals.xRange/s.layout.gridWidth):0;if("point"===t.type){const{newX:i,newY:a}=this._invertPoint(e,t.dxPixel,t.dyPixel);if(e.x=this._snapX(i),null!=a){const t=e.yAxisIndex||0,i=s.globals.seriesYAxisMap;e.y=this._snapY(a,i&&i[t]?i[t][0]:0)}return}if("xaxis"!==t.type){if("yaxis"===t.type){const i=e.yAxisIndex||0,a=s.globals.seriesYAxisMap,r=a&&a[i]?a[i][0]:0,o=s.globals.yRange?s.globals.yRange[r]:null;if(null==o||!s.layout.gridHeight)return;const n=-t.dyPixel*(o/s.layout.gridHeight);"number"==typeof e.y2?("number"==typeof e.y&&(e.y+=n),e.y2+=n):"number"==typeof e.y&&(e.y=this._snapY(e.y+n,r))}}else{if("number"!=typeof e.x)return;if("move"===t.mode)"number"==typeof e.x2?(e.x+=i,e.x2+=i):e.x=this._snapX(e.x+i);else if("resize-x1"===t.mode||"resize-x2"===t.mode){const s=null==e.x2||e.x<=e.x2;("resize-x2"===t.mode?!s:s)?e.x=this._snapX(e.x+i):"number"==typeof e.x2&&(e.x2=this._snapX(e.x2+i))}}}_invertPoint(t,e,s){const i=this.w,a=("category"===i.config.xaxis.type||i.config.xaxis.convertedCatToNumeric)&&!i.axisFlags.dataFormatXNumeric;let r=t.x;!a&&"number"==typeof t.x&&i.layout.gridWidth&&(r=t.x+e*(i.globals.xRange/i.layout.gridWidth));let o=t.y;const n=t.yAxisIndex||0,l=i.globals.seriesYAxisMap,h=l&&l[n]?l[n][0]:0,c=i.globals.yRange?i.globals.yRange[h]:null,d=i.config.yaxis[n]&&i.config.yaxis[n].logarithmic;return"number"==typeof t.y&&null!=c&&!d&&i.layout.gridHeight&&(o=t.y-s*(c/i.layout.gridHeight)),{newX:r,newY:o}}_redrawAnno(t,e,s){const i=this.w.dom.baseEl,a=this.ctx.annotations;if(!i||!a)return;i.querySelectorAll("."+e.id).forEach(t=>t.remove());const r=i.querySelector(".apexcharts-"+t+"-annotations");if(!r)return;"point"===t&&a.pointsAnnotations?a.pointsAnnotations.addPointAnnotation(e,r,s):"xaxis"===t&&a.xAxisAnnotations?a.xAxisAnnotations.addXaxisAnnotation(e,r,s):"yaxis"===t&&a.yAxisAnnotations&&a.yAxisAnnotations.addYaxisAnnotation(e,r,s);const o=i.querySelector(".apexcharts-"+t+"-annotation-label."+e.id);if(o&&a.helpers&&e.label&&e.label.text){const t=a.helpers.addBackgroundToAnno(o,e);t&&o.parentNode&&o.parentNode.insertBefore(t.node,o)}this._attach()}_fireDragged(t,e,s){var i;const a={type:t,id:e.id,index:s,x:e.x,y:e.y};null!=e.x2&&(a.x2=e.x2),null!=e.y2&&(a.y2=e.y2);const r=this.w.config.chart.events;"function"==typeof r.annotationDragged&&r.annotationDragged(this.ctx,a),null==(i=this.ctx.events)||i.fireEvent("annotationDragged",[this.ctx,a])}startCreate(){if(this._creating)return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(this._creating=!0,t.style.cursor="crosshair",t.addEventListener("click",this._onCreateClick,!0),this._syncPalette())}stopCreate(){if(!this._creating)return;this._creating=!1;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.style.cursor="",t.removeEventListener("click",this._onCreateClick,!0)),this._syncPalette()}_onCreateClick(t){if(!this._creating)return;t.preventDefault(),t.stopPropagation();const e=this._pixelToData(t.clientX,t.clientY);this.stopCreate(),e&&this.createAt(e.x,e.y)}createAt(t,e,s={}){const i=this.w;this._wire(),this._createSeq+=1;const a="apexcharts-ink-new-"+this._createSeq+"-"+i.globals.chartID,r=b.extend((new k).pointAnnotation,{x:t,y:e,id:a,draggable:!0,label:{text:s.text||"Note"}});i.config.annotations||(i.config.annotations={}),Array.isArray(i.config.annotations.points)||(i.config.annotations.points=[]),i.config.annotations.points.push(r);const o=i.config.annotations.points.length-1;return this._redrawAnno("point",r,o),this._checkpoint("ink:create"),this._fireCreated("point",r,o),this._startEdit("point",o,{select:!0}),r}createLineAt(t,e,s={}){const i=this.w;this._wire(),this._createSeq+=1;const a="apexcharts-ink-new-"+this._createSeq+"-"+i.globals.chartID,r="y"===t?"yaxis":"xaxis",o="yaxis"===r?(new k).yAxisAnnotation:(new k).xAxisAnnotation,n={id:a,draggable:!0,strokeDashArray:null!=s.strokeDashArray?s.strokeDashArray:4,label:{text:s.text||""}};s.color&&(n.borderColor=s.color,n.label.borderColor=s.color),"yaxis"===r?n.y=e:n.x=e;const l=b.extend(o,n);i.config.annotations||(i.config.annotations={}),Array.isArray(i.config.annotations[r])||(i.config.annotations[r]=[]),i.config.annotations[r].push(l);const h=i.config.annotations[r].length-1;return this._redrawAnno(r,l,h),this._checkpoint("ink:create"),this._fireCreated(r,l,h),!1!==s.select&&this._startEdit(r,h,{select:!0}),l}_pixelToData(t,e){const s=this.w,i=s.dom.baseEl&&s.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const a=i.getBoundingClientRect();if(!a.width||!a.height)return null;const r=(t-a.left)/a.width,o=(e-a.top)/a.height;let n=s.globals.minX+r*s.globals.xRange;const l=(s.globals.minYArr&&null!=s.globals.minYArr[0]?s.globals.minYArr[0]:s.globals.minY)+(1-o)*(s.globals.yRange&&null!=s.globals.yRange[0]?s.globals.yRange[0]:s.globals.maxY-s.globals.minY);return("category"===s.config.xaxis.type||s.config.xaxis.convertedCatToNumeric)&&!s.axisFlags.dataFormatXNumeric&&(n=Math.round(n)),{x:n,y:l}}_fireCreated(t,e,s){var i;const a={type:t,id:e.id,index:s};void 0!==e.x&&(a.x=e.x),void 0!==e.y&&(a.y=e.y);const r=this.w.config.chart.events;"function"==typeof r.annotationCreated&&r.annotationCreated(this.ctx,a),null==(i=this.ctx.events)||i.fireEvent("annotationCreated",[this.ctx,a])}_renderPalette(){const t=this.w.dom.elWrap;if(!t||t.querySelector(".apexcharts-ink-palette"))return;const e=t.ownerDocument,s=e.createElement("div");s.className="apexcharts-ink-palette";const i=s.style;i.position="absolute",i.top="6px",i.left="6px",i.zIndex="15";const a=e.createElement("button");a.type="button",a.className="apexcharts-ink-add",a.textContent="+ Note";const r=a.style;r.cursor="pointer",r.font="12px sans-serif",r.padding="4px 9px",r.borderRadius="5px",r.border="1px solid #6366f1",r.color="#4338ca",r.background="#fff",a.addEventListener("click",t=>{t.stopPropagation(),this._creating?this.stopCreate():this.startCreate()}),s.appendChild(a),t.appendChild(s),this._syncPalette()}_syncPalette(){const t=this.w.dom.elWrap,e=t&&t.querySelector(".apexcharts-ink-add");e&&(this._creating?(e.style.background="#6366f1",e.style.color="#fff",e.textContent="Click chart..."):(e.style.background="#fff",e.style.color="#4338ca",e.textContent="+ Note"))}_noteColors(){const t=this.w.config.chart.ink;return t&&Array.isArray(t.noteColors)&&t.noteColors.length?t.noteColors:Di}static _isLight(t){const e=String(t||"").replace("#",""),s=3===e.length?e.split("").map(t=>t+t).join(""):e,i=parseInt(s,16);if(isNaN(i)||6!==s.length)return!1;return(.299*(i>>16&255)+.587*(i>>8&255)+.114*(255&i))/255>.72}static _isBold(t){const e=t&&t.fontWeight;return"bold"===e||parseInt(String(e),10)>=600}_cardBtn(t,e,s,i,a,r){const o=t.createElement("button");return o.type="button",o.className="apexcharts-ink-btn"+(a?" "+a:""),o.title=s,o.setAttribute("aria-label",s),r?o.innerHTML=e:o.textContent=e,o.addEventListener("mousedown",t=>t.preventDefault()),o.addEventListener("click",t=>{t.stopPropagation(),i()}),o}_cardLabel(t,e){const s=t.createElement("span");return s.className="apexcharts-ink-cardlabel",s.textContent=e,s}_mkSwatch(t,e,s,i){const a=t.createElement("button");return a.type="button",a.className="apexcharts-ink-swatch"+(i?" "+i:""),a.title=e,a.setAttribute("aria-label","Color "+e),a.dataset.color=e,a.style.background=e,a.addEventListener("mousedown",t=>t.preventDefault()),a.addEventListener("click",t=>{t.stopPropagation(),s(e)}),a}_startEdit(t,e,s={}){const i=this.w,a=this._annoList(t)[e],r=i.dom.baseEl,o=i.dom.elWrap;if(!(a&&a.id&&r&&o))return;this._closeEditor(!1);const n=r.ownerDocument,l=n.createElement("div");l.className="apexcharts-ink-card",l.setAttribute("role","dialog"),l.setAttribute("aria-label","Edit note"),l.style.visibility="hidden";const h=n.createElement("div");h.className="apexcharts-ink-card-row";const c=n.createElement("input");c.type="text",c.className="apexcharts-ink-editor",c.placeholder="Note text",c.value=a.label&&a.label.text||"",h.appendChild(c),h.appendChild(this._cardBtn(n,'<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/></svg>',"Delete note",()=>this._deleteAnno(),"apexcharts-ink-btn--delete",!0)),l.appendChild(h);const d=n.createElement("div");d.className="apexcharts-ink-card-row","point"!==t&&d.appendChild(this._cardLabel(n,"Label")),this._noteColors().forEach(t=>{d.appendChild(this._mkSwatch(n,t,t=>this._applyColor(t)))});const g=n.createElement("span");if(g.className="apexcharts-ink-sep",d.appendChild(g),d.appendChild(this._cardBtn(n,"B","Bold",()=>this._toggleBold(),"apexcharts-ink-btn--bold")),d.appendChild(this._cardBtn(n,"A-","Smaller text",()=>this._stepFont(-1))),d.appendChild(this._cardBtn(n,"A+","Larger text",()=>this._stepFont(1))),l.appendChild(d),"point"!==t){const t=n.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(n,"Line")),this._noteColors().forEach(e=>{t.appendChild(this._mkSwatch(n,e,t=>this._applyLineColor(t),"apexcharts-ink-swatch--line"))}),l.appendChild(t)}if("point"===t){const t=n.createElement("div");t.className="apexcharts-ink-card-row",t.appendChild(this._cardLabel(n,"Marker")),t.appendChild(this._cardBtn(n,"-","Smaller marker",()=>this._stepMarker(-1)));const e=n.createElement("span");e.className="apexcharts-ink-marker-size",t.appendChild(e),t.appendChild(this._cardBtn(n,"+","Larger marker",()=>this._stepMarker(1))),t.appendChild(this._cardBtn(n,Mi.circle,"Marker shape",()=>this._cycleShape(),"apexcharts-ink-btn--shape")),l.appendChild(t)}o.appendChild(l),this._editor={card:l,input:c,type:t,index:e},this._positionCard(),this._syncCard(),l.style.visibility="",c.focus(),s.select&&c.select(),l.addEventListener("keydown",t=>{"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this._closeEditor(!1)):"Enter"===t.key&&t.target===c&&(t.preventDefault(),this._closeEditor(!0))}),n.addEventListener("mousedown",this._onDocDownEditor,!0),n.addEventListener("touchstart",this._onDocDownEditor,!0)}_onDocDownEditor(t){const e=this._editor;e&&!e.card.contains(t.target)&&this._closeEditor(!0)}_positionCard(){const t=this._editor;if(!t)return;const e=this.w,s=e.dom.baseEl,i=e.dom.elWrap,a=this._annoList(t.type)[t.index];if(!s||!i||!a)return;const r=s.querySelector(".apexcharts-"+t.type+"-annotation-label."+a.id)||s.querySelector("."+a.id);if(!r)return;const o=i.getBoundingClientRect(),n=r.getBoundingClientRect(),l=t.card.offsetWidth,h=t.card.offsetHeight;let c=Math.round(n.left-o.left),d=Math.round(n.bottom-o.top)+8;d+h>i.clientHeight-4&&(d=Math.round(n.top-o.top)-h-8),c+l>i.clientWidth-4&&(c=i.clientWidth-l-4),t.card.style.left=Math.max(4,c)+"px",t.card.style.top=Math.max(4,d)+"px"}_syncCard(){const t=this._editor;if(!t)return;const e=this._annoList(t.type)[t.index];if(!e)return;const s=e.label&&e.label.style||{},i=String(s.background||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch:not(.apexcharts-ink-swatch--line)").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===i)});const a=String(e.borderColor||"").toLowerCase();t.card.querySelectorAll(".apexcharts-ink-swatch--line").forEach(t=>{t.classList.toggle("apexcharts-ink-swatch--active",(t.dataset.color||"").toLowerCase()===a)});const r=t.card.querySelector(".apexcharts-ink-btn--bold");r&&r.classList.toggle("apexcharts-ink-btn--active",Ei._isBold(s));const o=e.marker||{},n=t.card.querySelector(".apexcharts-ink-marker-size");n&&(n.textContent=String("number"==typeof o.size?o.size:4));const l=t.card.querySelector(".apexcharts-ink-btn--shape");l&&(l.textContent=Mi[o.shape]||Mi.circle)}_commitTextOf(t){const e=this._annoList(t.type)[t.index];if(!e)return;const s=t.input.value;e.label||(e.label={}),e.label.text!==s&&(e.label.text=s,this._redrawAnno(t.type,e,t.index),this._checkpoint("ink:edit"),this._fireEdited(t.type,e,t.index))}_closeEditor(t){const e=this._editor;if(!e)return;this._editor=null;const s=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;s&&(s.removeEventListener("mousedown",this._onDocDownEditor,!0),s.removeEventListener("touchstart",this._onDocDownEditor,!0)),e.card.parentNode&&e.card.parentNode.removeChild(e.card),t&&this._commitTextOf(e)}_applyStyle(t,e){const s=this._editor;if(!s)return;const i=this._annoList(s.type)[s.index];i&&(this._commitTextOf(s),i.label||(i.label={}),i.label.style||(i.label.style={}),e(i),this._redrawAnno(s.type,i,s.index),this._checkpoint(t),this._fireStyled(s.type,i,s.index),this._syncCard(),this._positionCard())}_applyColor(t){const e=this._editor;if(!e)return;const s=Ei._isLight(t);this._applyStyle("ink:style",i=>{i.label.style.background=t,i.label.style.color=s?"#334155":"#ffffff",i.label.borderColor=s?"#cbd5e1":t,"point"===e.type&&(i.marker||(i.marker={}),i.marker.strokeColor=s?"#334155":t,i.marker.fillColor=s?"#ffffff":t)})}_applyLineColor(t){const e=this._editor;e&&"point"!==e.type&&this._applyStyle("ink:style",e=>{e.borderColor=t,null==e.x2&&null==e.y2||(e.fillColor=t)})}_stepFont(t){this._applyStyle("ink:style",e=>{const s=parseFloat(e.label.style.fontSize)||11;let i=0;for(let t=1;t<_i.length;t++)Math.abs(_i[t]-s)<Math.abs(_i[i]-s)&&(i=t);i=Math.min(_i.length-1,Math.max(0,i+t)),e.label.style.fontSize=_i[i]+"px"})}_toggleBold(){this._applyStyle("ink:style",t=>{t.label.style.fontWeight=Ei._isBold(t.label.style)?400:700})}_stepMarker(t){this._applyStyle("ink:style",e=>{e.marker||(e.marker={});const s="number"==typeof e.marker.size?e.marker.size:4;e.marker.size=Math.min(14,Math.max(2,s+t))})}_cycleShape(){this._applyStyle("ink:style",t=>{t.marker||(t.marker={});const e=Li.indexOf(t.marker.shape);t.marker.shape=Li[(e+1)%Li.length]})}_deleteAnno(){const t=this._editor;if(!t)return;const e=this._annoList(t.type),s=e[t.index];if(this._closeEditor(!1),!s)return;const i=this.w.dom.baseEl;i&&s.id&&i.querySelectorAll("."+s.id).forEach(t=>t.remove()),e.splice(t.index,1);for(let s=t.index;s<e.length;s++)this._redrawAnno(t.type,e[s],s);this._checkpoint("ink:delete"),this._fireDeleted(t.type,s,t.index)}_fireEdited(t,e,s){var i;const a={type:t,id:e.id,index:s,text:e.label?e.label.text:""},r=this.w.config.chart.events;"function"==typeof r.annotationEdited&&r.annotationEdited(this.ctx,a),null==(i=this.ctx.events)||i.fireEvent("annotationEdited",[this.ctx,a])}_fireStyled(t,e,s){var i;const a={type:t,id:e.id,index:s,label:e.label,marker:e.marker},r=this.w.config.chart.events;"function"==typeof r.annotationStyled&&r.annotationStyled(this.ctx,a),null==(i=this.ctx.events)||i.fireEvent("annotationStyled",[this.ctx,a])}_fireDeleted(t,e,s){var i;const a={type:t,id:e.id,index:s},r=this.w.config.chart.events;"function"==typeof r.annotationDeleted&&r.annotationDeleted(this.ctx,a),null==(i=this.ctx.events)||i.fireEvent("annotationDeleted",[this.ctx,a])}_teardownDocListeners(){const t=this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument;t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchend",this._onUp))}teardown(){var t,e,s,i;this._teardownDocListeners(),this._closeEditor(!1),this.stopCreate(),this._drag=null,this._wired&&(null==(e=(t=this.ctx).removeEventListener)||e.call(t,"mounted",this._onRerender),null==(i=(s=this.ctx).removeEventListener)||i.call(s,"updated",this._onRerender),this._wired=!1)}}Cs.registerFeatures({ink:Ei});Cs.registerFeatures({measure:class{constructor(t,e){this.w=t,this.ctx=e,this.graphics=new gt(t),this.pins=[],this.drag=null,this.armed=!1,this.persistent=!1,this.pane=null,this._seedActive=!1,this._onKeyDown=this._onKeyDown.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onDown=this._onDown.bind(this),this._onMove=this._onMove.bind(this),this._onUp=this._onUp.bind(this),this._onSeedDown=this._onSeedDown.bind(this),this._onSeedKey=this._onSeedKey.bind(this),this._afterRender=this._afterRender.bind(this),e.addEventListener("mounted",this._afterRender),e.addEventListener("updated",this._afterRender),this._bindKeys()}_cfg(){return this.w.config.chart.measure||{}}_enabled(){return this.w.globals.axisCharts&&!0===this._cfg().enabled}_mode(){return"free"===this._cfg().mode?"free":"span"}_snapToSeries(t){const e=(this.w.config.series||[])[0];if(!e)return null;const s=this._points(e.data||[]);if(!s.length)return null;let i=s[0],a=Math.abs(s[0].x-t);for(let e=1;e<s.length;e++){const r=Math.abs(s[e].x-t);r<a&&(a=r,i=s[e])}return i}_resolve(t){if("free"===this._mode())return t;const e=this._snapToSeries(t.x);if(!e)return t;const s=this._dataToGrid(e.x,e.y);return{x:e.x,y:e.y,gx:s.gx,gy:s.gy}}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_bindKeys(){if(this._keysBound)return;const t=this._doc();t&&(t.addEventListener("keydown",this._onKeyDown),t.addEventListener("keyup",this._onKeyUp),this._keysBound=!0)}_onKeyDown(t){if(!this._enabled()||this.persistent)return;const e=this._cfg().key||"m";t.key&&t.key.toLowerCase()===String(e).toLowerCase()?this._arm():"Escape"===t.key&&this._cancelDrag()}_onKeyUp(t){if(this.persistent)return;const e=this._cfg().key||"m";t.key&&t.key.toLowerCase()===String(e).toLowerCase()&&(this.drag||this._disarm())}startMeasure(){this._enabled()&&(this.persistent=!0,this._arm())}stopMeasure(){this.persistent=!1,this._cancelDrag(),this._disarm()}seedFromClient(t,e){if(!this._enabled())return;this._cancelDrag(),this._endSeed(!1);const s=this._project(t,e);this.drag={a:s,b:s},this._seedActive=!0;const i=this._doc();i&&(i.addEventListener("mousemove",this._onMove),i.addEventListener("touchmove",this._onMove,{passive:!1}),i.addEventListener("mousedown",this._onSeedDown,!0),i.addEventListener("touchstart",this._onSeedDown,!0),i.addEventListener("keydown",this._onSeedKey,!0)),this._renderLive()}_onSeedDown(t){if(!this._seedActive||!this.drag)return;t.preventDefault(),t.stopPropagation();const{cx:e,cy:s}=this._clientXY(t);this.drag.b=this._project(e,s),this._endSeed(!0)}_onSeedKey(t){"Escape"===t.key&&this._endSeed(!1)}_endSeed(t){var e,s;if(!this._seedActive)return;this._seedActive=!1;const i=this._doc();i&&(i.removeEventListener("mousemove",this._onMove),i.removeEventListener("touchmove",this._onMove),i.removeEventListener("mousedown",this._onSeedDown,!0),i.removeEventListener("touchstart",this._onSeedDown,!0),i.removeEventListener("keydown",this._onSeedKey,!0));const a=this.drag;if(this.drag=null,this._clearLive(),!t||!a)return;const r=this._resolve(a.a),o=this._resolve(a.b);if(Math.abs(r.gx-o.gx)<2&&Math.abs(r.gy-o.gy)<2)return;const n=this._mode();!1!==this._cfg().pinOnRelease&&(this.pins.push({xa:r.x,ya:r.y,xb:o.x,yb:o.y,mode:n}),this._renderPins(),null==(s=null==(e=this.ctx.history)?void 0:e.snapshot)||s.call(e,"measure")),this._fireMeasured(r,o)}clearMeasures(){var t,e;this.pins=[],this._renderPins(),null==(e=null==(t=this.ctx.history)?void 0:t.snapshot)||e.call(t,"clear measures")}getPins(){return this.pins.map(t=>({xa:t.xa,ya:t.ya,xb:t.xb,yb:t.yb,mode:"free"===t.mode?"free":"span"}))}setPins(t){this.pins=Array.isArray(t)?t.filter(t=>t&&isFinite(t.xa)&&isFinite(t.ya)&&isFinite(t.xb)&&isFinite(t.yb)).map(t=>({xa:+t.xa,ya:+t.ya,xb:+t.xb,yb:+t.yb,mode:"free"===t.mode?"free":"span"})):[],this._renderPins()}_points(t){const e=[];for(let s=0;s<t.length;s++){const i=t[s];let a,r;Array.isArray(i)?(a=+i[0],r=+i[1]):i&&"object"==typeof i?(a=+i.x,r=+i.y):(a=s,r=+i),isFinite(a)&&isFinite(r)&&e.push({x:a,y:r})}return e}_arm(){if(this.armed||!this._enabled())return;const t=this.w,e=t.dom.elGraphical;if(!e)return;this.armed=!0;const s=this.graphics.drawRect(0,0,t.layout.gridWidth,t.layout.gridHeight);s.node.setAttribute("class","apexcharts-measure-capture"),s.node.setAttribute("fill","transparent"),s.node.style.cursor="crosshair",s.node.style.pointerEvents="all",s.node.addEventListener("mousedown",this._onDown),s.node.addEventListener("touchstart",this._onDown,{passive:!1}),e.add(s),this.pane=s}_disarm(){if(this.armed=!1,this.pane){this.pane.node.removeEventListener("mousedown",this._onDown),this.pane.node.removeEventListener("touchstart",this._onDown);const t=this.pane.node;t.parentNode&&t.parentNode.removeChild(t),this.pane=null}}_clientXY(t){const e=t.touches&&t.touches[0]?t.touches[0]:t;return{cx:e.clientX,cy:e.clientY}}_gridRect(){const t=this.w.dom.baseEl.querySelector(".apexcharts-grid");return t?t.getBoundingClientRect():null}_yRange(){const t=this.w.globals,e=t.yAxisScale&&t.yAxisScale[0];return e&&isFinite(e.niceMin)&&isFinite(e.niceMax)&&e.niceMax!==e.niceMin?[e.niceMin,e.niceMax]:[t.minY,t.maxY]}_project(t,e){const s=this.w,i=this._gridRect(),a=s.layout.gridWidth,r=s.layout.gridHeight,o=t=>t<0?0:t>1?1:t,n=i?o((t-i.left)/i.width):0,l=i?o((e-i.top)/i.height):0,[h,c]=this._yRange();return{x:s.globals.minX+n*(s.globals.maxX-s.globals.minX),y:c-l*(c-h),gx:n*a,gy:l*r}}_dataToGrid(t,e){const s=this.w,i=s.layout.gridWidth,a=s.layout.gridHeight,r=s.globals.maxX-s.globals.minX||1,[o,n]=this._yRange(),l=n-o||1;return{gx:(t-s.globals.minX)/r*i,gy:a-(e-o)/l*a}}_onDown(t){if(!this.armed)return;t.preventDefault(),t.stopPropagation();const{cx:e,cy:s}=this._clientXY(t),i=this._project(e,s);this.drag={a:i,b:i};const a=this._doc();a&&(a.addEventListener("mousemove",this._onMove),a.addEventListener("mouseup",this._onUp),a.addEventListener("touchmove",this._onMove,{passive:!1}),a.addEventListener("touchend",this._onUp)),this._renderLive()}_onMove(t){if(!this.drag)return;t.cancelable&&t.preventDefault();const{cx:e,cy:s}=this._clientXY(t);this.drag.b=this._project(e,s),this._renderLive()}_onUp(t){var e,s;const i=this._doc();if(i&&(i.removeEventListener("mousemove",this._onMove),i.removeEventListener("mouseup",this._onUp),i.removeEventListener("touchmove",this._onMove),i.removeEventListener("touchend",this._onUp)),!this.drag)return;const a=this.drag.a,r=this.drag.b;if(this.drag=null,this._clearLive(),Math.abs(a.gx-r.gx)<2&&Math.abs(a.gy-r.gy)<2)return void(this.persistent||this._disarm());const o=this._mode(),n=this._resolve(a),l=this._resolve(r);!1!==this._cfg().pinOnRelease&&(this.pins.push({xa:n.x,ya:n.y,xb:l.x,yb:l.y,mode:o}),this._renderPins(),null==(s=null==(e=this.ctx.history)?void 0:e.snapshot)||s.call(e,"measure")),this._fireMeasured(n,l),this.persistent||this._disarm()}_cancelDrag(){const t=this._doc();t&&(t.removeEventListener("mousemove",this._onMove),t.removeEventListener("mouseup",this._onUp),t.removeEventListener("touchmove",this._onMove),t.removeEventListener("touchend",this._onUp)),this.drag=null,this._clearLive()}_stats(t,e){const s=e.x-t.x,i=e.y-t.y;return{dx:s,dy:i,pct:0!==t.y?i/Math.abs(t.y)*100:NaN,slope:0!==s?i/s:NaN}}_fmt(t){if(!isFinite(t))return"n/a";const e=Math.abs(t);return 0!==e&&(e<.01||e>=1e6)?t.toExponential(2):String(Math.round(100*t)/100)}_computedStyle(){if(!c.isBrowser())return null;const t=this.w.dom.elGraphical&&this.w.dom.elGraphical.node;if(!t||"function"!=typeof getComputedStyle)return null;try{return getComputedStyle(t)}catch(t){return null}}_resolveColor(t,e,s,i){if(t)return t;const a=void 0!==i?i:this._computedStyle();return(a?a.getPropertyValue(e).trim():"")||s}_colors(){const t=this._cfg().colors||{},e=this._computedStyle();return{up:this._resolveColor(t.up,"--apx-measure-up","#16a34a",e),down:this._resolveColor(t.down,"--apx-measure-down","#dc2626",e),neutral:this._resolveColor(t.neutral,"--apx-measure-neutral","#64748b",e),guide:this._resolveColor(t.guide,"--apx-measure-guide","#94a3b8",e)}}_dirColor(t){const e=this._colors();return 0===t?e.neutral:t>0?e.up:e.down}_dirClass(t){return 0===t?"apexcharts-measure-flat":t>0?"apexcharts-measure-up":"apexcharts-measure-down"}_fmtPct(t){if(!isFinite(t))return"n/a";const e=this._cfg().format&&this._cfg().format.percent;if("function"==typeof e)try{const s=e(t);if(null!=s)return String(s)}catch(t){}return(t>=0?"+":"")+this._fmt(t)+"%"}_label(t,e,s,i){const a=this._cfg().label;if("function"==typeof a){const r=a({from:{x:t.x,y:t.y},to:{x:e.x,y:e.y},dx:s.dx,dy:s.dy,percentChange:s.pct,slope:s.slope,mode:i});return Array.isArray(r)?r.map(String):[String(r)]}if("span"===i){const i=0===s.dy?"":s.dy>0?" \u2191":" \u2193",a=isFinite(s.pct)?"("+this._fmtPct(s.pct)+")":"";return[this._fmtY(s.dy)+" "+a+i,this._fmtX(t.x)+" to "+this._fmtX(e.x)]}return["\u0394x "+this._fmtDx(s.dx),"\u0394y "+this._fmtY(s.dy),this._fmtPct(s.pct)]}_fmtDx(t){if("datetime"===this.w.config.xaxis.type){const e=t/864e5;return Math.round(10*e)/10+"d"}return this._fmt(t)}_fmtY(t){const e=this._cfg().format&&this._cfg().format.y;if("function"==typeof e)try{const s=e(t);if(null!=s)return String(s)}catch(t){}const s=this.w.globals.yLabelFormatters&&this.w.globals.yLabelFormatters[0];if("function"==typeof s)try{const e=s(t,{seriesIndex:0,dataPointIndex:-1,w:this.w});if(null!=e&&""!==e)return String(e)}catch(t){}return this._fmt(t)}_fmtX(t){const e=this.w,s=this._cfg().format&&this._cfg().format.x;if("function"==typeof s)try{const e=s(t);if(null!=e)return String(e)}catch(t){}if("datetime"===e.config.xaxis.type){return new Date(t).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}const i=e.globals.xLabelFormatter;if("function"==typeof i)try{const s=i(t,{w:e});if(null!=s&&""!==s)return String(s)}catch(t){}return this._fmt(t)}_liveGroup(){const t=this.w;if(this._live&&this._live.node&&this._live.node.parentNode)return this._live;const e=this.graphics.group({class:"apexcharts-measure-live"});return e.node.style.pointerEvents="none",t.dom.elGraphical&&t.dom.elGraphical.add(e),this._live=e,e}_clearLive(){if(this._live&&this._live.node){const t=this._live.node;t.parentNode&&t.parentNode.removeChild(t)}this._live=null}_renderLive(){if(!this.drag)return;const t=this._liveGroup();for(;t.node.firstChild;)t.node.removeChild(t.node.firstChild);const e=this._resolve(this.drag.a),s=this._resolve(this.drag.b);this._drawRuler(t,e,s,!1,this._mode())}_renderPins(){const t=this.w,e=t.dom.baseEl&&t.dom.baseEl.querySelector(".apexcharts-measure-pins");if(e&&e.parentNode&&e.parentNode.removeChild(e),!this.pins.length||!t.dom.elGraphical)return;const s=this.graphics.group({class:"apexcharts-measure-pins"});s.node.style.pointerEvents="none",t.dom.elGraphical.add(s),this.pins.forEach(t=>{const e=l(n({},this._dataToGrid(t.xa,t.ya)),{x:t.xa,y:t.ya}),i=l(n({},this._dataToGrid(t.xb,t.yb)),{x:t.xb,y:t.yb});this._drawRuler(s,e,i,!0,t.mode||"span")})}_drawRuler(t,e,s,i,a){const r=this._stats(e,s),o=this.graphics.group({class:"apexcharts-measure-ruler "+this._dirClass(r.dy)+(i?" apexcharts-measure-pinned":"")});"free"===(a||this._mode())?this._drawFree(o,e,s,r):this._drawSpan(o,e,s,r),t.add(o)}_dot(t,e,s){if(!1===this._cfg().markers)return;const i=this.graphics.drawMarker(e.gx,e.gy,{pSize:4,shape:"circle",pointFillColor:s,pointFillOpacity:1,pointStrokeColor:"#fff",pointStrokeWidth:2,pointStrokeOpacity:1});t.add(i)}_readout(t,e,s,i,a,r,o){const n=this.graphics.drawRect(s,i,a,r,4);n.node.setAttribute("class","apexcharts-measure-label-bg"),n.attr({fill:"#ffffff","fill-opacity":.95,stroke:o,"stroke-width":1}),t.add(n);const l=this.graphics.drawText({x:s+9,y:i+15,text:e,textAnchor:"start",fontSize:"11px",foreColor:"#1e293b",cssClass:"apexcharts-measure-label"});t.add(l)}_drawSpan(t,e,s,i){const a=this.w,r=this._cfg(),o=a.layout.gridHeight,n=this._dirColor(i.dy),l=Math.min(e.gx,s.gx),h=Math.max(e.gx,s.gx);if(!1!==r.band){const e=this.graphics.drawRect(l,0,Math.max(0,h-l),o,0);e.node.setAttribute("class","apexcharts-measure-band"),e.attr({fill:n,"fill-opacity":.09,stroke:"none"}),t.add(e)}!1!==r.guides&&[e,s].forEach(e=>{const s=this.graphics.drawLine(e.gx,0,e.gx,o,this._colors().guide,4,1);s.node.setAttribute("class","apexcharts-measure-vline"),t.add(s)}),[e,s].forEach(e=>this._dot(t,e,n));const c=this._label(e,s,i,"span"),d=c.reduce((t,e)=>Math.max(t,e.length),0),g=Math.max(148,6.4*d),p=20+15*c.length;let u=(l+h)/2-g/2;u=Math.max(2,Math.min(u,a.layout.gridWidth-g-2)),this._readout(t,c,u,4,g,p,n)}_drawFree(t,e,s,i){const a=this._dirColor(i.dy),r=this.graphics.drawLine(e.gx,e.gy,s.gx,s.gy,a,0,2);r.node.setAttribute("class","apexcharts-measure-line"),t.add(r),[e,s].forEach(e=>this._dot(t,e,a));const o=this._label(e,s,i,"free"),n=o.reduce((t,e)=>Math.max(t,e.length),0),l=Math.max(72,6.2*n),h=16+15*o.length;let c=(e.gx+s.gx)/2+8,d=(e.gy+s.gy)/2-h/2;c=Math.max(2,Math.min(c,this.w.layout.gridWidth-l-2)),d=Math.max(2,Math.min(d,this.w.layout.gridHeight-h-2)),this._readout(t,o,c,d,l,h,a)}_fireMeasured(t,e){const s=this._stats(t,e),i={from:{x:t.x,y:t.y},to:{x:e.x,y:e.y},dx:s.dx,dy:s.dy,percentChange:s.pct,slope:s.slope},a=this.w.config.chart.events.measured;"function"==typeof a&&a(this.ctx,i),this.ctx.events.fireEvent("measured",[this.ctx,i])}_afterRender(){this._enabled()&&(this.w.interact.measureEnabled&&!this.persistent&&(this.persistent=!0),this.pins.length&&this._renderPins(),this.persistent&&!this.drag&&(this._disarm(),this._arm()))}teardown(){this._cancelDrag(),this._endSeed(!1),this._disarm();const t=this._doc();t&&this._keysBound&&(t.removeEventListener("keydown",this._onKeyDown),t.removeEventListener("keyup",this._onKeyUp)),this._keysBound=!1,this.pins=[]}}});Cs.registerFeatures({contextMenu:class{constructor(t,e){this.w=t,this.ctx=e,this.menu=null,this._items=[],this._focusIndex=-1,this._trigger=null,this._onContext=this._onContext.bind(this),this._onDocDown=this._onDocDown.bind(this),this._onKey=this._onKey.bind(this),this._afterRender=this._afterRender.bind(this),e.addEventListener("mounted",this._afterRender),e.addEventListener("updated",this._afterRender)}_cfg(){return this.w.config.chart.contextMenu||{}}_enabled(){return!0===this._cfg().enabled}_doc(){return this.w.dom.baseEl&&this.w.dom.baseEl.ownerDocument}_afterRender(){if(this._detachTrigger(),this.close(),!this._enabled()||!c.isBrowser())return;const t=this.w.dom.Paper&&this.w.dom.Paper.node;t&&(t.addEventListener("contextmenu",this._onContext),this._trigger=t)}_detachTrigger(){this._trigger&&(this._trigger.removeEventListener("contextmenu",this._onContext),this._trigger=null)}_onContext(t){this._enabled()&&(t.preventDefault(),this.open(t.clientX,t.clientY))}_clientToData(t,e){const s=this.w,i=s.dom.baseEl&&s.dom.baseEl.querySelector(".apexcharts-grid");if(!i)return null;const a=i.getBoundingClientRect();if(!a.width||!a.height)return null;const r=t=>t<0?0:t>1?1:t,o=r((t-a.left)/a.width),n=r((e-a.top)/a.height),l=s.globals.minX+o*(s.globals.maxX-s.globals.minX),h=s.globals.yAxisScale&&s.globals.yAxisScale[0],c=h&&isFinite(h.niceMin)?h.niceMin:s.globals.minY,d=h&&isFinite(h.niceMax)?h.niceMax:s.globals.maxY;return{x:l,y:d-n*(d-c)}}_resolveItems(t){const e=this._cfg(),s=Array.isArray(e.items)&&e.items.length?e.items:["annotate","xline","yline","measure"],i=e.labels||{},a=[];return s.forEach(e=>{if("string"==typeof e){if("annotate"===e)a.push({id:"annotate",label:i.annotate||"Add note here",run:()=>this._annotate(t)});else if("xline"===e)a.push({id:"xline",label:i.xline||"Annotate here",run:()=>this._line(t,"x")});else if("yline"===e)a.push({id:"yline",label:i.yline||"Mark this level",run:()=>this._line(t,"y")});else if("measure"===e){const e=this.ctx.measure;e&&this.w.config.chart.measure&&this.w.config.chart.measure.enabled&&a.push({id:"measure",label:i.measure||"Measure from here",run:()=>e.seedFromClient(t.clientX,t.clientY)})}}else e&&"object"==typeof e&&"function"==typeof e.onClick&&a.push({id:e.id||"custom",label:e.label||"Action",run:()=>e.onClick(this.ctx,t)})}),a}_annotate(t){if(null==t.x||null==t.y)return;const e=this._cfg(),s=this.ctx.ink;s&&"function"==typeof s.createAt?s.createAt(t.x,t.y,{text:e.noteText||"Note"}):this.ctx.addPointAnnotation({x:t.x,y:t.y,marker:{size:5},label:{text:e.noteText||"Note",style:{background:"#fff",color:"#334155"}}},!0)}_line(t,e){const s=this._cfg().line||{},i="x"===e?t.x:t.y;if(null==i)return;const a=this.ctx.ink;if(a&&"function"==typeof a.createLineAt)return void a.createLineAt(e,i,{text:s.text,strokeDashArray:s.strokeDashArray,color:s.color});const r={strokeDashArray:null!=s.strokeDashArray?s.strokeDashArray:4};s.text&&(r.label={text:s.text}),s.color&&(r.borderColor=s.color,r.label=b.extend(r.label||{},{borderColor:s.color})),"x"===e?this.ctx.addXaxisAnnotation(b.extend(r,{x:i}),!0):this.ctx.addYaxisAnnotation(b.extend(r,{y:i}),!0)}open(t,e){this.close();const s=this.w,i=s.dom.elWrap,a=this._doc();if(!i||!a)return;const r=this._clientToData(t,e),o=s.globals,n={x:r?r.x:null,y:r?r.y:null,seriesIndex:o.capturedSeriesIndex>=0?o.capturedSeriesIndex:null,dataPointIndex:o.capturedDataPointIndex>=0?o.capturedDataPointIndex:null,clientX:t,clientY:e},l=this._resolveItems(n);if(!l.length)return;this._items=l;const h=a.createElement("div");h.className="apexcharts-context-menu",h.setAttribute("role","menu"),h.style.position="absolute",h.style.visibility="hidden",l.forEach((t,e)=>{const s=a.createElement("button");s.type="button",s.className="apexcharts-context-menu-item",s.setAttribute("role","menuitem"),s.tabIndex=-1,s.textContent=t.label,s.addEventListener("click",t=>{t.stopPropagation(),this._activate(e)}),s.addEventListener("mouseenter",()=>this._focus(e)),h.appendChild(s)}),i.appendChild(h),this.menu=h;const c=i.getBoundingClientRect();let d=t-c.left,g=e-c.top;const p=h.offsetWidth,u=h.offsetHeight,x=Math.max(0,i.clientWidth-p),f=Math.max(0,i.clientHeight-u);d>x&&(d=x),g>f&&(g=f),h.style.left=Math.max(0,d)+"px",h.style.top=Math.max(0,g)+"px",h.style.visibility="visible",a.addEventListener("mousedown",this._onDocDown,!0),a.addEventListener("keydown",this._onKey,!0),this._focus(0)}_focus(t){if(!this.menu)return;const e=this.menu.querySelectorAll(".apexcharts-context-menu-item");this._focusIndex>=0&&e[this._focusIndex]&&e[this._focusIndex].classList.remove("apexcharts-context-menu-item--active"),this._focusIndex=t,e[t]&&(e[t].classList.add("apexcharts-context-menu-item--active"),"function"==typeof e[t].focus&&e[t].focus())}_activate(t){const e=this._items[t];this.close(),e&&e.run()}_onDocDown(t){this.menu&&this.menu.contains(t.target)||this.close()}_onKey(t){this.menu&&this._items.length&&("Escape"===t.key?(t.preventDefault(),this.close()):"ArrowDown"===t.key?(t.preventDefault(),this._focus((this._focusIndex+1)%this._items.length)):"ArrowUp"===t.key?(t.preventDefault(),this._focus((this._focusIndex-1+this._items.length)%this._items.length)):"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this._activate(this._focusIndex<0?0:this._focusIndex)))}close(){const t=this._doc();t&&(t.removeEventListener("mousedown",this._onDocDown,!0),t.removeEventListener("keydown",this._onKey,!0)),this.menu&&this.menu.parentNode&&this.menu.parentNode.removeChild(this.menu),this.menu=null,this._items=[],this._focusIndex=-1}teardown(){this.close(),this._detachTrigger()}}});class Pi{constructor(t){this.w=t.w,this.barCtx=t,this.totalFormatter=this.w.config.plotOptions.bar.dataLabels.total.formatter,this.totalFormatter||(this.totalFormatter=this.w.config.dataLabels.formatter)}handleBarDataLabels(t){const{x:e,y:s,y1:i,y2:a,i:r,j:o,realIndex:h,columnGroupIndex:c,series:d,barHeight:g,barWidth:p,barXPosition:u,barYPosition:x,visibleSeries:f}=t,m=this.w,b=new gt(this.barCtx.w),y=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[h]:this.barCtx.strokeWidth;let w,v;m.axisFlags.isXNumeric&&!m.globals.isBarHorizontal?(w=e+p*(f+1),v=s+g*(f+1)-y):(w=e+p*f,v=s+g*f);let A=null,C=null,S=e,k=s,_={};const L=m.config.dataLabels,M=this.barCtx.barOptions.dataLabels,D=this.barCtx.barOptions.dataLabels.total;void 0!==x&&(this.barCtx.isRangeBar||this.barCtx.isPyramid)&&(v=x,k=x),void 0!==u&&this.barCtx.isVerticalGroupedRangeBar&&(w=u,S=u);const E=L.offsetX,P=L.offsetY;let F={width:0,height:0};if(m.config.dataLabels.enabled){const t=m.seriesData.series[r][o];F=b.getTextRects(m.config.dataLabels.formatter?m.config.dataLabels.formatter(t,l(n({},m),{seriesIndex:r,dataPointIndex:o,w:m})):m.formatters.yLabelFormatters[0](t),parseFloat(L.style.fontSize).toString())}const T={x:e,y:s,i:r,j:o,realIndex:h,columnGroupIndex:c,bcx:w,bcy:v,barHeight:g,barWidth:p,textRects:F,strokeWidth:y,dataLabelsX:S,dataLabelsY:k,dataLabelsConfig:L,barDataLabelsConfig:M,barTotalDataLabelsConfig:D,offX:E,offY:P};return _=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(T):this.calculateColumnsDataLabelsPosition(T),A=this.drawCalculatedDataLabels({x:_.dataLabelsX,y:_.dataLabelsY,val:this.barCtx.isRangeBar?[i,a]:"100%"===m.config.chart.stackType?d[h][o]:m.seriesData.series[h][o],i:h,j:o,barWidth:p,barHeight:g,textRects:F,dataLabelsConfig:L}),m.config.chart.stacked&&D.enabled&&(C=this.drawTotalDataLabels({x:_.totalDataLabelsX,y:_.totalDataLabelsY,barWidth:p,barHeight:g,realIndex:h,textAnchor:_.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:h,j:o}),dataLabelsConfig:L,barTotalDataLabelsConfig:D})),{dataLabelsPos:_,dataLabels:A,totalDataLabels:C}}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let i=this.barCtx.stackedSeriesTotals[e];return this.totalFormatter&&(i=this.totalFormatter(i,l(n({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),i}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,i,{i:a,j:r,realIndex:o,y:n,bcx:l,barWidth:h,barHeight:c,textRects:d,dataLabelsX:g,dataLabelsY:p,dataLabelsConfig:u,barDataLabelsConfig:x,barTotalDataLabelsConfig:f,strokeWidth:m,offX:b,offY:y}=t;const w=l;c=Math.abs(c);const v="vertical"===e.config.plotOptions.bar.dataLabels.orientation,{zeroEncounters:A}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:r});l-=m/2;const C=e.layout.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?g+=h/2:(g=e.axisFlags.isXNumeric?l-h/2+b:l-C+h/2+b,!e.config.chart.stacked&&A>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g-=h*A)),v){const t=2;g=g+d.height/2-m/2-t}const S=e.seriesData.series[a][r]<0;let k=n;switch(this.barCtx.isReversed&&(k=n+(S?c:-c)),x.position){case"center":p=v?S?k-c/2+y:k+c/2-y:S?k-c/2+d.height/2+y:k+c/2+d.height/2-y;break;case"bottom":p=v?S?k-c+y:k+c-y:S?k-c+d.height+m+y:k+c-d.height/2+m-y;break;case"top":p=v?S?k+y:k-y:S?k-d.height/2-y:k+d.height+y}let _=k;if(e.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{_=S?Math.max(t[r],_):Math.min(t[r],_)})}),this.barCtx.lastActiveBarSerieIndex===o&&f.enabled){const t=18,a=new gt(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),u.fontSize);s=S?_-a.height/2-y-f.offsetY+t:_+a.height+y+f.offsetY-t;const n=C;i=w+(e.axisFlags.isXNumeric?-h*e.globals.barGroups.length/2:e.globals.barGroups.length*h/2-(e.globals.barGroups.length-1)*h-n)+f.offsetX}return e.config.chart.stacked||(p<0?p=0+m:p+d.height/3>e.layout.gridHeight&&(p=e.layout.gridHeight-m)),{bcx:l,bcy:n,dataLabelsX:g,dataLabelsY:p,totalDataLabelsX:i,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){var e;const s=this.w;let{x:i,i:a,j:r,realIndex:o,bcy:n,barHeight:l,barWidth:h,textRects:c,dataLabelsX:d,strokeWidth:g,dataLabelsConfig:p,barDataLabelsConfig:u,barTotalDataLabelsConfig:x,offX:f,offY:m}=t;const b=s.layout.gridHeight/s.globals.dataPoints,{zeroEncounters:y}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:r});let w,v,A;if(h=Math.abs(h),this.barCtx.isPyramid){w=n+l/2+m-(null!=(e=c.centerOffset)?e:0)}else w=n-(this.barCtx.isRangeBar?0:b)+l/2+c.height/2+m-3;!s.config.chart.stacked&&y>0&&s.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(w-=l*y);let C="start";const S=s.seriesData.series[a][r]<0;let k=i;if(this.barCtx.isReversed&&(k=i+(S?-h:h),C=S?"start":"end"),this.barCtx.isPyramid)d=s.layout.gridWidth/2+f;else switch(u.position){case"center":d=S?k+h/2-f:Math.max(c.width/2,k-h/2)+f;break;case"bottom":d=S?k+h-g-f:k-h+g+f;break;case"top":d=S?k-g-f:k-g+f}let _=k;if(s.labelData.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{_=S?Math.min(t[r],_):Math.max(t[r],_)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){const t=new gt(this.barCtx.w).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:r}),p.fontSize);S?(v=_-g-f-x.offsetX,C="end"):v=_+f+x.offsetX+(this.barCtx.isReversed?-(h+g):g),A=w-c.height/2+t.height/2+x.offsetY+g,s.globals.barGroups.length>1&&(A-=s.globals.barGroups.length/2*(l/2))}return s.config.chart.stacked||("start"===p.textAnchor?d-c.width<0?d=S?c.width+g:g:d+c.width>s.layout.gridWidth&&(d=S?s.layout.gridWidth-g:s.layout.gridWidth-c.width-g):"middle"===p.textAnchor?d-c.width/2<0?d=c.width/2+g:d+c.width/2>s.layout.gridWidth&&(d=s.layout.gridWidth-c.width/2-g):"end"===p.textAnchor&&(d<1?d=c.width+g:d+1>s.layout.gridWidth&&(d=s.layout.gridWidth-c.width-g))),{bcx:i,bcy:n,dataLabelsX:d,dataLabelsY:w,totalDataLabelsX:v,totalDataLabelsY:A,totalDataLabelsAnchor:C}}drawCalculatedDataLabels({x:t,y:e,val:s,i:i,j:a,textRects:r,barHeight:o,barWidth:h,dataLabelsConfig:c}){const d=this.w;let g="rotate(0)";"vertical"===d.config.plotOptions.bar.dataLabels.orientation&&(g=`rotate(-90, ${t}, ${e})`);const p=new yt(this.barCtx.w,this.barCtx.ctx),u=new gt(this.barCtx.w),x=c.formatter;let f=null;const m=d.globals.collapsedSeriesIndices.indexOf(i)>-1;if(c.enabled&&!m){f=u.group({class:"apexcharts-data-labels",transform:g});let m="";void 0!==s&&(m=x(s,l(n({},d),{seriesIndex:i,dataPointIndex:a,w:d}))),!s&&d.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(m="");const b=d.seriesData.series[i][a]<0,y=d.config.plotOptions.bar.dataLabels.position;if("vertical"===d.config.plotOptions.bar.dataLabels.orientation&&("top"===y&&(c.textAnchor=b?"end":"start"),"center"===y&&(c.textAnchor="middle"),"bottom"===y&&(c.textAnchor=b?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<u.getTextRects(m,parseFloat(c.style.fontSize).toString()).width&&(m="")}d.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?r.width/1.6>Math.abs(h)&&(m=""):r.height/1.6>Math.abs(o)&&(m=""));const w=n({},c);this.barCtx.isHorizontal&&s<0&&("start"===c.textAnchor?w.textAnchor="end":"end"===c.textAnchor&&(w.textAnchor="start")),p.plotDataLabelsText({x:t,y:e,text:m,i:i,j:a,parent:f,dataLabelsConfig:w,alwaysDrawDataLabel:!0,offsetCorrection:!0})}return f}drawTotalDataLabels({x:t,y:e,val:s,realIndex:i,textAnchor:a,barTotalDataLabelsConfig:r}){const o=new gt(this.barCtx.w);let n;return r.enabled&&void 0!==t&&void 0!==e&&this.barCtx.lastActiveBarSerieIndex===i&&(n=o.drawText({x:t,y:e,foreColor:r.style.color,text:s,textAnchor:a,fontFamily:r.style.fontFamily,fontSize:r.style.fontSize,fontWeight:r.style.fontWeight})),n}}let Fi=class{constructor(t){this.w=t.w,this.barCtx=t}initVariables(t){const e=this.w;this.barCtx.series=t,this.barCtx.totalItems=0,this.barCtx.seriesLen=0,this.barCtx.visibleI=-1,this.barCtx.visibleItems=1;for(let s=0;s<t.length;s++)if(t[s].length>0&&(this.barCtx.seriesLen=this.barCtx.seriesLen+1,this.barCtx.totalItems+=t[s].length),e.axisFlags.isXNumeric)for(let i=0;i<t[s].length;i++)e.seriesData.seriesX[s][i]>e.globals.minX&&e.seriesData.seriesX[s][i]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.seriesData.series),b.isSafari()&&(this.arrBorderRadius=this.arrBorderRadius.map(t=>t.map(t=>"none"))),0===this.barCtx.seriesLen&&(this.barCtx.seriesLen=1),this.barCtx.zeroSerieses=[],e.globals.comboCharts||this.checkZeroSeries({series:t})}initialPositions(t){const e=this.w;let s,i,a,r,o,n,l,h,c=e.globals.dataPoints;this.barCtx.isRangeBar&&(c=e.labelData.labels.length);let d=this.barCtx.seriesLen;if(e.config.plotOptions.bar.rangeBarGroupRows&&(d=1),this.barCtx.isHorizontal)a=e.layout.gridHeight/c,o=a/d,e.axisFlags.isXNumeric&&(a=e.layout.gridHeight/this.barCtx.totalItems,o=a/this.barCtx.seriesLen),o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),h=this.barCtx.baseLineInvertedY+e.globals.padHorizontal+(this.barCtx.isReversed?e.layout.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(h=e.layout.gridWidth/2),i=(a-o*this.barCtx.seriesLen)/2;else{if(r=e.layout.gridWidth/this.barCtx.visibleItems,e.config.xaxis.convertedCatToNumeric&&(r=e.layout.gridWidth/e.globals.dataPoints),n=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,e.axisFlags.isXNumeric){const t=this.barCtx.xRatio;e.globals.minXDiff&&.5!==e.globals.minXDiff&&e.globals.minXDiff/t>0&&(r=e.globals.minXDiff/t),n=r/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,n<1&&(n=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(n=parseInt(this.barCtx.barOptions.columnWidth,10)),l=e.layout.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?e.layout.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),e.axisFlags.isXNumeric){s=this.barCtx.getBarXForNumericXAxis({x:s,j:0,realIndex:t,barWidth:n}).x}else s=e.globals.padHorizontal+b.noExponents(r-n*this.barCtx.seriesLen)/2}return e.globals.barHeight=o,e.globals.barWidth=n,{x:s,y:i,yDivision:a,xDivision:r,barHeight:o,barWidth:n,zeroH:l,zeroW:h}}initializeStackedPrevVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].prevY=[],t[e].prevX=[],t[e].prevYF=[],t[e].prevXF=[],t[e].prevYVal=[],t[e].prevXVal=[]})}initializeStackedXYVars(t){t.w.labelData.seriesGroups.forEach(e=>{t[e]||(t[e]={}),t[e].xArrj=[],t[e].xArrjF=[],t[e].xArrjVal=[],t[e].yArrj=[],t[e].yArrjF=[],t[e].yArrjVal=[]})}getPathFillColor(t,e,s,i){var a,r,o,n;const l=this.w,h=new pt(this.barCtx.w);let c=null;const d=this.barCtx.barOptions.distributed?s:e;let g=!1;if(this.barCtx.barOptions.colors.ranges.length>0){this.barCtx.barOptions.colors.ranges.map(i=>{t[e][s]>=i.from&&t[e][s]<=i.to&&(c=i.color,g=!0)})}return{color:h.fillPath({seriesNumber:this.barCtx.barOptions.distributed?d:i,dataPointIndex:s,color:c,value:t[e][s],fillConfig:null==(a=l.config.series[e].data[s])?void 0:a.fill,fillType:(null==(o=null==(r=l.config.series[e].data[s])?void 0:r.fill)?void 0:o.type)?null==(n=l.config.series[e].data[s])?void 0:n.fill.type:Array.isArray(l.config.fill.type)?l.config.fill.type[i]:l.config.fill.type}),useRangeColor:g}}getStrokeWidth(t,e,s){let i=0;const a=this.w;return void 0===this.barCtx.series[t][e]||null===this.barCtx.series[t][e]||"bar"===a.config.chart.type&&!this.barCtx.series[t][e]?this.barCtx.isNullValue=!0:this.barCtx.isNullValue=!1,a.config.stroke.show&&(this.barCtx.isNullValue||(i=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[s]:this.barCtx.strokeWidth)),i}createBorderRadiusArr(t){var e;const s=this.w,i=!this.w.config.chart.stacked||s.config.plotOptions.bar.borderRadius<=0,a=t.length,r=0|(null==(e=t[0])?void 0:e.length),o=Array.from({length:a},()=>Array(r).fill(i?"top":"none"));if(i)return o;const n=this.w.config.chart.type;for(let e=0;e<r;e++){const s=[],i=[];let l=0;for(let r=0;r<a;r++){const a=t[r][e];a>0?(s.push(r),l++):a<0&&(i.push(r),l++)}if(s.length>0&&0===i.length)if(1===s.length)o[s[0]][e]="bar"===n&&1===r?"top":"both";else{const t=s[0],i=s[s.length-1];for(const a of s)o[a][e]=a===t?"bar"===n&&1===r?"top":"bottom":a===i?"top":"none"}else if(i.length>0&&0===s.length)if(1===i.length)o[i[0]][e]="both";else{const t=Math.max(...i),s=Math.min(...i);for(const a of i)o[a][e]=a===t?"bottom":a===s?"top":"none"}else if(s.length>0&&i.length>0){const t=s[s.length-1];for(const i of s)o[i][e]=i===t?"top":"none";const a=Math.max(...i);for(const t of i)o[t][e]=t===a?"bottom":"none"}else if(1===l){o[s[0]||i[0]][e]="both"}}return o}barBackground({j:t,i:e,x1:s,x2:i,y1:a,y2:r,elSeries:o}){const n=this.w,l=new gt(this.barCtx.w),h=new ce(this.barCtx.w).getActiveConfigSeriesIndex();if(this.barCtx.barOptions.colors.backgroundBarColors.length>0&&h===e){t>=this.barCtx.barOptions.colors.backgroundBarColors.length&&(t%=this.barCtx.barOptions.colors.backgroundBarColors.length);const e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=l.drawRect(void 0!==s?s:0,void 0!==a?a:0,void 0!==i?i:n.layout.gridWidth,void 0!==r?r:n.layout.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);o.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:i,strokeWidth:a,isReversed:r,series:o,seriesGroup:n,realIndex:l,i:h,j:c,w:d}){var g,p,u;const x=new gt(this.barCtx.w);(a=Array.isArray(a)?a[l]:a)||(a=0);let f=t,m=e;(null==(g=d.config.series[l].data[c])?void 0:g.columnWidthOffset)&&(m=e-d.config.series[l].data[c].columnWidthOffset/2,f=t+d.config.series[l].data[c].columnWidthOffset);const b=a/2,y=m+b,w=m+f-b,v=(o[h][c]>=0?1:-1)*(r?-1:1);s+=.001-b*v,i+=.001+b*v;const A=x.line(w,s),C="around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z";let S=x.move(y,s)+x.line(y,i)+x.line(w,i)+A+C;"none"!==this.arrBorderRadius[l][c]&&(S=x.roundPathCorners(S,d.config.plotOptions.bar.borderRadius));let k=null;const _=null==(u=null==(p=this.barCtx.ctx)?void 0:p.morphTypeChange)?void 0:u.getInitialPathFor(l,c);if(_?k=_:d.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(l,c,S)),null==k&&(k=x.move(y,s)+x.line(y,s)+A+A+A+A+A+x.line(y,s)+C),d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[n],t.yArrj.push(i-b*v),t.yArrjF.push(Math.abs(s-i+a*v)),t.yArrjVal.push(this.barCtx.series[h][c])}return{pathTo:S,pathFrom:k}}getFunnelTrapezoidPaths({barYPosition:t,barHeight:e,series:s,i:i,j:a,realIndex:r,strokeWidth:o,w:n}){var l,h;const c=new gt(this.barCtx.w),d=n.layout.gridWidth/2,g=t=>Math.abs(t/this.barCtx.invertedYRatio)/2,p=g(s[i][a]),u=a===s[i].length-1,x="taper"===n.config.plotOptions.funnel.lastShape?"taper":"flat";let f;f=u?"taper"===x?0:p:g(s[i][a+1]);const m=o/2,b=t+m,y=t+e-m,w=d-p,v=d+p,A=d-f,C=d+f,S=c.move(w,b)+c.line(v,b)+c.line(C,y)+c.line(A,y)+" Z";let k=null;const _=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(r,a);return _?k=_:n.globals.previousPaths.length>0&&(k=this.barCtx.getPreviousPath(r,a,S)),null==k&&(k=c.move(d,b)+c.line(d,b)+c.line(d,y)+c.line(d,y)+" Z"),{pathTo:S,pathFrom:k,x:v,x1:w,barXPosition:d}}computePyramidLayout(t){const e=this.w,s=e.layout.gridHeight,i=e.layout.gridWidth,a=t.map(t=>Math.abs(Number(t)||0)),r=a.reduce((t,e)=>t+e,0);if(0===r||s<=0)return a.map(()=>({y:0,height:0,topHalf:0,bottomHalf:0}));const o=i/2;let n=0;const l=[];for(let t=0;t<a.length;t++){const e=n/r;n+=a[t];const i=n/r,h=e*s,c=i*s;l.push({y:h,height:c-h,topHalf:e*o,bottomHalf:i*o})}return l}getPyramidPaths({barYPosition:t,barHeight:e,topHalf:s,bottomHalf:i,realIndex:a,j:r,strokeWidth:o,w:n}){var l,h;const c=new gt(this.barCtx.w),d=n.layout.gridWidth/2,g=o/2,p=t+g,u=t+e-g,x=d-s,f=d+s,m=d-i,b=d+i,y=c.move(x,p)+c.line(f,p)+c.line(b,u)+c.line(m,u)+" Z";let w=null;const v=null==(h=null==(l=this.barCtx.ctx)?void 0:l.morphTypeChange)?void 0:h.getInitialPathFor(a,r);return v?w=v:n.globals.previousPaths.length>0&&(w=this.barCtx.getPreviousPath(a,r,y)),null==w&&(w=c.move(d,p)+c.line(d,p)+c.line(d,u)+c.line(d,u)+" Z"),{pathTo:y,pathFrom:w,x:f,x1:x,barXPosition:d}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:i,strokeWidth:a,isReversed:r,series:o,seriesGroup:n,realIndex:l,i:h,j:c,w:d}){var g,p,u;const x=new gt(this.barCtx.w);(a=Array.isArray(a)?a[l]:a)||(a=0);let f=t,m=e;(null==(g=d.config.series[l].data[c])?void 0:g.barHeightOffset)&&(f=t-d.config.series[l].data[c].barHeightOffset/2,m=e+d.config.series[l].data[c].barHeightOffset);const b=a/2,y=f+b,w=f+m-b,v=(o[h][c]>=0?1:-1)*(r?-1:1);s+=.001+b*v,i+=.001-b*v;const A=this.barCtx.isFunnel,C=A?(s+i)/2:s,S=x.line(s,w),k="around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[l][c]?" Z":" z";let _=x.move(s,y)+x.line(i,y)+x.line(i,w)+S+k;"none"!==this.arrBorderRadius[l][c]&&(_=x.roundPathCorners(_,d.config.plotOptions.bar.borderRadius));let L=null;const M=null==(u=null==(p=this.barCtx.ctx)?void 0:p.morphTypeChange)?void 0:u.getInitialPathFor(l,c);if(M?L=M:d.globals.previousPaths.length>0&&(L=this.barCtx.getPreviousPath(l,c,_)),null==L){const t=A?x.line(C,w):S;L=x.move(C,y)+x.line(C,y)+t+t+t+t+t+x.line(C,y)+k}if(d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[n],t.xArrj.push(i+b*v),t.xArrjF.push(Math.abs(s-i-a*v)),t.xArrjVal.push(this.barCtx.series[h][c])}return{pathTo:_,pathFrom:L}}checkZeroSeries({series:t}){const e=this.w;for(let s=0;s<t.length;s++){let i=0;for(let a=0;a<t[e.globals.maxValsInArrayIndex].length;a++)i+=t[s][a];0===i&&this.barCtx.zeroSerieses.push(s)}}getXForValue(t,e,s=!0){let i=s?e:null;return null!=t&&(i=e+t/this.barCtx.invertedYRatio-2*(this.barCtx.isReversed?t/this.barCtx.invertedYRatio:0)),i}getYForValue(t,e,s,i=!0){let a=i?e:null;return null!=t&&(a=e-t/this.barCtx.yRatio[s]+2*(this.barCtx.isReversed?t/this.barCtx.yRatio[s]:0)),a}getGoalValues(t,e,s,i,a,r){const o=this.w,h=[],c=(i,a)=>{h.push({[t]:"x"===t?this.getXForValue(i,e,!1):this.getYForValue(i,s,r,!1),attrs:a})};if(o.seriesData.seriesGoals[i]&&o.seriesData.seriesGoals[i][a]&&Array.isArray(o.seriesData.seriesGoals[i][a])&&o.seriesData.seriesGoals[i][a].forEach(t=>{c(t.value,t)}),this.barCtx.barOptions.isDumbbell&&o.rangeData.seriesRange.length){const e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:o.globals.colors,s={strokeHeight:"x"===t?0:o.globals.markers.size[i],strokeWidth:"x"===t?o.globals.markers.size[i]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[i])?e[i][0]:e[i]};c(o.rangeData.seriesRangeStart[i][a],s),c(o.rangeData.seriesRangeEnd[i][a],l(n({},s),{strokeColor:Array.isArray(e[i])?e[i][1]:e[i]}))}return h}drawGoalLine({barXPosition:t,barYPosition:e,goalX:s,goalY:i,barWidth:a,barHeight:r}){if(!(Array.isArray(s)&&s.length>0||Array.isArray(i)&&i.length>0))return null;const o=new gt(this.barCtx.w),n=o.group({className:"apexcharts-bar-goals-groups"});n.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:n.node}),n.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let l=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=o.w.layout.gridWidth+1){const s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:r/2,i=e+s+r/2;l=o.drawLine(t.x,i-2*s,t.x,i,t.attrs.strokeColor?t.attrs.strokeColor:void 0,t.attrs.strokeDashArray,t.attrs.strokeWidth?t.attrs.strokeWidth:2,t.attrs.strokeLineCap),n.add(l)}}):Array.isArray(i)&&i.forEach(e=>{if(e.y>=-1&&e.y<=o.w.layout.gridHeight+1){const s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:a/2,i=t+s+a/2;l=o.drawLine(i-2*s,e.y,i,e.y,e.attrs.strokeColor?e.attrs.strokeColor:void 0,e.attrs.strokeDashArray,e.attrs.strokeHeight?e.attrs.strokeHeight:2,e.attrs.strokeLineCap),n.add(l)}}),n}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:i,j:a}){const r=this.w,{x:o,x1:n,barYPosition:l}=t,{x:h,x1:c,barYPosition:d}=e,g=l+e.barHeight,p=new gt(this.barCtx.w),u=new b,x=p.move(n,g)+p.line(o,g)+p.line(h,d)+p.line(c,d)+p.line(n,g)+("around"===r.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[i][a]?" Z":" z");return p.drawPath({d:x,fill:u.shadeColor(.5,b.rgb2hex(s)),stroke:"none",strokeWidth:0,fillOpacity:1,classes:"apexcharts-bar-shadow apexcharts-decoration-element"})}getZeroValueEncounters({i:t,j:e}){var s;const i=this.w;let a=0,r=0;return(i.config.plotOptions.bar.horizontal?i.seriesData.series.map((t,e)=>e):(null==(s=i.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{const o=i.globals.seriesPercent[s][e];o&&a++,s<t&&0===o&&r++}),{nonZeroColumns:a,zeroEncounters:r}}getGroupIndex(t){const e=this.w,s=e.labelData.seriesGroups.findIndex(s=>s.indexOf(e.seriesData.seriesNames[t])>-1),i=this.barCtx.columnGroupIndices;let a=i.indexOf(s);return a<0&&(i.push(s),a=i.length-1),{groupIndex:s,columnGroupIndex:a}}};class Ti{constructor(t,e,s){this.ctx=e,this.w=t,this.barOptions=t.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=t.config.stroke.width,this.isNullValue=!1,this.isRangeBar=t.rangeData.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!t.globals.isBarHorizontal&&t.rangeData.seriesRange.length&&t.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.isPyramid=this.barOptions.isPyramid,this.pyramidLayout=null,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.invertedXRatio=0,this.invertedYRatio=0,this.baseLineY=[],this.baseLineInvertedY=0,null!==this.xyRatios&&(this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.invertedXRatio=s.invertedXRatio,this.invertedYRatio=s.invertedYRatio,this.baseLineY=s.baseLineY,this.baseLineInvertedY=s.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[],this._prevKeyed=null,this._ltCache=null,this.series=[],this.elSeries=null,this.visibleI=0,this.isReversed=!1;const i=new ce(this.w);this.lastActiveBarSerieIndex=i.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];const a=i.getBarSeriesIndices(),r=new P(this.w);this.stackedSeriesTotals=r.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===a.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new Fi(this)}draw(t,e){var s,i;const a=this.w,r=new gt(this.w),o=new P(this.w);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const h=r.group({class:"apexcharts-bar-series apexcharts-plot-series"});a.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let o=0,c=0;o<t.length;o++,c++){let d,g;const p=[],u=[],x=a.globals.comboCharts?e[o]:o,{columnGroupIndex:f}=this.barHelpers.getGroupIndex(x),m=r.group({class:"apexcharts-series",rel:o+1,seriesName:b.escapeString(a.seriesData.seriesNames[x]),"data:realIndex":x});ce.addCollapsedClassToSeries(this.w,m,x),t[o].length>0&&(this.visibleI=this.visibleI+1),this.yRatio.length>1&&(this.yaxisIndex=a.globals.seriesYAxisReverseMap[x],this.translationsIndex=x);const y=this.translationsIndex;this.isReversed=a.config.yaxis[this.yaxisIndex]&&a.config.yaxis[this.yaxisIndex].reversed,this.isPyramid&&(this.pyramidLayout=this.barHelpers.computePyramidLayout(t[o]));const w=this.barHelpers.initialPositions(x),{y:v,yDivision:A,zeroW:C,x:S,xDivision:k,zeroH:_}=w;let L=w.barHeight,M=w.barWidth;g=v,d=S,this.isHorizontal||u.push(d+(null!=M?M:0)/2);const D=r.group({class:"apexcharts-datalabels","data:realIndex":x});a.globals.delayedElements.push({el:D.node,holdUntilComplete:this.isLengthTransition(x)}),D.node.classList.add("apexcharts-element-hidden");const E=r.group({class:"apexcharts-bar-goals-markers"}),P=r.group({class:"apexcharts-bar-shadows"});a.globals.delayedElements.push({el:P.node}),P.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[o].length;e++){const r=this.barHelpers.getStrokeWidth(o,e,x);let h=null;const w={indexes:{i:o,j:e,realIndex:x,translationsIndex:y,bc:c},x:d,y:g,strokeWidth:r,elSeries:m};this.isHorizontal?(h=this.drawBarPaths(l(n({},w),{barHeight:L,zeroW:C,yDivision:A})),M=this.series[o][e]/this.invertedYRatio):(h=this.drawColumnPaths(l(n({},w),{xDivision:k,barWidth:M,zeroH:_})),L=this.series[o][e]/this.yRatio[y]);const v=this.barHelpers.getPathFillColor(t,o,e,x);if(this.isFunnel&&!this.isPyramid&&this.barOptions.isFunnel3d&&"trapezoid"!==(null==(s=a.config.plotOptions.funnel)?void 0:s.shape)&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof v.color&&-1===(null==(i=v.color)?void 0:i.indexOf("url"))?v.color:b.hexToRgba(a.globals.colors[o]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:h,realIndex:x,j:e});if(P.add(t),a.config.chart.dropShadow.enabled){new dt(this.w).dropShadow(t,a.config.chart.dropShadow,x)}}this.pathArr.push(h);const S=this.barHelpers.drawGoalLine({barXPosition:h.barXPosition,barYPosition:h.barYPosition,goalX:h.goalX,goalY:h.goalY,barHeight:L,barWidth:M});S&&E.add(S),g=h.y,d=h.x,e>0&&u.push(d+(null!=M?M:0)/2),p.push(g),this.renderSeries(l(n({realIndex:x,pathFill:v.color},v.useRangeColor?{lineFill:v.color}:{}),{j:e,i:o,columnGroupIndex:f,pathFrom:h.pathFrom,pathTo:h.pathTo,strokeWidth:r,elSeries:m,x:d,y:g,series:t,barHeight:Math.abs(h.barHeight?h.barHeight:L),barWidth:Math.abs(h.barWidth?h.barWidth:M),elDataLabelsWrap:D,elGoalsMarkers:E,elBarShadows:P,visibleSeries:this.visibleI,type:"bar"}))}if(a.globals.seriesXvalues[x]=u,a.globals.seriesYvalues[x]=p,a.globals.previousPaths.length>0){const e=[];for(let s=0;s<t[o].length;s++)e.push(Ot(a,x,s));qt({w:a,elSeries:m,record:this._prevRecord(x),newKeys:e,isHorizontal:this.isHorizontal,speed:a.config.chart.animations.dynamicAnimation.speed})}h.add(m)}return h}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:i,i:a,columnGroupIndex:r,pathFrom:o,pathTo:n,strokeWidth:l,elSeries:h,x:c,y:d,y1:g,y2:p,series:u,barHeight:x,barWidth:f,barXPosition:m,barYPosition:b,elDataLabelsWrap:y,elGoalsMarkers:w,elBarShadows:v,visibleSeries:A,type:C,classes:S}){var k;const _=this.w,L=new gt(this.w,this.ctx),M=xt(this.ctx,L);let D=!1;if(h._bindingsDelegated||(h._bindingsDelegated=!0,L.setupEventDelegation(h,`.apexcharts-${C}-area`)),!s){let e=function(t){const e=_.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:_.seriesData.series[t][i],dataPointIndex:i,w:_}):s};const a="function"==typeof _.globals.stroke.colors[t]?e(t):_.globals.stroke.colors[t];s=this.barOptions.distributed?_.globals.stroke.colors[i]:a}const E=new Pi(this).handleBarDataLabels({x:c,y:d,y1:g,y2:p,i:a,j:i,series:u,realIndex:t,columnGroupIndex:r,barHeight:x,barWidth:f,barXPosition:m,barYPosition:b,visibleSeries:A});_.globals.isBarHorizontal||(E.dataLabelsPos.dataLabelsX+Math.max(f,_.globals.barPadForNumericAxis)<0||E.dataLabelsPos.dataLabelsX-Math.max(f,_.globals.barPadForNumericAxis)>_.layout.gridWidth)&&(D=!0),_.config.series[a].data[i]&&_.config.series[a].data[i].strokeColor&&(s=_.config.series[a].data[i].strokeColor),this.isNullValue&&(e="none");const P=_.config.chart.animations,F=P.animateGradually;let T=0;if(F&&!1!==F.enabled&&!(_.globals.dataChanged&&this.isLengthTransition(t))){const t=_.globals.dataPoints||1,e=F.delay||0,s=Math.min(e,.5*P.speed/Math.max(1,t));let r=ht({style:"sequential",index:i,baseDelay:s});_.config.chart.stacked&&(r+=a*s*.5);T=r/(e||1)}if(!D){const r=!0===(null==(k=this.ctx.morphTypeChange)?void 0:k.isActive())?this.ctx.morphTypeChange.getSpeed():_.config.chart.animations.dynamicAnimation.speed,c=M.renderPaths({i:a,j:i,realIndex:t,pathFrom:o,pathTo:n,stroke:s,strokeWidth:l,strokeLineCap:_.config.stroke.lineCap,fill:e,animationDelay:T,initialSpeed:_.config.chart.animations.speed,dataChangeSpeed:r,className:`apexcharts-${C}-area ${S}`,chartType:C,bindEventsOnPaths:!1});c.attr("clip-path",`url(#gridRectBarMask${_.globals.cuid})`);const d=_.config.forecastDataPoints;d.count>0&&i>=_.globals.dataPoints-d.count&&(c.node.setAttribute("stroke-dasharray",d.dashArray),c.node.setAttribute("stroke-width",d.strokeWidth),c.node.setAttribute("fill-opacity",d.fillOpacity)),void 0!==g&&void 0!==p&&(c.attr("data-range-y1",g),c.attr("data-range-y2",p));new dt(this.w).setSelectionFilter(c,t,i),h.add(c),c.attr({cy:E.dataLabelsPos.bcy,cx:E.dataLabelsPos.bcx,j:i,val:_.seriesData.series[a][i],barHeight:x,barWidth:f,"data:pathKey":Ot(_,t,i)}),"canvas"===M.kind&&(_.globals.barCanvasCoords||(_.globals.barCanvasCoords={}),_.globals.barCanvasCoords[t]||(_.globals.barCanvasCoords[t]={}),_.globals.barCanvasCoords[t][i]={cx:E.dataLabelsPos.bcx,cy:E.dataLabelsPos.bcy,barWidth:f}),null!==E.dataLabels&&y.add(E.dataLabels),E.totalDataLabels&&y.add(E.totalDataLabels),h.add(y),w&&h.add(w),v&&h.add(v)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:r,yDivision:o,elSeries:n}){const l=this.w,h=t.i,c=t.j;let d;if(l.axisFlags.isXNumeric)d=(r=(l.seriesData.seriesX[h][c]-l.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:h,j:c});t>0&&(e=this.seriesLen*e/t),d=r+e*this.visibleI,d-=e*s}else d=r+e*this.visibleI;const g=this.isFunnel&&"trapezoid"===l.config.plotOptions.funnel.shape,p=this.isPyramid&&this.pyramidLayout?this.pyramidLayout[c]:null,u=!!p;if(p)d=p.y,e=p.height;else if(this.isFunnel&&!g){const t=null!=i?i:0;i=t-(this.barHelpers.getXForValue(this.series[h][c],t)-t)/2}let x;return a=this.barHelpers.getXForValue(this.series[h][c],null!=i?i:0),x=p?this.barHelpers.getPyramidPaths({barYPosition:d,barHeight:e,topHalf:p.topHalf,bottomHalf:p.bottomHalf,realIndex:t.realIndex,j:c,strokeWidth:s,w:l}):g?this.barHelpers.getFunnelTrapezoidPaths({barYPosition:d,barHeight:e,series:this.series,i:h,j:c,realIndex:t.realIndex,strokeWidth:s,w:l}):this.barHelpers.getBarpaths({barYPosition:d,barHeight:e,x1:i,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:h,j:c,w:l}),(g||u)&&(i=x.x1,a=x.x),l.axisFlags.isXNumeric||u||(r+=o),u&&(r=d),this.barHelpers.barBackground({j:c,i:h,y1:d-e*this.visibleI,y2:e*this.seriesLen,elSeries:n}),{pathTo:x.pathTo,pathFrom:x.pathFrom,x1:i,x:a,y:r,goalX:this.barHelpers.getGoalValues("x",i,null,h,c,0),barYPosition:d,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:r,strokeWidth:o,elSeries:n}){const l=this.w,h=t.realIndex,c=t.translationsIndex,d=t.i,g=t.j,p=t.bc;let u;if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:g,realIndex:h,barWidth:a});e=t.x,u=t.barXPosition}else if(l.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:d,j:g});t>0&&(a=this.seriesLen*a/t),u=e+a*this.visibleI,u-=a*s}else u=e+a*this.visibleI;s=this.barHelpers.getYForValue(this.series[d][g],r,c);const x=this.barHelpers.getColumnPaths({barXPosition:u,barWidth:a,y1:r,y2:s,strokeWidth:o,isReversed:this.isReversed,series:this.series,realIndex:h,i:d,j:g,w:l});return l.axisFlags.isXNumeric||(e+=i),this.barHelpers.barBackground({bc:p,j:g,i:d,x1:u-o/2-a*this.visibleI,x2:a*this.seriesLen+o/2,elSeries:n}),{pathTo:x.pathTo,pathFrom:x.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,r,d,g,c),barXPosition:u,barWidth:a}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:i}){const a=this.w;let r=s;return a.seriesData.seriesX[s].length||(r=a.globals.maxValsInArrayIndex),b.isNumber(a.seriesData.seriesX[r][i])&&(t=(a.seriesData.seriesX[r][i]-a.globals.minX)/this.xRatio-e*this.seriesLen/2),{barXPosition:t+e*this.visibleI,x:t}}_prevRecord(t){const e=this.w;let s=null;for(let i=0;i<e.globals.previousPaths.length;i++){const a=e.globals.previousPaths[i];a.paths&&a.paths.length>0&&parseInt(a.realIndex,10)===parseInt(String(t),10)&&(s=a)}return s}_prevKeyedPaths(t){if(this._prevKeyed||(this._prevKeyed={}),void 0!==this._prevKeyed[t])return this._prevKeyed[t];const e=this._prevRecord(t);let s=null;if(e&&e.paths.every(t=>null!=t.key)){const t=new Map;e.paths.forEach(e=>{t.set(e.key,e)}),s=t}return this._prevKeyed[t]=s,s}isLengthTransition(t){var e,s;if(this._ltCache||(this._ltCache={}),void 0!==this._ltCache[t])return this._ltCache[t];const i=this.w;let a=!1;if(Wt(i)&&i.globals.previousPaths.length>0){const r=this._prevRecord(t),o=null!=(s=null==(e=i.seriesData.series[t])?void 0:e.length)?s:0;if(r)if(r.paths.length!==o)a=!0;else{const e=this._prevKeyedPaths(t);if(e)for(let s=0;s<o;s++)if(!e.has(Ot(i,t,s))){a=!0;break}}else a=o>0}return this._ltCache[t]=a,a}getPreviousPath(t,e,s){const i=this.w,a=this._prevRecord(t);if(!a)return Wt(i)?null:s;let r=null,o=!1;const n=this._prevKeyedPaths(t);if(n){const s=n.get(Ot(i,t,e));s?r=s.d:o=!0}else void 0!==a.paths[e]?r=a.paths[e].d:o=!0;return r&&Ti.pathCommandCount(r)===Ti.pathCommandCount(s)?r:o&&Wt(i)?null:s}static pathCommandCount(t){if(!t)return 0;const e=t.match(/[A-Za-z]/g);return e?e.length:0}}function Ii({w:t,points:e,seedA:s,seedB:i,center:a,halfExtent:r,alongFn:o,isHorizontal:n,options:l,clampAt:h}){const c=l;if(!c||!1===c.show)return[];if(!e||!e.length)return[];const d=c.maxPoints||3e3,g=e.length>d?Math.ceil(e.length/d):1,p=null!=c.size?c.size:2.5,u=r*(null!=c.jitter?c.jitter:.5),x=!1!==c.constrainToViolin&&"function"==typeof h,f="square"===c.shape,m=c.colorScale,b=m&&Array.isArray(m.colors)&&m.colors.length>0,y=b?Math.max(2,m.steps||24):1,w=b&&null!=m.min?m.min:t.globals.minY,v=(b&&null!=m.max?m.max:t.globals.maxY)-w||1,A=b?new Array(y).fill(""):[""];for(let t=0;t<e.length;t+=g){const r=e[t],l=o(r);let c=2*(Bi(7919*s+100003*i+t)-.5)*u;if(x){const t=h(r);c>t&&(c=t),c<-t&&(c=-t)}const d=n?l:a+c,g=n?a+c:l,m=f?Ni(d,g,p):Yi(d,g,p);if(b){let t=(r-w)/v;t<0&&(t=0),t>1&&(t=1),A[Math.round(t*(y-1))]+=m}else A[0]+=m}if(!b)return A[0]?[{fill:null,d:A[0]}]:[];const C=[];for(let t=0;t<y;t++)A[t]&&C.push({fill:zi(m.colors,t/(y-1)),d:A[t]});return C}function Xi({graphics:t,w:e,elSeries:s,pointsByCat:i,options:a,distributed:r,realIndex:o,wrapClass:n,pointClass:l}){if(!a||!1===a.show||!i.length)return;const h=null!=a.opacity?a.opacity:.9,c=null!=a.strokeColor?a.strokeColor:"#fff",d=null!=a.strokeWidth?a.strokeWidth:1,g=e.config.chart.animations.enabled&&!e.globals.resized&&!e.globals.dataChanged,p=t.group({class:g?`${n} apexcharts-element-hidden`:n});g&&e.globals.delayedElements.push({el:p.node}),i.forEach(({groups:s,j:i})=>{const n=r?e.globals.colors[i]:e.globals.colors[o],g=a.fillColor,u="series"===g?n:"series-dark"===g?Ri(n,.45):g||Ri(n,.45);s.forEach(s=>{const a=t.drawPath({d:s.d,fill:null!=s.fill?s.fill:u,stroke:d>0?c:"none",strokeWidth:d,fillOpacity:h,classes:l});a.attr("data:realIndex",o),a.attr("j",i),a.attr("clip-path",`url(#gridRectBarMask${e.globals.cuid})`),a.node.style.pointerEvents="none",p.add(a)})}),s.add(p)}function Ri(t,e){const s=b.parseHex(t);if(!s)return t;const i=Math.max(0,1-e);return`rgb(${Math.round(s[0]*i)},${Math.round(s[1]*i)},${Math.round(s[2]*i)})`}function zi(t,e){if(!t.length)return"#000";if(1===t.length)return t[0];const s=Math.max(0,Math.min(1,e))*(t.length-1),i=Math.floor(s),a=s-i,r=b.parseHex(t[i])||[0,0,0],o=b.parseHex(t[Math.min(i+1,t.length-1)])||r,n=(t,e)=>Math.round(t+(e-t)*a);return`rgb(${n(r[0],o[0])},${n(r[1],o[1])},${n(r[2],o[2])})`}function Bi(t){let e=(2654435769^t)>>>0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),((e^e>>>16)>>>0)/4294967296}function Yi(t,e,s){return`M ${t-s} ${e} a ${s} ${s} 0 1 0 ${2*s} 0 a ${s} ${s} 0 1 0 ${-2*s} 0 `}function Ni(t,e,s){return`M ${t-s} ${e-s} h ${2*s} v ${2*s} h ${-2*s} z `}class Wi extends Ti{draw(t,e,s){var i;const a=this.w,r=new gt(this.w),o=a.globals.comboCharts?e:a.config.chart.type,h=new pt(this.w);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=a.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new P(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const c=r.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let o,d;this.isBoxPlot="boxPlot"===a.config.chart.type||"boxPlot"===a.config.series[e].type;const g=[],p=[],u=a.globals.comboCharts?s[e]:e,{columnGroupIndex:x}=this.barHelpers.getGroupIndex(u),f=r.group({class:"apexcharts-series",seriesName:b.escapeString(a.seriesData.seriesNames[u]),rel:e+1,"data:realIndex":u});ce.addCollapsedClassToSeries(this.w,f,u),t[e].length>0&&(this.visibleI=this.visibleI+1);let m=0;this.yRatio.length>1&&(this.yaxisIndex=a.globals.seriesYAxisReverseMap[u][0],m=u);const y=this.barHelpers.initialPositions(u),{y:w,barHeight:v,yDivision:A,zeroW:C,x:S,barWidth:k,xDivision:_,zeroH:L}=y;d=w,o=S,p.push(o+(null!=k?k:0)/2);const M=r.group({class:"apexcharts-datalabels","data:realIndex":u}),D=r.group({class:"apexcharts-bar-goals-markers"}),E=this.isBoxPlot?this.boxOptions.points:null,P=[],F=a.layout.gridWidth,T=null!=k?k:0;for(let s=0;s<a.globals.dataPoints;s++){const r=this.barHelpers.getStrokeWidth(e,s,u);let c=null;const b={indexes:{i:e,j:s,realIndex:u,translationsIndex:m},x:o,y:d,strokeWidth:r,elSeries:f};if(c=this.isHorizontal?this.drawHorizontalBoxPaths(l(n({},b),{yDivision:A,barHeight:v,zeroW:C})):this.drawVerticalBoxPaths(l(n({},b),{xDivision:_,barWidth:k,zeroH:L,cullBounds:{lo:-T,hi:F+T}})),d=c.y,o=c.x,s>0&&p.push(o+(null!=k?k:0)/2),g.push(d),c.culled)continue;const y=this.barHelpers.drawGoalLine({barXPosition:c.barXPosition,barYPosition:c.barYPosition,goalX:c.goalX,goalY:c.goalY,barHeight:v,barWidth:k});if(y&&D.add(y),c.pathTo.forEach((i,n)=>{const l=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?c.color[n]:a.globals.stroke.colors[e],g=h.fillPath({seriesNumber:u,dataPointIndex:s,color:c.color[n],value:t[e][s]});this.renderSeries({realIndex:u,pathFill:g,lineFill:l,j:s,i:e,pathFrom:c.pathFrom,pathTo:i,strokeWidth:r,elSeries:f,x:o,y:d,series:t,columnGroupIndex:x,barHeight:v,barWidth:k,elDataLabelsWrap:M,elGoalsMarkers:D,visibleSeries:this.visibleI,type:a.config.chart.type})}),E&&!1!==E.show){const t=null==(i=a.candleData.seriesBoxPoints[u])?void 0:i[s];if(t&&t.length){const e=t=>this.coreUtils.getLogValAtSeriesIndex(t,u);let i,r,o;if(this.isHorizontal){const t=this.invertedYRatio,s=null!=v?v:0,a=null!=C?C:0;i=c.barYPosition+s/2,r=s/2,o=s=>a+e(s)/t}else{const t=this.yRatio[m],s=null!=k?k:0,a=null!=L?L:0;i=c.barXPosition+s/2,r=s/2,o=s=>a-e(s)/t}const n=Ii({w:a,points:t,seedA:u,seedB:s,center:i,halfExtent:r,alongFn:o,isHorizontal:this.isHorizontal,options:E});n.length&&P.push({groups:n,j:s})}}}E&&Xi({graphics:r,w:a,elSeries:f,pointsByCat:P,options:E,distributed:a.config.plotOptions.bar.distributed,realIndex:u,wrapClass:"apexcharts-boxPlot-points-wrap",pointClass:"apexcharts-boxPlot-points"}),a.globals.seriesXvalues[u]=p,a.globals.seriesYvalues[u]=g,c.add(f)}return c}drawVerticalBoxPaths({indexes:t,x:e,xDivision:s,barWidth:i,zeroH:a,strokeWidth:r,cullBounds:o=null}){var n,l;const h=this.w,c=new gt(this.w),d=t.i,g=t.j,{colors:p}=h.config.plotOptions.candlestick,{colors:u}=this.boxOptions,x=t.realIndex,f=t=>Array.isArray(t)?t[x]:t,m=f(p.upward),b=f(p.downward),y=this.yRatio[t.translationsIndex],w=this.getOHLCValue(x,g);let v=a,A=a,C=w.o<w.c?[m]:[b];this.isBoxPlot&&(C=[f(u.lower),f(u.upper)]);let S=Math.min(w.o,w.c),k=Math.max(w.o,w.c),_=w.m;h.axisFlags.isXNumeric&&(e=(h.seriesData.seriesX[x][g]-h.globals.minX)/this.xRatio-i/2);const L=e+i*this.visibleI;if(void 0===(null==(n=this.series[d])?void 0:n[g])||null===(null==(l=this.series[d])?void 0:l[g])?(S=a,k=a):(S=a-S/y,k=a-k/y,v=a-w.h/y,A=a-w.l/y,_=a-w.m/y),o&&(L+i<o.lo||L>o.hi))return{pathTo:null,pathFrom:null,x:h.axisFlags.isXNumeric?e:e+s,y:k,barXPosition:L,color:C,culled:!0};let M;if(this.isOHLC){const t=L+i/2,e=a-w.o/y,s=a-w.c/y;M=[c.move(t,v)+c.line(t,A)+c.move(t,e)+c.line(L,e)+c.move(t,s)+c.line(L+i,s)]}else M=this.isBoxPlot?[c.move(L,S)+c.line(L+i/2,S)+c.line(L+i/2,v)+c.line(L+i/4,v)+c.line(L+i-i/4,v)+c.line(L+i/2,v)+c.line(L+i/2,S)+c.line(L+i,S)+c.line(L+i,_)+c.line(L,_)+c.line(L,S+r/2),c.move(L,_)+c.line(L+i,_)+c.line(L+i,k)+c.line(L+i/2,k)+c.line(L+i/2,A)+c.line(L+i-i/4,A)+c.line(L+i/4,A)+c.line(L+i/2,A)+c.line(L+i/2,k)+c.line(L,k)+c.line(L,_)+"z"]:[c.move(L,k)+c.line(L+i/2,k)+c.line(L+i/2,v)+c.line(L+i/2,k)+c.line(L+i,k)+c.line(L+i,S)+c.line(L+i/2,S)+c.line(L+i/2,A)+c.line(L+i/2,S)+c.line(L,S)+c.line(L,k-r/2)];let D=null;return h.globals.previousPaths.length>0&&(D=this.getPreviousPath(x,g,M[0])),null==D&&(D=c.move(L+i/2,S)+c.move(L,S)),h.axisFlags.isXNumeric||(e+=s),{pathTo:M,pathFrom:D,x:e,y:k,goalY:this.barHelpers.getGoalValues("y",null,a,d,g,t.translationsIndex),barXPosition:L,color:C}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:s,barHeight:i,zeroW:a,strokeWidth:r}){var o,n;const l=this.w,h=new gt(this.w),c=t.i,d=t.j,g=t.realIndex,{colors:p}=l.config.plotOptions.candlestick,{colors:u}=this.boxOptions,x=t=>Array.isArray(t)?t[g]:t,f=this.invertedYRatio,m=this.getOHLCValue(g,d);let b=m.o<m.c?[x(p.upward)]:[x(p.downward)];this.isBoxPlot&&(b=[x(u.lower),x(u.upper)]);let y=a,w=a,v=Math.min(m.o,m.c),A=Math.max(m.o,m.c),C=m.m;l.axisFlags.isXNumeric&&(e=(l.seriesData.seriesX[g][d]-l.globals.minX)/this.invertedXRatio-i/2);const S=e+i*this.visibleI;void 0===(null==(o=this.series[c])?void 0:o[d])||null===(null==(n=this.series[c])?void 0:n[d])?(v=a,A=a):(v=a+v/f,A=a+A/f,y=a+m.h/f,w=a+m.l/f,C=a+m.m/f);const k=[h.move(v,S)+h.line(v,S+i/2)+h.line(y,S+i/2)+h.line(y,S+i/2-i/4)+h.line(y,S+i/2+i/4)+h.line(y,S+i/2)+h.line(v,S+i/2)+h.line(v,S+i)+h.line(C,S+i)+h.line(C,S)+h.line(v+r/2,S),h.move(C,S)+h.line(C,S+i)+h.line(A,S+i)+h.line(A,S+i/2)+h.line(w,S+i/2)+h.line(w,S+i-i/4)+h.line(w,S+i/4)+h.line(w,S+i/2)+h.line(A,S+i/2)+h.line(A,S)+h.line(C,S)+"z"];let _=null;return l.globals.previousPaths.length>0&&(_=this.getPreviousPath(g,d,k[0])),null==_&&(_=h.move(v,S+i/2)+h.move(v,S)),l.axisFlags.isXNumeric||(e+=s),{pathTo:k,pathFrom:_,x:A,y:e,goalX:this.barHelpers.getGoalValues("x",a,null,c,d,0),barYPosition:S,color:b}}getOHLCValue(t,e){const s=this.w,i=this.coreUtils,a=s=>s[t]&&null!=s[t][e]?i.getLogValAtSeriesIndex(s[t][e],t):0,r=a(s.candleData.seriesCandleH),o=a(s.candleData.seriesCandleO),n=a(s.candleData.seriesCandleM),l=a(s.candleData.seriesCandleC),h=a(s.candleData.seriesCandleL);return{o:this.isBoxPlot?r:o,h:this.isBoxPlot?o:r,m:n,l:this.isBoxPlot?l:h,c:this.isBoxPlot?h:l}}}const Oi=t=>{const e=function(t){const e=[];let s=t[0],i=t[1],a=e[0]=ji(s,i),r=1;for(let o=t.length-1;r<o;r++)s=i,i=t[r+1],e[r]=.5*(a+(a=ji(s,i)));return e[r]=a,e}(t),s=t.length-1,i=[];let a,r,o,n;for(let i=0;i<s;i++)o=ji(t[i],t[i+1]),Math.abs(o)<1e-6?e[i]=e[i+1]=0:(a=e[i]/o,r=e[i+1]/o,n=a*a+r*r,n>9&&(n=3*o/Math.sqrt(n),e[i]=n*a,e[i+1]=n*r));for(let a=0;a<=s;a++)n=(t[Math.min(s,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+e[a]*e[a])),i.push([n||0,e[a]*n||0]);return i},Hi=t=>{let e="";for(let s=0;s<t.length;s++){const i=t[s],a=i.length;a>4?(e+=`C${i[0]}, ${i[1]}`,e+=`, ${i[2]}, ${i[3]}`,e+=`, ${i[4]}, ${i[5]}`):a>2&&(e+=`S${i[0]}, ${i[1]}`,e+=`, ${i[2]}, ${i[3]}`)}return e},$i={points(t){const e=Oi(t),s=t[1],i=t[0],a=[],r=e[1],o=e[0];a.push(i,[i[0]+o[0],i[1]+o[1],s[0]-r[0],s[1]-r[1],s[0],s[1]]);for(let s=2,i=e.length;s<i;s++){const i=t[s],r=e[s];a.push([i[0]-r[0],i[1]-r[1],i[0],i[1]])}return a},slice(t,e,s){const i=t.slice(e,s);if(e){if(s-e>1&&i[1].length<6){const t=i[0].length;i[1]=[2*i[0][t-2]-i[0][t-4],2*i[0][t-1]-i[0][t-3]].concat(i[1])}i[0]=i[0].slice(-2)}return i}};function ji(t,e){return(e[1]-t[1])/(e[0]-t[0])}function Gi(t){const e=[];for(let s=0;s<t.length;s+=2)e.push(t[s+1],t[s]);return e}class Vi{constructor(t,e){this.ctx=e,this.w=t}checkColorRange(){const t=this.w;let e=!1;const s=t.config.plotOptions[t.config.chart.type];return s.colorScale.ranges.length>0&&s.colorScale.ranges.map(t=>{t.from<=0&&(e=!0)}),e}getShadeColor(t,e,s,i){const a=this.w;let r=1;const o=a.config.plotOptions[t].shadeIntensity,n=this.determineColor(t,e,s);a.globals.hasNegs||i?r=a.config.plotOptions[t].reverseNegativeShade?n.percent<0?n.percent/100*(1.25*o):(1-n.percent/100)*(1.25*o):n.percent<=0?1-(1+n.percent/100)*o:(1-n.percent/100)*o:(r=1-n.percent/100,"treemap"===t&&(r=(1-n.percent/100)*(1.25*o)));let l=n.color;const h=new b;if(a.config.plotOptions[t].enableShades)if("dark"===this.w.config.theme.mode){const t=h.shadeColor(-1*r,n.color);l=b.hexToRgba(b.isColorHex(t)?t:b.rgb2hex(t),a.config.fill.opacity)}else{const t=h.shadeColor(r,n.color);l=b.hexToRgba(b.isColorHex(t)?t:b.rgb2hex(t),a.config.fill.opacity)}return{color:l,colorProps:n}}determineColor(t,e,s){const i=this.w,a=i.seriesData.series[e][s],r=i.config.plotOptions[t];let o=r.colorScale.inverse?s:e;r.distributed&&"treemap"===i.config.chart.type&&(o=s);let n=i.globals.colors[o],l=null,h=Math.min(...i.seriesData.series[e]),c=Math.max(...i.seriesData.series[e]);r.distributed||"heatmap"!==t||(h=i.globals.minY,c=i.globals.maxY),void 0!==r.colorScale.min&&(h=r.colorScale.min<i.globals.minY?r.colorScale.min:i.globals.minY,c=r.colorScale.max>i.globals.maxY?r.colorScale.max:i.globals.maxY);const d=Math.abs(c)+Math.abs(h);let g=0===d?0:100*a/d;if(r.colorScale.ranges.length>0){r.colorScale.ranges.map(t=>{if(a>=t.from&&a<=t.to){n=t.color,l=t.foreColor?t.foreColor:null,h=t.from,c=t.to;const e=Math.abs(c)+Math.abs(h);g=0===e?0:100*a/e}})}return{color:n,foreColor:l,percent:g}}calculateDataLabels({text:t,x:e,y:s,i:i,j:a,colorProps:r,fontSize:o}){const n=this.w.config.dataLabels,l=new gt(this.w),h=new yt(this.w,this.ctx);let c=null;if(n.enabled){c=l.group({class:"apexcharts-data-labels"});const d=n.offsetX,g=n.offsetY,p=e+d,u=s+parseFloat(n.style.fontSize)/3+g;h.plotDataLabelsText({x:p,y:u,text:t,i:i,j:a,color:r.foreColor,parent:c,fontSize:o,dataLabelsConfig:n})}return c}}class Ui{constructor(t){this.w=t.w,this.lineCtx=t}sameValueSeriesFix(t,e){const s=this.w;if("gradient"===s.config.fill.type||"gradient"===s.config.fill.type[t]){if(new P(this.lineCtx.w).seriesHaveSameValues(t)){const s=e[t].slice();s[s.length-1]=s[s.length-1]+1e-6,e[t]=s}}return e}calculatePoints({series:t,realIndex:e,x:s,y:i,i:a,j:r,prevY:o}){const n=this.w,l=[],h=[];let c=this.lineCtx.categoryAxisCorrection+n.config.markers.offsetX;return n.axisFlags.isXNumeric&&(c=(n.seriesData.seriesX[e][0]-n.globals.minX)/this.lineCtx.xRatio+n.config.markers.offsetX),0===r&&(l.push(c),h.push(b.isNumber(t[a][0])?o+n.config.markers.offsetY:null)),l.push(s+n.config.markers.offsetX),h.push(b.isNumber(t[a][r+1])?i+n.config.markers.offsetY:null),{x:l,y:h}}checkPreviousPaths({pathFromLine:t,pathFromArea:e,realIndex:s}){const i=this.w;for(let a=0;a<i.globals.previousPaths.length;a++){const r=i.globals.previousPaths[a];("line"===r.type||"area"===r.type)&&r.paths.length>0&&parseInt(r.realIndex,10)===parseInt(s,10)&&("line"===r.type?(this.lineCtx.appendPathFrom=!1,t=i.globals.previousPaths[a].paths[0].d):"area"===r.type&&(this.lineCtx.appendPathFrom=!1,e=i.globals.previousPaths[a].paths[0].d,i.config.stroke.show&&i.globals.previousPaths[a].paths[1]&&(t=i.globals.previousPaths[a].paths[1].d)))}return{pathFromLine:t,pathFromArea:e}}determineFirstPrevY({i:t,realIndex:e,series:s,prevY:i,lineYPosition:a,translationsIndex:r}){var o,n,l;const h=this.w,c=h.config.chart.stacked&&!h.globals.comboCharts||h.config.chart.stacked&&h.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(o=this.w.config.series[e])?void 0:o.type)||"column"===(null==(n=this.w.config.series[e])?void 0:n.type));if(void 0!==(null==(l=s[t])?void 0:l[0]))i=(a=c&&t>0?this.lineCtx.prevSeriesY[t-1][0]:this.lineCtx.zeroY)-s[t][0]/this.lineCtx.yRatio[r]+2*(this.lineCtx.isReversed?s[t][0]/this.lineCtx.yRatio[r]:0);else if(c&&t>0&&void 0===s[t][0])for(let e=t-1;e>=0;e--)if(null!==s[e][0]&&void 0!==s[e][0]){i=a=this.lineCtx.prevSeriesY[e][0];break}return{prevY:i,lineYPosition:a}}}class qi{constructor(t,e,s,i){this.ctx=e,this.w=t,this.xyRatios=s,this.xRatio=0,this.yRatio=[],this.zRatio=0,this.baseLineY=[],this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||i,this.scatter=new bt(this.w,this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new Ui(this),this.markers=new mt(this.w,this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0,this.xDivision=0,this.zeroY=0,this.areaBottomY=0,this.strokeWidth=0,this.isReversed=!1,this.appendPathFrom=!1,this.elSeries=null,this.elPointsMain=null,this.elDataLabelsWrap=null,this._elLastPointsWrap=null}draw(t,e,s,i){var a;const r=this.w,o=new gt(this.w),h=r.globals.comboCharts?e:r.config.chart.type,c=o.group({class:`apexcharts-${h}-series apexcharts-plot-series`}),d=new P(this.w);this.yRatio=this.xyRatios.yRatio,this.zRatio=this.xyRatios.zRatio,this.xRatio=this.xyRatios.xRatio,this.baseLineY=this.xyRatios.baseLineY,t=d.getLogSeries(t),this.yRatio=d.getLogYRatios(this.yRatio),this.prevSeriesY=[];const g=[];for(let e=0;e<t.length;e++){t=this.lineHelpers.sameValueSeriesFix(e,t);const a=r.globals.comboCharts?s[e]:e,o=this.yRatio.length>1?a:0;this._initSerieVariables(t,e,a);const c=[],d=[],p=[];let u=r.globals.padHorizontal+this.categoryAxisCorrection;const x=1,f=[],m=[];ce.addCollapsedClassToSeries(this.w,this.elSeries,a),r.axisFlags.isXNumeric&&r.seriesData.seriesX.length>0&&(u=(r.seriesData.seriesX[a][0]-r.globals.minX)/this.xRatio),p.push(u);const b=u;let y;const w=b;let v=this.zeroY,A=this.zeroY;const C=0;v=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:t,prevY:v,lineYPosition:C,translationsIndex:o}).prevY,"monotoneCubic"===r.config.stroke.curve&&null===t[e][0]?c.push(null):c.push(v);const S=v;let k;"rangeArea"===h&&(k=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:i,prevY:A,lineYPosition:C,translationsIndex:o}),A=k.prevY,y=A,d.push(null!==c[0]?A:null));const _=this._calculatePathsFrom({type:h,series:t,i:e,realIndex:a,translationsIndex:o,prevX:w,prevY:v,prevY2:A}),L=[c[0]],M=[d[0]],D={type:h,series:t,realIndex:a,translationsIndex:o,i:e,x:u,y:x,pX:b,pY:S,pathsFrom:_,linePaths:f,areaPaths:m,seriesIndex:s,lineYPosition:C,xArrj:p,yArrj:c,y2Arrj:d,seriesRangeEnd:i},E=this._iterateOverDataPoints(l(n({},D),{iterations:"rangeArea"===h?t[e].length-1:void 0,isRangeStart:!0}));if("rangeArea"===h){const t=this._calculatePathsFrom({series:i,i:e,realIndex:a,prevX:w,prevY:A}),s=this._iterateOverDataPoints(l(n({},D),{series:i,xArrj:[u],yArrj:L,y2Arrj:M,pY:y,areaPaths:E.areaPaths,pathsFrom:t,iterations:i[e].length-1,isRangeStart:!1})),r=E.linePaths.length/2;for(let t=0;t<r;t++)E.linePaths[t]=s.linePaths[t+r]+E.linePaths[t];E.linePaths.splice(r),E.pathFromLine=s.pathFromLine+E.pathFromLine}else/z\s*$/i.test(E.pathFromArea)||(E.pathFromArea+="z");this._handlePaths({type:h,realIndex:a,i:e,paths:E}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),g.push(this.elSeries)}if(void 0!==(null==(a=r.config.series[0])?void 0:a.zIndex)&&g.sort((t,e)=>Number(t.node.getAttribute("zIndex"))-Number(e.node.getAttribute("zIndex"))),r.config.chart.stacked)for(let t=g.length-1;t>=0;t--)c.add(g[t]);else for(let t=0;t<g.length;t++)c.add(g[t]);return c}_initSerieVariables(t,e,s){const i=this.w,a=new gt(this.w);this.xDivision=i.layout.gridWidth/(i.globals.dataPoints-("on"===i.config.xaxis.tickPlacement?1:0)),this.strokeWidth=Array.isArray(i.config.stroke.width)?i.config.stroke.width[s]:i.config.stroke.width;let r=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[s],r=s),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.zeroY=i.layout.gridHeight-this.baseLineY[r]-(this.isReversed?i.layout.gridHeight:0)+(this.isReversed?2*this.baseLineY[r]:0),this.areaBottomY=this.zeroY,(this.zeroY>i.layout.gridHeight||"end"===i.config.plotOptions.area.fillTo)&&(this.areaBottomY=i.layout.gridHeight),this.categoryAxisCorrection=this.xDivision/2;const o=i.config.series[s];if(this.elSeries=a.group({class:"apexcharts-series",zIndex:void 0!==o.zIndex?o.zIndex:s,seriesName:b.escapeString(i.seriesData.seriesNames[s])}),this.elPointsMain=a.group({class:"apexcharts-series-markers-wrap","data:realIndex":s}),this.markers.resetSeriesWrapCache(),this._elLastPointsWrap=null,i.globals.hasNullValues){const t=this.markers.plotChartMarkers({pointsPos:{x:[0],y:[i.layout.gridHeight+i.globals.markers.largestSize]},seriesIndex:e,j:0,pSize:.1,alwaysDrawMarker:!0,isVirtualPoint:!0});null!==t&&this.elPointsMain.add(t)}this.elDataLabelsWrap=a.group({class:"apexcharts-datalabels","data:realIndex":s});const n=t[e].length===i.globals.dataPoints;this.elSeries.attr({"data:longestSeries":n,rel:e+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom({type:t,series:e,i:s,realIndex:i,translationsIndex:a,prevX:r,prevY:o,prevY2:n}){const l=this.w,h=new gt(this.w);let c,d,g,p;if(null===e[s][0]){for(let t=0;t<e[s].length;t++)if(null!==e[s][t]){r=this.xDivision*t,o=this.zeroY-e[s][t]/this.yRatio[a],c=h.move(r,o),d=h.move(r,this.areaBottomY);break}}else c=h.move(r,o),"rangeArea"===t&&(c=h.move(r,n)+h.line(r,o)),d=h.move(r,this.areaBottomY)+h.line(r,o);if(g=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),p=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),l.globals.previousPaths.length>0){const t=this.lineHelpers.checkPreviousPaths({pathFromLine:g,pathFromArea:p,realIndex:i});g=t.pathFromLine,p=t.pathFromArea}return{prevX:r,prevY:o,linePath:c,areaPath:d,pathFromLine:g,pathFromArea:p}}_handlePaths({type:t,realIndex:e,i:s,paths:i}){var a,r,o,h,c,d,g;const p=this.w,u=new gt(this.w),x=xt(this.ctx,u),f=new pt(this.w);this.prevSeriesY.push(i.yArrj);let m=null;"line"!==t&&"area"!==t||!p.globals.dataChanged||(m=function(t,e,s,i){var a;const r=t.globals,o=r.prevStreamFrame;if(!o||!r.dataChanged||!(null==(a=t.axisFlags)?void 0:a.isXNumeric))return null;const n=o.seriesX[e],l=o.seriesY[e],h=t.seriesData.seriesX[e],c=t.seriesData.series[e];if(!(n&&l&&h&&c))return null;if(n.length<3||h.length<3)return null;let d=-1;for(let t=0;t<n.length;t++)if(n[t]===h[0]){d=t;break}if(-1===d)return null;const g=Math.min(n.length-d,h.length);if(g<2)return null;const p=h.length-g;if(0===d&&0===p)return null;for(let t=0;t<g;t++){if(n[d+t]!==h[t])return null;const e=l[d+t],s=c[t];if(e!==s&&(null!=e||null!=s))return null}const u=o.xPixels[e],x=o.yPixels[e];if(!u||!x)return null;let f=-1,m=-1;for(let t=0;t<g;t++)null!=u[d+t]&&null!=x[d+t]&&null!=s[t]&&null!=i[t]&&(-1===f&&(f=t),m=t);if(-1===f||m<=f)return null;const b=s[f],y=s[m],w=u[d+f],v=u[d+m];if(Math.abs(y-b)<1e-6)return null;const A=(v-w)/(y-b),C=w-A*b;if(!isFinite(A)||!isFinite(C))return null;if(Math.abs(A-1)>.02)return null;if(Math.abs(C)<.5)return null;let S=f,k=f;for(let t=f;t<=m;t++){const e=i[t];null!=e&&null!=x[d+t]&&(e<i[S]&&(S=t),e>i[k]&&(k=t))}let _=1,L=0;const M=i[S],D=i[k];if(Math.abs(D-M)>1e-6?(_=(x[d+k]-x[d+S])/(D-M),L=x[d+S]-_*M):L=x[d+S]-M,!isFinite(_)||!isFinite(L)||_<.2||_>5)return null;const E=Math.floor((f+m)/2);if(E!==f&&E!==m&&null!=s[E]&&null!=u[d+E]){const t=A*s[E]+C;if(Math.abs(t-u[d+E])>1.5)return null;if(null!=i[E]&&null!=x[d+E]){const t=_*i[E]+L;if(Math.abs(t-x[d+E])>1.5)return null}}return{ax:A,bx:C,ay:_,by:L}}(p,e,i.xArrj,i.yArrj));let b=null;m||"line"!==t&&"area"!==t||(b=Ut(p,{type:t,realIndex:e,pathFromLine:i.pathFromLine,pathFromArea:i.pathFromArea,linePaths:i.linePaths,areaPaths:i.areaPaths})),p.globals.seriesXvalues[e]=i.xArrj,p.globals.seriesYvalues[e]=i.yArrj;const y=p.config.forecastDataPoints;if(y.count>0&&"rangeArea"!==t){const t=p.globals.seriesXvalues[e][p.globals.seriesXvalues[e].length-y.count-1],s=u.drawRect(t,0,p.layout.gridWidth,p.layout.gridHeight,0);p.dom.elForecastMask.appendChild(s.node);const i=u.drawRect(0,0,t,p.layout.gridHeight,0);p.dom.elNonForecastMask.appendChild(i.node)}this.pointsChart?Vt(p,{elPointsMain:this.elPointsMain,realIndex:e,speed:p.config.chart.animations.dynamicAnimation.speed}):(p.globals.delayedElements.push({el:this.elPointsMain.node,index:e}),Vt(p,{elPointsMain:this.elPointsMain,realIndex:e,speed:p.config.chart.animations.dynamicAnimation.speed}),$t(p,e)&&(null==(a=this.elDataLabelsWrap)?void 0:a.node)&&(this.elDataLabelsWrap.node.classList.add("apexcharts-element-hidden"),p.globals.delayedElements.push({el:this.elDataLabelsWrap.node,holdUntilComplete:!0})));const w={i:s,realIndex:e,animationDelay:s,initialSpeed:p.config.chart.animations.speed,dataChangeSpeed:p.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${t}`},v=i.numericXY;if("area"===t){const t=f.fillPath({seriesNumber:e});for(let e=0;e<i.areaPaths.length;e++){const s=x.renderPaths(l(n({},w),{pathFrom:m?It(i.areaPaths[e],m):null!=(o=null==(r=null==b?void 0:b.area)?void 0:r.from)?o:i.pathFromArea,pathTo:i.areaPaths[e],pathToNumeric:v?{xs:v.xs,ys:v.ys,closeY:v.areaCloseY}:void 0,pathToInterp:null==(h=null==b?void 0:b.area)?void 0:h.toInterp,scrollMorph:!!m,stroke:"none",strokeWidth:0,strokeLineCap:null,fill:t}));this.elSeries.add(s)}}if(p.config.stroke.show&&!this.pointsChart){let a=null;if("line"===t)a=f.fillPath({seriesNumber:e,i:s});else if("solid"===p.config.stroke.fill.type)a=p.globals.stroke.colors[e];else{const t=p.config.fill;p.config.fill=p.config.stroke.fill,a=f.fillPath({seriesNumber:e,i:s}),p.config.fill=t}for(let s=0;s<i.linePaths.length;s++){let r=a;"rangeArea"===t&&(r=f.fillPath({seriesNumber:e}));const o=l(n({},w),{pathFrom:m?It(i.linePaths[s],m):null!=(d=null==(c=null==b?void 0:b.line)?void 0:c.from)?d:i.pathFromLine,pathTo:i.linePaths[s],pathToNumeric:v?{xs:v.xs,ys:v.ys}:void 0,pathToInterp:null==(g=null==b?void 0:b.line)?void 0:g.toInterp,scrollMorph:!!m,stroke:a,strokeWidth:this.strokeWidth,strokeLineCap:p.config.stroke.lineCap,fill:"rangeArea"===t?r:"none"}),h=x.renderPaths(o);if(this.elSeries.add(h),h.attr("fill-rule","evenodd"),y.count>0&&"rangeArea"!==t){const t=x.renderPaths(o);t.node.setAttribute("stroke-dasharray",y.dashArray),y.strokeWidth&&t.node.setAttribute("stroke-width",y.strokeWidth),this.elSeries.add(t),t.attr("clip-path",`url(#forecastMask${p.globals.cuid})`),h.attr("clip-path",`url(#nonForecastMask${p.globals.cuid})`)}}}}_iterateOverDataPoints({type:t,series:e,iterations:s,realIndex:i,translationsIndex:a,i:r,x:o,y:n,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:g,seriesIndex:p,lineYPosition:u,xArrj:x,yArrj:f,y2Arrj:m,isRangeStart:y,seriesRangeEnd:w}){var v,A;const C=this.w,S=new gt(this.w),k=this.yRatio;let{prevY:_,linePath:L,areaPath:M,pathFromLine:D,pathFromArea:E}=c;const P=b.isNumber(C.globals.minYArr[i])?C.globals.minYArr[i]:C.globals.minY;s||(s=C.globals.dataPoints>1?C.globals.dataPoints-1:C.globals.dataPoints);const F=(t,e)=>e-t/k[a]+2*(this.isReversed?t/k[a]:0);let T=n;const I=C.config.chart.stacked&&!C.globals.comboCharts||C.config.chart.stacked&&C.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(v=this.w.config.series[i])?void 0:v.type)||"column"===(null==(A=this.w.config.series[i])?void 0:A.type));let X=C.config.stroke.curve;Array.isArray(X)&&(X=Array.isArray(p)?X[p[r]]:X[r]);let R,z=0;const B=this.pointsChart?this._scatterJitterPx(i):null;if("straight"===X&&!this.pointsChart){const p=this._fastStraightPath({type:t,series:e,i:r,realIndex:i,translationsIndex:a,iterations:s,x:o,y:n,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:g,xArrj:x,yArrj:f,y2Arrj:m,stackSeries:I});if(p)return p}for(let a=0;a<s&&0!==e[r].length;a++){const c=void 0===e[r][a+1]||null===e[r][a+1];if(C.axisFlags.isXNumeric){let t=C.seriesData.seriesX[i][a+1];void 0===C.seriesData.seriesX[i][a+1]&&(t=C.seriesData.seriesX[i][s-1]),o=(t-C.globals.minX)/this.xRatio}else o+=this.xDivision;if(I)if(r>0&&C.globals.collapsedSeries.length<C.config.series.length-1){const t=t=>{for(let e=t;e>0;e--){if(!(C.globals.collapsedSeriesIndices.indexOf((null==p?void 0:p[e])||e)>-1))return e;e--}return 0};u=this.prevSeriesY[t(r-1)][a+1]}else u=this.zeroY;else u=this.zeroY;c?n=F(P,u):(n=F(e[r][a+1],u),"rangeArea"===t&&(T=F(w[r][a+1],u)));let b=o,v=n;if(B){const t=100003*i+(a+1);B.x&&(b=o+2*(Bi(7919*t+13)-.5)*B.x),B.y&&(v=n+2*(Bi(6271*t+97)-.5)*B.y)}x.push(null===e[r][a+1]?null:b),!c||"smooth"!==C.config.stroke.curve&&"monotoneCubic"!==C.config.stroke.curve?(f.push(v),m.push(T)):(f.push(null),m.push(null));const A=this.lineHelpers.calculatePoints({series:e,x:b,y:v,realIndex:i,i:r,j:a,prevY:_}),k=this._createPaths({type:t,series:e,i:r,j:a,x:o,y:n,y2:T,xArrj:x,yArrj:f,y2Arrj:m,pX:l,pY:h,pathState:z,segmentStartX:R,linePath:L,areaPath:M,linePaths:d,areaPaths:g,curve:X,isRangeStart:y});g=k.areaPaths,d=k.linePaths,l=k.pX,h=k.pY,z=k.pathState,R=k.segmentStartX,M=k.areaPath,L=k.linePath,!this.appendPathFrom||C.globals.hasNullValues||"monotoneCubic"===X&&"rangeArea"===t||(D+=S.line(o,this.areaBottomY),E+=S.line(o,this.areaBottomY)),this.handleNullDataPoints(e,A,r,a,i),this._handleMarkersAndLabels({type:t,pointsPos:A,i:r,j:a,realIndex:i,isRangeStart:y})}return{yArrj:f,xArrj:x,pathFromArea:E,areaPaths:g,pathFromLine:D,linePaths:d,linePath:L,areaPath:M}}_handleMarkersAndLabels({type:t,pointsPos:e,isRangeStart:s,i:i,j:a,realIndex:r}){const o=this.w,n=new yt(this.w,this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:r,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{!(!o.globals.dataChanged&&!o.globals.resized)&&o.seriesData.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");const t=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:r,j:a+1});null!==t&&t!==this._elLastPointsWrap&&(this.elPointsMain.add(t),this._elLastPointsWrap=t)}const l=n.drawDataLabel({type:t,isRangeStart:s,pos:e,i:r,j:a+1});null!==l&&this.elDataLabelsWrap.add(l)}_scatterJitterPx(t){var e;const s=this.w,i=null==(e=s.config.plotOptions.scatter)?void 0:e.jitter;if(!i||!i.enabled||!i.x&&!i.y)return null;const a=s.axisFlags.isXNumeric&&this.xRatio?1/this.xRatio:this.xDivision,r=this.yRatio.length>1?t:0,o=this.yRatio[r]?1/this.yRatio[r]:0;return{x:(i.x||0)*a,y:(i.y||0)*o}}_fastStraightPath({type:t,series:e,i:s,realIndex:i,translationsIndex:a,iterations:r,x:o,y:n,pX:l,pY:h,pathsFrom:c,linePaths:d,areaPaths:g,xArrj:p,yArrj:u,y2Arrj:x,stackSeries:f}){const m=this.w;if("line"!==t&&"area"!==t)return null;if(m.globals.comboCharts||f)return null;if(m.config.dataLabels.enabled)return null;if(m.config.markers.discrete.length)return null;if(m.globals.markers.size[i]>0)return null;const b=e[s],y=b.length;if(!r||y<2||y-1!==r)return null;for(let t=0;t<=r;t++){const e=b[t];if(null==e)return null}const w=m.axisFlags.isXNumeric,v=w?m.seriesData.seriesX[i]:null;if(w&&(!v||v.length<y))return null;const A=this.yRatio[a],C=this.isReversed,S=this.zeroY,k=this.areaBottomY,_=this.xRatio,L=m.globals.minX,M=this.xDivision,D=m.config.markers.offsetX,E=m.config.markers.offsetY,P=this.appendPathFrom&&!m.globals.hasNullValues;let{pathFromLine:F,pathFromArea:T}=c;const I=this.ctx&&this.ctx.renderer,X=!(!I||!I.kind||"svg"===I.kind),R=!X||m.globals.dataChanged,z=X?new Float64Array(y):null,B=X?new Float64Array(y):null;z&&B&&(z[0]=l,B[0]=h),void 0===m.globals.pointsArray[i]&&(m.globals.pointsArray[i]=[]);const Y=m.globals.pointsArray[i],N=v?(v[0]-L)/_+D:this.categoryAxisCorrection+D;Y.push([N,c.prevY+E]);const W=R?new Array(r+1):[];R&&(W[0]="M "+l+" "+h);const O=R&&P?new Array(r):null;let H=o,$=l,j=h;for(let t=0;t<r;t++){v?$=(v[t+1]-L)/_:(H+=M,$=H);const e=b[t+1];j=S-e/A+2*(C?e/A:0),p.push($),u.push(j),x.push(n),Y.push([$+D,j+E]),R&&(W[t+1]=" L "+$+" "+j,O&&(O[t]=" L "+$+" "+k)),z&&B&&(z[t+1]=$,B[t+1]=j)}let G="",V="";if(R&&(G=W.join(""),V=G+" L "+$+" "+k+" L "+l+" "+k+"z"),O){const t=O.join("");F+=t,T+=t}else!R&&P&&(F+=" L "+$+" "+k,T+=" L "+$+" "+k);return d.push(G),g.push(V),{yArrj:u,xArrj:p,pathFromArea:T,areaPaths:g,pathFromLine:F,linePaths:d,linePath:G,areaPath:V,numericXY:z?{xs:z,ys:B,areaCloseY:k}:void 0}}_createPaths({type:t,series:e,i:s,j:i,x:a,y:r,xArrj:o,yArrj:n,y2:l,y2Arrj:h,pX:c,pY:d,pathState:g,segmentStartX:p,linePath:u,areaPath:x,linePaths:f,areaPaths:m,curve:b,isRangeStart:y}){const w=new gt(this.w),v=this.areaBottomY,A="rangeArea"===t,C="rangeArea"===t&&y;switch(b){case"monotoneCubic":{const t=y?n:h,a=(t,e)=>t.map((t,s)=>[t,e[s]]).filter(t=>null!==t[1]),r=t=>{const e=[];let s=0;return t.forEach(t=>{null!==t?s++:s>0&&(e.push(s),s=0)}),s>0&&e.push(s),e},l=(t,e)=>{const s=r(t),i=[];for(let t=0,a=0;t<s.length;a+=s[t++])i[t]=$i.slice(e,a,a+s[t]);return i};switch(g){case 0:if(null===t[i+1])break;g=1;case 1:if(!(A?o.length===e[s].length:i===e[s].length-2))break;case 2:{const e=y?o:o.slice().reverse(),s=y?t:t.slice().reverse(),i=a(e,s),r=i.length>1?$i.points(i):i;let n=[];A&&(C?m=i:n=m.reverse());let h=0,c=0;if(l(s,r).forEach(t=>{h++;const e=Hi(t),s=c;c+=t.length;const a=c-1;C?u=w.move(i[s][0],i[s][1])+e:A?u=w.move(n[s][0],n[s][1])+w.line(i[s][0],i[s][1])+e+w.line(n[a][0],n[a][1]):(u=w.move(i[s][0],i[s][1])+e,x=u+w.line(i[a][0],v)+w.line(i[s][0],v)+"z",m.push(x)),f.push(u)}),A&&h>1&&!C){const t=f.slice(h).reverse();f.splice(h),t.forEach(t=>f.push(t))}g=0;break}}break}case"smooth":{const t=.35*(a-c);if(null===e[s][i])g=0;else switch(g){case 0:if(p=c,u=C?w.move(c,h[i])+w.line(c,d):w.move(c,d),x=w.move(c,d),null===e[s][i+1]||void 0===e[s][i+1]){f.push(u),m.push(x);break}if(g=1,i<e[s].length-2){const e=w.curve(c+t,d,a-t,r,a,r);u+=e,x+=e;break}case 1:if(null===e[s][i+1])u+=C?w.line(c,l):w.move(c,d),x+=w.line(c,v)+w.line(p,v)+"z",f.push(u),m.push(x),g=-1;else{const o=w.curve(c+t,d,a-t,r,a,r);u+=o,x+=o,i>=e[s].length-2&&(C&&(u+=w.curve(a,r,a,r,a,l)+w.move(a,l)),x+=w.curve(a,r,a,r,a,v)+w.line(p,v)+"z",f.push(u),m.push(x),g=-1)}}c=a,d=r;break}default:{const t=(t,e,s)=>{let i="";switch(t){case"stepline":i=w.line(e,null,"H")+w.line(null,s,"V");break;case"linestep":i=w.line(null,s,"V")+w.line(e,null,"H");break;case"straight":i=w.line(e,s)}return i};if(null===e[s][i])g=0;else switch(g){case 0:if(p=c,u=C?w.move(c,h[i])+w.line(c,d):w.move(c,d),x=w.move(c,d),null===e[s][i+1]||void 0===e[s][i+1]){f.push(u),m.push(x);break}if(g=1,i<e[s].length-2){const e=t(b,a,r);u+=e,x+=e;break}case 1:if(null===e[s][i+1])u+=C?w.line(c,l):w.move(c,d),x+=w.line(c,v)+w.line(p,v)+"z",f.push(u),m.push(x),g=-1;else{const o=t(b,a,r);u+=o,x+=o,i>=e[s].length-2&&(C&&(u+=w.line(a,l)),x+=w.line(a,v)+w.line(p,v)+"z",f.push(u),m.push(x),g=-1)}}c=a,d=r;break}}return{linePaths:f,areaPaths:m,pX:c,pY:d,pathState:g,segmentStartX:p,linePath:u,areaPath:x}}handleNullDataPoints(t,e,s,i,a){const r=this.w;if(null===t[s][i]&&r.config.markers.showNullDataPoints||1===t[s].length){let t=this.strokeWidth-r.config.markers.strokeWidth/2;t>0||(t=0);const s=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:i+1,pSize:t,alwaysDrawMarker:!0});null!==s&&this.elPointsMain.add(s)}}}class Zi{constructor(t){this.w=t}drawYAxisTexts(t,e,s,i){const a=this.w,r=a.config.yaxis[0],o=a.formatters.yLabelFormatters[0];return new gt(this.w).drawText({x:t+r.labels.offsetX,y:e+r.labels.offsetY,text:o(i,s),textAnchor:"middle",fontSize:r.labels.style.fontSize,fontFamily:r.labels.style.fontFamily,foreColor:Array.isArray(r.labels.style.colors)?r.labels.style.colors[s]:r.labels.style.colors})}getMaxLabelWidth(t,{fontSize:e,fontFamily:s}={}){const i=new gt(this.w);let a=0;return t.forEach(t=>{if(null==t||""===t)return;const r=i.getTextRects(`${t}`,e||"12px",s,"");a=Math.max(a,r.width)}),a}drawExternalLabel({lines:t,lineHeight:e,anchor:s,elbow:i,labelX:a,labelY:r,side:o,connector:n,style:l,foreColor:h}){const c=new gt(this.w),d=c.group({class:"apexcharts-pie-name-label-group"});if(n.show){const t=`M ${s.x} ${s.y} L ${i.x} ${i.y} L ${a} ${r}`,e=c.drawPath({d:t,stroke:n.color,strokeWidth:n.width,fill:"none",strokeLinecap:"round"});e.node.classList.add("apexcharts-pie-label-connector"),d.add(e)}const g="right"===o?a+4:a-4,p=t.length,u=r-(p-1)*e/2,x=c.drawText({x:g,y:u,text:1===p?t[0]:t,textAnchor:"right"===o?"start":"end",fontSize:l.fontSize,fontFamily:l.fontFamily,fontWeight:l.fontWeight,foreColor:h,dominantBaseline:"central",cssClass:"apexcharts-pie-name-label"});if(p>1){const t=x.node.getElementsByTagName("tspan");for(let s=0;s<t.length;s++)t[s].setAttribute("x",`${g}`),t[s].setAttribute("dy",0===s?"0":`${e}`)}return d.add(x),d}}class Ki{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animBeginArr=[0],this.animDur=0,this.donutDataLabels=this.w.config.plotOptions.pie.donut.labels,this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=Math.min(t.layout.gridWidth,t.layout.gridHeight),this.centerY=this.defaultSize/2,this.centerX=t.layout.gridWidth/2,"radialBar"===t.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(t.config.plotOptions.pie.endAngle-t.config.plotOptions.pie.startAngle),this.initialAngle=t.config.plotOptions.pie.startAngle%this.fullAngle,t.globals.radialSize=this.defaultSize/2.05-t.config.stroke.width-(t.config.chart.sparkline.enabled?0:t.config.chart.dropShadow.blur),this.externalCfg=t.config.plotOptions.pie.dataLabels.external;const s=t.config.dataLabels.style;this.externalLabelStyle={fontSize:this.externalCfg.fontSize||s.fontSize,fontFamily:this.externalCfg.fontFamily||s.fontFamily,fontWeight:this.externalCfg.fontWeight||s.fontWeight},this.externalLabels=[],this.externalLabelMaxLines=1,this.externalLabelLineH=parseFloat(this.externalLabelStyle.fontSize)||12,t.globals.pieExternalLabelMarginY=0,this.showExternalLabels=this.externalCfg.show&&"polarArea"!==this.chartType,this.showExternalLabels&&!t.globals.noData&&this.reserveExternalLabelSpace(),this.donutSize=t.globals.radialSize*parseInt(t.config.plotOptions.pie.donut.size,10)/100;const i=t.config.plotOptions.pie.customScale,a=t.layout.gridWidth/2,r=t.layout.gridHeight/2;this.translateX=a-a*i,this.translateY=r-r*i,this.dataLabelsGroup=new gt(this.w).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${i})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}getExternalLabelText(t){var e,s,i;const a=this.w,r=a.seriesData.seriesNames[t],o=this.externalCfg.formatter;return"function"==typeof o?o(r,{seriesIndex:t,percent:null==(s=null==(e=a.globals.seriesPercent)?void 0:e[t])?void 0:s[0],value:null==(i=a.globals.seriesTotals)?void 0:i[t],w:a}):null==r?"":`${r}`}getExternalLabelLines(t){const e=this.getExternalLabelText(t);return(Array.isArray(e)?e:`${null==e?"":e}`.split("\n")).map(t=>null==t?"":`${t}`)}reserveExternalLabelSpace(){const t=this.w,e=new Zi(t),s=(t.seriesData.seriesNames||[]).map((t,e)=>this.getExternalLabelLines(e)),i=e.getMaxLabelWidth(s.flat(),{fontSize:this.externalLabelStyle.fontSize,fontFamily:this.externalLabelStyle.fontFamily});this.externalLabelMaxLines=s.reduce((t,e)=>Math.max(t,e.length),1),this.externalLabelLineH=Math.round(1.35*(parseFloat(this.externalLabelStyle.fontSize)||12));const a=this.externalCfg.connector,r=this.externalLabelMaxLines*this.externalLabelLineH,o=i+(a.length||0)+(a.gap||0)+12,n=r/2+(a.gap||0)+6,l=Math.min(t.globals.radialSize,t.layout.gridWidth/2-o,t.layout.gridHeight/2-n);t.globals.radialSize=Math.max(l,.15*this.defaultSize),t.globals.pieExternalLabelMarginY=n;const h=t.config.chart.height?String(t.config.chart.height):"",c=""!==h&&"auto"!==h;this.centerY=c?t.layout.gridHeight/2:t.globals.radialSize+n}draw(t){var e;const s=this.w,i=new gt(this.w),a=i.group({class:"apexcharts-pie"});if(s.globals.noData)return a;let r=0;for(let e=0;e<t.length;e++)r+=b.negToZero(t[e]);const o=[],n=i.group();0===r&&(r=1e-5),t.forEach(t=>{this.maxY=Math.max(this.maxY,t)}),s.config.yaxis[0].max&&(this.maxY=s.config.yaxis[0].max),"back"===s.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(a);for(let e=0;e<t.length;e++){const i=this.fullAngle*b.negToZero(t[e])/r;o.push(i),"polarArea"===this.chartType?(o[e]=this.fullAngle/t.length,this.sliceSizes.push(s.globals.radialSize*t[e]/this.maxY)):this.sliceSizes.push(s.globals.radialSize)}const l=!0===(null==(e=this.ctx.morphTypeChange)?void 0:e.isActive());if(s.globals.dataChanged&&!l){let t,e=0;for(let t=0;t<s.globals.previousPaths.length;t++)e+=b.negToZero(s.globals.previousPaths[t]);for(let i=0;i<s.globals.previousPaths.length;i++)t=this.fullAngle*b.negToZero(s.globals.previousPaths[i])/e,this.prevSectorAngleArr.push(t)}if(this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const t=i.drawCircle(this.donutSize);t.attr({cx:this.centerX,cy:this.centerY,fill:s.config.plotOptions.pie.donut.background?s.config.plotOptions.pie.donut.background:"transparent"}),n.add(t)}const h=this.drawArcs(o,t);if(this.sliceLabels.forEach(t=>{h.add(t)}),n.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${s.config.plotOptions.pie.customScale})`}),n.add(h),a.add(n),this.donutDataLabels.show){const t=this.initialAnim&&!s.globals.resized&&!s.globals.dataChanged&&this.animDur>0,e=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:t?0:this.donutDataLabels.show});if(t){const t=this.dataLabelsGroup.node;t.style.transition="opacity 280ms ease-out",setTimeout(()=>{t.style.opacity="1"},this.animDur)}a.add(e)}return"front"===s.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(a),a}drawArcs(t,e){var s,i;const a=this.w,r=new dt(this.w),o=new gt(this.w),n=new pt(this.w),l=o.group({class:"apexcharts-slices"});let h=this.initialAngle,d=this.initialAngle,g=this.initialAngle,p=this.initialAngle;this.strokeWidth=a.config.stroke.show?a.config.stroke.width:0;const u=!0===(null==(s=this.ctx.morphTypeChange)?void 0:s.isActive());for(let s=0;s<t.length;s++){const c=o.group({class:"apexcharts-series apexcharts-pie-series",seriesName:b.escapeString(a.seriesData.seriesNames[s]),rel:s+1,"data:realIndex":s});l.add(c),h=g,d=p,g=h+t[s],p=d+this.prevSectorAngleArr[s];const x=g<h?this.fullAngle+g-h:g-h,f=n.fillPath({seriesNumber:s,size:this.sliceSizes[s],value:e[s]}),m=u?this.ctx.morphTypeChange.getInitialPathFor(s,0):null,y=m||this.getChangedPath(d,p),w=o.drawPath({d:y,stroke:Array.isArray(this.lineColorArr)?null!=(i=this.lineColorArr[s])?i:this.lineColorArr[s%this.lineColorArr.length]:this.lineColorArr,strokeWidth:0,fill:f,fillOpacity:a.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${s}`});if(w.attr({index:0,j:s}),r.setSelectionFilter(w,0,s),a.config.chart.dropShadow.enabled){const t=a.config.chart.dropShadow;r.dropShadow(w,t,s)}this.addListeners(w,this.donutDataLabels);let v={x:0,y:0};const A=(h+x/2)%this.fullAngle;let C={x:this.centerX,y:this.centerY};"pie"===this.chartType||"polarArea"===this.chartType?(v=b.polarToCartesian(this.centerX,this.centerY,a.globals.radialSize/1.25+a.config.plotOptions.pie.dataLabels.offset,A),C=b.polarToCartesian(this.centerX,this.centerY,a.globals.radialSize/2,A)):"donut"===this.chartType&&(v=b.polarToCartesian(this.centerX,this.centerY,(a.globals.radialSize+this.donutSize)/2+a.config.plotOptions.pie.dataLabels.offset,A),C=b.polarToCartesian(this.centerX,this.centerY,(a.globals.radialSize+this.donutSize)/2,A)),gt.setAttrs(w.node,{"data:angle":x,"data:startAngle":h,"data:strokeWidth":this.strokeWidth,"data:value":e[s],"data:cx":C.x,"data:cy":C.y}),c.add(w);let S=0;if(!this.initialAnim||a.globals.resized||a.globals.dataChanged?this.animBeginArr.push(0):(S=x/this.fullAngle*a.config.chart.animations.speed,0===S&&(S=1),this.animDur=S+this.animDur,this.animBeginArr.push(this.animDur)),u&&m){const t=this.getPiePath({me:this,startAngle:h,angle:x,size:this.sliceSizes[s]}),e=this.ctx.morphTypeChange.getSpeed(),i=this.ctx.animations;w.node.setAttribute("data:pathOrig",t);const a=w.animate(e).plot(t,"polygons").attr({"stroke-width":this.strokeWidth});a&&"function"==typeof a.after?a.after(()=>i.animationCompleted(w)):i.animationCompleted(w)}else this.dynamicAnim&&a.globals.dataChanged?this.animatePaths(w,{size:this.sliceSizes[s],endAngle:g,startAngle:h,prevStartAngle:d,prevEndAngle:p,animateStartingPos:!0,i:s,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:a.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(w,{size:this.sliceSizes[s],endAngle:g,startAngle:h,i:s,totalItems:t.length-1,animBeginArr:this.animBeginArr,dur:S});if(a.config.plotOptions.pie.expandOnClick&&"polarArea"!==this.chartType&&w.node.addEventListener("mouseup",this.pieClicked.bind(this,s)),void 0!==a.interact.selectedDataPoints[0]&&a.interact.selectedDataPoints[0].indexOf(s)>-1)if(this.initialAnim&&!a.globals.resized&&!a.globals.dataChanged&&this.animDur>0){const t=this,e=s;setTimeout(()=>t.pieClicked(e),this.animDur)}else this.pieClicked(s);if(a.config.dataLabels.enabled){const e=v.x,i=v.y;let n=100*x/this.fullAngle+"%";if(0!==x&&a.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[s]){const t=a.config.dataLabels.formatter;void 0!==t&&(n=t(a.globals.seriesPercent[s][0],{seriesIndex:s,w:a}));const l=a.globals.dataLabels.style.colors[s],h=o.group({class:"apexcharts-datalabels"}),c=o.drawText({x:e,y:i,text:n,textAnchor:"middle",fontSize:a.config.dataLabels.style.fontSize,fontFamily:a.config.dataLabels.style.fontFamily,fontWeight:a.config.dataLabels.style.fontWeight,foreColor:l});if(h.add(c),a.config.dataLabels.dropShadow.enabled){const t=a.config.dataLabels.dropShadow;r.dropShadow(c,t)}c.node.classList.add("apexcharts-pie-label"),a.config.chart.animations.animate&&!1===a.globals.resized&&(c.node.classList.add("apexcharts-pie-label-delay"),c.node.style.animationDelay=a.config.chart.animations.speed/940+"s"),this.sliceLabels.push(h)}}if(this.showExternalLabels&&0!==x){const t=this.getExternalLabelLines(s);if(t.some(t=>""!==t)){const e=b.polarToCartesian(this.centerX,this.centerY,a.globals.radialSize,A),i=b.polarToCartesian(this.centerX,this.centerY,a.globals.radialSize+(this.externalCfg.connector.gap||0),A),r=i.x>=this.centerX,o=r?i.x+(this.externalCfg.connector.length||0):i.x-(this.externalCfg.connector.length||0);this.externalLabels.push({lines:t,anchor:e,elbow:i,side:r?"right":"left",labelX:o+parseFloat(this.externalCfg.offsetX||0),idealY:i.y+parseFloat(this.externalCfg.offsetY||0),connectorColor:this.externalCfg.connector.color||a.globals.colors[s],foreColor:this.externalCfg.color||a.config.chart.foreColor})}}}if(this.showExternalLabels&&this.externalLabels.length){this.placeExternalLabels();const t=c.isBrowser()&&(u||this.dynamicAnim&&a.globals.dataChanged||this.initialAnim&&!a.globals.resized&&!a.globals.dataChanged);this.externalLabels.forEach(e=>{const s=new Zi(a).drawExternalLabel({lines:e.lines,lineHeight:this.externalLabelLineH,anchor:e.anchor,elbow:e.elbow,labelX:e.labelX,labelY:e.labelY,side:e.side,connector:{show:this.externalCfg.connector.show,width:this.externalCfg.connector.width,color:e.connectorColor},style:this.externalLabelStyle,foreColor:e.foreColor});t&&(s.node.classList.add("apexcharts-element-hidden"),a.globals.delayedElements.push({el:s.node})),l.add(s)})}return l}placeExternalLabels(){const t=this.w,e=this.externalLabelMaxLines*this.externalLabelLineH+2,s=this.centerY+t.globals.radialSize+t.globals.pieExternalLabelMarginY;["left","right"].forEach(t=>{const i=this.externalLabels.filter(e=>e.side===t).sort((t,e)=>t.idealY-e.idealY);i.forEach(t=>{t.labelY=t.idealY});for(let t=1;t<i.length;t++)i[t].labelY-i[t-1].labelY<e&&(i[t].labelY=i[t-1].labelY+e);const a=i[i.length-1],r=a?a.labelY-s:0;if(r>0)for(let t=i.length-1;t>=0;t--)i[t].labelY-=r,t<i.length-1&&i[t+1].labelY-i[t].labelY<e&&(i[t].labelY=i[t+1].labelY-e)})}addListeners(t,e){const s=new gt(this.w);t.node.addEventListener("mouseenter",s.pathMouseEnter.bind(this,t)),t.node.addEventListener("mouseleave",s.pathMouseLeave.bind(this,t)),t.node.addEventListener("mouseleave",this.revertDataLabelsInner.bind(this)),t.node.addEventListener("mousedown",s.pathMouseDown.bind(this,t)),this.donutDataLabels.total.showAlways||(t.node.addEventListener("mouseenter",this.printDataLabelsInner.bind(this,t.node,e)),t.node.addEventListener("mousedown",this.printDataLabelsInner.bind(this,t.node,e)))}animatePaths(t,e){const s=this.w;let i=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,a=i,r=e.startAngle;const o=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(r=e.prevEndAngle,a=e.prevEndAngle<e.prevStartAngle?this.fullAngle+e.prevEndAngle-e.prevStartAngle:e.prevEndAngle-e.prevStartAngle),e.i===s.config.series.length-1&&(i+o>this.fullAngle?e.endAngle=e.endAngle-(i+o):i+o<this.fullAngle&&(e.endAngle=e.endAngle+(this.fullAngle-(i+o)))),i===this.fullAngle&&(i=this.fullAngle-.01),this.animateArc(t,r,o,i,a,e)}animateArc(t,e,s,i,a,r){const o=this,n=this.w,l=new ct(this.w),h=r.size;let c;(isNaN(e)||isNaN(a))&&(e=s,a=i,r.dur=0);let d=i,g=s;const p=e<s?this.fullAngle+e-s:e-s;n.globals.dataChanged&&r.shouldSetPrevPaths&&r.prevEndAngle&&(c=o.getPiePath({me:o,startAngle:r.prevStartAngle,angle:r.prevEndAngle<r.prevStartAngle?this.fullAngle+r.prevEndAngle-r.prevStartAngle:r.prevEndAngle-r.prevStartAngle,size:h}),t.attr({d:c})),0!==r.dur?t.animate(r.dur,r.animBeginArr[r.i]).after(function(){"pie"!==o.chartType&&"donut"!==o.chartType&&"polarArea"!==o.chartType||this.animate(n.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":o.strokeWidth}),r.i===n.config.series.length-1&&l.animationCompleted(t)}).during(n=>{d=p+(i-p)*n,r.animateStartingPos&&(d=a+(i-a)*n,g=e-a+(s-(e-a))*n),c=o.getPiePath({me:o,startAngle:g,angle:d,size:h}),t.node.setAttribute("data:pathOrig",c),t.attr({d:c})}):(c=o.getPiePath({me:o,startAngle:g,angle:i,size:h}),r.isTrack||(n.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",c),t.attr({d:c,"stroke-width":o.strokeWidth}))}pieClicked(t){const e=this.w,s=this,i=s.sliceSizes[t]+(e.config.plotOptions.pie.expandOnClick?4:0),a=e.dom.Paper.findOne(`.apexcharts-${s.chartType.toLowerCase()}-slice-${t}`);if("true"===a.attr("data:pieClicked")){a.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner();const t=a.attr("data:pathOrig");return void a.attr({d:t})}{const s=e.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(s,t=>{t.setAttribute("data:pieClicked","false");const e=t.getAttribute("data:pathOrig");e&&t.setAttribute("d",e)}),e.interact.capturedDataPointIndex=t,a.attr("data:pieClicked","true")}const r=parseInt(a.attr("data:startAngle"),10),o=parseInt(a.attr("data:angle"),10),n=s.getPiePath({me:s,startAngle:r,angle:o,size:i});360!==o&&a.plot(n)}getChangedPath(t,e){let s="";return this.dynamicAnim&&this.w.globals.dataChanged&&(s=this.getPiePath({me:this,startAngle:t,angle:e-t,size:this.size})),s}getPiePath({me:t,startAngle:e,angle:s,size:i}){let a;const r=new gt(this.w),o=e,n=Math.PI*(o-90)/180;let l=s+e;Math.ceil(l)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(l=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(l)>this.fullAngle&&(l-=this.fullAngle);const h=Math.PI*(l-90)/180,c=t.centerX+i*Math.cos(n),d=t.centerY+i*Math.sin(n),g=t.centerX+i*Math.cos(h),p=t.centerY+i*Math.sin(h),u=b.polarToCartesian(t.centerX,t.centerY,t.donutSize,l),x=b.polarToCartesian(t.centerX,t.centerY,t.donutSize,o),f=s>180?1:0,m=["M",c,d,"A",i,i,0,f,1,g,p];return a="donut"===t.chartType?[...m,"L",u.x,u.y,"A",t.donutSize,t.donutSize,0,f,0,x.x,x.y,"L",c,d,"z"].join(" "):"pie"===t.chartType||"polarArea"===t.chartType?[...m,"L",t.centerX,t.centerY,"L",c,d].join(" "):[...m].join(" "),r.roundPathCorners(a,2*this.strokeWidth)}drawPolarElements(t){const e=this.w,s=new St(this.w),i=new gt(this.w),a=new Zi(this.w),r=i.group(),o=i.group(),n=s.niceScale(0,Math.ceil(this.maxY),0),l=n.result.reverse(),h=n.result.length;this.maxY=n.niceMax;let c=e.globals.radialSize;const d=c/(h-1);for(let t=0;t<h-1;t++){const s=i.drawCircle(c);if(s.attr({cx:this.centerX,cy:this.centerY,fill:"none","stroke-width":e.config.plotOptions.polarArea.rings.strokeWidth,stroke:e.config.plotOptions.polarArea.rings.strokeColor}),e.config.yaxis[0].show){const s=a.drawYAxisTexts(this.centerX,this.centerY-c+parseInt(e.config.yaxis[0].labels.style.fontSize,10)/2,t,l[t]);o.add(s)}r.add(s),c-=d}this.drawSpokes(t),t.add(r),t.add(o)}renderInnerDataLabels(t,e,s){const i=this.w,a=new gt(this.w),r=e.total.show;t.node.innerHTML="",t.node.style.opacity=s.opacity;const o=s.centerX,n=this.donutDataLabels.total.label?s.centerY:s.centerY-s.centerY/6;let l,h;l=void 0===e.name.color?i.globals.colors[0]:e.name.color;let c=e.name.fontSize,d=e.name.fontFamily,g=e.name.fontWeight;h=void 0===e.value.color?i.config.chart.foreColor:e.value.color;const p=e.value.formatter;let u="",x="";if(r?(l=e.total.color,c=e.total.fontSize,d=e.total.fontFamily,g=e.total.fontWeight,x=this.donutDataLabels.total.label?e.total.label:"",u=e.total.formatter(i)):1===i.seriesData.series.length&&(u=p(i.seriesData.series[0],i),x=i.seriesData.seriesNames[0]),x&&(x=e.name.formatter(x,e.total.show,i)),e.name.show){const s=a.drawText({x:o,y:n+parseFloat(e.name.offsetY),text:x,textAnchor:"middle",foreColor:l,fontSize:c,fontWeight:g,fontFamily:d});s.node.classList.add("apexcharts-datalabel-label"),t.add(s)}if(e.value.show){const s=e.name.show?parseFloat(e.value.offsetY)+16:e.value.offsetY,i=a.drawText({x:o,y:n+s,text:u,textAnchor:"middle",foreColor:h,fontWeight:e.value.fontWeight,fontSize:e.value.fontSize,fontFamily:e.value.fontFamily});i.node.classList.add("apexcharts-datalabel-value"),t.add(i)}return t}printInnerLabels(t,e,s,i){const a=this.w;let r;i?r=void 0===t.name.color?a.globals.colors[parseInt(i.parentNode.getAttribute("rel"),10)-1]:t.name.color:a.seriesData.series.length>1&&t.total.show&&(r=t.total.color);const o=a.dom.baseEl.querySelector(".apexcharts-datalabel-label"),n=a.dom.baseEl.querySelector(".apexcharts-datalabel-value");s=(0,t.value.formatter)(s,a),i||"function"!=typeof t.total.formatter||(s=t.total.formatter(a));const l=e===t.total.label;if(e=this.donutDataLabels.total.label?t.name.formatter(e,l,a):"",null!==o&&(o.textContent=e),null!==n&&(n.textContent=s),null!==o){o.style.fill=r}}printDataLabelsInner(t,e){const s=this.w,i=t.getAttribute("data:value"),a=s.seriesData.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];s.seriesData.series.length>1&&this.printInnerLabels(e,a,i,t);const r=s.dom.baseEl.querySelector(".apexcharts-datalabels-group");if(null!==r){r.style.opacity="1"}}drawSpokes(t){const e=this.w,s=new gt(this.w),i=e.config.plotOptions.polarArea.spokes;if(0===i.strokeWidth)return;const a=[],r=360/e.seriesData.series.length;for(let t=0;t<e.seriesData.series.length;t++)a.push(b.polarToCartesian(this.centerX,this.centerY,e.globals.radialSize,e.config.plotOptions.pie.startAngle+r*t));a.forEach((e,a)=>{const r=s.drawLine(e.x,e.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[a]:i.connectorColors);t.add(r)})}revertDataLabelsInner(){const t=this.w;if(this.donutDataLabels.show){const e=t.dom.Paper.findOne(".apexcharts-datalabels-group"),s=this.renderInnerDataLabels(e,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});t.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(s)}}}function Ji(t,e){let s=0;for(let e=0;e<t.length;e++)s+=t[e];const i=e/s,a=new Array(t.length);for(let e=0;e<t.length;e++)a[e]=t[e]*i;return a}function Qi(t,e,s,i){const a=i*i,r=s*s;return Math.max(a*e/r,r/(a*t))}function ta(t,e,s,i,a,r){if(0===t)return!0;return Qi(e,s,i,r)>=Qi(Math.min(e,a),Math.max(s,a),i+a,r)}function ea(t,e,s,i,a,r,o,n){if(o>=n){const o=i/n;let l=r;for(let i=0;i<s;i++){const s=e[i]/o;t.push([a,l,a+o,l+s]),l+=s}}else{const n=i/o;let l=a;for(let i=0;i<s;i++){const s=e[i]/n;t.push([l,r,l+s,r+n]),l+=s}}}function sa(t,e,s,i,a){const r=[],o=t.length;if(0===o)return r;const n=new Array(o);let l=0,h=0,c=1/0,d=-1/0,g=0;for(;g<o;){const o=Math.min(i,a),p=t[g];if(ta(l,c,d,h,p,o))n[l]=p,l++,h+=p,p<c&&(c=p),p>d&&(d=p),g++;else{if(ea(r,n,l,h,e,s,i,a),i>=a){const t=h/a;e+=t,i-=t}else{const t=h/i;s+=t,a-=t}l=0,h=0,c=1/0,d=-1/0}}return l>0&&ea(r,n,l,h,e,s,i,a),r}const ia={generate:function(t,e,s){const i=t.length,a=new Array(i);for(let e=0;e<i;e++){let s=0;const i=t[e];for(let t=0;t<i.length;t++)s+=i[t];a[e]=s}const r=sa(Ji(a,e*s),0,0,e,s),o=new Array(i);for(let e=0;e<i;e++){const s=r[e],i=s[0],a=s[1],n=s[2]-i,l=s[3]-a;o[e]=sa(Ji(t[e],n*l),i,a,n,l)}return o}};Cs.use({line:qi,area:qi,scatter:qi,bubble:qi,rangeArea:qi,bar:Ti,column:Ti,barStacked:class extends Ti{draw(t,e){const s=this.w;this.graphics=new gt(this.w),this.bar=new Ti(this.w,this.ctx,this.xyRatios);const i=new P(this.w);t=i.getLogSeries(t),this.yRatio=i.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t),"100%"===s.config.chart.stackType&&(t=s.globals.comboCharts?e.map(t=>s.globals.seriesPercent[t]):s.globals.seriesPercent.slice()),this.series=t,this.barHelpers.initializeStackedPrevVars(this);const a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"});let r=0,o=0;for(let i=0,h=0;i<t.length;i++,h++){const c=s.globals.comboCharts?e[i]:i,{groupIndex:d,columnGroupIndex:g}=this.barHelpers.getGroupIndex(c);this.groupCtx=this[s.labelData.seriesGroups[d]];const p=[],u=[];let x=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[c][0],x=c),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let f=this.graphics.group({class:"apexcharts-series",seriesName:b.escapeString(s.seriesData.seriesNames[c]),rel:i+1,"data:realIndex":c});ce.addCollapsedClassToSeries(this.w,f,c);const m=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":c}),y=this.graphics.group({class:"apexcharts-bar-goals-markers"}),w=this.initialPositions(r,o,void 0,void 0,void 0,void 0,x),{xDivision:v,yDivision:A,zeroH:C,zeroW:S}=w;let k=w.barHeight,_=w.barWidth;o=w.y,r=w.x,s.globals.barHeight=k,s.globals.barWidth=_,this.barHelpers.initializeStackedXYVars(this),1===this.groupCtx.prevY.length&&this.groupCtx.prevY[0].every(t=>isNaN(t))&&(this.groupCtx.prevY[0]=this.groupCtx.prevY[0].map(()=>C),this.groupCtx.prevYF[0]=this.groupCtx.prevYF[0].map(()=>0));for(let e=0;e<s.globals.dataPoints;e++){const a=this.barHelpers.getStrokeWidth(i,e,c),b={indexes:{i:i,j:e,realIndex:c,translationsIndex:x,bc:h},strokeWidth:a,x:r,y:o,elSeries:f,columnGroupIndex:g,seriesGroup:s.labelData.seriesGroups[d]};let w=null;this.isHorizontal?(w=this.drawStackedBarPaths(l(n({},b),{zeroW:S,barHeight:k,yDivision:A})),_=this.series[i][e]/this.invertedYRatio):(w=this.drawStackedColumnPaths(l(n({},b),{xDivision:v,barWidth:_,zeroH:C})),k=this.series[i][e]/this.yRatio[x]);const L=this.barHelpers.drawGoalLine({barXPosition:w.barXPosition,barYPosition:w.barYPosition,goalX:w.goalX,goalY:w.goalY,barHeight:k,barWidth:_});L&&y.add(L),o=w.y,r=w.x,p.push(r),u.push(o);const M=this.barHelpers.getPathFillColor(t,i,e,c);let D="";const E=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y";("bottom"===this.barHelpers.arrBorderRadius[c][e]&&s.seriesData.series[c][e]>0||"top"===this.barHelpers.arrBorderRadius[c][e]&&s.seriesData.series[c][e]<0)&&(D=E),f=this.renderSeries(l(n({realIndex:c,pathFill:M.color},M.useRangeColor?{lineFill:M.color}:{}),{j:e,i:i,columnGroupIndex:g,pathFrom:w.pathFrom,pathTo:w.pathTo,strokeWidth:a,elSeries:f,x:r,y:o,series:t,barHeight:k,barWidth:_,elDataLabelsWrap:m,elGoalsMarkers:y,type:"bar",visibleSeries:g,classes:D}))}s.globals.seriesXvalues[c]=p,s.globals.seriesYvalues[c]=u,this.groupCtx.prevY.push(this.groupCtx.yArrj),this.groupCtx.prevYF.push(this.groupCtx.yArrjF),this.groupCtx.prevYVal.push(this.groupCtx.yArrjVal),this.groupCtx.prevX.push(this.groupCtx.xArrj),this.groupCtx.prevXF.push(this.groupCtx.xArrjF),this.groupCtx.prevXVal.push(this.groupCtx.xArrjVal),a.add(f)}return a}initialPositions(t,e,s,i,a,r,o){const n=this.w;let l,h;if(this.isHorizontal){i=n.layout.gridHeight/n.globals.dataPoints;const t=n.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):i*parseInt(t,10)/100,r=n.globals.padHorizontal+(this.isReversed?n.layout.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(i-l)/2}else{h=s=n.layout.gridWidth/n.globals.dataPoints;const e=n.config.plotOptions.bar.columnWidth;n.axisFlags.isXNumeric&&n.globals.dataPoints>1?h=(s=n.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:-1===String(e).indexOf("%")?h=parseInt(e,10):h*=parseInt(e,10)/100,a=this.isReversed?this.baseLineY[o]:n.layout.gridHeight-this.baseLineY[o],t=n.globals.padHorizontal+(s-h)/2}const c=n.globals.barGroups.length||1;return{x:t,y:e,yDivision:i,xDivision:s,barHeight:(null!=l?l:0)/c,barWidth:(null!=h?h:0)/c,zeroH:a,zeroW:r}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:r,columnGroupIndex:o,seriesGroup:n,yDivision:l,elSeries:h}){var c,d,g,p,u;const x=this.w,f=r+o*e;let m;const b=t.i,y=t.j,w=t.realIndex,v=t.translationsIndex;let A=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)A+=this.groupCtx.prevXF[t][y];let C=b;if(x.config.series[w].name&&(C=n.indexOf(x.config.series[w].name)),C>0){let t=i;this.groupCtx.prevXVal[C-1][y]<0?t=(null==(c=this.series[b])?void 0:c[y])>=0?this.groupCtx.prevX[C-1][y]+A-2*(this.isReversed?A:0):this.groupCtx.prevX[C-1][y]:this.groupCtx.prevXVal[C-1][y]>=0&&(t=(null==(d=this.series[b])?void 0:d[y])>=0?this.groupCtx.prevX[C-1][y]:this.groupCtx.prevX[C-1][y]-A+2*(this.isReversed?A:0)),m=t}else m=i;a=null===(null==(g=this.series[b])?void 0:g[y])?m:m+(null==(p=this.series[b])?void 0:p[y])/this.invertedYRatio-2*(this.isReversed?(null==(u=this.series[b])?void 0:u[y])/this.invertedYRatio:0);const S=this.barHelpers.getBarpaths({barYPosition:f,barHeight:e,x1:m,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:n,i:b,j:y,w:x});return this.barHelpers.barBackground({j:y,i:b,y1:f,y2:e,elSeries:h}),r+=l,{pathTo:S.pathTo,pathFrom:S.pathFrom,goalX:this.barHelpers.getGoalValues("x",i,null,b,y,v),barXPosition:m,barYPosition:f,x:a,y:r}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:r,columnGroupIndex:o,seriesGroup:n,elSeries:l}){var h,c,d,g,p,u,x,f,m;const b=this.w,y=t.i,w=t.j,v=t.bc,A=t.realIndex,C=t.translationsIndex;if(b.axisFlags.isXNumeric){let t=b.seriesData.seriesX[A][w];t||(t=0),e=(t-b.globals.minX)/this.xRatio-a/2*b.globals.barGroups.length}const S=e+o*a;let k,_=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)_+=isNaN(this.groupCtx.prevYF[t][w])?0:this.groupCtx.prevYF[t][w];let L=y;if(n&&(L=n.indexOf(b.seriesData.seriesNames[A])),L>0&&!b.axisFlags.isXNumeric||L>0&&b.axisFlags.isXNumeric&&b.seriesData.seriesX[A-1][w]===b.seriesData.seriesX[A][w]){let t,e;const s=Math.min(this.yRatio.length+1,A+1);if(void 0!==this.groupCtx.prevY[L-1]&&this.groupCtx.prevY[L-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[L-t])?void 0:h[w])){e=this.groupCtx.prevY[L-t][w];break}for(let i=1;i<s;i++){if((null==(c=this.groupCtx.prevYVal[L-i])?void 0:c[w])<0){t=(null==(d=this.series[y])?void 0:d[w])>=0?e-_+2*(this.isReversed?_:0):e;break}if((null==(g=this.groupCtx.prevYVal[L-i])?void 0:g[w])>=0){t=(null==(p=this.series[y])?void 0:p[w])>=0?e:e+_-2*(this.isReversed?_:0);break}}void 0===t&&(t=b.layout.gridHeight),k=(null==(u=this.groupCtx.prevYF[0])?void 0:u.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,L).every(t=>t.every(t=>isNaN(t)))?r:t}else k=r;s=(null==(x=this.series[y])?void 0:x[w])?k-(null==(f=this.series[y])?void 0:f[w])/this.yRatio[C]+2*(this.isReversed?(null==(m=this.series[y])?void 0:m[w])/this.yRatio[C]:0):k;const M=this.barHelpers.getColumnPaths({barXPosition:S,barWidth:a,y1:k,y2:s,yRatio:this.yRatio[C],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:n,realIndex:t.realIndex,i:y,j:w,w:b});return this.barHelpers.barBackground({bc:v,j:w,i:y,x1:S,x2:a,elSeries:l}),{pathTo:M.pathTo,pathFrom:M.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,r,y,w,0),barXPosition:S,x:b.axisFlags.isXNumeric?e:e+i,y:s}}},rangeBar:class extends Ti{draw(t,e){var s,i,a,r,o,l,h,c,d;const g=this.w,p=new gt(this.w);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=g.rangeData.seriesRangeStart,this.seriesRangeEnd=g.rangeData.seriesRangeEnd,this.barHelpers.initVariables(t);const u=p.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let x=0;x<t.length;x++){let f,m;const y=g.globals.comboCharts?e[x]:x,{columnGroupIndex:w}=this.barHelpers.getGroupIndex(y),v=p.group({class:"apexcharts-series",seriesName:b.escapeString(g.seriesData.seriesNames[y]),rel:x+1,"data:realIndex":y});ce.addCollapsedClassToSeries(this.w,v,y),t[x].length>0&&(this.visibleI=this.visibleI+1);let A=0;this.yRatio.length>1&&(this.yaxisIndex=g.globals.seriesYAxisReverseMap[y][0],A=y);const C=this.barHelpers.initialPositions(y),{y:S,zeroW:k,x:_,zeroH:L}=C;let M=null!=(s=C.barWidth)?s:0,D=null!=(i=C.barHeight)?i:0;const E=null!=(a=C.yDivision)?a:0,P=null!=(r=C.xDivision)?r:0;m=S,f=_;const F=p.group({class:"apexcharts-datalabels","data:realIndex":y}),T=p.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<g.globals.dataPoints;e++){const s=this.barHelpers.getStrokeWidth(x,e,y),i=this.seriesRangeStart[x][e],a=this.seriesRangeEnd[x][e];let r=null,p=null,u=null;const b={x:f,y:m,strokeWidth:s,elSeries:v};let S=this.seriesLen;if(g.config.plotOptions.bar.rangeBarGroupRows&&(S=1),void 0===(null==(o=g.config.series[x].data)?void 0:o[e]))break;if(this.isHorizontal){u=m+D*this.visibleI;const t=(E-D*S)/2;if(null==(h=null==(l=g.config.series[x].data)?void 0:l[e])?void 0:h.x){const s=this.detectOverlappingBars({i:x,j:e,barYPosition:u,srty:t,barHeight:D,yDivision:E,initPositions:C});D=s.barHeight,u=s.barYPosition}r=this.drawRangeBarPaths(n({indexes:{i:x,j:e,realIndex:y},barHeight:D,barYPosition:u,zeroW:k,yDivision:E,y1:i,y2:a},b)),M=r.barWidth}else{g.axisFlags.isXNumeric&&(f=(g.seriesData.seriesX[x][e]-g.globals.minX)/this.xRatio-M/2),p=f+M*this.visibleI;const t=(P-M*S)/2;if(null==(d=null==(c=g.config.series[x].data)?void 0:c[e])?void 0:d.x){const s=this.detectOverlappingBars({i:x,j:e,barXPosition:p,srtx:t,barWidth:M,xDivision:P,initPositions:C});M=s.barWidth,p=s.barXPosition}r=this.drawRangeColumnPaths(n({indexes:{i:x,j:e,realIndex:y,translationsIndex:A},barWidth:M,barXPosition:p,zeroH:L,xDivision:P},b)),D=r.barHeight}const _=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:u,goalX:r.goalX,goalY:r.goalY,barHeight:D,barWidth:M});_&&T.add(_),m=r.y,f=r.x;const I=this.barHelpers.getPathFillColor(t,x,e,y);this.renderSeries({realIndex:y,pathFill:I.color,lineFill:I.useRangeColor?I.color:g.globals.stroke.colors[y],j:e,i:x,x:f,y:m,y1:i,y2:a,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:s,elSeries:v,series:t,barHeight:D,barWidth:M,barXPosition:p,barYPosition:u,columnGroupIndex:w,elDataLabelsWrap:F,elGoalsMarkers:T,visibleSeries:this.visibleI,type:"rangebar"})}u.add(v)}return u}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:i,srty:a,srtx:r,barHeight:o,barWidth:n,yDivision:l,xDivision:h,initPositions:c}){var d,g,p,u;const x=this.w;let f=[];const m=null==(g=null==(d=x.config.series[t].data)?void 0:d[e])?void 0:g.rangeName,b=null==(u=null==(p=x.config.series[t].data)?void 0:p[e])?void 0:u.x,y=Array.isArray(b)?b.join(" "):b,w=x.labelData.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(y),v=x.rangeData.seriesRange[t].findIndex(t=>{var e;return t.x===y&&(null==(e=t.overlaps)?void 0:e.size)>0});return this.isHorizontal?(s=x.config.plotOptions.bar.rangeBarGroupRows?a+l*w:a+o*this.visibleI+l*w,v>-1&&!x.config.plotOptions.bar.rangeBarOverlap&&(f=Array.from(x.rangeData.seriesRange[t][v].overlaps),f.indexOf(m)>-1&&(s=(o=c.barHeight/f.length)*this.visibleI+l*(100-parseInt(this.barOptions.barHeight,10))/100/2+o*(this.visibleI+f.indexOf(m))+l*w))):(w>-1&&!x.labelData.timescaleLabels.length&&(i=x.config.plotOptions.bar.rangeBarGroupRows?r+h*w:r+n*this.visibleI+h*w),v>-1&&!x.config.plotOptions.bar.rangeBarOverlap&&(f=Array.from(x.rangeData.seriesRange[t][v].overlaps),f.indexOf(m)>-1&&(i=(n=c.barWidth/f.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+n*(this.visibleI+f.indexOf(m))+h*w))),{barYPosition:s,barXPosition:i,barHeight:o,barWidth:n}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:i,barXPosition:a,zeroH:r}){var o,n;const l=this.w,{i:h,j:c,realIndex:d,translationsIndex:g}=t,p=this.yRatio[g],u=this.getRangeValue(d,c);let x=Math.min(u.start,u.end),f=Math.max(u.start,u.end);void 0===(null==(o=this.series[h])?void 0:o[c])||null===(null==(n=this.series[h])?void 0:n[c])?x=r:(x=r-x/p,f=r-f/p);const m=Math.abs(f-x),b=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:i,y1:x,y2:f,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:d,i:d,j:c,w:l});if(l.axisFlags.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:c,realIndex:d,barWidth:i});e=t.x,a=t.barXPosition}else e+=s;return{pathTo:b.pathTo,pathFrom:b.pathFrom,barHeight:m,x:e,y:u.start<0&&u.end<0?x:f,goalY:this.barHelpers.getGoalValues("y",null,r,h,c,g),barXPosition:a}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.layout.gridWidth&&(t=e.layout.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:i,yDivision:a,barHeight:r,barYPosition:o,zeroW:n}){const l=this.w,{realIndex:h,j:c}=t,d=this.preventBarOverflow(n+s/this.invertedYRatio),g=this.preventBarOverflow(n+i/this.invertedYRatio),p=this.getRangeValue(h,c),u=Math.abs(g-d),x=this.barHelpers.getBarpaths({barYPosition:o,barHeight:r,x1:d,x2:g,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:c,w:l});return l.axisFlags.isXNumeric||(e+=a),{pathTo:x.pathTo,pathFrom:x.pathFrom,barWidth:u,x:p.start<0&&p.end<0?d:g,goalX:this.barHelpers.getGoalValues("x",n,null,h,c,0),y:e}}getRangeValue(t,e){const s=this.w;return{start:s.rangeData.seriesRangeStart[t][e],end:s.rangeData.seriesRangeEnd[t][e]}}},candlestick:Wi,boxPlot:Wi,violin:class extends Ti{draw(t,e,s){const i=this.w,a=new gt(this.w),r=new pt(this.w);this.violinOptions=i.config.plotOptions.violin,this.pointsOptions=this.violinOptions.points,this.bandwidthScale=this.violinOptions.bandwidthScale||1,this.normalize=this.violinOptions.normalize||"individual",this.distributed=i.config.plotOptions.bar.distributed,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.coreUtils=new P(this.w),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const o=a.group({class:"apexcharts-violin-series apexcharts-plot-series"});for(let e=0;e<t.length;e++){let n,l;const h=[],c=[],d=i.globals.comboCharts?s[e]:e,{columnGroupIndex:g}=this.barHelpers.getGroupIndex(d),p=a.group({class:"apexcharts-series",seriesName:b.escapeString(i.seriesData.seriesNames[d]),rel:e+1,"data:realIndex":d});ce.addCollapsedClassToSeries(this.w,p,d),t[e].length>0&&(this.visibleI=this.visibleI+1);let u=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[d][0],u=d);const x=this.barHelpers.initialPositions(d),{y:f,barHeight:m,yDivision:y,zeroW:w,x:v,barWidth:A,xDivision:C,zeroH:S}=x;l=f,n=v,c.push(n+(null!=A?A:0)/2);const k=a.group({class:"apexcharts-datalabels","data:realIndex":d});if(this.seriesMaxWeight=0,"group"===this.normalize){(i.violinData.seriesViolinDensity[d]||[]).forEach(t=>{t&&t.maxWeight>this.seriesMaxWeight&&(this.seriesMaxWeight=t.maxWeight)})}const _=[];for(let s=0;s<i.globals.dataPoints;s++){const a=this.barHelpers.getStrokeWidth(e,s,d),o=this.isHorizontal?this.drawHorizontalViolin({indexes:{i:e,j:s,realIndex:d,translationsIndex:u},y:l,yDivision:y,barHeight:m,zeroW:w}):this.drawVerticalViolin({indexes:{i:e,j:s,realIndex:d,translationsIndex:u},x:n,xDivision:C,barWidth:A,zeroH:S});n=o.x,l=o.y,s>0&&c.push(o.center),h.push(o.alongRepresentative);const x=this.buildPointsSubPath({realIndex:d,j:s,center:o.center,halfExtent:o.halfExtent,alongFn:o.alongFn,density:o.density,maxWeight:o.maxWeight});x.length&&_.push({groups:x,j:s});const f=r.fillPath({seriesNumber:this.distributed?s:d,dataPointIndex:s,color:this.distributed?i.globals.colors[s]:void 0,value:t[e][s]});this.renderSeries({realIndex:d,pathFill:f,lineFill:i.globals.stroke.colors[d],j:s,i:e,pathFrom:o.pathFrom,pathTo:o.pathTo,strokeWidth:a,elSeries:p,x:n,y:l,series:t,columnGroupIndex:g,barHeight:m,barWidth:A,elDataLabelsWrap:k,visibleSeries:this.visibleI,type:"violin"});const b=p.node.querySelector(`path.apexcharts-violin-area[j='${s}']`);b&&isFinite(o.alongRepresentative)&&b.setAttribute(this.isHorizontal?"cx":"cy",`${o.alongRepresentative}`)}Xi({graphics:a,w:i,elSeries:p,pointsByCat:_,options:this.pointsOptions,distributed:this.distributed,realIndex:d,wrapClass:"apexcharts-violin-points-wrap",pointClass:"apexcharts-violin-points"}),i.globals.seriesXvalues[d]=c,i.globals.seriesYvalues[d]=h,o.add(p)}return o}drawVerticalViolin({indexes:t,x:e,xDivision:s,barWidth:i,zeroH:a}){var r;const o=this.w,{realIndex:n,j:l,translationsIndex:h}=t,c=this.yRatio[h];o.axisFlags.isXNumeric&&(e=(o.seriesData.seriesX[n][l]-o.globals.minX)/this.xRatio-i/2);const d=e+i*this.visibleI+i/2,g=i/2,p=this.getDensity(n,l),u=this.effectiveMaxWeight(p),x=t=>a-this.logVal(t,n)/c,f=this.buildBodyPath({nodes:p.nodes,center:d,halfExtent:g,maxWeight:u,vertical:!0,alongFn:x,collapsed:!1});let m=null;return o.globals.previousPaths.length>0&&(m=this.getPreviousPath(n,l,f)),null==m&&(m=this.buildBodyPath({nodes:p.nodes,center:d,halfExtent:g,maxWeight:u,vertical:!0,alongFn:x,collapsed:!0})),o.axisFlags.isXNumeric||(e+=s),{pathTo:f,pathFrom:m,x:e,y:a,center:d,halfExtent:g,alongFn:x,density:p,maxWeight:u,alongRepresentative:x(null!=(r=this.series[t.i][l])?r:0)}}drawHorizontalViolin({indexes:t,y:e,yDivision:s,barHeight:i,zeroW:a}){var r;const o=this.w,{realIndex:n,j:l}=t,h=this.invertedYRatio;o.axisFlags.isXNumeric&&(e=(o.seriesData.seriesX[n][l]-o.globals.minX)/this.invertedXRatio-i/2);const c=e+i*this.visibleI+i/2,d=i/2,g=this.getDensity(n,l),p=this.effectiveMaxWeight(g),u=t=>a+this.logVal(t,n)/h,x=this.buildBodyPath({nodes:g.nodes,center:c,halfExtent:d,maxWeight:p,vertical:!1,alongFn:u,collapsed:!1});let f=null;return o.globals.previousPaths.length>0&&(f=this.getPreviousPath(n,l,x)),null==f&&(f=this.buildBodyPath({nodes:g.nodes,center:c,halfExtent:d,maxWeight:p,vertical:!1,alongFn:u,collapsed:!0})),o.axisFlags.isXNumeric||(e+=s),{pathTo:x,pathFrom:f,x:a,y:e,center:c,halfExtent:d,alongFn:u,maxWeight:p,density:g,alongRepresentative:u(null!=(r=this.series[t.i][l])?r:0)}}getDensity(t,e){var s;const i=null==(s=this.w.violinData.seriesViolinDensity[t])?void 0:s[e];if(!i||!i.values.length)return{nodes:[],maxWeight:0};const a=i.values.map((t,e)=>e);a.sort((t,e)=>i.values[t]-i.values[e]);const r=[];let o=null;for(const t of a){const e=i.values[t];null!==o&&e===o||(r.push({v:e,w:i.weights[t]}),o=e)}return{nodes:r,maxWeight:i.maxWeight}}effectiveMaxWeight(t){return"group"===this.normalize&&this.seriesMaxWeight>0?this.seriesMaxWeight:t.maxWeight}buildBodyPath({nodes:t,center:e,halfExtent:s,maxWeight:i,vertical:a,alongFn:r,collapsed:o}){const n=new gt(this.w);if(0===t.length){const t=r(0);return a?n.move(e,t)+n.line(e,t):n.move(t,e)+n.line(t,e)}const l=t=>{if(o||i<=0)return 0;const e=t/i*s*this.bandwidthScale;return Math.min(s,Math.max(0,e))},h=[],c=[];for(let s=0;s<t.length;s++){const i=r(t[s].v),o=l(t[s].w);a?(h.push([e+o,i]),c.push([e-o,i])):(h.push([i,e+o]),c.push([i,e-o]))}return c.reverse(),this.smoothSegment(h,a,!1)+this.smoothSegment(c,a,!0)+"z"}smoothSegment(t,e,s){const i=new gt(this.w),a=t[0];let r=s?i.line(a[0],a[1]):i.move(a[0],a[1]);if(t.length<3||!this.strictlyMonotonic(t,e)){for(let e=1;e<t.length;e++)r+=i.line(t[e][0],t[e][1]);return r}const o=t.map(([t,s])=>e?[s,t]:[t,s]),n=$i.points(o),l=e?n.map(Gi):n;return r+=Hi(l),r}strictlyMonotonic(t,e){const s=e?1:0;for(let e=1;e<t.length;e++)if(t[e][s]===t[e-1][s])return!1;return!0}buildPointsSubPath({realIndex:t,j:e,center:s,halfExtent:i,alongFn:a,density:r,maxWeight:o}){var n;return Ii({w:this.w,points:null==(n=this.w.violinData.seriesViolinPoints[t])?void 0:n[e],seedA:t,seedB:e,center:s,halfExtent:i,alongFn:a,isHorizontal:this.isHorizontal,options:this.pointsOptions,clampAt:t=>this.halfWidthAtValue(t,r,i,o)})}halfWidthAtValue(t,e,s,i){const{nodes:a}=e,r=null!=i?i:e.maxWeight;if(!a.length||r<=0)return 0;const o=t=>Math.min(s,t/r*s*this.bandwidthScale);if(t<=a[0].v)return o(a[0].w);if(t>=a[a.length-1].v)return o(a[a.length-1].w);for(let e=1;e<a.length;e++)if(t<=a[e].v){const s=a[e-1],i=a[e],r=i.v===s.v?0:(t-s.v)/(i.v-s.v);return o(s.w+(i.w-s.w)*r)}return 0}logVal(t,e){return this.coreUtils.getLogValAtSeriesIndex(t,e)}},pie:Ki,donut:Ki,polarArea:Ki,radialBar:class extends Ki{constructor(t,e){super(t,e),this.ctx=e,this.w=t,this.animBeginArr=[0],this.animDur=0,this.startAngle=t.config.plotOptions.radialBar.startAngle,this.endAngle=t.config.plotOptions.radialBar.endAngle,this.totalAngle=Math.abs(t.config.plotOptions.radialBar.endAngle-t.config.plotOptions.radialBar.startAngle),this.trackStartAngle=t.config.plotOptions.radialBar.track.startAngle,this.trackEndAngle=t.config.plotOptions.radialBar.track.endAngle,this.barLabels=this.w.config.plotOptions.radialBar.barLabels,this.donutDataLabels=this.w.config.plotOptions.radialBar.dataLabels,this.radialDataLabels=this.donutDataLabels,this.trackStartAngle||(this.trackStartAngle=this.startAngle),this.trackEndAngle||(this.trackEndAngle=this.endAngle),360===this.endAngle&&(this.endAngle=359.99),this.margin=parseInt(t.config.plotOptions.radialBar.track.margin,10),this.onBarLabelClick=this.onBarLabelClick.bind(this)}draw(t){var e;const s=this.w,i=new gt(this.w),a=i.group({class:"apexcharts-radialbar"});if(s.globals.noData)return a;const r=i.group(),o=this.defaultSize/2,n=s.layout.gridWidth/2;let l=this.defaultSize/2.05;s.config.chart.sparkline.enabled||(l=l-s.config.stroke.width-s.config.chart.dropShadow.blur);const h=s.globals.fill.colors,d=s.config.plotOptions.radialBar,g=Array.isArray(d.bands)&&d.bands.length>0,p=g&&d.bandsStyle&&d.bandsStyle.hideTrackWhenPresent,u="needle"===d.shape;if(d.track.show&&!p){const e=this.drawTracks({size:l,centerX:n,centerY:o,colorArr:h,series:t});r.add(e)}if(g){const e=this.drawBands({size:l,centerX:n,centerY:o,series:t});r.add(e)}const x=this.drawArcs({size:l,centerX:n,centerY:o,colorArr:h,series:t,skipValueArc:u&&!(null==(e=d.needle)?void 0:e.showValueArc)});if(d.ticks&&d.ticks.show){const e=this.drawTicks({size:l,centerX:n,centerY:o,series:t});if(this.initialAnim&&!s.globals.dataChanged&&!s.globals.resized&&c.isBrowser()&&s.globals.shouldAnimate){const t=e.node;t.style.opacity="0",t.style.transition="opacity 280ms ease-out";const i=s.config.chart.animations.speed||800;setTimeout(()=>{t.style.opacity="1"},i)}r.add(e)}if(u){const e=this.drawNeedle({size:l,centerX:n,centerY:o,series:t});r.add(e)}let f=360;s.config.plotOptions.radialBar.startAngle<0&&(f=this.totalAngle);const m=(360-f)/360;if(s.globals.radialSize=l-l*m,this.radialDataLabels.value.show){const t=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);s.globals.radialSize+=t*m}return r.add(x.g),"front"===s.config.plotOptions.radialBar.hollow.position&&(x.g.add(x.elHollow),x.dataLabels&&x.g.add(x.dataLabels)),a.add(r),a}drawTracks(t){const e=this.w,s=new gt(this.w),i=s.group({class:"apexcharts-tracks"}),a=new dt(this.w),r=new pt(this.w),o=this.getStrokeWidth(t);t.size=t.size-o/2;for(let n=0;n<t.series.length;n++){const l=s.group({class:"apexcharts-radialbar-track apexcharts-track"});i.add(l),l.attr({rel:n+1}),t.size=t.size-o-this.margin;const h=e.config.plotOptions.radialBar.track,c=r.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(h.background)?h.background[n]:h.background,solid:!0}),d=this.trackStartAngle;let g=this.trackEndAngle;Math.abs(g)+Math.abs(d)>=360&&(g=360-Math.abs(this.startAngle)-.1);const p=s.drawPath({d:"",stroke:c,strokeWidth:o*parseInt(h.strokeWidth,10)/100,fill:"none",strokeOpacity:h.opacity,classes:"apexcharts-radialbar-area"});if(h.dropShadow.enabled){const t=h.dropShadow;a.dropShadow(p,t)}l.add(p),p.attr("id","apexcharts-radialbarTrack-"+n),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:g,startAngle:d,size:t.size,i:n,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return i}drawArcs(t){var e;const s=this.w,i=new gt(this.w),a=new pt(this.w),r=new dt(this.w),o=i.group(),n=this.getStrokeWidth(t);t.size=t.size-n/2;let l=s.config.plotOptions.radialBar.hollow.background;const h=t.size-n*t.series.length-this.margin*t.series.length-n*parseInt(s.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,c=h-s.config.plotOptions.radialBar.hollow.margin;void 0!==s.config.plotOptions.radialBar.hollow.image&&(l=this.drawHollowImage(t,o,h,l));const d=this.drawHollow({size:c,centerX:t.centerX,centerY:t.centerY,fill:l||"transparent"});if(s.config.plotOptions.radialBar.hollow.dropShadow.enabled){const t=s.config.plotOptions.radialBar.hollow.dropShadow;r.dropShadow(d,t)}let g=1;!this.radialDataLabels.total.show&&s.seriesData.series.length>1&&(g=0);let p=null;if(this.radialDataLabels.show){const e=s.dom.Paper.findOne(".apexcharts-datalabels-group");p=this.renderInnerDataLabels(e,this.radialDataLabels,{hollowSize:h,centerX:t.centerX,centerY:t.centerY,opacity:g})}"back"===s.config.plotOptions.radialBar.hollow.position&&(o.add(d),p&&o.add(p));let u=!1;s.config.plotOptions.radialBar.inverseOrder&&(u=!0);const x=!0===(null==(e=this.ctx.morphTypeChange)?void 0:e.isActive());for(let e=u?t.series.length-1:0;u?e>=0:e<t.series.length;u?e--:e++){const l=i.group({class:"apexcharts-series apexcharts-radial-series",seriesName:b.escapeString(s.seriesData.seriesNames[e])});o.add(l),l.attr({rel:e+1,"data:realIndex":e}),ce.addCollapsedClassToSeries(this.w,l,e),t.size=t.size-n-this.margin;const h=a.fillPath({seriesNumber:e,size:t.size,value:t.series[e]}),c=this.startAngle;let d;const g=s.config.plotOptions.radialBar,p="number"==typeof g.min?g.min:0,u="number"==typeof g.max?g.max:100,f=u===p?1:u-p,m=t=>{const e=Math.min(Math.max(t,p),u);return Math.max(0,(e-p)/f)},y=m(b.negToZero(t.series[e]));let w,v=Math.round(this.totalAngle*y)+this.startAngle;s.globals.dataChanged&&(d=this.startAngle,w=Math.round(this.totalAngle*m(b.negToZero(s.globals.previousPaths[e])))+d);Math.abs(v)+Math.abs(c)>360&&(v-=.01);Math.abs(w)+Math.abs(d)>360&&(w-=.01);const A=v-c,C=Array.isArray(s.config.stroke.dashArray)?s.config.stroke.dashArray[e]:s.config.stroke.dashArray,S=x?this.ctx.morphTypeChange.getInitialPathFor(e,0):null,k=x?this.ctx.morphTypeChange.getFromType():null,_=!!S&&("bar"===k||"funnel"===k||"pyramid"===k||"pie"===k||"donut"===k||"polarArea"===k),L=i.drawPath({d:S||"",stroke:_||t.skipValueArc?"transparent":h,strokeWidth:_||t.skipValueArc?0:n,fill:_?h:"none",fillOpacity:s.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+e,strokeDashArray:C}),M=c+A/2,D=b.polarToCartesian(t.centerX,t.centerY,t.size,M);if(gt.setAttrs(L.node,{"data:angle":A,"data:value":t.series[e],"data:cx":D.x,"data:cy":D.y}),s.config.chart.dropShadow.enabled){const t=s.config.chart.dropShadow;r.dropShadow(L,t,e)}if(r.setSelectionFilter(L,0,e),this.addListeners(L,this.radialDataLabels),l.add(L),L.attr({index:0,j:e}),this.barLabels.enabled){const a=b.polarToCartesian(t.centerX,t.centerY,t.size,c),r=this.barLabels.formatter(s.seriesData.seriesNames[e],{seriesIndex:e,w:s}),o=["apexcharts-radialbar-label"];this.barLabels.onClick||o.push("apexcharts-no-click");let n=this.barLabels.useSeriesColors?s.globals.colors[e]:s.config.chart.foreColor;n||(n=s.config.chart.foreColor);const h=a.x+this.barLabels.offsetX,d=a.y+this.barLabels.offsetY,g=i.drawText({x:h,y:d,text:r,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:n,cssClass:o.join(" ")});g.on("click",this.onBarLabelClick),g.attr({rel:e+1}),0!==c&&g.attr({"transform-origin":`${h} ${d}`,transform:`rotate(${c} 0 0)`}),l.add(g)}let E=0;if(!this.initialAnim||s.globals.resized||s.globals.dataChanged||(E=s.config.chart.animations.speed),s.globals.dataChanged&&(E=s.config.chart.animations.dynamicAnimation.speed),this.animDur=E/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur),x&&S){const e=this.ctx.morphTypeChange.getSpeed(),s=this.getPiePath({me:this,startAngle:c,angle:A,size:t.size});if(_){const i=this.ctx.morphTypeChange.buildRingSegmentPath(t.centerX,t.centerY,t.size,n,c,c+A);L.animate(e).plot(i,"polygons").after(function(){this.attr({d:s,fill:"none",stroke:t.skipValueArc?"transparent":h,"stroke-width":t.skipValueArc?0:n})})}else L.animate(e).plot(s,"polygons").attr({"stroke-width":n})}else this.animatePaths(L,{centerX:t.centerX,centerY:t.centerY,endAngle:v,startAngle:c,prevEndAngle:w,prevStartAngle:d,size:t.size,i:e,totalItems:2,animBeginArr:this.animBeginArr,dur:E,shouldSetPrevPaths:!0})}return{g:o,elHollow:d,dataLabels:p}}_angleAtValue(t){const e=this.w.config.plotOptions.radialBar,s="number"==typeof e.min?e.min:0,i="number"==typeof e.max?e.max:100,a=i===s?s+1:i,r=(Math.max(s,Math.min(a,Number(t)))-s)/(a-s);return this.startAngle+r*(this.endAngle-this.startAngle)}_describeArc(t,e,s,i,a){const r=b.polarToCartesian(t,e,s,a),o=b.polarToCartesian(t,e,s,i),n=a-i,l=Math.abs(n)>180?1:0;return`M ${r.x} ${r.y} A ${s} ${s} 0 ${l} 0 ${o.x} ${o.y}`}drawBands(t){const e=this.w,s=new gt(this.w),i=e.config.plotOptions.radialBar,a=i.bands||[],r=s.group({class:"apexcharts-gauge-bands"}),o=this.getStrokeWidth(t),n=t.size-o/2-o-this.margin,l=o*parseInt(i.bandsStyle.strokeWidth,10)/100,h="number"==typeof i.min?i.min:0,c="number"==typeof i.max?i.max:100,d=c===h?0:(i.bandsStyle.gap||0)*((this.endAngle-this.startAngle)/(c-h));for(let e=0;e<a.length;e++){const o=a[e];if(void 0===o.from||void 0===o.to)continue;const h=this._angleAtValue(o.from),c=this._angleAtValue(o.to),g=Math.min(h,c)+d/2,p=Math.max(h,c)-d/2;if(p-g<=0)continue;const u=s.drawPath({d:this._describeArc(t.centerX,t.centerY,n,g,p),stroke:o.color||"#ccc",strokeWidth:l,fill:"none",strokeLinecap:i.bandsStyle.linecap||"butt",classes:"apexcharts-gauge-band"});u.node.setAttribute("data-band-index",String(e)),r.add(u)}return r}drawTicks(t){var e,s,i,a;const r=this.w,o=new gt(this.w),n=r.config.plotOptions.radialBar,l=n.ticks,h=o.group({class:"apexcharts-gauge-ticks"}),c=this.getStrokeWidth(t),d=t.size-c/2-c-this.margin,g="number"==typeof n.min?n.min:0,p="number"==typeof n.max?n.max:100,u=Math.max(2,null!=(s=null==(e=l.major)?void 0:e.count)?s:11),x=Math.max(0,null!=(a=null==(i=l.minor)?void 0:i.count)?a:0),f=(e,s,i)=>{var a,r,n;const c=this._angleAtValue(e),g=null!=(a=s.length)?a:8,p="inside"===s.placement?d-g:d,u="inside"===s.placement?d:d+g,x=b.polarToCartesian(t.centerX,t.centerY,p,c),f=b.polarToCartesian(t.centerX,t.centerY,u,c),m=o.drawLine(x.x,x.y,f.x,f.y,s.color||(i?"#666":"#999"),0,s.width||(i?2:1));if(h.add(m),i&&(null==(r=l.labels)?void 0:r.show)){const i=("inside"===s.placement?p:u)+("inside"===s.placement?-1:1)*(null!=(n=l.labels.offset)?n:6),a=b.polarToCartesian(t.centerX,t.centerY,i,c),r="function"==typeof l.labels.formatter?l.labels.formatter(e):String(e),d=o.drawText({x:a.x,y:a.y,text:r,textAnchor:"middle",dominantBaseline:"middle",fontFamily:l.labels.fontFamily,fontSize:l.labels.fontSize,fontWeight:l.labels.fontWeight,foreColor:l.labels.color,cssClass:"apexcharts-gauge-tick-label"});h.add(d)}};for(let t=0;t<u;t++){if(f(g+t/(u-1)*(p-g),l.major||{},!0),t<u-1&&x>0)for(let e=1;e<=x;e++){f(g+(t+e/(x+1))/(u-1)*(p-g),l.minor||{},!1)}}return h}drawNeedle(t){var e,s,i,a,r;const o=this.w,n=new gt(this.w),l=o.config.plotOptions.radialBar.needle||{},h=n.group({class:"apexcharts-gauge-needle"});if(!t.series||0===t.series.length)return h;const d=this.getStrokeWidth(t),g=t.size-d/2-d-this.margin,p="string"==typeof l.length&&l.length.endsWith("%")?g*parseInt(l.length,10)/100:Number(l.length||.85*g),u=null!=(e=l.baseWidth)?e:4,x=null!=(s=l.tipWidth)?s:1,f=l.color||"#333",b=t.centerX,y=Number(null!=(i=l.offsetY)?i:0),w=t.centerY+y,v=`M ${b+u/2} ${w} A ${u/2} ${u/2} 0 0 1 ${b-u/2} ${w} L ${b-x/2} ${w-p} L ${b+x/2} ${w-p} Z`,A=n.drawPath({d:v,stroke:f,strokeWidth:0,fill:f,classes:"apexcharts-gauge-needle-shape"});h.add(A);const C=Number(t.series[0]),S=this._angleAtValue(C),k=this.initialAnim&&!o.globals.dataChanged&&!o.globals.resized,_=this.ctx,L="number"==typeof _._lastNeedleAngle?_._lastNeedleAngle:this.startAngle;_._lastNeedleAngle=S;if(c.isBrowser()&&o.globals.shouldAnimate&&(k||o.globals.dataChanged)&&L!==S){const t=h.node;t.setAttribute("transform-origin",`${b} ${w}`),t.setAttribute("transform",`rotate(${L})`);const e=(null==(a=l.animation)?void 0:a.duration)&&Number(l.animation.duration)||l.animationSpeed&&Number(l.animationSpeed)||(null==(r=o.config.chart.animations.dynamicAnimation)?void 0:r.speed)||o.config.chart.animations.speed||800,s=1.70158,i=s+1,n=k?t=>1+i*Math.pow(t-1,3)+s*Math.pow(t-1,2):t=>1-Math.pow(1-t,3),c=performance.now(),d=s=>{const i=Math.max(0,Math.min(1,(s-c)/e)),a=L+(S-L)*n(i);t.setAttribute("transform",`rotate(${a})`),i<1&&m.requestAnimationFrame(d)};m.requestAnimationFrame(d)}else h.attr({"transform-origin":`${b} ${w}`,transform:`rotate(${S})`});return h}drawHollow(t){var e;const s=new gt(this.w),i=this.w.config.plotOptions.radialBar.hollow,a=s.drawCircle(2*t.size),r={class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill};return(i.stroke||i.strokeDasharray)&&(r.stroke=i.stroke||"transparent",r["stroke-width"]=null!=(e=i.strokeWidth)?e:1,i.strokeDasharray&&(r["stroke-dasharray"]=i.strokeDasharray)),a.attr(r),a}drawHollowImage(t,e,s,i){const a=this.w,r=new pt(this.w),o=b.randomId(),n=a.config.plotOptions.radialBar.hollow.image;if(a.config.plotOptions.radialBar.hollow.imageClipped)r.clippedImgArea({width:s,height:s,image:n,patternID:`pattern${a.globals.cuid}${o}`}),i=`url(#pattern${a.globals.cuid}${o})`;else{const s=a.config.plotOptions.radialBar.hollow.imageWidth,i=a.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===s&&void 0===i){const s=a.dom.Paper.image(n,function(e){this.move(t.centerX-e.width/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-e.height/2+a.config.plotOptions.radialBar.hollow.imageOffsetY)});e.add(s)}else{const r=a.dom.Paper.image(n,function(){this.move(t.centerX-s/2+a.config.plotOptions.radialBar.hollow.imageOffsetX,t.centerY-i/2+a.config.plotOptions.radialBar.hollow.imageOffsetY),this.size(s,i)});e.add(r)}}return i}getStrokeWidth(t){const e=this.w;return t.size*(100-parseInt(e.config.plotOptions.radialBar.hollow.size,10))/100/(t.series.length+1)-this.margin}onBarLabelClick(t){var e;const s=t.target,i=parseInt(null!=(e=s.getAttribute("rel"))?e:"",10)-1,a=this.barLabels.onClick,r=this.w;a&&a(r.seriesData.seriesNames[i],{w:r,seriesIndex:i})}},radar:class{constructor(t,e){this.ctx=e,this.w=t,this.chartType=this.w.config.chart.type,this.initialAnim=this.w.config.chart.animations.enabled,this.dynamicAnim=this.initialAnim&&this.w.config.chart.animations.dynamicAnimation.enabled,this.animDur=0,this.graphics=new gt(this.w),this.lineColorArr=void 0!==t.globals.stroke.colors?t.globals.stroke.colors:t.globals.colors,this.defaultSize=t.globals.svgHeight<t.globals.svgWidth?t.layout.gridHeight:t.layout.gridWidth,this.isLog=t.config.yaxis[0].logarithmic,this.logBase=t.config.yaxis[0].logBase,this.coreUtils=new P(this.w),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,t.globals.maxY,0):t.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):t.globals.minY,this.polygons=t.config.plotOptions.radar.polygons,this.strokeWidth=t.config.stroke.show?t.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-t.config.chart.dropShadow.blur,t.config.xaxis.labels.show&&(this.size=this.size-t.layout.xAxisLabelsWidth/1.75),void 0!==t.config.plotOptions.radar.size&&(this.size=t.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.dataPointsLen=0,this.disAngle=0,this.yaxisLabelsTextsPos=[]}draw(t){const e=this.w,s=new pt(this.w),i=[],a=new yt(this.w,this.ctx);t.length&&(this.dataPointsLen=t[e.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;const r=e.layout.gridWidth/2,o=e.layout.gridHeight/2,h=r+e.config.plotOptions.radar.offsetX,c=o+e.config.plotOptions.radar.offsetY,d=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:`translate(${h||0}, ${c||0})`});let g=[],p=null,u=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((t,r)=>{const o=t.length===e.globals.dataPoints,h=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":o,seriesName:b.escapeString(e.seriesData.seriesNames[r]),rel:r+1,"data:realIndex":r});this.dataRadiusOfPercent[r]=[],this.dataRadius[r]=[],this.angleArr[r]=[],t.forEach((t,e)=>{const s=Math.abs(this.maxValue-this.minValue);t-=this.minValue,this.isLog&&(t=this.coreUtils.getLogVal(this.logBase,t,0)),this.dataRadiusOfPercent[r][e]=t/s,this.dataRadius[r][e]=this.dataRadiusOfPercent[r][e]*this.size,this.angleArr[r][e]=e*this.disAngle}),g=this.getDataPointsPos(this.dataRadius[r],this.angleArr[r]);const c=this.createPaths(g,{x:0,y:0});p=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),u=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":r}),e.globals.delayedElements.push({el:p.node,index:r});const d={i:r,realIndex:r,animationDelay:r,initialSpeed:e.config.chart.animations.speed,dataChangeSpeed:e.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-radar",shouldClipToGrid:!1,bindEventsOnPaths:!1,stroke:e.globals.stroke.colors[r],strokeLineCap:e.config.stroke.lineCap};let x=null;e.globals.previousPaths.length>0&&(x=this.getPreviousPath(r));for(let t=0;t<c.linePathsTo.length;t++){const i=this.graphics.renderPaths(l(n({},d),{pathFrom:null===x?c.linePathsFrom[t]:x,pathTo:c.linePathsTo[t],strokeWidth:Array.isArray(this.strokeWidth)?this.strokeWidth[r]:this.strokeWidth,fill:"none",drawShadow:!1}));h.add(i);const a=s.fillPath({seriesNumber:r}),o=this.graphics.renderPaths(l(n({},d),{pathFrom:null===x?c.areaPathsFrom[t]:x,pathTo:c.areaPathsTo[t],strokeWidth:0,fill:a,drawShadow:!1,drawMask:{type:"radial",cx:0,cy:0,r:this.size}}));if(e.config.chart.dropShadow.enabled){const t=new dt(this.w),s=e.config.chart.dropShadow;t.dropShadow(o,Object.assign({},s,{noUserSpaceOnUse:!0}),r)}h.add(o)}t.forEach((t,s)=>{const i=new mt(this.w,this.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:r,dataPointIndex:s}),o=this.graphics.drawMarker(g[s].x,g[s].y,i);o.attr("rel",s),o.attr("j",s),o.attr("index",r),o.node.setAttribute("default-marker-size",i.pSize);const l=this.graphics.group({class:"apexcharts-series-markers"});l&&l.add(o),p.add(l),h.add(p);const c=e.config.dataLabels;if(c.enabled){const t=c.formatter(e.seriesData.series[r][s],{seriesIndex:r,dataPointIndex:s,w:e});a.plotDataLabelsText({x:g[s].x,y:g[s].y,text:t,textAnchor:"middle",i:r,j:r,parent:u,offsetCorrection:!1,dataLabelsConfig:n({},c)})}h.add(u)}),i.push(h)}),this.drawPolygons({parent:d}),e.config.xaxis.labels.show){const t=this.drawXAxisTexts();d.add(t)}return i.forEach(t=>{d.add(t)}),d.add(this.yaxisLabels),d}drawPolygons(t){const e=this.w,{parent:s}=t,i=new Zi(this.w),a=e.globals.yAxisScale[0].result.reverse(),r=a.length,o=[],n=this.size/(r-1);for(let t=0;t<r;t++)o[t]=n*t;o.reverse();const l=[],h=[];o.forEach((t,e)=>{const s=b.getPolygonPos(t,this.dataPointsLen);let i="";s.forEach((t,s)=>{if(0===e){const e=this.graphics.drawLine(t.x,t.y,0,0,Array.isArray(this.polygons.connectorColors)?this.polygons.connectorColors[s]:this.polygons.connectorColors);h.push(e)}0===s&&this.yaxisLabelsTextsPos.push({x:t.x,y:t.y}),i+=t.x+","+t.y+" "}),l.push(i)}),l.forEach((t,i)=>{const a=this.polygons.strokeColors,r=this.polygons.strokeWidth,o=this.graphics.drawPolygon(t,Array.isArray(a)?a[i]:a,Array.isArray(r)?r[i]:r,e.globals.radarPolygons.fill.colors[i]);s.add(o)}),h.forEach(t=>{s.add(t)}),e.config.yaxis[0].show&&this.yaxisLabelsTextsPos.forEach((t,e)=>{const s=i.drawYAxisTexts(t.x,t.y,e,a[e]);this.yaxisLabels.add(s)})}drawXAxisTexts(){const t=this.w,e=t.config.xaxis.labels,s=this.graphics.group({class:"apexcharts-xaxis"}),i=b.getPolygonPos(this.size,this.dataPointsLen);return t.labelData.labels.forEach((a,r)=>{const o=t.config.xaxis.labels.formatter,l=new yt(this.w,this.ctx);if(i[r]){const h=this.getTextPos(i[r],this.size),c=o(a,{seriesIndex:-1,dataPointIndex:r,w:t});l.plotDataLabelsText({x:h.newX,y:h.newY,text:c,textAnchor:h.textAnchor,i:r,j:r,parent:s,className:"apexcharts-xaxis-label",color:Array.isArray(e.style.colors)&&e.style.colors[r]?e.style.colors[r]:"#a8a8a8",dataLabelsConfig:n({textAnchor:h.textAnchor,dropShadow:{enabled:!1}},e),offsetCorrection:!1}).on("click",e=>{if("function"==typeof t.config.chart.events.xAxisLabelClick){const s=Object.assign({},t,{labelIndex:r});t.config.chart.events.xAxisLabelClick(e,this.ctx,s)}})}}),s}createPaths(t,e){const s=[];let i=[];const a=[];let r=[];if(t.length){i=[this.graphics.move(e.x,e.y)],r=[this.graphics.move(e.x,e.y)];let o=this.graphics.move(t[0].x,t[0].y),n=this.graphics.move(t[0].x,t[0].y);t.forEach((e,s)=>{o+=this.graphics.line(e.x,e.y),n+=this.graphics.line(e.x,e.y),s===t.length-1&&(o+="Z",n+="Z")}),s.push(o),a.push(n)}return{linePathsFrom:i,linePathsTo:s,areaPathsFrom:r,areaPathsTo:a}}getTextPos(t,e){let s="middle",i=t.x,a=t.y;return Math.abs(t.x)>=10?t.x>0?(s="start",i+=10):t.x<0&&(s="end",i-=10):s="middle",Math.abs(t.y)>=e-10&&(t.y<0?a-=10:t.y>0&&(a+=10)),{textAnchor:s,newX:i,newY:a}}getPreviousPath(t){const e=this.w;let s=null;for(let i=0;i<e.globals.previousPaths.length;i++){const a=e.globals.previousPaths[i];a.paths.length>0&&parseInt(a.realIndex,10)===parseInt(String(t),10)&&void 0!==e.globals.previousPaths[i].paths[0]&&(s=e.globals.previousPaths[i].paths[0].d)}return s}getDataPointsPos(t,e,s=this.dataPointsLen){t=t||[],e=e||[];const i=[];for(let a=0;a<s;a++){const s={};s.x=t[a]*Math.sin(e[a]),s.y=-t[a]*Math.cos(e[a]),i.push(s)}return i}},heatmap:class{constructor(t,e,s){this.ctx=e,this.w=t,this.xRatio=s.xRatio,this.yRatio=s.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new Vi(t,e),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}draw(t){const e=this.w,s=new gt(this.w,this.ctx),i=s.group({class:"apexcharts-heatmap"});i.attr("clip-path",`url(#gridRectMask${e.globals.cuid})`);const a=e.layout.gridWidth/e.globals.dataPoints,r=e.layout.gridHeight/e.seriesData.series.length;let o=0,n=!1;this.negRange=this.helpers.checkColorRange();const l=t.slice();e.config.yaxis[0].reversed&&(n=!0,l.reverse());for(let h=n?0:l.length-1;n?h<l.length:h>=0;n?h++:h--){const n=s.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:b.escapeString(e.seriesData.seriesNames[h]),rel:h+1,"data:realIndex":h});if(ce.addCollapsedClassToSeries(this.w,n,h),s.setupEventDelegation(n,".apexcharts-heatmap-rect"),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;new dt(this.w).dropShadow(n,t,h)}let c=0;const d=e.config.plotOptions.heatmap.shadeIntensity;let g=0;for(let i=0;i<e.globals.dataPoints;i++){if(e.seriesData.seriesX.length&&!e.globals.allSeriesHasEqualX&&e.globals.minX+e.globals.minXDiff*i<e.seriesData.seriesX[h][g]){c+=a;continue}if(g>=l[h].length)break;const p=this.helpers.getShadeColor(e.config.chart.type,h,g,this.negRange);let u=p.color;const x=p.colorProps;if("image"===e.config.fill.type){u=new pt(this.w).fillPath({seriesNumber:h,dataPointIndex:g,opacity:e.globals.hasNegs?x.percent<0?1-(1+x.percent/100):d+x.percent/100:x.percent/100,patternID:b.randomId(),width:e.config.fill.image.width?e.config.fill.image.width:a,height:e.config.fill.image.height?e.config.fill.image.height:r})}const f=this.rectRadius,m=s.drawRect(c,o,a,r,f);if(m.attr({cx:c,cy:o}),m.node.classList.add("apexcharts-heatmap-rect"),n.add(m),m.attr({fill:u,i:h,index:h,j:g,val:t[h][g],"stroke-width":this.strokeWidth,stroke:e.config.plotOptions.heatmap.useFillColorAsStroke?u:e.globals.stroke.colors[0],color:u}),e.config.chart.animations.enabled&&!e.globals.dataChanged){let t=1;e.globals.resized||(t=e.config.chart.animations.speed),this.animateHeatMap(m,c,o,a,r,t,h,g)}if(e.globals.dataChanged){let t=1;if(this.dynamicAnim.enabled&&e.globals.shouldAnimate){t=this.dynamicAnim.speed;let s=e.globals.previousPaths[h]&&e.globals.previousPaths[h][g]&&e.globals.previousPaths[h][g].color;s||(s="rgba(255, 255, 255, 0)"),this.animateHeatColor(m,b.isColorHex(s)?s:b.rgb2hex(s),b.isColorHex(u)?u:b.rgb2hex(u),t)}}const y=(0,e.config.dataLabels.formatter)(e.seriesData.series[h][g],{value:e.seriesData.series[h][g],seriesIndex:h,dataPointIndex:g,w:e}),w=this.helpers.calculateDataLabels({text:y,x:c+a/2,y:o+r/2,i:h,j:g,colorProps:x,series:l});null!==w&&n.add(w),c+=a,g++}o+=r,i.add(n)}const h=e.globals.yAxisScale[0].result.slice();return e.config.yaxis[0].reversed?h.unshift(""):h.push(""),e.globals.yAxisScale[0].result=h,i}animateHeatMap(t,e,s,i,a,r,o=0,n=0){const l=this.w,h=new ct(this.w),c=l.config.chart.animations.animateGradually;let d=0;if(c&&!1!==c.enabled){const t=((l.seriesData.series||[]).length||1)+(l.globals.dataPoints||1)-2;d=ht({style:"diagonal",index:n,row:o,col:n,baseDelay:Math.min(c.delay||0,.5*r/Math.max(1,t))})}h.animateRect(t,{x:e+i/2,y:s+a/2,width:0,height:0},{x:e,y:s,width:i,height:a},r,()=>{h.animationCompleted(t)},d)}animateHeatColor(t,e,s,i){t.attr({fill:e}).animate(i).attr({fill:s})}},treemap:class{constructor(t,e){this.ctx=e,this.w=t,this.strokeWidth=this.w.config.stroke.width,this.helpers=new Vi(t,e),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}draw(t){const e=this.w,s=new gt(this.w,this.ctx),i=new pt(this.w),a=s.group({class:"apexcharts-treemap"});if(e.globals.noData)return a;const r=[];t.forEach(t=>{const e=t.map(t=>Math.abs(t));r.push(e)}),this.negRange=this.helpers.checkColorRange(),e.config.series.forEach((t,e)=>{t.data.forEach(t=>{Array.isArray(this.labels[e])||(this.labels[e]=[]),this.labels[e].push(t.x)})});return ia.generate(r,e.layout.gridWidth,e.layout.gridHeight).forEach((r,o)=>{var n;const l=s.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:b.escapeString(e.seriesData.seriesNames[o]),rel:o+1,"data:realIndex":o});if(s.setupEventDelegation(l,".apexcharts-treemap-rect"),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;new dt(this.w).dropShadow(a,t,o)}const h=s.group({class:"apexcharts-data-labels"}),c={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},d=e.config.chart.animations,g=d.animateGradually,p=g&&!1!==g.enabled,u=new Array(r.length).fill(0);if(p){const t=r.length||1,e=Math.min(g.delay||0,.5*d.speed/t);r.map((t,e)=>({j:e,area:(t[2]-t[0])*(t[3]-t[1])})).sort((t,e)=>e.area-t.area).forEach((t,s)=>{u[t.j]=s*e})}r.forEach((a,r)=>{const n=a[0],h=a[1],d=a[2],g=a[3];c.xMin=Math.min(c.xMin,n),c.yMin=Math.min(c.yMin,h),c.xMax=Math.max(c.xMax,d),c.yMax=Math.max(c.yMax,g);const p=this.helpers.getShadeColor(e.config.chart.type,o,r,this.negRange),x=p.color,f=i.fillPath({color:x,seriesNumber:o,dataPointIndex:r}),m=s.drawRect(n,h,d-n,g-h,e.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,e.config.plotOptions.treemap.useFillColorAsStroke?x:e.globals.stroke.colors[o]);m.attr({cx:n,cy:h,index:o,i:o,j:r,width:d-n,height:g-h,fill:f}),m.node.classList.add("apexcharts-treemap-rect");let b={x:n+(d-n)/2,y:h+(g-h)/2,width:0,height:0};const y={x:n,y:h,width:d-n,height:g-h};if(e.config.chart.animations.enabled&&!e.globals.dataChanged){let t=1;e.globals.resized||(t=e.config.chart.animations.speed),this.animateTreemap(m,b,y,t,u[r]||0)}if(e.globals.dataChanged){let t=1;this.dynamicAnim.enabled&&e.globals.shouldAnimate&&(t=this.dynamicAnim.speed,e.globals.previousPaths[o]&&e.globals.previousPaths[o][r]&&e.globals.previousPaths[o][r].rect&&(b=e.globals.previousPaths[o][r].rect),this.animateTreemap(m,b,y,t))}let w=this.getFontSize(a),v=e.config.dataLabels.formatter(this.labels[o][r],{value:e.seriesData.series[o][r],seriesIndex:o,dataPointIndex:r,w:e});"truncate"===e.config.plotOptions.treemap.dataLabels.format&&(w=parseInt(String(e.config.dataLabels.style.fontSize),10),v=this.truncateLabels(String(v),w,n,h,d,g));let A=null;e.seriesData.series[o][r]&&(A=this.helpers.calculateDataLabels({text:v,x:(n+d)/2,y:(h+g)/2+this.strokeWidth/2+w/3,i:o,j:r,colorProps:p,fontSize:w,series:t})),e.config.dataLabels.enabled&&A&&this.rotateToFitLabel(A,w,v,n,h,d,g),l.add(m),null!==A&&l.add(A)});const x=e.config.plotOptions.treemap.seriesTitle;if(e.config.series.length>1&&x&&x.show){const t=e.config.series[o].name||"";if(t&&c.xMin<1/0&&c.yMin<1/0){const{offsetX:i,offsetY:a,borderColor:r,borderWidth:o,borderRadius:h,style:d}=x,g=d.color||e.config.chart.foreColor,p={left:d.padding.left,right:d.padding.right,top:d.padding.top,bottom:d.padding.bottom},u=s.getTextRects(t,d.fontSize,d.fontFamily),f=u.width+p.left+p.right,m=u.height+p.top+p.bottom,b=c.xMin+(i||0),y=c.yMin+(a||0),w=s.drawRect(b,y,f,m,h,d.background,1,o,r),v=s.drawText({x:b+p.left,y:y+p.top+.75*(null!=(n=null==u?void 0:u.height)?n:0),text:t,fontSize:d.fontSize,fontFamily:d.fontFamily,fontWeight:d.fontWeight,foreColor:g,cssClass:d.cssClass||""});l.add(w),l.add(v)}}l.add(h),a.add(l)}),a}getFontSize(t){const e=this.w;const s=function t(e){let s,i=0;if(Array.isArray(e[0]))for(s=0;s<e.length;s++)i+=t(e[s]);else for(s=0;s<e.length;s++)i+=e[s].length;return i}(this.labels)/function t(e){let s,i=0;if(Array.isArray(e[0]))for(s=0;s<e.length;s++)i+=t(e[s]);else for(s=0;s<e.length;s++)i+=1;return i}(this.labels);return function(t,i){const a=t*i,r=Math.pow(a,.5);return Math.min(r/s,parseInt(e.config.dataLabels.style.fontSize,10))}(t[2]-t[0],t[3]-t[1])}rotateToFitLabel(t,e,s,i,a,r,o){const n=new gt(this.w),l=n.getTextRects(s,String(e));if(l.width+this.w.config.stroke.width+5>r-i&&l.width<=o-a){const e=n.rotateAroundCenter(t.node);t.node.setAttribute("transform",`rotate(-90 ${e.x} ${e.y}) translate(${l.height/3})`)}}truncateLabels(t,e,s,i,a,r){const o=new gt(this.w),n=o.getTextRects(t,String(e)).width+this.w.config.stroke.width+5>a-s&&r-i>a-s?r-i:a-s,l=o.getTextBasedOnMaxWidth({text:t,maxWidth:n,fontSize:e});return t.length!==l.length&&n/e<5?"":l}animateTreemap(t,e,s,i,a=0){const r=new ct(this.w);r.animateRect(t,e,s,i,()=>{r.animationCompleted(t)},a)}}}),module.exports=Cs;
|