apexcharts 5.5.1 → 5.6.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.
@@ -2,4 +2,4 @@
2
2
  * ApexCharts v5.5.1
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,o=Object.prototype.propertyIsEnumerable,r=(e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,l=(t,e)=>{for(var s in e||(e={}))a.call(e,s)&&r(t,s,e[s]);if(i)for(var s of i(e))o.call(e,s)&&r(t,s,e[s]);return t},n=(t,i)=>e(t,s(i));class h{static isSSR(){return"undefined"==typeof window||"undefined"==typeof document}static isBrowser(){return!this.isSSR()}static hasAPI(t){return!this.isSSR()&&void 0!==window[t]}}class c{constructor(t,e=null){this.nodeName=t,this.namespaceURI=e,this.attributes=new Map,this.children=[],this.textContent="",this.style={},this.classList=new d,this.parentNode=null}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){return t&&t!==this&&(t.parentNode=this,this.children.push(t)),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);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 c(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}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 d{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 g{constructor(){this.SVGNS="http://www.w3.org/2000/svg",this.XLINKNS="http://www.w3.org/1999/xlink"}createElementNS(t,e){return new c(e,t)}createTextNode(t){return{nodeName:"#text",nodeType:3,textContent:t,toString(){return this.textContent}}}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 c("root");return s.innerHTML=t,{documentElement:s}}}}}let p=null,x=null,b=null;class f{static init(){h.isSSR()&&!p&&(p=new g)}static createElementNS(t,e){return h.isSSR()?(p||this.init(),p.createElementNS(t,e)):document.createElementNS(t,e)}static createTextNode(t){return h.isSSR()?(p||this.init(),p.createTextNode(t)):document.createTextNode(t)}static querySelector(t){return h.isSSR()?null:document.querySelector(t)}static querySelectorAll(t){return h.isSSR()?[]:document.querySelectorAll(t)}static getComputedStyle(t){return h.isSSR()?{}:window.getComputedStyle(t)}static getBoundingClientRect(t){return h.isSSR()?(p||this.init(),p.getBoundingClientRect(t)):t?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}static getXMLSerializer(){return h.isSSR()?(p||this.init(),x||(x=p.createXMLSerializer()),x):(x||(x=new XMLSerializer),x)}static getDOMParser(){return h.isSSR()?(p||this.init(),b||(b=p.createDOMParser()),b):(b||(b=new DOMParser),b)}static addWindowEventListener(t,e,s){h.isBrowser()&&window.addEventListener(t,e,s)}static removeWindowEventListener(t,e,s){h.isBrowser()&&window.removeEventListener(t,e,s)}static requestAnimationFrame(t){return h.isBrowser()?window.requestAnimationFrame(t):(t(),null)}static cancelAnimationFrame(t){h.isBrowser()&&t&&window.cancelAnimationFrame(t)}static elementExists(t){return!!t&&(h.isSSR()?!0===t._ssrMode||void 0!==t.nodeName:!!t.getRootNode&&(t.getRootNode({composed:!0})===document||t.isConnected))}static getWindow(){return h.isBrowser()?window:null}static getDocument(){return h.isBrowser()?document:null}static _getShim(){return p}static _resetShim(){p=null,x=null,b=null}}let u=class t{static bind(t,e){return function(){return t.apply(e,arguments)}}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/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}static listToArray(t){let e,s=[];for(e=0;e<t.length;e++)s[e]=t[e];return s}static extend(t,e){"function"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");let e=Object(t);for(let t=1;t<arguments.length;t++){let s=arguments[t];if(null!=s)for(let t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=s[t])}return e});let 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){let 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(let 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(let 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(h.isSSR())return[t._ssrWidth||400,t._ssrHeight||300];const e=t.getRootNode&&t.getRootNode();if(e&&e!==document&&e.host){const t=e.host.getBoundingClientRect();return[t.width,t.height]}let s;try{s=getComputedStyle(t,null)}catch(e){return[t.clientWidth||0,t.clientHeight||0]}let i=t.clientHeight,a=t.clientWidth;return i-=parseFloat(s.paddingTop)+parseFloat(s.paddingBottom),a-=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),[a,i]}static getBoundingClientRect(t){if(!t)return{top:0,right:0,bottom:0,left:0,width:0,height:0,x:0,y:0};if(h.isSSR())return f.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");let s=t.replace("#","");s=s.match(new RegExp("(.{"+s.length/3+"})","g"));for(let t=0;t<s.length;t++)s[t]=parseInt(1===s[t].length?s[t]+s[t]:s[t],16);return void 0!==e&&s.push(e),"rgba("+s.join(",")+")"}static getOpacityFromRGBA(t){return parseFloat(t.replace(/^.*,(.+)\)/,"$1"))}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){let s=e.split(","),i=t<0?0:255,a=t<0?-1*t:t,o=parseInt(s[0].slice(4),10),r=parseInt(s[1],10),l=parseInt(s[2],10);return"rgb("+(Math.round((i-o)*a)+o)+","+(Math.round((i-r)*a)+r)+","+(Math.round((i-l)*a)+l)+")"}shadeHexColor(t,e){let s=parseInt(e.slice(1),16),i=t<0?0:255,a=t<0?-1*t:t,o=s>>16,r=s>>8&255,l=255&s;return"#"+(16777216+65536*(Math.round((i-o)*a)+o)+256*(Math.round((i-r)*a)+r)+(Math.round((i-l)*a)+l)).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;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 getPolygonPos(t,e){let s=[],i=2*Math.PI/e;for(let a=0;a<e;a++){let 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){let 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(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t.style.key=e[s])}static preciseAddition(t,e){let 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(Number(t))===t&&!isNaN(parseInt(t,10))}static isFloat(t){return Number(t)===t&&t%1!=0}static isMsEdge(){let 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;){let 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){let 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 m{constructor(t){this.ctx=t,this.w=t.w}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()})}animateRect(t,e,s,i,a){t.attr(e).animate(i).attr(s).after(()=>a())}animatePathsGradually(t){let{el:e,realIndex:s,j:i,fill:a,pathFrom:o,pathTo:r,speed:l,delay:n}=t,h=this.w,c=0;h.config.chart.animations.animateGradually.enabled&&(c=h.config.chart.animations.animateGradually.delay),h.config.chart.animations.dynamicAnimation.enabled&&h.globals.dataChanged&&"bar"!==h.config.chart.type&&(c=0),this.morphSVG(e,s,i,"line"!==h.config.chart.type||h.globals.comboCharts?a:"stroke",o,r,l,n*c)}showDelayedElements(){this.w.globals.delayedElements.forEach(t=>{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}))}morphSVG(t,e,s,i,a,o,r,l){let n=this.w;a||(a=t.attr("pathFrom")),o||(o=t.attr("pathTo"));const h=()=>("radar"===n.config.chart.type&&(r=1),`M 0 ${n.globals.gridHeight}`);(!a||a.indexOf("undefined")>-1||a.indexOf("NaN")>-1)&&(a=h()),(!o.trim()||o.indexOf("undefined")>-1||o.indexOf("NaN")>-1)&&(o=h()),n.globals.shouldAnimate||(r=1),t.plot(a).animate(1,l).plot(a).animate(r,l).plot(o).after(()=>{u.isNumber(s)?s===n.globals.series[n.globals.maxValsInArrayIndex].length-2&&n.globals.shouldAnimate&&this.animationCompleted(t):"none"!==i&&n.globals.shouldAnimate&&(!n.globals.comboCharts&&e===n.globals.series.length-1||n.globals.comboCharts)&&this.animationCompleted(t),this.showDelayedElements()})}}class y{constructor(t){this.ctx=t,this.w=t.w}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,o;const r=this.w;if(t.unfilter&&t.unfilter(!0),"none"===s)return void this.getDefaultFilter(t,e);const l=r.config.chart.dropShadow,n="lighten"===s?2:.3;t.filterWith&&(t.filterWith(t=>{t.colorMatrix({type:"matrix",values:`\n ${n} 0 0 0 0\n 0 ${n} 0 0 0\n 0 0 ${n} 0 0\n 0 0 0 1 0\n `,in:"SourceGraphic",result:"brightness"}),l.enabled&&this.addShadow(t,e,l,"brightness")}),l.noUserSpaceOnUse||null==(a=null==(i=t.filterer())?void 0:i.node)||a.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(o=t.filterer())?void 0:o.node))}addShadow(t,e,s,i){var a;const o=this.w;let{blur:r,top:l,left:n,color:h,opacity:c}=s;if(h=Array.isArray(h)?h[e]:h,(null==(a=o.config.chart.dropShadow.enabledOnSeries)?void 0:a.length)>0&&-1===o.config.chart.dropShadow.enabledOnSeries.indexOf(e))return t;t.offset({in:i,dx:n,dy:l,result:"offset"}),t.gaussianBlur({in:"offset",stdDeviation:r,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,o,r,l;const n=this.w;return t.unfilter&&t.unfilter(!0),u.isMsEdge()&&"radialBar"===n.config.chart.type||(null==(i=n.config.chart.dropShadow.enabledOnSeries)?void 0:i.length)>0&&-1===(null==(a=n.config.chart.dropShadow.enabledOnSeries)?void 0:a.indexOf(s))||t.filterWith&&(t.filterWith(t=>{this.addShadow(t,s,e,"SourceGraphic")}),e.noUserSpaceOnUse||null==(r=null==(o=t.filterer())?void 0:o.node)||r.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(l=t.filterer())?void 0:l.node)),t}setSelectionFilter(t,e,s){const i=this.w;if(void 0!==i.globals.selectedDataPoints[e]&&i.globals.selectedDataPoints[e].indexOf(s)>-1){t.node.setAttribute("selected",!0);let s=i.config.states.active.filter;"none"!==s&&this.applyFilter(t,e,s.type)}}_scaleFilterSize(t){if(!t)return;(e=>{for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.setAttribute(s,e[s])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}class w{constructor(t){this.ctx=t,this.w=t.w}roundPathCorners(t,e){function s(t,e,s){var a=e.x-t.x,o=e.y-t.y,r=Math.sqrt(a*a+o*o);return i(t,e,Math.min(1,s/r))}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 o(t){return{x:parseFloat(t[t.length-2]),y:parseFloat(t[t.length-1])}}t.indexOf("NaN")>-1&&(t="");var r=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},[]),l=[];if(r.length>1){var n=o(r[0]),h=null;"Z"==r[r.length-1][0]&&r[0].length>2&&(h=["L",n.x,n.y],r[r.length-1]=h),l.push(r[0]);for(var c=1;c<r.length;c++){var d=l[l.length-1],g=r[c],p=g==h?r[1]:r[c+1];if(p&&d&&d.length>2&&"L"==g[0]&&p.length>2&&"L"==p[0]){var x,b,f=o(d),u=o(g),m=o(p);x=s(u,f,e),b=s(u,m,e),a(g,x),g.origPoint=u,l.push(g);var y=i(x,u,.5),w=i(u,b,.5),v=["C",y.x,y.y,w.x,w.y,b.x,b.y];v.origPoint=u,l.push(v)}else l.push(g)}if(h){var A=o(l[l.length-1]);l.push(["Z"]),a(l[0],A)}}else l=r;return l.reduce(function(t,e){return t+e.join(" ")+" "},"")}drawLine(t,e,s,i,a="#a8a8a8",o=0,r=null,l="butt"){return this.w.globals.dom.Paper.line().attr({x1:t,y1:e,x2:s,y2:i,stroke:a,"stroke-dasharray":o,"stroke-width":r,"stroke-linecap":l})}drawRect(t=0,e=0,s=0,i=0,a=0,o="#fefefe",r=1,l=null,n=null,h=0){let c=this.w.globals.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:r,"stroke-width":null!==l?l:0,stroke:null!==n?n:"none","stroke-dasharray":h}),c.node.setAttribute("fill",o),c}drawPolygon(t,e="#e1e1e1",s=1,i="none"){return this.w.globals.dom.Paper.polygon(t).attr({fill:i,stroke:e,"stroke-width":s})}drawCircle(t,e=null){t<0&&(t=0);const s=this.w.globals.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:o=1,classes:r,strokeLinecap:l=null,strokeDashArray:n=0}){let h=this.w;return null===l&&(l=h.config.stroke.lineCap),(t.indexOf("undefined")>-1||t.indexOf("NaN")>-1)&&(t=`M 0 ${h.globals.gridHeight}`),h.globals.dom.Paper.path(t).attr({fill:i,"fill-opacity":a,stroke:e,"stroke-opacity":o,"stroke-linecap":l,"stroke-width":s,"stroke-dasharray":n,class:r})}group(t=null){const e=this.w.globals.dom.Paper.group();return null!==t&&e.attr(t),e}move(t,e){return["M",t,e].join(" ")}line(t,e,s=null){let i=null;return null===s?i=[" L",t,e].join(" "):"H"===s?i=[" H",t].join(" "):"V"===s&&(i=[" V",e].join(" ")),i}curve(t,e,s,i,a,o){return["C",t,e,s,i,a,o].join(" ")}quadraticCurve(t,e,s,i){return["Q",t,e,s,i].join(" ")}arc(t,e,s,i,a,o,r,l=!1){let n="A";return l&&(n="a"),[n,t,e,s,i,a,o,r].join(" ")}renderPaths({j:t,realIndex:e,pathFrom:s,pathTo:i,stroke:a,strokeWidth:o,strokeLinecap:r,fill:h,animationDelay:c,initialSpeed:d,dataChangeSpeed:g,className:p,chartType:x,shouldClipToGrid:b=!0,bindEventsOnPaths:f=!0,drawShadow:u=!0}){let w=this.w;const v=new y(this.ctx),A=new m(this.ctx);let C,S=this.w.config.chart.animations.enabled,k=S&&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 L=!!(S&&!w.globals.resized||k&&w.globals.dataChanged&&w.globals.shouldAnimate);L?C=s:(C=i,w.globals.animationEnded=!0);let M=w.config.stroke.dashArray,P=0;P=Array.isArray(M)?M[e]:w.config.stroke.dashArray;let I=this.drawPath({d:C,stroke:a,strokeWidth:o,fill:h,fillOpacity:1,classes:p,strokeLinecap:r,strokeDashArray:P});I.attr("index",e),b&&("bar"===x&&!w.globals.isHorizontal||w.globals.comboCharts?I.attr({"clip-path":`url(#gridRectBarMask${w.globals.cuid})`}):I.attr({"clip-path":`url(#gridRectMask${w.globals.cuid})`})),w.config.chart.dropShadow.enabled&&u&&v.dropShadow(I,w.config.chart.dropShadow,e),f&&(I.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,I)),I.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,I)),I.node.addEventListener("mousedown",this.pathMouseDown.bind(this,I))),I.attr({pathTo:i,pathFrom:s});const T={el:I,j:t,realIndex:e,pathFrom:s,pathTo:i,fill:h,strokeWidth:o,delay:c};return!S||w.globals.resized||w.globals.dataChanged?!w.globals.resized&&w.globals.dataChanged||A.showDelayedElements():A.animatePathsGradually(n(l({},T),{speed:d})),w.globals.dataChanged&&k&&L&&A.animatePathsGradually(n(l({},T),{speed:g})),I}drawPattern(t,e,s,i="#a8a8a8",a=0){return this.w.globals.dom.Paper.pattern(e,s,o=>{"horizontalLines"===t?o.line(0,0,s,0).stroke({color:i,width:a+1}):"verticalLines"===t?o.line(0,0,0,e).stroke({color:i,width:a+1}):"slantedLines"===t?o.line(0,0,e,s).stroke({color:i,width:a}):"squares"===t?o.rect(e,s).fill("none").stroke({color:i,width:a}):"circles"===t&&o.circle(e).fill("none").stroke({color:i,width:a})})}drawGradient(t,e,s,i,a,o=null,r=null,l=[],n=0){let h,c=this.w;e.length<9&&0===e.indexOf("#")&&(e=u.hexToRgba(e,i)),s.length<9&&0===s.indexOf("#")&&(s=u.hexToRgba(s,a));let d=0,g=1,p=1,x=null;null!==r&&(d=void 0!==r[0]?r[0]/100:0,g=void 0!==r[1]?r[1]/100:1,p=void 0!==r[2]?r[2]/100:1,x=void 0!==r[3]?r[3]/100:null);let b=!("donut"!==c.config.chart.type&&"pie"!==c.config.chart.type&&"polarArea"!==c.config.chart.type&&"bubble"!==c.config.chart.type);if(h=l&&0!==l.length?c.globals.dom.Paper.gradient(b?"radial":"linear",t=>{(Array.isArray(l[n])?l[n]:l).forEach(e=>{t.stop(e.offset/100,e.color,e.opacity)})}):c.globals.dom.Paper.gradient(b?"radial":"linear",t=>{t.stop(d,e,i),t.stop(g,s,a),t.stop(p,s,a),null!==x&&t.stop(x,e,i)}),b){let t=c.globals.gridWidth/2,e=c.globals.gridHeight/2;"bubble"!==c.config.chart.type?h.attr({gradientUnits:"userSpaceOnUse",cx:t,cy:e,r:o}):h.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else"vertical"===t?h.from(0,0).to(0,1):"diagonal"===t?h.from(0,0).to(1,1):"horizontal"===t?h.from(0,1).to(1,1):"diagonal2"===t&&h.from(1,0).to(0,1);return h}getTextBasedOnMaxWidth({text:t,maxWidth:e,fontSize:s,fontFamily:i}){const a=this.getTextRects(t,s,i),o=a.width/t.length,r=Math.floor(e/o);return e<a.width?t.slice(0,r-3)+"...":t}drawText({x:t,y:e,text:s,textAnchor:i,fontSize:a,fontFamily:o,fontWeight:r,foreColor:n,opacity:h,maxWidth:c,cssClass:d="",isPlainText:g=!0,dominantBaseline:p="auto"}){let x=this.w;void 0===s&&(s="");let b=s;i||(i="start"),n&&n.length||(n=x.config.chart.foreColor),o=o||x.config.chart.fontFamily,r=r||"regular";const f={maxWidth:c,fontSize:a=a||"11px",fontFamily:o};let u;return Array.isArray(s)?u=x.globals.dom.Paper.text(t=>{for(let e=0;e<s.length;e++)b=s[e],c&&(b=this.getTextBasedOnMaxWidth(l({text:s[e]},f))),0===e?t.tspan(b):t.tspan(b).newLine()}):(c&&(b=this.getTextBasedOnMaxWidth(l({text:s},f))),u=g?x.globals.dom.Paper.plain(s):x.globals.dom.Paper.text(t=>t.tspan(b))),u.attr({x:t,y:e,"text-anchor":i,"dominant-baseline":p,"font-size":a,"font-family":o,"font-weight":r,fill:n,class:"apexcharts-text "+d}),u.node.style.fontFamily=o,u.node.style.opacity=h,u}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 o=5;i*=1.15,"sparkle"===s&&(i/=1.1,o=4);const r=Math.PI/o;for(let s=0;s<=2*o;s++){const o=s*r,l=s%2==0?i:i/2;a+=(0===s?"M":"L")+(t+l*Math.sin(o))+","+(e-l*Math.cos(o))}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 o=this.drawPath({d:this.getMarkerPath(t,e,s,i,a),stroke:a.pointStrokeColor,strokeDashArray:a.pointStrokeDashArray,strokeWidth:a.pointStrokeWidth,fill:a.pointFillColor,fillOpacity:a.pointFillOpacity,strokeOpacity:a.pointStrokeOpacity});return o.attr({cx:t,cy:e,shape:a.shape,class:a.class?a.class:""}),o}drawMarker(t,e,s){t=t||0;let i=s.pSize||0;return u.isNumber(e)||(i=0,e=0),this.drawMarkerShape(t,e,null==s?void 0:s.shape,i,l(l({},s),"line"===s.shape||"plus"===s.shape||"cross"===s.shape?{pointStrokeColor:s.pointFillColor,pointStrokeOpacity:s.pointFillOpacity}:{}))}pathMouseEnter(t,e){let s=this.w;const i=new y(this.ctx),a=parseInt(t.node.getAttribute("index"),10),o=parseInt(t.node.getAttribute("j"),10);if("function"==typeof s.config.chart.events.dataPointMouseEnter&&s.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:a,dataPointIndex:o,w:s}),this.ctx.events.fireEvent("dataPointMouseEnter",[e,this.ctx,{seriesIndex:a,dataPointIndex:o,w:s}]),("none"===s.config.states.active.filter.type||"true"!==t.node.getAttribute("selected"))&&"none"!==s.config.states.hover.filter.type&&!s.globals.isTouchDevice){let e=s.config.states.hover.filter;i.applyFilter(t,a,e.type)}}pathMouseLeave(t,e){let s=this.w;const i=new y(this.ctx),a=parseInt(t.node.getAttribute("index"),10),o=parseInt(t.node.getAttribute("j"),10);"function"==typeof s.config.chart.events.dataPointMouseLeave&&s.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:a,dataPointIndex:o,w:s}),this.ctx.events.fireEvent("dataPointMouseLeave",[e,this.ctx,{seriesIndex:a,dataPointIndex:o,w:s}]),"none"!==s.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"!==s.config.states.hover.filter.type&&i.getDefaultFilter(t,a)}pathMouseDown(t,e){let s=this.w;const i=new y(this.ctx),a=parseInt(t.node.getAttribute("index"),10),o=parseInt(t.node.getAttribute("j"),10);let r="false";if("true"===t.node.getAttribute("selected")){if(t.node.setAttribute("selected","false"),s.globals.selectedDataPoints[a].indexOf(o)>-1){let t=s.globals.selectedDataPoints[a].indexOf(o);s.globals.selectedDataPoints[a].splice(t,1)}}else{if(!s.config.states.active.allowMultipleDataPointsSelection&&s.globals.selectedDataPoints.length>0){s.globals.selectedDataPoints=[];const t=s.globals.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),e=s.globals.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),o=t=>{Array.prototype.forEach.call(t,t=>{t.node.setAttribute("selected","false"),i.getDefaultFilter(t,a)})};o(t),o(e)}t.node.setAttribute("selected","true"),r="true",void 0===s.globals.selectedDataPoints[a]&&(s.globals.selectedDataPoints[a]=[]),s.globals.selectedDataPoints[a].push(o)}if("true"===r){let e=s.config.states.active.filter;if("none"!==e)i.applyFilter(t,a,e.type);else if("none"!==s.config.states.hover.filter&&!s.globals.isTouchDevice){let e=s.config.states.hover.filter;i.applyFilter(t,a,e.type)}}else if("none"!==s.config.states.active.filter.type)if("none"===s.config.states.hover.filter.type||s.globals.isTouchDevice)i.getDefaultFilter(t,a);else{let e=s.config.states.hover.filter;i.applyFilter(t,a,e.type)}"function"==typeof s.config.chart.events.dataPointSelection&&s.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:s.globals.selectedDataPoints,seriesIndex:a,dataPointIndex:o,w:s}),e&&this.ctx.events.fireEvent("dataPointSelection",[e,this.ctx,{selectedDataPoints:s.globals.selectedDataPoints,seriesIndex:a,dataPointIndex:o,w:s}])}rotateAroundCenter(t){let e={};return t&&"function"==typeof t.getBBox&&(e=t.getBBox()),{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=w._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?w._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=w._findDelegateTarget(s.target,t.node,e);i&&i.instance&&this.pathMouseDown(i.instance,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(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.setAttribute(s,e[s])}getTextRects(t,e,s,i,a=!0){let o=this.w;const r=`${t}|${e}|${s}|${i}|${a}`,l=o.globals.textRectsCache;if(l&&l.has(r))return l.get(r);let n=this.drawText({x:-200,y:-200,text:t,textAnchor:"start",fontSize:e,fontFamily:s,foreColor:"#fff",opacity:0});i&&n.attr("transform",i),o.globals.dom.Paper.add(n);let h=n.bbox();a||(h=n.node.getBoundingClientRect()),n.remove();const c={width:h.width,height:h.height};return l&&l.set(r,c),c}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 v{constructor(t){this.ctx=t,this.w=t.w}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||i++,void 0!==t.type&&t.type!==e&&a++}),a>0&&(s=!0),{comboBarCount:i,comboCharts:s}}getStackedSeriesTotals(t=[]){const e=this.w;let s=[];if(0===e.globals.series.length)return s;for(let i=0;i<e.globals.series[e.globals.maxValsInArrayIndex].length;i++){let a=0;for(let s=0;s<e.globals.series.length;s++)void 0!==e.globals.series[s][i]&&-1===t.indexOf(s)&&(a+=e.globals.series[s][i]);s.push(a)}return s}getSeriesTotalByIndex(t=null){return null===t?this.w.config.series.reduce((t,e)=>t+e,0):this.w.globals.series[t].reduce((t,e)=>t+e,0)}getStackedSeriesTotalsByGroups(){const t=this.w;let e=[];return t.globals.seriesGroups.forEach(s=>{let i=[];t.config.series.forEach((e,a)=>{s.indexOf(t.globals.seriesNames[a])>-1&&i.push(a)});const a=t.globals.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=[],i=[],a=[],o=t.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]=[]});let r=[];e.yaxis.forEach((t,i)=>{let l=!1;if(t.seriesName){let r=[];Array.isArray(t.seriesName)?r=t.seriesName:r.push(t.seriesName),r.forEach(t=>{e.series.forEach((e,r)=>{if(e.name===t){let t=r;i===r||o?(!o||a.indexOf(r)>-1)&&s[i].push([i,r]):(s[r].push([r,i]),t=i),l=!0,t=a.indexOf(t),-1!==t&&a.splice(t,1)}})})}l||r.push(i)}),s=s.map(t=>{let e=[];return t.forEach(t=>{i[t[1]]=t[0],e.push(t[1])}),e});let l=e.yaxis.length-1;for(let t=0;t<r.length&&(l=r[t],s[l]=[],a);t++){let t=a[0];a.shift(),s[l].push(t),i[t]=l}a.forEach(t=>{s[l].push(t),i[t]=l}),t.seriesYAxisMap=s.map(t=>t),t.seriesYAxisReverseMap=i.map(t=>t),t.seriesYAxisMap.forEach((t,s)=>{t.forEach(t=>{e.series[t]&&void 0===e.series[t].group&&(e.series[t].group="apexcharts-axis-".concat(s.toString()))})})}isSeriesNull(t=null){let e=[];return e=null===t?this.w.config.series.filter(t=>null!==t):this.w.config.series[t].data.filter(t=>null!==t),0===e.length}seriesHaveSameValues(t){return this.w.globals.series[t].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.globals.series.map(t=>t.length).indexOf(Math.max.apply(Math,t.globals.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.globals.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.globals.series.map((i,a)=>{let o=0;for(let r=0;r<i.length;r++)s.globals.seriesX[a][r]>t&&s.globals.seriesX[a][r]<e&&(o+=i[r]);return o})}getPercentSeries(){const t=this.w;t.globals.seriesPercent=t.globals.series.map(e=>{let s=[];if(Array.isArray(e))for(let i=0;i<e.length;i++){let a=t.globals.stackedSeriesTotals[i],o=0;a&&(o=100*e[i]/a),s.push(o)}else{let i=100*e/t.globals.seriesTotals.reduce((t,e)=>t+e,0);s.push(i)}return s})}getCalculatedRatios(){let t=this.w,e=t.globals,s=[],i=0,a=0,o=0,r=0,l=[],n=.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])),l.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]/e.gridHeight);if(a=e.xRange/e.gridWidth,i=e.yRange/e.gridWidth,o=e.xRange/e.gridHeight,r=e.zRange/e.gridHeight*16,r||(r=1),e.minY!==Number.MIN_VALUE&&0!==Math.abs(e.minY)&&(e.hasNegs=!0),t.globals.seriesYAxisReverseMap.length>0){let o=(e,i)=>{let a=t.config.yaxis[t.globals.seriesYAxisReverseMap[i]],o=e<0?-1:1;return e=Math.abs(e),a.logarithmic&&(e=this.getBaseLog(a.logBase,e)),-o*e/s[i]};if(e.isMultipleYAxis){l=[];for(let t=0;t<s.length;t++)l.push(o(e.minYArr[t],t))}else l=[],l.push(o(e.minY,0)),e.minY!==Number.MIN_VALUE&&0!==Math.abs(e.minY)&&(n=-e.minY/i,h=e.minX/a)}else l=[],l.push(0),n=0,h=0;return{yRatio:s,invertedYRatio:i,zRatio:r,xRatio:a,invertedXRatio:o,baseLineInvertedY:n,baseLineY:l,baseLineX:h}}getLogSeries(t){const e=this.w;return e.globals.seriesLog=t.map((t,s)=>{let 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;let 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]),o=(0===i.globals.maxYArr[s]?0:this.getBaseLog(t,i.globals.maxYArr[s]))-a;if(e<1)return e/o;return(this.getBaseLog(t,e)-a)/o}getLogYRatios(t){const e=this.w,s=this.w.globals;return s.yLogRatio=t.slice(),s.logYRange=s.yRange.map((t,i)=>{let a=e.globals.seriesYAxisReverseMap[i];if(e.config.yaxis[a]&&this.w.config.yaxis[a].logarithmic){let t=-Number.MAX_VALUE,a=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),a=Math.min(s,a))})}),o=Math.pow(s.yRange[i],Math.abs(a-t)/s.yRange[i]),s.yLogRatio[i]=o/s.gridHeight,o}}),s.invalidLogScale?t.slice():s.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){let a=this.w,o=[];return t.series.length>0&&e.forEach(e=>{let r=[],l=[];t.i.forEach((s,i)=>{a.config.series[s].group===e&&(r.push(t.series[i]),l.push(s))}),r.length>0&&o.push(i.draw(r,s,l))}),o}}let A=class{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){const s=this.w;if("vertical"===t.label.orientation){const i=null!==e?e:0,a=s.globals.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${i}']`);if(null!==a){const e=a.getBBox();a.setAttribute("x",parseFloat(a.getAttribute("x"))-e.height+4);const s="top"===t.label.position?e.width:-e.width;a.setAttribute("y",parseFloat(a.getAttribute("y"))+s);const{x:i,y:o}=this.annoCtx.graphics.rotateAroundCenter(a);a.setAttribute("transform",`rotate(-90 ${i} ${o})`)}}}addBackgroundToAnno(t,e){const s=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const i=s.globals.dom.baseEl.querySelector(".apexcharts-grid"),a=i.getBoundingClientRect(),o=i.getBBox(),r=a.width/o.width||1,l=t.getBoundingClientRect();let{left:n,right:h,top:c,bottom:d}=e.label.style.padding;"vertical"===e.label.orientation&&([c,d,n,h]=[n,h,c,d]);const g=(l.left-a.left)/r-n,p=(l.top-a.top)/r-c,x=this.annoCtx.graphics.drawRect(g-s.globals.barPadForNumericAxis,p,l.width/r+n+h,l.height/r+c+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&x.node.classList.add(e.id),x}annotationsBackground(){const t=this.w,e=(e,s,i)=>{const a=t.globals.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${s}']`);if(a){const t=a.parentNode,s=this.addBackgroundToAnno(a,e);s&&(t.insertBefore(s.node,a),e.label.mouseEnter&&s.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&s.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&s.node.addEventListener("click",e.label.click.bind(this,e)))}};t.config.annotations.xaxis.forEach((t,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;const i=this.w;let a,o="y1"===t?e.y:e.y2,r=!1;if(this.annoCtx.invertAxis){const t=i.config.xaxis.convertedCatToNumeric?i.globals.categoryLabels:i.globals.labels,s=t.indexOf(o),r=i.globals.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);a=r?parseFloat(r.getAttribute("y")):(i.globals.gridHeight/t.length-1)*(s+1)-i.globals.barHeight,void 0!==e.seriesIndex&&i.globals.barHeight&&(a-=i.globals.barHeight/2*(i.globals.series.length-1)-i.globals.barHeight*e.seriesIndex)}else{const t=i.globals.seriesYAxisMap[e.yAxisIndex][0],l=i.config.yaxis[e.yAxisIndex].logarithmic?new v(this.annoCtx.ctx).getLogVal(i.config.yaxis[e.yAxisIndex].logBase,o,t)/i.globals.yLogRatio[t]:(o-i.globals.minYArr[t])/(i.globals.yRange[t]/i.globals.gridHeight);a=i.globals.gridHeight-Math.min(Math.max(l,0),i.globals.gridHeight),r=l>i.globals.gridHeight||l<0,!e.marker||void 0!==e.y&&null!==e.y||(a=0),(null==(s=i.config.yaxis[e.yAxisIndex])?void 0:s.reversed)&&(a=l)}return"string"==typeof o&&o.includes("px")&&(a=parseFloat(o)),{yP:a,clipped:r}}getX1X2(t,e){const s=this.w,i="x1"===t?e.x:e.x2,a=this.annoCtx.invertAxis?s.globals.minY:s.globals.minX,o=this.annoCtx.invertAxis?s.globals.maxY:s.globals.maxX,r=this.annoCtx.invertAxis?s.globals.yRange[0]:s.globals.xRange;let l=!1,n=this.annoCtx.inversedReversedAxis?(o-i)/(r/s.globals.gridWidth):(i-a)/(r/s.globals.gridWidth);return"category"!==s.config.xaxis.type&&!s.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||s.globals.dataFormatXNumeric||s.config.chart.sparkline.enabled||(n=this.getStringX(i)),"string"==typeof i&&i.includes("px")&&(n=parseFloat(i)),null==i&&e.marker&&(n=s.globals.gridWidth),void 0!==e.seriesIndex&&s.globals.barWidth&&!this.annoCtx.invertAxis&&(n-=s.globals.barWidth/2*(s.globals.series.length-1)-s.globals.barWidth*e.seriesIndex),"number"!=typeof n&&(n=0,l=!0),parseFloat(n.toFixed(10))>parseFloat(s.globals.gridWidth.toFixed(10))?(n=s.globals.gridWidth,l=!0):n<0&&(n=0,l=!0),{x:n,clipped:l}}getStringX(t){const e=this.w;let s=t;e.config.xaxis.convertedCatToNumeric&&e.globals.categoryLabels.length&&(t=e.globals.categoryLabels.indexOf(t)+1);const i=e.globals.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),a=e.globals.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${i+1})`);return a&&(s=parseFloat(a.getAttribute("x"))),s}};class C{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new A(this.annoCtx)}addXaxisAnnotation(t,e,s){let i,a=this.w,o=this.helpers.getX1X2("x1",t),r=o.x,l=o.clipped,n=!0;const h=t.label.text;let c=t.strokeDashArray;if(u.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!l){let s=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,a.globals.gridHeight+t.offsetY,t.borderColor,c,t.borderWidth);e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}else{let s=this.helpers.getX1X2("x2",t);if(i=s.x,n=s.clipped,i<r){let t=r;r=i,i=t}let o=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,i-r,a.globals.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,c);o.node.classList.add("apexcharts-annotation-rect"),o.attr("clip-path",`url(#gridRectMask${a.globals.cuid})`),e.appendChild(o.node),t.id&&o.node.classList.add(t.id)}if(!l||!n){let i=this.annoCtx.graphics.getTextRects(h,parseFloat(t.label.style.fontSize)),o="top"===t.label.position?4:"center"===t.label.position?a.globals.gridHeight/2+("vertical"===t.label.orientation?i.width/2:0):a.globals.gridHeight,l=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:o+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?i.width/2-12:-i.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:""}`});l.attr({rel:s}),e.appendChild(l.node),this.annoCtx.helpers.setOrientations(t,s)}}}drawXAxisAnnotations(){let 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 S{constructor(t){this.ctx=t,this.w=t.w,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;let a=["\0",...s.months],o=["\x01",...s.shortMonths],r=["\x02",...s.days],l=["\x03",...s.shortDays];function n(t,e){let s=t+"";for(e=e||2;s.length<e;)s="0"+s;return s}let 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);let c=(i?t.getUTCMonth():t.getMonth())+1;e=(e=(e=(e=e.replace(/(^|[^\\])MMMM+/g,"$1"+a[0])).replace(/(^|[^\\])MMM/g,"$1"+o[0])).replace(/(^|[^\\])MM/g,"$1"+n(c))).replace(/(^|[^\\])M/g,"$1"+c);let d=i?t.getUTCDate():t.getDate();e=(e=(e=(e=e.replace(/(^|[^\\])dddd+/g,"$1"+r[0])).replace(/(^|[^\\])ddd/g,"$1"+l[0])).replace(/(^|[^\\])dd/g,"$1"+n(d))).replace(/(^|[^\\])d/g,"$1"+d);let g=i?t.getUTCHours():t.getHours(),p=g>12?g-12:0===g?12:g;e=(e=(e=(e=e.replace(/(^|[^\\])HH+/g,"$1"+n(g))).replace(/(^|[^\\])H/g,"$1"+g)).replace(/(^|[^\\])hh+/g,"$1"+n(p))).replace(/(^|[^\\])h/g,"$1"+p);let x=i?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\])mm+/g,"$1"+n(x))).replace(/(^|[^\\])m/g,"$1"+x);let b=i?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\])ss+/g,"$1"+n(b))).replace(/(^|[^\\])s/g,"$1"+b);let f=i?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+n(f,3)),f=Math.round(f/10),e=e.replace(/(^|[^\\])ff/g,"$1"+n(f)),f=Math.round(f/10);let u=g<12?"AM":"PM";e=(e=(e=e.replace(/(^|[^\\])f/g,"$1"+f)).replace(/(^|[^\\])TT+/g,"$1"+u)).replace(/(^|[^\\])T/g,"$1"+u.charAt(0));let m=u.toLowerCase();e=(e=e.replace(/(^|[^\\])tt+/g,"$1"+m)).replace(/(^|[^\\])t/g,"$1"+m.charAt(0));let y=-t.getTimezoneOffset(),w=i||!y?"Z":y>0?"+":"-";if(!i){y=Math.abs(y);let t=y%60;w+=n(Math.floor(y/60))+":"+n(t)}e=e.replace(/(^|[^\\])K/g,"$1"+w);let v=(i?t.getUTCDay():t.getDay())+1;return e=(e=(e=(e=(e=e.replace(new RegExp(r[0],"g"),r[v])).replace(new RegExp(l[0],"g"),l[v])).replace(new RegExp(a[0],"g"),a[c])).replace(new RegExp(o[0],"g"),o[c])).replace(/\\(.)/g,"$1")}getTimeUnitsfromTimestamp(t,e){let 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),o=this.formatDate(i,"yyyy MM dd HH mm ss fff").split(" "),r=this.formatDate(a,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(o[6],10),maxMillisecond:parseInt(r[6],10),minSecond:parseInt(o[5],10),maxSecond:parseInt(r[5],10),minMinute:parseInt(o[4],10),maxMinute:parseInt(r[4],10),minHour:parseInt(o[3],10),maxHour:parseInt(r[3],10),minDate:parseInt(o[2],10),maxDate:parseInt(r[2],10),minMonth:parseInt(o[1],10)-1,maxMonth:parseInt(r[1],10)-1,minYear:parseInt(o[0],10),maxYear:parseInt(r[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()&&i++,i}determineDaysOfMonths(t,e){let s=30;switch(t=u.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}}class k{constructor(t){this.ctx=t,this.w=t.w,this.tooltipKeyFormat="dd MMM"}xLabelFormat(t,e,s,i){let a=this.w;if("datetime"===a.config.xaxis.type&&void 0===a.config.xaxis.labels.formatter&&void 0===a.config.tooltip.x.formatter){let t=new S(this.ctx);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){let s=this.w;if(u.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=t==e?e:t.toFixed(1)}return t}setLabelFormatters(){let t=this.w;return t.globals.xaxisTooltipFormatter=t=>this.defaultGeneralFormatter(t),t.globals.ttKeyFormatter=t=>this.defaultGeneralFormatter(t),t.globals.ttZFormatter=t=>t,t.globals.legendFormatter=t=>this.defaultGeneralFormatter(t),void 0!==t.config.xaxis.labels.formatter?t.globals.xLabelFormatter=t.config.xaxis.labels.formatter:t.globals.xLabelFormatter=e=>{if(u.isNumber(e)){if(!t.config.xaxis.convertedCatToNumeric&&"numeric"===t.config.xaxis.type){if(u.isNumber(t.config.xaxis.decimalsInFloat))return e.toFixed(t.config.xaxis.decimalsInFloat);{const s=t.globals.maxX-t.globals.minX;return s>0&&s<100?e.toFixed(1):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?t.globals.ttKeyFormatter=t.config.tooltip.x.formatter:t.globals.ttKeyFormatter=t.globals.xLabelFormatter,"function"==typeof t.config.xaxis.tooltip.formatter&&(t.globals.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||void 0!==t.config.tooltip.y.formatter)&&(t.globals.ttVal=t.config.tooltip.y),void 0!==t.config.tooltip.z.formatter&&(t.globals.ttZFormatter=t.config.tooltip.z.formatter),void 0!==t.config.legend.formatter&&(t.globals.legendFormatter=t.config.legend.formatter),t.config.yaxis.forEach((e,s)=>{void 0!==e.labels.formatter?t.globals.yLabelFormatters[s]=e.labels.formatter:t.globals.yLabelFormatters[s]=i=>t.globals.xyCharts?Array.isArray(i)?i.map(t=>this.defaultYFormatter(t,e,s)):this.defaultYFormatter(i,e,s):i}),t.globals}heatmapLabelFormatters(){const t=this.w;if("heatmap"===t.config.chart.type){t.globals.yAxisScale[0].result=t.globals.seriesNames.slice();let e=t.globals.seriesNames.reduce((t,e)=>t.length>e.length?t:e,0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}}class L{constructor(t){this.ctx=t,this.w=t.w}getLabel(t,e,s,i,a=[],o="12px",r=!0){const l=this.w;let n=void 0===t[i]?"":t[i],h=n,c=l.globals.xLabelFormatter,d=l.config.xaxis.labels.formatter,g=!1,p=new k(this.ctx),x=n;r&&(h=p.xLabelFormat(c,n,x,{i:i,dateFormatter:new S(this.ctx).formatDate,w:l}),void 0!==d&&(h=d(n,t[i],{i:i,dateFormatter:new S(this.ctx).formatDate,w:l})));e.length>0?(g=(t=>{let s=null;return e.forEach(t=>{"month"===t.unit?s="year":"day"===t.unit?s="month":"hour"===t.unit?s="day":"minute"===t.unit&&(s="hour")}),s===t})(e[i].unit),s=e[i].position,h=e[i].value):"datetime"===l.config.xaxis.type&&void 0===d&&(h=""),void 0===h&&(h=""),h=Array.isArray(h)?h:h.toString();let b=new w(this.ctx),f={};f=l.globals.rotateXLabels&&r?b.getTextRects(h,parseInt(o,10),null,`rotate(${l.config.xaxis.labels.rotate} 0 0)`,!1):b.getTextRects(h,parseInt(o,10));const u=!l.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(h)&&("NaN"===String(h)||a.indexOf(h)>=0&&u)&&(h=""),{x:s,text:h,textRect:f,isBold:g}}checkLabelBasedOnTickamount(t,e,s){const i=this.w;let a=i.config.xaxis.tickAmount;return"dataPoints"===a&&(a=Math.round(i.globals.gridWidth/120)),a>s||t%Math.round(s/(a+1))===0||(e.text=""),e}checkForOverflowingLabels(t,e,s,i,a){const o=this.w;if(0===t&&o.globals.skipFirstTimelinelabel&&(e.text=""),t===s-1&&o.globals.skipLastTimelinelabel&&(e.text=""),o.config.xaxis.labels.hideOverlappingLabels&&i.length>0){const t=a[a.length-1];if(o.config.xaxis.labels.trim&&"datetime"!==o.config.xaxis.type)return e;e.x<t.textRect.width/(o.globals.rotateXLabels?Math.abs(o.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 s.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 v(this.ctx);return s.every(t=>i.isSeriesNull(t))}return!1}getYAxisForeColor(t,e){const s=this.w;return Array.isArray(t)&&s.globals.yAxisScale[e]&&this.ctx.theme.pushExtraColors(t,s.globals.yAxisScale[e].result.length,!1),t}drawYAxisTicks(t,e,s,i,a,o,r){let l=this.w,n=new w(this.ctx),h=l.globals.translateY+l.config.yaxis[a].labels.offsetY;if(l.globals.isBarHorizontal?h=0:"heatmap"===l.config.chart.type&&(h+=o/2),i.show&&e>0){!0===l.config.yaxis[a].opposite&&(t+=i.width);for(let a=e;a>=0;a--){let e=n.drawLine(t+s.offsetX-i.width+i.offsetX,h+i.offsetY,t+s.offsetX+i.offsetX,h+i.offsetY,i.color);r.add(e),h+=o}}}}class M{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new A(this.annoCtx),this.axesUtils=new L(this.annoCtx)}addYaxisAnnotation(t,e,s){let i,a=this.w,o=t.strokeDashArray,r=this.helpers.getY1Y2("y1",t),l=r.yP,n=r.clipped,h=!0,c=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!n){c=!0;let s=this.annoCtx.graphics.drawLine(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),l+t.offsetY,t.borderColor,o,t.borderWidth);e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),i=r.yP,h=r.clipped,i>l){let t=l;l=i,i=t}if(!n||!h){c=!0;let s=this.annoCtx.graphics.drawRect(0+t.offsetX,i+t.offsetY,this._getYAxisAnnotationWidth(t),l-i,0,t.fillColor,t.opacity,1,t.borderColor,o);s.node.classList.add("apexcharts-annotation-rect"),s.attr("clip-path",`url(#gridRectMask${a.globals.cuid})`),e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}if(c){let o="right"===t.label.position?a.globals.gridWidth:"center"===t.label.position?a.globals.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:o+t.label.offsetX,y:(null!=i?i:l)+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.globals.gridWidth;return s=t.width.indexOf("%")>-1?e.globals.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),s+t.offsetX}drawYAxisAnnotations(){const t=this.w;let 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 P{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new A(this.annoCtx)}addPointAnnotation(t,e,s){if(this.w.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;let i=this.helpers.getX1X2("x1",t),a=i.x,o=i.clipped;i=this.helpers.getY1Y2("y1",t);let r=i.yP,l=i.clipped;if(u.isNumber(a)&&!l&&!o){let i={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:""}`},o=this.annoCtx.graphics.drawMarker(a+t.marker.offsetX,r+t.marker.offsetY,i);e.appendChild(o.node);const l=t.label.text?t.label.text:"";let n=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:r+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:l,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(n.attr({rel:s}),e.appendChild(n.node),t.customSVG.SVG){let s=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});s.attr({transform:`translate(${a+t.customSVG.offsetX}, ${r+t.customSVG.offsetY})`}),s.node.innerHTML=t.customSVG.SVG,e.appendChild(s.node)}if(t.image.path){let e=t.image.width?t.image.width:20,s=t.image.height?t.image.height:20;o=this.annoCtx.addImage({x:a+t.image.offsetX-e/2,y:r+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(){let 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}}const I={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 T{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,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:[]},chart:{animations:{enabled:!0,speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"",locales:[I],defaultLocale:"en",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,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},stacked:!1,stackOnlyBar:!0,stackType:"normal",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,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}},accessibility:{enabled:!0,description:void 0,announcements:{enabled:!0},keyboard:{enabled:!0}}},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},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},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,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",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.globals.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},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:[],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",verticalAlign:"middle",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,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily: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 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss",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:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65}}}}}class X{constructor(t){this.ctx=t,this.w=t.w,this.graphics=new w(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new A(this),this.xAxisAnnotations=new C(this),this.yAxisAnnotations=new M(this),this.pointsAnnotations=new P(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts&&t.globals.dataPoints){let e=this.yAxisAnnotations.drawYAxisAnnotations(),s=this.xAxisAnnotations.drawXAxisAnnotations(),i=this.pointsAnnotations.drawPointAnnotations();const a=t.config.chart.animations.enabled,o=[e,s,i],r=[s.node,e.node,i.node];for(let e=0;e<3;e++)t.globals.dom.elGraphical.add(o[e]),!a||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&r[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:r[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map((t,e)=>{this.addImage(t,e)})}drawTextAnnos(){this.w.config.annotations.texts.map((t,e)=>{this.addText(t,e)})}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:o,fontSize:r,fontFamily:l,fontWeight:n,cssClass:h,backgroundColor:c,borderWidth:d,strokeDashArray:g,borderRadius:p,borderColor:x,appendTo:b=".apexcharts-svg",paddingLeft:f=4,paddingRight:u=4,paddingBottom:m=2,paddingTop:y=2}=t,w=this.w;let v=this.graphics.drawText({x:e,y:s,text:i,textAnchor:a||"start",fontSize:r||"12px",fontWeight:n||"regular",fontFamily:l||w.config.chart.fontFamily,foreColor:o||w.config.chart.foreColor,cssClass:h});const A=w.globals.dom.baseEl.querySelector(b);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+u,C.height+m+y,p,c||"transparent",1,d,x,g);A.insertBefore(t.node,v.node)}}addImage(t){const e=this.w,{path:s,x:i=0,y:a=0,width:o=20,height:r=20,appendTo:l=".apexcharts-svg"}=t;let n=e.globals.dom.Paper.image(s);n.size(o,r).move(i,a);const h=e.globals.dom.baseEl.querySelector(l);return h&&h.appendChild(n.node),n}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 o=s,r=o.w,l=r.globals.dom.baseEl.querySelector(`.apexcharts-${i}-annotations`),n=l.childNodes.length+1,h=new T,c=Object.assign({},"xaxis"===i?h.xAxisAnnotation:"yaxis"===i?h.yAxisAnnotation:h.pointAnnotation),d=u.extend(c,t);switch(i){case"xaxis":this.addXaxisAnnotation(d,l,n);break;case"yaxis":this.addYaxisAnnotation(d,l,n);break;case"point":this.addPointAnnotation(d,l,n)}let g=r.globals.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${n}']`);const p=this.helpers.addBackgroundToAnno(g,d);return p&&l.insertBefore(p.node,g),e&&r.globals.memory.methodsToExec.push({context:o,id:d.id?d.id:u.randomId(),method:a,label:"addAnnotation",params:t}),s}clearAnnotations(t){const e=t.w;let s=e.globals.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);s=u.listToArray(s),Array.prototype.forEach.call(s,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const s=t.w;let i=s.globals.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)}))}}const z=({isTimeline:t,ctx:e,seriesIndex:s,dataPointIndex:i,y1:a,y2:o,w:r})=>{var l;let n=r.globals.seriesRangeStart[s][i],h=r.globals.seriesRangeEnd[s][i],c=r.globals.labels[i],d=r.config.series[s].name?r.config.series[s].name:"";const g=r.globals.ttKeyFormatter,p=r.config.tooltip.y.title.formatter,x={w:r,seriesIndex:s,dataPointIndex:i,start:n,end:h};if("function"==typeof p&&(d=p(d,x)),(null==(l=r.config.series[s].data[i])?void 0:l.x)&&(c=r.config.series[s].data[i].x),!t&&"datetime"===r.config.xaxis.type){c=new k(e).xLabelFormat(r.globals.ttKeyFormatter,c,c,{i:void 0,dateFormatter:new S(e).formatDate,w:r})}"function"==typeof g&&(c=g(c,x)),Number.isFinite(a)&&Number.isFinite(o)&&(n=a,h=o);let b="",f="";const u=r.globals.colors[s];if(void 0===r.config.tooltip.x.formatter)if("datetime"===r.config.xaxis.type){let t=new S(e);b=t.formatDate(t.getDate(n),r.config.tooltip.x.format),f=t.formatDate(t.getDate(h),r.config.tooltip.x.format)}else b=n,f=h;else b=r.config.tooltip.x.formatter(n),f=r.config.tooltip.x.formatter(h);return{start:n,end:h,startVal:b,endVal:f,ylabel:c,color:u,seriesName:d}},E=t=>{let{color:e,seriesName:s,ylabel:i,start:a,end:o,seriesIndex:r,dataPointIndex:l}=t;const n=t.ctx.tooltip.tooltipLabels.getFormatters(r);a=n.yLbFormatter(a),o=n.yLbFormatter(o);const h=n.yLbFormatter(t.w.globals.series[r][l]);let c="";const d=`<span class="value start-value">\n ${a}\n </span> <span class="separator">-</span> <span class="value end-value">\n ${o}\n </span>`;return c=t.w.globals.comboCharts?"rangeArea"===t.w.config.series[r].type||"rangeBar"===t.w.config.series[r].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 Y{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 u.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(),n(l({},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}}})}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}}}}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.globals.seriesRangeStart[e][s];return i.globals.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:o}=z(n(l({},t),{isTimeline:!0}));return E(n(l({},t),{color:e,seriesName:s,ylabel:i,start:a,end:o}))})(t):(t=>{const{color:e,seriesName:s,ylabel:i,start:a,end:o}=z(t);return E(n(l({},t),{color:e,seriesName:s,ylabel:i,start:a,end:o}))})(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:o}=z(t);return E(n(l({},t),{color:e,seriesName:s,ylabel:i,start:a,end:o}))})(t)}}}brush(t){return u.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 n(l({},t),{plotOptions:n(l({},t.plotOptions),{bar:n(l({},t.plotOptions.bar),{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}convertCatToNumeric(t){return t.xaxis.convertedCatToNumeric=!0,t}convertCatToNumericXaxis(t,e,s){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return u.isNumber(t)?Math.floor(t):t};const i=t.xaxis.labels.formatter;let a=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return s&&s.length&&(a=s.map(t=>Array.isArray(t)?t:String(t))),a&&a.length&&(t.xaxis.labels.formatter=function(t){return u.isNumber(t)?i(a[Math.floor(t)-1]):i(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}},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 o=t.globals.seriesCandleO[e][s],r=t.globals.seriesCandleH[e][s],l=t.globals.seriesCandleM[e][s],n=t.globals.seriesCandleL[e][s],h=t.globals.seriesCandleC[e][s];return t.config.series[e].type&&t.config.series[e].type!==a?`<div class="apexcharts-custom-tooltip">\n ${t.config.series[e].name?t.config.series[e].name:"series-"+(e+1)}: <strong>${t.globals.series[e][s]}</strong>\n </div>`:`<div class="apexcharts-tooltip-box apexcharts-tooltip-${t.config.chart.type}"><div>${i[0]}: <span class="value">`+o+`</span></div><div>${i[1]}: <span class="value">`+r+"</span></div>"+(l?`<div>${i[2]}: <span class="value">`+l+"</span></div>":"")+`<div>${i[3]}: <span class="value">`+n+`</span></div><div>${i[4]}: <span class="value">`+h+"</span></div></div>"}}class R{constructor(t){this.opts=t}init({responsiveOverride:t}){var e,s,i,a,o,r,l,n,h,c;let d=this.opts,g=new T,p=new Y(d);this.chartType=d.chart.type,d=this.extendYAxis(d),d=this.extendAnnotations(d);let x=g.init(),b={};if(d&&"object"==typeof d){let g={};g=-1!==["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(d.chart.type)?p[d.chart.type]():p.line(),(null==(s=null==(e=d.plotOptions)?void 0:e.bar)?void 0:s.isFunnel)&&(g=p.funnel()),d.chart.stacked&&"bar"===d.chart.type&&(g=p.stackedBars()),(null==(i=d.chart.brush)?void 0:i.enabled)&&(g=p.brush(g)),(null==(o=null==(a=d.plotOptions)?void 0:a.line)?void 0:o.isSlopeChart)&&(g=p.slope()),d.chart.stacked&&"100%"===d.chart.stackType&&(d=p.stacked100(d)),(null==(l=null==(r=d.plotOptions)?void 0:r.bar)?void 0:l.isDumbbell)&&(d=p.dumbbell(d)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(d),d.xaxis=d.xaxis||window.Apex.xaxis||{},t||(d.xaxis.convertedCatToNumeric=!1),d=this.checkForCatToNumericXAxis(this.chartType,g,d),((null==(n=d.chart.sparkline)?void 0:n.enabled)||(null==(c=null==(h=window.Apex.chart)?void 0:h.sparkline)?void 0:c.enabled))&&(g=p.sparkline(g)),b=u.extend(x,g)}let f=u.extend(b,window.Apex);return x=u.extend(f,d),x=this.handleUserInputErrors(x),x}checkForCatToNumericXAxis(t,e,s){var i,a;let o=new Y(s);const r=("bar"===t||"boxPlot"===t)&&(null==(a=null==(i=s.plotOptions)?void 0:i.bar)?void 0:a.horizontal),l="pie"===t||"polarArea"===t||"donut"===t||"radar"===t||"radialBar"===t||"heatmap"===t,n="datetime"!==s.xaxis.type&&"numeric"!==s.xaxis.type;let h=s.xaxis.tickPlacement?s.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return r||l||!n||"between"===h||(s=o.convertCatToNumeric(s)),s}extendYAxis(t,e){let s=new T;(void 0===t.yaxis||!t.yaxis||Array.isArray(t.yaxis)&&0===t.yaxis.length)&&(t.yaxis={}),t.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(t.yaxis=u.extend(t.yaxis,window.Apex.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[u.extend(s.yAxis,t.yaxis)]:t.yaxis=u.extendArray(t.yaxis,s.yAxis);let i=!1;t.yaxis.forEach(t=>{t.logarithmic&&(i=!0)});let a=t.series;return e&&!a&&(a=e.config.series),i&&a.length!==t.yaxis.length&&a.length&&(t.yaxis=a.map((e,i)=>{if(e.name||(a[i].name=`series-${i+1}`),t.yaxis[i])return t.yaxis[i].seriesName=a[i].name,t.yaxis[i];{const e=u.extend(s.yAxis,t.yaxis[0]);return e.show=!1,e}})),i&&a.length>1&&(a.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){let e=new T;return t.annotations.yaxis=u.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}extendXAxisAnnotations(t){let e=new T;return t.annotations.xaxis=u.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}extendPointAnnotations(t){let e=new T;return t.annotations.points=u.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){let 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}}class F{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.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.resizeTimer=null,t.selectionResizeTimer=null,t.lastWheelExecution=0,t.delayedElements=[],t.pointsArray=[],t.dataLabelsRects=[],t.textRectsCache=new Map,t.domCache=new Map,t.dimensionCache={},t.cachedSelectors={},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.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0,t.multiAxisTickAmount=0}globalVars(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],invalidLogScale:!1,ignoreYAxisIndexes:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,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,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:"http://www.w3.org/2000/svg",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},domCache:new Map,dimensionCache:{},cachedSelectors:{},resizeObserver:null,shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,isSlopeChart:t.plotOptions.line.isSlopeChart,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null,niceScaleAllowedMagMsd:[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],niceScaleDefaultTicks:[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],seriesYAxisMap:[],seriesYAxisReverseMap:[]}}init(t){let e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=u.extend({},t),e.initialSeries=u.clone(t.series),e.lastXAxis=u.clone(e.initialConfig.xaxis),e.lastYAxis=u.clone(e.initialConfig.yaxis),e}}class H{constructor(t){this.opts=t}init(){const t=new R(this.opts).init({responsiveOverride:!1});return{config:t,globals:(new F).init(t)}}}class D{constructor(t){this.ctx=t,this.w=t.w,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}clippedImgArea(t){let e=this.w,s=e.config,i=parseInt(e.globals.gridWidth,10),a=parseInt(e.globals.gridHeight,10),o=i>a?i:a,r=t.image,l=0,n=0;void 0===t.width&&void 0===t.height?void 0!==s.fill.image.width&&void 0!==s.fill.image.height?(l=s.fill.image.width+1,n=s.fill.image.height):(l=o+1,n=o):(l=t.width,n=t.height);let h=document.createElementNS(e.globals.SVGNS,"pattern");w.setAttrs(h,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:l+"px",height:n+"px"});let c=document.createElementNS(e.globals.SVGNS,"image");h.appendChild(c),c.setAttributeNS(window.SVG.xlink,"href",r),w.setAttrs(c,{x:0,y:0,preserveAspectRatio:"none",width:l+"px",height:n+"px"}),c.style.opacity=t.opacity,e.globals.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.globals.series.length,this.seriesIndex}computeColorStops(t,e){const s=this.w;let i=null,a=null;for(let 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 o=i-e.threshold+(e.threshold-a);0===o&&(o=1);let r=100-(e.threshold-a)/o*100;return r=Math.max(0,Math.min(r,100)),[{offset:r,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,o,r;let l=this.w;this.opts=t;let n,h,c,d=this.w.config;this.seriesIndex=this.getSeriesIndex(t);const g=d.plotOptions.line.colors.colorAboveThreshold&&d.plotOptions.line.colors.colorBelowThreshold;let p=this.getFillColors()[this.seriesIndex];void 0!==l.globals.seriesColors[this.seriesIndex]&&(p=l.globals.seriesColors[this.seriesIndex]),"function"==typeof p&&(p=p({seriesIndex:this.seriesIndex,dataPointIndex:t.dataPointIndex,value:t.value,w:l}));let x=t.fillType?t.fillType:this.getFillType(this.seriesIndex),b=Array.isArray(d.fill.opacity)?d.fill.opacity[this.seriesIndex]:d.fill.opacity;const f="gradient"===x||g;t.color&&(p=t.color),(null==(i=null==(s=null==(e=l.config.series[this.seriesIndex])?void 0:e.data)?void 0:s[t.dataPointIndex])?void 0:i.fillColor)&&(p=null==(r=null==(o=null==(a=l.config.series[this.seriesIndex])?void 0:a.data)?void 0:o[t.dataPointIndex])?void 0:r.fillColor),p||(p="#fff"),u.isCSSVariable(p)&&(p=u.getThemeColor(p));let m=p;if(-1===p.indexOf("rgb")?-1===p.indexOf("#")?m=p:p.length<9&&(m=u.hexToRgba(p,b)):p.indexOf("rgba")>-1?b=u.getOpacityFromRGBA(p):m=u.hexToRgba(u.rgb2hex(p),b),t.opacity&&(b=t.opacity),"pattern"===x&&(h=this.handlePatternFill({fillConfig:t.fillConfig,patternFill:h,fillColor:p,fillOpacity:b,defaultColor:m})),f){let e=d.fill.gradient.colorStops?[...d.fill.gradient.colorStops]:[],s=d.fill.gradient.type;g&&(e[this.seriesIndex]=this.computeColorStops(l.globals.series[this.seriesIndex],d.plotOptions.line.colors),s="vertical"),c=this.handleGradientFill({type:s,fillConfig:t.fillConfig,fillColor:p,fillOpacity:b,colorStops:e,i:this.seriesIndex})}if("image"===x){let e=d.fill.image.src,s=t.patternID?t.patternID:"";const i=`pattern${l.globals.cuid}${t.seriesNumber+1}${s}`;-1===this.patternIDs.indexOf(i)&&(this.clippedImgArea({opacity:b,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=f?c:"pattern"===x?h:m;return t.solid&&(n=m),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,fillOpacity:i,defaultColor:a}){let o=this.w.config.fill;t&&(o=t);const r=this.opts;let l=new w(this.ctx),n=Array.isArray(o.pattern.strokeWidth)?o.pattern.strokeWidth[this.seriesIndex]:o.pattern.strokeWidth,h=s;if(Array.isArray(o.pattern.style))if(void 0!==o.pattern.style[r.seriesNumber]){e=l.drawPattern(o.pattern.style[r.seriesNumber],o.pattern.width,o.pattern.height,h,n,i)}else e=a;else e=l.drawPattern(o.pattern.style,o.pattern.width,o.pattern.height,h,n,i);return e}handleGradientFill({type:t,fillColor:e,fillOpacity:s,fillConfig:i,colorStops:a,i:o}){let r=this.w.config.fill;i&&(r=l(l({},r),i));const n=this.opts;let h=new w(this.ctx),c=new u;t=t||r.gradient.type;let d,g=e,p=void 0===r.gradient.opacityFrom?s:Array.isArray(r.gradient.opacityFrom)?r.gradient.opacityFrom[o]:r.gradient.opacityFrom;g.indexOf("rgba")>-1&&(p=u.getOpacityFromRGBA(g));let x=void 0===r.gradient.opacityTo?s:Array.isArray(r.gradient.opacityTo)?r.gradient.opacityTo[o]:r.gradient.opacityTo;if(void 0===r.gradient.gradientToColors||0===r.gradient.gradientToColors.length)d="dark"===r.gradient.shade?c.shadeColor(-1*parseFloat(r.gradient.shadeIntensity),e.indexOf("rgb")>-1?u.rgb2hex(e):e):c.shadeColor(parseFloat(r.gradient.shadeIntensity),e.indexOf("rgb")>-1?u.rgb2hex(e):e);else if(r.gradient.gradientToColors[n.seriesNumber]){const t=r.gradient.gradientToColors[n.seriesNumber];d=t,t.indexOf("rgba")>-1&&(x=u.getOpacityFromRGBA(t))}else d=e;if(r.gradient.gradientFrom&&(g=r.gradient.gradientFrom),r.gradient.gradientTo&&(d=r.gradient.gradientTo),r.gradient.inverseColors){let t=g;g=d,d=t}return g.indexOf("rgb")>-1&&(g=u.rgb2hex(g)),d.indexOf("rgb")>-1&&(d=u.rgb2hex(d)),h.drawGradient(t,g,d,p,x,n.size,r.gradient.stops,a,o)}}class O{constructor(t){this.ctx=t,this.w=t.w,this._filters=new y(this.ctx),this._graphics=new 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.globals.series.length+1)for(let e=0;e<=t.globals.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:o=!1}){let r=this.w,l=e,n=t,h=null,c=new w(this.ctx);const d=r.config.markers.discrete&&r.config.markers.discrete.length;if(Array.isArray(n.x))for(let t=0;t<n.x.length;t++){let g,p=s,x=!u.isNumber(n.y[t]);0===r.globals.markers.largestSize&&r.globals.hasNullValues&&null!==r.globals.series[l][s+1]&&!o&&(x=!0),1===s&&0===t&&(p=0),1===s&&1===t&&(p=1);let b="apexcharts-marker";"line"!==r.config.chart.type&&"area"!==r.config.chart.type||r.globals.comboCharts||r.config.tooltip.intersect||(b+=" no-pointer-events");if((Array.isArray(r.config.markers.size)?r.globals.markers.size[e]>0:r.config.markers.size>0)||a||d){x||(b+=` w${u.randomId()}`);let s=this.getMarkerConfig({cssClass:b,seriesIndex:e,dataPointIndex:p});if(r.config.series[l].data[p]&&(r.config.series[l].data[p].fillColor&&(s.pointFillColor=r.config.series[l].data[p].fillColor),r.config.series[l].data[p].strokeColor&&(s.pointStrokeColor=r.config.series[l].data[p].strokeColor)),void 0!==i&&(s.pSize=i),(n.x[t]<-r.globals.markers.largestSize||n.x[t]>r.globals.gridWidth+r.globals.markers.largestSize||n.y[t]<-r.globals.markers.largestSize||n.y[t]>r.globals.gridHeight+r.globals.markers.largestSize)&&(s.pSize=0),!x){(r.globals.markers.size[e]>0||a||d)&&!h&&(h=c.group({class:a||d?"":"apexcharts-series-markers"}),h.attr("clip-path",`url(#gridRectMarkerMask${r.globals.cuid})`),this.setupMarkerDelegation(h)),g=c.drawMarker(n.x[t],n.y[t],s),g.attr("rel",p),g.attr("j",p),g.attr("index",e),g.node.setAttribute("default-marker-size",s.pSize),this._filters.setSelectionFilter(g,e,p),h&&h.add(g)}}else void 0===r.globals.pointsArray[e]&&(r.globals.pointsArray[e]=[]),r.globals.pointsArray[e].push([n.x[t],n.y[t]])}return h}getMarkerConfig({cssClass:t,seriesIndex:e,dataPointIndex:s=null,radius:i=null,size:a=null,strokeWidth:o=null}){const r=this.w;let l=this.getMarkerStyle(e),n=null===a?r.globals.markers.size[e]:a;const h=r.config.markers;return null!==s&&h.discrete.length&&h.discrete.map(t=>{t.seriesIndex===e&&t.dataPointIndex===s&&(l.pointStrokeColor=t.strokeColor,l.pointFillColor=t.fillColor,n=t.size,l.pointShape=t.shape)}),{pSize:null===i?n:i,pRadius:null!==i?i:h.radius,pointStrokeWidth:null!==o?o:Array.isArray(h.strokeWidth)?h.strokeWidth[e]:h.strokeWidth,pointStrokeColor:l.pointStrokeColor,pointFillColor:l.pointFillColor,shape:l.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){w._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onClick(i)}}),t.node.addEventListener("dblclick",i=>{if(e.config.markers.onDblClick){w._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onDblClick(i)}}),t.node.addEventListener("touchstart",e=>{const i=w._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){let 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 W{constructor(t){this.ctx=t,this.w=t.w,this.initialAnim=this.w.config.chart.animations.enabled,this.anim=new m(this.ctx),this.filters=new y(this.ctx),this.fill=new D(this.ctx),this.markers=new O(this.ctx),this.graphics=new w(this.ctx)}draw(t,e,s){let i=this.w,a=this.graphics,o=s.realIndex,r=s.pointsPos,l=s.zRatio,n=s.elParent,h=a.group({class:`apexcharts-series-markers apexcharts-series-${i.config.chart.type}`});if(h.attr("clip-path",`url(#gridRectMarkerMask${i.globals.cuid})`),this.markers.setupMarkerDelegation(h),Array.isArray(r.x))for(let t=0;t<r.x.length;t++){let s=e+1,a=!0;0===e&&0===t&&(s=0),0===e&&1===t&&(s=1);let c=i.globals.markers.size[o];if(l!==1/0){const t=i.config.plotOptions.bubble;c=i.globals.seriesZ[o][s],t.zScaling&&(c/=l),t.minBubbleRadius&&c<t.minBubbleRadius&&(c=t.minBubbleRadius),t.maxBubbleRadius&&c>t.maxBubbleRadius&&(c=t.maxBubbleRadius)}let d=r.x[t],g=r.y[t];if(c=c||0,null!==g&&void 0!==i.globals.series[o][s]||(a=!1),a){const t=this.drawPoint(d,g,c,o,s,e);h.add(t)}n.add(h)}}drawPoint(t,e,s,i,a,o){const r=this.w;let l=i;const n=this.anim,h=this.filters,c=this.fill,d=this.markers,g=this.graphics,p=d.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:l,dataPointIndex:a,radius:"bubble"===r.config.chart.type||r.globals.comboCharts&&r.config.series[i]&&"bubble"===r.config.series[i].type?s:null});let x=c.fillPath({seriesNumber:i,dataPointIndex:a,color:p.pointFillColor,patternUnits:"objectBoundingBox",value:r.globals.series[i][o]}),b=g.drawMarker(t,e,p);if(r.config.series[l].data[a]&&r.config.series[l].data[a].fillColor&&(x=r.config.series[l].data[a].fillColor),b.attr({fill:x}),r.config.chart.dropShadow.enabled){const t=r.config.chart.dropShadow;h.dropShadow(b,t,i)}if(!this.initialAnim||r.globals.dataChanged||r.globals.resized)r.globals.animationEnded=!0;else{let t=r.config.chart.animations.speed;n.animateMarker(b,t,r.globals.easing,()=>{window.setTimeout(()=>{n.animationCompleted(b)},100)})}return b.attr({rel:a,j:a,index:i,"default-marker-size":p.pSize}),h.setSelectionFilter(b,i,a),b.node.classList.add("apexcharts-marker"),b}centerTextInBubble(t){let e=this.w;return{y:t+=parseInt(e.config.dataLabels.style.fontSize,10)/4}}}class N{constructor(t){this.ctx=t,this.w=t.w}dataLabelsCorrection(t,e,s,i,a,o,r){let l=this.w,n=!1,h=new w(this.ctx).getTextRects(s,r),c=h.width,d=h.height;e<0&&(e=0),e>l.globals.gridHeight+d&&(e=l.globals.gridHeight+d/2),void 0===l.globals.dataLabelsRects[i]&&(l.globals.dataLabelsRects[i]=[]),l.globals.dataLabelsRects[i].push({x:t,y:e,width:c,height:d});let g=l.globals.dataLabelsRects[i].length-2,p=void 0!==l.globals.lastDrawnDataLabelsIndexes[i]?l.globals.lastDrawnDataLabelsIndexes[i][l.globals.lastDrawnDataLabelsIndexes[i].length-1]:0;if(void 0!==l.globals.dataLabelsRects[i][g]){let s=l.globals.dataLabelsRects[i][p];(t>s.x+s.width||e>s.y+s.height||e+d<s.y||t+c<s.x)&&(n=!0)}return(0===a||o)&&(n=!0),{x:t,y:e,textRects:h,drawnextLabel:n}}drawDataLabel({type:t,pos:e,i:s,j:i,isRangeStart:a,strokeWidth:o=2}){let r=this.w;const l=new w(this.ctx);let n=r.config.dataLabels,h=0,c=0,d=i,g=null;if(-1!==r.globals.collapsedSeriesIndices.indexOf(s)||!n.enabled||!Array.isArray(e.x))return g;g=l.group({class:"apexcharts-data-labels"});for(let l=0;l<e.x.length;l++)if(h=e.x[l]+n.offsetX,c=e.y[l]+n.offsetY+o,!isNaN(h)){1===i&&0===l&&(d=0),1===i&&1===l&&(d=1);let o=r.globals.series[s][d];"rangeArea"===t&&(o=a?r.globals.seriesRangeStart[s][d]:r.globals.seriesRangeEnd[s][d]);let n="";const p=t=>r.config.dataLabels.formatter(t,{ctx:this.ctx,seriesIndex:s,dataPointIndex:d,w:r});if("bubble"===r.config.chart.type){o=r.globals.seriesZ[s][d],n=p(o),c=e.y[l];c=new W(this.ctx).centerTextInBubble(c,s,d).y}else void 0!==o&&(n=p(o));let x=r.config.dataLabels.textAnchor;r.globals.isSlopeChart&&(x=0===d?"end":d===r.config.series[s].data.length-1?"start":"middle"),this.plotDataLabelsText({x:h,y:c,text:n,i:s,j:d,parent:g,offsetCorrection:!0,dataLabelsConfig:r.config.dataLabels,textAnchor:x})}return g}plotDataLabelsText(t){let e=this.w,s=new w(this.ctx),{x:i,y:a,i:o,j:r,text:l,textAnchor:n,fontSize:h,parent:c,dataLabelsConfig:d,color:g,alwaysDrawDataLabel:p,offsetCorrection:x,className:b}=t,f=null;if(Array.isArray(e.config.dataLabels.enabledOnSeries)&&e.config.dataLabels.enabledOnSeries.indexOf(o)<0)return f;let u={x:i,y:a,drawnextLabel:!0,textRects:null};x&&(u=this.dataLabelsCorrection(i,a,l,o,r,p,parseInt(d.style.fontSize,10))),e.globals.zoomed||(i=u.x,a=u.y),u.textRects&&(i<-20-u.textRects.width||i>e.globals.gridWidth+u.textRects.width+30)&&(l="");let m=e.globals.dataLabels.style.colors[o];(("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||e.config.dataLabels.distributed)&&(m=e.globals.dataLabels.style.colors[r]),"function"==typeof m&&(m=m({series:e.globals.series,seriesIndex:o,dataPointIndex:r,w:e})),g&&(m=g);let v=d.offsetX,A=d.offsetY;if("bar"!==e.config.chart.type&&"rangeBar"!==e.config.chart.type||(v=0,A=0),e.globals.isSlopeChart&&(0!==r&&(v=-2*d.offsetX+5),0!==r&&r!==e.config.series[o].data.length-1&&(v=0)),u.drawnextLabel){if("middle"===n&&i===e.globals.gridWidth&&(n="end"),f=s.drawText({width:100,height:parseInt(d.style.fontSize,10),x:i+v,y:a+A,foreColor:m,textAnchor:n||d.textAnchor,text:l,fontSize:h||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||"normal"}),f.attr({class:b||"apexcharts-datalabel",cx:i,cy:a}),d.dropShadow.enabled){const t=d.dropShadow;new y(this.ctx).dropShadow(f,t)}c.add(f),void 0===e.globals.lastDrawnDataLabelsIndexes[o]&&(e.globals.lastDrawnDataLabelsIndexes[o]=[]),e.globals.lastDrawnDataLabelsIndexes[o].push(r)}return f}addBackgroundToDataLabel(t,e){const s=this.w,i=s.config.dataLabels.background,a=i.padding,o=i.padding/2,r=e.width,l=e.height,n=new w(this.ctx).drawRect(e.x-a,e.y-o/2,r+2*a,l+o,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 y(this.ctx).dropShadow(n,i.dropShadow)}return n}dataLabelsBackground(){const t=this.w;if("bubble"===t.config.chart.type)return;const e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text");for(let s=0;s<e.length;s++){const i=e[s],a=i.getBBox();let o=null;if(a.width&&a.height&&(o=this.addBackgroundToDataLabel(i,a)),o){i.parentNode.insertBefore(o.node,i);const e=t.config.dataLabels.background.backgroundColor||i.getAttribute("fill");t.config.chart.animations.enabled&&!t.globals.resized&&!t.globals.dataChanged?o.animate().attr({fill:e}):o.attr({fill:e}),i.setAttribute("fill",t.config.dataLabels.background.foreColor)}}}bringForward(){const t=this.w,e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),s=t.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child");for(let t=0;t<e.length;t++)s&&s.insertBefore(e[t],s.nextSibling)}}const B=".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 G{constructor(t){this.ctx=t,this.w=t.w,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.globals.dom.baseEl.getElementsByClassName("apexcharts-series")),t.globals.cachedSelectors[e]}getSeriesByName(t){return this.w.globals.dom.baseEl.querySelector(`.apexcharts-inner .apexcharts-series[seriesName='${u.escapeString(t)}']`)}isSeriesHidden(t){const e=this.getSeriesByName(t);let s=parseInt(e.getAttribute("data:realIndex"),10);return{isHidden:e.classList.contains("apexcharts-series-collapsed"),realIndex:s}}addCollapsedClassToSeries(t,e){const s=this.w;function i(s){for(let i=0;i<s.length;i++)s[i].index===e&&t.node.classList.add("apexcharts-series-collapsed")}i(s.globals.collapsedSeries),i(s.globals.ancillaryCollapsedSeries)}toggleSeries(t){let e=this.isSeriesHidden(t);return this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,e.isHidden),e.isHidden}showSeries(t){let e=this.isSeriesHidden(t);e.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,!0)}hideSeries(t){let e=this.isSeriesHidden(t);e.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,!1)}resetSeries(t=!0,e=!0,s=!0){const i=this.w;this.clearSeriesCache();let a=u.clone(i.globals.initialSeries);i.globals.previousPaths=[],s?(i.globals.collapsedSeries=[],i.globals.ancillaryCollapsedSeries=[],i.globals.collapsedSeriesIndices=[],i.globals.ancillaryCollapsedSeriesIndices=[]):a=this.emptyCollapsedSeries(a),i.config.series=a,t&&(e&&(i.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(a,i.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}highlightSeries(t){const e=this.w,s=this.getSeriesByName(t);let i=parseInt(null==s?void 0:s.getAttribute("data:realIndex"),10);const a="highlightSeriesEls";let o=e.globals.cachedSelectors[a];o||(o=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),e.globals.cachedSelectors[a]=o);let r=null,l=null,n=null;if(e.globals.axisCharts||"radialBar"===e.config.chart.type)if(e.globals.axisCharts){r=e.globals.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${i}']`),l=e.globals.dom.baseEl.querySelector(`.apexcharts-datalabels[data\\:realIndex='${i}']`);let t=e.globals.seriesYAxisReverseMap[i];n=e.globals.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}']`)}else r=e.globals.dom.baseEl.querySelector(`.apexcharts-series[rel='${i+1}']`);else r=e.globals.dom.baseEl.querySelector(`.apexcharts-series[rel='${i+1}'] path`);for(let t=0;t<o.length;t++)o[t].classList.add(this.legendInactiveClass);if(r)e.globals.axisCharts||r.parentNode.classList.remove(this.legendInactiveClass),r.classList.remove(this.legendInactiveClass),null!==l&&l.classList.remove(this.legendInactiveClass),null!==n&&n.classList.remove(this.legendInactiveClass);else for(let t=0;t<o.length;t++)o[t].classList.remove(this.legendInactiveClass)}toggleSeriesOnHover(t,e){const s=this.w;e||(e=t.target);let i=s.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if("mousemove"===t.type){let t=parseInt(e.getAttribute("rel"),10)-1;this.highlightSeries(s.globals.seriesNames[t])}else if("mouseout"===t.type)for(let t=0;t<i.length;t++)i[t].classList.remove(this.legendInactiveClass)}highlightRangeInSeries(t,e){const s=this.w,i=s.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),a=t=>{for(let e=0;e<i.length;e++)i[e].classList[t](this.legendInactiveClass)},o=(t,e)=>{for(let s=0;s<i.length;s++){const a=Number(i[s].getAttribute("val"));a>=t.from&&(a<t.to||t.to===e&&a===e)&&i[s].classList.remove(this.legendInactiveClass)}};if("mousemove"===t.type){let t=parseInt(e.getAttribute("rel"),10)-1;a("add");const i=s.config.plotOptions.heatmap.colorScale.ranges;o(i[t],i.reduce((t,e)=>Math.max(t,e.to),0))}else"mouseout"===t.type&&a("remove")}getActiveConfigSeriesIndex(t="asc",e=[]){const s=this.w;let i=0;if(s.config.series.length>1){let 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(){let t=this.w;function e(e,s,i){let a=e[s].childNodes,o={type:i,paths:[],realIndex:e[s].getAttribute("data:realIndex")};for(let t=0;t<a.length;t++)if(a[t].hasAttribute("pathTo")){let e=a[t].getAttribute("pathTo");o.paths.push({d:e})}t.globals.previousPaths.push(o)}t.globals.previousPaths=[];["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(s=>{const i=(a=s,t.globals.dom.baseEl.querySelectorAll(`.apexcharts-${a}-series .apexcharts-series`));var a;for(let t=0;t<i.length;t++)e(i,t,s)});let s=t.globals.dom.baseEl.querySelectorAll(`.apexcharts-${t.config.chart.type} .apexcharts-series`);if(s.length>0)for(let e=0;e<s.length;e++){let s=t.globals.dom.baseEl.querySelectorAll(`.apexcharts-${t.config.chart.type} .apexcharts-series[data\\:realIndex='${e}'] rect`),i=[];for(let t=0;t<s.length;t++){const e=e=>s[t].getAttribute(e),a={x:parseFloat(e("x")),y:parseFloat(e("y")),width:parseFloat(e("width")),height:parseFloat(e("height"))};i.push({rect:a,color:s[t].getAttribute("color")})}t.globals.previousPaths.push(i)}t.globals.axisCharts||(t.globals.previousPaths=t.globals.series)}clearPreviousPaths(){const t=this.w;t.globals.previousPaths=[],t.globals.allSeriesCollapsed=!1}handleNoData(){const t=this.w,e=t.config.noData,s=new w(this.ctx);let i=t.globals.svgWidth/2,a=t.globals.svgHeight/2,o="middle";if(t.globals.noData=!0,t.globals.animationEnded=!0,"left"===e.align?(i=10,o="start"):"right"===e.align&&(i=t.globals.svgWidth-10,o="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){let r=s.drawText({x:i,y:a,text:e.text,textAnchor:o,fontSize:e.style.fontSize,fontFamily:e.style.fontFamily,foreColor:e.style.color,opacity:1,class:"apexcharts-text-nodata"});t.globals.dom.Paper.add(r)}}setNullSeriesToZeroValues(t){let 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.globals.seriesX.map(t=>t.length>0?t:[])}}class ${constructor(t){this.ctx=t,this.w=t.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new v(this.ctx)}getFirstDataPoint(){const t=this.w.config.series,e=new G(this.ctx);return this.activeSeriesIndex=e.getActiveConfigSeriesIndex(),t[this.activeSeriesIndex]&&t[this.activeSeriesIndex].data&&t[this.activeSeriesIndex].data.length>0&&null!==t[this.activeSeriesIndex].data[0]&&void 0!==t[this.activeSeriesIndex].data[0]?t[this.activeSeriesIndex].data[0]:null}isMultiFormat(){return this.isFormatXY()||this.isFormat2DArray()}isFormatXY(){const t=this.getFirstDataPoint();return t&&void 0!==t.x}isFormat2DArray(){const t=this.getFirstDataPoint();return t&&Array.isArray(t)}handleFormat2DArray(t,e){const s=this.w.config,i=this.w.globals,a=t[e].data,o="boxPlot"===s.chart.type||"boxPlot"===s.series[e].type;for(let t=0;t<a.length;t++){const e=a[t],r=e[0],l=e[1],n=e[2];if(void 0!==l&&(Array.isArray(l)&&4===l.length&&!o?this.twoDSeries.push(u.parseNumber(l[3])):e.length>=5?this.twoDSeries.push(u.parseNumber(e[4])):this.twoDSeries.push(u.parseNumber(l)),i.dataFormatXNumeric=!0),"datetime"===s.xaxis.type){let t=new Date(r);t=t.getTime(),this.twoDSeriesX.push(t)}else this.twoDSeriesX.push(r);void 0!==n&&(this.threeDSeries.push(n),i.isDataXYZ=!0)}}handleFormatXY(t,e){const s=this.w.config,i=this.w.globals,a=new S(this.ctx),o=t[e].data;let r=e;i.collapsedSeriesIndices.indexOf(e)>-1&&(r=this.activeSeriesIndex);const l=t[r].data;for(let t=0;t<o.length;t++){const s=o[t];if(void 0!==s.y){const t=Array.isArray(s.y)?u.parseNumber(s.y[s.y.length-1]):u.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),i.isDataXYZ=!0)}for(let t=0;t<l.length;t++){const e=l[t].x,o="string"==typeof e,r=Array.isArray(e),n=!r&&!!a.isValidDate(e);if(o||n)if(o||s.xaxis.convertedCatToNumeric){const t=i.isBarHorizontal&&i.isRangeData;"datetime"!==s.xaxis.type||t?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e),isNaN(e)||"category"===this.w.config.xaxis.type||"string"==typeof e||(i.isXNumeric=!0)):this.twoDSeriesX.push(a.parseDate(e))}else"datetime"===s.xaxis.type?this.twoDSeriesX.push(a.parseDate(e.toString())):(i.dataFormatXNumeric=!0,i.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(e)));else r?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e)):(i.isXNumeric=!0,i.dataFormatXNumeric=!0,this.twoDSeriesX.push(e))}}handleRangeData(t,e){const s=this.w.globals;let i={};return this.isFormat2DArray()?i=this.handleRangeDataFormat("array",t,e):this.isFormatXY()&&(i=this.handleRangeDataFormat("xy",t,e)),s.seriesRangeStart[e]=void 0===i.start?[]:i.start,s.seriesRangeEnd[e]=void 0===i.end?[]:i.end,s.seriesRange[e]=i.rangeUniques,s.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],o=a.y1,r=a.y2;for(let l=i+1;l<s;l++){const s=e[l],i=s.y1;o<=s.y2&&i<=r&&(t.overlaps.indexOf(a.rangeName)<0&&t.overlaps.push(a.rangeName),t.overlaps.indexOf(s.rangeName)<0&&t.overlaps.push(s.rangeName))}}})}),i}handleCandleStickBoxData(t,e){const s=this.w.globals;let i={};return this.isFormat2DArray()?i=this.handleCandleStickBoxDataFormat("array",t,e):this.isFormatXY()&&(i=this.handleCandleStickBoxDataFormat("xy",t,e)),s.seriesCandleO[e]=i.o,s.seriesCandleH[e]=i.h,s.seriesCandleM[e]=i.m,s.seriesCandleL[e]=i.l,s.seriesCandleC[e]=i.c,i}handleRangeDataFormat(t,e,s){const i=[],a=[],o=new Map,r=[];if(e[s].data.forEach(t=>{if(!o.has(t.x)){const e={x:t.x,overlaps:[],y:[]};o.set(t.x,e),r.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++){let r=Array.isArray(e[s].data[t].y);const l=u.randomId(),n=e[s].data[t].x,h={y1:r?e[s].data[t].y[0]:e[s].data[t].y,y2:r?e[s].data[t].y[1]:e[s].data[t].y,rangeName:l};e[s].data[t].rangeName=l;const c=o.get(n);c&&c.y.push(h),i.push(h.y1),a.push(h.y2)}return{start:i,end:a,rangeUniques:r}}handleCandleStickBoxDataFormat(t,e,s){const i=this.w,a="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[s].type,o=[],r=[],l=[],n=[],h=[],c=e[s].data;let d;if("array"===t){d=a&&6===c[0].length||!a&&5===c[0].length?t=>t.slice(1):t=>Array.isArray(t[1])?t[1]:[]}else d=t=>Array.isArray(t.y)?t.y:[];for(let t=0;t<c.length;t++){const e=d(c[t]);e&&e.length>=2&&(o.push(e[0]),r.push(e[1]),a?(l.push(e[2]),n.push(e[3]),h.push(e[4])):(n.push(e[2]),h.push(e[3])))}return{o:o,h:r,m:l,l:n,c:h}}parseDataAxisCharts(t,e=this.ctx){const s=this.w.config,i=this.w.globals,a=new S(e),o=s.labels.length>0?s.labels.slice():s.xaxis.categories.slice();i.isRangeBar="rangeBar"===s.chart.type&&i.isBarHorizontal,i.hasXaxisGroups="category"===s.xaxis.type&&s.xaxis.group.groups.length>0,i.hasXaxisGroups&&(i.groups=s.xaxis.group.groups),t.forEach((t,e)=>{void 0!==t.name?i.seriesNames.push(t.name):i.seriesNames.push("series-"+parseInt(e+1,10))}),this.coreUtils.setSeriesYAxisMappings();let r=[],l=[...new Set(s.series.map(t=>t.group))];s.series.forEach((t,e)=>{let s=l.indexOf(t.group);r[s]||(r[s]=[]),r[s].push(i.seriesNames[e])}),i.seriesGroups=r;const n=()=>{for(let t=0;t<o.length;t++)if("string"==typeof o[t]){if(!a.isValidDate(o[t]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");this.twoDSeriesX.push(a.parseDate(o[t]))}else this.twoDSeriesX.push(o[t])};for(let e=0;e<t.length;e++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],void 0===t[e].data)return;if("rangeBar"!==s.chart.type&&"rangeArea"!==s.chart.type&&"rangeBar"!==t[e].type&&"rangeArea"!==t[e].type||(i.isRangeData=!0,this.handleRangeData(t,e)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(t,e):this.isFormatXY()&&this.handleFormatXY(t,e),"candlestick"!==s.chart.type&&"candlestick"!==t[e].type&&"boxPlot"!==s.chart.type&&"boxPlot"!==t[e].type||this.handleCandleStickBoxData(t,e),i.series.push(this.twoDSeries),i.labels.push(this.twoDSeriesX),i.seriesX.push(this.twoDSeriesX),i.seriesGoals=this.seriesGoals,e!==this.activeSeriesIndex||this.fallbackToCategory||(i.isXNumeric=!0);else{"datetime"===s.xaxis.type?(i.isXNumeric=!0,n(),i.seriesX.push(this.twoDSeriesX)):"numeric"===s.xaxis.type&&(i.isXNumeric=!0,o.length>0&&(this.twoDSeriesX=o,i.seriesX.push(this.twoDSeriesX))),i.labels.push(this.twoDSeriesX);const a=t[e].data.map(t=>u.parseNumber(t));i.series.push(a)}i.seriesZ.push(this.threeDSeries),void 0!==t[e].color?i.seriesColors.push(t[e].color):i.seriesColors.push(void 0)}return this.w}parseDataNonAxisCharts(t){const e=this.w.globals,s=this.w.config,i=Array.isArray(t)&&t.every(t=>"number"==typeof t)&&s.labels.length>0;Array.isArray(t)&&t.some(t=>t&&"object"==typeof t&&t.data||t&&"object"==typeof t&&t.parsing);if(i){e.series=t.slice(),e.seriesNames=s.labels.slice();for(let t=0;t<e.series.length;t++)void 0===e.seriesNames[t]&&e.seriesNames.push("series-"+(t+1));return this.w}if(Array.isArray(t)&&t.every(t=>"number"==typeof t)){e.series=t.slice(),e.seriesNames=[];for(let t=0;t<e.series.length;t++)e.seriesNames.push(s.labels[t]||`series-${t+1}`);return this.w}const a=this.extractPieDataFromSeries(t);e.series=a.values,e.seriesNames=a.labels,"radialBar"===s.chart.type&&(e.series=e.series.map(t=>{const e=u.parseNumber(t);return e}));for(let t=0;t<e.series.length;t++)void 0===e.seriesNames[t]&&e.seriesNames.push("series-"+(t+1));return this.w}resetParsingFlags(){const t=this.w;t.globals.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(u.parseNumber(t.y)))})})}handleExternalLabelsData(t){const e=this.w.config,s=this.w.globals;if(e.xaxis.categories.length>0)s.labels=e.xaxis.categories;else if(e.labels.length>0)s.labels=e.labels.slice();else if(this.fallbackToCategory){if(s.labels=s.labels[0],s.seriesRange.length&&(s.seriesRange.map(t=>{t.forEach(t=>{s.labels.indexOf(t.x)<0&&t.x&&s.labels.push(t.x)})}),s.labels=Array.from(new Set(s.labels.map(JSON.stringify)),JSON.parse)),e.xaxis.convertedCatToNumeric){new Y(e).convertCatToNumericXaxis(e,this.ctx,s.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(e.series.length>0)if(this.isFormatXY()){const t=s.series.map(t=>t.data.filter((t,e,s)=>s.findIndex(e=>e.x===t.x)===e)),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<e.series[e.maxValsInArrayIndex].length;t++)i.push(t+1);e.seriesX=[];for(let s=0;s<t.length;s++)e.seriesX.push(i);this.w.globals.isBarHorizontal||(e.isXNumeric=!0)}if(0===i.length){i=e.axisCharts?[]:e.series.map((t,e)=>e+1);for(let s=0;s<t.length;s++)e.seriesX.push(i)}e.labels=i,s.xaxis.convertedCatToNumeric&&(e.categoryLabels=i.map(t=>s.xaxis.labels.formatter(t))),e.noLabelsProvided=!0}parseRawDataIfNeeded(t){const e=this.w.config,s=this.w.globals,i=e.parsing;if(s.dataWasParsed)return t;if(!i&&!t.some(t=>t.parsing))return t;const a=t.map((t,e)=>{var s,a,o;if(!t.data||!Array.isArray(t.data)||0===t.data.length)return t;const r={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==(o=t.parsing)?void 0:o.z)||(null==i?void 0:i.z)};if(!r.x&&!r.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(!r.x||!r.y||Array.isArray(r.y)&&0===r.y.length)return t;const c=t.data.map((t,e)=>{if("object"!=typeof t||null===t)return t;const s=this.getNestedValue(t,r.x);let i,a;if(Array.isArray(r.y)){const e=r.y.map(e=>this.getNestedValue(t,e));i="bubble"===this.w.config.chart.type&&2===e.length?e[0]:e}else i=this.getNestedValue(t,r.y);r.z&&(a=this.getNestedValue(t,r.z));const o={x:s,y:i};if("bubble"===this.w.config.chart.type&&Array.isArray(r.y)&&2===r.y.length){const e=this.getNestedValue(t,r.y[1]);void 0!==e&&(o.z=e)}return void 0!==a&&(o.z=a),o});return n(l({},t),{data:c,__apexParsed:!0})});return s.dataWasParsed=!0,s.originalSeries||(s.originalSeries=u.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}parseData(t){let e=this.w,s=e.config,i=e.globals;if(t=this.parseRawDataIfNeeded(t),s.series=t,i.initialSeries=u.clone(t),this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),i.axisCharts?(this.parseDataAxisCharts(t),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(t),s.chart.stacked){const t=new G(this.ctx);i.series=t.setNullSeriesToZeroValues(i.series)}this.coreUtils.getSeriesTotals(),i.axisCharts&&(i.stackedSeriesTotals=this.coreUtils.getStackedSeriesTotals(),i.stackedSeriesTotalsByGroups=this.coreUtils.getStackedSeriesTotalsByGroups()),this.coreUtils.getPercentSeries(),i.dataFormatXNumeric||i.isXNumeric&&("numeric"!==s.xaxis.type||0!==s.labels.length||0!==s.xaxis.categories.length)||this.handleExternalLabelsData(t);const a=this.coreUtils.getCategoryLabels(i.labels);for(let t=0;t<a.length;t++)if(Array.isArray(a[t])){i.isMultiLineX=!0;break}}excludeCollapsedSeriesInYAxis(){const t=this.w;let 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 _{constructor(t){this.ctx=t,this.w=t.w}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){let 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)}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,o=s.globals.svgHeight*i,r=s.globals.dom.elWrap.cloneNode(!0);r.style.width=a+"px",r.style.height=o+"px";const l=(new XMLSerializer).serializeToString(r);let n="\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.globals.dom.elLegendWrap&&s.globals.dom.elLegendWrap.children.length>0&&(n+=B);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:${o}px;">\n <style type="text/css">\n ${n}\n </style>\n ${l}\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(/&nbsp;/g,"&#160;"))})})}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 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;t.getContext("2d").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 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.globals.dom.elWrap.style.height,10)*i;const o="transparent"!==s.config.chart.background&&s.config.chart.background?s.config.chart.background:"#fff";let r=a.getContext("2d");r.fillStyle=o,r.fillRect(0,0,a.width*i,a.height*i),this.getSvgString(i).then(t=>{const s="data:image/svg+xml,"+encodeURIComponent(t);let i=new Image;i.crossOrigin="anonymous",i.onload=()=>{if(r.drawImage(i,0,0),a.msToBlob){let t=a.msToBlob();e({blob:t})}else{let 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 o=[],r=[],l="",n=a.globals.series.map((t,e)=>-1===a.globals.collapsedSeriesIndices.indexOf(e)?t:[]);const 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():u.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 $(this.ctx),p=new L(this.ctx),x=t=>{let e="";if(a.globals.axisCharts){if("category"===a.config.xaxis.type||a.config.xaxis.convertedCatToNumeric)if(a.globals.isBarHorizontal){let s=a.globals.yLabelFormatters[0],i=new G(this.ctx).getActiveConfigSeriesIndex();e=s(a.globals.labels[t],{seriesIndex:i,dataPointIndex:t,w:a})}else e=p.getLabel(a.globals.labels,a.globals.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(" ")),u.isNumber(e)?e:e.split(s).join(""))},b=(e,i)=>{var l;if(o.length&&0===i&&r.push(o.join(s)),e.data){e.data=e.data.length&&e.data||[...Array(d)].map(()=>"");for(let d=0;d<e.data.length;d++){o=[];let p=x(d);if("nullvalue"!==p){if(p||(g.isFormatXY()?p=t[i].data[d].x:g.isFormat2DArray()&&(p=t[i].data[d]?t[i].data[d][0]:"")),0===i){o.push(h(p));for(let e=0;e<a.globals.series.length;e++){const s=g.isFormatXY()?null==(l=t[e].data[d])?void 0:l.y:n[e][d];o.push(c(s))}}("candlestick"===a.config.chart.type||e.type&&"candlestick"===e.type)&&(o.pop(),o.push(a.globals.seriesCandleO[i][d]),o.push(a.globals.seriesCandleH[i][d]),o.push(a.globals.seriesCandleL[i][d]),o.push(a.globals.seriesCandleC[i][d])),("boxPlot"===a.config.chart.type||e.type&&"boxPlot"===e.type)&&(o.pop(),o.push(a.globals.seriesCandleO[i][d]),o.push(a.globals.seriesCandleH[i][d]),o.push(a.globals.seriesCandleM[i][d]),o.push(a.globals.seriesCandleL[i][d]),o.push(a.globals.seriesCandleC[i][d])),"rangeBar"===a.config.chart.type&&(o.pop(),o.push(a.globals.seriesRangeStart[i][d]),o.push(a.globals.seriesRangeEnd[i][d])),o.length&&r.push(o.join(s))}}}};o.push(a.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===a.config.chart.type?(o.push("minimum"),o.push("q1"),o.push("median"),o.push("q3"),o.push("maximum")):"candlestick"===a.config.chart.type?(o.push("open"),o.push("high"),o.push("low"),o.push("close")):"rangeBar"===a.config.chart.type?(o.push("minimum"),o.push("maximum")):t.map((t,e)=>{const i=(t.name?t.name:`series-${e}`)+"";a.globals.axisCharts&&o.push(i.split(s).join("")?i.split(s).join(""):`series-${e}`)}),a.globals.axisCharts||(o.push(a.config.chart.toolbar.export.csv.headerValue),r.push(o.join(s))),a.globals.allSeriesHasEqualX||!a.globals.axisCharts||a.config.xaxis.categories.length||a.config.labels.length?t.map((t,e)=>{a.globals.axisCharts?b(t,e):(o=[],o.push(h(a.globals.labels[e])),o.push(c(n[e])),r.push(o.join(s)))}):(()=>{const e=new Set,i={};t.forEach((s,a)=>{null==s||s.data.forEach(s=>{let o,r;if(g.isFormatXY())o=s.x,r=s.y;else{if(!g.isFormat2DArray())return;o=s[0],r=s[1]}i[o]||(i[o]=Array(t.length).fill("")),i[o][a]=c(r),e.add(o)})}),o.length&&r.push(o.join(s)),Array.from(e).sort().forEach(t=>{r.push([h(t),i[t].join(s)])})})(),l+=r.join(i),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+l),e||a.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,s){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)}}class V{constructor(t,e){this.ctx=t,this.elgrid=e,this.w=t.w;const s=this.w;this.axesUtils=new L(t),this.xaxisLabels=s.globals.labels.slice(),s.globals.timescaleLabels.length>0&&!s.globals.isBarHorizontal&&(this.xaxisLabels=s.globals.timescaleLabels.slice()),s.config.xaxis.overwriteCategories&&(this.xaxisLabels=s.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===s.config.xaxis.position?this.offY=0:this.offY=s.globals.gridHeight,this.offY=this.offY+s.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===s.config.chart.type&&s.config.plotOptions.bar.horizontal,this.xaxisFontSize=s.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=s.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=s.config.xaxis.labels.style.colors,this.xaxisBorderWidth=s.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=s.config.yaxis[0].axisBorder.width.toString()),String(this.xaxisBorderWidth).indexOf("%")>-1?this.xaxisBorderWidth=s.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=s.config.xaxis.axisBorder.height,this.yaxis=s.config.yaxis[0]}drawXaxis(){let t=this.w,e=new w(this.ctx),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.globals.translateXAxisX}, ${t.globals.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.globals.isXNumeric,(t,e)=>e),t.globals.hasXaxisGroups){let s=t.globals.groups;a=[];for(let t=0;t<s.length;t++)a.push(s[t].title);let o={};t.config.xaxis.group.style&&(o.xaxisFontSize=t.config.xaxis.group.style.fontSize,o.xaxisFontFamily=t.config.xaxis.group.style.fontFamily,o.xaxisForeColors=t.config.xaxis.group.style.colors,o.fontWeight=t.config.xaxis.group.style.fontWeight,o.cssClass=t.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,e,i,a,!1,(t,e)=>s[t].cols*e,o)}if(void 0!==t.config.xaxis.title.text){let i=e.group({class:"apexcharts-xaxis-title"}),a=e.drawText({x:t.globals.gridWidth/2+t.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+("bottom"===t.config.xaxis.position?t.globals.xAxisLabelsHeight:-t.globals.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;let 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,o,r={}){let l=[],n=[],h=this.w;const c=r.xaxisFontSize||this.xaxisFontSize,d=r.xaxisFontFamily||this.xaxisFontFamily,g=r.xaxisForeColors||this.xaxisForeColors,p=r.fontWeight||h.config.xaxis.labels.style.fontWeight,x=r.cssClass||h.config.xaxis.labels.style.cssClass;let b,f=h.globals.padHorizontal,u=i.length,m="category"===h.config.xaxis.type?h.globals.dataPoints:u;if(0===m&&u>m&&(m=u),a){let t=Math.max(Number(h.config.xaxis.tickAmount)||1,m>1?m-1:m);b=h.globals.gridWidth/Math.min(t,u-1),f=f+o(0,b)/2+h.config.xaxis.labels.offsetX}else b=h.globals.gridWidth/m,f=f+o(0,b)+h.config.xaxis.labels.offsetX;for(let a=0;a<=u-1;a++){let r=f-o(a,b)/2+h.config.xaxis.labels.offsetX;0===a&&1===u&&b/2===f&&1===m&&(r=h.globals.gridWidth/2);let y=this.axesUtils.getLabel(i,h.globals.timescaleLabels,r,a,l,c,t),w=28;h.globals.rotateXLabels&&t&&(w=22),h.config.xaxis.title.text&&"top"===h.config.xaxis.position&&(w+=parseFloat(h.config.xaxis.title.style.fontSize)+2),t||(w=w+parseFloat(c)+(h.globals.xAxisLabelsHeight-h.globals.xAxisGroupLabelsHeight)+(h.globals.rotateXLabels?10:0));y=void 0!==h.config.xaxis.tickAmount&&"dataPoints"!==h.config.xaxis.tickAmount&&"datetime"!==h.config.xaxis.type?this.axesUtils.checkLabelBasedOnTickamount(a,y,u):this.axesUtils.checkForOverflowingLabels(a,y,u,l,n);const v=()=>t&&h.config.xaxis.convertedCatToNumeric?g[h.globals.minX+a-1]:g[a];if(h.config.xaxis.labels.show){let i=e.drawText({x:y.x,y:this.offY+h.config.xaxis.labels.offsetY+w-("top"===h.config.xaxis.position?h.globals.xAxisHeight+h.config.xaxis.axisTicks.height-2:0),text:y.text,textAnchor:"middle",fontWeight:y.isBold?600:p,fontSize:c,fontFamily:d,foreColor:Array.isArray(g)?v():g,isPlainText:!1,cssClass:(t?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+x});if(s.add(i),i.on("click",t=>{if("function"==typeof h.config.chart.events.xAxisLabelClick){const e=Object.assign({},h,{labelIndex:a});h.config.chart.events.xAxisLabelClick(t,this.ctx,e)}}),t){let t=document.createElementNS(h.globals.SVGNS,"title");t.textContent=Array.isArray(y.text)?y.text.join(" "):y.text,i.node.appendChild(t),""!==y.text&&(l.push(y.text),n.push(y))}}a<u-1&&(f+=o(a+1,b))}}drawXaxisInversed(t){let e,s,i=this.w,a=new w(this.ctx),o=i.config.yaxis[0].opposite?i.globals.translateYAxisX[t]:0,r=a.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:t}),l=a.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+o+", 0)"});r.add(l);let n=[];if(i.config.yaxis[t].show)for(let t=0;t<this.xaxisLabels.length;t++)n.push(this.xaxisLabels[t]);e=i.globals.gridHeight/n.length,s=-e/2.2;let h=i.globals.yLabelFormatters[0];const c=i.config.yaxis[0].labels;if(c.show)for(let o=0;o<=n.length-1;o++){let r=void 0===n[o]?"":n[o];r=h(r,{seriesIndex:t,dataPointIndex:o,w:i});const d=this.axesUtils.getYAxisForeColor(c.style.colors,t),g=()=>Array.isArray(d)?d[o]:d;let p=0;Array.isArray(r)&&(p=r.length/2*parseInt(c.style.fontSize,10));let x=c.offsetX-15,b="end";this.yaxis.opposite&&(b="start"),"left"===i.config.yaxis[0].labels.align?(x=c.offsetX,b="start"):"center"===i.config.yaxis[0].labels.align?(x=c.offsetX,b="middle"):"right"===i.config.yaxis[0].labels.align&&(b="end");let f=a.drawText({x:x,y:s+e+c.offsetY-p,text:r,textAnchor:b,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});l.add(f),f.on("click",t=>{if("function"==typeof i.config.chart.events.xAxisLabelClick){const e=Object.assign({},i,{labelIndex:o});i.config.chart.events.xAxisLabelClick(t,this.ctx,e)}});let u=document.createElementNS(i.globals.SVGNS,"title");if(u.textContent=Array.isArray(r)?r.join(" "):r,f.node.appendChild(u),0!==i.config.yaxis[t].labels.rotate){let e=a.rotateAroundCenter(f.node);f.node.setAttribute("transform",`rotate(${i.config.yaxis[t].labels.rotate} 0 ${e.y})`)}s+=e}if(void 0!==i.config.yaxis[0].title.text){let t=a.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+o+", 0)"}),e=a.drawText({x:i.config.yaxis[0].title.offsetX,y:i.globals.gridHeight/2+i.config.yaxis[0].title.offsetY,text:i.config.yaxis[0].title.text,textAnchor:"middle",foreColor:i.config.yaxis[0].title.style.color,fontSize:i.config.yaxis[0].title.style.fontSize,fontWeight:i.config.yaxis[0].title.style.fontWeight,fontFamily:i.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+i.config.yaxis[0].title.style.cssClass});t.add(e),r.add(t)}let d=0;this.isCategoryBarHorizontal&&i.config.yaxis[0].opposite&&(d=i.globals.gridWidth);const g=i.config.xaxis.axisBorder;if(g.show){let t=a.drawLine(i.globals.padHorizontal+g.offsetX+d,1+g.offsetY,i.globals.padHorizontal+g.offsetX+d,i.globals.gridHeight+g.offsetY,g.color,0);this.elgrid&&this.elgrid.elGridBorders&&i.config.grid.show?this.elgrid.elGridBorders.add(t):r.add(t)}return i.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(d,n.length,i.config.yaxis[0].axisBorder,i.config.yaxis[0].axisTicks,0,e,r),r}drawXaxisTicks(t,e,s){let i=this.w,a=t;if(t<0||t-2>i.globals.gridWidth)return;let o=this.offY+i.config.xaxis.axisTicks.offsetY;if(e=e+o+i.config.xaxis.axisTicks.height,"top"===i.config.xaxis.position&&(e=o-i.config.xaxis.axisTicks.height),i.config.xaxis.axisTicks.show){let r=new w(this.ctx).drawLine(t+i.config.xaxis.axisTicks.offsetX,o+i.config.xaxis.offsetY,a+i.config.xaxis.axisTicks.offsetX,e+i.config.xaxis.offsetY,i.config.xaxis.axisTicks.color);s.add(r),r.node.classList.add("apexcharts-xaxis-tick")}}getXAxisTicksPositions(){const t=this.w;let e=[];const s=this.xaxisLabels.length;let i=t.globals.padHorizontal;if(t.globals.timescaleLabels.length>0)for(let t=0;t<s;t++)i=this.xaxisLabels[t].position,e.push(i);else{let a=s;for(let s=0;s<a;s++){let s=a;t.globals.isXNumeric&&"bar"!==t.config.chart.type&&(s-=1),i+=t.globals.gridWidth/s,e.push(i)}}return e}xAxisLabelCorrections(){let t=this.w,e=new w(this.ctx),s=t.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),i=t.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),a=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),o=t.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(t.globals.rotateXLabels||t.config.xaxis.labels.rotateAlways)for(let a=0;a<i.length;a++){let o=e.rotateAroundCenter(i[a]);o.y=o.y-1,o.x=o.x+1,i[a].setAttribute("transform",`rotate(${t.config.xaxis.labels.rotate} ${o.x} ${o.y})`),i[a].setAttribute("text-anchor","end"),s.setAttribute("transform","translate(0, -10)");let r=i[a].childNodes;t.config.xaxis.labels.trim&&Array.prototype.forEach.call(r,s=>{e.placeTextWithEllipsis(s,s.textContent,t.globals.xAxisLabelsHeight-("bottom"===t.config.legend.position?20:10))})}else{let s=t.globals.gridWidth/(t.globals.labels.length+1);for(let a=0;a<i.length;a++){let o=i[a].childNodes;t.config.xaxis.labels.trim&&"datetime"!==t.config.xaxis.type&&Array.prototype.forEach.call(o,t=>{e.placeTextWithEllipsis(t,t.textContent,s)})}}if(a.length>0){let s=a[a.length-1].getBBox(),i=a[0].getBBox();s.x<-20&&a[a.length-1].parentNode.removeChild(a[a.length-1]),i.x+i.width>t.globals.gridWidth&&!t.globals.isBarHorizontal&&a[0].parentNode.removeChild(a[0]);for(let s=0;s<o.length;s++)e.placeTextWithEllipsis(o[s],o[s].textContent,t.config.yaxis[0].labels.maxWidth-(t.config.yaxis[0].title.text?2*parseFloat(t.config.yaxis[0].title.style.fontSize):0)-15)}}}class j{constructor(t){this.ctx=t,this.w=t.w;const e=this.w;this.xaxisLabels=e.globals.labels.slice(),this.axesUtils=new L(t),this.isRangeBar=e.globals.seriesRange.length&&e.globals.isBarHorizontal,e.globals.timescaleLabels.length>0&&(this.xaxisLabels=e.globals.timescaleLabels.slice())}drawGridArea(t=null){const e=this.w,s=new w(this.ctx);t||(t=s.group({class:"apexcharts-grid"}));const i=s.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.globals.gridHeight,"transparent"),a=s.drawLine(e.globals.padHorizontal,e.globals.gridHeight,e.globals.gridWidth,e.globals.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 w(this.ctx),i=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width,a=t=>{const s=document.createElementNS(e.SVGNS,"clipPath");return s.setAttribute("id",t),s};e.dom.elGridRectMask=a(`gridRectMask${e.cuid}`),e.dom.elGridRectBarMask=a(`gridRectBarMask${e.cuid}`),e.dom.elGridRectMarkerMask=a(`gridRectMarkerMask${e.cuid}`),e.dom.elForecastMask=a(`forecastMask${e.cuid}`),e.dom.elNonForecastMask=a(`nonForecastMask${e.cuid}`);let o=0,r=0;(["bar","rangeBar","candlestick","boxPlot"].includes(t.config.chart.type)||t.globals.comboBarCount>0)&&t.globals.isXNumeric&&!t.globals.isBarHorizontal&&(o=Math.max(t.config.grid.padding.left,e.barPadForNumericAxis),r=Math.max(t.config.grid.padding.right,e.barPadForNumericAxis)),e.dom.elGridRect=s.drawRect(-i/2-2,-i/2-2,e.gridWidth+i+4,e.gridHeight+i+4,0,"#fff"),e.dom.elGridRectBar=s.drawRect(-i/2-o-2,-i/2-2,e.gridWidth+i+r+o+4,e.gridHeight+i+4,0,"#fff");const l=t.globals.markers.largestSize;e.dom.elGridRectMarker=s.drawRect(Math.min(-i/2-o-2,-l),-l,e.gridWidth+Math.max(i+r+o+4,2*l),e.gridHeight+2*l,0,"#fff"),e.dom.elGridRectMask.appendChild(e.dom.elGridRect.node),e.dom.elGridRectBarMask.appendChild(e.dom.elGridRectBar.node),e.dom.elGridRectMarkerMask.appendChild(e.dom.elGridRectMarker.node);const n=e.dom.baseEl.querySelector("defs");n.appendChild(e.dom.elGridRectMask),n.appendChild(e.dom.elGridRectBarMask),n.appendChild(e.dom.elGridRectMarkerMask),n.appendChild(e.dom.elForecastMask),n.appendChild(e.dom.elNonForecastMask)}_drawGridLines({i:t,x1:e,y1:s,x2:i,y2:a,xCount:o,parent:r}){const l=this.w;if(!(0===t&&l.globals.skipFirstTimelinelabel||t===o-1&&l.globals.skipLastTimelinelabel&&!l.config.xaxis.labels.formatter||"radar"===l.config.chart.type)){l.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:o,parent:r});let n=0;if(l.globals.hasXaxisGroups&&"between"===l.config.xaxis.tickPlacement){const e=l.globals.groups;if(e){let s=0;for(let i=0;s<t&&i<e.length;i++)s+=e[i].cols;s===t&&(n=.6*l.globals.xAxisLabelsHeight)}}new V(this.ctx).drawXaxisTicks(e,n,l.globals.dom.elGraphical)}}_drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:o,parent:r}){const l=this.w,n=r.node.classList.contains("apexcharts-gridlines-horizontal"),h=l.globals.barPadForNumericAxis,c=0===s&&0===a||0===e&&0===i||s===l.globals.gridHeight&&a===l.globals.gridHeight||l.globals.isBarHorizontal&&(0===t||t===o-1),d=new w(this).drawLine(e-(n?h:0),s,i+(n?h:0),a,l.config.grid.borderColor,l.config.grid.strokeDashArray);d.node.classList.add("apexcharts-gridline"),c&&l.config.grid.show?this.elGridBorders.add(d):r.add(d)}_drawGridBandRect({c:t,x1:e,y1:s,x2:i,y2:a,type:o}){const r=this.w,l=new w(this.ctx),n=r.globals.barPadForNumericAxis,h=r.config.grid[o].colors[t],c=l.drawRect(e-("row"===o?n:0),s,i+("row"===o?2*n:0),a,0,h,r.config.grid[o].opacity);this.elg.add(c),c.attr("clip-path",`url(#gridRectMask${r.globals.cuid})`),c.node.classList.add(`apexcharts-grid-${o}`)}_drawXYLines({xCount:t,tickAmount:e}){const s=this.w,i=({xC:e,x1:s,y1:i,x2:a,y2:o})=>{for(let r=0;r<e;r++)s=this.xaxisLabels[r].position,a=this.xaxisLabels[r].position,this._drawGridLines({i:r,x1:s,y1:i,x2:a,y2:o,xCount:t,parent:this.elgridLinesV})},a=({xC:e,x1:i,y1:a,x2:o,y2:r})=>{for(let l=0;l<e+(s.globals.isXNumeric?0:1);l++)0===l&&1===e&&1===s.globals.dataPoints&&(o=i=s.globals.gridWidth/2),this._drawGridLines({i:l,x1:i,y1:a,x2:o,y2:r,xCount:t,parent:this.elgridLinesV}),o=i+=s.globals.gridWidth/(s.globals.isXNumeric?e-1:e)};if(s.config.grid.xaxis.lines.show||s.config.xaxis.axisTicks.show){let e,o=s.globals.padHorizontal,r=0,l=s.globals.gridHeight;s.globals.timescaleLabels.length?i({xC:t,x1:o,y1:r,x2:e,y2:l}):(s.globals.isXNumeric&&(t=s.globals.xAxisScale.result.length),a({xC:t,x1:o,y1:r,x2:e,y2:l}))}if(s.config.grid.yaxis.lines.show){let t=0,i=0,a=0,o=s.globals.gridWidth,r=e+1;this.isRangeBar&&(r=s.globals.labels.length);for(let l=0;l<r+(this.isRangeBar?1:0);l++)this._drawGridLine({i:l,xCount:r+(this.isRangeBar?1:0),x1:t,y1:i,x2:o,y2:a,parent:this.elgridLinesH}),i+=s.globals.gridHeight/(this.isRangeBar?r:e),a=i}}_drawInvertedXYLines({xCount:t}){const e=this.w;if(e.config.grid.xaxis.lines.show||e.config.xaxis.axisTicks.show){let s,i=e.globals.padHorizontal,a=0,o=e.globals.gridHeight;for(let r=0;r<t+1;r++){e.config.grid.xaxis.lines.show&&this._drawGridLine({i:r,xCount:t+1,x1:i,y1:a,x2:s,y2:o,parent:this.elgridLinesV});new V(this.ctx).drawXaxisTicks(i,0,e.globals.dom.elGraphical),i+=e.globals.gridWidth/t,s=i}}if(e.config.grid.yaxis.lines.show){let t=0,s=0,i=0,a=e.globals.gridWidth;for(let o=0;o<e.globals.dataPoints+1;o++)this._drawGridLine({i:o,xCount:e.globals.dataPoints+1,x1:t,y1:s,x2:a,y2:i,parent:this.elgridLinesH}),s+=e.globals.gridHeight/e.globals.dataPoints,i=s}}renderGrid(){var t,e,s;const i=this.w,a=i.globals,o=new w(this.ctx);this.elg=o.group({class:"apexcharts-grid"}),this.elgridLinesH=o.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=o.group({class:"apexcharts-gridlines-vertical"}),this.elGridBorders=o.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 r=0;for(;r<a.seriesYAxisMap.length&&a.ignoreYAxisIndexes.includes(r);)r++;r===a.seriesYAxisMap.length&&(r=0);let l,n=a.yAxisScale[r].result.length-1;return!a.isBarHorizontal||this.isRangeBar?(l=this.xaxisLabels.length,this.isRangeBar&&(n=a.labels.length,i.config.xaxis.tickAmount&&i.config.xaxis.labels.formatter&&(l=i.config.xaxis.tickAmount),(null==(s=null==(e=null==(t=a.yAxisScale)?void 0:t[r])?void 0:e.result)?void 0:s.length)>0&&"datetime"!==i.config.xaxis.type&&(l=a.yAxisScale[r].result.length-1)),this._drawXYLines({xCount:l,tickAmount:n})):(l=n,n=a.xTickAmount,this._drawInvertedXYLines({xCount:l,tickAmount:n})),this.drawGridBands(l,n),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:a.gridWidth/l}}drawGridBands(t,e){var s,i,a;const o=this.w,r=(t,s,i,a,r,l)=>{for(let n=0,h=0;n<s;n++,h++)h>=o.config.grid[t].colors.length&&(h=0),this._drawGridBandRect({c:h,x1:i,y1:a,x2:r,y2:l,type:t}),a+=o.globals.gridHeight/e};if((null==(s=o.config.grid.row.colors)?void 0:s.length)>0&&r("row",e,0,0,o.globals.gridWidth,o.globals.gridHeight/e),(null==(i=o.config.grid.column.colors)?void 0:i.length)>0){let e=o.globals.isBarHorizontal||"on"!==o.config.xaxis.tickPlacement||"category"!==o.config.xaxis.type&&!o.config.xaxis.convertedCatToNumeric?t:t-1;o.globals.isXNumeric&&(e=o.globals.xAxisScale.result.length-1);let s=o.globals.padHorizontal,i=0,r=o.globals.padHorizontal+o.globals.gridWidth/e,l=o.globals.gridHeight;for(let n=0,h=0;n<t;n++,h++)h>=o.config.grid.column.colors.length&&(h=0),"datetime"===o.config.xaxis.type&&(s=this.xaxisLabels[n].position,r=((null==(a=this.xaxisLabels[n+1])?void 0:a.position)||o.globals.gridWidth)-this.xaxisLabels[n].position),this._drawGridBandRect({c:h,x1:s,y1:i,x2:r,y2:l,type:"column"}),s+=o.globals.gridWidth/e}}}class U{constructor(t){this.ctx=t,this.w=t.w,this.coreUtils=new v(this.ctx)}niceScale(t,e,s=0){const i=1e-11,a=this.w,o=a.globals;let r,l,n,h;o.isBarHorizontal?(r=a.config.xaxis,l=Math.max((o.svgWidth-100)/25,2)):(r=a.config.yaxis[s],l=Math.max((o.svgHeight-100)/15,2)),u.isNumber(l)||(l=10),n=void 0!==r.min&&null!==r.min,h=void 0!==r.max&&null!==r.min;let c=void 0!==r.stepSize&&null!==r.stepSize,d=void 0!==r.tickAmount&&null!==r.tickAmount,g=d?r.tickAmount:o.niceScaleDefaultTicks[Math.min(Math.round(l/2),o.niceScaleDefaultTicks.length-1)];if(o.isMultipleYAxis&&!d&&o.multiAxisTickAmount>0&&(g=o.multiAxisTickAmount,d=!0),g="dataPoints"===g?o.dataPoints-1:Math.abs(Math.round(g)),(t===Number.MIN_VALUE&&0===e||!u.isNumber(t)&&!u.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE)&&(t=u.isNumber(r.min)?r.min:0,e=u.isNumber(r.max)?r.max:t+g,o.allSeriesCollapsed=!1),t>e){let s=e;e=t,t=s}else t===e&&(t=0===t?0:t-1,e=0===e?2:e+1);let p=[];g<1&&(g=1);let x=g,b=Math.abs(e-t);!n&&t>0&&t/b<.15&&(t=0,n=!0),!h&&e<0&&-e/b<.15&&(e=0,h=!0),b=Math.abs(e-t);let f=b/x,m=f,y=Math.floor(Math.log10(m)),w=Math.pow(10,y),v=Math.ceil(m/w);if(v=o.niceScaleAllowedMagMsd[0===o.yValueDecimal?0:1][v],m=v*w,f=m,o.isBarHorizontal&&r.stepSize&&"datetime"!==r.type?(f=r.stepSize,c=!0):c&&(f=r.stepSize),c&&r.forceNiceScale){let t=Math.floor(Math.log10(f));f*=Math.pow(10,y-t)}if(n&&h){let t=b/x;if(d)if(c)if(0!=u.mod(b,f)){let e=u.getGCD(f,t);f=t/e<10?e:t}else 0==u.mod(f,t)?f=t:(t=f,d=!1);else f=t;else if(c)0==u.mod(b,f)?t=f:f=t;else if(0==u.mod(b,f))t=f;else{x=Math.ceil(b/f),t=b/x;let e=u.getGCD(b,f);b/e<l&&(t=e),f=t}x=Math.round(b/f)}else{if(n||h){if(h)if(d)t=e-f*x;else{let s=t;t=f*Math.floor(t/f),Math.abs(e-t)/u.getGCD(b,f)>l&&(t=e-f*g,t+=f*Math.floor((s-t)/f))}else if(n)if(d)e=t+f*x;else{let s=e;e=f*Math.ceil(e/f),Math.abs(e-t)/u.getGCD(b,f)>l&&(e=t+f*g,e+=f*Math.ceil((s-e)/f))}}else if(o.isMultipleYAxis&&d){let s=f*Math.floor(t/f),i=s+f*x;i<e&&(f*=2),i=e,e=(t=s)+f*x,b=Math.abs(e-t),t>0&&t<Math.abs(i-e)&&(t=0,e=f*x),e<0&&-e<Math.abs(s-t)&&(e=0,t=-f*x)}else t=f*Math.floor(t/f),e=f*Math.ceil(e/f);b=Math.abs(e-t),f=u.getGCD(b,f),x=Math.round(b/f)}if(d||n||h||(x=Math.ceil((b-i)/(f+i)),x>16&&u.getPrimeFactors(x).length<2&&x++),!d&&r.forceNiceScale&&0===o.yValueDecimal&&x>b&&(x=b,f=Math.round(b/x)),x>l&&(!d&&!c||r.forceNiceScale)){let t=u.getPrimeFactors(x),e=t.length-1,s=x;t:for(var A=0;A<e;A++)for(var C=0;C<=e-A;C++){let i=Math.min(C+A,e),a=s,o=1;for(var S=C;S<=i;S++)o*=t[S];if(a/=o,a<l){s=a;break t}}f=s===x?b:b/s,x=Math.round(b/f)}o.isMultipleYAxis&&0==o.multiAxisTickAmount&&o.ignoreYAxisIndexes.indexOf(s)<0&&(o.multiAxisTickAmount=x);let k=t-f,L=f*i;do{k+=f,p.push(u.stripNumber(k,7))}while(e-k>L);return{result:p,niceMin:p[0],niceMax:p[p.length-1]}}linearScale(t,e,s=10,i=0,a=void 0){let o=Math.abs(e-t),r=[];if(t===e)return r=[t],{result:r,niceMin:r[0],niceMax:r[r.length-1]};"dataPoints"===(s=this._adjustTicksForSmallRange(s,i,o))&&(s=this.w.globals.dataPoints-1),a||(a=o/s);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}s===Number.MAX_VALUE&&(s=5,a=1);let l=t;for(;s>=0;)r.push(l),l=u.preciseAddition(l,a),s-=1;return{result:r,niceMin:r[0],niceMax:r[r.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),o=Math.log(t)/Math.log(s),r=a-o,l=Math.round(r),n=r/l;for(let t=0,e=o;t<l;t++,e+=n)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));u.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;let o=i.isBarHorizontal?a.xaxis:a.yaxis[t];void 0===i.yAxisScale[t]&&(i.yAxisScale[t]=[]);let r=Math.abs(s-e);o.logarithmic&&r<=5&&(i.invalidLogScale=!0),o.logarithmic&&r>5?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=o.forceNiceScale?this.logarithmicScaleNice(e,s,o.logBase):this.logarithmicScale(e,s,o.logBase)):s!==-Number.MAX_VALUE&&u.isNumber(s)&&e!==Number.MAX_VALUE&&u.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&&u.isNumber(e)){let 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();let s=e.seriesYAxisMap,i=e.minYArr,a=e.maxYArr;e.allSeriesCollapsed=!0,e.barGroups=[],s.forEach((s,o)=>{let r=[];if(s.forEach(e=>{var s;let i=null==(s=t.series[e])?void 0:s.group;r.indexOf(i)<0&&r.push(i)}),s.length>0){let l,n,h=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=h,g=c;if(t.chart.stacked){let i=new Array(e.dataPoints).fill(0),a=[],p=[],x=[];r.forEach(()=>{a.push(i.map(()=>Number.MIN_VALUE)),p.push(i.map(()=>Number.MIN_VALUE)),x.push(i.map(()=>Number.MIN_VALUE))});for(let i=0;i<s.length;i++){!l&&t.series[s[i]].type&&(l=t.series[s[i]].type);let h=s[i];n=t.series[h].group?t.series[h].group:"axis-".concat(o),!(e.collapsedSeriesIndices.indexOf(h)<0&&e.ancillaryCollapsedSeriesIndices.indexOf(h)<0)||(e.allSeriesCollapsed=!1,r.forEach((s,i)=>{if(t.series[h].group===s)for(let t=0;t<e.series[h].length;t++){let s=e.series[h][t];s>=0?p[i][t]+=s:x[i][t]+=s,a[i][t]+=s,d=Math.min(d,s),g=Math.max(g,s)}})),"bar"!==l&&"column"!==l||e.barGroups.push(n)}l||(l=t.chart.type),"bar"===l||"column"===l?r.forEach((t,e)=>{h=Math.min(h,Math.min.apply(null,x[e])),c=Math.max(c,Math.max.apply(null,p[e]))}):(r.forEach((t,e)=>{d=Math.min(d,Math.min.apply(null,a[e])),g=Math.max(g,Math.max.apply(null,a[e]))}),h=d,c=g),h===Number.MIN_VALUE&&c===Number.MIN_VALUE&&(c=-Number.MAX_VALUE)}else for(let t=0;t<s.length;t++){let o=s[t];h=Math.min(h,i[o]),c=Math.max(c,a[o]),!(e.collapsedSeriesIndices.indexOf(o)<0&&e.ancillaryCollapsedSeriesIndices.indexOf(o)<0)||(e.allSeriesCollapsed=!1)}void 0!==t.yaxis[o].min&&(h="function"==typeof t.yaxis[o].min?t.yaxis[o].min(h):t.yaxis[o].min),void 0!==t.yaxis[o].max&&(c="function"==typeof t.yaxis[o].max?t.yaxis[o].max(c):t.yaxis[o].max),e.barGroups=e.barGroups.filter((t,e,s)=>s.indexOf(t)===e),this.setYScaleForIndex(o,h,c),s.forEach(t=>{i[t]=e.yAxisScale[o].niceMin,a[t]=e.yAxisScale[o].niceMax})}else this.setYScaleForIndex(o,0,-Number.MAX_VALUE)})}}class q{constructor(t){this.ctx=t,this.w=t.w,this.scales=new U(t)}init(){this.setYRange(),this.setXRange(),this.setZRange()}getMinYMaxY(t,e=Number.MAX_VALUE,s=-Number.MAX_VALUE,i=null){var a,o,r,l,n;const h=this.w.config,c=this.w.globals;let d=-Number.MAX_VALUE,g=Number.MIN_VALUE;null===i&&(i=t+1);let p=c.series,x=p,b=p;"candlestick"===h.chart.type?(x=c.seriesCandleL,b=c.seriesCandleH):"boxPlot"===h.chart.type?(x=c.seriesCandleO,b=c.seriesCandleC):c.isRangeData&&(x=c.seriesRangeStart,b=c.seriesRangeEnd);let f=!1;if(c.seriesX.length>=i){let t=null==(a=c.brushSource)?void 0:a.w.config.chart.brush;(h.chart.zoom.enabled&&h.chart.zoom.autoScaleYaxis||(null==t?void 0:t.enabled)&&(null==t?void 0:t.autoScaleYaxis))&&(f=!0)}for(let a=t;a<i;a++){c.dataPoints=Math.max(c.dataPoints,p[a].length);const t=h.series[a].type;c.categoryLabels.length&&(c.dataPoints=c.categoryLabels.filter(t=>void 0!==t).length),c.labels.length&&"datetime"!==h.xaxis.type&&0!==c.series.reduce((t,e)=>t+e.length,0)&&(c.dataPoints=Math.max(c.dataPoints,c.labels.length));let i=0,m=p[a].length-1;if(f){if(h.xaxis.min)for(;i<m&&c.seriesX[a][i]<h.xaxis.min;i++);if(h.xaxis.max)for(;m>i&&c.seriesX[a][m]>h.xaxis.max;m--);}for(let h=i;h<=m&&h<c.series[a].length;h++){let i=p[a][h];if(null!==i&&u.isNumber(i)){switch(void 0!==(null==(o=b[a])?void 0:o[h])&&(d=Math.max(d,b[a][h]),e=Math.min(e,b[a][h])),void 0!==(null==(r=x[a])?void 0:r[h])&&(e=Math.min(e,x[a][h]),s=Math.max(s,x[a][h])),t){case"candlestick":void 0!==c.seriesCandleC[a][h]&&(d=Math.max(d,c.seriesCandleH[a][h]),e=Math.min(e,c.seriesCandleL[a][h]));break;case"boxPlot":void 0!==c.seriesCandleC[a][h]&&(d=Math.max(d,c.seriesCandleC[a][h]),e=Math.min(e,c.seriesCandleO[a][h]))}t&&"candlestick"!==t&&"boxPlot"!==t&&"rangeArea"!==t&&"rangeBar"!==t&&(d=Math.max(d,c.series[a][h]),e=Math.min(e,c.series[a][h])),c.seriesGoals[a]&&c.seriesGoals[a][h]&&Array.isArray(c.seriesGoals[a][h])&&c.seriesGoals[a][h].forEach(t=>{d=Math.max(d,t.value),e=Math.min(e,t.value)}),s=d,i=u.noExponents(i),u.isFloat(i)&&(c.yValueDecimal=Math.max(c.yValueDecimal,i.toString().split(".")[1].length)),g>(null==(l=x[a])?void 0:l[h])&&(null==(n=x[a])?void 0:n[h])<0&&(g=x[a][h])}else c.hasNullValues=!0}"bar"!==t&&"column"!==t||(g<0&&d<0&&(d=0,s=Math.max(s,0)),g===Number.MIN_VALUE&&(g=0,e=Math.min(e,0)))}return"rangeBar"===h.chart.type&&c.seriesRangeStart.length&&c.isBarHorizontal&&(g=e),"bar"===h.chart.type&&(g<0&&d<0&&(d=0),g===Number.MIN_VALUE&&(g=0)),{minY:g,maxY:d,lowestY:e,highestY:s}}setYRange(){let 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<t.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,null,t.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||"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=>{switch(s.type||e.chart.type){case"bar":case"column":t.barGroups.push(s.group);break;case"line":t.lineGroups.push(s.group);break;case"area":t.areaGroups.push(s.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(){let t=this.w.globals,e=this.w.config;const s="numeric"===e.xaxis.type||"datetime"===e.xaxis.type||"category"===e.xaxis.type&&!t.noLabelsProvided||t.noLabelsProvided||t.isXNumeric;if(t.isXNumeric&&(()=>{for(let e=0;e<t.series.length;e++)if(t.labels[e])for(let s=0;s<t.labels[e].length;s++)null!==t.labels[e][s]&&u.isNumber(t.labels[e][s])&&(t.maxX=Math.max(t.maxX,t.labels[e][s]),t.initialMaxX=Math.max(t.maxX,t.labels[e][s]),t.minX=Math.min(t.minX,t.labels[e][s]),t.initialMinX=Math.min(t.minX,t.labels[e][s]))})(),t.noLabelsProvided&&0===e.xaxis.categories.length&&(t.maxX=t.labels[t.labels.length-1],t.initialMaxX=t.labels[t.labels.length-1],t.minX=1,t.initialMinX=1),t.isXNumeric||t.noLabelsProvided||t.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(t.series.length>1&&(i=t.series[t.maxValsInArrayIndex].length-1),t.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&&!t.dataFormatXNumeric){let 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),t.noLabelsProvided&&t.labels.length>0&&(t.xAxisScale=this.scales.linearScale(1,t.labels.length,i-1,0,e.xaxis.stepSize),t.seriesX=t.labels.slice());s&&(t.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&t.labels.length&&(t.xTickAmount=t.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}setZRange(){let t=this.w.globals;if(t.isDataXYZ)for(let e=0;e<t.series.length;e++)if(void 0!==t.seriesZ[e])for(let s=0;s<t.seriesZ[e].length;s++)null!==t.seriesZ[e][s]&&u.isNumber(t.seriesZ[e][s])&&(t.maxZ=Math.max(t.maxZ,t.seriesZ[e][s]),t.minZ=Math.min(t.minZ,t.seriesZ[e][s]))}_handleSingleDataPoint(){const t=this.w.globals,e=this.w.config;if(t.minX===t.maxX){let s=new S(this.ctx);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&&!t.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;t.isXNumeric&&t.seriesX.forEach(e=>{if(e.length){1===e.length&&e.push(t.seriesX[t.maxValsInArrayIndex][t.seriesX[t.maxValsInArrayIndex].length-1]);const s=e.slice();s.sort((t,e)=>t-e),s.forEach((e,i)=>{if(i>0){let 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(!t.series.length)return;let e=t.seriesGroups;e.length||(e=[this.w.globals.seriesNames.map(t=>t)]);let s={},i={};e.forEach(e=>{s[e]=[],i[e]=[];this.w.config.series.map((s,i)=>e.indexOf(t.seriesNames[i])>-1?i:null).filter(t=>null!==t).forEach(a=>{var o,r,l,n;for(let h=0;h<t.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==(r=null==(o=this.w.config.series)?void 0:o[a])?void 0:r.type)||"column"===(null==(n=null==(l=this.w.config.series)?void 0:l[a])?void 0:n.type)))&&null!==t.series[a][h]&&u.isNumber(t.series[a][h])&&(t.series[a][h]>0?s[e][h]+=parseFloat(t.series[a][h])+1e-4:i[e][h]+=parseFloat(t.series[a][h]))}})}),Object.entries(s).forEach(([e])=>{s[e].forEach((a,o)=>{t.maxY=Math.max(t.maxY,s[e][o]),t.minY=Math.min(t.minY,i[e][o])})})}}class Z{constructor(t,e){this.ctx=t,this.elgrid=e,this.w=t.w;const s=this.w;this.xaxisFontSize=s.config.xaxis.labels.style.fontSize,this.axisFontFamily=s.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=s.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===s.config.chart.type&&s.config.plotOptions.bar.horizontal,this.xAxisoffX="bottom"===s.config.xaxis.position?s.globals.gridHeight:0,this.drawnLabels=[],this.axesUtils=new L(t)}drawYaxis(t){const e=this.w,s=new w(this.ctx),i=e.config.yaxis[t].labels.style,{fontSize:a,fontFamily:o,fontWeight:r}=i,l=s.group({class:"apexcharts-yaxis",rel:t,transform:`translate(${e.globals.translateYAxisX[t]}, 0)`});if(this.axesUtils.isYAxisHidden(t))return l;const n=s.group({class:"apexcharts-yaxis-texts-g"});l.add(n);const h=e.globals.yAxisScale[t].result.length-1,c=e.globals.gridHeight/h,d=e.globals.yLabelFormatters[t];let g=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());if(e.config.yaxis[t].labels.show){let l=e.globals.translateY+e.config.yaxis[t].labels.offsetY;e.globals.isBarHorizontal?l=0:"heatmap"===e.config.chart.type&&(l-=c/2),l+=parseInt(a,10)/3;let p=null;for(let x=h;x>=0;x--){let h=d(g[x],x,e),b=e.config.yaxis[t].labels.padding;e.config.yaxis[t].opposite&&0!==e.config.yaxis.length&&(b*=-1);const f=this.getTextAnchor(e.config.yaxis[t].labels.align,e.config.yaxis[t].opposite),m=this.axesUtils.getYAxisForeColor(i.colors,t),y=Array.isArray(m)?m[x]:m,w=u.listToArray(e.globals.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-label tspan`)).map(t=>t.textContent),v=s.drawText({x:b,y:l,text:w.includes(h)&&!e.config.yaxis[t].labels.showDuplicates?"":h,textAnchor:f,fontSize:a,fontFamily:o,fontWeight:r,maxWidth:e.config.yaxis[t].labels.maxWidth,foreColor:y,isPlainText:!1,cssClass:`apexcharts-yaxis-label ${i.cssClass}`});n.add(v),this.addTooltip(v,h),null===p&&(p=v),0!==e.config.yaxis[t].labels.rotate&&this.rotateLabel(s,v,p,e.config.yaxis[t].labels.rotate),l+=c}}return this.addYAxisTitle(s,l,t),this.addAxisBorder(s,l,t,h,c),l}getTextAnchor(t,e){return"left"===t?"start":"center"===t?"middle":"right"===t?"end":e?"start":"end"}addTooltip(t,e){const s=document.createElementNS(this.w.globals.SVGNS,"title");s.textContent=Array.isArray(e)?e.join(" "):e,t.node.appendChild(s)}rotateLabel(t,e,s,i){const a=t.rotateAroundCenter(s.node),o=t.rotateAroundCenter(e.node);e.node.setAttribute("transform",`rotate(${i} ${a.x} ${o.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"}),o=i.config.yaxis[s].opposite?i.globals.translateYAxisX[s]:0,r=t.drawText({x:o,y:i.globals.gridHeight/2+i.globals.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(r),e.add(a)}}addAxisBorder(t,e,s,i,a){const o=this.w,r=o.config.yaxis[s].axisBorder;let l=31+r.offsetX;if(o.config.yaxis[s].opposite&&(l=-31-r.offsetX),r.show){const s=t.drawLine(l,o.globals.translateY+r.offsetY-2,l,o.globals.gridHeight+o.globals.translateY+r.offsetY+2,r.color,0,r.width);e.add(s)}o.config.yaxis[s].axisTicks.show&&this.axesUtils.drawYAxisTicks(l,i,r,o.config.yaxis[s].axisTicks,s,a,e)}drawYaxisInversed(t){const e=this.w,s=new w(this.ctx),i=s.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),a=s.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${e.globals.translateXAxisX}, ${e.globals.translateXAxisY})`});i.add(a);let o=e.globals.yAxisScale[t].result.length-1;const r=e.globals.gridWidth/o+.1;let l=r+e.config.xaxis.labels.offsetX;const n=e.globals.xLabelFormatter;let h=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());const c=e.globals.timescaleLabels;if(c.length>0&&(this.xaxisLabels=c.slice(),h=c.slice(),o=h.length),e.config.xaxis.labels.show)for(let i=c.length?0:o;c.length?i<c.length:i>=0;c.length?i++:i--){let o=n(h[i],i,e),d=e.globals.gridWidth+e.globals.padHorizontal-(l-r+e.config.xaxis.labels.offsetX);if(c.length){const t=this.axesUtils.getLabel(h,c,d,i,this.drawnLabels,this.xaxisFontSize);d=t.x,o=t.text,this.drawnLabels.push(t.text),0===i&&e.globals.skipFirstTimelinelabel&&(o=""),i===h.length-1&&e.globals.skipLastTimelinelabel&&(o="")}const g=s.drawText({x:d,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-("top"===e.config.xaxis.position?e.globals.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:o,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,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,o),l+=r}return this.inversedYAxisTitleText(i),this.inversedYAxisBorder(i),i}inversedYAxisBorder(t){const e=this.w,s=new w(this.ctx),i=e.config.xaxis.axisBorder;if(i.show){let a=0;"bar"===e.config.chart.type&&e.globals.isXNumeric&&(a-=15);const o=s.drawLine(e.globals.padHorizontal+a+i.offsetX,this.xAxisoffX,e.globals.gridWidth,this.xAxisoffX,i.color,0,i.height);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(o):t.add(o)}}inversedYAxisTitleText(t){const e=this.w,s=new w(this.ctx);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.globals.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 w(this.ctx),a=s.globals.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-texts-g`),o=a?a.getBoundingClientRect():{width:0,height:0},r=s.globals.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-title text`),l=r?r.getBoundingClientRect():{width:0,height:0};if(r){const a=this.xPaddingForYAxisTitle(t,o,l,e);r.setAttribute("x",a.xPos-(e?10:0));const n=i.rotateAroundCenter(r);r.setAttribute("transform",`rotate(${e?-1*s.config.yaxis[t].title.rotate:s.config.yaxis[t].title.rotate} ${n.x} ${n.y})`)}}xPaddingForYAxisTitle(t,e,s,i){const a=this.w;let o=0,r=10;return void 0===a.config.yaxis[t].title.text||t<0?{xPos:o,padd:0}:(i?o=e.width+a.config.yaxis[t].title.offsetX+s.width/2+r/2:(o=-1*e.width+a.config.yaxis[t].title.offsetX+r/2+s.width/2,a.globals.isBarHorizontal&&(r=25,o=-1*e.width-a.config.yaxis[t].title.offsetX-r)),{xPos:o,padd:r})}setYAxisXPosition(t,e){const s=this.w;let i=0,a=0,o=18,r=1;s.config.yaxis.length>1&&(this.multipleYs=!0),s.config.yaxis.forEach((l,n)=>{const h=s.globals.ignoreYAxisIndexes.includes(n)||!l.show||l.floating||0===t[n].width,c=t[n].width+e[n].width;l.opposite?s.globals.isBarHorizontal?(a=s.globals.gridWidth+s.globals.translateX-1,s.globals.translateYAxisX[n]=a-l.labels.offsetX):(a=s.globals.gridWidth+s.globals.translateX+r,h||(r+=c+20),s.globals.translateYAxisX[n]=a-l.labels.offsetX+20):(i=s.globals.translateX-o,h||(o+=c+20),s.globals.translateYAxisX[n]=i+l.labels.offsetX)})}setYAxisTextAlignments(){const t=this.w;u.listToArray(t.globals.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.globals.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${s}'] .apexcharts-yaxis-texts-g`),a=u.listToArray(t.globals.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${s}'] .apexcharts-yaxis-label`)),o=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(${o.width/2*(i.opposite?1:-1)}, 0)`):"right"===i.labels.align&&i.opposite&&e.setAttribute("transform",`translate(${o.width}, 0)`):e.setAttribute("transform",`translate(-${o.width}, 0)`)}})}}class J{constructor(t){this.ctx=t,this.w=t.w,this.documentEvent=u.bind(this.documentEvent,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;let 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=[]);let 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;let s=t.globals.dom.baseEl.querySelector(t.globals.chartClass);this.ctx.eventList.forEach(i=>{s.addEventListener(i,s=>{let i=null===s.target.getAttribute("i")&&-1!==t.globals.capturedSeriesIndex?t.globals.capturedSeriesIndex:s.target.getAttribute("i"),a=null===s.target.getAttribute("j")&&-1!==t.globals.capturedDataPointIndex?t.globals.capturedDataPointIndex:s.target.getAttribute("j");const o=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&&("function"==typeof t.config.chart.events.keyDown&&t.config.chart.events.keyDown(s,e,o),e.ctx.events.fireEvent("keydown",[s,e,o])):"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,o),e.ctx.events.fireEvent("keyup",[s,e,o])):"mousemove"===s.type||"touchmove"===s.type?"function"==typeof t.config.chart.events.mouseMove&&t.config.chart.events.mouseMove(s,e,o):"mouseleave"===s.type||"touchleave"===s.type?"function"==typeof t.config.chart.events.mouseLeave&&t.config.chart.events.mouseLeave(s,e,o):("mouseup"===s.type&&1===s.which||"touchend"===s.type)&&("function"==typeof t.config.chart.events.click&&t.config.chart.events.click(s,e,o),e.ctx.events.fireEvent("click",[s,e,o]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(e=>{t.globals.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){let t=e.globals.dom.baseEl.querySelector(".apexcharts-menu");t&&t.classList.contains("apexcharts-menu-open")&&"apexcharts-menu-icon"!==s&&t.classList.remove("apexcharts-menu-open")}e.globals.clientX="touchmove"===t.type?t.touches[0].clientX:t.clientX,e.globals.clientY="touchmove"===t.type?t.touches[0].clientY:t.clientY}}class K{constructor(t){this.ctx=t,this.w=t.w}setCurrentLocaleValues(t){let e=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&window.Apex.chart.locales.length>0&&(e=this.w.config.chart.locales.concat(window.Apex.chart.locales));const s=e.filter(e=>e.name===t)[0];if(!s)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");{let t=u.extend(I,s);this.w.globals.locale=t.options}}}class Q{constructor(t){this.ctx=t,this.w=t.w}drawAxis(t,e){let s=this.w.globals,i=this.w.config,a=new V(this.ctx,e),o=new Z(this.ctx,e);if(s.axisCharts&&"radar"!==t){let t,e;s.isBarHorizontal?(e=o.drawYaxisInversed(0),t=a.drawXaxisInversed(0),s.dom.elGraphical.add(t),s.dom.elGraphical.add(e)):(t=a.drawXaxis(),s.dom.elGraphical.add(t),i.yaxis.map((t,i)=>{if(-1===s.ignoreYAxisIndexes.indexOf(i)&&(e=o.drawYaxis(i),s.dom.Paper.add(e),"back"===this.w.config.grid.position)){const t=s.dom.Paper.children()[1];t.remove(),s.dom.Paper.add(t)}}))}}}class tt{constructor(t){this.ctx=t,this.w=t.w}drawXCrosshairs(){const t=this.w;let e=new w(this.ctx),s=new y(this.ctx),i=t.config.xaxis.crosshairs.fill.gradient,a=t.config.xaxis.crosshairs.dropShadow,o=t.config.xaxis.crosshairs.fill.type,r=i.colorFrom,l=i.colorTo,n=i.opacityFrom,h=i.opacityTo,c=i.stops,d=a.enabled,g=a.left,p=a.top,x=a.blur,b=a.color,f=a.opacity,m=t.config.xaxis.crosshairs.fill.color;if(t.config.xaxis.crosshairs.show){"gradient"===o&&(m=e.drawGradient("vertical",r,l,n,h,null,c,null));let i=e.drawRect();1===t.config.xaxis.crosshairs.width&&(i=e.drawLine());let a=t.globals.gridHeight;(!u.isNumber(a)||a<0)&&(a=0);let y=t.config.xaxis.crosshairs.width;(!u.isNumber(y)||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:x,color:b,opacity:f})),t.globals.dom.elGraphical.add(i)}}drawYCrosshairs(){const t=this.w;let e=new w(this.ctx),s=t.config.yaxis[0].crosshairs;const i=t.globals.barPadForNumericAxis;if(t.config.yaxis[0].crosshairs.show){let a=e.drawLine(-i,0,t.globals.gridWidth+i,0,s.stroke.color,s.stroke.dashArray,s.stroke.width);a.attr({class:"apexcharts-ycrosshairs"}),t.globals.dom.elGraphical.add(a)}let a=e.drawLine(-i,0,t.globals.gridWidth+i,0,s.stroke.color,0,0);a.attr({class:"apexcharts-ycrosshairs-hidden"}),t.globals.dom.elGraphical.add(a)}}class et{constructor(t){this.ctx=t,this.w=t.w}checkResponsiveConfig(t){const e=this.w,s=e.config;if(0===s.responsive.length)return;let i=s.responsive.slice();i.sort((t,e)=>t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0).reverse();let a=new R({});const o=(t={})=>{let s=i[0].breakpoint;const o=window.innerWidth>0?window.innerWidth:screen.width;if(o>s){let s=u.clone(e.globals.initialConfig);s.series=u.clone(e.config.series);let i=v.extendArrayProps(a,s,e);t=u.extend(i,t),t=u.extend(e.config,t),this.overrideResponsiveOptions(t)}else for(let s=0;s<i.length;s++)o<i[s].breakpoint&&(t=v.extendArrayProps(a,i[s].options,e),t=u.extend(e.config,t),this.overrideResponsiveOptions(t))};if(t){let s=v.extendArrayProps(a,t,e);s=u.extend(e.config,s),s=u.extend(s,t),o(s)}else o({})}overrideResponsiveOptions(t){let e=new R(t).init({responsiveOverride:!0});this.w.config=e}}class st{constructor(t){this.ctx=t,this.w=t.w,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed()}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(){const t=this.w,e=new u;t.globals.dom.elWrap.classList.add(`apexcharts-theme-${t.config.theme.mode||"light"}`);const s=[...t.config.colors||t.config.fill.colors||[]];t.globals.colors=this.getColors(s),this.applySeriesColors(t.globals.seriesColors,t.globals.colors),t.config.theme.monochrome.enabled&&(t.globals.colors=this.getMonochromeColors(t.config.theme.monochrome,t.globals.series,e));const i=t.globals.colors.slice();this.pushExtraColors(t.globals.colors),this.applyColorTypes(["fill","stroke"],i),this.applyDataLabelsColors(i),this.applyRadarPolygonsColors(),this.applyMarkersColors(i)}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)=>{let a=t[i]||t[0];return"function"==typeof a?a({value:e.globals.axisCharts?e.globals.series[i][0]||0:e.globals.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:o}=t,r=this.isBarDistributed||this.isHeatmapDistributed?e[0].length*e.length:e.length,l=1/(r/a);let n=0;return Array.from({length:r},()=>{const t="dark"===o?s.shadeColor(-1*n,i):s.shadeColor(n,i);return n+=l,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.globals.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.globals.series.length&&(a=i.globals.series[i.globals.maxValsInArrayIndex].length*i.globals.series.length),t.length<a){let e=a-t.length;for(let s=0;s<e;s++)t.push(t[s])}}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=this.w.config.theme.palette,e=this.ctx.constructor.getThemePalettes();return e[t]||e.palette1}}class it{constructor(t){this.ctx=t,this.w=t.w}draw(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}drawTitleSubtitle(t){let e=this.w;const s="title"===t?e.config.title:e.config.subtitle;let i=e.globals.svgWidth/2,a=s.offsetY,o="middle";if("left"===s.align?(i=10,o="start"):"right"===s.align&&(i=e.globals.svgWidth-10,o="end"),i+=s.offsetX,a=a+parseInt(s.style.fontSize,10)+s.margin/2,void 0!==s.text){let r=new w(this.ctx).drawText({x:i,y:a,text:s.text,textAnchor:o,fontSize:s.style.fontSize,fontFamily:s.style.fontFamily,fontWeight:s.style.fontWeight,foreColor:s.style.color,opacity:1});r.node.setAttribute("class",`apexcharts-${t}-text`),e.globals.dom.Paper.add(r)}}}let at=class{constructor(t){this.w=t.w,this.dCtx=t}getTitleSubtitleCoords(t){let e=this.w,s=0,i=0;const a="title"===t?e.config.title.floating:e.config.subtitle.floating;let o=e.globals.dom.baseEl.querySelector(`.apexcharts-${t}-text`);if(null!==o&&!a){let t=o.getBoundingClientRect();s=t.width,i=e.globals.axisCharts?t.height+5:t.height}return{width:s,height:i}}getLegendsRect(){let t=this.w,e=t.globals.dom.elLegendWrap;t.config.legend.height||"top"!==t.config.legend.position&&"bottom"!==t.config.legend.position||(e.style.maxHeight=t.globals.svgHeight/2+"px");let s=Object.assign({},u.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(){let t=this.w,e=[];t.config.series.forEach((s,i)=>{s.data.forEach((s,a)=>{const o=(e=>t.config.dataLabels.formatter(e,{ctx:this.dCtx.ctx,seriesIndex:i,dataPointIndex:a,w:t}))(t.globals.series[i][a]);e.push(o)})});let s=u.getLargestStringFromArr(e),i=new w(this.dCtx.ctx);const a=t.config.dataLabels.style;let o=i.getTextRects(s,parseInt(a.fontSize),a.fontFamily);return{width:1.05*o.width,height:o.height}}getLargestStringFromMultiArr(t,e){let s=t;if(this.w.globals.isMultiLineX){let t=e.map(t=>Array.isArray(t)?t.length:1),i=Math.max(...t);s=e[t.indexOf(i)]}return s}};class ot{constructor(t){this.w=t.w,this.dCtx=t}getxAxisLabelsCoords(){let t,e=this.w,s=e.globals.labels.slice();if(e.config.xaxis.convertedCatToNumeric&&0===s.length&&(s=e.globals.categoryLabels),e.globals.timescaleLabels.length>0){const s=this.getxAxisTimeScaleLabelsCoords();t={width:s.width,height:s.height},e.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends="left"!==e.config.legend.position&&"right"!==e.config.legend.position||e.config.legend.floating?0:this.dCtx.lgRect.width;let i=e.globals.xLabelFormatter,a=u.getLargestStringFromArr(s),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(a,s);e.globals.isBarHorizontal&&(a=e.globals.yAxisScale[0].result.reduce((t,e)=>t.length>e.length?t:e,0),o=a);let r=new k(this.dCtx.ctx),l=a;a=r.xLabelFormat(i,a,l,{i:void 0,dateFormatter:new S(this.dCtx.ctx).formatDate,w:e}),o=r.xLabelFormat(i,o,l,{i:void 0,dateFormatter:new S(this.dCtx.ctx).formatDate,w:e}),(e.config.xaxis.convertedCatToNumeric&&void 0===a||""===String(a).trim())&&(a="1",o=a);let n=new w(this.dCtx.ctx),h=n.getTextRects(a,e.config.xaxis.labels.style.fontSize),c=h;if(a!==o&&(c=n.getTextRects(o,e.config.xaxis.labels.style.fontSize)),t={width:h.width>=c.width?h.width:c.width,height:h.height>=c.height?h.height:c.height},t.width*s.length>e.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==e.config.xaxis.labels.rotate||e.config.xaxis.labels.rotateAlways){if(!e.globals.isBarHorizontal){e.globals.rotateXLabels=!0;const s=t=>n.getTextRects(t,e.config.xaxis.labels.style.fontSize,e.config.xaxis.labels.style.fontFamily,`rotate(${e.config.xaxis.labels.rotate} 0 0)`,!1);h=s(a),a!==o&&(c=s(o)),t.height=(h.height>c.height?h.height:c.height)/1.5,t.width=h.width>c.width?h.width:c.width}}else e.globals.rotateXLabels=!1}return e.config.xaxis.labels.show||(t={width:0,height:0}),{width:t.width,height:t.height}}getxAxisGroupLabelsCoords(){var t;let e=this.w;if(!e.globals.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;let i,a=e.globals.groups.map(t=>t.title),o=u.getLargestStringFromArr(a),r=this.dCtx.dimHelpers.getLargestStringFromMultiArr(o,a),l=new w(this.dCtx.ctx),n=l.getTextRects(o,s),h=n;return o!==r&&(h=l.getTextRects(r,s)),i={width:n.width>=h.width?n.width:h.width,height:n.height>=h.height?n.height:h.height},e.config.xaxis.labels.show||(i={width:0,height:0}),{width:i.width,height:i.height}}getxAxisTitleCoords(){let t=this.w,e=0,s=0;if(void 0!==t.config.xaxis.title.text){let i=new w(this.dCtx.ctx).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize);e=i.width,s=i.height}return{width:e,height:s}}getxAxisTimeScaleLabelsCoords(){let t,e=this.w;this.dCtx.timescaleLabels=e.globals.timescaleLabels.slice();let s=this.dCtx.timescaleLabels.map(t=>t.value),i=s.reduce((t,e)=>void 0===t?0:t.length>e.length?t:e,0);return t=new w(this.dCtx.ctx).getTextRects(i,e.config.xaxis.labels.style.fontSize),1.05*t.width*s.length>e.globals.gridWidth&&0!==e.config.xaxis.labels.rotate&&(e.globals.overlappingXLabels=!0),t}additionalPaddingXLabels(t){const e=this.w,s=e.globals,i=e.config,a=i.xaxis.type;let o=t.width;s.skipLastTimelinelabel=!1,s.skipFirstTimelinelabel=!1;const r=e.config.yaxis[0].opposite&&e.globals.isBarHorizontal,l=t=>{if(this.dCtx.timescaleLabels&&this.dCtx.timescaleLabels.length){const a=this.dCtx.timescaleLabels[0],r=this.dCtx.timescaleLabels[this.dCtx.timescaleLabels.length-1].position+o/1.75-this.dCtx.yAxisWidthRight,l=a.position-o/1.75+this.dCtx.yAxisWidthLeft;let n="right"===e.config.legend.position&&this.dCtx.lgRect.width>0?this.dCtx.lgRect.width:0;r>s.svgWidth-s.translateX-n&&(s.skipLastTimelinelabel=!0),l<-(t.show&&!t.floating||"bar"!==i.chart.type&&"candlestick"!==i.chart.type&&"rangeBar"!==i.chart.type&&"boxPlot"!==i.chart.type?10:o/1.75)&&(s.skipFirstTimelinelabel=!0)}else"datetime"===a?this.dCtx.gridPad.right<o&&!s.rotateXLabels&&(s.skipLastTimelinelabel=!0):"datetime"!==a&&this.dCtx.gridPad.right<o/2-this.dCtx.yAxisWidthRight&&!s.rotateXLabels&&!e.config.xaxis.labels.trim&&(this.dCtx.xPadRight=o/2+1)},n=(t,e)=>{i.yaxis.length>1&&(t=>-1!==s.collapsedSeriesIndices.indexOf(t))(e)||l(t)};i.yaxis.forEach((t,e)=>{r?(this.dCtx.gridPad.left<o&&(this.dCtx.xPadLeft=o/2+1),this.dCtx.xPadRight=o/2+1):n(t,e)})}}class rt{constructor(t){this.w=t.w,this.dCtx=t}getyAxisLabelsCoords(){let t=this.w,e=[],s=10;const i=new L(this.dCtx.ctx);return t.config.yaxis.map((a,o)=>{const r={seriesIndex:o,dataPointIndex:-1,w:t},l=t.globals.yAxisScale[o];let n=0;if(!i.isYAxisHidden(o)&&a.labels.show&&void 0!==a.labels.minWidth&&(n=a.labels.minWidth),!i.isYAxisHidden(o)&&a.labels.show&&l.result.length){let i=t.globals.yLabelFormatters[o],h=l.niceMin===Number.MIN_VALUE?0:l.niceMin,c=l.result.reduce((t,e)=>{var s,a;return(null==(s=String(i(t,r)))?void 0:s.length)>(null==(a=String(i(e,r)))?void 0:a.length)?t:e},h);c=i(c,r);let d=c;if(void 0!==c&&0!==c.length||(c=l.niceMax),1===String(c).length&&(c+=".0",d=c),t.globals.isBarHorizontal){s=0;let e=t.globals.labels.slice();c=u.getLargestStringFromArr(e),c=i(c,{seriesIndex:o,dataPointIndex:-1,w:t}),d=this.dCtx.dimHelpers.getLargestStringFromMultiArr(c,e)}let g=new w(this.dCtx.ctx),p="rotate(".concat(a.labels.rotate," 0 0)"),x=g.getTextRects(c,a.labels.style.fontSize,a.labels.style.fontFamily,p,!1),b=x;c!==d&&(b=g.getTextRects(d,a.labels.style.fontSize,a.labels.style.fontFamily,p,!1)),e.push({width:(n>b.width||n>x.width?n:b.width>x.width?b.width:x.width)+s,height:b.height>x.height?b.height:x.height})}else e.push({width:0,height:0})}),e}getyAxisTitleCoords(){let t=this.w,e=[];return t.config.yaxis.map(t=>{if(t.show&&void 0!==t.title.text){let s=new w(this.dCtx.ctx),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(){let t=this.w,e=0,s=0,i=0,a=t.globals.yAxisScale.length>1?10:0;const o=new L(this.dCtx.ctx),r=(r,l)=>{let n=t.config.yaxis[l].floating,h=0;r.width>0&&!n?(h=r.width+a,function(e){return t.globals.ignoreYAxisIndexes.indexOf(e)>-1}(l)&&(h=h-r.width-a)):h=n||o.isYAxisHidden(l)?0:5,t.config.yaxis[l].opposite?i+=h:s+=h,e+=h};return t.globals.yLabelsCoords.map((t,e)=>{r(t,e)}),t.globals.yTitleCoords.map((t,e)=>{r(t,e)}),t.globals.isBarHorizontal&&!t.config.yaxis[0].floating&&(e=t.globals.yLabelsCoords[0].width+t.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=s,this.dCtx.yAxisWidthRight=i,e}}class lt{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"].includes(t),o=s.chart.type;let r=0,l=a(o)?s.series.length:1;i.comboBarCount>0&&(l=i.comboBarCount),i.collapsedSeries.forEach(t=>{a(t.type)&&(l-=1)}),s.chart.stacked&&(l=1);const n=a(o)||i.comboBarCount>0;let h=Math.abs(i.initialMaxX-i.initialMinX);if(n&&i.isXNumeric&&!i.isBarHorizontal&&l>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),r=a*parseInt(s.plotOptions.bar.columnWidth,10)/100,r<1&&(r=1),i.barPadForNumericAxis=r}return r}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");e.gridHeight-=i.height+a.height+s,e.translateY+=i.height+a.height+s}setGridXPosForDualYAxis(t,e){const{w:s}=this,i=new L(this.dCtx.ctx);s.config.yaxis.forEach((a,o)=>{-1!==s.globals.ignoreYAxisIndexes.indexOf(o)||a.floating||i.isYAxisHidden(o)||(a.opposite&&(s.globals.translateX-=e[o].width+t[o].width+parseInt(a.labels.style.fontSize,10)/1.2+12),s.globals.translateX<2&&(s.globals.translateX=2))})}}class nt{constructor(t){this.ctx=t,this.w=t.w,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 at(this),this.dimYAxis=new rt(this),this.dimXAxis=new ot(this),this.dimGrid=new lt(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}plotCoords(){let 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(),e.gridHeight=e.gridHeight-this.gridPad.top-this.gridPad.bottom,e.gridWidth=e.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;let i=this.dimGrid.gridPadForColumnsInNumericAxis(e.gridWidth);e.gridWidth=e.gridWidth-2*i,e.translateX=e.translateX+this.gridPad.left+this.xPadLeft+(i>0?i:0),e.translateY=e.translateY+this.gridPad.top}setDimensionsForAxisCharts(){let t=this.w,e=t.globals,s=this.dimYAxis.getyAxisLabelsCoords(),i=this.dimYAxis.getyAxisTitleCoords();e.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),t.globals.yLabelsCoords=[],t.globals.yTitleCoords=[],t.config.yaxis.map((e,a)=>{t.globals.yLabelsCoords.push({width:s[a].width,index:a}),t.globals.yTitleCoords.push({width:i[a].width,index:a})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();let a=this.dimXAxis.getxAxisLabelsCoords(),o=this.dimXAxis.getxAxisGroupLabelsCoords(),r=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(a,r,o),e.translateXAxisY=t.globals.rotateXLabels?this.xAxisHeight/8:-4,e.translateXAxisX=t.globals.rotateXLabels&&t.globals.isXNumeric&&t.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,t.globals.isBarHorizontal&&(e.rotateXLabels=!1,e.translateXAxisY=parseInt(t.config.xaxis.labels.style.fontSize,10)/1.5*-1),e.translateXAxisY=e.translateXAxisY+t.config.xaxis.labels.offsetY,e.translateXAxisX=e.translateXAxisX+t.config.xaxis.labels.offsetX;let l=this.yAxisWidth,n=this.xAxisHeight;e.xAxisLabelsHeight=this.xAxisHeight-r.height,e.xAxisGroupLabelsHeight=e.xAxisLabelsHeight-a.height,e.xAxisLabelsWidth=this.xAxisWidth,e.xAxisHeight=this.xAxisHeight;let h=10;("radar"===t.config.chart.type||this.isSparkline)&&(l=0,n=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||"treemap"===t.config.chart.type)&&(l=0,n=0,h=0),this.isSparkline||"treemap"===t.config.chart.type||this.dimXAxis.additionalPaddingXLabels(a);const c=()=>{e.translateX=l+this.datalabelsCoords.width,e.gridHeight=e.svgHeight-this.lgRect.height-n-(this.isSparkline||"treemap"===t.config.chart.type?0:t.globals.rotateXLabels?10:15),e.gridWidth=e.svgWidth-l-2*this.datalabelsCoords.width};switch("top"===t.config.xaxis.position&&(h=e.xAxisHeight-t.config.xaxis.axisTicks.height-5),t.config.legend.position){case"bottom":e.translateY=h,c();break;case"top":e.translateY=this.lgRect.height+h,c();break;case"left":e.translateY=h,e.translateX=this.lgRect.width+l+this.datalabelsCoords.width,e.gridHeight=e.svgHeight-n-12,e.gridWidth=e.svgWidth-this.lgRect.width-l-2*this.datalabelsCoords.width;break;case"right":e.translateY=h,e.translateX=l+this.datalabelsCoords.width,e.gridHeight=e.svgHeight-n-12,e.gridWidth=e.svgWidth-this.lgRect.width-l-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(i,s),new Z(this.ctx).setYAxisXPosition(s,i)}setDimensionsForNonAxisCharts(){let t=this.w,e=t.globals,s=t.config,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";let o=s.plotOptions[a].offsetY,r=s.plotOptions[a].offsetX;if(!s.legend.show||s.legend.floating){e.gridHeight=e.svgHeight;const t=e.dom.elWrap.getBoundingClientRect().width;return e.gridWidth=Math.min(t,e.gridHeight),e.translateY=o,void(e.translateX=r+(e.svgWidth-e.gridWidth)/2)}switch(s.legend.position){case"bottom":e.gridHeight=e.svgHeight-this.lgRect.height,e.gridWidth=e.svgWidth,e.translateY=o-10,e.translateX=r+(e.svgWidth-e.gridWidth)/2;break;case"top":e.gridHeight=e.svgHeight-this.lgRect.height,e.gridWidth=e.svgWidth,e.translateY=this.lgRect.height+o+10,e.translateX=r+(e.svgWidth-e.gridWidth)/2;break;case"left":e.gridWidth=e.svgWidth-this.lgRect.width-i,e.gridHeight="auto"!==s.chart.height?e.svgHeight:e.gridWidth,e.translateY=o,e.translateX=r+this.lgRect.width+i;break;case"right":e.gridWidth=e.svgWidth-this.lgRect.width-i-5,e.gridHeight="auto"!==s.chart.height?e.svgHeight:e.gridWidth,e.translateY=o,e.translateX=r+10;break;default:throw new Error("Legend position not supported")}}conditionalChecksForAxisCoords(t,e,s){const i=this.w,a=i.globals.hasXaxisGroups?2:1,o=s.height+t.height+e.height,r=i.globals.isMultiLineX?1.2:i.globals.LINE_HEIGHT_RATIO,l=i.globals.rotateXLabels?22:10,n=i.globals.rotateXLabels&&"bottom"===i.config.legend.position?10:0;this.xAxisHeight=o*r+a*l+n,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)}}let ht=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){var t,e,s;let i=document.createElement("style");i.setAttribute("type","text/css");const a=(null==(s=null==(e=null==(t=this.lgCtx.ctx)?void 0:t.opts)?void 0:e.chart)?void 0:s.nonce)||this.w.config.chart.nonce;a&&i.setAttribute("nonce",a);const o=document.createTextNode(B);return i.appendChild(o),i}getLegendDimensions(){let t=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend"),{width:e,height:s}=t.getBoundingClientRect();return{clwh:s,clww:e}}appendToForeignObject(){const t=this.w.globals;!1!==this.w.config.chart.injectStyleSheet&&t.dom.elLegendForeign.appendChild(this.getLegendStyles())}toggleDataSeries(t,e){const s=this.w;if(s.globals.axisCharts||"radialBar"===s.config.chart.type){s.globals.resized=!0;let i=null,a=null;if(s.globals.risingSeries=[],s.globals.axisCharts){if(i=s.globals.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`),!i)return;a=parseInt(i.getAttribute("data:realIndex"),10)}else{if(i=s.globals.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!i)return;a=parseInt(i.getAttribute("rel"),10)-1}if(e){[{cs:s.globals.collapsedSeries,csi:s.globals.collapsedSeriesIndices},{cs:s.globals.ancillaryCollapsedSeries,csi:s.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{this.riseCollapsedSeries(t.cs,t.csi,a)})}else this.hideSeries({seriesEl:i,realIndex:a});if(s.config.chart.accessibility.enabled){const e=s.globals.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=s.globals.collapsedSeriesIndices.includes(a)||s.globals.ancillaryCollapsedSeriesIndices.includes(a);e.setAttribute("aria-pressed",i?"true":"false");const o=e.querySelector(".apexcharts-legend-text"),r=o?o.textContent:s.globals.seriesNames[t],l=i?"hidden":"visible";e.setAttribute("aria-label",`${r}, ${l}. Press Enter or Space to toggle.`)}}}else{let e=s.globals.dom.Paper.findOne(` .apexcharts-series[rel='${t+1}'] path`);const i=s.config.chart.type;if("pie"===i||"polarArea"===i||"donut"===i){let t=s.config.plotOptions.pie.donut.labels;new w(this.lgCtx.ctx).pathMouseDown(e,null),this.lgCtx.ctx.pie.printDataLabelsInner(e.node,t)}if(s.config.chart.accessibility.enabled){const e=s.globals.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=s.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const a=e.querySelector(".apexcharts-legend-text"),o=a?a.textContent:s.globals.seriesNames[t],r=i?"hidden":"visible";e.setAttribute("aria-label",`${o}, ${r}. Press Enter or Space to toggle.`)}}}}getSeriesAfterCollapsing({realIndex:t}){const e=this.w,s=e.globals;let i=u.clone(e.config.series);if(s.axisCharts){let a=e.config.yaxis[s.seriesYAxisReverseMap[t]];const o={index:t,data:i[t].data.slice(),type:i[t].type||e.config.chart.type};if(a&&a.show&&a.showAlways)s.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(s.ancillaryCollapsedSeries.push(o),s.ancillaryCollapsedSeriesIndices.push(t));else if(s.collapsedSeriesIndices.indexOf(t)<0){s.collapsedSeries.push(o),s.collapsedSeriesIndices.push(t);let e=s.risingSeries.indexOf(t);s.risingSeries.splice(e,1)}}else s.collapsedSeries.push({index:t,data:i[t]}),s.collapsedSeriesIndices.push(t);return s.allSeriesCollapsed=s.collapsedSeries.length+s.ancillaryCollapsedSeries.length===e.config.series.length,this._getSeriesBasedOnCollapsedState(i)}hideSeries({seriesEl:t,realIndex:e}){const s=this.w;let 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.ctx.updateHelpers._updateSeries(i,s.config.chart.animations.dynamicAnimation.enabled)}riseCollapsedSeries(t,e,s){const i=this.w;let a=u.clone(i.config.series);if(t.length>0){for(let o=0;o<t.length;o++)t[o].index===s&&(i.globals.axisCharts?a[s].data=t[o].data.slice():a[s]=t[o].data,"number"!=typeof a[s]&&(a[s].hidden=!1),t.splice(o,1),e.splice(o,1),i.globals.risingSeries.push(s),o--);a=this._getSeriesBasedOnCollapsedState(a),this.lgCtx.ctx.updateHelpers._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}};class ct{constructor(t){this.ctx=t,this.w=t.w,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 ht(this)}init(){const t=this.w,e=t.globals,s=t.config,i=s.legend.showForSingleSeries&&1===e.series.length||this.isBarsDistributed||e.series.length>1;if(this.legendHelpers.appendToForeignObject(),(i||!e.axisCharts)&&s.legend.show){for(;e.dom.elLegendWrap.firstChild;)e.dom.elLegendWrap.removeChild(e.dom.elLegendWrap.firstChild);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=document.createElement("span");i.classList.add("apexcharts-legend-marker");let a=s.config.legend.markers.shape||s.config.markers.shape,o=a;Array.isArray(a)&&(o=a[t]);let r=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),c=Array.isArray(s.config.legend.markers.offsetY)?parseFloat(s.config.legend.markers.offsetY[t]):parseFloat(s.config.legend.markers.offsetY),d=Array.isArray(s.config.legend.markers.strokeWidth)?parseFloat(s.config.legend.markers.strokeWidth[t]):parseFloat(s.config.legend.markers.strokeWidth),g=i.style;if(g.height=2*(r+d)+"px",g.width=2*(r+d)+"px",g.left=h+"px",g.top=c+"px",s.config.legend.markers.customHTML)g.background="transparent",g.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 O(this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${o}`,seriesIndex:t,strokeWidth:d,size:r}),h=window.SVG().addTo(i).size("100%","100%"),c=new w(this.ctx).drawMarker(0,0,n(l({},a),{pointFillColor:Array.isArray(e)?e[t]:a.pointFillColor,shape:o}));s.globals.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(c)}return i}drawLegends(){var t;let e=this,s=this.w,i=s.config.legend.fontFamily,a=s.globals.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;a=t.map(t=>t.name?t.name:t.from+" - "+t.to),o=t.map(t=>t.color)}else this.isBarsDistributed&&(a=s.globals.labels.slice());s.config.legend.customLegendItems.length&&(a=s.config.legend.customLegendItems);let r=s.globals.legendFormatter,l=s.config.legend.inverseOrder,n=[];s.globals.seriesGroups.length>1&&s.config.legend.clusterGroupedSeries&&s.globals.seriesGroups.forEach((t,e)=>{n[e]=document.createElement("div"),n[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===s.config.legend.clusterGroupedSeriesOrientation?s.globals.dom.elLegendWrap.classList.add("apexcharts-legend-group-horizontal"):n[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?a.length-1:0;l?e>=0:e<=a.length-1;l?e--:e++){let l=r(a[e],{seriesIndex:e,w:s}),h=!1,c=!1;if(s.globals.collapsedSeries.length>0)for(let t=0;t<s.globals.collapsedSeries.length;t++)s.globals.collapsedSeries[t].index===e&&(h=!0);if(s.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<s.globals.ancillaryCollapsedSeriesIndices.length;t++)s.globals.ancillaryCollapsedSeriesIndices[t]===e&&(c=!0);let d=this.createLegendMarker({i:e,fillcolor:o});w.setAttrs(d,{rel:e+1,"data:collapsed":h||c}),(h||c)&&d.classList.add("apexcharts-inactive-legend");let g=document.createElement("div");if(s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled){g.setAttribute("role","button"),g.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=h||c,s=e?"hidden":"visible";g.setAttribute("aria-label",`${t}, ${s}. Press Enter or Space to toggle.`),g.setAttribute("aria-pressed",e?"true":"false")}let p=document.createElement("span");p.classList.add("apexcharts-legend-text"),p.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),p.style.color=x,p.style.fontSize=s.config.legend.fontSize,p.style.fontWeight=s.config.legend.fontWeight,p.style.fontFamily=i||s.config.chart.fontFamily,w.setAttrs(p,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":h||c}),g.appendChild(d),g.appendChild(p);const b=new v(this.ctx);if(!s.config.legend.showForZeroSeries){0===b.getSeriesTotalByIndex(e)&&b.seriesHaveSameValues(e)&&!b.isSeriesNull(e)&&-1===s.globals.collapsedSeriesIndices.indexOf(e)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&g.classList.add("apexcharts-hidden-zero-series")}s.config.legend.showForNullSeries||b.isSeriesNull(e)&&-1===s.globals.collapsedSeriesIndices.indexOf(e)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&g.classList.add("apexcharts-hidden-null-series"),n.length?s.globals.seriesGroups.forEach((t,i)=>{var a;t.includes(null==(a=s.config.series[e])?void 0:a.name)&&(s.globals.dom.elLegendWrap.appendChild(n[i]),n[i].appendChild(g))}):s.globals.dom.elLegendWrap.appendChild(g),s.globals.dom.elLegendWrap.classList.add(`apexcharts-align-${s.config.legend.horizontalAlign}`),s.globals.dom.elLegendWrap.classList.add("apx-legend-position-"+s.config.legend.position),g.classList.add("apexcharts-legend-series"),g.style.margin=`${s.config.legend.itemMargin.vertical}px ${s.config.legend.itemMargin.horizontal}px`,s.globals.dom.elLegendWrap.style.width=s.config.legend.width?s.config.legend.width+"px":"",s.globals.dom.elLegendWrap.style.height=s.config.legend.height?s.config.legend.height+"px":"",w.setAttrs(g,{rel:e+1,seriesName:u.escapeString(a[e]),"data:collapsed":h||c}),(h||c)&&g.classList.add("apexcharts-inactive-legend"),s.config.legend.onItemClick.toggleDataSeries||g.classList.add("apexcharts-no-click")}s.globals.dom.elWrap.addEventListener("click",e.onLegendClick,!0),s.config.legend.onItemHover.highlightDataSeries&&0===s.config.legend.customLegendItems.length&&(s.globals.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),s.globals.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.globals.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){let s=this.w,i=s.globals.dom.elLegendWrap;const a=i.clientHeight;let o=0,r=0;if("bottom"===s.config.legend.position)r=s.globals.svgHeight-Math.min(a,s.globals.svgHeight/2)-5;else if("top"===s.config.legend.position){const t=new nt(this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,s=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;r=(e>0?e-10:0)+(s>0?s-10:0)}i.style.position="absolute",o=o+t+s.config.legend.offsetX,r=r+e+s.config.legend.offsetY,i.style.left=o+"px",i.style.top=r+"px","right"===s.config.legend.position&&(i.style.left="auto",i.style.right=25+s.config.legend.offsetX+"px");["width","height"].forEach(t=>{i.style[t]&&(i.style[t]=parseInt(s.config.legend[t],10)+"px")})}legendAlignHorizontal(){let t=this.w;t.globals.dom.elLegendWrap.style.right=0;let e=new nt(this.ctx),s=e.dimHelpers.getTitleSubtitleCoords("title"),i=e.dimHelpers.getTitleSubtitleCoords("subtitle"),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(){let t=this.w,e=this.legendHelpers.getLegendDimensions(),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){const e=this.w,s=t.target.classList.contains("apexcharts-legend-series")||t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker");if("heatmap"===e.config.chart.type||this.isBarsDistributed){if(s){let e=parseInt(t.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,e,this.w]),new G(this.ctx).highlightRangeInSeries(t,t.target)}}else if(!t.target.classList.contains("apexcharts-inactive-legend")&&s){new G(this.ctx).toggleSeriesOnHover(t,t.target)}}onLegendKeyDown(t){const e=this;(t.target.classList.contains("apexcharts-legend-series")||t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker"))&&("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.onLegendClick(t)))}onLegendClick(t){const e=this.w;if(!e.config.legend.customLegendItems.length&&(t.target.classList.contains("apexcharts-legend-series")||t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker"))){let s=parseInt(t.target.getAttribute("rel"),10)-1,i="true"===t.target.getAttribute("data:collapsed");const a=this.w.config.chart.events.legendClick;"function"==typeof a&&a(this.ctx,s,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,s,this.w]);const o=this.w.config.legend.markers.onClick;"function"==typeof o&&t.target.classList.contains("apexcharts-legend-marker")&&(o(this.ctx,s,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,s,this.w]));"treemap"!==e.config.chart.type&&"heatmap"!==e.config.chart.type&&!this.isBarsDistributed&&e.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(s,i)}}}class dt{constructor(t){this.ctx=t,this.w=t.w;const e=this.w;this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=e.globals.minX,this.maxX=e.globals.maxX}createToolbar(){let t=this.w;const e=()=>document.createElement("div"),s=e();if(s.setAttribute("class","apexcharts-toolbar"),s.style.top=t.config.chart.toolbar.offsetY+"px",s.style.right=3-t.config.chart.toolbar.offsetX+"px",t.globals.dom.elWrap.appendChild(s),this.elZoom=e(),this.elZoomIn=e(),this.elZoomOut=e(),this.elPan=e(),this.elSelection=e(),this.elZoomReset=e(),this.elMenuIcon=e(),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(e());let i=[];const a=(e,s,a)=>{const o=e.toLowerCase();this.t[o]&&t.config.chart.zoom.enabled&&i.push({el:s,icon:"string"==typeof this.t[o]?this.t[o]:a,title:this.localeValues[e],class:`apexcharts-${o}-icon`})};a("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n'),a("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n');const o=e=>{this.t[e]&&t.config.chart[e].enabled&&i.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" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>\n <path d="M0 0h24v24H0V0z" fill="none"/>\n <path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>\n</svg>':'<svg fill="#6E8192" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z"/>\n</svg>',title:this.localeValues["zoom"===e?"selectionZoom":"selection"],class:`apexcharts-${e}-icon`})};o("zoom"),o("selection"),this.t.pan&&t.config.chart.zoom.enabled&&i.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n <defs>\n <path d="M0 0h24v24H0z" id="a"/>\n </defs>\n <clipPath id="b">\n <use overflow="visible" xlink:href="#a"/>\n </clipPath>\n <path clip-path="url(#b)" d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"/>\n</svg>',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),a("reset",this.elZoomReset,'<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>\n <path d="M0 0h24v24H0z" fill="none"/>\n</svg>'),this.t.download&&i.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"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)i.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});i.forEach((t,e)=>{t.index&&u.moveIndexInArray(i,e,t.index)});for(let t=0;t<i.length;t++)w.setAttrs(i[t].el,{class:i[t].class,title:i[t].title}),i[t].el.innerHTML=i[t].icon,s.appendChild(i[t].el);this._createHamburgerMenu(s),t.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):t.globals.panEnabled?this.elPan.classList.add(this.selectedClass):t.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),w.setAttrs(this.elMenu,{class:"apexcharts-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(document.createElement("div")),this.elMenuItems[t].innerHTML=e[t].title,w.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){this.elZoomReset.addEventListener("click",this.handleZoomReset.bind(this)),this.elSelection.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),this.elZoom.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),this.elZoomIn.addEventListener("click",this.handleZoomIn.bind(this)),this.elZoomOut.addEventListener("click",this.handleZoomOut.bind(this)),this.elPan.addEventListener("click",this.togglePanning.bind(this)),this.elMenuIcon.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))}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{e.ctx.toolbar.toggleOtherControls();let 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)})}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.globals.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.globals.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.globals.dom.baseEl.querySelector(".apexcharts-selection-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.globals.panEnabled=!0:this.w.globals.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.globals.panEnabled=!t.w.globals.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)})}toggleOtherControls(){const t=this.w;t.globals.panEnabled=!1,t.globals.zoomEnabled=!1,t.globals.selectionEnabled=!1,this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}handleZoomIn(){const t=this.w;t.globals.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY);const e=(this.minX+this.maxX)/2;let s=(this.minX+e)/2,i=(this.maxX+e)/2;const a=this._getNewMinXMaxX(s,i);t.globals.disableZoomIn||this.zoomUpdateOptions(a.minX,a.maxX)}handleZoomOut(){const t=this.w;if(t.globals.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY),"datetime"===t.config.xaxis.type&&new Date(this.minX).getUTCFullYear()<1e3)return;const e=(this.minX+this.maxX)/2;let s=this.minX-(e-this.minX),i=this.maxX-(e-this.maxX);const a=this._getNewMinXMaxX(s,i);t.globals.disableZoomOut||this.zoomUpdateOptions(a.minX,a.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);a&&(i=a.xaxis);let o={xaxis:i},r=u.clone(s.globals.initialConfig.yaxis);s.config.chart.group||(o.yaxis=r),this.w.globals.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(i,r)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let s=null;return"function"==typeof this.ev.beforeZoom&&(s=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),s}toggleMenu(){window.setTimeout(()=>{this.elMenu.classList.contains("apexcharts-menu-open")?this.elMenu.classList.remove("apexcharts-menu-open"):this.elMenu.classList.add("apexcharts-menu-open")},0)}handleDownload(t){const e=this.w,s=new _(this.ctx);switch(t){case"svg":s.exportToSVG(this.ctx);break;case"png":s.exportToPng(this.ctx);break;case"csv":s.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{let e=t.w;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}),e.globals.zoomed=!1;let s=t.ctx.series.emptyCollapsedSeries(u.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(s,e.config.chart.animations.dynamicAnimation.enabled)})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}class gt{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 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 gt(t))}findOne(t){const e=this.node.querySelector(t);return e?e.instance||new gt(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 gt(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 gt(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=document.createElementNS("http://www.w3.org/2000/svg","tspan");return e.textContent=t,this.node.appendChild(e),new gt(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}}const pt="http://www.w3.org/2000/svg";class xt{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 xt(this.x,this.y)}}class bt{constructor(t,e,s,i,a,o){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!=o?o:0}rotate(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return this.multiply(new bt(s,i,-i,s,0,0))}scale(t,e){return this.multiply(new bt(t,0,0,null!=e?e:t,0,0))}multiply(t){return new bt(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 xt(this.a*t.x+this.c*t.y+this.e,this.b*t.x+this.d*t.y+this.f)}}class ft{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}}let ut=0;class mt extends gt{constructor(t,e,s){const i="radial"===e?"radialGradient":"linearGradient";super(f.createElementNS(pt,i)),this._id="SvgjsGradient"+ ++ut,this.attr("id",this._id),"function"==typeof s&&s(new yt(this));let a=t.node.querySelector("defs");a||(a=f.createElementNS(pt,"defs"),t.node.appendChild(a)),a.appendChild(this.node)}stop(t,e,s){const i=f.createElementNS(pt,"stop");return i.setAttribute("offset",t),i.setAttribute("stop-color",e),void 0!==s&&i.setAttribute("stop-opacity",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 yt{constructor(t){this.gradient=t}stop(t,e,s){return this.gradient.stop(t,e,s),this}}let wt=0;class vt extends gt{constructor(t,e,s,i){if(super(f.createElementNS(pt,"pattern")),this._id="SvgjsPattern"+ ++wt,this.attr({id:this._id,width:e,height:s,patternUnits:"userSpaceOnUse"}),"function"==typeof i){i(new At(this.node))}let a=t.node.querySelector("defs");a||(a=f.createElementNS(pt,"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 At extends gt{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=f.createElementNS(pt,"text");e.textContent=t;const s=new gt(e);return this.node.appendChild(e),s}text(t){const e=f.createElementNS(pt,"text"),s=new gt(e);return this.node.appendChild(e),"function"==typeof t&&t(new Ct(e)),s}image(t,e){const s=f.createElementNS(pt,"image");s.setAttributeNS("http://www.w3.org/1999/xlink","href",t);const i=new gt(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 mt(this,t,e)}pattern(t,e,s){return new vt(this,t,e,s)}_make(t){const e=f.createElementNS(pt,t);return this.node.appendChild(e),new gt(e)}_makeContainer(t){const e=f.createElementNS(pt,t);return this.node.appendChild(e),new At(e)}}class Ct{constructor(t){this.textNode=t}tspan(t){const e=f.createElementNS(pt,"tspan");return e.textContent=t,this.textNode.appendChild(e),new St(e,this.textNode)}}class St{constructor(t,e){this.node=t,this.textNode=e}newLine(){return this.node.setAttribute("dy","1.1em"),this.node.dataset.newline="1",this}}let kt=0;class Lt extends gt{constructor(){super(f.createElementNS(pt,"filter")),this._id="SvgjsFilter"+ ++kt,this.attr("id",this._id)}size(t,e,s,i){return this.attr({width:t,height:e,x:s,y:i})}}class Mt{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=f.createElementNS(pt,"feMerge");return t.forEach(t=>{const s=f.createElementNS(pt,"feMergeNode");s.setAttribute("in",t),e.appendChild(s)}),this.filter.node.appendChild(e),new gt(e)}_primitive(t,e){const s=f.createElementNS(pt,t);for(const t in e)s.setAttribute(t,e[t]);return this.filter.node.appendChild(s),new gt(s)}}function Pt(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 o=[],r=[];for(;null!==(a=s.exec(t));)o.push(a[1]),r.push(a.index);for(let s=0;s<o.length;s++){const a=r[s]+o[s].length,l=s+1<r.length?r[s+1]:t.length,n=t.substring(a,l),h=[];let c;for(i.lastIndex=0;null!==(c=i.exec(n));)h.push(parseFloat(c[0]));const d=o[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 It(t){let e=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEach(t=>{for(let o=1;o<t.length;o+=2)if(o+1<=t.length){const r=t[o],l=t[o+1];"number"==typeof r&&"number"==typeof l&&(r<e&&(e=r),r>i&&(i=r),l<s&&(s=l),l>a&&(a=l))}}),e===1/0?{x:0,y:0,width:0,height:0}:{x:e,y:s,width:i-e,height:a-s}}function Tt(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 Xt(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 zt(t){var e=[t];switch(t[0]){case"M":return this.pos=this.start=[t[1],t[2]],e;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":e=function(t,e){var s,i,a,o,r,l,n,h,c,d,g,p,x,b,f,u,m,y,w,v,A,C,S,k,L,M,P=Math.abs(e[1]),I=Math.abs(e[2]),T=e[3]%360,X=e[4],z=e[5],E=e[6],Y=e[7],R=new xt(t[0],t[1]),F=new xt(E,Y),H=[];if(0===P||0===I||R.x===F.x&&R.y===F.y)return[["C",R.x,R.y,F.x,F.y,F.x,F.y]];s=new xt((R.x-F.x)/2,(R.y-F.y)/2).transform((new bt).rotate(T)),(i=s.x*s.x/(P*P)+s.y*s.y/(I*I))>1&&(P*=i=Math.sqrt(i),I*=i);a=(new bt).rotate(T).scale(1/P,1/I).rotate(-T),R=R.transform(a),F=F.transform(a),o=[F.x-R.x,F.y-R.y],l=o[0]*o[0]+o[1]*o[1],r=Math.sqrt(l),o[0]/=r,o[1]/=r,n=l<4?Math.sqrt(1-l/4):0,X===z&&(n*=-1);h=new xt((F.x+R.x)/2+n*-o[1],(F.y+R.y)/2+n*o[0]),c=new xt(R.x-h.x,R.y-h.y),d=new xt(F.x-h.x,F.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);z&&g>p&&(p+=2*Math.PI);!z&&g<p&&(p-=2*Math.PI);for(b=Math.ceil(2*Math.abs(g-p)/Math.PI),u=[],m=g,x=(p-g)/b,f=4*Math.tan(x/4)/3,A=0;A<=b;A++)w=Math.cos(m),y=Math.sin(m),v=new xt(h.x+w,h.y+y),u[A]=[new xt(v.x+f*y,v.y-f*w),v,new xt(v.x-f*y,v.y+f*w)],m+=x;for(u[0][0]=u[0][1].clone(),u[u.length-1][2]=u[u.length-1][1].clone(),a=(new bt).rotate(T).scale(P,I).rotate(-T),A=0,C=u.length;A<C;A++)u[A][0]=u[A][0].transform(a),u[A][1]=u[A][1].transform(a),u[A][2]=u[A][2].transform(a);for(A=1,C=u.length;A<C;A++)S=(v=u[A-1][2]).x,k=v.y,L=(v=u[A][0]).x,M=v.y,E=(v=u[A][1]).x,Y=v.y,H.push(["C",S,k,L,M,E,Y]);return H}(this.pos,t),t=e[0]}return t[0]="C",this.pos=[t[5],t[6]],this.reflection=[2*t[5]-t[3],2*t[6]-t[4]],e}function Et(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 Yt(t,e,s,i,a,o){for(var r=t.slice(e,s||void 0),l=i.slice(a,o||void 0),n=0,h={pos:[0,0],start:[0,0]},c={pos:[0,0],start:[0,0]};r[n]=Tt.call(h,r[n]),l[n]=Tt.call(c,l[n]),r[n][0]!=l[n][0]||"M"==r[n][0]||"A"==r[n][0]&&(r[n][4]!=l[n][4]||r[n][5]!=l[n][5])?(Array.prototype.splice.apply(r,[n,1].concat(zt.call(h,r[n]))),Array.prototype.splice.apply(l,[n,1].concat(zt.call(c,l[n])))):(r[n]=Xt.call(h,r[n]),l[n]=Xt.call(c,l[n])),++n!=r.length||n!=l.length;)n==r.length&&r.push(["C",h.pos[0],h.pos[1],h.pos[0],h.pos[1],h.pos[0],h.pos[1]]),n==l.length&&l.push(["C",c.pos[0],c.pos[1],c.pos[0],c.pos[1],c.pos[0],c.pos[1]]);return{start:r,dest:l}}function Rt(t,e){var s=function(t,e){for(var s,i=Pt(t),a=Pt(e),o=0,r=0,l=!1,n=!1;!1!==o||!1!==r;){if(l=Et(i,!1!==o&&o+1),n=Et(a,!1!==r&&r+1),!1===o){let t=It(s.start);o=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===r){let t=It(s.dest);r=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=Yt(i,o,l,a,r,n),i=i.slice(0,o).concat(s.start,!1===l?[]:i.slice(l)),a=a.slice(0,r).concat(s.dest,!1===n?[]:a.slice(n)),o=!1!==l&&o+s.start.length,r=!1!==n&&r+s.dest.length}return{start:i,dest:a}}(t,e),i=s.start,a=s.dest;return function(t){var e=i.map(function(e,s){return a[s].map(function(i,o){return 0===o?i:e[o]+(a[s][o]-e[o])*t})});return e.map(t=>t.join(" ")).join(" ")}}function Ft(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 Ht(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 Dt{constructor(t,e,s){this.el=t,this.duration=null!=e?e:300,this.delay=s||0,this._attrTarget=null,this._plotTarget=null,this._afterCb=null,this._duringCb=null,this._next=null,this._root=null,this._scheduled=!1}attr(t){return this._attrTarget=t,this._schedule(),this}plot(t){return this._plotTarget=t,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 Dt(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._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 o=e.attr(s);t[s]=o;const r=Ft(o),l=Ft(String(this._attrTarget[s]));r&&l&&(i[s]=r,a[s]=l)}let o=null;if(this._plotTarget){const t=e.attr("d")||"";try{o=Rt(t,this._plotTarget)}catch(t){o=null}}const r=performance.now(),l=n=>{const h=n-r,c=Math.min(h/s,1),d=(g=c,-Math.cos(g*Math.PI)/2+.5);var g;if(this._attrTarget)if(c>=1)e.attr(this._attrTarget);else{const s={};for(const e of Object.keys(this._attrTarget))if(i[e]&&a[e])s[e]=Ht(i[e],a[e],d);else{const i=parseFloat(t[e]),a=parseFloat(this._attrTarget[e]);isNaN(i)||isNaN(a)||(s[e]=i+(a-i)*d)}e.attr(s)}o&&c<1&&e.attr("d",o(d)),this._duringCb&&this._duringCb(d),c<1?requestAnimationFrame(l):(this._plotTarget&&e.attr("d",this._plotTarget),this._afterCb&&this._afterCb.call(e))};requestAnimationFrame(l)};t>0?setTimeout(i,t):i()}}var Ot;function Wt(){const t=f.createElementNS(pt,"svg"),e=new At(t);return e.attr({xmlns:pt}),e}(Ot=gt).prototype.filterWith=function(t){const e=new Lt;this._filter=e;let s=this.node;for(;s&&"svg"!==s.nodeName;)s=s.parentNode;if(s){let t=s.querySelector("defs");t||(t=f.createElementNS(pt,"defs"),s.insertBefore(t,s.firstChild)),t.appendChild(e.node)}return t(new Mt(e)),this.attr("filter","url(#"+e._id+")"),this},Ot.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},Ot.prototype.filterer=function(){return this._filter},function(t){t.prototype.animate=function(t,e){return new Dt(this,t,e)}}(gt),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,o=parseFloat(a.getAttribute("x"))||0,r=parseFloat(a.getAttribute("y"))||0,l=i.clientX,n=i.clientY,h=a.ownerSVGElement;let c=null;h&&(c=h.getScreenCTM());const d=t=>{const e="touchmove"===t.type?t.touches[0]:t;let i=e.clientX-l,h=e.clientY-n;c&&(i/=c.a,h/=c.d);let d=o+i,g=r+h;const p=parseFloat(a.getAttribute("width"))||0,x=parseFloat(a.getAttribute("height"))||0;void 0!==s.minX&&d<s.minX&&(d=s.minX),void 0!==s.minY&&g<s.minY&&(g=s.minY),void 0!==s.maxX&&d+p>s.maxX&&(d=s.maxX-p),void 0!==s.maxY&&g+x>s.maxY&&(g=s.maxY-x);const b=new CustomEvent("dragmove",{detail:{handler:{move:function(t,e){a.setAttribute("x",t),a.setAttribute("y",e)}},box:{x:d,y:g,w:p,h:x,x2:d+p,y2:g+x}}});a.dispatchEvent(b)},g=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("touchmove",d),document.removeEventListener("mouseup",g),document.removeEventListener("touchend",g)};document.addEventListener("mousemove",d),document.addEventListener("touchmove",d),document.addEventListener("mouseup",g),document.addEventListener("touchend",g)};return e.node.addEventListener("mousedown",i),e.node.addEventListener("touchstart",i),e._dragCleanup=()=>{e.node.removeEventListener("mousedown",i),e.node.removeEventListener("touchstart",i)},e}}(gt),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(pt,"g");a.setAttribute("class","svg_select_points");const o=e.node.parentNode;o&&o.appendChild(a);const r={},l=["t","b","l","r","lt","rt","lb","rb"];l.forEach((t,e)=>{const i=new At(document.createElementNS(pt,"g"));a.appendChild(i.node);const o=s(i,[0,0],e,[],t);r[t]={group:i,handle:o}});const n=()=>{const t=parseFloat(e.attr("x"))||0,s=parseFloat(e.attr("y"))||0,o=parseFloat(e.attr("width"))||0,n=parseFloat(e.attr("height"))||0,h=e.node.getAttribute("transform");h?a.setAttribute("transform",h):a.removeAttribute("transform");const c={t:[t+o/2,s],b:[t+o/2,s+n],l:[t,s+n/2],r:[t+o,s+n/2],lt:[t,s],rt:[t+o,s],lb:[t,s+n],rb:[t+o,s+n]};l.forEach(t=>{r[t]&&c[t]&&i(r[t].group,c[t])})};return n(),e._selectHandles=a,e._selectHandlesMap=r,e._updateSelectPositions=n,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 o=a.group.node,r=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 o=null;a&&(o=a.getScreenCTM());const r=parseFloat(e.attr("x"))||0,l=parseFloat(e.attr("width"))||0,n=s=>{let a=("touchmove"===s.type?s.touches[0]:s).clientX-i;o&&(a/=o.a);let n=r,h=l;"l"===t?(n=r+a,h=l-a):"r"===t&&(h=l+a),h<0&&(h=0),e.attr({x:n,width:h}),e._updateSelectPositions&&e._updateSelectPositions();const c=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(c)},h=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("touchmove",n),document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h);const t=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(t)};document.addEventListener("mousemove",n),document.addEventListener("touchmove",n),document.addEventListener("mouseup",h),document.addEventListener("touchend",h)};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r),i.push(()=>{o.removeEventListener("mousedown",r),o.removeEventListener("touchstart",r)})};return a("l"),a("r"),e._resizeCleanup=()=>{i.forEach(t=>t())},e}}(gt),Wt.xlink="http://www.w3.org/1999/xlink",h.isBrowser()&&void 0===window.SVG&&(window.SVG=Wt);class Nt extends dt{constructor(t){super(t),this.ctx=t,this.w=t.w,this.dragged=!1,this.graphics=new w(this.ctx),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}){let 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.globals.dom.baseEl.querySelector(".apexcharts-grid"),this.constraints=new ft(0,0,e.globals.gridWidth,e.globals.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.globals.dom.Paper.add(this.zoomRect),e.globals.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.globals.gridWidth,maxY:e.globals.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.globals.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.globals.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{this.hoverArea.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})}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){let s=this.w;const i=this.ctx.toolbar;let a=s.globals.zoomEnabled?s.config.chart.zoom.type:s.config.chart.selection.type;const o=s.config.chart.toolbar.autoSelected;if(e.shiftKey?(this.shiftWasPressed=!0,i.enableZoomPanFromToolbar("pan"===o?"zoom":"pan")):this.shiftWasPressed&&(i.enableZoomPanFromToolbar(o),this.shiftWasPressed=!1),!e.target)return;const r=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(r.contains("apexcharts-legend-marker")||r.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){let t=this.gridRect.getBoundingClientRect();this.startX=this.clientX-t.left-s.globals.barPadForNumericAxis,this.startY=this.clientY-t.top,this.dragged=!1,this.w.globals.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,s.globals.panEnabled?(s.globals.selection=null,this.w.globals.mousedown&&this.panDragging({context:this,zoomtype:a,xyRatios:t})):(this.w.globals.mousedown&&s.globals.zoomEnabled||this.w.globals.mousedown&&s.globals.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:a}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:a}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){var s;const i=this.w;let a=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();a&&(this.w.globals.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.globals.zoomEnabled||i.globals.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.globals.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.globals.mousedown=!1}mouseWheelEvent(t){const e=this.w;t.preventDefault();const s=Date.now();s-e.globals.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.globals.lastWheelExecution=s),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{s-e.globals.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.globals.lastWheelExecution=s)},this.debounceDelay)}executeMouseWheelZoom(t){var e;const s=this.w;this.minX=s.globals.isRangeBar?s.globals.minY:s.globals.minX,this.maxX=s.globals.isRangeBar?s.globals.maxY:s.globals.maxX;const i=null==(e=this.gridRect)?void 0:e.getBoundingClientRect();if(!i)return;const a=(t.clientX-i.left)/i.width,o=this.minX,r=this.maxX,l=r-o;let n,h,c;if(t.deltaY<0){n=.5*l;const t=o+a*l;h=t-n/2,c=t+n/2}else n=1.5*l,h=o-n/2,c=r+n/2;if(!s.globals.isRangeBar){h=Math.max(h,s.globals.initialMinX),c=Math.min(c,s.globals.initialMaxX);const t=.01*(s.globals.initialMaxX-s.globals.initialMinX);if(c-h<t){const e=(h+c)/2;h=e-t/2,c=e+t/2}}const d=this._getNewMinXMaxX(h,c);isNaN(d.minX)||isNaN(d.maxX)||this.zoomUpdateOptions(d.minX,d.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",()=>{let e=t.globals.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.globals.zoomEnabled)if(void 0!==t.globals.selection&&null!==t.globals.selection)this.drawSelectionRect(n(l({},t.globals.selection),{translateX:t.globals.translateX,translateY:t.globals.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.globals.gridWidth-(t.globals.maxX-t.config.chart.selection.xaxis.max)/e.xRatio-s;t.globals.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);let a={x:s,y:0,width:i,height:t.globals.gridHeight,translateX:t.globals.translateX,translateY:t.globals.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:o=0}){const r=this.w,l=this.zoomRect,n=this.selectionRect;if(this.dragged||null!==r.globals.selection){let h={transform:"translate("+a+", "+o+")"};r.globals.zoomEnabled&&this.dragged&&(s<0&&(s=1),l.attr({x:t,y:e,width:s,height:i,fill:r.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":r.config.chart.zoom.zoomedArea.fill.opacity,stroke:r.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":r.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":r.config.chart.zoom.zoomedArea.stroke.opacity}),w.setAttrs(l.node,h)),r.globals.selectionEnabled&&(n.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,fill:r.config.chart.selection.fill.color,"fill-opacity":r.config.chart.selection.fill.opacity,stroke:r.config.chart.selection.stroke.color,"stroke-width":r.config.chart.selection.stroke.width,"stroke-dasharray":r.config.chart.selection.stroke.dashArray,"stroke-opacity":r.config.chart.selection.stroke.opacity}),w.setAttrs(n.node,h))}}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const s=this.w;let i=t,a=this.gridRect.getBoundingClientRect(),o=i.startX-1,r=i.startY,h=!1,c=!1;const d=i.clientX-a.left-s.globals.barPadForNumericAxis,g=i.clientY-a.top;let p=d-o,x=g-r,b={translateX:s.globals.translateX,translateY:s.globals.translateY};return Math.abs(p+o)>s.globals.gridWidth?p=s.globals.gridWidth-o:d<0&&(p=o),o>d&&(h=!0,p=Math.abs(p)),r>g&&(c=!0,x=Math.abs(x)),b="x"===e?{x:h?o-p:o,y:0,width:p,height:s.globals.gridHeight}:"y"===e?{x:0,y:c?r-x:r,width:s.globals.gridWidth,height:x}:{x:h?o-p:o,y:c?r-x:r,width:p,height:x},b=n(l({},b),{translateX:s.globals.translateX,translateY:s.globals.translateY}),i.drawSelectionRect(b),i.selectionDragging("resizing"),b}selectionDragging(t,e){const s=this.w;if(!e)return;e.preventDefault();const{handler:i,box:a}=e.detail;let{x:o,y:r}=a;o<this.constraints.x&&(o=this.constraints.x),r<this.constraints.y&&(r=this.constraints.y),a.x2>this.constraints.x2&&(o=this.constraints.x2-a.w),a.y2>this.constraints.y2&&(r=this.constraints.y2-a.h),i.move(o,r);const l=this.xyRatios,n=this.selectionRect;let h=0;"resizing"===t&&(h=30);const c=t=>parseFloat(n.node.getAttribute(t)),d={x:c("x"),y:c("y"),width:c("width"),height:c("height")};s.globals.selection=d,"function"==typeof s.config.chart.events.selection&&s.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{const t=this.gridRect.getBoundingClientRect(),e=n.node.getBoundingClientRect();let i,a,o,r;s.globals.isRangeBar?(i=s.globals.yAxisScale[0].niceMin+(e.left-t.left)*l.invertedYRatio,a=s.globals.yAxisScale[0].niceMin+(e.right-t.left)*l.invertedYRatio,o=0,r=1):(i=s.globals.xAxisScale.niceMin+(e.left-t.left)*l.xRatio,a=s.globals.xAxisScale.niceMin+(e.right-t.left)*l.xRatio,o=s.globals.yAxisScale[0].niceMin+(t.bottom-e.bottom)*l.yRatio[0],r=s.globals.yAxisScale[0].niceMax-(e.top-t.top)*l.yRatio[0]);const h={xaxis:{min:i,max:a},yaxis:{min:o,max:r}};s.config.chart.events.selection(this.ctx,h),s.config.chart.brush.enabled&&void 0!==s.config.chart.events.brushScrolled&&s.config.chart.events.brushScrolled(this.ctx,h)},h))}selectionDrawn({context:t,zoomtype:e}){const s=this.w,i=t,a=this.xyRatios,o=this.ctx.toolbar,r=s.globals.zoomEnabled?i.zoomRect.node.getBoundingClientRect():i.selectionRect.node.getBoundingClientRect(),l=i.gridRect.getBoundingClientRect(),n=r.left-l.left-s.globals.barPadForNumericAxis,h=r.right-l.left-s.globals.barPadForNumericAxis,c=r.top-l.top,d=r.bottom-l.top;let g,p;s.globals.isRangeBar?(g=s.globals.yAxisScale[0].niceMin+n*a.invertedYRatio,p=s.globals.yAxisScale[0].niceMin+h*a.invertedYRatio):(g=s.globals.xAxisScale.niceMin+n*a.xRatio,p=s.globals.xAxisScale.niceMin+h*a.xRatio);let x=[],b=[];if(s.config.yaxis.forEach((t,e)=>{let i=s.globals.seriesYAxisMap[e][0],o=s.globals.yAxisScale[e].niceMax-a.yRatio[i]*c,r=s.globals.yAxisScale[e].niceMax-a.yRatio[i]*d;x.push(o),b.push(r)}),i.dragged&&(i.dragX>10||i.dragY>10)&&g!==p)if(s.globals.zoomEnabled){let t=u.clone(s.globals.initialConfig.yaxis),a=u.clone(s.globals.initialConfig.xaxis);if(s.globals.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(g=Math.floor(g),p=Math.floor(p),g<1&&(g=1,p=s.globals.dataPoints),p-g<2&&(p=g+1)),"xy"!==e&&"x"!==e||(a={min:g,max:p}),"xy"!==e&&"y"!==e||t.forEach((e,s)=>{t[s].min=b[s],t[s].max=x[s]}),o){let e=o.getBeforeZoomRange(a,t);e&&(a=e.xaxis?e.xaxis:a,t=e.yaxis?e.yaxis:t)}let r={xaxis:a};s.config.chart.group||(r.yaxis=t),i.ctx.updateHelpers._updateOptions(r,!1,i.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof s.config.chart.events.zoomed&&o.zoomCallback(a,t)}else if(s.globals.selectionEnabled){let t=null,a=null;a={min:g,max:p},"xy"!==e&&"y"!==e||(t=u.clone(s.config.yaxis),t.forEach((e,s)=>{t[s].min=b[s],t[s].max=x[s]})),s.globals.selection=i.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(i.ctx,{xaxis:a,yaxis:t})}}panDragging({context:t}){const e=this.w;let s=t;if(void 0!==e.globals.lastClientPosition.x){const t=e.globals.lastClientPosition.x-s.clientX,i=e.globals.lastClientPosition.y-s.clientY;Math.abs(t)>Math.abs(i)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(i)&&t<0?this.moveDirection="right":Math.abs(i)>Math.abs(t)&&i>0?this.moveDirection="up":Math.abs(i)>Math.abs(t)&&i<0&&(this.moveDirection="down")}e.globals.lastClientPosition={x:s.clientX,y:s.clientY};let i=e.globals.isRangeBar?e.globals.minY:e.globals.minX,a=e.globals.isRangeBar?e.globals.maxY:e.globals.maxX;s.panScrolled(i,a)}panScrolled(t,e){const s=this.w,i=this.xyRatios;let a=u.clone(s.globals.initialConfig.yaxis),o=i.xRatio,r=s.globals.minX,l=s.globals.maxX;s.globals.isRangeBar&&(o=i.invertedYRatio,r=s.globals.minY,l=s.globals.maxY),"left"===this.moveDirection?(t=r+s.globals.gridWidth/15*o,e=l+s.globals.gridWidth/15*o):"right"===this.moveDirection&&(t=r-s.globals.gridWidth/15*o,e=l-s.globals.gridWidth/15*o),s.globals.isRangeBar||(t<s.globals.initialMinX||e>s.globals.initialMaxX)&&(t=r,e=l);let n={xaxis:{min:t,max:e}};s.config.chart.group||(n.yaxis=a),this.updateScrolledChart(n,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)}}}class Bt{constructor(t){this.w=t.w,this.ttCtx=t,this.ctx=t.ctx}getNearestValues({hoverArea:t,elGrid:e,clientX:s,clientY:i}){let a=this.w;const o=e.getBoundingClientRect(),r=o.width,l=o.height;let n=r/(a.globals.dataPoints-1),h=l/a.globals.dataPoints;const c=this.hasBars();!a.globals.comboCharts&&!c||a.config.xaxis.convertedCatToNumeric||(n=r/a.globals.dataPoints);let d=s-o.left-a.globals.barPadForNumericAxis,g=i-o.top;d<0||g<0||d>r||g>l?(t.classList.remove("hovering-zoom"),t.classList.remove("hovering-pan")):a.globals.zoomEnabled?(t.classList.remove("hovering-pan"),t.classList.add("hovering-zoom")):a.globals.panEnabled&&(t.classList.remove("hovering-zoom"),t.classList.add("hovering-pan"));let p=Math.round(d/n),x=Math.floor(g/h);c&&!a.config.xaxis.convertedCatToNumeric&&(p=Math.ceil(d/n),p-=1);let b=null,f=null,m=a.globals.seriesXvalues.map(t=>t.filter(t=>u.isNumber(t))),y=a.globals.seriesYvalues.map(t=>t.filter(t=>u.isNumber(t)));if(a.globals.isXNumeric){const t=this.ttCtx.getElGrid().getBoundingClientRect(),e=d*(t.width/r),s=g*(t.height/l);f=this.closestInMultiArray(e,s,m,y),b=f.index,p=f.j,null!==b&&a.globals.hasNullValues&&(m=a.globals.seriesXvalues[b],f=this.closestInArray(e,m),p=f.j)}return a.globals.capturedSeriesIndex=null===b?-1:b,(!p||p<1)&&(p=0),a.globals.isBarHorizontal?a.globals.capturedDataPointIndex=x:a.globals.capturedDataPointIndex=p,{capturedSeries:b,j:a.globals.isBarHorizontal?x:p,hoverX:d,hoverY:g}}getFirstActiveXArray(t){const e=this.w;let s=0,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,o=t=>-1===a.globals.collapsedSeriesIndices.indexOf(t)&&-1===a.globals.ancillaryCollapsedSeriesIndices.indexOf(t);let r=1/0,l=null,n=null;for(let h=0;h<s.length;h++){if(!o(h))continue;const c=s[h],d=i[h],g=Math.min(c.length,d.length);for(let s=0;s<g;s++){const i=t-c[s];let o=Math.sqrt(i*i);if(!a.globals.allSeriesHasEqualX){const t=e-d[s];o=Math.sqrt(i*i+t*t)}o<r&&(r=o,l=h,n=s)}}return{index:l,j:n}}closestInArray(t,e){let s=e[0],i=null,a=Math.abs(t-s);for(let s=0;s<e.length;s++){let o=Math.abs(t-e[s]);o<a&&(a=o,i=s)}return{j:i}}isXoverlap(t){let e=[];const s=this.w.globals.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;let e=!0;const s=(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<s.length-1;t++)if(s[t].data.length!==s[t+1].data.length){e=!1;break}return e}getBarsHeight(t){return[...t].reduce((t,e)=>t+e.getBBox().height,0)}getElMarkers(t){return"number"==typeof t?this.w.globals.dom.baseEl.querySelectorAll(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers-wrap > *`):this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}getAllMarkers(t=!1){let e=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");e=[...e],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});let s=[];return e.forEach(t=>{s.push(t.querySelector(".apexcharts-marker"))}),s}hasMarkers(t){return this.getElMarkers(t).length>0}getPathFromPoint(t,e){let s=Number(t.getAttribute("cx")),i=Number(t.getAttribute("cy")),a=t.getAttribute("shape");return new w(this.ctx).getMarkerPath(s,i,a,e)}getElBars(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-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){let e=this.w;const s=this.ttCtx;0===s.allTooltipSeriesGroups.length&&(s.allTooltipSeriesGroups=e.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));let 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 Gt{constructor(t){this.w=t.w,this.ctx=t.ctx,this.ttCtx=t,this.tooltipUtil=new Bt(t)}drawSeriesTexts({shared:t=!0,ttItems:e,i:s=0,j:i=null,y1:a,y2:o,e:r}){let l=this.w;void 0!==l.config.tooltip.custom?this.handleCustomTooltip({i:s,j:i,y1:a,y2:o,w:l}):this.toggleActiveInactiveSeries(t,s);let n=this.getValuesToPrint({i:s,j:i});this.printLabels({i:s,j:i,values:n,ttItems:e,shared:t,e:r});const h=this.ttCtx.getElTooltip();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:o}){var r;const h=this.w;let c,d=[];const g=t=>h.globals.seriesGoals[t]&&h.globals.seriesGoals[t][e]&&Array.isArray(h.globals.seriesGoals[t][e]),{xVal:p,zVal:x,xAxisTTVal:b}=s;let f="",u=h.globals.colors[t];null!==e&&h.config.plotOptions.bar.distributed&&(u=h.globals.colors[e]);for(let s=0,m=h.globals.series.length-1;s<h.globals.series.length;s++,m--){let y=this.getFormatters(t);f=this.getSeriesName({fn:y.yLbTitleFormatter,index:t,seriesIndex:t,j:e}),"treemap"===h.config.chart.type&&(f=y.yLbTitleFormatter(String(h.config.series[t].data[e].x),{series:h.globals.series,seriesIndex:t,dataPointIndex:e,w:h}));const w=h.config.tooltip.inverseOrder?m:s;if(h.globals.axisCharts){const s=t=>{var s,i,a,o;return h.globals.isRangeData?y.yLbFormatter(null==(i=null==(s=h.globals.seriesRangeStart)?void 0:s[t])?void 0:i[e],{series:h.globals.seriesRangeStart,seriesIndex:t,dataPointIndex:e,w:h})+" - "+y.yLbFormatter(null==(o=null==(a=h.globals.seriesRangeEnd)?void 0:a[t])?void 0:o[e],{series:h.globals.seriesRangeEnd,seriesIndex:t,dataPointIndex:e,w:h}):y.yLbFormatter(h.globals.series[t][e],{series:h.globals.series,seriesIndex:t,dataPointIndex:e,w:h})};if(a)y=this.getFormatters(w),f=this.getSeriesName({fn:y.yLbTitleFormatter,index:w,seriesIndex:t,j:e}),u=h.globals.colors[w],c=s(w),g(w)&&(d=h.globals.seriesGoals[w][e].map(t=>({attrs:t,val:y.yLbFormatter(t.value,{seriesIndex:w,dataPointIndex:e,w:h})})));else{const i=null==(r=null==o?void 0:o.target)?void 0:r.getAttribute("fill");i&&(-1!==i.indexOf("url")?-1!==i.indexOf("Pattern")&&(u=h.globals.dom.baseEl.querySelector(i.substr(4).slice(0,-1)).childNodes[0].getAttribute("stroke")):u=i),c=s(t),g(t)&&Array.isArray(h.globals.seriesGoals[t][e])&&(d=h.globals.seriesGoals[t][e].map(s=>({attrs:s,val:y.yLbFormatter(s.value,{seriesIndex:t,dataPointIndex:e,w:h})})))}}null===e&&(c=y.yLbFormatter(h.globals.series[t],n(l({},h),{seriesIndex:t,dataPointIndex:t}))),this.DOMHandling({i:t,t:w,j:e,ttItems:i,values:{val:c,goalVals:d,xVal:p,xAxisTTVal:b,zVal:x},seriesName:f,shared:a,pColor:u})}}getFormatters(t){const e=this.w;let s,i=e.globals.yLabelFormatters[t];return void 0!==e.globals.ttVal?Array.isArray(e.globals.ttVal)?(i=e.globals.ttVal[t]&&e.globals.ttVal[t].formatter,s=e.globals.ttVal[t]&&e.globals.ttVal[t].title&&e.globals.ttVal[t].title.formatter):(i=e.globals.ttVal.formatter,"function"==typeof e.globals.ttVal.title.formatter&&(s=e.globals.ttVal.title.formatter)):s=e.config.tooltip.y.title.formatter,"function"!=typeof i&&(i=e.globals.yLabelFormatters[0]?e.globals.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.globals.seriesNames[e]),{series:a.globals.series,seriesIndex:s,dataPointIndex:i,w:a})}DOMHandling({t:t,j:e,ttItems:s,values:i,seriesName:a,shared:o,pColor:r}){const l=this.w,n=this.ttCtx,{val:h,goalVals:c,xVal:d,xAxisTTVal:g,zVal:p}=i;let x=null;x=s[t].children,l.config.tooltip.fillSeriesColor&&(s[t].style.backgroundColor=r,x[0].style.display="none"),n.showTooltipTitle&&(null===n.tooltipTitle&&(n.tooltipTitle=l.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")),n.tooltipTitle.innerHTML=d),n.isXAxisTooltipEnabled&&(n.xaxisTooltipText.innerHTML=""!==g?g:d);const b=s[t].querySelector(".apexcharts-tooltip-text-y-label");b&&(b.innerHTML=a||"");const f=s[t].querySelector(".apexcharts-tooltip-text-y-value");f&&(f.innerHTML=void 0!==h?h:""),x[0]&&x[0].classList.contains("apexcharts-tooltip-marker")&&(l.config.tooltip.marker.fillColors&&Array.isArray(l.config.tooltip.marker.fillColors)&&(r=l.config.tooltip.marker.fillColors[t]),l.config.tooltip.fillSeriesColor?x[0].style.backgroundColor=r:x[0].style.color=r),l.config.tooltip.marker.show||(x[0].style.display="none");const u=s[t].querySelector(".apexcharts-tooltip-text-goals-label"),m=s[t].querySelector(".apexcharts-tooltip-text-goals-value");if(c.length&&l.globals.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>`}),u.innerHTML=t+"</div>",m.innerHTML=e+"</div>"};o?l.globals.seriesGoals[t][e]&&Array.isArray(l.globals.seriesGoals[t][e])?s():(u.innerHTML="",m.innerHTML=""):s()}else u.innerHTML="",m.innerHTML="";if(null!==p){s[t].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=l.config.tooltip.z.title;s[t].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=void 0!==p?p:""}if(o&&x[0]){if(l.config.tooltip.hideEmptySeries){let 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||l.globals.ancillaryCollapsedSeriesIndices.indexOf(t)>-1||l.globals.collapsedSeriesIndices.indexOf(t)>-1||Array.isArray(n.tConfig.enabledOnSeries)&&-1===n.tConfig.enabledOnSeries.indexOf(t)?x[0].parentNode.style.display="none":x[0].parentNode.style.display=l.config.tooltip.items.display}else Array.isArray(n.tConfig.enabledOnSeries)&&-1===n.tConfig.enabledOnSeries.indexOf(t)&&(x[0].parentNode.style.display="none")}toggleActiveInactiveSeries(t,e){const s=this.w;if(t)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");let t=s.globals.dom.baseEl.querySelector(`.apexcharts-tooltip-series-group-${e}`);t&&(t.classList.add("apexcharts-active"),t.style.display=s.config.tooltip.items.display)}}getValuesToPrint({i:t,j:e}){const s=this.w,i=this.ctx.series.filteredSeriesX();let a="",o="",r=null,l=null;const n={series:s.globals.series,seriesIndex:t,dataPointIndex:e,w:s};let h=s.globals.ttZFormatter;if(null===e)l=s.globals.series[t];else if(s.globals.isXNumeric&&"treemap"!==s.config.chart.type){if(a=i[t][e],0===i[t].length){a=i[this.tooltipUtil.getFirstActiveXArray(i)][e]}}else{a=new $(this.ctx).isFormatXY()?void 0!==s.config.series[t].data[e]?s.config.series[t].data[e].x:"":void 0!==s.globals.labels[e]?s.globals.labels[e]:""}let c=a;if(s.globals.isXNumeric&&"datetime"===s.config.xaxis.type){a=new k(this.ctx).xLabelFormat(s.globals.ttKeyFormatter,c,c,{i:void 0,dateFormatter:new S(this.ctx).formatDate,w:this.w})}else a=s.globals.isBarHorizontal?s.globals.yLabelFormatters[0](c,n):s.globals.xLabelFormatter(c,n);return void 0!==s.config.tooltip.x.formatter&&(a=s.globals.ttKeyFormatter(c,n)),s.globals.seriesZ.length>0&&s.globals.seriesZ[t].length>0&&(r=h(s.globals.seriesZ[t][e],s)),o="function"==typeof s.config.xaxis.tooltip.formatter?s.globals.xaxisTooltipFormatter(c,n):a,{val:Array.isArray(l)?l.join(" "):l,xVal:Array.isArray(a)?a.join(" "):a,xAxisTTVal:Array.isArray(o)?o.join(" "):o,zVal:r}}handleCustomTooltip({i:t,j:e,y1:s,y2:i,w:a}){const o=this.ttCtx.getElTooltip();let r=a.config.tooltip.custom;Array.isArray(r)&&r[t]&&(r=r[t]);const l=r({ctx:this.ctx,series:a.globals.series,seriesIndex:t,dataPointIndex:e,y1:s,y2:i,w:a});"string"==typeof l||"number"==typeof l?o.innerHTML=l:(l instanceof Element||"string"==typeof l.nodeName)&&(o.innerHTML="",o.appendChild(l.cloneNode(!0)))}}class $t{constructor(t){this.ttCtx=t,this.ctx=t.ctx,this.w=t.w}moveXCrosshairs(t,e=null){const s=this.ttCtx;let i=this.w;const a=s.getElXCrosshairs();let o=t-s.xcrosshairsWidth/2,r=i.globals.labels.slice().length;if(null!==e&&(o=i.globals.gridWidth/r*e),null===a||i.globals.isBarHorizontal||(a.setAttribute("x",o),a.setAttribute("x1",o),a.setAttribute("x2",o),a.setAttribute("y2",i.globals.gridHeight),a.classList.add("apexcharts-active")),o<0&&(o=0),o>i.globals.gridWidth&&(o=i.globals.gridWidth),s.isXAxisTooltipEnabled){let t=o;"tickWidth"!==i.config.xaxis.crosshairs.width&&"barWidth"!==i.config.xaxis.crosshairs.width||(t=o+s.xcrosshairsWidth/2),this.moveXAxisTooltip(t)}}moveYCrosshairs(t){const e=this.ttCtx;null!==e.ycrosshairs&&w.setAttrs(e.ycrosshairs,{y1:t,y2:t}),null!==e.ycrosshairsHidden&&w.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t})}moveXAxisTooltip(t){let e=this.w;const s=this.ttCtx;if(null!==s.xaxisTooltip&&0!==s.xcrosshairsWidth){s.xaxisTooltip.classList.add("apexcharts-active");let i=s.xaxisOffY+e.config.xaxis.tooltip.offsetY+e.globals.translateY+1+e.config.xaxis.offsetY;if(t-=s.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(t)){t+=e.globals.translateX;let a=0;a=new w(this.ctx).getTextRects(s.xaxisTooltipText.innerHTML),s.xaxisTooltipText.style.minWidth=a.width+"px",s.xaxisTooltip.style.left=t+"px",s.xaxisTooltip.style.top=i+"px"}}}moveYAxisTooltip(t){const e=this.w,s=this.ttCtx;null===s.yaxisTTEls&&(s.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));const i=parseInt(s.ycrosshairsHidden.getAttribute("y1"),10);let a=e.globals.translateY+i;const o=s.yaxisTTEls[t].getBoundingClientRect(),r=o.height;let l=e.globals.translateYAxisX[t]-2;e.config.yaxis[t].opposite&&(l-=o.width),a-=r/2,-1===e.globals.ignoreYAxisIndexes.indexOf(t)&&a>0&&a<e.globals.gridHeight?(s.yaxisTTEls[t].classList.add("apexcharts-active"),s.yaxisTTEls[t].style.top=a+"px",s.yaxisTTEls[t].style.left=l+e.config.yaxis[t].tooltip.offsetX+"px"):s.yaxisTTEls[t].classList.remove("apexcharts-active")}moveTooltip(t,e,s=null){let i=this.w,a=this.ttCtx;const o=a.getElTooltip();let r=a.tooltipRect,l=null!==s?parseFloat(s):1,n=parseFloat(t)+l+5,h=parseFloat(e)+l/2;if(n>i.globals.gridWidth/2&&(n=n-r.ttWidth-l-10),n>i.globals.gridWidth-r.ttWidth-10&&(n=i.globals.gridWidth-r.ttWidth),n<-20&&(n=-20),i.config.tooltip.followCursor){const t=a.getElGrid().getBoundingClientRect();n=a.e.clientX-t.left,n>i.globals.gridWidth/2&&(n-=a.tooltipRect.ttWidth),h=a.e.clientY+i.globals.translateY-t.top,h>i.globals.gridHeight/2&&(h-=a.tooltipRect.ttHeight)}else i.globals.isBarHorizontal||r.ttHeight/2+h>i.globals.gridHeight&&(h=i.globals.gridHeight-r.ttHeight+i.globals.translateY);isNaN(n)||(n+=i.globals.translateX,o.style.left=n+"px",o.style.top=h+"px")}moveMarkers(t,e){let s=this.w,i=this.ttCtx;if(s.globals.markers.size[t]>0){let a=s.globals.dom.baseEl.querySelectorAll(` .apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker`);for(let t=0;t<a.length;t++)parseInt(a[t].getAttribute("rel"),10)===e&&(i.marker.resetPointsSize(),i.marker.enlargeCurrentPoint(e,a[t]))}else i.marker.resetPointsSize(),this.moveDynamicPointOnHover(e,t)}moveDynamicPointOnHover(t,e){var s,i;let a=this.w,o=this.ttCtx,r=0,l=0;const n=new w(this.ctx);let h=a.globals.pointsArray,c=o.tooltipUtil.getHoverMarkerSize(e);const d=a.config.series[e].type;if(d&&("column"===d||"candlestick"===d||"boxPlot"===d))return;r=null==(s=h[e][t])?void 0:s[0],l=(null==(i=h[e][t])?void 0:i[1])||0;let g=a.globals.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${e}'] .apexcharts-series-markers path`);if(g&&l<a.globals.gridHeight&&l>0){const t=g.getAttribute("shape"),e=n.getMarkerPath(r,l,t,1.5*c);g.setAttribute("d",e)}this.moveXCrosshairs(r),o.fixedTooltip||this.moveTooltip(r,l,c)}moveDynamicPointsOnHover(t){const e=this.ttCtx;let s=e.w,i=0,a=0,o=0,r=s.globals.pointsArray,l=new G(this.ctx);const n=new w(this.ctx);o=l.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);let h=e.tooltipUtil.getHoverMarkerSize(o);if(r[o]&&(i=r[o][t][0],a=r[o][t][1]),isNaN(i))return;let c=e.tooltipUtil.getAllMarkers();if(c.length)for(let e=0;e<s.globals.series.length;e++){let a=r[e];if(s.globals.comboCharts&&void 0===a&&c.splice(e,0,null),a&&a.length){let a,o=r[e][t][1];c[e].setAttribute("cx",i);const l=c[e].getAttribute("shape");if("rangeArea"===s.config.chart.type&&!s.globals.comboCharts){const i=t+s.globals.series[e].length;a=r[e][i][1];o-=Math.abs(o-a)/2}if(null!==o&&!isNaN(o)&&o<s.globals.gridHeight+h&&o+h>0){const t=n.getMarkerPath(i,o,l,h);c[e].setAttribute("d",t)}else c[e].setAttribute("d","")}}this.moveXCrosshairs(i),e.fixedTooltip||this.moveTooltip(i,a||s.globals.gridHeight,h)}moveStickyTooltipOverBars(t,e){const s=this.w,i=this.ttCtx;let a=s.globals.columnSeries?s.globals.columnSeries.length:s.globals.series.length;s.config.chart.stacked&&(a=s.globals.barGroups.length);let o=a>=2&&a%2==0?Math.floor(a/2):Math.floor(a/2)+1;if(s.globals.isBarHorizontal){o=new G(this.ctx).getActiveConfigSeriesIndex("desc")+1}let r=s.globals.dom.baseEl.querySelector(`.apexcharts-bar-series .apexcharts-series[rel='${o}'] path[j='${t}'], .apexcharts-candlestick-series .apexcharts-series[rel='${o}'] path[j='${t}'], .apexcharts-boxPlot-series .apexcharts-series[rel='${o}'] path[j='${t}'], .apexcharts-rangebar-series .apexcharts-series[rel='${o}'] path[j='${t}']`);r||"number"!=typeof e||(r=s.globals.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-rangebar-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}']`));let l=r?parseFloat(r.getAttribute("cx")):0,n=r?parseFloat(r.getAttribute("cy")):0,h=r?parseFloat(r.getAttribute("barWidth")):0;let c=i.getElGrid().getBoundingClientRect();const d=r&&(r.classList.contains("apexcharts-candlestick-area")||r.classList.contains("apexcharts-boxPlot-area"));s.globals.isXNumeric?(r&&!d&&(l-=a%2!=0?h/2:0),r&&d&&(l-=h/2)):s.globals.isBarHorizontal||(l=i.xAxisTicksPositions[t-1]+i.dataPointsDividedWidth/2,isNaN(l)&&(l=i.xAxisTicksPositions[t]-i.dataPointsDividedWidth/2)),s.globals.isBarHorizontal?n-=i.tooltipRect.ttHeight:s.config.tooltip.followCursor?n=i.e.clientY-c.top-i.tooltipRect.ttHeight/2:n+i.tooltipRect.ttHeight+15>s.globals.gridHeight&&(n=s.globals.gridHeight),s.globals.isBarHorizontal||this.moveXCrosshairs(l),i.fixedTooltip||this.moveTooltip(l,n||s.globals.gridHeight)}}class _t{constructor(t){this.w=t.w,this.ttCtx=t,this.ctx=t.ctx,this.tooltipPosition=new $t(t)}drawDynamicPoints(){let t=this.w,e=new w(this.ctx),s=new O(this.ctx),i=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series");i=[...i],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++){let o=i[a].querySelector(".apexcharts-series-markers-wrap");if(null!==o){let i,a=`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||(a+=" no-pointer-events");let r=s.getMarkerConfig({cssClass:a,seriesIndex:Number(o.getAttribute("data:realIndex"))});i=e.drawMarker(0,0,r),i.node.setAttribute("default-marker-size",0);let l=document.createElementNS(t.globals.SVGNS,"g");l.classList.add("apexcharts-series-markers"),l.appendChild(i.node),o.appendChild(l)}}}enlargeCurrentPoint(t,e,s=null,i=null){let a=this.w;"bubble"!==a.config.chart.type&&this.newPointSize(t,e);let o=e.getAttribute("cx"),r=e.getAttribute("cy");if(null!==s&&null!==i&&(o=s,r=i),this.tooltipPosition.moveXCrosshairs(o),!this.fixedTooltip){if("radar"===a.config.chart.type){const t=this.ttCtx.getElGrid().getBoundingClientRect();o=this.ttCtx.e.clientX-t.left}this.tooltipPosition.moveTooltip(o,r,a.config.markers.hover.size)}}enlargePoints(t){let e=this.w,s=this;const i=this.ttCtx;let a=t,o=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),r=e.config.markers.hover.size;for(let t=0;t<o.length;t++){let l=o[t].getAttribute("rel"),n=o[t].getAttribute("index");if(void 0===r&&(r=e.globals.markers.size[n]+e.config.markers.hover.sizeOffset),a===parseInt(l,10)){s.newPointSize(a,o[t]);let e=o[t].getAttribute("cx"),l=o[t].getAttribute("cy");s.tooltipPosition.moveXCrosshairs(e),i.fixedTooltip||s.tooltipPosition.moveTooltip(e,l,r)}else s.oldPointSize(o[t])}}newPointSize(t,e){let s=this.w,i=s.config.markers.hover.size,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 o=this.ttCtx.tooltipUtil.getPathFromPoint(e,i);e.setAttribute("d",o)}}oldPointSize(t){const e=parseFloat(t.getAttribute("default-marker-size")),s=this.ttCtx.tooltipUtil.getPathFromPoint(t,e);t.setAttribute("d",s)}resetPointsSize(){let t=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker");for(let e=0;e<t.length;e++){const s=parseFloat(t[e].getAttribute("default-marker-size"));if(u.isNumber(s)&&s>0){const i=this.ttCtx.tooltipUtil.getPathFromPoint(t[e],s);t[e].setAttribute("d",i)}else t[e].setAttribute("d","M0,0")}}}class Vt{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){return parseFloat(t.target.getAttribute(e))}handleHeatTreeTooltip({e:t,opt:e,x:s,y:i,type:a}){const o=this.ttCtx,r=this.w;if(t.target.classList.contains(`apexcharts-${a}-rect`)){let a=this.getAttr(t,"i"),l=this.getAttr(t,"j"),n=this.getAttr(t,"cx"),h=this.getAttr(t,"cy"),c=this.getAttr(t,"width"),d=this.getAttr(t,"height");if(o.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:a,j:l,shared:!1,e:t}),r.globals.capturedSeriesIndex=a,r.globals.capturedDataPointIndex=l,s=n+o.tooltipRect.ttWidth/2+c,i=h+o.tooltipRect.ttHeight/2-d/2,o.tooltipPosition.moveXCrosshairs(n+c/2),s>r.globals.gridWidth/2&&(s=n-o.tooltipRect.ttWidth/2+c),o.w.config.tooltip.followCursor){let t=r.globals.dom.elWrap.getBoundingClientRect();s=r.globals.clientX-t.left-(s>r.globals.gridWidth/2?o.tooltipRect.ttWidth:0),i=r.globals.clientY-t.top-(i>r.globals.gridHeight/2?o.tooltipRect.ttHeight:0)}}return{x:s,y:i}}handleMarkerTooltip({e:t,opt:e,x:s,y:i}){let a=this.w;const o=this.ttCtx;let r,l;if(t.target.classList.contains("apexcharts-marker")){let n=parseInt(e.paths.getAttribute("cx"),10),h=parseInt(e.paths.getAttribute("cy"),10),c=parseFloat(e.paths.getAttribute("val"));if(l=parseInt(e.paths.getAttribute("rel"),10),r=parseInt(e.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,o.intersect){const t=u.findAncestor(e.paths,"apexcharts-series");t&&(r=parseInt(t.getAttribute("data:realIndex"),10))}if(o.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:r,j:l,shared:!o.showOnIntersect&&a.config.tooltip.shared,e:t}),"mouseup"===t.type&&o.markerClick(t,r,l),a.globals.capturedSeriesIndex=r,a.globals.capturedDataPointIndex=l,s=n,i=h+a.globals.translateY-1.4*o.tooltipRect.ttHeight,o.w.config.tooltip.followCursor){const t=o.getElGrid().getBoundingClientRect();i=o.e.clientY+a.globals.translateY-t.top}c<0&&(i=h),o.marker.enlargeCurrentPoint(l,e.paths,s,i)}return{x:s,y:i}}handleBarTooltip({e:t,opt:e}){const s=this.w,i=this.ttCtx,a=i.getElTooltip();let o,r=0,l=0,n=0,h=0,c=this.getBarTooltipXY({e:t,opt:e});if(null===c.j&&0===c.barHeight&&0===c.barWidth)return;h=c.i;let d=c.j;if(s.globals.capturedSeriesIndex=h,s.globals.capturedDataPointIndex=d,s.globals.isBarHorizontal&&i.tooltipUtil.hasBars()||!s.config.tooltip.shared?(l=c.x,n=c.y,o=Array.isArray(s.config.stroke.width)?s.config.stroke.width[h]:s.config.stroke.width,r=l):s.globals.comboCharts||s.config.tooltip.shared||(r/=2),isNaN(n)&&(n=s.globals.svgHeight-i.tooltipRect.ttHeight),l+i.tooltipRect.ttWidth>s.globals.gridWidth?l-=i.tooltipRect.ttWidth:l<0&&(l=0),i.w.config.tooltip.followCursor){const t=i.getElGrid().getBoundingClientRect();n=i.e.clientY-t.top}null===i.tooltip&&(i.tooltip=s.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),s.config.tooltip.shared||(s.globals.comboBarCount>0?i.tooltipPosition.moveXCrosshairs(r+o/2):i.tooltipPosition.moveXCrosshairs(r)),!i.fixedTooltip&&(!s.config.tooltip.shared||s.globals.isBarHorizontal&&i.tooltipUtil.hasBars())&&(n=n+s.globals.translateY-i.tooltipRect.ttHeight/2,a.style.left=l+s.globals.translateX+"px",a.style.top=n+"px")}getBarTooltipXY({e:t,opt:e}){let s=this.w,i=null;const a=this.ttCtx;let o=0,r=0,l=0,n=0,h=0;const c=t.target.classList;if(c.contains("apexcharts-bar-area")||c.contains("apexcharts-candlestick-area")||c.contains("apexcharts-boxPlot-area")||c.contains("apexcharts-rangebar-area")){let c=t.target,d=c.getBoundingClientRect(),g=e.elGrid.getBoundingClientRect(),p=d.height;h=d.height;let x=d.width,b=parseInt(c.getAttribute("cx"),10),f=parseInt(c.getAttribute("cy"),10);n=parseFloat(c.getAttribute("barWidth"));const u="touchmove"===t.type?t.touches[0].clientX:t.clientX;i=parseInt(c.getAttribute("j"),10),o=parseInt(c.parentNode.getAttribute("rel"),10)-1;let m=c.getAttribute("data-range-y1"),y=c.getAttribute("data-range-y2");s.globals.comboCharts&&(o=parseInt(c.parentNode.getAttribute("data:realIndex"),10));const w=t=>s.globals.isXNumeric?b-x/2:this.isVerticalGroupedRangeBar?b+x/2:b-a.dataPointsDividedWidth+x/2,v=()=>f-a.dataPointsDividedHeight+p/2-a.tooltipRect.ttHeight/2;a.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:o,j:i,y1:m?parseInt(m,10):null,y2:y?parseInt(y,10):null,shared:!a.showOnIntersect&&s.config.tooltip.shared,e:t}),s.config.tooltip.followCursor?s.globals.isBarHorizontal?(r=u-g.left+15,l=v()):(r=w(r),l=t.clientY-g.top-a.tooltipRect.ttHeight/2-15):s.globals.isBarHorizontal?(r=b,r<a.xyRatios.baseLineInvertedY&&(r=b-a.tooltipRect.ttWidth),l=v()):(r=w(r),l=f)}return{x:r,y:l,barHeight:h,barWidth:n,i:o,j:i}}}class jt{constructor(t){this.w=t.w,this.ttCtx=t}drawXaxisTooltip(){let t=this.w;const e=this.ttCtx,s="bottom"===t.config.xaxis.position;e.xaxisOffY=s?t.globals.gridHeight+1:-t.globals.xAxisHeight-t.config.xaxis.axisTicks.height+3;const i=s?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top";let a=t.globals.dom.elWrap;if(e.isXAxisTooltipEnabled){null===t.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip")&&(e.xaxisTooltip=document.createElement("div"),e.xaxisTooltip.setAttribute("class",i+" apexcharts-theme-"+t.config.tooltip.theme),a.appendChild(e.xaxisTooltip),e.xaxisTooltipText=document.createElement("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(){let t=this.w;const 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.globals.gridWidth+1:1;let a=i?`apexcharts-yaxistooltip apexcharts-yaxistooltip-${s} apexcharts-yaxistooltip-right`:`apexcharts-yaxistooltip apexcharts-yaxistooltip-${s} apexcharts-yaxistooltip-left`,o=t.globals.dom.elWrap;null===t.globals.dom.baseEl.querySelector(`.apexcharts-yaxistooltip apexcharts-yaxistooltip-${s}`)&&(e.yaxisTooltip=document.createElement("div"),e.yaxisTooltip.setAttribute("class",a+" apexcharts-theme-"+t.config.tooltip.theme),o.appendChild(e.yaxisTooltip),0===s&&(e.yaxisTooltipText=[]),e.yaxisTooltipText[s]=document.createElement("div"),e.yaxisTooltipText[s].classList.add("apexcharts-yaxistooltip-text"),e.yaxisTooltip.appendChild(e.yaxisTooltipText[s]))}}setXCrosshairWidth(){let t=this.w;const e=this.ttCtx,s=e.getElXCrosshairs();if(e.xcrosshairsWidth=parseInt(t.config.xaxis.crosshairs.width,10),t.globals.comboCharts){let s=t.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==s&&"barWidth"===t.config.xaxis.crosshairs.width){let t=parseFloat(s.getAttribute("barWidth"));e.xcrosshairsWidth=t}else if("tickWidth"===t.config.xaxis.crosshairs.width){let s=t.globals.labels.length;e.xcrosshairsWidth=t.globals.gridWidth/s}}else if("tickWidth"===t.config.xaxis.crosshairs.width){let s=t.globals.labels.length;e.xcrosshairsWidth=t.globals.gridWidth/s}else if("barWidth"===t.config.xaxis.crosshairs.width){let s=t.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==s){let t=parseFloat(s.getAttribute("barWidth"));e.xcrosshairsWidth=t}else e.xcrosshairsWidth=1}t.globals.isBarHorizontal&&(e.xcrosshairsWidth=0),null!==s&&e.xcrosshairsWidth>0&&s.setAttribute("width",e.xcrosshairsWidth)}handleYCrosshair(){let t=this.w;const e=this.ttCtx;e.ycrosshairs=t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),e.ycrosshairsHidden=t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}drawYaxisTooltipText(t,e,s){const i=this.ttCtx,a=this.w,o=a.globals,r=o.seriesYAxisMap[t];if(i.yaxisTooltips[t]&&r.length>0){const l=o.yLabelFormatters[t],n=i.getElGrid().getBoundingClientRect(),h=r[0];let c=0;s.yRatio.length>1&&(c=h);const d=(e-n.top)*s.yRatio[c],g=o.maxYArr[h]-o.minYArr[h];let p=o.minYArr[h]+(g-d);a.config.yaxis[t].reversed&&(p=o.maxYArr[h]-(g-d)),i.tooltipPosition.moveYCrosshairs(e-n.top),i.yaxisTooltipText[t].innerHTML=l(p),i.tooltipPosition.moveYAxisTooltip(t)}}}class Ut{constructor(t){this.ctx=t,this.w=t.w;const e=this.w;this.tConfig=e.config.tooltip,this.tooltipUtil=new Bt(this),this.tooltipLabels=new Gt(this),this.tooltipPosition=new $t(this),this.marker=new _t(this),this.intersect=new Vt(this),this.axesTooltip=new jt(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!e.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now(),this.dimensionUpdateScheduled=!1}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.globals.dom.baseEl?t.w.globals.dom.baseEl.querySelector(".apexcharts-tooltip"):null}getElXCrosshairs(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}getElGrid(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid")}drawTooltip(t){let 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=document.createElement("div");if(s.classList.add("apexcharts-tooltip"),e.config.tooltip.cssClass&&s.classList.add(e.config.tooltip.cssClass),s.classList.add(`apexcharts-theme-${this.tConfig.theme||"light"}`),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&(s.setAttribute("role","tooltip"),s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic","true"),s.setAttribute("aria-hidden","true")),e.globals.dom.elWrap.appendChild(s),e.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();let t=new V(this.ctx);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(this),e.globals.collapsedSeries.length===e.globals.series.length)return;this.dataPointsDividedHeight=e.globals.gridHeight/e.globals.dataPoints,this.dataPointsDividedWidth=e.globals.gridWidth/e.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("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,s.appendChild(this.tooltipTitle));let i=e.globals.series.length;(e.globals.xyCharts||e.globals.comboCharts)&&this.tConfig.shared&&(i=this.showOnIntersect?1:e.globals.series.length),this.legendLabels=e.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(i),this.addSVGEvents(),this.setupDimensionCache()}createTTElements(t){const e=this.w;let s=[];const i=this.getElTooltip();for(let a=0;a<t;a++){let o=document.createElement("div");o.classList.add("apexcharts-tooltip-series-group",`apexcharts-tooltip-series-group-${a}`),o.style.order=e.config.tooltip.inverseOrder?t-a:a+1;let r=document.createElement("span");r.classList.add("apexcharts-tooltip-marker"),e.config.tooltip.fillSeriesColor?r.style.backgroundColor=e.globals.colors[a]:r.style.color=e.globals.colors[a];let l=e.config.markers.shape,n=l;Array.isArray(l)&&(n=l[a]),r.setAttribute("shape",n),o.appendChild(r);const h=document.createElement("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=document.createElement("div");e.classList.add(`apexcharts-tooltip-${t}-group`);let s=document.createElement("span");s.classList.add(`apexcharts-tooltip-text-${t}-label`),e.appendChild(s);let i=document.createElement("span");i.classList.add(`apexcharts-tooltip-text-${t}-value`),e.appendChild(i),h.appendChild(e)}),o.appendChild(h),i.appendChild(o),s.push(o)}return s}addSVGEvents(){const t=this.w;let e=t.config.chart.type;const s=this.getElTooltip(),i=!("bar"!==e&&"candlestick"!==e&&"boxPlot"!==e&&"rangeBar"!==e),a="area"===e||"line"===e||"scatter"===e||"bubble"===e||"radar"===e;let o=t.globals.dom.Paper.node;const r=this.getElGrid();r&&(this.seriesBound=r.getBoundingClientRect());let l,n=[],h=[],c={hoverArea:o,elGrid:r,tooltipEl:s,tooltipY:n,tooltipX:h,ttItems:this.ttItems};if(t.globals.axisCharts&&(a?l=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):i?l=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-rangebar-area"):"heatmap"!==e&&"treemap"!==e||(l=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),l&&l.length))for(let t=0;t<l.length;t++)n.push(l[t].getAttribute("cy")),h.push(l[t].getAttribute("cx"));if(t.globals.xyCharts&&!this.showOnIntersect||t.globals.comboCharts&&!this.showOnIntersect||i&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([o],c);else if(i&&!t.globals.comboCharts||a&&this.showOnIntersect)this.addDatapointEventsListeners(c);else if(!t.globals.axisCharts||"heatmap"===e||"treemap"===e){let e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(e,c)}if(this.showOnIntersect){let e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");e.length>0&&this.addPathsEventListeners(e,c),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(c)}}drawFixedTooltipRect(){let t=this.w;const e=this.getElTooltip();let s=e.getBoundingClientRect(),i=s.width+10,a=s.height+10,o=this.tConfig.fixed.offsetX,r=this.tConfig.fixed.offsetY;const l=this.tConfig.fixed.position.toLowerCase();return l.indexOf("right")>-1&&(o=o+t.globals.svgWidth-i+10),l.indexOf("bottom")>-1&&(r=r+t.globals.svgHeight-a-10),e.style.left=o+"px",e.style.top=r+"px",{x:o,y:r,ttWidth:i,ttHeight:a}}addDatapointEventsListeners(t){let e=this.w.globals.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){let s=this;for(let i=0;i<t.length;i++){let 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;i.config.chart.group&&(s=this.ctx.getGroupedCharts()),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}){let a=t.w;if(!this.getElTooltip(t))return;const o=e.getCachedDimensions();if(e.tooltipRect={x:0,y:0,ttWidth:o.ttWidth,ttHeight:o.ttHeight},e.e=i,e.tooltipUtil.hasBars()&&!a.globals.comboCharts&&!e.isBarShared&&this.tConfig.onDatasetHover.highlightDataSeries){new G(t).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}){let s,i,a=this.w,o=e.elGrid.getBoundingClientRect();const r="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=r,a.globals.capturedSeriesIndex=-1,a.globals.capturedDataPointIndex=-1,l<o.top||l>o.top+o.height)return void this.handleMouseOut(e);if(Array.isArray(this.tConfig.enabledOnSeries)&&!a.config.tooltip.shared){const t=parseInt(e.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(t)<0)return void this.handleMouseOut(e)}const n=this.getElTooltip(),h=this.getElXCrosshairs();let c=[];a.config.chart.group&&(c=this.ctx.getSyncedCharts());let d=a.globals.xyCharts||"bar"===a.config.chart.type&&!a.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||a.globals.comboCharts&&this.tooltipUtil.hasBars();if("mousemove"===t.type||"touchmove"===t.type||"mouseup"===t.type){if(a.globals.collapsedSeries.length+a.globals.ancillaryCollapsedSeries.length===a.globals.series.length)return;null!==h&&h.classList.add("apexcharts-active");const o=this.yaxisTooltips.filter(t=>!0===t);if(null!==this.ycrosshairs&&o.length&&this.ycrosshairs.classList.add("apexcharts-active"),d&&!this.showOnIntersect||c.length>1)this.handleStickyTooltip(t,r,l,e);else if("heatmap"===a.config.chart.type||"treemap"===a.config.chart.type){let o=this.intersect.handleHeatTreeTooltip({e:t,opt:e,x:s,y:i,type:a.config.chart.type});s=o.x,i=o.y,n.style.left=s+"px",n.style.top=i+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:t,opt:e}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:t,opt:e,x:s,y:i});if(this.yaxisTooltips.length)for(let t=0;t<a.config.yaxis.length;t++)this.axesTooltip.drawYaxisTooltipText(t,l,this.xyRatios);a.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),e.tooltipEl.classList.add("apexcharts-active"),a.config.chart.accessibility.enabled&&a.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}){let i=this.w,a=e.paths.getAttribute("rel");const o=this.getElTooltip();let r=i.globals.dom.elWrap.getBoundingClientRect();if("mousemove"===t.type||"touchmove"===t.type){i.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),o.classList.add("apexcharts-active"),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.announcements.enabled&&o.removeAttribute("aria-hidden"),this.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:parseInt(a,10)-1,shared:!1});let t=i.globals.clientX-r.left-s.ttWidth/2,l=i.globals.clientY-r.top-s.ttHeight-10;if(o.style.left=t+"px",o.style.top=l+"px",i.config.legend.tooltipHoverFormatter){const t=a-1;let e=(0,i.config.legend.tooltipHoverFormatter)(this.legendLabels[t].getAttribute("data:default-text"),{seriesIndex:t,dataPointIndex:t,w:i});this.legendLabels[t].innerHTML=e}}else"mouseout"!==t.type&&"touchend"!==t.type||(o.classList.remove("apexcharts-active"),i.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),i.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(e)}))}handleStickyTooltip(t,e,s,i){const a=this.w;let o=this.tooltipUtil.getNearestValues({context:this,hoverArea:i.hoverArea,elGrid:i.elGrid,clientX:e,clientY:s}),r=o.j,l=o.capturedSeries;a.globals.collapsedSeriesIndices.includes(l)&&(l=null);const n=i.elGrid.getBoundingClientRect();if(o.hoverX<0||o.hoverX>n.width)this.handleMouseOut(i);else if(null!==l)this.handleStickyCapturedSeries(t,l,i,r);else if(this.tooltipUtil.isXoverlap(r)||a.globals.isBarHorizontal){const e=a.globals.series.findIndex((t,e)=>!a.globals.collapsedSeriesIndices.includes(e));this.create(t,this,e,r,i.ttItems)}}handleStickyCapturedSeries(t,e,s,i){const a=this.w;if(!this.tConfig.shared){if(null===a.globals.series[e][i])return void this.handleMouseOut(s)}if(void 0!==a.globals.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.globals.series.findIndex((t,e)=>!a.globals.collapsedSeriesIndices.includes(e));this.create(t,this,e,i,s.ttItems)}}deactivateHoverFilter(){let t=this.w,e=new w(this.ctx),s=t.globals.dom.Paper.find(".apexcharts-bar-area");for(let t=0;t<s.length;t++)e.pathMouseLeave(s[t])}handleMouseOut(t){const e=this.w,s=this.getElXCrosshairs();if(e.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),t.tooltipEl.classList.remove("apexcharts-active"),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&t.tooltipEl.setAttribute("aria-hidden","true"),this.deactivateHoverFilter(),"bubble"!==e.config.chart.type&&this.marker.resetPointsSize(),null!==s&&s.classList.remove("apexcharts-active"),null!==this.ycrosshairs&&this.ycrosshairs.classList.remove("apexcharts-active"),this.isXAxisTooltipEnabled&&this.xaxisTooltip.classList.remove("apexcharts-active"),this.yaxisTooltips.length){null===this.yaxisTTEls&&(this.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));for(let t=0;t<this.yaxisTTEls.length;t++)this.yaxisTTEls[t].classList.remove("apexcharts-active")}e.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(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}])}create(t,e,s,i,a,o=null){var r,h,c,d,g,p,x,b,f,u,m,y,v,A,C,S;let k=this.w,L=e;"mouseup"===t.type&&this.markerClick(t,s,i),null===o&&(o=this.tConfig.shared);const M=this.tooltipUtil.hasMarkers(s),P=this.tooltipUtil.getElBars(),I=()=>{k.globals.markers.largestSize>0?L.marker.enlargePoints(i):L.tooltipPosition.moveDynamicPointsOnHover(i)};if(k.config.legend.tooltipHoverFormatter){let t=k.config.legend.tooltipHoverFormatter,e=Array.from(this.legendLabels);e.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(e)});for(let a=0;a<e.length;a++){const r=e[a],l=parseInt(r.getAttribute("i"),10),n=decodeURIComponent(r.getAttribute("data:default-text"));let h=t(n,{seriesIndex:o?l:s,dataPointIndex:i,w:k});if(o)r.innerHTML=k.globals.collapsedSeriesIndices.indexOf(l)<0?h:n;else if(r.innerHTML=l===s?h:n,s===l)break}}const T=l(l({ttItems:a,i:s,j:i},void 0!==(null==(d=null==(c=null==(h=null==(r=k.globals.seriesRange)?void 0:r[s])?void 0:h[i])?void 0:c.y[0])?void 0:d.y1)&&{y1:null==(b=null==(x=null==(p=null==(g=k.globals.seriesRange)?void 0:g[s])?void 0:p[i])?void 0:x.y[0])?void 0:b.y1}),void 0!==(null==(y=null==(m=null==(u=null==(f=k.globals.seriesRange)?void 0:f[s])?void 0:u[i])?void 0:m.y[0])?void 0:y.y2)&&{y2:null==(S=null==(C=null==(A=null==(v=k.globals.seriesRange)?void 0:v[s])?void 0:A[i])?void 0:C.y[0])?void 0:S.y2});if(o){if(L.tooltipLabels.drawSeriesTexts(n(l({},T),{shared:!this.showOnIntersect&&this.tConfig.shared})),M)I();else if(this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(P),this.barSeriesHeight>0)){let t=new w(this.ctx),e=k.globals.dom.Paper.find(`.apexcharts-bar-area[j='${i}']`);this.deactivateHoverFilter(),L.tooltipUtil.getAllMarkers(!0).length&&!this.barSeriesHeight&&I(),L.tooltipPosition.moveStickyTooltipOverBars(i,s);for(let s=0;s<e.length;s++)t.pathMouseEnter(e[s])}}else L.tooltipLabels.drawSeriesTexts(l({shared:!1},T)),this.tooltipUtil.hasBars()&&L.tooltipPosition.moveStickyTooltipOverBars(i,s),M&&L.tooltipPosition.moveMarkers(s,i)}}const qt=86400,Zt=10/qt;class Jt{constructor(t){this.ctx=t,this.w=t.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}calculateTimeScaleTicks(t,e){let s=this.w;if(s.globals.allSeriesCollapsed)return s.globals.labels=[],s.globals.timescaleLabels=[],[];let i=new S(this.ctx);const a=(e-t)/864e5;this.determineInterval(a),s.globals.disableZoomIn=!1,s.globals.disableZoomOut=!1,a<Zt?s.globals.disableZoomIn=!0:a>5e4&&(s.globals.disableZoomOut=!0);const o=i.getTimeUnitsfromTimestamp(t,e,this.utc),r=s.globals.gridWidth/a,h=r/24,c=h/60,d=c/60;let g=Math.floor(24*a),p=Math.floor(1440*a),x=Math.floor(a*qt),b=Math.floor(a),f=Math.floor(a/30),u=Math.floor(a/365);const m={minMillisecond:o.minMillisecond,minSecond:o.minSecond,minMinute:o.minMinute,minHour:o.minHour,minDate:o.minDate,minMonth:o.minMonth,minYear:o.minYear};const y={firstVal:m,currentMillisecond:m.minMillisecond,currentSecond:m.minSecond,currentMinute:m.minMinute,currentHour:m.minHour,currentMonthDate:m.minDate,currentDate:m.minDate,currentMonth:m.minMonth,currentYear:m.minYear,daysWidthOnXAxis:r,hoursWidthOnXAxis:h,minutesWidthOnXAxis:c,secondsWidthOnXAxis:d,numberOfSeconds:x,numberOfMinutes:p,numberOfHours:g,numberOfDays:b,numberOfMonths:f,numberOfYears:u};switch(this.tickInterval){case"years":this.generateYearScale(y);break;case"months":case"half_year":this.generateMonthScale(y);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(y);break;case"hours":this.generateHourScale(y);break;case"minutes_fives":case"minutes":this.generateMinuteScale(y);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(y)}const w=this.timeScaleArray.map(t=>{let e={position:t.position,unit:t.unit,year:t.year,day:t.day?t.day:1,hour:t.hour?t.hour:0,month:t.month+1};return"month"===t.unit?n(l({},e),{day:1,value:t.value+1}):"day"===t.unit||"hour"===t.unit?n(l({},e),{value:t.value}):"minute"===t.unit?n(l({},e),{value:t.value,minute:t.value}):"second"===t.unit?n(l({},e),{value:t.value,minute:t.minute,second:t.second}):t});return w.filter(t=>{let e=1,i=Math.ceil(s.globals.gridWidth/120),a=t.value;void 0!==s.config.xaxis.tickAmount&&(i=s.config.xaxis.tickAmount),w.length>i&&(e=Math.floor(w.length/i));let o=!1,r=!1;switch(this.tickInterval){case"years":"year"===t.unit&&(o=!0);break;case"half_year":e=7,"year"===t.unit&&(o=!0);break;case"months":e=1,"year"===t.unit&&(o=!0);break;case"months_fortnight":e=15,"year"!==t.unit&&"month"!==t.unit||(o=!0),30===a&&(r=!0);break;case"months_days":e=10,"month"===t.unit&&(o=!0),30===a&&(r=!0);break;case"week_days":e=8,"month"===t.unit&&(o=!0);break;case"days":e=1,"month"===t.unit&&(o=!0);break;case"hours":"day"===t.unit&&(o=!0);break;case"minutes_fives":case"seconds_fives":a%5!=0&&(r=!0);break;case"seconds_tens":a%10!=0&&(r=!0)}if("hours"===this.tickInterval||"minutes_fives"===this.tickInterval||"seconds_tens"===this.tickInterval||"seconds_fives"===this.tickInterval){if(!r)return!0}else if((a%e===0||o)&&!r)return!0})}recalcDimensionsBasedOnFormat(t){const e=this.w,s=this.formatDates(t),i=this.removeOverlappingTS(s);e.globals.timescaleLabels=i.slice(),new nt(this.ctx).plotCoords()}determineInterval(t){const e=24*t,s=60*e;switch(!0){case t/365>5:this.tickInterval="years";break;case t>800:this.tickInterval="half_year";break;case t>180:this.tickInterval="months";break;case t>90:this.tickInterval="months_fortnight";break;case t>60:this.tickInterval="months_days";break;case t>30:this.tickInterval="week_days";break;case t>2:this.tickInterval="days";break;case e>2.4:this.tickInterval="hours";break;case s>15:this.tickInterval="minutes_fives";break;case s>5:this.tickInterval="minutes";break;case s>1:this.tickInterval="seconds_tens";break;case 60*s>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds"}}generateYearScale({firstVal:t,currentMonth:e,currentYear:s,daysWidthOnXAxis:i,numberOfYears:a}){let o=t.minYear,r=0;const l=new S(this.ctx);let n="year";if(t.minDate>1||t.minMonth>0){let s=l.determineRemainingDaysOfYear(t.minYear,t.minMonth,t.minDate);r=(l.determineDaysOfYear(t.minYear)-s+1)*i,o=t.minYear+1,this.timeScaleArray.push({position:r,value:o,unit:n,year:o,month:u.monthMod(e+1)})}else 1===t.minDate&&0===t.minMonth&&this.timeScaleArray.push({position:r,value:o,unit:n,year:s,month:u.monthMod(e+1)});let h=o,c=r;for(let t=0;t<a;t++)h++,c=l.determineDaysOfYear(h-1)*i+c,this.timeScaleArray.push({position:c,value:h,unit:n,year:h,month:1})}generateMonthScale({firstVal:t,currentMonthDate:e,currentMonth:s,currentYear:i,daysWidthOnXAxis:a,numberOfMonths:o}){let r=s,l=0;const n=new S(this.ctx);let h="month",c=0;if(t.minDate>1){l=(n.determineDaysOfMonths(s+1,t.minYear)-e+1)*a,r=u.monthMod(s+1);let o=i+c,d=u.monthMod(r),g=r;0===r&&(h="year",g=o,d=1,c+=1,o+=c),this.timeScaleArray.push({position:l,value:g,unit:h,year:o,month:d})}else this.timeScaleArray.push({position:l,value:r,unit:h,year:i,month:u.monthMod(s)});let d=r+1,g=l;for(let t=0,e=1;t<o;t++,e++){d=u.monthMod(d),0===d?(h="year",c+=1):h="month";let t=this._getYear(i,d,c);g=n.determineDaysOfMonths(d,t)*a+g;let e=0===d?t:d;this.timeScaleArray.push({position:g,value:e,unit:h,year:t,month:0===d?1:d}),d++}}generateDayScale({firstVal:t,currentMonth:e,currentYear:s,hoursWidthOnXAxis:i,numberOfDays:a}){const o=new S(this.ctx);let r="day",l=t.minDate+1,n=l;const h=(t,e,s)=>t>o.determineDaysOfMonths(e+1,s)?(n=1,r="month",d=e+=1,e):e;let c=(24-t.minHour)*i,d=l,g=h(n,e,s);0===t.minHour&&1===t.minDate?(c=0,d=u.monthMod(t.minMonth),r="month",n=t.minDate):1!==t.minDate&&0===t.minHour&&0===t.minMinute&&(c=0,l=t.minDate,n=l,d=l,g=h(n,e,s),1!==d&&(r="day")),this.timeScaleArray.push({position:c,value:d,unit:r,year:this._getYear(s,g,0),month:u.monthMod(g),day:n});let p=c;for(let t=0;t<a;t++){n+=1,r="day",g=h(n,g,this._getYear(s,g,0));let t=this._getYear(s,g,0);p=24*i+p;let e=1===n?u.monthMod(g):n;this.timeScaleArray.push({position:p,value:e,unit:r,year:t,month:u.monthMod(g),day:e})}}generateHourScale({firstVal:t,currentDate:e,currentMonth:s,currentYear:i,minutesWidthOnXAxis:a,numberOfHours:o}){const r=new S(this.ctx);let l="hour";const n=(t,e)=>(t>r.determineDaysOfMonths(e+1,i)&&(x=1,e+=1),{month:e,date:x}),h=(t,e)=>t>r.determineDaysOfMonths(e+1,i)?e+=1:e;let c=60-(t.minMinute+t.minSecond/60),d=c*a,g=t.minHour+1,p=g;60===c&&(d=0,g=t.minHour,p=g);let x=e;p>=24&&(p=0,x+=1,l="day",g=x);let b=n(x,s).month;b=h(x,b),g>31&&(x=1,g=x),this.timeScaleArray.push({position:d,value:g,unit:l,day:x,hour:p,year:i,month:u.monthMod(b)}),p++;let f=d;for(let t=0;t<o;t++){if(l="hour",p>=24){p=0,x+=1,l="day";b=n(x,b).month,b=h(x,b)}let t=this._getYear(i,b,0);f=60*a+f;let e=0===p?x:p;this.timeScaleArray.push({position:f,value:e,unit:l,hour:p,day:x,year:t,month:u.monthMod(b)}),p++}}generateMinuteScale({currentMillisecond:t,currentSecond:e,currentMinute:s,currentHour:i,currentDate:a,currentMonth:o,currentYear:r,minutesWidthOnXAxis:l,secondsWidthOnXAxis:n,numberOfMinutes:h}){let c=s+1,d=a,g=o,p=r,x=i,b=(60-e-t/1e3)*n;for(let t=0;t<h;t++)c>=60&&(c=0,x+=1,24===x&&(x=0)),this.timeScaleArray.push({position:b,value:c,unit:"minute",hour:x,minute:c,day:d,year:this._getYear(p,g,0),month:u.monthMod(g)}),b+=l,c++}generateSecondScale({currentMillisecond:t,currentSecond:e,currentMinute:s,currentHour:i,currentDate:a,currentMonth:o,currentYear:r,secondsWidthOnXAxis:l,numberOfSeconds:n}){let h=e+1,c=s,d=a,g=o,p=r,x=i,b=(1e3-t)/1e3*l;for(let t=0;t<n;t++)h>=60&&(c++,h=0,c>=60&&(x++,c=0,24===x&&(x=0))),this.timeScaleArray.push({position:b,value:h,unit:"second",hour:x,minute:c,second:h,day:d,year:this._getYear(p,g,0),month:u.monthMod(g)}),b+=l,h++}createRawDateString(t,e){let s=t.year;return 0===t.month&&(t.month=1),s+="-"+("0"+t.month.toString()).slice(-2),"day"===t.unit?s+="day"===t.unit?"-"+("0"+e).slice(-2):"-01":s+="-"+("0"+(t.day?t.day:"1")).slice(-2),"hour"===t.unit?s+="hour"===t.unit?"T"+("0"+e).slice(-2):"T00":s+="T"+("0"+(t.hour?t.hour:"0")).slice(-2),"minute"===t.unit?s+=":"+("0"+e).slice(-2):s+=":"+(t.minute?("0"+t.minute).slice(-2):"00"),"second"===t.unit?s+=":"+("0"+e).slice(-2):s+=":00",this.utc&&(s+=".000Z"),s}formatDates(t){const e=this.w;return t.map(t=>{let s=t.value.toString(),i=new S(this.ctx);const a=this.createRawDateString(t,s);let o=i.getDate(i.parseDate(a));if(this.utc||(o=i.getDate(i.parseDateWithTimezone(a))),void 0===e.config.xaxis.labels.format){let a="dd MMM";const r=e.config.xaxis.labels.datetimeFormatter;"year"===t.unit&&(a=r.year),"month"===t.unit&&(a=r.month),"day"===t.unit&&(a=r.day),"hour"===t.unit&&(a=r.hour),"minute"===t.unit&&(a=r.minute),"second"===t.unit&&(a=r.second),s=i.formatDate(o,a)}else s=i.formatDate(o,e.config.xaxis.labels.format);return{dateString:a,position:t.position,value:s,unit:t.unit,year:t.year,month:t.month}})}removeOverlappingTS(t){const e=new w(this.ctx);let s,i=!1;t.length>0&&t[0].value&&t.every(e=>e.value.length===t[0].value.length)&&(i=!0,s=e.getTextRects(t[0].value).width);let a=0,o=t.map((o,r)=>{if(r>0&&this.w.config.xaxis.labels.hideOverlappingLabels){const l=i?s:e.getTextRects(t[a].value).width,n=t[a].position;return o.position>n+l+10?(a=r,o):null}return o});return o=o.filter(t=>null!==t),o}_getYear(t,e,s){return t+Math.floor(e/12)+s}}class Kt{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){let e,s,{x:i,y:a,y1:o,y2:r,i:h,j:c,realIndex:d,columnGroupIndex:g,series:p,barHeight:x,barWidth:b,barXPosition:f,barYPosition:u,visibleSeries:m}=t,y=this.w,v=new w(this.barCtx.ctx),A=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[d]:this.barCtx.strokeWidth;y.globals.isXNumeric&&!y.globals.isBarHorizontal?(e=i+parseFloat(b*(m+1)),s=a+parseFloat(x*(m+1))-A):(e=i+parseFloat(b*m),s=a+parseFloat(x*m));let C=null,S=null,k=i,L=a,M={},P=y.config.dataLabels,I=this.barCtx.barOptions.dataLabels,T=this.barCtx.barOptions.dataLabels.total;void 0!==u&&this.barCtx.isRangeBar&&(s=u,L=u),void 0!==f&&this.barCtx.isVerticalGroupedRangeBar&&(e=f,k=f);const X=P.offsetX,z=P.offsetY;let E={width:0,height:0};if(y.config.dataLabels.enabled){const t=y.globals.series[h][c];E=v.getTextRects(y.config.dataLabels.formatter?y.config.dataLabels.formatter(t,n(l({},y),{seriesIndex:h,dataPointIndex:c,w:y})):y.globals.yLabelFormatters[0](t),parseFloat(P.style.fontSize))}const Y={x:i,y:a,i:h,j:c,realIndex:d,columnGroupIndex:g,bcx:e,bcy:s,barHeight:x,barWidth:b,textRects:E,strokeWidth:A,dataLabelsX:k,dataLabelsY:L,dataLabelsConfig:P,barDataLabelsConfig:I,barTotalDataLabelsConfig:T,offX:X,offY:z};return M=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(Y):this.calculateColumnsDataLabelsPosition(Y),C=this.drawCalculatedDataLabels({x:M.dataLabelsX,y:M.dataLabelsY,val:this.barCtx.isRangeBar?[o,r]:"100%"===y.config.chart.stackType?p[d][c]:y.globals.series[d][c],i:d,j:c,barWidth:b,barHeight:x,textRects:E,dataLabelsConfig:P}),y.config.chart.stacked&&T.enabled&&(S=this.drawTotalDataLabels({x:M.totalDataLabelsX,y:M.totalDataLabelsY,barWidth:b,barHeight:x,realIndex:d,textAnchor:M.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:d,j:c}),dataLabelsConfig:P,barTotalDataLabelsConfig:T})),{dataLabelsPos:M,dataLabels:C,totalDataLabels:S}}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let i=this.barCtx.stackedSeriesTotals[e];return this.totalFormatter&&(i=this.totalFormatter(i,n(l({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),i}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,i,{i:a,j:o,realIndex:r,y:l,bcx:n,barWidth:h,barHeight:c,textRects:d,dataLabelsX:g,dataLabelsY:p,dataLabelsConfig:x,barDataLabelsConfig:b,barTotalDataLabelsConfig:f,strokeWidth:u,offX:m,offY:y}=t,v=n;c=Math.abs(c);let A="vertical"===e.config.plotOptions.bar.dataLabels.orientation;const{zeroEncounters:C}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:o});n-=u/2;let S=e.globals.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?g+=h/2:(g=e.globals.isXNumeric?n-h/2+m:n-S+h/2+m,!e.config.chart.stacked&&C>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g-=h*C)),A){const t=2;g=g+d.height/2-u/2-t}let k=e.globals.series[a][o]<0,L=l;switch(this.barCtx.isReversed&&(L=l+(k?c:-c)),b.position){case"center":p=A?k?L-c/2+y:L+c/2-y:k?L-c/2+d.height/2+y:L+c/2+d.height/2-y;break;case"bottom":p=A?k?L-c+y:L+c-y:k?L-c+d.height+u+y:L+c-d.height/2+u-y;break;case"top":p=A?k?L+y:L-y:k?L-d.height/2-y:L+d.height+y}let M=L;if(e.globals.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{M=k?Math.max(t[o],M):Math.min(t[o],M)})}),this.barCtx.lastActiveBarSerieIndex===r&&f.enabled){const t=18,a=new w(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:r,j:o}),x.fontSize);s=k?M-a.height/2-y-f.offsetY+t:M+a.height+y+f.offsetY-t;let l=S;i=v+(e.globals.isXNumeric?-h*e.globals.barGroups.length/2:e.globals.barGroups.length*h/2-(e.globals.barGroups.length-1)*h-l)+f.offsetX}return e.config.chart.stacked||(p<0?p=0+u:p+d.height/3>e.globals.gridHeight&&(p=e.globals.gridHeight-u)),{bcx:n,bcy:l,dataLabelsX:g,dataLabelsY:p,totalDataLabelsX:i,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){const e=this.w;let{x:s,i:i,j:a,realIndex:o,bcy:r,barHeight:l,barWidth:n,textRects:h,dataLabelsX:c,strokeWidth:d,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:b,offY:f}=t,u=e.globals.gridHeight/e.globals.dataPoints;const{zeroEncounters:m}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:a});n=Math.abs(n);let y,v,A=r-(this.barCtx.isRangeBar?0:u)+l/2+h.height/2+f-3;!e.config.chart.stacked&&m>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(A-=l*m);let C="start",S=e.globals.series[i][a]<0,k=s;switch(this.barCtx.isReversed&&(k=s+(S?-n:n),C=S?"start":"end"),p.position){case"center":c=S?k+n/2-b:Math.max(h.width/2,k-n/2)+b;break;case"bottom":c=S?k+n-d-b:k-n+d+b;break;case"top":c=S?k-d-b:k-d+b}let L=k;if(e.globals.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{L=S?Math.min(t[a],L):Math.max(t[a],L)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){const t=new w(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:a}),g.fontSize);S?(y=L-d-b-x.offsetX,C="end"):y=L+b+x.offsetX+(this.barCtx.isReversed?-(n+d):d),v=A-h.height/2+t.height/2+x.offsetY+d,e.globals.barGroups.length>1&&(v-=e.globals.barGroups.length/2*(l/2))}return e.config.chart.stacked||("start"===g.textAnchor?c-h.width<0?c=S?h.width+d:d:c+h.width>e.globals.gridWidth&&(c=S?e.globals.gridWidth-d:e.globals.gridWidth-h.width-d):"middle"===g.textAnchor?c-h.width/2<0?c=h.width/2+d:c+h.width/2>e.globals.gridWidth&&(c=e.globals.gridWidth-h.width/2-d):"end"===g.textAnchor&&(c<1?c=h.width+d:c+1>e.globals.gridWidth&&(c=e.globals.gridWidth-h.width-d))),{bcx:s,bcy:r,dataLabelsX:c,dataLabelsY:A,totalDataLabelsX:y,totalDataLabelsY:v,totalDataLabelsAnchor:C}}drawCalculatedDataLabels({x:t,y:e,val:s,i:i,j:a,textRects:o,barHeight:r,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 N(this.barCtx.ctx),x=new w(this.barCtx.ctx),b=c.formatter;let f=null;const u=d.globals.collapsedSeriesIndices.indexOf(i)>-1;if(c.enabled&&!u){f=x.group({class:"apexcharts-data-labels",transform:g});let u="";void 0!==s&&(u=b(s,n(l({},d),{seriesIndex:i,dataPointIndex:a,w:d}))),!s&&d.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u="");let m=d.globals.series[i][a]<0,y=d.config.plotOptions.bar.dataLabels.position;if("vertical"===d.config.plotOptions.bar.dataLabels.orientation&&("top"===y&&(c.textAnchor=m?"end":"start"),"center"===y&&(c.textAnchor="middle"),"bottom"===y&&(c.textAnchor=m?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<x.getTextRects(u,parseFloat(c.style.fontSize)).width&&(u="")}d.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?o.width/1.6>Math.abs(h)&&(u=""):o.height/1.6>Math.abs(r)&&(u=""));let w=l({},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:u,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:o}){const r=new w(this.barCtx.ctx);let l;return o.enabled&&void 0!==t&&void 0!==e&&this.barCtx.lastActiveBarSerieIndex===i&&(l=r.drawText({x:t,y:e,foreColor:o.style.color,text:s,textAnchor:a,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight})),l}}let Qt=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.globals.isXNumeric)for(let i=0;i<t[s].length;i++)e.globals.seriesX[s][i]>e.globals.minX&&e.globals.seriesX[s][i]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.globals.series),u.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){let e,s,i,a,o,r,l,n,h=this.w,c=h.globals.dataPoints;this.barCtx.isRangeBar&&(c=h.globals.labels.length);let d=this.barCtx.seriesLen;if(h.config.plotOptions.bar.rangeBarGroupRows&&(d=1),this.barCtx.isHorizontal)i=h.globals.gridHeight/c,o=i/d,h.globals.isXNumeric&&(i=h.globals.gridHeight/this.barCtx.totalItems,o=i/this.barCtx.seriesLen),o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),n=this.barCtx.baseLineInvertedY+h.globals.padHorizontal+(this.barCtx.isReversed?h.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(n=h.globals.gridWidth/2),s=(i-o*this.barCtx.seriesLen)/2;else{if(a=h.globals.gridWidth/this.barCtx.visibleItems,h.config.xaxis.convertedCatToNumeric&&(a=h.globals.gridWidth/h.globals.dataPoints),r=a/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,h.globals.isXNumeric){let t=this.barCtx.xRatio;h.globals.minXDiff&&.5!==h.globals.minXDiff&&h.globals.minXDiff/t>0&&(a=h.globals.minXDiff/t),r=a/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,r<1&&(r=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(r=parseInt(this.barCtx.barOptions.columnWidth,10)),l=h.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?h.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),h.globals.isXNumeric){e=this.barCtx.getBarXForNumericXAxis({x:e,j:0,realIndex:t,barWidth:r}).x}else e=h.globals.padHorizontal+u.noExponents(a-r*this.barCtx.seriesLen)/2}return h.globals.barHeight=o,h.globals.barWidth=r,{x:e,y:s,yDivision:i,xDivision:a,barHeight:o,barWidth:r,zeroH:l,zeroW:n}}initializeStackedPrevVars(t){t.w.globals.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.globals.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,o,r,l;const n=this.w;let h=this.barCtx.ctx.fill,c=null,d=this.barCtx.barOptions.distributed?s:e,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=n.config.series[e].data[s])?void 0:a.fill,fillType:(null==(r=null==(o=n.config.series[e].data[s])?void 0:o.fill)?void 0:r.type)?null==(l=n.config.series[e].data[s])?void 0:l.fill.type:Array.isArray(n.config.fill.type)?n.config.fill.type[i]:n.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,o=0|(null==(e=t[0])?void 0:e.length),r=Array.from({length:a},()=>Array(o).fill(i?"top":"none"));if(i)return r;const l=this.w.config.chart.type;for(let e=0;e<o;e++){let s=[],i=[],n=0;for(let o=0;o<a;o++){const a=t[o][e];a>0?(s.push(o),n++):a<0&&(i.push(o),n++)}if(s.length>0&&0===i.length)if(1===s.length)r[s[0]][e]="bar"===l&&1===o?"top":"both";else{const t=s[0],i=s[s.length-1];for(let a of s)r[a][e]=a===t?"bar"===l&&1===o?"top":"bottom":a===i?"top":"none"}else if(i.length>0&&0===s.length)if(1===i.length)r[i[0]][e]="both";else{const t=Math.max(...i),s=Math.min(...i);for(let a of i)r[a][e]=a===t?"bottom":a===s?"top":"none"}else if(s.length>0&&i.length>0){const t=s[s.length-1];for(let i of s)r[i][e]=i===t?"top":"none";const a=Math.max(...i);for(let t of i)r[t][e]=t===a?"bottom":"none"}else if(1===n){r[s[0]||i[0]][e]="both"}}return r}barBackground({j:t,i:e,x1:s,x2:i,y1:a,y2:o,elSeries:r}){const l=this.w,n=new w(this.barCtx.ctx);let h=new G(this.barCtx.ctx).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);let e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=n.drawRect(void 0!==s?s:0,void 0!==a?a:0,void 0!==i?i:l.globals.gridWidth,void 0!==o?o:l.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);r.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:i,strokeWidth:a,isReversed:o,series:r,seriesGroup:l,realIndex:n,i:h,j:c,w:d}){var g;const p=new w(this.barCtx.ctx);(a=Array.isArray(a)?a[n]:a)||(a=0);let x=t,b=e;(null==(g=d.config.series[n].data[c])?void 0:g.columnWidthOffset)&&(b=e-d.config.series[n].data[c].columnWidthOffset/2,x=t+d.config.series[n].data[c].columnWidthOffset);let f=a/2;const u=b+f,m=b+x-f;let y=(r[h][c]>=0?1:-1)*(o?-1:1);s+=.001-f*y,i+=.001+f*y;let v=p.move(u,s),A=p.move(u,s);const C=p.line(m,s);if(d.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(n,c,!1)),v=v+p.line(u,i)+p.line(m,i)+C+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][c]?" Z":" z"),A=A+p.line(u,s)+C+C+C+C+C+p.line(u,s)+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][c]?" Z":" z"),"none"!==this.arrBorderRadius[n][c]&&(v=p.roundPathCorners(v,d.config.plotOptions.bar.borderRadius)),d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.yArrj.push(i-f*y),t.yArrjF.push(Math.abs(s-i+a*y)),t.yArrjVal.push(this.barCtx.series[h][c])}return{pathTo:v,pathFrom:A}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:i,strokeWidth:a,isReversed:o,series:r,seriesGroup:l,realIndex:n,i:h,j:c,w:d}){var g;const p=new w(this.barCtx.ctx);(a=Array.isArray(a)?a[n]:a)||(a=0);let x=t,b=e;(null==(g=d.config.series[n].data[c])?void 0:g.barHeightOffset)&&(x=t-d.config.series[n].data[c].barHeightOffset/2,b=e+d.config.series[n].data[c].barHeightOffset);let f=a/2;const u=x+f,m=x+b-f;let y=(r[h][c]>=0?1:-1)*(o?-1:1);s+=.001+f*y,i+=.001-f*y;let v=p.move(s,u),A=p.move(s,u);d.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(n,c,!1));const C=p.line(s,m);if(v=v+p.line(i,u)+p.line(i,m)+C+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][c]?" Z":" z"),A=A+p.line(s,u)+C+C+C+C+C+p.line(s,u)+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][c]?" Z":" z"),"none"!==this.arrBorderRadius[n][c]&&(v=p.roundPathCorners(v,d.config.plotOptions.bar.borderRadius)),d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.xArrj.push(i+f*y),t.xArrjF.push(Math.abs(s-i-a*y)),t.xArrjVal.push(this.barCtx.series[h][c])}return{pathTo:v,pathFrom:A}}checkZeroSeries({series:t}){let 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,o){const r=this.w;let h=[];const c=(i,a)=>{h.push({[t]:"x"===t?this.getXForValue(i,e,!1):this.getYForValue(i,s,o,!1),attrs:a})};if(r.globals.seriesGoals[i]&&r.globals.seriesGoals[i][a]&&Array.isArray(r.globals.seriesGoals[i][a])&&r.globals.seriesGoals[i][a].forEach(t=>{c(t.value,t)}),this.barCtx.barOptions.isDumbbell&&r.globals.seriesRange.length){let e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:r.globals.colors;const s={strokeHeight:"x"===t?0:r.globals.markers.size[i],strokeWidth:"x"===t?r.globals.markers.size[i]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[i])?e[i][0]:e[i]};c(r.globals.seriesRangeStart[i][a],s),c(r.globals.seriesRangeEnd[i][a],n(l({},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:o}){let r=new w(this.barCtx.ctx);const l=r.group({className:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let n=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=r.w.globals.gridWidth+1){let s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:o/2,i=e+s+o/2;n=r.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),l.add(n)}}):Array.isArray(i)&&i.forEach(e=>{if(e.y>=-1&&e.y<=r.w.globals.gridHeight+1){let s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:a/2,i=t+s+a/2;n=r.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),l.add(n)}}),l}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:i,j:a}){const o=this.w,{x:r,x1:l,barYPosition:n}=t,{x:h,x1:c,barYPosition:d}=e,g=n+e.barHeight,p=new w(this.barCtx.ctx),x=new u,b=p.move(l,g)+p.line(r,g)+p.line(h,d)+p.line(c,d)+p.line(l,g)+("around"===o.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[i][a]?" Z":" z");return p.drawPath({d:b,fill:x.shadeColor(.5,u.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,o=0;return(i.config.plotOptions.bar.horizontal?i.globals.series.map((t,e)=>e):(null==(s=i.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{let r=i.globals.seriesPercent[s][e];r&&a++,s<t&&0===r&&o++}),{nonZeroColumns:a,zeroEncounters:o}}getGroupIndex(t){const e=this.w;let s=e.globals.seriesGroups.findIndex(s=>s.indexOf(e.globals.seriesNames[t])>-1),i=this.barCtx.columnGroupIndices,a=i.indexOf(s);return a<0&&(i.push(s),a=i.length-1),{groupIndex:s,columnGroupIndex:a}}};class te{constructor(t,e){this.ctx=t,this.w=t.w;const s=this.w;this.barOptions=s.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=s.config.stroke.width,this.isNullValue=!1,this.isRangeBar=s.globals.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!s.globals.isBarHorizontal&&s.globals.seriesRange.length&&s.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.xyRatios=e,null!==this.xyRatios&&(this.xRatio=e.xRatio,this.yRatio=e.yRatio,this.invertedXRatio=e.invertedXRatio,this.invertedYRatio=e.invertedYRatio,this.baseLineY=e.baseLineY,this.baseLineInvertedY=e.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[];const i=new G(this.ctx);this.lastActiveBarSerieIndex=i.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];const a=i.getBarSeriesIndices(),o=new v(this.ctx);this.stackedSeriesTotals=o.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===a.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new Qt(this)}draw(t,e){var s;let i=this.w,a=new w(this.ctx);const o=new v(this.ctx);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);let r=a.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let o=0,h=0;o<t.length;o++,h++){let c,d,g,p,x,b,f=[],m=[],w=i.globals.comboCharts?e[o]:o,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(w),A=a.group({class:"apexcharts-series",rel:o+1,seriesName:u.escapeString(i.globals.seriesNames[w]),"data:realIndex":w});this.ctx.series.addCollapsedClassToSeries(A,w),t[o].length>0&&(this.visibleI=this.visibleI+1);let C=0,S=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[w],this.translationsIndex=w);let k=this.translationsIndex;this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed;let L=this.barHelpers.initialPositions(w);d=L.y,C=L.barHeight,p=L.yDivision,b=L.zeroW,c=L.x,S=L.barWidth,g=L.xDivision,x=L.zeroH,this.isHorizontal||m.push(c+S/2);let M=a.group({class:"apexcharts-datalabels","data:realIndex":w});i.globals.delayedElements.push({el:M.node}),M.node.classList.add("apexcharts-element-hidden");let P=a.group({class:"apexcharts-bar-goals-markers"}),I=a.group({class:"apexcharts-bar-shadows"});i.globals.delayedElements.push({el:I.node}),I.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[o].length;e++){const a=this.barHelpers.getStrokeWidth(o,e,w);let r=null;const L={indexes:{i:o,j:e,realIndex:w,translationsIndex:k,bc:h},x:c,y:d,strokeWidth:a,elSeries:A};this.isHorizontal?(r=this.drawBarPaths(n(l({},L),{barHeight:C,zeroW:b,yDivision:p})),S=this.series[o][e]/this.invertedYRatio):(r=this.drawColumnPaths(n(l({},L),{xDivision:g,barWidth:S,zeroH:x})),C=this.series[o][e]/this.yRatio[k]);let T=this.barHelpers.getPathFillColor(t,o,e,w);if(this.isFunnel&&this.barOptions.isFunnel3d&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof T.color&&-1===(null==(s=T.color)?void 0:s.indexOf("url"))?T.color:u.hexToRgba(i.globals.colors[o]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:r,realIndex:w,j:e});if(I.add(t),i.config.chart.dropShadow.enabled){new y(this.ctx).dropShadow(t,i.config.chart.dropShadow,w)}}this.pathArr.push(r);const X=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:r.barYPosition,goalX:r.goalX,goalY:r.goalY,barHeight:C,barWidth:S});X&&P.add(X),d=r.y,c=r.x,e>0&&m.push(c+S/2),f.push(d),this.renderSeries(n(l({realIndex:w,pathFill:T.color},T.useRangeColor?{lineFill:T.color}:{}),{j:e,i:o,columnGroupIndex:v,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:a,elSeries:A,x:c,y:d,series:t,barHeight:Math.abs(r.barHeight?r.barHeight:C),barWidth:Math.abs(r.barWidth?r.barWidth:S),elDataLabelsWrap:M,elGoalsMarkers:P,elBarShadows:I,visibleSeries:this.visibleI,type:"bar"}))}i.globals.seriesXvalues[w]=m,i.globals.seriesYvalues[w]=f,r.add(A)}return r}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:i,i:a,columnGroupIndex:o,pathFrom:r,pathTo:l,strokeWidth:n,elSeries:h,x:c,y:d,y1:g,y2:p,series:x,barHeight:b,barWidth:f,barXPosition:u,barYPosition:m,elDataLabelsWrap:v,elGoalsMarkers:A,elBarShadows:C,visibleSeries:S,type:k,classes:L}){const M=this.w,P=new w(this.ctx);let I=!1;if(h._bindingsDelegated||(h._bindingsDelegated=!0,P.setupEventDelegation(h,`.apexcharts-${k}-area`)),!s){let e=function(t){const e=M.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:M.globals.series[t][i],dataPointIndex:i,w:M}):s};const a="function"==typeof M.globals.stroke.colors[t]?e(t):M.globals.stroke.colors[t];s=this.barOptions.distributed?M.globals.stroke.colors[i]:a}let T=new Kt(this).handleBarDataLabels({x:c,y:d,y1:g,y2:p,i:a,j:i,series:x,realIndex:t,columnGroupIndex:o,barHeight:b,barWidth:f,barXPosition:u,barYPosition:m,visibleSeries:S});M.globals.isBarHorizontal||(T.dataLabelsPos.dataLabelsX+Math.max(f,M.globals.barPadForNumericAxis)<0||T.dataLabelsPos.dataLabelsX-Math.max(f,M.globals.barPadForNumericAxis)>M.globals.gridWidth)&&(I=!0),M.config.series[a].data[i]&&M.config.series[a].data[i].strokeColor&&(s=M.config.series[a].data[i].strokeColor),this.isNullValue&&(e="none");let X=i/M.config.chart.animations.animateGradually.delay*(M.config.chart.animations.speed/M.globals.dataPoints)/2.4;if(!I){let o=P.renderPaths({i:a,j:i,realIndex:t,pathFrom:r,pathTo:l,stroke:s,strokeWidth:n,strokeLineCap:M.config.stroke.lineCap,fill:e,animationDelay:X,initialSpeed:M.config.chart.animations.speed,dataChangeSpeed:M.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${k}-area ${L}`,chartType:k,bindEventsOnPaths:!1});o.attr("clip-path",`url(#gridRectBarMask${M.globals.cuid})`);const c=M.config.forecastDataPoints;c.count>0&&i>=M.globals.dataPoints-c.count&&(o.node.setAttribute("stroke-dasharray",c.dashArray),o.node.setAttribute("stroke-width",c.strokeWidth),o.node.setAttribute("fill-opacity",c.fillOpacity)),void 0!==g&&void 0!==p&&(o.attr("data-range-y1",g),o.attr("data-range-y2",p));new y(this.ctx).setSelectionFilter(o,t,i),h.add(o),o.attr({cy:T.dataLabelsPos.bcy,cx:T.dataLabelsPos.bcx,j:i,val:M.globals.series[a][i],barHeight:b,barWidth:f}),null!==T.dataLabels&&v.add(T.dataLabels),T.totalDataLabels&&v.add(T.totalDataLabels),h.add(v),A&&h.add(A),C&&h.add(C)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:o,yDivision:r,elSeries:l}){let n,h=this.w,c=t.i,d=t.j;if(h.globals.isXNumeric)n=(o=(h.globals.seriesX[c][d]-h.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(h.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:c,j:d});t>0&&(e=this.seriesLen*e/t),n=o+e*this.visibleI,n-=e*s}else n=o+e*this.visibleI;this.isFunnel&&(i-=(this.barHelpers.getXForValue(this.series[c][d],i)-i)/2),a=this.barHelpers.getXForValue(this.series[c][d],i);const g=this.barHelpers.getBarpaths({barYPosition:n,barHeight:e,x1:i,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:c,j:d,w:h});return h.globals.isXNumeric||(o+=r),this.barHelpers.barBackground({j:d,i:c,y1:n-e*this.visibleI,y2:e*this.seriesLen,elSeries:l}),{pathTo:g.pathTo,pathFrom:g.pathFrom,x1:i,x:a,y:o,goalX:this.barHelpers.getGoalValues("x",i,null,c,d),barYPosition:n,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:o,strokeWidth:r,elSeries:l}){let n,h=this.w,c=t.realIndex,d=t.translationsIndex,g=t.i,p=t.j,x=t.bc;if(h.globals.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:p,realIndex:c,barWidth:a});e=t.x,n=t.barXPosition}else if(h.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:g,j:p});t>0&&(a=this.seriesLen*a/t),n=e+a*this.visibleI,n-=a*s}else n=e+a*this.visibleI;s=this.barHelpers.getYForValue(this.series[g][p],o,d);const b=this.barHelpers.getColumnPaths({barXPosition:n,barWidth:a,y1:o,y2:s,strokeWidth:r,isReversed:this.isReversed,series:this.series,realIndex:c,i:g,j:p,w:h});return h.globals.isXNumeric||(e+=i),this.barHelpers.barBackground({bc:x,j:p,i:g,x1:n-r/2-a*this.visibleI,x2:a*this.seriesLen+r/2,elSeries:l}),{pathTo:b.pathTo,pathFrom:b.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,o,g,p,d),barXPosition:n,barWidth:a}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:i}){const a=this.w;let o=s;return a.globals.seriesX[s].length||(o=a.globals.maxValsInArrayIndex),u.isNumber(a.globals.seriesX[o][i])&&(t=(a.globals.seriesX[o][i]-a.globals.minX)/this.xRatio-e*this.seriesLen/2),{barXPosition:t+e*this.visibleI,x:t}}getPreviousPath(t,e){let s=this.w,i="M 0 0";for(let a=0;a<s.globals.previousPaths.length;a++){let o=s.globals.previousPaths[a];o.paths&&o.paths.length>0&&parseInt(o.realIndex,10)===parseInt(t,10)&&void 0!==s.globals.previousPaths[a].paths[e]&&(i=s.globals.previousPaths[a].paths[e].d)}return i}}class ee extends te{draw(t,e){let s=this.w;this.graphics=new w(this.ctx),this.bar=new te(this.ctx,this.xyRatios);const i=new v(this.ctx);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);let a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),o=0,r=0;for(let i=0,h=0;i<t.length;i++,h++){let c,d,g,p,x=s.globals.comboCharts?e[i]:i,{groupIndex:b,columnGroupIndex:f}=this.barHelpers.getGroupIndex(x);this.groupCtx=this[s.globals.seriesGroups[b]];let m=[],y=[],w=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[x][0],w=x),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let v=this.graphics.group({class:"apexcharts-series",seriesName:u.escapeString(s.globals.seriesNames[x]),rel:i+1,"data:realIndex":x});this.ctx.series.addCollapsedClassToSeries(v,x);let A=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":x}),C=this.graphics.group({class:"apexcharts-bar-goals-markers"}),S=0,k=0,L=this.initialPositions(o,r,c,d,g,p,w);r=L.y,S=L.barHeight,d=L.yDivision,p=L.zeroW,o=L.x,k=L.barWidth,c=L.xDivision,g=L.zeroH,s.globals.barHeight=S,s.globals.barWidth=k,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(()=>g),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,x),u={indexes:{i:i,j:e,realIndex:x,translationsIndex:w,bc:h},strokeWidth:a,x:o,y:r,elSeries:v,columnGroupIndex:f,seriesGroup:s.globals.seriesGroups[b]};let L=null;this.isHorizontal?(L=this.drawStackedBarPaths(n(l({},u),{zeroW:p,barHeight:S,yDivision:d})),k=this.series[i][e]/this.invertedYRatio):(L=this.drawStackedColumnPaths(n(l({},u),{xDivision:c,barWidth:k,zeroH:g})),S=this.series[i][e]/this.yRatio[w]);const M=this.barHelpers.drawGoalLine({barXPosition:L.barXPosition,barYPosition:L.barYPosition,goalX:L.goalX,goalY:L.goalY,barHeight:S,barWidth:k});M&&C.add(M),r=L.y,o=L.x,m.push(o),y.push(r);let P=this.barHelpers.getPathFillColor(t,i,e,x),I="";const T=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y";("bottom"===this.barHelpers.arrBorderRadius[x][e]&&s.globals.series[x][e]>0||"top"===this.barHelpers.arrBorderRadius[x][e]&&s.globals.series[x][e]<0)&&(I=T),v=this.renderSeries(n(l({realIndex:x,pathFill:P.color},P.useRangeColor?{lineFill:P.color}:{}),{j:e,i:i,columnGroupIndex:f,pathFrom:L.pathFrom,pathTo:L.pathTo,strokeWidth:a,elSeries:v,x:o,y:r,series:t,barHeight:S,barWidth:k,elDataLabelsWrap:A,elGoalsMarkers:C,type:"bar",visibleSeries:f,classes:I}))}s.globals.seriesXvalues[x]=m,s.globals.seriesYvalues[x]=y,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(v)}return a}initialPositions(t,e,s,i,a,o,r){let l,n,h=this.w;if(this.isHorizontal){i=h.globals.gridHeight/h.globals.dataPoints;let t=h.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):i*parseInt(t,10)/100,o=h.globals.padHorizontal+(this.isReversed?h.globals.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(i-l)/2}else{n=s=h.globals.gridWidth/h.globals.dataPoints;let e=h.config.plotOptions.bar.columnWidth;h.globals.isXNumeric&&h.globals.dataPoints>1?n=(s=h.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:-1===String(e).indexOf("%")?n=parseInt(e,10):n*=parseInt(e,10)/100,a=this.isReversed?this.baseLineY[r]:h.globals.gridHeight-this.baseLineY[r],t=h.globals.padHorizontal+(s-n)/2}let c=h.globals.barGroups.length||1;return{x:t,y:e,yDivision:i,xDivision:s,barHeight:l/c,barWidth:n/c,zeroH:a,zeroW:o}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:o,columnGroupIndex:r,seriesGroup:l,yDivision:n,elSeries:h}){let c,d=this.w,g=o+r*e,p=t.i,x=t.j,b=t.realIndex,f=t.translationsIndex,u=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)u+=this.groupCtx.prevXF[t][x];let m=p;if(d.config.series[b].name&&(m=l.indexOf(d.config.series[b].name)),m>0){let t=i;this.groupCtx.prevXVal[m-1][x]<0?t=this.series[p][x]>=0?this.groupCtx.prevX[m-1][x]+u-2*(this.isReversed?u:0):this.groupCtx.prevX[m-1][x]:this.groupCtx.prevXVal[m-1][x]>=0&&(t=this.series[p][x]>=0?this.groupCtx.prevX[m-1][x]:this.groupCtx.prevX[m-1][x]-u+2*(this.isReversed?u:0)),c=t}else c=i;a=null===this.series[p][x]?c:c+this.series[p][x]/this.invertedYRatio-2*(this.isReversed?this.series[p][x]/this.invertedYRatio:0);const y=this.barHelpers.getBarpaths({barYPosition:g,barHeight:e,x1:c,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:l,i:p,j:x,w:d});return this.barHelpers.barBackground({j:x,i:p,y1:g,y2:e,elSeries:h}),o+=n,{pathTo:y.pathTo,pathFrom:y.pathFrom,goalX:this.barHelpers.getGoalValues("x",i,null,p,x,f),barXPosition:c,barYPosition:g,x:a,y:o}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:o,columnGroupIndex:r,seriesGroup:l,elSeries:n}){var h,c,d,g;let p=this.w,x=t.i,b=t.j,f=t.bc,u=t.realIndex,m=t.translationsIndex;if(p.globals.isXNumeric){let t=p.globals.seriesX[u][b];t||(t=0),e=(t-p.globals.minX)/this.xRatio-a/2*p.globals.barGroups.length}let y,w=e+r*a,v=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)v+=isNaN(this.groupCtx.prevYF[t][b])?0:this.groupCtx.prevYF[t][b];let A=x;if(l&&(A=l.indexOf(p.globals.seriesNames[u])),A>0&&!p.globals.isXNumeric||A>0&&p.globals.isXNumeric&&p.globals.seriesX[u-1][b]===p.globals.seriesX[u][b]){let t,e;const s=Math.min(this.yRatio.length+1,u+1);if(void 0!==this.groupCtx.prevY[A-1]&&this.groupCtx.prevY[A-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[A-t])?void 0:h[b])){e=this.groupCtx.prevY[A-t][b];break}for(let i=1;i<s;i++){if((null==(c=this.groupCtx.prevYVal[A-i])?void 0:c[b])<0){t=this.series[x][b]>=0?e-v+2*(this.isReversed?v:0):e;break}if((null==(d=this.groupCtx.prevYVal[A-i])?void 0:d[b])>=0){t=this.series[x][b]>=0?e:e+v-2*(this.isReversed?v:0);break}}void 0===t&&(t=p.globals.gridHeight),y=(null==(g=this.groupCtx.prevYF[0])?void 0:g.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,A).every(t=>t.every(t=>isNaN(t)))?o:t}else y=o;s=this.series[x][b]?y-this.series[x][b]/this.yRatio[m]+2*(this.isReversed?this.series[x][b]/this.yRatio[m]:0):y;const C=this.barHelpers.getColumnPaths({barXPosition:w,barWidth:a,y1:y,y2:s,yRatio:this.yRatio[m],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:l,realIndex:t.realIndex,i:x,j:b,w:p});return this.barHelpers.barBackground({bc:f,j:b,i:x,x1:w,x2:a,elSeries:n}),{pathTo:C.pathTo,pathFrom:C.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,o,x,b),barXPosition:w,x:p.globals.isXNumeric?e:e+i,y:s}}}class se extends te{draw(t,e,s){const i=this.w,a=new w(this.ctx),o=i.globals.comboCharts?e:i.config.chart.type,r=new D(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new v(this.ctx),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const h=a.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let o,c,d,g,p,x;this.isBoxPlot="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[e].type;const b=[],f=[],m=i.globals.comboCharts?s[e]:e,{columnGroupIndex:y}=this.barHelpers.getGroupIndex(m),w=a.group({class:"apexcharts-series",seriesName:u.escapeString(i.globals.seriesNames[m]),rel:e+1,"data:realIndex":m});this.ctx.series.addCollapsedClassToSeries(w,m),t[e].length>0&&(this.visibleI=this.visibleI+1);let v=0,A=0,C=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[m][0],C=m);const S=this.barHelpers.initialPositions(m);c=S.y,v=S.barHeight,g=S.yDivision,x=S.zeroW,o=S.x,A=S.barWidth,d=S.xDivision,p=S.zeroH,f.push(o+A/2);const k=a.group({class:"apexcharts-datalabels","data:realIndex":m}),L=a.group({class:"apexcharts-bar-goals-markers"});for(let s=0;s<i.globals.dataPoints;s++){const a=this.barHelpers.getStrokeWidth(e,s,m);let h=null;const u={indexes:{i:e,j:s,realIndex:m,translationsIndex:C},x:o,y:c,strokeWidth:a,elSeries:w};h=this.isHorizontal?this.drawHorizontalBoxPaths(n(l({},u),{yDivision:g,barHeight:v,zeroW:x})):this.drawVerticalBoxPaths(n(l({},u),{xDivision:d,barWidth:A,zeroH:p})),c=h.y,o=h.x;const S=this.barHelpers.drawGoalLine({barXPosition:h.barXPosition,barYPosition:h.barYPosition,goalX:h.goalX,goalY:h.goalY,barHeight:v,barWidth:A});S&&L.add(S),s>0&&f.push(o+A/2),b.push(c),h.pathTo.forEach((l,n)=>{const d=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?h.color[n]:i.globals.stroke.colors[e],g=r.fillPath({seriesNumber:m,dataPointIndex:s,color:h.color[n],value:t[e][s]});this.renderSeries({realIndex:m,pathFill:g,lineFill:d,j:s,i:e,pathFrom:h.pathFrom,pathTo:l,strokeWidth:a,elSeries:w,x:o,y:c,series:t,columnGroupIndex:y,barHeight:v,barWidth:A,elDataLabelsWrap:k,elGoalsMarkers:L,visibleSeries:this.visibleI,type:i.config.chart.type})})}i.globals.seriesXvalues[m]=f,i.globals.seriesYvalues[m]=b,h.add(w)}return h}drawVerticalBoxPaths({indexes:t,x:e,xDivision:s,barWidth:i,zeroH:a,strokeWidth:o}){const r=this.w,l=new w(this.ctx),n=t.i,h=t.j,{colors:c}=r.config.plotOptions.candlestick,{colors:d}=this.boxOptions,g=t.realIndex,p=t=>Array.isArray(t)?t[g]:t,x=p(c.upward),b=p(c.downward),f=this.yRatio[t.translationsIndex],u=this.getOHLCValue(g,h);let m=a,y=a,v=u.o<u.c?[x]:[b];this.isBoxPlot&&(v=[p(d.lower),p(d.upper)]);let A=Math.min(u.o,u.c),C=Math.max(u.o,u.c),S=u.m;r.globals.isXNumeric&&(e=(r.globals.seriesX[g][h]-r.globals.minX)/this.xRatio-i/2);const k=e+i*this.visibleI;let L;void 0===this.series[n][h]||null===this.series[n][h]?(A=a,C=a):(A=a-A/f,C=a-C/f,m=a-u.h/f,y=a-u.l/f,S=a-u.m/f);let M=l.move(k+i/2,A);if(r.globals.previousPaths.length>0&&(M=this.getPreviousPath(g,h,!0)),this.isOHLC){const t=k+i/2,e=a-u.o/f,s=a-u.c/f;L=[l.move(t,m)+l.line(t,y)+l.move(t,e)+l.line(k,e)+l.move(t,s)+l.line(k+i,s)]}else L=this.isBoxPlot?[l.move(k,A)+l.line(k+i/2,A)+l.line(k+i/2,m)+l.line(k+i/4,m)+l.line(k+i-i/4,m)+l.line(k+i/2,m)+l.line(k+i/2,A)+l.line(k+i,A)+l.line(k+i,S)+l.line(k,S)+l.line(k,A+o/2),l.move(k,S)+l.line(k+i,S)+l.line(k+i,C)+l.line(k+i/2,C)+l.line(k+i/2,y)+l.line(k+i-i/4,y)+l.line(k+i/4,y)+l.line(k+i/2,y)+l.line(k+i/2,C)+l.line(k,C)+l.line(k,S)+"z"]:[l.move(k,C)+l.line(k+i/2,C)+l.line(k+i/2,m)+l.line(k+i/2,C)+l.line(k+i,C)+l.line(k+i,A)+l.line(k+i/2,A)+l.line(k+i/2,y)+l.line(k+i/2,A)+l.line(k,A)+l.line(k,C-o/2)];return M+=l.move(k,A),r.globals.isXNumeric||(e+=s),{pathTo:L,pathFrom:M,x:e,y:C,goalY:this.barHelpers.getGoalValues("y",null,a,n,h,t.translationsIndex),barXPosition:k,color:v}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:s,barHeight:i,zeroW:a,strokeWidth:o}){const r=this.w,l=new w(this.ctx),n=t.i,h=t.j,c=t.realIndex,{colors:d}=r.config.plotOptions.candlestick,{colors:g}=this.boxOptions,p=t=>Array.isArray(t)?t[c]:t,x=this.invertedYRatio,b=this.getOHLCValue(c,h);let f=b.o<b.c?[p(d.upward)]:[p(d.downward)];this.isBoxPlot&&(f=[p(g.lower),p(g.upper)]);let u=a,m=a,y=Math.min(b.o,b.c),v=Math.max(b.o,b.c),A=b.m;r.globals.isXNumeric&&(e=(r.globals.seriesX[c][h]-r.globals.minX)/this.invertedXRatio-i/2);const C=e+i*this.visibleI;let S;void 0===this.series[n][h]||null===this.series[n][h]?(y=a,v=a):(y=a+y/x,v=a+v/x,u=a+b.h/x,m=a+b.l/x,A=a+b.m/x);let k=l.move(y,C+i/2);return r.globals.previousPaths.length>0&&(k=this.getPreviousPath(c,h,!0)),S=[l.move(y,C)+l.line(y,C+i/2)+l.line(u,C+i/2)+l.line(u,C+i/2-i/4)+l.line(u,C+i/2+i/4)+l.line(u,C+i/2)+l.line(y,C+i/2)+l.line(y,C+i)+l.line(A,C+i)+l.line(A,C)+l.line(y+o/2,C),l.move(A,C)+l.line(A,C+i)+l.line(v,C+i)+l.line(v,C+i/2)+l.line(m,C+i/2)+l.line(m,C+i-i/4)+l.line(m,C+i/4)+l.line(m,C+i/2)+l.line(v,C+i/2)+l.line(v,C)+l.line(A,C)+"z"],k+=l.move(y,C),r.globals.isXNumeric||(e+=s),{pathTo:S,pathFrom:k,x:v,y:e,goalX:this.barHelpers.getGoalValues("x",a,null,n,h),barYPosition:C,color:f}}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,o=a(s.globals.seriesCandleH),r=a(s.globals.seriesCandleO),l=a(s.globals.seriesCandleM),n=a(s.globals.seriesCandleC),h=a(s.globals.seriesCandleL);return{o:this.isBoxPlot?o:r,h:this.isBoxPlot?r:o,m:l,l:this.isBoxPlot?n:h,c:this.isBoxPlot?h:n}}}class ie{constructor(t){this.ctx=t,this.w=t.w}checkColorRange(){const t=this.w;let e=!1,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 o=1,r=a.config.plotOptions[t].shadeIntensity;const l=this.determineColor(t,e,s);a.globals.hasNegs||i?o=a.config.plotOptions[t].reverseNegativeShade?l.percent<0?l.percent/100*(1.25*r):(1-l.percent/100)*(1.25*r):l.percent<=0?1-(1+l.percent/100)*r:(1-l.percent/100)*r:(o=1-l.percent/100,"treemap"===t&&(o=(1-l.percent/100)*(1.25*r)));let n=l.color,h=new u;if(a.config.plotOptions[t].enableShades)if("dark"===this.w.config.theme.mode){const t=h.shadeColor(-1*o,l.color);n=u.hexToRgba(u.isColorHex(t)?t:u.rgb2hex(t),a.config.fill.opacity)}else{const t=h.shadeColor(o,l.color);n=u.hexToRgba(u.isColorHex(t)?t:u.rgb2hex(t),a.config.fill.opacity)}return{color:n,colorProps:l}}determineColor(t,e,s){const i=this.w;let a=i.globals.series[e][s],o=i.config.plotOptions[t],r=o.colorScale.inverse?s:e;o.distributed&&"treemap"===i.config.chart.type&&(r=s);let l=i.globals.colors[r],n=null,h=Math.min(...i.globals.series[e]),c=Math.max(...i.globals.series[e]);o.distributed||"heatmap"!==t||(h=i.globals.minY,c=i.globals.maxY),void 0!==o.colorScale.min&&(h=o.colorScale.min<i.globals.minY?o.colorScale.min:i.globals.minY,c=o.colorScale.max>i.globals.maxY?o.colorScale.max:i.globals.maxY);let d=Math.abs(c)+Math.abs(h),g=100*a/(0===d?d-1e-6:d);if(o.colorScale.ranges.length>0){o.colorScale.ranges.map(t=>{if(a>=t.from&&a<=t.to){l=t.color,n=t.foreColor?t.foreColor:null,h=t.from,c=t.to;let e=Math.abs(c)+Math.abs(h);g=100*a/(0===e?e-1e-6:e)}})}return{color:l,foreColor:n,percent:g}}calculateDataLabels({text:t,x:e,y:s,i:i,j:a,colorProps:o,fontSize:r}){let l=this.w.config.dataLabels;const n=new w(this.ctx);let h=new N(this.ctx),c=null;if(l.enabled){c=n.group({class:"apexcharts-data-labels"});const d=l.offsetX,g=l.offsetY;let p=e+d,x=s+parseFloat(l.style.fontSize)/3+g;h.plotDataLabelsText({x:p,y:x,text:t,i:i,j:a,color:o.foreColor,parent:c,fontSize:r,dataLabelsConfig:l})}return c}}class ae{constructor(t,e){this.ctx=t,this.w=t.w,this.xRatio=e.xRatio,this.yRatio=e.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new ie(t),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}draw(t){let e=this.w;const s=new w(this.ctx);let i=s.group({class:"apexcharts-heatmap"});i.attr("clip-path",`url(#gridRectMask${e.globals.cuid})`);let a=e.globals.gridWidth/e.globals.dataPoints,o=e.globals.gridHeight/e.globals.series.length,r=0,l=!1;this.negRange=this.helpers.checkColorRange();let n=t.slice();e.config.yaxis[0].reversed&&(l=!0,n.reverse());for(let h=l?0:n.length-1;l?h<n.length:h>=0;l?h++:h--){let l=s.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:u.escapeString(e.globals.seriesNames[h]),rel:h+1,"data:realIndex":h});if(this.ctx.series.addCollapsedClassToSeries(l,h),s.setupEventDelegation(l,".apexcharts-heatmap-rect"),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;new y(this.ctx).dropShadow(l,t,h)}let c=0,d=e.config.plotOptions.heatmap.shadeIntensity,g=0;for(let i=0;i<e.globals.dataPoints;i++){if(e.globals.seriesX.length&&!e.globals.allSeriesHasEqualX&&e.globals.minX+e.globals.minXDiff*i<e.globals.seriesX[h][g]){c+=a;continue}if(g>=n[h].length)break;let p=this.helpers.getShadeColor(e.config.chart.type,h,g,this.negRange),x=p.color,b=p.colorProps;if("image"===e.config.fill.type){x=new D(this.ctx).fillPath({seriesNumber:h,dataPointIndex:g,opacity:e.globals.hasNegs?b.percent<0?1-(1+b.percent/100):d+b.percent/100:b.percent/100,patternID:u.randomId(),width:e.config.fill.image.width?e.config.fill.image.width:a,height:e.config.fill.image.height?e.config.fill.image.height:o})}let f=this.rectRadius,m=s.drawRect(c,r,a,o,f);if(m.attr({cx:c,cy:r}),m.node.classList.add("apexcharts-heatmap-rect"),l.add(m),m.attr({fill:x,i:h,index:h,j:g,val:t[h][g],"stroke-width":this.strokeWidth,stroke:e.config.plotOptions.heatmap.useFillColorAsStroke?x:e.globals.stroke.colors[0],color:x}),e.config.chart.animations.enabled&&!e.globals.dataChanged){let t=1;e.globals.resized||(t=e.config.chart.animations.speed),this.animateHeatMap(m,c,r,a,o,t)}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,u.isColorHex(s)?s:u.rgb2hex(s),u.isColorHex(x)?x:u.rgb2hex(x),t)}}let y=(0,e.config.dataLabels.formatter)(e.globals.series[h][g],{value:e.globals.series[h][g],seriesIndex:h,dataPointIndex:g,w:e}),w=this.helpers.calculateDataLabels({text:y,x:c+a/2,y:r+o/2,i:h,j:g,colorProps:b,series:n});null!==w&&l.add(w),c+=a,g++}r+=o,i.add(l)}let 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,o){const r=new m(this.ctx);r.animateRect(t,{x:e+i/2,y:s+a/2,width:0,height:0},{x:e,y:s,width:i,height:a},o,()=>{r.animationCompleted(t)})}animateHeatColor(t,e,s,i){t.attr({fill:e}).animate(i).attr({fill:s})}}class oe{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 v(this.lineCtx.ctx).seriesHaveSameValues(t)){let 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:o,prevY:r}){let l=this.w,n=[],h=[],c=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;return l.globals.isXNumeric&&(c=(l.globals.seriesX[e][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),0===o&&(n.push(c),h.push(u.isNumber(t[a][0])?r+l.config.markers.offsetY:null)),n.push(s+l.config.markers.offsetX),h.push(u.isNumber(t[a][o+1])?i+l.config.markers.offsetY:null),{x:n,y:h}}checkPreviousPaths({pathFromLine:t,pathFromArea:e,realIndex:s}){let i=this.w;for(let a=0;a<i.globals.previousPaths.length;a++){let o=i.globals.previousPaths[a];("line"===o.type||"area"===o.type)&&o.paths.length>0&&parseInt(o.realIndex,10)===parseInt(s,10)&&("line"===o.type?(this.lineCtx.appendPathFrom=!1,t=i.globals.previousPaths[a].paths[0].d):"area"===o.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:o}){var r,l,n;let 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==(r=this.w.config.series[e])?void 0:r.type)||"column"===(null==(l=this.w.config.series[e])?void 0:l.type));if(void 0!==(null==(n=s[t])?void 0:n[0]))i=(a=c&&t>0?this.lineCtx.prevSeriesY[t-1][0]:this.lineCtx.zeroY)-s[t][0]/this.lineCtx.yRatio[o]+2*(this.lineCtx.isReversed?s[t][0]/this.lineCtx.yRatio[o]: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}}}const re=t=>{const e=function(t){const e=[];let s=t[0],i=t[1],a=e[0]=ne(s,i),o=1;for(let r=t.length-1;o<r;o++)s=i,i=t[o+1],e[o]=.5*(a+(a=ne(s,i)));return e[o]=a,e}(t),s=t.length-1,i=[];let a,o,r,l;for(let i=0;i<s;i++)r=ne(t[i],t[i+1]),Math.abs(r)<1e-6?e[i]=e[i+1]=0:(a=e[i]/r,o=e[i+1]/r,l=a*a+o*o,l>9&&(l=3*r/Math.sqrt(l),e[i]=l*a,e[i+1]=l*o));for(let a=0;a<=s;a++)l=(t[Math.min(s,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+e[a]*e[a])),i.push([l||0,e[a]*l||0]);return i},le={points(t){const e=re(t),s=t[1],i=t[0],a=[],o=e[1],r=e[0];a.push(i,[i[0]+r[0],i[1]+r[1],s[0]-o[0],s[1]-o[1],s[0],s[1]]);for(let s=2,i=e.length;s<i;s++){const i=t[s],o=e[s];a.push([i[0]-o[0],i[1]-o[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 ne(t,e){return(e[1]-t[1])/(e[0]-t[0])}class he{constructor(t,e,s){this.ctx=t,this.w=t.w,this.xyRatios=e,this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||s,this.scatter=new W(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new oe(this),this.markers=new O(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}draw(t,e,s,i){var a;let o=this.w,r=new w(this.ctx),h=o.globals.comboCharts?e:o.config.chart.type,c=r.group({class:`apexcharts-${h}-series apexcharts-plot-series`});const d=new v(this.ctx);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=[];let g=[];for(let e=0;e<t.length;e++){t=this.lineHelpers.sameValueSeriesFix(e,t);let a=o.globals.comboCharts?s[e]:e,r=this.yRatio.length>1?a:0;this._initSerieVariables(t,e,a);let c=[],d=[],p=[],x=o.globals.padHorizontal+this.categoryAxisCorrection,b=1,f=[],u=[];this.ctx.series.addCollapsedClassToSeries(this.elSeries,a),o.globals.isXNumeric&&o.globals.seriesX.length>0&&(x=(o.globals.seriesX[a][0]-o.globals.minX)/this.xRatio),p.push(x);let m,y,w,v=x,A=v,C=this.zeroY,S=this.zeroY,k=0;C=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:t,prevY:C,lineYPosition:k,translationsIndex:r}).prevY,"monotoneCubic"===o.config.stroke.curve&&null===t[e][0]?c.push(null):c.push(C),m=C,"rangeArea"===h&&(w=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:i,prevY:S,lineYPosition:k,translationsIndex:r}),S=w.prevY,y=S,d.push(null!==c[0]?S:null));let L=this._calculatePathsFrom({type:h,series:t,i:e,realIndex:a,translationsIndex:r,prevX:A,prevY:C,prevY2:S}),M=[c[0]],P=[d[0]];const I={type:h,series:t,realIndex:a,translationsIndex:r,i:e,x:x,y:b,pX:v,pY:m,pathsFrom:L,linePaths:f,areaPaths:u,seriesIndex:s,lineYPosition:k,xArrj:p,yArrj:c,y2Arrj:d,seriesRangeEnd:i};let T=this._iterateOverDataPoints(n(l({},I),{iterations:"rangeArea"===h?t[e].length-1:void 0,isRangeStart:!0}));if("rangeArea"===h){let t=this._calculatePathsFrom({series:i,i:e,realIndex:a,prevX:A,prevY:S}),s=this._iterateOverDataPoints(n(l({},I),{series:i,xArrj:[x],yArrj:M,y2Arrj:P,pY:y,areaPaths:T.areaPaths,pathsFrom:t,iterations:i[e].length-1,isRangeStart:!1})),o=T.linePaths.length/2;for(let t=0;t<o;t++)T.linePaths[t]=s.linePaths[t+o]+T.linePaths[t];T.linePaths.splice(o),T.pathFromLine=s.pathFromLine+T.pathFromLine}else T.pathFromArea+="z";this._handlePaths({type:h,realIndex:a,i:e,paths:T}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),g.push(this.elSeries)}if(void 0!==(null==(a=o.config.series[0])?void 0:a.zIndex)&&g.sort((t,e)=>Number(t.node.getAttribute("zIndex"))-Number(e.node.getAttribute("zIndex"))),o.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 w(this.ctx);this.xDivision=i.globals.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 o=0;if(this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[s],o=s),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.zeroY=i.globals.gridHeight-this.baseLineY[o]-(this.isReversed?i.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[o]:0),this.areaBottomY=this.zeroY,(this.zeroY>i.globals.gridHeight||"end"===i.config.plotOptions.area.fillTo)&&(this.areaBottomY=i.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=a.group({class:"apexcharts-series",zIndex:void 0!==i.config.series[s].zIndex?i.config.series[s].zIndex:s,seriesName:u.escapeString(i.globals.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.globals.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});let r=t[e].length===i.globals.dataPoints;this.elSeries.attr({"data:longestSeries":r,rel:e+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom({type:t,series:e,i:s,realIndex:i,translationsIndex:a,prevX:o,prevY:r,prevY2:l}){const n=this.w,h=new w(this.ctx);let c,d,g,p;if(null===e[s][0]){for(let t=0;t<e[s].length;t++)if(null!==e[s][t]){o=this.xDivision*t,r=this.zeroY-e[s][t]/this.yRatio[a],c=h.move(o,r),d=h.move(o,this.areaBottomY);break}}else c=h.move(o,r),"rangeArea"===t&&(c=h.move(o,l)+h.line(o,r)),d=h.move(o,this.areaBottomY)+h.line(o,r);if(g=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),p=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),n.globals.previousPaths.length>0){const t=this.lineHelpers.checkPreviousPaths({pathFromLine:g,pathFromArea:p,realIndex:i});g=t.pathFromLine,p=t.pathFromArea}return{prevX:o,prevY:r,linePath:c,areaPath:d,pathFromLine:g,pathFromArea:p}}_handlePaths({type:t,realIndex:e,i:s,paths:i}){const a=this.w,o=new w(this.ctx),r=new D(this.ctx);this.prevSeriesY.push(i.yArrj),a.globals.seriesXvalues[e]=i.xArrj,a.globals.seriesYvalues[e]=i.yArrj;const h=a.config.forecastDataPoints;if(h.count>0&&"rangeArea"!==t){const t=a.globals.seriesXvalues[e][a.globals.seriesXvalues[e].length-h.count-1],s=o.drawRect(t,0,a.globals.gridWidth,a.globals.gridHeight,0);a.globals.dom.elForecastMask.appendChild(s.node);const i=o.drawRect(0,0,t,a.globals.gridHeight,0);a.globals.dom.elNonForecastMask.appendChild(i.node)}this.pointsChart||a.globals.delayedElements.push({el:this.elPointsMain.node,index:e});const c={i:s,realIndex:e,animationDelay:s,initialSpeed:a.config.chart.animations.speed,dataChangeSpeed:a.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${t}`};if("area"===t){let t=r.fillPath({seriesNumber:e});for(let e=0;e<i.areaPaths.length;e++){let s=o.renderPaths(n(l({},c),{pathFrom:i.pathFromArea,pathTo:i.areaPaths[e],stroke:"none",strokeWidth:0,strokeLineCap:null,fill:t}));this.elSeries.add(s)}}if(a.config.stroke.show&&!this.pointsChart){let d=null;if("line"===t)d=r.fillPath({seriesNumber:e,i:s});else if("solid"===a.config.stroke.fill.type)d=a.globals.stroke.colors[e];else{const t=a.config.fill;a.config.fill=a.config.stroke.fill,d=r.fillPath({seriesNumber:e,i:s}),a.config.fill=t}for(let s=0;s<i.linePaths.length;s++){let g=d;"rangeArea"===t&&(g=r.fillPath({seriesNumber:e}));const p=n(l({},c),{pathFrom:i.pathFromLine,pathTo:i.linePaths[s],stroke:d,strokeWidth:this.strokeWidth,strokeLineCap:a.config.stroke.lineCap,fill:"rangeArea"===t?g:"none"});let x=o.renderPaths(p);if(this.elSeries.add(x),x.attr("fill-rule","evenodd"),h.count>0&&"rangeArea"!==t){let t=o.renderPaths(p);t.node.setAttribute("stroke-dasharray",h.dashArray),h.strokeWidth&&t.node.setAttribute("stroke-width",h.strokeWidth),this.elSeries.add(t),t.attr("clip-path",`url(#forecastMask${a.globals.cuid})`),x.attr("clip-path",`url(#nonForecastMask${a.globals.cuid})`)}}}}_iterateOverDataPoints({type:t,series:e,iterations:s,realIndex:i,translationsIndex:a,i:o,x:r,y:l,pX:n,pY:h,pathsFrom:c,linePaths:d,areaPaths:g,seriesIndex:p,lineYPosition:x,xArrj:b,yArrj:f,y2Arrj:m,isRangeStart:y,seriesRangeEnd:v}){var A,C;const S=this.w;let k=new w(this.ctx),L=this.yRatio,{prevY:M,linePath:P,areaPath:I,pathFromLine:T,pathFromArea:X}=c;const z=u.isNumber(S.globals.minYArr[i])?S.globals.minYArr[i]:S.globals.minY;s||(s=S.globals.dataPoints>1?S.globals.dataPoints-1:S.globals.dataPoints);const E=(t,e)=>e-t/L[a]+2*(this.isReversed?t/L[a]:0);let Y=l,R=S.config.chart.stacked&&!S.globals.comboCharts||S.config.chart.stacked&&S.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(A=this.w.config.series[i])?void 0:A.type)||"column"===(null==(C=this.w.config.series[i])?void 0:C.type)),F=S.config.stroke.curve;Array.isArray(F)&&(F=Array.isArray(p)?F[p[o]]:F[o]);let H,D=0;for(let a=0;a<s&&0!==e[o].length;a++){const c=void 0===e[o][a+1]||null===e[o][a+1];if(S.globals.isXNumeric){let t=S.globals.seriesX[i][a+1];void 0===S.globals.seriesX[i][a+1]&&(t=S.globals.seriesX[i][s-1]),r=(t-S.globals.minX)/this.xRatio}else r+=this.xDivision;if(R)if(o>0&&S.globals.collapsedSeries.length<S.config.series.length-1){const t=t=>{for(let e=t;e>0;e--){if(!(S.globals.collapsedSeriesIndices.indexOf((null==p?void 0:p[e])||e)>-1))return e;e--}return 0};x=this.prevSeriesY[t(o-1)][a+1]}else x=this.zeroY;else x=this.zeroY;c?l=E(z,x):(l=E(e[o][a+1],x),"rangeArea"===t&&(Y=E(v[o][a+1],x))),b.push(null===e[o][a+1]?null:r),!c||"smooth"!==S.config.stroke.curve&&"monotoneCubic"!==S.config.stroke.curve?(f.push(l),m.push(Y)):(f.push(null),m.push(null));let u=this.lineHelpers.calculatePoints({series:e,x:r,y:l,realIndex:i,i:o,j:a,prevY:M}),w=this._createPaths({type:t,series:e,i:o,j:a,x:r,y:l,y2:Y,xArrj:b,yArrj:f,y2Arrj:m,pX:n,pY:h,pathState:D,segmentStartX:H,linePath:P,areaPath:I,linePaths:d,areaPaths:g,curve:F,isRangeStart:y});g=w.areaPaths,d=w.linePaths,n=w.pX,h=w.pY,D=w.pathState,H=w.segmentStartX,I=w.areaPath,P=w.linePath,!this.appendPathFrom||S.globals.hasNullValues||"monotoneCubic"===F&&"rangeArea"===t||(T+=k.line(r,this.areaBottomY),X+=k.line(r,this.areaBottomY)),this.handleNullDataPoints(e,u,o,a,i),this._handleMarkersAndLabels({type:t,pointsPos:u,i:o,j:a,realIndex:i,isRangeStart:y})}return{yArrj:f,xArrj:b,pathFromArea:X,areaPaths:g,pathFromLine:T,linePaths:d,linePath:P,areaPath:I}}_handleMarkersAndLabels({type:t,pointsPos:e,isRangeStart:s,i:i,j:a,realIndex:o}){const r=this.w;let l=new N(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:o,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{r.globals.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");let t=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:o,j:a+1});null!==t&&this.elPointsMain.add(t)}let n=l.drawDataLabel({type:t,isRangeStart:s,pos:e,i:o,j:a+1});null!==n&&this.elDataLabelsWrap.add(n)}_createPaths({type:t,series:e,i:s,j:i,x:a,y:o,xArrj:r,yArrj:l,y2:n,y2Arrj:h,pX:c,pY:d,pathState:g,segmentStartX:p,linePath:x,areaPath:b,linePaths:f,areaPaths:u,curve:m,isRangeStart:y}){let v=new w(this.ctx);const A=this.areaBottomY;let C="rangeArea"===t,S="rangeArea"===t&&y;switch(m){case"monotoneCubic":{let t=y?l:h,a=(t,e)=>t.map((t,s)=>[t,e[s]]).filter(t=>null!==t[1]),o=t=>{let e=[],s=0;return t.forEach(t=>{null!==t?s++:s>0&&(e.push(s),s=0)}),s>0&&e.push(s),e},n=(t,e)=>{let s=o(t),i=[];for(let t=0,a=0;t<s.length;a+=s[t++])i[t]=le.slice(e,a,a+s[t]);return i};switch(g){case 0:if(null===t[i+1])break;g=1;case 1:if(!(C?r.length===e[s].length:i===e[s].length-2))break;case 2:{const e=y?r:r.slice().reverse(),s=y?t:t.slice().reverse(),i=a(e,s),o=i.length>1?le.points(i):i;let l=[];C&&(S?u=i:l=u.reverse());let h=0,c=0;if(n(s,o).forEach(t=>{h++;let e=(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})(t),s=c;c+=t.length;let a=c-1;S?x=v.move(i[s][0],i[s][1])+e:C?x=v.move(l[s][0],l[s][1])+v.line(i[s][0],i[s][1])+e+v.line(l[a][0],l[a][1]):(x=v.move(i[s][0],i[s][1])+e,b=x+v.line(i[a][0],A)+v.line(i[s][0],A)+"z",u.push(b)),f.push(x)}),C&&h>1&&!S){let t=f.slice(h).reverse();f.splice(h),t.forEach(t=>f.push(t))}g=0;break}}break}case"smooth":{let t=.35*(a-c);if(null===e[s][i])g=0;else switch(g){case 0:if(p=c,x=S?v.move(c,h[i])+v.line(c,d):v.move(c,d),b=v.move(c,d),null===e[s][i+1]||void 0===e[s][i+1]){f.push(x),u.push(b);break}if(g=1,i<e[s].length-2){let e=v.curve(c+t,d,a-t,o,a,o);x+=e,b+=e;break}case 1:if(null===e[s][i+1])x+=S?v.line(c,n):v.move(c,d),b+=v.line(c,A)+v.line(p,A)+"z",f.push(x),u.push(b),g=-1;else{let r=v.curve(c+t,d,a-t,o,a,o);x+=r,b+=r,i>=e[s].length-2&&(S&&(x+=v.curve(a,o,a,o,a,n)+v.move(a,n)),b+=v.curve(a,o,a,o,a,A)+v.line(p,A)+"z",f.push(x),u.push(b),g=-1)}}c=a,d=o;break}default:{let t=(t,e,s)=>{let i=[];switch(t){case"stepline":i=v.line(e,null,"H")+v.line(null,s,"V");break;case"linestep":i=v.line(null,s,"V")+v.line(e,null,"H");break;case"straight":i=v.line(e,s)}return i};if(null===e[s][i])g=0;else switch(g){case 0:if(p=c,x=S?v.move(c,h[i])+v.line(c,d):v.move(c,d),b=v.move(c,d),null===e[s][i+1]||void 0===e[s][i+1]){f.push(x),u.push(b);break}if(g=1,i<e[s].length-2){let e=t(m,a,o);x+=e,b+=e;break}case 1:if(null===e[s][i+1])x+=S?v.line(c,n):v.move(c,d),b+=v.line(c,A)+v.line(p,A)+"z",f.push(x),u.push(b),g=-1;else{let r=t(m,a,o);x+=r,b+=r,i>=e[s].length-2&&(S&&(x+=v.line(a,n)),b+=v.line(a,A)+v.line(p,A)+"z",f.push(x),u.push(b),g=-1)}}c=a,d=o;break}}return{linePaths:f,areaPaths:u,pX:c,pY:d,pathState:g,segmentStartX:p,linePath:x,areaPath:b}}handleNullDataPoints(t,e,s,i,a){const o=this.w;if(null===t[s][i]&&o.config.markers.showNullDataPoints||1===t[s].length){let t=this.strokeWidth-o.config.markers.strokeWidth/2;t>0||(t=0);let s=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:i+1,pSize:t,alwaysDrawMarker:!0});null!==s&&this.elPointsMain.add(s)}}}class ce{constructor(t){this.ctx=t,this.w=t.w}drawYAxisTexts(t,e,s,i){const a=this.w,o=a.config.yaxis[0],r=a.globals.yLabelFormatters[0];return new w(this.ctx).drawText({x:t+o.labels.offsetX,y:e+o.labels.offsetY,text:r(i,s),textAnchor:"middle",fontSize:o.labels.style.fontSize,fontFamily:o.labels.style.fontFamily,foreColor:Array.isArray(o.labels.style.colors)?o.labels.style.colors[s]:o.labels.style.colors})}}class de{constructor(t){this.ctx=t,this.w=t.w;const e=this.w;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!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=Math.min(e.globals.gridWidth,e.globals.gridHeight),this.centerY=this.defaultSize/2,this.centerX=e.globals.gridWidth/2,"radialBar"===e.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(e.config.plotOptions.pie.endAngle-e.config.plotOptions.pie.startAngle),this.initialAngle=e.config.plotOptions.pie.startAngle%this.fullAngle,e.globals.radialSize=this.defaultSize/2.05-e.config.stroke.width-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.donutSize=e.globals.radialSize*parseInt(e.config.plotOptions.pie.donut.size,10)/100;let s=e.config.plotOptions.pie.customScale,i=e.globals.gridWidth/2,a=e.globals.gridHeight/2;this.translateX=i-i*s,this.translateY=a-a*s,this.dataLabelsGroup=new w(this.ctx).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${s})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}draw(t){let e=this.w;const s=new w(this.ctx);let i=s.group({class:"apexcharts-pie"});if(e.globals.noData)return i;let a=0;for(let e=0;e<t.length;e++)a+=u.negToZero(t[e]);let o=[],r=s.group();0===a&&(a=1e-5),t.forEach(t=>{this.maxY=Math.max(this.maxY,t)}),e.config.yaxis[0].max&&(this.maxY=e.config.yaxis[0].max),"back"===e.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(i);for(let s=0;s<t.length;s++){let i=this.fullAngle*u.negToZero(t[s])/a;o.push(i),"polarArea"===this.chartType?(o[s]=this.fullAngle/t.length,this.sliceSizes.push(e.globals.radialSize*t[s]/this.maxY)):this.sliceSizes.push(e.globals.radialSize)}if(e.globals.dataChanged){let t,s=0;for(let t=0;t<e.globals.previousPaths.length;t++)s+=u.negToZero(e.globals.previousPaths[t]);for(let i=0;i<e.globals.previousPaths.length;i++)t=this.fullAngle*u.negToZero(e.globals.previousPaths[i])/s,this.prevSectorAngleArr.push(t)}if(this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const t=s.drawCircle(this.donutSize);t.attr({cx:this.centerX,cy:this.centerY,fill:e.config.plotOptions.pie.donut.background?e.config.plotOptions.pie.donut.background:"transparent"}),r.add(t)}let l=this.drawArcs(o,t);if(this.sliceLabels.forEach(t=>{l.add(t)}),r.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${e.config.plotOptions.pie.customScale})`}),r.add(l),i.add(r),this.donutDataLabels.show){let t=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});i.add(t)}return"front"===e.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(i),i}drawArcs(t,e){let s=this.w;const i=new y(this.ctx);let a=new w(this.ctx),o=new D(this.ctx),r=a.group({class:"apexcharts-slices"}),l=this.initialAngle,n=this.initialAngle,h=this.initialAngle,c=this.initialAngle;this.strokeWidth=s.config.stroke.show?s.config.stroke.width:0;for(let d=0;d<t.length;d++){let g=a.group({class:"apexcharts-series apexcharts-pie-series",seriesName:u.escapeString(s.globals.seriesNames[d]),rel:d+1,"data:realIndex":d});r.add(g),l=h,n=c,h=l+t[d],c=n+this.prevSectorAngleArr[d];const p=h<l?this.fullAngle+h-l:h-l;let x=o.fillPath({seriesNumber:d,size:this.sliceSizes[d],value:e[d]}),b=this.getChangedPath(n,c),f=a.drawPath({d:b,stroke:Array.isArray(this.lineColorArr)?this.lineColorArr[d]:this.lineColorArr,strokeWidth:0,fill:x,fillOpacity:s.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${d}`});if(f.attr({index:0,j:d}),i.setSelectionFilter(f,0,d),s.config.chart.dropShadow.enabled){const t=s.config.chart.dropShadow;i.dropShadow(f,t,d)}this.addListeners(f,this.donutDataLabels),w.setAttrs(f.node,{"data:angle":p,"data:startAngle":l,"data:strokeWidth":this.strokeWidth,"data:value":e[d]});let m={x:0,y:0};"pie"===this.chartType||"polarArea"===this.chartType?m=u.polarToCartesian(this.centerX,this.centerY,s.globals.radialSize/1.25+s.config.plotOptions.pie.dataLabels.offset,(l+p/2)%this.fullAngle):"donut"===this.chartType&&(m=u.polarToCartesian(this.centerX,this.centerY,(s.globals.radialSize+this.donutSize)/2+s.config.plotOptions.pie.dataLabels.offset,(l+p/2)%this.fullAngle)),g.add(f);let y=0;if(!this.initialAnim||s.globals.resized||s.globals.dataChanged?this.animBeginArr.push(0):(y=p/this.fullAngle*s.config.chart.animations.speed,0===y&&(y=1),this.animDur=y+this.animDur,this.animBeginArr.push(this.animDur)),this.dynamicAnim&&s.globals.dataChanged?this.animatePaths(f,{size:this.sliceSizes[d],endAngle:h,startAngle:l,prevStartAngle:n,prevEndAngle:c,animateStartingPos:!0,i:d,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:s.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(f,{size:this.sliceSizes[d],endAngle:h,startAngle:l,i:d,totalItems:t.length-1,animBeginArr:this.animBeginArr,dur:y}),s.config.plotOptions.pie.expandOnClick&&"polarArea"!==this.chartType&&f.node.addEventListener("mouseup",this.pieClicked.bind(this,d)),void 0!==s.globals.selectedDataPoints[0]&&s.globals.selectedDataPoints[0].indexOf(d)>-1&&this.pieClicked(d),s.config.dataLabels.enabled){let e=m.x,o=m.y,r=100*p/this.fullAngle+"%";if(0!==p&&s.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[d]){let t=s.config.dataLabels.formatter;void 0!==t&&(r=t(s.globals.seriesPercent[d][0],{seriesIndex:d,w:s}));let l=s.globals.dataLabels.style.colors[d];const n=a.group({class:"apexcharts-datalabels"});let h=a.drawText({x:e,y:o,text:r,textAnchor:"middle",fontSize:s.config.dataLabels.style.fontSize,fontFamily:s.config.dataLabels.style.fontFamily,fontWeight:s.config.dataLabels.style.fontWeight,foreColor:l});if(n.add(h),s.config.dataLabels.dropShadow.enabled){const t=s.config.dataLabels.dropShadow;i.dropShadow(h,t)}h.node.classList.add("apexcharts-pie-label"),s.config.chart.animations.animate&&!1===s.globals.resized&&(h.node.classList.add("apexcharts-pie-label-delay"),h.node.style.animationDelay=s.config.chart.animations.speed/940+"s"),this.sliceLabels.push(n)}}}return r}addListeners(t,e){const s=new w(this.ctx);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,e)),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){let s=this.w,i=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,a=i,o=e.startAngle,r=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(o=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+r>this.fullAngle?e.endAngle=e.endAngle-(i+r):i+r<this.fullAngle&&(e.endAngle=e.endAngle+(this.fullAngle-(i+r)))),i===this.fullAngle&&(i=this.fullAngle-.01),this.animateArc(t,o,r,i,a,e)}animateArc(t,e,s,i,a,o){let r=this;const l=this.w,n=new m(this.ctx);let h,c=o.size;(isNaN(e)||isNaN(a))&&(e=s,a=i,o.dur=0);let d=i,g=s,p=e<s?this.fullAngle+e-s:e-s;l.globals.dataChanged&&o.shouldSetPrevPaths&&o.prevEndAngle&&(h=r.getPiePath({me:r,startAngle:o.prevStartAngle,angle:o.prevEndAngle<o.prevStartAngle?this.fullAngle+o.prevEndAngle-o.prevStartAngle:o.prevEndAngle-o.prevStartAngle,size:c}),t.attr({d:h})),0!==o.dur?t.animate(o.dur,o.animBeginArr[o.i]).after(function(){"pie"!==r.chartType&&"donut"!==r.chartType&&"polarArea"!==r.chartType||this.animate(l.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":r.strokeWidth}),o.i===l.config.series.length-1&&n.animationCompleted(t)}).during(l=>{d=p+(i-p)*l,o.animateStartingPos&&(d=a+(i-a)*l,g=e-a+(s-(e-a))*l),h=r.getPiePath({me:r,startAngle:g,angle:d,size:c}),t.node.setAttribute("data:pathOrig",h),t.attr({d:h})}):(h=r.getPiePath({me:r,startAngle:g,angle:i,size:c}),o.isTrack||(l.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",h),t.attr({d:h,"stroke-width":r.strokeWidth}))}pieClicked(t){let e,s=this.w,i=this,a=i.sliceSizes[t]+(s.config.plotOptions.pie.expandOnClick?4:0),o=s.globals.dom.Paper.findOne(`.apexcharts-${i.chartType.toLowerCase()}-slice-${t}`);if("true"===o.attr("data:pieClicked")){o.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(o.node,this.donutDataLabels);let t=o.attr("data:pathOrig");return void o.attr({d:t})}{let e=s.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(e,t=>{t.setAttribute("data:pieClicked","false");let e=t.getAttribute("data:pathOrig");e&&t.setAttribute("d",e)}),s.globals.capturedDataPointIndex=t,o.attr("data:pieClicked","true")}let r=parseInt(o.attr("data:startAngle"),10),l=parseInt(o.attr("data:angle"),10);e=i.getPiePath({me:i,startAngle:r,angle:l,size:a}),360!==l&&o.plot(e)}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 o=new w(this.ctx);let r=e,l=Math.PI*(r-90)/180,n=s+e;Math.ceil(n)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(n=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(n)>this.fullAngle&&(n-=this.fullAngle);let h=Math.PI*(n-90)/180,c=t.centerX+i*Math.cos(l),d=t.centerY+i*Math.sin(l),g=t.centerX+i*Math.cos(h),p=t.centerY+i*Math.sin(h),x=u.polarToCartesian(t.centerX,t.centerY,t.donutSize,n),b=u.polarToCartesian(t.centerX,t.centerY,t.donutSize,r),f=s>180?1:0;const m=["M",c,d,"A",i,i,0,f,1,g,p];return a="donut"===t.chartType?[...m,"L",x.x,x.y,"A",t.donutSize,t.donutSize,0,f,0,b.x,b.y,"L",c,d,"z"].join(" "):"pie"===t.chartType||"polarArea"===t.chartType?[...m,"L",t.centerX,t.centerY,"L",c,d].join(" "):[...m].join(" "),o.roundPathCorners(a,2*this.strokeWidth)}drawPolarElements(t){const e=this.w,s=new U(this.ctx),i=new w(this.ctx),a=new ce(this.ctx),o=i.group(),r=i.group(),l=s.niceScale(0,Math.ceil(this.maxY),0),n=l.result.reverse();let h=l.result.length;this.maxY=l.niceMax;let c=e.globals.radialSize,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,n[t]);r.add(s)}o.add(s),c-=d}this.drawSpokes(t),t.add(o),t.add(r)}renderInnerDataLabels(t,e,s){let i=this.w;const a=new w(this.ctx),o=e.total.show;t.node.innerHTML="",t.node.style.opacity=s.opacity;let r,l,n=s.centerX,h=this.donutDataLabels.total.label?s.centerY:s.centerY-s.centerY/6;r=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;l=void 0===e.value.color?i.config.chart.foreColor:e.value.color;let p=e.value.formatter,x="",b="";if(o?(r=e.total.color,c=e.total.fontSize,d=e.total.fontFamily,g=e.total.fontWeight,b=this.donutDataLabels.total.label?e.total.label:"",x=e.total.formatter(i)):1===i.globals.series.length&&(x=p(i.globals.series[0],i),b=i.globals.seriesNames[0]),b&&(b=e.name.formatter(b,e.total.show,i)),e.name.show){let s=a.drawText({x:n,y:h+parseFloat(e.name.offsetY),text:b,textAnchor:"middle",foreColor:r,fontSize:c,fontWeight:g,fontFamily:d});s.node.classList.add("apexcharts-datalabel-label"),t.add(s)}if(e.value.show){let s=e.name.show?parseFloat(e.value.offsetY)+16:e.value.offsetY,i=a.drawText({x:n,y:h+s,text:x,textAnchor:"middle",foreColor:l,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 o;i?o=void 0===t.name.color?a.globals.colors[parseInt(i.parentNode.getAttribute("rel"),10)-1]:t.name.color:a.globals.series.length>1&&t.total.show&&(o=t.total.color);let r=a.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),l=a.globals.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 n=e===t.total.label;e=this.donutDataLabels.total.label?t.name.formatter(e,n,a):"",null!==r&&(r.textContent=e),null!==l&&(l.textContent=s),null!==r&&(r.style.fill=o)}printDataLabelsInner(t,e){let s=this.w,i=t.getAttribute("data:value"),a=s.globals.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];s.globals.series.length>1&&this.printInnerLabels(e,a,i,t);let o=s.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");null!==o&&(o.style.opacity=1)}drawSpokes(t){const e=this.w,s=new w(this.ctx),i=e.config.plotOptions.polarArea.spokes;if(0===i.strokeWidth)return;let a=[],o=360/e.globals.series.length;for(let t=0;t<e.globals.series.length;t++)a.push(u.polarToCartesian(this.centerX,this.centerY,e.globals.radialSize,e.config.plotOptions.pie.startAngle+o*t));a.forEach((e,a)=>{const o=s.drawLine(e.x,e.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[a]:i.connectorColors);t.add(o)})}revertDataLabelsInner(){const t=this.w;if(this.donutDataLabels.show){let e=t.globals.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.globals.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(s)}}}class ge{constructor(t){this.ctx=t,this.w=t.w,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;const e=this.w;this.graphics=new w(this.ctx),this.lineColorArr=void 0!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=e.globals.svgHeight<e.globals.svgWidth?e.globals.gridHeight:e.globals.gridWidth,this.isLog=e.config.yaxis[0].logarithmic,this.logBase=e.config.yaxis[0].logBase,this.coreUtils=new v(this.ctx),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,e.globals.maxY,0):e.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):e.globals.minY,this.polygons=e.config.plotOptions.radar.polygons,this.strokeWidth=e.config.stroke.show?e.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-e.config.chart.dropShadow.blur,e.config.xaxis.labels.show&&(this.size=this.size-e.globals.xAxisLabelsWidth/1.75),void 0!==e.config.plotOptions.radar.size&&(this.size=e.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}draw(t){let e=this.w;const s=new D(this.ctx),i=[],a=new N(this.ctx);t.length&&(this.dataPointsLen=t[e.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;let o=e.globals.gridWidth/2,r=e.globals.gridHeight/2,h=o+e.config.plotOptions.radar.offsetX,c=r+e.config.plotOptions.radar.offsetY,d=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:`translate(${h||0}, ${c||0})`}),g=[],p=null,x=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((t,o)=>{let r=t.length===e.globals.dataPoints,h=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":r,seriesName:u.escapeString(e.globals.seriesNames[o]),rel:o+1,"data:realIndex":o});this.dataRadiusOfPercent[o]=[],this.dataRadius[o]=[],this.angleArr[o]=[],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[o][e]=t/s,this.dataRadius[o][e]=this.dataRadiusOfPercent[o][e]*this.size,this.angleArr[o][e]=e*this.disAngle}),g=this.getDataPointsPos(this.dataRadius[o],this.angleArr[o]);const c=this.createPaths(g,{x:0,y:0});p=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),x=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":o}),e.globals.delayedElements.push({el:p.node,index:o});const d={i:o,realIndex:o,animationDelay:o,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[o],strokeLineCap:e.config.stroke.lineCap};let b=null;e.globals.previousPaths.length>0&&(b=this.getPreviousPath(o));for(let t=0;t<c.linePathsTo.length;t++){let i=this.graphics.renderPaths(n(l({},d),{pathFrom:null===b?c.linePathsFrom[t]:b,pathTo:c.linePathsTo[t],strokeWidth:Array.isArray(this.strokeWidth)?this.strokeWidth[o]:this.strokeWidth,fill:"none",drawShadow:!1}));h.add(i);let a=s.fillPath({seriesNumber:o}),r=this.graphics.renderPaths(n(l({},d),{pathFrom:null===b?c.areaPathsFrom[t]:b,pathTo:c.areaPathsTo[t],strokeWidth:0,fill:a,drawShadow:!1}));if(e.config.chart.dropShadow.enabled){const t=new y(this.ctx),s=e.config.chart.dropShadow;t.dropShadow(r,Object.assign({},s,{noUserSpaceOnUse:!0}),o)}h.add(r)}t.forEach((t,s)=>{let i=new O(this.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:o,dataPointIndex:s}),r=this.graphics.drawMarker(g[s].x,g[s].y,i);r.attr("rel",s),r.attr("j",s),r.attr("index",o),r.node.setAttribute("default-marker-size",i.pSize);let n=this.graphics.group({class:"apexcharts-series-markers"});n&&n.add(r),p.add(n),h.add(p);const c=e.config.dataLabels;if(c.enabled){let t=c.formatter(e.globals.series[o][s],{seriesIndex:o,dataPointIndex:s,w:e});a.plotDataLabelsText({x:g[s].x,y:g[s].y,text:t,textAnchor:"middle",i:o,j:o,parent:x,offsetCorrection:!1,dataLabelsConfig:l({},c)})}h.add(x)}),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 ce(this.ctx),a=e.globals.yAxisScale[0].result.reverse(),o=a.length;let r=[],l=this.size/(o-1);for(let t=0;t<o;t++)r[t]=l*t;r.reverse();let n=[],h=[];r.forEach((t,e)=>{const s=u.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+" "}),n.push(i)}),n.forEach((t,i)=>{const a=this.polygons.strokeColors,o=this.polygons.strokeWidth,r=this.graphics.drawPolygon(t,Array.isArray(a)?a[i]:a,Array.isArray(o)?o[i]:o,e.globals.radarPolygons.fill.colors[i]);s.add(r)}),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;let s=this.graphics.group({class:"apexcharts-xaxis"}),i=u.getPolygonPos(this.size,this.dataPointsLen);return t.globals.labels.forEach((a,o)=>{let r=t.config.xaxis.labels.formatter,n=new N(this.ctx);if(i[o]){let h=this.getTextPos(i[o],this.size),c=r(a,{seriesIndex:-1,dataPointIndex:o,w:t});n.plotDataLabelsText({x:h.newX,y:h.newY,text:c,textAnchor:h.textAnchor,i:o,j:o,parent:s,className:"apexcharts-xaxis-label",color:Array.isArray(e.style.colors)&&e.style.colors[o]?e.style.colors[o]:"#a8a8a8",dataLabelsConfig:l({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:o});t.config.chart.events.xAxisLabelClick(e,this.ctx,s)}})}}),s}createPaths(t,e){let s=[],i=[],a=[],o=[];if(t.length){i=[this.graphics.move(e.x,e.y)],o=[this.graphics.move(e.x,e.y)];let r=this.graphics.move(t[0].x,t[0].y),l=this.graphics.move(t[0].x,t[0].y);t.forEach((e,s)=>{r+=this.graphics.line(e.x,e.y),l+=this.graphics.line(e.x,e.y),s===t.length-1&&(r+="Z",l+="Z")}),s.push(r),a.push(l)}return{linePathsFrom:i,linePathsTo:s,areaPathsFrom:o,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){let e=this.w,s=null;for(let i=0;i<e.globals.previousPaths.length;i++){let a=e.globals.previousPaths[i];a.paths.length>0&&parseInt(a.realIndex,10)===parseInt(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||[];let i=[];for(let a=0;a<s;a++){let s={};s.x=t[a]*Math.sin(e[a]),s.y=-t[a]*Math.cos(e[a]),i.push(s)}return i}}class pe extends de{constructor(t){super(t),this.ctx=t,this.w=t.w,this.animBeginArr=[0],this.animDur=0;const e=this.w;this.startAngle=e.config.plotOptions.radialBar.startAngle,this.endAngle=e.config.plotOptions.radialBar.endAngle,this.totalAngle=Math.abs(e.config.plotOptions.radialBar.endAngle-e.config.plotOptions.radialBar.startAngle),this.trackStartAngle=e.config.plotOptions.radialBar.track.startAngle,this.trackEndAngle=e.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(e.config.plotOptions.radialBar.track.margin,10),this.onBarLabelClick=this.onBarLabelClick.bind(this)}draw(t){let e=this.w;const s=new w(this.ctx);let i=s.group({class:"apexcharts-radialbar"});if(e.globals.noData)return i;let a=s.group(),o=this.defaultSize/2,r=e.globals.gridWidth/2,l=this.defaultSize/2.05;e.config.chart.sparkline.enabled||(l=l-e.config.stroke.width-e.config.chart.dropShadow.blur);let n=e.globals.fill.colors;if(e.config.plotOptions.radialBar.track.show){let e=this.drawTracks({size:l,centerX:r,centerY:o,colorArr:n,series:t});a.add(e)}let h=this.drawArcs({size:l,centerX:r,centerY:o,colorArr:n,series:t}),c=360;e.config.plotOptions.radialBar.startAngle<0&&(c=this.totalAngle);let d=(360-c)/360;if(e.globals.radialSize=l-l*d,this.radialDataLabels.value.show){let t=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);e.globals.radialSize+=t*d}return a.add(h.g),"front"===e.config.plotOptions.radialBar.hollow.position&&(h.g.add(h.elHollow),h.dataLabels&&h.g.add(h.dataLabels)),i.add(a),i}drawTracks(t){let e=this.w;const s=new w(this.ctx);let i=s.group({class:"apexcharts-tracks"}),a=new y(this.ctx),o=new D(this.ctx),r=this.getStrokeWidth(t);t.size=t.size-r/2;for(let l=0;l<t.series.length;l++){let n=s.group({class:"apexcharts-radialbar-track apexcharts-track"});i.add(n),n.attr({rel:l+1}),t.size=t.size-r-this.margin;const h=e.config.plotOptions.radialBar.track;let c=o.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(h.background)?h.background[l]:h.background,solid:!0}),d=this.trackStartAngle,g=this.trackEndAngle;Math.abs(g)+Math.abs(d)>=360&&(g=360-Math.abs(this.startAngle)-.1);let p=s.drawPath({d:"",stroke:c,strokeWidth:r*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)}n.add(p),p.attr("id","apexcharts-radialbarTrack-"+l),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:g,startAngle:d,size:t.size,i:l,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return i}drawArcs(t){let e=this.w,s=new w(this.ctx),i=new D(this.ctx),a=new y(this.ctx),o=s.group(),r=this.getStrokeWidth(t);t.size=t.size-r/2;let l=e.config.plotOptions.radialBar.hollow.background,n=t.size-r*t.series.length-this.margin*t.series.length-r*parseInt(e.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,h=n-e.config.plotOptions.radialBar.hollow.margin;void 0!==e.config.plotOptions.radialBar.hollow.image&&(l=this.drawHollowImage(t,o,n,l));let c=this.drawHollow({size:h,centerX:t.centerX,centerY:t.centerY,fill:l||"transparent"});if(e.config.plotOptions.radialBar.hollow.dropShadow.enabled){const t=e.config.plotOptions.radialBar.hollow.dropShadow;a.dropShadow(c,t)}let d=1;!this.radialDataLabels.total.show&&e.globals.series.length>1&&(d=0);let g=null;if(this.radialDataLabels.show){let s=e.globals.dom.Paper.findOne(".apexcharts-datalabels-group");g=this.renderInnerDataLabels(s,this.radialDataLabels,{hollowSize:n,centerX:t.centerX,centerY:t.centerY,opacity:d})}"back"===e.config.plotOptions.radialBar.hollow.position&&(o.add(c),g&&o.add(g));let p=!1;e.config.plotOptions.radialBar.inverseOrder&&(p=!0);for(let l=p?t.series.length-1:0;p?l>=0:l<t.series.length;p?l--:l++){let n=s.group({class:"apexcharts-series apexcharts-radial-series",seriesName:u.escapeString(e.globals.seriesNames[l])});o.add(n),n.attr({rel:l+1,"data:realIndex":l}),this.ctx.series.addCollapsedClassToSeries(n,l),t.size=t.size-r-this.margin;let h,c=i.fillPath({seriesNumber:l,size:t.size,value:t.series[l]}),d=this.startAngle;const g=u.negToZero(t.series[l]>100?100:t.series[l])/100;let p,x=Math.round(this.totalAngle*g)+this.startAngle;e.globals.dataChanged&&(h=this.startAngle,p=Math.round(this.totalAngle*u.negToZero(e.globals.previousPaths[l])/100)+h);Math.abs(x)+Math.abs(d)>360&&(x-=.01);Math.abs(p)+Math.abs(h)>360&&(p-=.01);let b=x-d;const f=Array.isArray(e.config.stroke.dashArray)?e.config.stroke.dashArray[l]:e.config.stroke.dashArray;let m=s.drawPath({d:"",stroke:c,strokeWidth:r,fill:"none",fillOpacity:e.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+l,strokeDashArray:f});if(w.setAttrs(m.node,{"data:angle":b,"data:value":t.series[l]}),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;a.dropShadow(m,t,l)}if(a.setSelectionFilter(m,0,l),this.addListeners(m,this.radialDataLabels),n.add(m),m.attr({index:0,j:l}),this.barLabels.enabled){let i=u.polarToCartesian(t.centerX,t.centerY,t.size,d),a=this.barLabels.formatter(e.globals.seriesNames[l],{seriesIndex:l,w:e}),o=["apexcharts-radialbar-label"];this.barLabels.onClick||o.push("apexcharts-no-click");let r=this.barLabels.useSeriesColors?e.globals.colors[l]:e.config.chart.foreColor;r||(r=e.config.chart.foreColor);const h=i.x+this.barLabels.offsetX,c=i.y+this.barLabels.offsetY;let g=s.drawText({x:h,y:c,text:a,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:r,cssClass:o.join(" ")});g.on("click",this.onBarLabelClick),g.attr({rel:l+1}),0!==d&&g.attr({"transform-origin":`${h} ${c}`,transform:`rotate(${d} 0 0)`}),n.add(g)}let y=0;!this.initialAnim||e.globals.resized||e.globals.dataChanged||(y=e.config.chart.animations.speed),e.globals.dataChanged&&(y=e.config.chart.animations.dynamicAnimation.speed),this.animDur=y/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(m,{centerX:t.centerX,centerY:t.centerY,endAngle:x,startAngle:d,prevEndAngle:p,prevStartAngle:h,size:t.size,i:l,totalItems:2,animBeginArr:this.animBeginArr,dur:y,shouldSetPrevPaths:!0})}return{g:o,elHollow:c,dataLabels:g}}drawHollow(t){let e=new w(this.ctx).drawCircle(2*t.size);return e.attr({class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill}),e}drawHollowImage(t,e,s,i){const a=this.w;let o=new D(this.ctx),r=u.randomId(),l=a.config.plotOptions.radialBar.hollow.image;if(a.config.plotOptions.radialBar.hollow.imageClipped)o.clippedImgArea({width:s,height:s,image:l,patternID:`pattern${a.globals.cuid}${r}`}),i=`url(#pattern${a.globals.cuid}${r})`;else{const s=a.config.plotOptions.radialBar.hollow.imageWidth,i=a.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===s&&void 0===i){let s=a.globals.dom.Paper.image(l,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{let o=a.globals.dom.Paper.image(l,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(o)}}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){let e=parseInt(t.target.getAttribute("rel"),10)-1;const s=this.barLabels.onClick,i=this.w;s&&s(i.globals.seriesNames[e],{w:i,seriesIndex:e})}}class xe extends te{draw(t,e){let s=this.w,i=new w(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=s.globals.seriesRangeStart,this.seriesRangeEnd=s.globals.seriesRangeEnd,this.barHelpers.initVariables(t);let a=i.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let o=0;o<t.length;o++){let r,n,h,c,d,g,p=s.globals.comboCharts?e[o]:o,{columnGroupIndex:x}=this.barHelpers.getGroupIndex(p),b=i.group({class:"apexcharts-series",seriesName:u.escapeString(s.globals.seriesNames[p]),rel:o+1,"data:realIndex":p});this.ctx.series.addCollapsedClassToSeries(b,p),t[o].length>0&&(this.visibleI=this.visibleI+1);let f=0,m=0,y=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[p][0],y=p);let w=this.barHelpers.initialPositions(p);n=w.y,g=w.zeroW,r=w.x,m=w.barWidth,f=w.barHeight,h=w.xDivision,c=w.yDivision,d=w.zeroH;let v=i.group({class:"apexcharts-datalabels","data:realIndex":p}),A=i.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<s.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(o,e,p),a=this.seriesRangeStart[o][e],u=this.seriesRangeEnd[o][e];let C=null,S=null,k=null;const L={x:r,y:n,strokeWidth:i,elSeries:b};let M=this.seriesLen;if(s.config.plotOptions.bar.rangeBarGroupRows&&(M=1),void 0===s.config.series[o].data[e])break;if(this.isHorizontal){k=n+f*this.visibleI;let t=(c-f*M)/2;if(s.config.series[o].data[e].x){let s=this.detectOverlappingBars({i:o,j:e,barYPosition:k,srty:t,barHeight:f,yDivision:c,initPositions:w});f=s.barHeight,k=s.barYPosition}C=this.drawRangeBarPaths(l({indexes:{i:o,j:e,realIndex:p},barHeight:f,barYPosition:k,zeroW:g,yDivision:c,y1:a,y2:u},L)),m=C.barWidth}else{s.globals.isXNumeric&&(r=(s.globals.seriesX[o][e]-s.globals.minX)/this.xRatio-m/2),S=r+m*this.visibleI;let t=(h-m*M)/2;if(s.config.series[o].data[e].x){let s=this.detectOverlappingBars({i:o,j:e,barXPosition:S,srtx:t,barWidth:m,xDivision:h,initPositions:w});m=s.barWidth,S=s.barXPosition}C=this.drawRangeColumnPaths(l({indexes:{i:o,j:e,realIndex:p,translationsIndex:y},barWidth:m,barXPosition:S,zeroH:d,xDivision:h},L)),f=C.barHeight}const P=this.barHelpers.drawGoalLine({barXPosition:C.barXPosition,barYPosition:k,goalX:C.goalX,goalY:C.goalY,barHeight:f,barWidth:m});P&&A.add(P),n=C.y,r=C.x;let I=this.barHelpers.getPathFillColor(t,o,e,p);this.renderSeries({realIndex:p,pathFill:I.color,lineFill:I.useRangeColor?I.color:s.globals.stroke.colors[p],j:e,i:o,x:r,y:n,y1:a,y2:u,pathFrom:C.pathFrom,pathTo:C.pathTo,strokeWidth:i,elSeries:b,series:t,barHeight:f,barWidth:m,barXPosition:S,barYPosition:k,columnGroupIndex:x,elDataLabelsWrap:v,elGoalsMarkers:A,visibleSeries:this.visibleI,type:"rangebar"})}a.add(b)}return a}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:i,srty:a,srtx:o,barHeight:r,barWidth:l,yDivision:n,xDivision:h,initPositions:c}){const d=this.w;let g=[],p=d.config.series[t].data[e].rangeName;const x=d.config.series[t].data[e].x,b=Array.isArray(x)?x.join(" "):x,f=d.globals.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(b),u=d.globals.seriesRange[t].findIndex(t=>t.x===b&&t.overlaps.length>0);return this.isHorizontal?(s=d.config.plotOptions.bar.rangeBarGroupRows?a+n*f:a+r*this.visibleI+n*f,u>-1&&!d.config.plotOptions.bar.rangeBarOverlap&&(g=d.globals.seriesRange[t][u].overlaps,g.indexOf(p)>-1&&(s=(r=c.barHeight/g.length)*this.visibleI+n*(100-parseInt(this.barOptions.barHeight,10))/100/2+r*(this.visibleI+g.indexOf(p))+n*f))):(f>-1&&!d.globals.timescaleLabels.length&&(i=d.config.plotOptions.bar.rangeBarGroupRows?o+h*f:o+l*this.visibleI+h*f),u>-1&&!d.config.plotOptions.bar.rangeBarOverlap&&(g=d.globals.seriesRange[t][u].overlaps,g.indexOf(p)>-1&&(i=(l=c.barWidth/g.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+l*(this.visibleI+g.indexOf(p))+h*f))),{barYPosition:s,barXPosition:i,barHeight:r,barWidth:l}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:i,barXPosition:a,zeroH:o}){let r=this.w;const{i:l,j:n,realIndex:h,translationsIndex:c}=t,d=this.yRatio[c],g=this.getRangeValue(h,n);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);void 0===this.series[l][n]||null===this.series[l][n]?p=o:(p=o-p/d,x=o-x/d);const b=Math.abs(x-p),f=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:i,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:h,i:h,j:n,w:r});if(r.globals.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:n,realIndex:h,barWidth:i});e=t.x,a=t.barXPosition}else e+=s;return{pathTo:f.pathTo,pathFrom:f.pathFrom,barHeight:b,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,o,l,n,c),barXPosition:a}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.globals.gridWidth&&(t=e.globals.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:i,yDivision:a,barHeight:o,barYPosition:r,zeroW:l}){let n=this.w;const{realIndex:h,j:c}=t;let d=this.preventBarOverflow(l+s/this.invertedYRatio),g=this.preventBarOverflow(l+i/this.invertedYRatio);const p=this.getRangeValue(h,c),x=Math.abs(g-d),b=this.barHelpers.getBarpaths({barYPosition:r,barHeight:o,x1:d,x2:g,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:c,w:n});return n.globals.isXNumeric||(e+=a),{pathTo:b.pathTo,pathFrom:b.pathFrom,barWidth:x,x:p.start<0&&p.end<0?d:g,goalX:this.barHelpers.getGoalValues("x",l,null,h,c),y:e}}getRangeValue(t,e){const s=this.w;return{start:s.globals.seriesRangeStart[t][e],end:s.globals.seriesRangeEnd[t][e]}}}function be(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 fe(t,e,s,i){const a=i*i,o=s*s;return Math.max(a*e/o,o/(a*t))}function ue(t,e,s,i,a,o){if(0===t)return!0;return fe(e,s,i,o)>=fe(Math.min(e,a),Math.max(s,a),i+a,o)}function me(t,e,s,i,a,o,r,l){if(r>=l){const r=i/l;let n=o;for(let i=0;i<s;i++){const s=e[i]/r;t.push([a,n,a+r,n+s]),n+=s}}else{const l=i/r;let n=a;for(let i=0;i<s;i++){const s=e[i]/l;t.push([n,o,n+s,o+l]),n+=s}}}function ye(t,e,s,i,a){const o=[],r=t.length;if(0===r)return o;const l=new Array(r);let n=0,h=0,c=1/0,d=-1/0,g=0;for(;g<r;){const r=Math.min(i,a),p=t[g];if(ue(n,c,d,h,p,r))l[n]=p,n++,h+=p,p<c&&(c=p),p>d&&(d=p),g++;else{if(me(o,l,n,h,e,s,i,a),i>=a){const t=h/a;e+=t,i-=t}else{const t=h/i;s+=t,a-=t}n=0,h=0,c=1/0,d=-1/0}}return n>0&&me(o,l,n,h,e,s,i,a),o}const we={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 o=ye(be(a,e*s),0,0,e,s),r=new Array(i);for(let e=0;e<i;e++){const s=o[e],i=s[0],a=s[1],l=s[2]-i,n=s[3]-a;r[e]=ye(be(t[e],l*n),i,a,l,n)}return r}};class ve{constructor(t){this.ctx=t,this.w=t.w,this.strokeWidth=this.w.config.stroke.width,this.helpers=new ie(t),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}draw(t){let e=this.w;const s=new w(this.ctx),i=new D(this.ctx);let a=s.group({class:"apexcharts-treemap"});if(e.globals.noData)return a;let o=[];t.forEach(t=>{let e=t.map(t=>Math.abs(t));o.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 we.generate(o,e.globals.gridWidth,e.globals.gridHeight).forEach((o,r)=>{let l=s.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:u.escapeString(e.globals.seriesNames[r]),rel:r+1,"data:realIndex":r});if(s.setupEventDelegation(l,".apexcharts-treemap-rect"),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;new y(this.ctx).dropShadow(a,t,r)}let n=s.group({class:"apexcharts-data-labels"}),h={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};o.forEach((a,o)=>{const n=a[0],c=a[1],d=a[2],g=a[3];h.xMin=Math.min(h.xMin,n),h.yMin=Math.min(h.yMin,c),h.xMax=Math.max(h.xMax,d),h.yMax=Math.max(h.yMax,g);let p=this.helpers.getShadeColor(e.config.chart.type,r,o,this.negRange),x=p.color,b=i.fillPath({color:x,seriesNumber:r,dataPointIndex:o}),f=s.drawRect(n,c,d-n,g-c,e.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,e.config.plotOptions.treemap.useFillColorAsStroke?x:e.globals.stroke.colors[r]);f.attr({cx:n,cy:c,index:r,i:r,j:o,width:d-n,height:g-c,fill:b}),f.node.classList.add("apexcharts-treemap-rect");let u={x:n+(d-n)/2,y:c+(g-c)/2,width:0,height:0},m={x:n,y:c,width:d-n,height:g-c};if(e.config.chart.animations.enabled&&!e.globals.dataChanged){let t=1;e.globals.resized||(t=e.config.chart.animations.speed),this.animateTreemap(f,u,m,t)}if(e.globals.dataChanged){let t=1;this.dynamicAnim.enabled&&e.globals.shouldAnimate&&(t=this.dynamicAnim.speed,e.globals.previousPaths[r]&&e.globals.previousPaths[r][o]&&e.globals.previousPaths[r][o].rect&&(u=e.globals.previousPaths[r][o].rect),this.animateTreemap(f,u,m,t))}let y=this.getFontSize(a),w=e.config.dataLabels.formatter(this.labels[r][o],{value:e.globals.series[r][o],seriesIndex:r,dataPointIndex:o,w:e});"truncate"===e.config.plotOptions.treemap.dataLabels.format&&(y=parseInt(e.config.dataLabels.style.fontSize,10),w=this.truncateLabels(w,y,n,c,d,g));let v=null;e.globals.series[r][o]&&(v=this.helpers.calculateDataLabels({text:w,x:(n+d)/2,y:(c+g)/2+this.strokeWidth/2+y/3,i:r,j:o,colorProps:p,fontSize:y,series:t})),e.config.dataLabels.enabled&&v&&this.rotateToFitLabel(v,y,w,n,c,d,g),l.add(f),null!==v&&l.add(v)});const c=e.config.plotOptions.treemap.seriesTitle;if(e.config.series.length>1&&c&&c.show){const t=e.config.series[r].name||"";if(t&&h.xMin<1/0&&h.yMin<1/0){const{offsetX:i,offsetY:a,borderColor:o,borderWidth:r,borderRadius:n,style:d}=c,g=d.color||e.config.chart.foreColor,p={left:d.padding.left,right:d.padding.right,top:d.padding.top,bottom:d.padding.bottom},x=s.getTextRects(t,d.fontSize,d.fontFamily),b=x.width+p.left+p.right,f=x.height+p.top+p.bottom,u=h.xMin+(i||0),m=h.yMin+(a||0),y=s.drawRect(u,m,b,f,n,d.background,1,r,o),w=s.drawText({x:u+p.left,y:m+p.top+.75*x.height,text:t,fontSize:d.fontSize,fontFamily:d.fontFamily,fontWeight:d.fontWeight,foreColor:g,cssClass:d.cssClass||""});l.add(y),l.add(w)}}l.add(n),a.add(l)}),a}getFontSize(t){const e=this.w;let 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){let a=t*i,o=Math.pow(a,.5);return Math.min(o/s,parseInt(e.config.dataLabels.style.fontSize,10))}(t[2]-t[0],t[3]-t[1])}rotateToFitLabel(t,e,s,i,a,o,r){const l=new w(this.ctx),n=l.getTextRects(s,e);if(n.width+this.w.config.stroke.width+5>o-i&&n.width<=r-a){let e=l.rotateAroundCenter(t.node);t.node.setAttribute("transform",`rotate(-90 ${e.x} ${e.y}) translate(${n.height/3})`)}}truncateLabels(t,e,s,i,a,o){const r=new w(this.ctx),l=r.getTextRects(t,e).width+this.w.config.stroke.width+5>a-s&&o-i>a-s?o-i:a-s,n=r.getTextBasedOnMaxWidth({text:t,maxWidth:l,fontSize:e});return t.length!==n.length&&l/e<5?"":n}animateTreemap(t,e,s,i){const a=new m(this.ctx);a.animateRect(t,e,s,i,()=>{a.animationCompleted(t)})}}class Ae{constructor(t,e){this.ctx=e,this.w=e.w,this.el=t}setupElements(){const{globals:t,config:e}=this.w,s=e.chart.type;t.axisCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble","radar","heatmap","treemap"].includes(s),t.xyCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"].includes(s),t.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(s)&&e.plotOptions.bar.horizontal,t.chartClass=`.apexcharts${t.chartID}`,t.dom.baseEl=this.el,t.dom.elWrap=f.createElementNS("http://www.w3.org/1999/xhtml","div"),w.setAttrs(t.dom.elWrap,{id:t.chartClass.substring(1),class:`apexcharts-canvas ${t.chartClass.substring(1)}`}),this.el.appendChild(t.dom.elWrap);const i=h.isBrowser()?window.SVG:global.SVG;if(t.dom.Paper=i().addTo(t.dom.elWrap),t.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:`translate(${e.chart.offsetX}, ${e.chart.offsetY})`}),t.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(),e.chart.accessibility.enabled){const s=this.getAccessibleChartLabel();t.dom.Paper.attr({role:"img","aria-label":s});const i=document.createElementNS(t.SVGNS,"title");if(i.textContent=e.title.text||"Chart",t.dom.Paper.node.insertBefore(i,t.dom.Paper.node.firstChild),e.chart.accessibility.description){const s=document.createElementNS(t.SVGNS,"desc");s.textContent=e.chart.accessibility.description,t.dom.Paper.node.insertBefore(s,i.nextSibling)}}t.dom.elLegendForeign=document.createElementNS(t.SVGNS,"foreignObject"),w.setAttrs(t.dom.elLegendForeign,{x:0,y:0,width:t.svgWidth,height:t.svgHeight}),t.dom.elLegendWrap=document.createElement("div"),t.dom.elLegendWrap.classList.add("apexcharts-legend"),t.dom.elWrap.appendChild(t.dom.elLegendWrap),t.dom.Paper.node.appendChild(t.dom.elLegendForeign),t.dom.elGraphical=t.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),t.dom.elDefs=t.dom.Paper.defs(),t.dom.Paper.add(t.dom.elGraphical),t.dom.elGraphical.add(t.dom.elDefs)}plotChartType(t,e){const{w:s,ctx:i}=this,{config:a,globals:o}=s,r={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},bar:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},l=a.chart.type||"line";let n=null,h=0;o.series.forEach((e,i)=>{var a,c;const d="column"===(null==(a=t[i])?void 0:a.type)?"bar":(null==(c=t[i])?void 0:c.type)||("column"===l?"bar":l);r[d]?("rangeArea"===d?(r[d].series.push(o.seriesRangeStart[i]),r[d].seriesRangeEnd.push(o.seriesRangeEnd[i])):r[d].series.push(e),r[d].i.push(i),"bar"===d&&(s.globals.columnSeries=r.bar)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(d)&&(n=d),l!==d&&"scatter"!==d&&h++}),h>0&&r.bar.series.length>0&&a.plotOptions.bar.horizontal&&(h-=r.bar.series.length,r.bar={series:[],i:[]},s.globals.columnSeries={series:[],i:[]}),o.comboCharts||(o.comboCharts=h>0);const c=new he(i,e),d=new se(i,e);i.pie=new de(i);const g=new pe(i);i.rangeBar=new xe(i,e);const p=new ge(i);let x=[];if(o.comboCharts){const t=new v(i);if(r.area.series.length>0&&x.push(...t.drawSeriesByGroup(r.area,o.areaGroups,"area",c)),r.bar.series.length>0)if(a.chart.stacked){const t=new ee(i,e);x.push(t.draw(r.bar.series,r.bar.i))}else i.bar=new te(i,e),x.push(i.bar.draw(r.bar.series,r.bar.i));if(r.rangeArea.series.length>0&&x.push(c.draw(r.rangeArea.series,"rangeArea",r.rangeArea.i,r.rangeArea.seriesRangeEnd)),r.line.series.length>0&&x.push(...t.drawSeriesByGroup(r.line,o.lineGroups,"line",c)),r.candlestick.series.length>0&&x.push(d.draw(r.candlestick.series,"candlestick",r.candlestick.i)),r.boxPlot.series.length>0&&x.push(d.draw(r.boxPlot.series,"boxPlot",r.boxPlot.i)),r.rangeBar.series.length>0&&x.push(i.rangeBar.draw(r.rangeBar.series,r.rangeBar.i)),r.scatter.series.length>0){const t=new he(i,e,!0);x.push(t.draw(r.scatter.series,"scatter",r.scatter.i))}if(r.bubble.series.length>0){const t=new he(i,e,!0);x.push(t.draw(r.bubble.series,"bubble",r.bubble.i))}}else switch(a.chart.type){case"line":x=c.draw(o.series,"line");break;case"area":x=c.draw(o.series,"area");break;case"bar":if(a.chart.stacked){x=new ee(i,e).draw(o.series)}else i.bar=new te(i,e),x=i.bar.draw(o.series);break;case"candlestick":x=new se(i,e).draw(o.series,"candlestick");break;case"boxPlot":x=new se(i,e).draw(o.series,a.chart.type);break;case"rangeBar":x=i.rangeBar.draw(o.series);break;case"rangeArea":x=c.draw(o.seriesRangeStart,"rangeArea",void 0,o.seriesRangeEnd);break;case"heatmap":x=new ae(i,e).draw(o.series);break;case"treemap":x=new ve(i).draw(o.series);break;case"pie":case"donut":case"polarArea":x=i.pie.draw(o.series);break;case"radialBar":x=g.draw(o.series);break;case"radar":x=p.draw(o.series);break;default:x=c.draw(o.series)}return x}setSVGDimensions(){const{globals:t,config:e}=this.w;e.chart.width=e.chart.width||"100%",e.chart.height=e.chart.height||"auto",t.svgWidth=e.chart.width,t.svgHeight=e.chart.height;let s=u.getDimensions(this.el);const i=e.chart.width.toString().split(/[0-9]+/g).pop();"%"===i?u.isNumber(s[0])&&(0===s[0].width&&(s=u.getDimensions(this.el.parentNode)),t.svgWidth=s[0]*parseInt(e.chart.width,10)/100):"px"!==i&&""!==i||(t.svgWidth=parseInt(e.chart.width,10));const a=String(e.chart.height).toString().split(/[0-9]+/g).pop();if("auto"!==t.svgHeight&&""!==t.svgHeight)if("%"===a){const s=u.getDimensions(this.el.parentNode);t.svgHeight=s[1]*parseInt(e.chart.height,10)/100}else t.svgHeight=parseInt(e.chart.height,10);else t.svgHeight=t.axisCharts?t.svgWidth/1.61:t.svgWidth/1.2;if(t.svgWidth=Math.max(t.svgWidth,0),t.svgHeight=Math.max(t.svgHeight,0),w.setAttrs(t.dom.Paper.node,{width:t.svgWidth,height:t.svgHeight}),"%"!==a){const s=e.chart.sparkline.enabled?0:t.axisCharts?e.chart.parentHeightOffset:0;t.dom.Paper.node.parentNode.parentNode.style.minHeight=`${t.svgHeight+s}px`}t.dom.elWrap.style.width=`${t.svgWidth}px`,t.dom.elWrap.style.height=`${t.svgHeight}px`}shiftGraphPosition(){const{globals:t}=this.w,{translateY:e,translateX:s}=t;w.setAttrs(t.dom.elGraphical.node,{transform:`translate(${s}, ${e})`})}resizeNonAxisCharts(){const{w:t}=this,{globals:e}=t;let s=0,i=t.config.chart.sparkline.enabled?1:15;i+=t.config.grid.padding.bottom,["top","bottom"].includes(t.config.legend.position)&&t.config.legend.show&&!t.config.legend.floating&&(s=new ct(this.ctx).legendHelpers.getLegendDimensions().clwh+7);const a=t.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie");let o=2.05*t.globals.radialSize;if(a&&!t.config.chart.sparkline.enabled&&0!==t.config.plotOptions.radialBar.startAngle){const e=u.getBoundingClientRect(a);o=e.bottom;const s=e.bottom-e.top;o=Math.max(2.05*t.globals.radialSize,s)}const r=Math.ceil(o+e.translateY+s+i);e.dom.elLegendForeign&&e.dom.elLegendForeign.setAttribute("height",r),t.config.chart.height&&String(t.config.chart.height).includes("%")||(e.dom.elWrap.style.height=`${r}px`,w.setAttrs(e.dom.Paper.node,{height:r}),e.dom.Paper.node.parentNode.parentNode.style.minHeight=`${r}px`)}coreCalculations(){new q(this.ctx).init()}resetGlobals(){const t=()=>this.w.config.series.map(()=>[]),e=new F,{globals:s}=this.w,i={dataWasParsed:s.dataWasParsed,originalSeries:s.originalSeries};e.initGlobalVars(s),s.seriesXvalues=t(),s.seriesYvalues=t(),i.dataWasParsed&&(s.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 tt(this.ctx).drawXCrosshairs(),"back"===t.config.yaxis[0].crosshairs.position&&new tt(this.ctx).drawYCrosshairs(),"datetime"===t.config.xaxis.type&&void 0===t.config.xaxis.labels.formatter){this.ctx.timeScale=new Jt(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 v(this.ctx).getCalculatedRatios()}return e}updateSourceChart(t){this.ctx.w.globals.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;let s="";if(e.chart.accessibility&&e.chart.accessibility.description)s=e.chart.accessibility.description;else if(e.title.text){const t=e.chart.type;s=`${e.title.text}. ${t} chart`,e.subtitle.text&&(s+=`. ${e.subtitle.text}`)}else{s=`${e.chart.type} chart with ${t.globals.series.length||(e.series?e.series.length:0)} data series`}return s}}class Ce{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],o=Date.now();if(a&&a.lastUpdate&&o-a.lastUpdate<i)return a.value;const r=s();return t.globals.dimensionCache[e]={value:r,lastUpdate:o},r}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 Se{constructor(t){this.ctx=t,this.w=t.w}_updateOptions(t,e=!1,s=!0,i=!0,a=!1){return new Promise(o=>{let r=[this.ctx];i&&(r=this.ctx.getSyncedCharts()),this.ctx.w.globals.isExecCalled&&(r=[this.ctx],this.ctx.w.globals.isExecCalled=!1),r.forEach((i,l)=>{let n=i.w;if(n.globals.shouldAnimate=s,e||(n.globals.resized=!0,n.globals.dataChanged=!0,s&&i.series.getPreviousPaths()),t&&"object"==typeof t&&(i.config=new R(t),t=v.extendArrayProps(i.config,t,n),i.w.globals.chartID!==this.ctx.w.globals.chartID&&delete t.series,n.config=u.extend(n.config,t),a&&(n.globals.lastXAxis=t.xaxis?u.clone(t.xaxis):[],n.globals.lastYAxis=t.yaxis?u.clone(t.yaxis):[],n.globals.initialConfig=u.extend({},n.config),n.globals.initialSeries=u.clone(n.config.series),t.series))){for(let t=0;t<n.globals.collapsedSeriesIndices.length;t++){let e=n.config.series[n.globals.collapsedSeriesIndices[t]];n.globals.collapsedSeries[t].data=n.globals.axisCharts?e.data.slice():e}for(let t=0;t<n.globals.ancillaryCollapsedSeriesIndices.length;t++){let e=n.config.series[n.globals.ancillaryCollapsedSeriesIndices[t]];n.globals.ancillaryCollapsedSeries[t].data=n.globals.axisCharts?e.data.slice():e}i.series.emptyCollapsedSeries(n.config.series)}return i.update(t).then(()=>{l===r.length-1&&o(i)})})})}_updateSeries(t,e,s=!1){return new Promise(i=>{const a=this.w;return a.globals.shouldAnimate=e,a.globals.dataChanged=!0,Ce.invalidateSelectors(a),e&&this.ctx.series.getPreviousPaths(),this.ctx.data.resetParsingFlags(),this.ctx.data.parseData(t),s&&(a.globals.initialConfig.series=u.clone(a.config.series),a.globals.initialSeries=u.clone(a.config.series)),this.ctx.update().then(()=>{i(this.ctx)})})}_extendSeries(t,e){const s=this.w,i=s.config.series[e];return n(l({},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.globals.dom.Paper.findOne(`${a} path[j='${e}'], ${a} circle[j='${e}'], ${a} rect[j='${e}']`):void 0===e&&(i=s.globals.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 w(this.ctx).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 Y(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),e.config.xaxis.min=s.min,e.config.xaxis.max=s.max;const a=t=>{void 0!==i[t]&&(e.config.yaxis[t].min=i[t].min,e.config.yaxis[t].max=i[t].max)};e.config.yaxis.map((t,s)=>{e.globals.zoomed||void 0!==i[s]?a(s):void 0!==this.ctx.opts.yaxis[s]&&(t.min=this.ctx.opts.yaxis[s].min,t.max=this.ctx.opts.yaxis[s].max)})}}h.isBrowser()?(void 0===window.SVG&&(window.SVG=Wt),void 0===window.Apex&&(window.Apex={})):"undefined"!=typeof global&&void 0===global.Apex&&(global.Apex={});class ke{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","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend","keydown","keyup"],this.ctx.animations=new m(this.ctx),this.ctx.axes=new Q(this.ctx),this.ctx.core=new Ae(this.ctx.el,this.ctx),this.ctx.config=new R({}),this.ctx.data=new $(this.ctx),this.ctx.grid=new j(this.ctx),this.ctx.graphics=new w(this.ctx),this.ctx.coreUtils=new v(this.ctx),this.ctx.crosshairs=new tt(this.ctx),this.ctx.events=new J(this.ctx),this.ctx.exports=new _(this.ctx),this.ctx.fill=new D(this.ctx),this.ctx.localization=new K(this.ctx),this.ctx.options=new T,this.ctx.responsive=new et(this.ctx),this.ctx.series=new G(this.ctx),this.ctx.theme=new st(this.ctx),this.ctx.formatters=new k(this.ctx),this.ctx.titleSubtitle=new it(this.ctx),this.ctx.legend=new ct(this.ctx),this.ctx.toolbar=new dt(this.ctx),this.ctx.tooltip=new Ut(this.ctx),this.ctx.dimensions=new nt(this.ctx),this.ctx.updateHelpers=new Se(this.ctx),this.ctx.zoomPanSelection=new Nt(this.ctx),this.ctx.w.globals.tooltip=new Ut(this.ctx)}}class Le{constructor(t){this.ctx=t,this.w=t.w}clear({isUpdating:t}){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),Ce.invalidateAll(this.w),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.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.globals.dom.Paper.node;e.parentNode&&e.parentNode.parentNode&&!t&&(e.parentNode.parentNode.style.minHeight="unset");const s=this.w.globals.dom.baseEl;s&&this.ctx.eventList.forEach(t=>{s.removeEventListener(t,this.ctx.events.documentEvent)});const i=this.w.globals.dom;if(null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(i.Paper),i.Paper.remove(),i.elWrap=null,i.elGraphical=null,i.elLegendWrap=null,i.elLegendForeign=null,i.baseEl=null,i.elGridRect=null,i.elGridRectMask=null,i.elGridRectBarMask=null,i.elGridRectMarkerMask=null,i.elForecastMask=null,i.elNonForecastMask=null,i.elDefs=null}}let Me=new WeakMap;class Pe{constructor(t,e){this.opts=e,this.ctx=this,this.w=new H(e).init(),this.el=t,this.w.globals.cuid=u.randomId(),this.w.globals.chartID=this.w.config.chart.id?u.escapeString(this.w.config.chart.id):this.w.globals.cuid;new ke(this).initModules(),this.lastUpdateOptions=null,this.create=u.bind(this.create,this),h.isBrowser()&&(this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this))}render(){return new Promise((t,e)=>{var s;if(u.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]),h.isBrowser()){window.addEventListener("resize",this.windowResizeHandler),function(t,e){if(h.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)}let 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),Me.set(e,i)}(this.el.parentNode,this.parentResizeHandler);let t=this.el.getRootNode&&this.el.getRootNode(),e=u.is("ShadowRoot",t),i=this.el.ownerDocument,a=e?t.getElementById("apexcharts-css"):i.getElementById("apexcharts-css");if(!a){a=f.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}\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.apexcharts-legend-text {\n padding-left: 15px;\n margin-left: -15px;\n}\n\n.apexcharts-legend-series[role="button"]:focus {\n outline: 2px solid #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 #008FFB;\n outline-offset: 2px;\n}\n\n.apexcharts-series-collapsed {\n opacity: 0\n}\n\n.apexcharts-tooltip {\n border-radius: 5px;\n box-shadow: 2px 2px 6px -4px #999;\n cursor: default;\n font-size: 14px;\n left: 62px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 20px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n white-space: nowrap;\n z-index: 12;\n transition: .15s ease all\n}\n\n.apexcharts-tooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-tooltip.apexcharts-theme-light {\n border: 1px solid #e3e3e3;\n background: rgba(255, 255, 255, .96)\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark {\n color: #fff;\n background: rgba(30, 30, 30, .8)\n}\n\n.apexcharts-tooltip * {\n font-family: inherit\n}\n\n.apexcharts-tooltip-title {\n padding: 6px;\n font-size: 15px;\n margin-bottom: 4px\n}\n\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {\n background: #eceff1;\n border-bottom: 1px solid #ddd\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\n background: rgba(0, 0, 0, .7);\n border-bottom: 1px solid #333\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-block;\n position: relative;\n width: 16px;\n height: 16px;\n font-size: 16px;\n line-height: 16px;\n margin-right: 4px;\n text-align: center;\n vertical-align: middle;\n color: inherit;\n}\n\n.apexcharts-tooltip-marker::before {\n content: "";\n display: inline-block;\n width: 100%;\n text-align: center;\n color: currentcolor;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n font-size: 26px;\n font-family: Arial, Helvetica, sans-serif;\n line-height: 14px;\n font-weight: 900;\n}\n\n.apexcharts-tooltip-marker[shape="circle"]::before {\n content: "\\25CF";\n}\n\n.apexcharts-tooltip-marker[shape="square"]::before,\n.apexcharts-tooltip-marker[shape="rect"]::before {\n content: "\\25A0";\n transform: translate(-1px, -2px);\n}\n\n.apexcharts-tooltip-marker[shape="line"]::before {\n content: "\\2500";\n}\n\n.apexcharts-tooltip-marker[shape="diamond"]::before {\n content: "\\25C6";\n font-size: 28px;\n}\n\n.apexcharts-tooltip-marker[shape="triangle"]::before {\n content: "\\25B2";\n font-size: 22px;\n}\n\n.apexcharts-tooltip-marker[shape="cross"]::before {\n content: "\\2715";\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="plus"]::before {\n content: "\\2715";\n transform: rotate(45deg) translate(-1px, -1px);\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="star"]::before {\n content: "\\2605";\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="sparkle"]::before {\n content: "\\2726";\n font-size: 20px;\n}\n\n.apexcharts-tooltip-series-group {\n padding: 0 10px;\n display: none;\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,\n.apexcharts-tooltip-series-group:last-child {\n padding-bottom: 4px\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.apexcharts-xaxistooltip,\n.apexcharts-yaxistooltip {\n opacity: 0;\n pointer-events: none;\n color: #373d3f;\n font-size: 13px;\n text-align: center;\n border-radius: 2px;\n position: absolute;\n z-index: 10;\n background: #eceff1;\n border: 1px solid #90a4ae\n}\n\n.apexcharts-xaxistooltip {\n padding: 9px 10px;\n transition: .15s ease all\n}\n\n.apexcharts-xaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, .7);\n border: 1px solid rgba(0, 0, 0, .5);\n color: #fff\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.apexcharts-xaxistooltip:after {\n border-color: transparent;\n border-width: 6px;\n margin-left: -6px\n}\n\n.apexcharts-xaxistooltip:before {\n border-color: transparent;\n border-width: 7px;\n margin-left: -7px\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: #eceff1\n}\n\n.apexcharts-xaxistooltip-bottom:before {\n border-bottom-color: #90a4ae\n}\n\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after,\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {\n border-bottom-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-xaxistooltip-top:after {\n border-top-color: #eceff1\n}\n\n.apexcharts-xaxistooltip-top:before {\n border-top-color: #90a4ae\n}\n\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after,\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {\n border-top-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-xaxistooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-yaxistooltip {\n padding: 4px 10px\n}\n\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, .7);\n border: 1px solid rgba(0, 0, 0, .5);\n color: #fff\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: 6px;\n margin-top: -6px\n}\n\n.apexcharts-yaxistooltip:before {\n border-color: transparent;\n border-width: 7px;\n margin-top: -7px\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: #eceff1\n}\n\n.apexcharts-yaxistooltip-left:before {\n border-left-color: #90a4ae\n}\n\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after,\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {\n border-left-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-yaxistooltip-right:after {\n border-right-color: #eceff1\n}\n\n.apexcharts-yaxistooltip-right:before {\n border-right-color: #90a4ae\n}\n\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after,\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {\n border-right-color: rgba(0, 0, 0, .5)\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 width: 20px;\n height: 20px;\n line-height: 24px;\n color: #6e8192;\n text-align: center\n}\n\n.apexcharts-menu-icon svg,\n.apexcharts-reset-icon svg,\n.apexcharts-zoom-icon svg,\n.apexcharts-zoomin-icon svg,\n.apexcharts-zoomout-icon svg {\n fill: #6e8192\n}\n\n.apexcharts-selection-icon svg {\n fill: #444;\n transform: scale(.76)\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon svg,\n.apexcharts-theme-dark .apexcharts-pan-icon svg,\n.apexcharts-theme-dark .apexcharts-reset-icon svg,\n.apexcharts-theme-dark .apexcharts-selection-icon svg,\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomin-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomout-icon svg {\n fill: #f3f4f5\n}\n\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg {\n fill: #008ffb\n}\n\n.apexcharts-theme-light .apexcharts-menu-icon:hover svg,\n.apexcharts-theme-light .apexcharts-reset-icon:hover svg,\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg {\n fill: #333\n}\n\n.apexcharts-menu-icon,\n.apexcharts-selection-icon {\n position: relative\n}\n\n.apexcharts-reset-icon {\n margin-left: 5px\n}\n\n.apexcharts-menu-icon,\n.apexcharts-reset-icon,\n.apexcharts-zoom-icon {\n transform: scale(.85)\n}\n\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n transform: scale(.7)\n}\n\n.apexcharts-zoomout-icon {\n margin-right: 3px\n}\n\n.apexcharts-pan-icon {\n transform: scale(.62);\n position: relative;\n left: 1px;\n top: 0\n}\n\n.apexcharts-pan-icon svg {\n fill: #fff;\n stroke: #6e8192;\n stroke-width: 2\n}\n\n.apexcharts-pan-icon.apexcharts-selected svg {\n stroke: #008ffb\n}\n\n.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {\n stroke: #333\n}\n\n.apexcharts-toolbar {\n position: absolute;\n z-index: 11;\n max-width: 176px;\n text-align: right;\n border-radius: 3px;\n padding: 0 6px 2px;\n display: flex;\n justify-content: space-between;\n align-items: center\n}\n\n.apexcharts-menu {\n background: #fff;\n position: absolute;\n top: 100%;\n border: 1px solid #ddd;\n border-radius: 3px;\n padding: 3px;\n right: 10px;\n opacity: 0;\n min-width: 110px;\n transition: .15s ease all;\n pointer-events: none\n}\n\n.apexcharts-menu.apexcharts-menu-open {\n opacity: 1;\n pointer-events: all;\n transition: .15s ease all\n}\n\n.apexcharts-menu-item {\n padding: 6px 7px;\n font-size: 12px;\n cursor: pointer\n}\n\n.apexcharts-theme-light .apexcharts-menu-item:hover {\n background: #eee\n}\n\n.apexcharts-theme-dark .apexcharts-menu {\n background: rgba(0, 0, 0, .7);\n color: #fff\n}\n\n@media screen and (min-width:768px) {\n .apexcharts-canvas:hover .apexcharts-toolbar {\n opacity: 1\n }\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 cursor: default;\n pointer-events: 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-disable-transitions * {\n transition: none !important;\n}';const o=(null==(s=this.opts.chart)?void 0:s.nonce)||this.w.config.chart.nonce;o&&a.setAttribute("nonce",o),e?t.prepend(a):!1!==this.w.config.chart.injectStyleSheet&&i.head.appendChild(a)}}let 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=>{e(t)})}else e(new Error("Element not found"))})}create(t,e){let s=this.w;new ke(this).initModules();let i=this.w.globals;if(i.noData=!1,i.animationEnded=!1,!u.elementExists(this.el))return i.animationEnded=!0,null;if(this.responsive.checkResponsiveConfig(e),s.config.xaxis.convertedCatToNumeric){new Y(s.config).convertCatToNumericXaxis(s.config,this.ctx)}if(this.core.setupElements(),"treemap"===s.config.chart.type&&(s.config.grid.show=!1,s.config.yaxis[0].show=!1),0===i.svgWidth)return i.animationEnded=!0,null;let a=t;t.forEach((t,e)=>{t.hidden&&(a=this.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:e}))});const o=v.checkComboSeries(a,s.config.chart.type);i.comboCharts=o.comboCharts,i.comboBarCount=o.comboBarCount;const r=a.every(t=>t.data&&0===t.data.length);(0===a.length||r&&i.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(a),this.theme.init();new O(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),i.noData&&i.collapsedSeries.length!==i.series.length&&!s.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),i.axisCharts&&(this.core.coreCalculations(),"category"!==s.config.xaxis.type&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=s.globals.minX,this.ctx.toolbar.maxX=s.globals.maxX),this.formatters.heatmapLabelFormatters();new v(this).getLargestMarkerSize(),this.dimensions.plotCoords();const l=this.core.xySettings();this.grid.createGridMask();const n=this.core.plotChartType(a,l),h=new N(this);h.bringForward(),s.config.dataLabels.background.enabled&&h.dataLabelsBackground(),this.core.shiftGraphPosition(),s.globals.dataPoints>50&&s.globals.dom.elWrap.classList.add("apexcharts-disable-transitions");return{elGraph:n,xyRatios:l,dimensions:{plot:{left:s.globals.translateX,top:s.globals.translateY,width:s.globals.gridWidth,height:s.globals.gridHeight}}}}mount(t=null){let e=this,s=e.w;return new Promise((i,a)=>{var o,r;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 j(e);let l=e.grid.drawGrid();if(e.annotations=new X(e),e.annotations.drawImageAnnos(),e.annotations.drawTextAnnos(),"back"===s.config.grid.position&&(l&&s.globals.dom.elGraphical.add(l.el),(null==(o=null==l?void 0:l.elGridBorders)?void 0:o.node)&&s.globals.dom.elGraphical.add(l.elGridBorders)),Array.isArray(t.elGraph))for(let e=0;e<t.elGraph.length;e++)s.globals.dom.elGraphical.add(t.elGraph[e]);else s.globals.dom.elGraphical.add(t.elGraph);"front"===s.config.grid.position&&(l&&s.globals.dom.elGraphical.add(l.el),(null==(r=null==l?void 0:l.elGridBorders)?void 0:r.node)&&s.globals.dom.elGraphical.add(l.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,l);let n=new V(this.ctx,l),h=new Z(this.ctx,l);if(null!==l&&(n.xAxisLabelCorrections(l.xAxisTickWidth),h.setYAxisTextAlignments(),s.config.yaxis.map((t,e)=>{-1===s.globals.ignoreYAxisIndexes.indexOf(e)&&h.yAxisTitleRotate(e,t.opposite)})),e.annotations.drawAxesAnnotations(),!s.globals.noData){if(s.config.tooltip.enabled&&!s.globals.noData&&e.w.globals.tooltip.drawTooltip(t.xyRatios),s.globals.axisCharts&&(s.globals.isXNumeric||s.config.xaxis.convertedCatToNumeric||s.globals.isRangeBar))(s.config.chart.zoom.enabled||s.config.chart.selection&&s.config.chart.selection.enabled||s.config.chart.pan&&s.config.chart.pan.enabled)&&e.zoomPanSelection.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&&e.toolbar.createToolbar()}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(){h.isBrowser()&&(window.removeEventListener("resize",this.windowResizeHandler),function(t,e){if(h.isSSR())return;let s=Me.get(e);s&&(s.disconnect(),Me.delete(e))}(this.el.parentNode,this.parentResizeHandler));const t=this.w.config.chart.id;t&&Apex._chartInstances.forEach((e,s)=>{e.id===u.escapeString(t)&&Apex._chartInstances.splice(s,1)}),new Le(this.ctx).clear({isUpdating:!1})}updateOptions(t,e=!1,s=!0,i=!0,a=!0){const o=this.w;if(o.globals.selection=void 0,this.lastUpdateOptions){if(u.shallowEqual(this.lastUpdateOptions,t))return this;if(t.series&&this.lastUpdateOptions.series&&JSON.stringify(this.lastUpdateOptions.series)===JSON.stringify(t.series)){const e=l({},t),s=l({},this.lastUpdateOptions);if(delete e.series,delete s.series,u.shallowEqual(e,s))return 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)),o.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){let s=this;s.data.resetParsingFlags(),s.w.globals.dataChanged=!0,s.series.getPreviousPaths();let i=s.w.config.series.slice();for(let e=0;e<i.length;e++)if(null!==t[e]&&void 0!==t[e])for(let s=0;s<t[e].data.length;s++)i[e].data.push(t[e].data[s]);return s.w.config.series=i,e&&(s.w.globals.initialSeries=u.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=u.clone(t),new Le(this.ctx).clear({isUpdating:!0});const i=this.create(this.w.config.series,t);if(!i)return e(this);this.mount(i).then(()=>{"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)})})}getSyncedCharts(){const t=this.getGroupedCharts();let e=[this];return t.length&&(e=[],t.forEach(t=>{e.push(t)})),e}getGroupedCharts(){return Apex._chartInstances.filter(t=>{if(t.group)return!0}).map(t=>this.w.config.chart.group===t.group?t.chart:this)}static getChartByID(t){const e=u.escapeString(t);if(!Apex._chartInstances)return;const s=Apex._chartInstances.filter(t=>t.id===e)[0];return s&&s.chart}static initOnLoad(){const t=document.querySelectorAll("[data-apexcharts]");for(let e=0;e<t.length;e++){const s=t[e],i=JSON.parse(t[e].getAttribute("data-options"));new Pe(s,i).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 u.extend(t,e)}static getThemePalettes(){return{palette1:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"],palette2:["#3F51B5","#03A9F4","#4CAF50","#F9CE1D","#FF9800"],palette3:["#33B2DF","#546E7A","#D4526E","#13D8AA","#A5978B"],palette4:["#4ECDC4","#C7F464","#81D4FA","#FD6A6A","#546E7A"],palette5:["#2B908F","#F9A3A4","#90EE7E","#FA4443","#69D2E7"],palette6:["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"],palette7:["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"],palette8:["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"],palette9:["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"],palette10:["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"]}}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){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){let i=this;s&&(i=s),i.annotations.addXaxisAnnotationExternal(t,e,i)}addYaxisAnnotation(t,e=!0,s=void 0){let i=this;s&&(i=s),i.annotations.addYaxisAnnotationExternal(t,e,i)}addPointAnnotation(t,e=!0,s=void 0){let i=this;s&&(i=s),i.annotations.addPointAnnotationExternal(t,e,i)}clearAnnotations(t=void 0){let e=this;t&&(e=t),e.annotations.clearAnnotations(e)}removeAnnotation(t,e=void 0){let s=this;e&&(s=e),s.annotations.removeAnnotation(s,t)}getChartArea(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}getSeriesTotalXRange(t,e){return this.coreUtils.getSeriesTotalsXRange(t,e)}getHighestValueInSeries(t=0){return new q(this.ctx).getMinYMaxY(t).highestY}getLowestValueInSeries(t=0){return new q(this.ctx).getMinYMaxY(t).lowestY}getSeriesTotal(){return this.w.globals.seriesTotals}toggleDataPointSelection(t,e){return this.updateHelpers.toggleDataPointSelection(t,e)}zoomX(t,e){this.ctx.toolbar.zoomUpdateOptions(t,e)}setLocale(t){this.localization.setCurrentLocaleValues(t)}dataURI(t){return new _(this.ctx).dataURI(t)}getSvgString(t){return new _(this.ctx).getSvgString(t)}exportToCSV(t={}){return new _(this.ctx).exportToCSV(t)}paper(){return this.w.globals.dom.Paper}_parentResizeCallback(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}_windowResize(){clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(()=>{this.w.globals.resized=!0,this.w.globals.dataChanged=!1,this.ctx.update()},150)}_windowResizeHandler(){let{redrawOnWindowResize:t}=this.w.config.chart;"function"==typeof t&&(t=t()),t&&this._windowResize()}}module.exports=Pe;
5
+ "use strict";var t=Object.defineProperty,e=Object.defineProperties,s=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,r=(e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,l=(t,e)=>{for(var s in e||(e={}))a.call(e,s)&&r(t,s,e[s]);if(i)for(var s of i(e))o.call(e,s)&&r(t,s,e[s]);return t},n=(t,i)=>e(t,s(i));class h{static isSSR(){return"undefined"==typeof window||"undefined"==typeof document}static isBrowser(){return!this.isSSR()}static hasAPI(t){return!this.isSSR()&&void 0!==window[t]}}class c{constructor(t,e=null){this.nodeName=t,this.namespaceURI=e,this.attributes=new Map,this.children=[],this.textContent="",this.style={},this.classList=new d,this.parentNode=null}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){return t&&t!==this&&(t.parentNode=this,this.children.push(t)),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);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 c(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}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 d{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 g{constructor(){this.SVGNS="http://www.w3.org/2000/svg",this.XLINKNS="http://www.w3.org/1999/xlink"}createElementNS(t,e){return new c(e,t)}createTextNode(t){return{nodeName:"#text",nodeType:3,textContent:t,toString(){return this.textContent}}}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 c("root");return s.innerHTML=t,{documentElement:s}}}}}let p=null,x=null,b=null;class f{static init(){h.isSSR()&&!p&&(p=new g)}static createElementNS(t,e){return h.isSSR()?(p||this.init(),p.createElementNS(t,e)):document.createElementNS(t,e)}static createTextNode(t){return h.isSSR()?(p||this.init(),p.createTextNode(t)):document.createTextNode(t)}static querySelector(t){return h.isSSR()?null:document.querySelector(t)}static querySelectorAll(t){return h.isSSR()?[]:document.querySelectorAll(t)}static getComputedStyle(t){return h.isSSR()?{}:window.getComputedStyle(t)}static getBoundingClientRect(t){return h.isSSR()?(p||this.init(),p.getBoundingClientRect(t)):t?t.getBoundingClientRect():{width:0,height:0,top:0,left:0,right:0,bottom:0,x:0,y:0}}static getXMLSerializer(){return h.isSSR()?(p||this.init(),x||(x=p.createXMLSerializer()),x):(x||(x=new XMLSerializer),x)}static getDOMParser(){return h.isSSR()?(p||this.init(),b||(b=p.createDOMParser()),b):(b||(b=new DOMParser),b)}static addWindowEventListener(t,e,s){h.isBrowser()&&window.addEventListener(t,e,s)}static removeWindowEventListener(t,e,s){h.isBrowser()&&window.removeEventListener(t,e,s)}static requestAnimationFrame(t){return h.isBrowser()?window.requestAnimationFrame(t):(t(),null)}static cancelAnimationFrame(t){h.isBrowser()&&t&&window.cancelAnimationFrame(t)}static elementExists(t){return!!t&&(h.isSSR()?!0===t._ssrMode||void 0!==t.nodeName:!!t.getRootNode&&(t.getRootNode({composed:!0})===document||t.isConnected))}static getWindow(){return h.isBrowser()?window:null}static getDocument(){return h.isBrowser()?document:null}static _getShim(){return p}static _resetShim(){p=null,x=null,b=null}}let u=class t{static bind(t,e){return function(){return t.apply(e,arguments)}}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/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}static listToArray(t){let e,s=[];for(e=0;e<t.length;e++)s[e]=t[e];return s}static extend(t,e){"function"!=typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");let e=Object(t);for(let t=1;t<arguments.length;t++){let s=arguments[t];if(null!=s)for(let t in s)Object.prototype.hasOwnProperty.call(s,t)&&(e[t]=s[t])}return e});let 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){let 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(let 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(let 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(h.isSSR())return[t._ssrWidth||400,t._ssrHeight||300];const e=t.getRootNode&&t.getRootNode();if(e&&e!==document&&e.host){const t=e.host.getBoundingClientRect();return[t.width,t.height]}let s;try{s=getComputedStyle(t,null)}catch(e){return[t.clientWidth||0,t.clientHeight||0]}let i=t.clientHeight,a=t.clientWidth;return i-=parseFloat(s.paddingTop)+parseFloat(s.paddingBottom),a-=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),[a,i]}static getBoundingClientRect(t){if(!t)return{top:0,right:0,bottom:0,left:0,width:0,height:0,x:0,y:0};if(h.isSSR())return f.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");let s=t.replace("#","");s=s.match(new RegExp("(.{"+s.length/3+"})","g"));for(let t=0;t<s.length;t++)s[t]=parseInt(1===s[t].length?s[t]+s[t]:s[t],16);return void 0!==e&&s.push(e),"rgba("+s.join(",")+")"}static getOpacityFromRGBA(t){return parseFloat(t.replace(/^.*,(.+)\)/,"$1"))}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){let s=e.split(","),i=t<0?0:255,a=t<0?-1*t:t,o=parseInt(s[0].slice(4),10),r=parseInt(s[1],10),l=parseInt(s[2],10);return"rgb("+(Math.round((i-o)*a)+o)+","+(Math.round((i-r)*a)+r)+","+(Math.round((i-l)*a)+l)+")"}shadeHexColor(t,e){let s=parseInt(e.slice(1),16),i=t<0?0:255,a=t<0?-1*t:t,o=s>>16,r=s>>8&255,l=255&s;return"#"+(16777216+65536*(Math.round((i-o)*a)+o)+256*(Math.round((i-r)*a)+r)+(Math.round((i-l)*a)+l)).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;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 getPolygonPos(t,e){let s=[],i=2*Math.PI/e;for(let a=0;a<e;a++){let 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){let 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(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t.style.key=e[s])}static preciseAddition(t,e){let 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(Number(t))===t&&!isNaN(parseInt(t,10))}static isFloat(t){return Number(t)===t&&t%1!=0}static isMsEdge(){let 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;){let 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){let 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 m{constructor(t){this.ctx=t,this.w=t.w}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()})}animateRect(t,e,s,i,a){t.attr(e).animate(i).attr(s).after(()=>a())}animatePathsGradually(t){let{el:e,realIndex:s,j:i,fill:a,pathFrom:o,pathTo:r,speed:l,delay:n}=t,h=this.w,c=0;h.config.chart.animations.animateGradually.enabled&&(c=h.config.chart.animations.animateGradually.delay),h.config.chart.animations.dynamicAnimation.enabled&&h.globals.dataChanged&&"bar"!==h.config.chart.type&&(c=0),this.morphSVG(e,s,i,"line"!==h.config.chart.type||h.globals.comboCharts?a:"stroke",o,r,l,n*c)}showDelayedElements(){this.w.globals.delayedElements.forEach(t=>{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}))}morphSVG(t,e,s,i,a,o,r,l){let n=this.w;a||(a=t.attr("pathFrom")),o||(o=t.attr("pathTo"));const h=()=>("radar"===n.config.chart.type&&(r=1),`M 0 ${n.globals.gridHeight}`);(!a||a.indexOf("undefined")>-1||a.indexOf("NaN")>-1)&&(a=h()),(!o.trim()||o.indexOf("undefined")>-1||o.indexOf("NaN")>-1)&&(o=h()),n.globals.shouldAnimate||(r=1),t.plot(a).animate(1,l).plot(a).animate(r,l).plot(o).after(()=>{u.isNumber(s)?s===n.globals.series[n.globals.maxValsInArrayIndex].length-2&&n.globals.shouldAnimate&&this.animationCompleted(t):"none"!==i&&n.globals.shouldAnimate&&(!n.globals.comboCharts&&e===n.globals.series.length-1||n.globals.comboCharts)&&this.animationCompleted(t),this.showDelayedElements()})}}class y{constructor(t){this.ctx=t,this.w=t.w}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,o;const r=this.w;if(t.unfilter&&t.unfilter(!0),"none"===s)return void this.getDefaultFilter(t,e);const l=r.config.chart.dropShadow,n="lighten"===s?2:.3;t.filterWith&&(t.filterWith(t=>{t.colorMatrix({type:"matrix",values:`\n ${n} 0 0 0 0\n 0 ${n} 0 0 0\n 0 0 ${n} 0 0\n 0 0 0 1 0\n `,in:"SourceGraphic",result:"brightness"}),l.enabled&&this.addShadow(t,e,l,"brightness")}),l.noUserSpaceOnUse||null==(a=null==(i=t.filterer())?void 0:i.node)||a.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(o=t.filterer())?void 0:o.node))}addShadow(t,e,s,i){var a;const o=this.w;let{blur:r,top:l,left:n,color:h,opacity:c}=s;if(h=Array.isArray(h)?h[e]:h,(null==(a=o.config.chart.dropShadow.enabledOnSeries)?void 0:a.length)>0&&-1===o.config.chart.dropShadow.enabledOnSeries.indexOf(e))return t;t.offset({in:i,dx:n,dy:l,result:"offset"}),t.gaussianBlur({in:"offset",stdDeviation:r,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,o,r,l;const n=this.w;return t.unfilter&&t.unfilter(!0),u.isMsEdge()&&"radialBar"===n.config.chart.type||(null==(i=n.config.chart.dropShadow.enabledOnSeries)?void 0:i.length)>0&&-1===(null==(a=n.config.chart.dropShadow.enabledOnSeries)?void 0:a.indexOf(s))||t.filterWith&&(t.filterWith(t=>{this.addShadow(t,s,e,"SourceGraphic")}),e.noUserSpaceOnUse||null==(r=null==(o=t.filterer())?void 0:o.node)||r.setAttribute("filterUnits","userSpaceOnUse"),this._scaleFilterSize(null==(l=t.filterer())?void 0:l.node)),t}setSelectionFilter(t,e,s){const i=this.w;if(void 0!==i.globals.selectedDataPoints[e]&&i.globals.selectedDataPoints[e].indexOf(s)>-1){t.node.setAttribute("selected",!0);let s=i.config.states.active.filter;"none"!==s&&this.applyFilter(t,e,s.type)}}_scaleFilterSize(t){if(!t)return;(e=>{for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.setAttribute(s,e[s])})({width:"200%",height:"200%",x:"-50%",y:"-50%"})}}class w{constructor(t){this.ctx=t,this.w=t.w}roundPathCorners(t,e){function s(t,e,s){var a=e.x-t.x,o=e.y-t.y,r=Math.sqrt(a*a+o*o);return i(t,e,Math.min(1,s/r))}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 o(t){return{x:parseFloat(t[t.length-2]),y:parseFloat(t[t.length-1])}}t.indexOf("NaN")>-1&&(t="");var r=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},[]),l=[];if(r.length>1){var n=o(r[0]),h=null;"Z"==r[r.length-1][0]&&r[0].length>2&&(h=["L",n.x,n.y],r[r.length-1]=h),l.push(r[0]);for(var c=1;c<r.length;c++){var d=l[l.length-1],g=r[c],p=g==h?r[1]:r[c+1];if(p&&d&&d.length>2&&"L"==g[0]&&p.length>2&&"L"==p[0]){var x,b,f=o(d),u=o(g),m=o(p);x=s(u,f,e),b=s(u,m,e),a(g,x),g.origPoint=u,l.push(g);var y=i(x,u,.5),w=i(u,b,.5),v=["C",y.x,y.y,w.x,w.y,b.x,b.y];v.origPoint=u,l.push(v)}else l.push(g)}if(h){var A=o(l[l.length-1]);l.push(["Z"]),a(l[0],A)}}else l=r;return l.reduce(function(t,e){return t+e.join(" ")+" "},"")}drawLine(t,e,s,i,a="#a8a8a8",o=0,r=null,l="butt"){return this.w.globals.dom.Paper.line().attr({x1:t,y1:e,x2:s,y2:i,stroke:a,"stroke-dasharray":o,"stroke-width":r,"stroke-linecap":l})}drawRect(t=0,e=0,s=0,i=0,a=0,o="#fefefe",r=1,l=null,n=null,h=0){let c=this.w.globals.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:r,"stroke-width":null!==l?l:0,stroke:null!==n?n:"none","stroke-dasharray":h}),c.node.setAttribute("fill",o),c}drawPolygon(t,e="#e1e1e1",s=1,i="none"){return this.w.globals.dom.Paper.polygon(t).attr({fill:i,stroke:e,"stroke-width":s})}drawCircle(t,e=null){t<0&&(t=0);const s=this.w.globals.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:o=1,classes:r,strokeLinecap:l=null,strokeDashArray:n=0}){let h=this.w;return null===l&&(l=h.config.stroke.lineCap),(t.indexOf("undefined")>-1||t.indexOf("NaN")>-1)&&(t=`M 0 ${h.globals.gridHeight}`),h.globals.dom.Paper.path(t).attr({fill:i,"fill-opacity":a,stroke:e,"stroke-opacity":o,"stroke-linecap":l,"stroke-width":s,"stroke-dasharray":n,class:r})}group(t=null){const e=this.w.globals.dom.Paper.group();return null!==t&&e.attr(t),e}move(t,e){return["M",t,e].join(" ")}line(t,e,s=null){let i=null;return null===s?i=[" L",t,e].join(" "):"H"===s?i=[" H",t].join(" "):"V"===s&&(i=[" V",e].join(" ")),i}curve(t,e,s,i,a,o){return["C",t,e,s,i,a,o].join(" ")}quadraticCurve(t,e,s,i){return["Q",t,e,s,i].join(" ")}arc(t,e,s,i,a,o,r,l=!1){let n="A";return l&&(n="a"),[n,t,e,s,i,a,o,r].join(" ")}renderPaths({j:t,realIndex:e,pathFrom:s,pathTo:i,stroke:a,strokeWidth:o,strokeLinecap:r,fill:h,animationDelay:c,initialSpeed:d,dataChangeSpeed:g,className:p,chartType:x,shouldClipToGrid:b=!0,bindEventsOnPaths:f=!0,drawShadow:u=!0}){let w=this.w;const v=new y(this.ctx),A=new m(this.ctx);let C,S=this.w.config.chart.animations.enabled,k=S&&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 L=!!(S&&!w.globals.resized||k&&w.globals.dataChanged&&w.globals.shouldAnimate);L?C=s:(C=i,w.globals.animationEnded=!0);let M=w.config.stroke.dashArray,P=0;P=Array.isArray(M)?M[e]:w.config.stroke.dashArray;let I=this.drawPath({d:C,stroke:a,strokeWidth:o,fill:h,fillOpacity:1,classes:p,strokeLinecap:r,strokeDashArray:P});I.attr("index",e),b&&("bar"===x&&!w.globals.isHorizontal||w.globals.comboCharts?I.attr({"clip-path":`url(#gridRectBarMask${w.globals.cuid})`}):I.attr({"clip-path":`url(#gridRectMask${w.globals.cuid})`})),w.config.chart.dropShadow.enabled&&u&&v.dropShadow(I,w.config.chart.dropShadow,e),f&&(I.node.addEventListener("mouseenter",this.pathMouseEnter.bind(this,I)),I.node.addEventListener("mouseleave",this.pathMouseLeave.bind(this,I)),I.node.addEventListener("mousedown",this.pathMouseDown.bind(this,I))),I.attr({pathTo:i,pathFrom:s});const T={el:I,j:t,realIndex:e,pathFrom:s,pathTo:i,fill:h,strokeWidth:o,delay:c};return!S||w.globals.resized||w.globals.dataChanged?!w.globals.resized&&w.globals.dataChanged||A.showDelayedElements():A.animatePathsGradually(n(l({},T),{speed:d})),w.globals.dataChanged&&k&&L&&A.animatePathsGradually(n(l({},T),{speed:g})),I}drawPattern(t,e,s,i="#a8a8a8",a=0){return this.w.globals.dom.Paper.pattern(e,s,o=>{"horizontalLines"===t?o.line(0,0,s,0).stroke({color:i,width:a+1}):"verticalLines"===t?o.line(0,0,0,e).stroke({color:i,width:a+1}):"slantedLines"===t?o.line(0,0,e,s).stroke({color:i,width:a}):"squares"===t?o.rect(e,s).fill("none").stroke({color:i,width:a}):"circles"===t&&o.circle(e).fill("none").stroke({color:i,width:a})})}drawGradient(t,e,s,i,a,o=null,r=null,l=[],n=0){let h,c=this.w;e.length<9&&0===e.indexOf("#")&&(e=u.hexToRgba(e,i)),s.length<9&&0===s.indexOf("#")&&(s=u.hexToRgba(s,a));let d=0,g=1,p=1,x=null;null!==r&&(d=void 0!==r[0]?r[0]/100:0,g=void 0!==r[1]?r[1]/100:1,p=void 0!==r[2]?r[2]/100:1,x=void 0!==r[3]?r[3]/100:null);let b=!("donut"!==c.config.chart.type&&"pie"!==c.config.chart.type&&"polarArea"!==c.config.chart.type&&"bubble"!==c.config.chart.type);if(h=l&&0!==l.length?c.globals.dom.Paper.gradient(b?"radial":"linear",t=>{(Array.isArray(l[n])?l[n]:l).forEach(e=>{t.stop(e.offset/100,e.color,e.opacity)})}):c.globals.dom.Paper.gradient(b?"radial":"linear",t=>{t.stop(d,e,i),t.stop(g,s,a),t.stop(p,s,a),null!==x&&t.stop(x,e,i)}),b){let t=c.globals.gridWidth/2,e=c.globals.gridHeight/2;"bubble"!==c.config.chart.type?h.attr({gradientUnits:"userSpaceOnUse",cx:t,cy:e,r:o}):h.attr({cx:.5,cy:.5,r:.8,fx:.2,fy:.2})}else"vertical"===t?h.from(0,0).to(0,1):"diagonal"===t?h.from(0,0).to(1,1):"horizontal"===t?h.from(0,1).to(1,1):"diagonal2"===t&&h.from(1,0).to(0,1);return h}getTextBasedOnMaxWidth({text:t,maxWidth:e,fontSize:s,fontFamily:i}){const a=this.getTextRects(t,s,i),o=a.width/t.length,r=Math.floor(e/o);return e<a.width?t.slice(0,r-3)+"...":t}drawText({x:t,y:e,text:s,textAnchor:i,fontSize:a,fontFamily:o,fontWeight:r,foreColor:n,opacity:h,maxWidth:c,cssClass:d="",isPlainText:g=!0,dominantBaseline:p="auto"}){let x=this.w;void 0===s&&(s="");let b=s;i||(i="start"),n&&n.length||(n=x.config.chart.foreColor),o=o||x.config.chart.fontFamily,r=r||"regular";const f={maxWidth:c,fontSize:a=a||"11px",fontFamily:o};let u;return Array.isArray(s)?u=x.globals.dom.Paper.text(t=>{for(let e=0;e<s.length;e++)b=s[e],c&&(b=this.getTextBasedOnMaxWidth(l({text:s[e]},f))),0===e?t.tspan(b):t.tspan(b).newLine()}):(c&&(b=this.getTextBasedOnMaxWidth(l({text:s},f))),u=g?x.globals.dom.Paper.plain(s):x.globals.dom.Paper.text(t=>t.tspan(b))),u.attr({x:t,y:e,"text-anchor":i,"dominant-baseline":p,"font-size":a,"font-family":o,"font-weight":r,fill:n,class:"apexcharts-text "+d}),u.node.style.fontFamily=o,u.node.style.opacity=h,u}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 o=5;i*=1.15,"sparkle"===s&&(i/=1.1,o=4);const r=Math.PI/o;for(let s=0;s<=2*o;s++){const o=s*r,l=s%2==0?i:i/2;a+=(0===s?"M":"L")+(t+l*Math.sin(o))+","+(e-l*Math.cos(o))}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 o=this.drawPath({d:this.getMarkerPath(t,e,s,i,a),stroke:a.pointStrokeColor,strokeDashArray:a.pointStrokeDashArray,strokeWidth:a.pointStrokeWidth,fill:a.pointFillColor,fillOpacity:a.pointFillOpacity,strokeOpacity:a.pointStrokeOpacity});return o.attr({cx:t,cy:e,shape:a.shape,class:a.class?a.class:""}),o}drawMarker(t,e,s){t=t||0;let i=s.pSize||0;return u.isNumber(e)||(i=0,e=0),this.drawMarkerShape(t,e,null==s?void 0:s.shape,i,l(l({},s),"line"===s.shape||"plus"===s.shape||"cross"===s.shape?{pointStrokeColor:s.pointFillColor,pointStrokeOpacity:s.pointFillOpacity}:{}))}pathMouseEnter(t,e){let s=this.w;const i=new y(this.ctx),a=parseInt(t.node.getAttribute("index"),10),o=parseInt(t.node.getAttribute("j"),10);if("function"==typeof s.config.chart.events.dataPointMouseEnter&&s.config.chart.events.dataPointMouseEnter(e,this.ctx,{seriesIndex:a,dataPointIndex:o,w:s}),this.ctx.events.fireEvent("dataPointMouseEnter",[e,this.ctx,{seriesIndex:a,dataPointIndex:o,w:s}]),("none"===s.config.states.active.filter.type||"true"!==t.node.getAttribute("selected"))&&"none"!==s.config.states.hover.filter.type&&!s.globals.isTouchDevice){let e=s.config.states.hover.filter;i.applyFilter(t,a,e.type)}}pathMouseLeave(t,e){let s=this.w;const i=new y(this.ctx),a=parseInt(t.node.getAttribute("index"),10),o=parseInt(t.node.getAttribute("j"),10);"function"==typeof s.config.chart.events.dataPointMouseLeave&&s.config.chart.events.dataPointMouseLeave(e,this.ctx,{seriesIndex:a,dataPointIndex:o,w:s}),this.ctx.events.fireEvent("dataPointMouseLeave",[e,this.ctx,{seriesIndex:a,dataPointIndex:o,w:s}]),"none"!==s.config.states.active.filter.type&&"true"===t.node.getAttribute("selected")||"none"!==s.config.states.hover.filter.type&&i.getDefaultFilter(t,a)}pathMouseDown(t,e){let s=this.w;const i=new y(this.ctx),a=parseInt(t.node.getAttribute("index"),10),o=parseInt(t.node.getAttribute("j"),10);let r="false";if("true"===t.node.getAttribute("selected")){if(t.node.setAttribute("selected","false"),s.globals.selectedDataPoints[a].indexOf(o)>-1){let t=s.globals.selectedDataPoints[a].indexOf(o);s.globals.selectedDataPoints[a].splice(t,1)}}else{if(!s.config.states.active.allowMultipleDataPointsSelection&&s.globals.selectedDataPoints.length>0){s.globals.selectedDataPoints=[];const t=s.globals.dom.Paper.find(".apexcharts-series path:not(.apexcharts-decoration-element)"),e=s.globals.dom.Paper.find(".apexcharts-series circle:not(.apexcharts-decoration-element), .apexcharts-series rect:not(.apexcharts-decoration-element)"),o=t=>{Array.prototype.forEach.call(t,t=>{t.node.setAttribute("selected","false"),i.getDefaultFilter(t,a)})};o(t),o(e)}t.node.setAttribute("selected","true"),r="true",void 0===s.globals.selectedDataPoints[a]&&(s.globals.selectedDataPoints[a]=[]),s.globals.selectedDataPoints[a].push(o)}if("true"===r){let e=s.config.states.active.filter;if("none"!==e)i.applyFilter(t,a,e.type);else if("none"!==s.config.states.hover.filter&&!s.globals.isTouchDevice){let e=s.config.states.hover.filter;i.applyFilter(t,a,e.type)}}else if("none"!==s.config.states.active.filter.type)if("none"===s.config.states.hover.filter.type||s.globals.isTouchDevice)i.getDefaultFilter(t,a);else{let e=s.config.states.hover.filter;i.applyFilter(t,a,e.type)}"function"==typeof s.config.chart.events.dataPointSelection&&s.config.chart.events.dataPointSelection(e,this.ctx,{selectedDataPoints:s.globals.selectedDataPoints,seriesIndex:a,dataPointIndex:o,w:s}),e&&this.ctx.events.fireEvent("dataPointSelection",[e,this.ctx,{selectedDataPoints:s.globals.selectedDataPoints,seriesIndex:a,dataPointIndex:o,w:s}])}rotateAroundCenter(t){let e={};return t&&"function"==typeof t.getBBox&&(e=t.getBBox()),{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=w._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?w._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=w._findDelegateTarget(s.target,t.node,e);i&&i.instance&&this.pathMouseDown(i.instance,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(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.setAttribute(s,e[s])}getTextRects(t,e,s,i,a=!0){let o=this.w;const r=`${t}|${e}|${s}|${i}|${a}`,l=o.globals.textRectsCache;if(l&&l.has(r))return l.get(r);let n=this.drawText({x:-200,y:-200,text:t,textAnchor:"start",fontSize:e,fontFamily:s,foreColor:"#fff",opacity:0});i&&n.attr("transform",i),o.globals.dom.Paper.add(n);let h=n.bbox();a||(h=n.node.getBoundingClientRect()),n.remove();const c={width:h.width,height:h.height};return l&&l.set(r,c),c}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 v{constructor(t){this.ctx=t,this.w=t.w}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||i++,void 0!==t.type&&t.type!==e&&a++}),a>0&&(s=!0),{comboBarCount:i,comboCharts:s}}getStackedSeriesTotals(t=[]){const e=this.w;let s=[];if(0===e.globals.series.length)return s;for(let i=0;i<e.globals.series[e.globals.maxValsInArrayIndex].length;i++){let a=0;for(let s=0;s<e.globals.series.length;s++)void 0!==e.globals.series[s][i]&&-1===t.indexOf(s)&&(a+=e.globals.series[s][i]);s.push(a)}return s}getSeriesTotalByIndex(t=null){return null===t?this.w.config.series.reduce((t,e)=>t+e,0):this.w.globals.series[t].reduce((t,e)=>t+e,0)}getStackedSeriesTotalsByGroups(){const t=this.w;let e=[];return t.globals.seriesGroups.forEach(s=>{let i=[];t.config.series.forEach((e,a)=>{s.indexOf(t.globals.seriesNames[a])>-1&&i.push(a)});const a=t.globals.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=[],i=[],a=[],o=t.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]=[]});let r=[];e.yaxis.forEach((t,i)=>{let l=!1;if(t.seriesName){let r=[];Array.isArray(t.seriesName)?r=t.seriesName:r.push(t.seriesName),r.forEach(t=>{e.series.forEach((e,r)=>{if(e.name===t){let t=r;i===r||o?(!o||a.indexOf(r)>-1)&&s[i].push([i,r]):(s[r].push([r,i]),t=i),l=!0,t=a.indexOf(t),-1!==t&&a.splice(t,1)}})})}l||r.push(i)}),s=s.map(t=>{let e=[];return t.forEach(t=>{i[t[1]]=t[0],e.push(t[1])}),e});let l=e.yaxis.length-1;for(let t=0;t<r.length&&(l=r[t],s[l]=[],a);t++){let t=a[0];a.shift(),s[l].push(t),i[t]=l}a.forEach(t=>{s[l].push(t),i[t]=l}),t.seriesYAxisMap=s.map(t=>t),t.seriesYAxisReverseMap=i.map(t=>t),t.seriesYAxisMap.forEach((t,s)=>{t.forEach(t=>{e.series[t]&&void 0===e.series[t].group&&(e.series[t].group="apexcharts-axis-".concat(s.toString()))})})}isSeriesNull(t=null){let e=[];return e=null===t?this.w.config.series.filter(t=>null!==t):this.w.config.series[t].data.filter(t=>null!==t),0===e.length}seriesHaveSameValues(t){return this.w.globals.series[t].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.globals.series.map(t=>t.length).indexOf(Math.max.apply(Math,t.globals.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.globals.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.globals.series.map((i,a)=>{let o=0;for(let r=0;r<i.length;r++)s.globals.seriesX[a][r]>t&&s.globals.seriesX[a][r]<e&&(o+=i[r]);return o})}getPercentSeries(){const t=this.w;t.globals.seriesPercent=t.globals.series.map(e=>{let s=[];if(Array.isArray(e))for(let i=0;i<e.length;i++){let a=t.globals.stackedSeriesTotals[i],o=0;a&&(o=100*e[i]/a),s.push(o)}else{let i=100*e/t.globals.seriesTotals.reduce((t,e)=>t+e,0);s.push(i)}return s})}getCalculatedRatios(){let t=this.w,e=t.globals,s=[],i=0,a=0,o=0,r=0,l=[],n=.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])),l.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]/e.gridHeight);if(a=e.xRange/e.gridWidth,i=e.yRange/e.gridWidth,o=e.xRange/e.gridHeight,r=e.zRange/e.gridHeight*16,r||(r=1),e.minY!==Number.MIN_VALUE&&0!==Math.abs(e.minY)&&(e.hasNegs=!0),t.globals.seriesYAxisReverseMap.length>0){let o=(e,i)=>{let a=t.config.yaxis[t.globals.seriesYAxisReverseMap[i]],o=e<0?-1:1;return e=Math.abs(e),a.logarithmic&&(e=this.getBaseLog(a.logBase,e)),-o*e/s[i]};if(e.isMultipleYAxis){l=[];for(let t=0;t<s.length;t++)l.push(o(e.minYArr[t],t))}else l=[],l.push(o(e.minY,0)),e.minY!==Number.MIN_VALUE&&0!==Math.abs(e.minY)&&(n=-e.minY/i,h=e.minX/a)}else l=[],l.push(0),n=0,h=0;return{yRatio:s,invertedYRatio:i,zRatio:r,xRatio:a,invertedXRatio:o,baseLineInvertedY:n,baseLineY:l,baseLineX:h}}getLogSeries(t){const e=this.w;return e.globals.seriesLog=t.map((t,s)=>{let 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;let 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]),o=(0===i.globals.maxYArr[s]?0:this.getBaseLog(t,i.globals.maxYArr[s]))-a;if(e<1)return e/o;return(this.getBaseLog(t,e)-a)/o}getLogYRatios(t){const e=this.w,s=this.w.globals;return s.yLogRatio=t.slice(),s.logYRange=s.yRange.map((t,i)=>{let a=e.globals.seriesYAxisReverseMap[i];if(e.config.yaxis[a]&&this.w.config.yaxis[a].logarithmic){let t=-Number.MAX_VALUE,a=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),a=Math.min(s,a))})}),o=Math.pow(s.yRange[i],Math.abs(a-t)/s.yRange[i]),s.yLogRatio[i]=o/s.gridHeight,o}}),s.invalidLogScale?t.slice():s.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){let a=this.w,o=[];return t.series.length>0&&e.forEach(e=>{let r=[],l=[];t.i.forEach((s,i)=>{a.config.series[s].group===e&&(r.push(t.series[i]),l.push(s))}),r.length>0&&o.push(i.draw(r,s,l))}),o}}let A=class{constructor(t){this.w=t.w,this.annoCtx=t}setOrientations(t,e=null){const s=this.w;if("vertical"===t.label.orientation){const i=null!==e?e:0,a=s.globals.dom.baseEl.querySelector(`.apexcharts-xaxis-annotations .apexcharts-xaxis-annotation-label[rel='${i}']`);if(null!==a){const e=a.getBBox();a.setAttribute("x",parseFloat(a.getAttribute("x"))-e.height+4);const s="top"===t.label.position?e.width:-e.width;a.setAttribute("y",parseFloat(a.getAttribute("y"))+s);const{x:i,y:o}=this.annoCtx.graphics.rotateAroundCenter(a);a.setAttribute("transform",`rotate(-90 ${i} ${o})`)}}}addBackgroundToAnno(t,e){const s=this.w;if(!t||!e.label.text||!String(e.label.text).trim())return null;const i=s.globals.dom.baseEl.querySelector(".apexcharts-grid"),a=i.getBoundingClientRect(),o=i.getBBox(),r=a.width/o.width||1,l=t.getBoundingClientRect();let{left:n,right:h,top:c,bottom:d}=e.label.style.padding;"vertical"===e.label.orientation&&([c,d,n,h]=[n,h,c,d]);const g=(l.left-a.left)/r-n,p=(l.top-a.top)/r-c,x=this.annoCtx.graphics.drawRect(g-s.globals.barPadForNumericAxis,p,l.width/r+n+h,l.height/r+c+d,e.label.borderRadius,e.label.style.background,1,e.label.borderWidth,e.label.borderColor,0);return e.id&&x.node.classList.add(e.id),x}annotationsBackground(){const t=this.w,e=(e,s,i)=>{const a=t.globals.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${s}']`);if(a){const t=a.parentNode,s=this.addBackgroundToAnno(a,e);s&&(t.insertBefore(s.node,a),e.label.mouseEnter&&s.node.addEventListener("mouseenter",e.label.mouseEnter.bind(this,e)),e.label.mouseLeave&&s.node.addEventListener("mouseleave",e.label.mouseLeave.bind(this,e)),e.label.click&&s.node.addEventListener("click",e.label.click.bind(this,e)))}};t.config.annotations.xaxis.forEach((t,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;const i=this.w;let a,o="y1"===t?e.y:e.y2,r=!1;if(this.annoCtx.invertAxis){const t=i.config.xaxis.convertedCatToNumeric?i.globals.categoryLabels:i.globals.labels,s=t.indexOf(o),r=i.globals.dom.baseEl.querySelector(`.apexcharts-yaxis-texts-g text:nth-child(${s+1})`);a=r?parseFloat(r.getAttribute("y")):(i.globals.gridHeight/t.length-1)*(s+1)-i.globals.barHeight,void 0!==e.seriesIndex&&i.globals.barHeight&&(a-=i.globals.barHeight/2*(i.globals.series.length-1)-i.globals.barHeight*e.seriesIndex)}else{const t=i.globals.seriesYAxisMap[e.yAxisIndex][0],l=i.config.yaxis[e.yAxisIndex].logarithmic?new v(this.annoCtx.ctx).getLogVal(i.config.yaxis[e.yAxisIndex].logBase,o,t)/i.globals.yLogRatio[t]:(o-i.globals.minYArr[t])/(i.globals.yRange[t]/i.globals.gridHeight);a=i.globals.gridHeight-Math.min(Math.max(l,0),i.globals.gridHeight),r=l>i.globals.gridHeight||l<0,!e.marker||void 0!==e.y&&null!==e.y||(a=0),(null==(s=i.config.yaxis[e.yAxisIndex])?void 0:s.reversed)&&(a=l)}return"string"==typeof o&&o.includes("px")&&(a=parseFloat(o)),{yP:a,clipped:r}}getX1X2(t,e){const s=this.w,i="x1"===t?e.x:e.x2,a=this.annoCtx.invertAxis?s.globals.minY:s.globals.minX,o=this.annoCtx.invertAxis?s.globals.maxY:s.globals.maxX,r=this.annoCtx.invertAxis?s.globals.yRange[0]:s.globals.xRange;let l=!1,n=this.annoCtx.inversedReversedAxis?(o-i)/(r/s.globals.gridWidth):(i-a)/(r/s.globals.gridWidth);return"category"!==s.config.xaxis.type&&!s.config.xaxis.convertedCatToNumeric||this.annoCtx.invertAxis||s.globals.dataFormatXNumeric||s.config.chart.sparkline.enabled||(n=this.getStringX(i)),"string"==typeof i&&i.includes("px")&&(n=parseFloat(i)),null==i&&e.marker&&(n=s.globals.gridWidth),void 0!==e.seriesIndex&&s.globals.barWidth&&!this.annoCtx.invertAxis&&(n-=s.globals.barWidth/2*(s.globals.series.length-1)-s.globals.barWidth*e.seriesIndex),"number"!=typeof n&&(n=0,l=!0),parseFloat(n.toFixed(10))>parseFloat(s.globals.gridWidth.toFixed(10))?(n=s.globals.gridWidth,l=!0):n<0&&(n=0,l=!0),{x:n,clipped:l}}getStringX(t){const e=this.w;let s=t;e.config.xaxis.convertedCatToNumeric&&e.globals.categoryLabels.length&&(t=e.globals.categoryLabels.indexOf(t)+1);const i=e.globals.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(t),a=e.globals.dom.baseEl.querySelector(`.apexcharts-xaxis-texts-g text:nth-child(${i+1})`);return a&&(s=parseFloat(a.getAttribute("x"))),s}};class C{constructor(t){this.w=t.w,this.annoCtx=t,this.invertAxis=this.annoCtx.invertAxis,this.helpers=new A(this.annoCtx)}addXaxisAnnotation(t,e,s){let i,a=this.w,o=this.helpers.getX1X2("x1",t),r=o.x,l=o.clipped,n=!0;const h=t.label.text;let c=t.strokeDashArray;if(u.isNumber(r)){if(null===t.x2||void 0===t.x2){if(!l){let s=this.annoCtx.graphics.drawLine(r+t.offsetX,0+t.offsetY,r+t.offsetX,a.globals.gridHeight+t.offsetY,t.borderColor,c,t.borderWidth);e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}else{let s=this.helpers.getX1X2("x2",t);if(i=s.x,n=s.clipped,i<r){let t=r;r=i,i=t}let o=this.annoCtx.graphics.drawRect(r+t.offsetX,0+t.offsetY,i-r,a.globals.gridHeight+t.offsetY,0,t.fillColor,t.opacity,1,t.borderColor,c);o.node.classList.add("apexcharts-annotation-rect"),o.attr("clip-path",`url(#gridRectMask${a.globals.cuid})`),e.appendChild(o.node),t.id&&o.node.classList.add(t.id)}if(!l||!n){let i=this.annoCtx.graphics.getTextRects(h,parseFloat(t.label.style.fontSize)),o="top"===t.label.position?4:"center"===t.label.position?a.globals.gridHeight/2+("vertical"===t.label.orientation?i.width/2:0):a.globals.gridHeight,l=this.annoCtx.graphics.drawText({x:r+t.label.offsetX,y:o+t.label.offsetY-("vertical"===t.label.orientation?"top"===t.label.position?i.width/2-12:-i.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:""}`});l.attr({rel:s}),e.appendChild(l.node),this.annoCtx.helpers.setOrientations(t,s)}}}drawXAxisAnnotations(){let 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 S{constructor(t){this.ctx=t,this.w=t.w,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;let a=["\0",...s.months],o=["\x01",...s.shortMonths],r=["\x02",...s.days],l=["\x03",...s.shortDays];function n(t,e){let s=t+"";for(e=e||2;s.length<e;)s="0"+s;return s}let 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);let c=(i?t.getUTCMonth():t.getMonth())+1;e=(e=(e=(e=e.replace(/(^|[^\\])MMMM+/g,"$1"+a[0])).replace(/(^|[^\\])MMM/g,"$1"+o[0])).replace(/(^|[^\\])MM/g,"$1"+n(c))).replace(/(^|[^\\])M/g,"$1"+c);let d=i?t.getUTCDate():t.getDate();e=(e=(e=(e=e.replace(/(^|[^\\])dddd+/g,"$1"+r[0])).replace(/(^|[^\\])ddd/g,"$1"+l[0])).replace(/(^|[^\\])dd/g,"$1"+n(d))).replace(/(^|[^\\])d/g,"$1"+d);let g=i?t.getUTCHours():t.getHours(),p=g>12?g-12:0===g?12:g;e=(e=(e=(e=e.replace(/(^|[^\\])HH+/g,"$1"+n(g))).replace(/(^|[^\\])H/g,"$1"+g)).replace(/(^|[^\\])hh+/g,"$1"+n(p))).replace(/(^|[^\\])h/g,"$1"+p);let x=i?t.getUTCMinutes():t.getMinutes();e=(e=e.replace(/(^|[^\\])mm+/g,"$1"+n(x))).replace(/(^|[^\\])m/g,"$1"+x);let b=i?t.getUTCSeconds():t.getSeconds();e=(e=e.replace(/(^|[^\\])ss+/g,"$1"+n(b))).replace(/(^|[^\\])s/g,"$1"+b);let f=i?t.getUTCMilliseconds():t.getMilliseconds();e=e.replace(/(^|[^\\])fff+/g,"$1"+n(f,3)),f=Math.round(f/10),e=e.replace(/(^|[^\\])ff/g,"$1"+n(f)),f=Math.round(f/10);let u=g<12?"AM":"PM";e=(e=(e=e.replace(/(^|[^\\])f/g,"$1"+f)).replace(/(^|[^\\])TT+/g,"$1"+u)).replace(/(^|[^\\])T/g,"$1"+u.charAt(0));let m=u.toLowerCase();e=(e=e.replace(/(^|[^\\])tt+/g,"$1"+m)).replace(/(^|[^\\])t/g,"$1"+m.charAt(0));let y=-t.getTimezoneOffset(),w=i||!y?"Z":y>0?"+":"-";if(!i){y=Math.abs(y);let t=y%60;w+=n(Math.floor(y/60))+":"+n(t)}e=e.replace(/(^|[^\\])K/g,"$1"+w);let v=(i?t.getUTCDay():t.getDay())+1;return e=(e=(e=(e=(e=e.replace(new RegExp(r[0],"g"),r[v])).replace(new RegExp(l[0],"g"),l[v])).replace(new RegExp(a[0],"g"),a[c])).replace(new RegExp(o[0],"g"),o[c])).replace(/\\(.)/g,"$1")}getTimeUnitsfromTimestamp(t,e){let 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),o=this.formatDate(i,"yyyy MM dd HH mm ss fff").split(" "),r=this.formatDate(a,"yyyy MM dd HH mm ss fff").split(" ");return{minMillisecond:parseInt(o[6],10),maxMillisecond:parseInt(r[6],10),minSecond:parseInt(o[5],10),maxSecond:parseInt(r[5],10),minMinute:parseInt(o[4],10),maxMinute:parseInt(r[4],10),minHour:parseInt(o[3],10),maxHour:parseInt(r[3],10),minDate:parseInt(o[2],10),maxDate:parseInt(r[2],10),minMonth:parseInt(o[1],10)-1,maxMonth:parseInt(r[1],10)-1,minYear:parseInt(o[0],10),maxYear:parseInt(r[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()&&i++,i}determineDaysOfMonths(t,e){let s=30;switch(t=u.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}}class k{constructor(t){this.ctx=t,this.w=t.w,this.tooltipKeyFormat="dd MMM"}xLabelFormat(t,e,s,i){let a=this.w;if("datetime"===a.config.xaxis.type&&void 0===a.config.xaxis.labels.formatter&&void 0===a.config.tooltip.x.formatter){let t=new S(this.ctx);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){let s=this.w;if(u.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=t==e?e:t.toFixed(1)}return t}setLabelFormatters(){let t=this.w;return t.globals.xaxisTooltipFormatter=t=>this.defaultGeneralFormatter(t),t.globals.ttKeyFormatter=t=>this.defaultGeneralFormatter(t),t.globals.ttZFormatter=t=>t,t.globals.legendFormatter=t=>this.defaultGeneralFormatter(t),void 0!==t.config.xaxis.labels.formatter?t.globals.xLabelFormatter=t.config.xaxis.labels.formatter:t.globals.xLabelFormatter=e=>{if(u.isNumber(e)){if(!t.config.xaxis.convertedCatToNumeric&&"numeric"===t.config.xaxis.type){if(u.isNumber(t.config.xaxis.decimalsInFloat))return e.toFixed(t.config.xaxis.decimalsInFloat);{const s=t.globals.maxX-t.globals.minX;return s>0&&s<100?e.toFixed(1):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?t.globals.ttKeyFormatter=t.config.tooltip.x.formatter:t.globals.ttKeyFormatter=t.globals.xLabelFormatter,"function"==typeof t.config.xaxis.tooltip.formatter&&(t.globals.xaxisTooltipFormatter=t.config.xaxis.tooltip.formatter),(Array.isArray(t.config.tooltip.y)||void 0!==t.config.tooltip.y.formatter)&&(t.globals.ttVal=t.config.tooltip.y),void 0!==t.config.tooltip.z.formatter&&(t.globals.ttZFormatter=t.config.tooltip.z.formatter),void 0!==t.config.legend.formatter&&(t.globals.legendFormatter=t.config.legend.formatter),t.config.yaxis.forEach((e,s)=>{void 0!==e.labels.formatter?t.globals.yLabelFormatters[s]=e.labels.formatter:t.globals.yLabelFormatters[s]=i=>t.globals.xyCharts?Array.isArray(i)?i.map(t=>this.defaultYFormatter(t,e,s)):this.defaultYFormatter(i,e,s):i}),t.globals}heatmapLabelFormatters(){const t=this.w;if("heatmap"===t.config.chart.type){t.globals.yAxisScale[0].result=t.globals.seriesNames.slice();let e=t.globals.seriesNames.reduce((t,e)=>t.length>e.length?t:e,0);t.globals.yAxisScale[0].niceMax=e,t.globals.yAxisScale[0].niceMin=e}}}class L{constructor(t){this.ctx=t,this.w=t.w}getLabel(t,e,s,i,a=[],o="12px",r=!0){const l=this.w;let n=void 0===t[i]?"":t[i],h=n,c=l.globals.xLabelFormatter,d=l.config.xaxis.labels.formatter,g=!1,p=new k(this.ctx),x=n;r&&(h=p.xLabelFormat(c,n,x,{i:i,dateFormatter:new S(this.ctx).formatDate,w:l}),void 0!==d&&(h=d(n,t[i],{i:i,dateFormatter:new S(this.ctx).formatDate,w:l})));e.length>0?(g=(t=>{let s=null;return e.forEach(t=>{"month"===t.unit?s="year":"day"===t.unit?s="month":"hour"===t.unit?s="day":"minute"===t.unit&&(s="hour")}),s===t})(e[i].unit),s=e[i].position,h=e[i].value):"datetime"===l.config.xaxis.type&&void 0===d&&(h=""),void 0===h&&(h=""),h=Array.isArray(h)?h:h.toString();let b=new w(this.ctx),f={};f=l.globals.rotateXLabels&&r?b.getTextRects(h,parseInt(o,10),null,`rotate(${l.config.xaxis.labels.rotate} 0 0)`,!1):b.getTextRects(h,parseInt(o,10));const u=!l.config.xaxis.labels.showDuplicates&&this.ctx.timeScale;return!Array.isArray(h)&&("NaN"===String(h)||a.indexOf(h)>=0&&u)&&(h=""),{x:s,text:h,textRect:f,isBold:g}}checkLabelBasedOnTickamount(t,e,s){const i=this.w;let a=i.config.xaxis.tickAmount;return"dataPoints"===a&&(a=Math.round(i.globals.gridWidth/120)),a>s||t%Math.round(s/(a+1))===0||(e.text=""),e}checkForOverflowingLabels(t,e,s,i,a){const o=this.w;if(0===t&&o.globals.skipFirstTimelinelabel&&(e.text=""),t===s-1&&o.globals.skipLastTimelinelabel&&(e.text=""),o.config.xaxis.labels.hideOverlappingLabels&&i.length>0){const t=a[a.length-1];if(o.config.xaxis.labels.trim&&"datetime"!==o.config.xaxis.type)return e;e.x<t.textRect.width/(o.globals.rotateXLabels?Math.abs(o.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 s.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 v(this.ctx);return s.every(t=>i.isSeriesNull(t))}return!1}getYAxisForeColor(t,e){const s=this.w;return Array.isArray(t)&&s.globals.yAxisScale[e]&&this.ctx.theme.pushExtraColors(t,s.globals.yAxisScale[e].result.length,!1),t}drawYAxisTicks(t,e,s,i,a,o,r){let l=this.w,n=new w(this.ctx),h=l.globals.translateY+l.config.yaxis[a].labels.offsetY;if(l.globals.isBarHorizontal?h=0:"heatmap"===l.config.chart.type&&(h+=o/2),i.show&&e>0){!0===l.config.yaxis[a].opposite&&(t+=i.width);for(let a=e;a>=0;a--){let e=n.drawLine(t+s.offsetX-i.width+i.offsetX,h+i.offsetY,t+s.offsetX+i.offsetX,h+i.offsetY,i.color);r.add(e),h+=o}}}}class M{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new A(this.annoCtx),this.axesUtils=new L(this.annoCtx)}addYaxisAnnotation(t,e,s){let i,a=this.w,o=t.strokeDashArray,r=this.helpers.getY1Y2("y1",t),l=r.yP,n=r.clipped,h=!0,c=!1;const d=t.label.text;if(null===t.y2||void 0===t.y2){if(!n){c=!0;let s=this.annoCtx.graphics.drawLine(0+t.offsetX,l+t.offsetY,this._getYAxisAnnotationWidth(t),l+t.offsetY,t.borderColor,o,t.borderWidth);e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}else{if(r=this.helpers.getY1Y2("y2",t),i=r.yP,h=r.clipped,i>l){let t=l;l=i,i=t}if(!n||!h){c=!0;let s=this.annoCtx.graphics.drawRect(0+t.offsetX,i+t.offsetY,this._getYAxisAnnotationWidth(t),l-i,0,t.fillColor,t.opacity,1,t.borderColor,o);s.node.classList.add("apexcharts-annotation-rect"),s.attr("clip-path",`url(#gridRectMask${a.globals.cuid})`),e.appendChild(s.node),t.id&&s.node.classList.add(t.id)}}if(c){let o="right"===t.label.position?a.globals.gridWidth:"center"===t.label.position?a.globals.gridWidth/2:0,r=this.annoCtx.graphics.drawText({x:o+t.label.offsetX,y:(null!=i?i:l)+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.globals.gridWidth;return s=t.width.indexOf("%")>-1?e.globals.gridWidth*parseInt(t.width,10)/100:parseInt(t.width,10),s+t.offsetX}drawYAxisAnnotations(){const t=this.w;let 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 P{constructor(t){this.w=t.w,this.annoCtx=t,this.helpers=new A(this.annoCtx)}addPointAnnotation(t,e,s){if(this.w.globals.collapsedSeriesIndices.indexOf(t.seriesIndex)>-1)return;let i=this.helpers.getX1X2("x1",t),a=i.x,o=i.clipped;i=this.helpers.getY1Y2("y1",t);let r=i.yP,l=i.clipped;if(u.isNumber(a)&&!l&&!o){let i={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:""}`},o=this.annoCtx.graphics.drawMarker(a+t.marker.offsetX,r+t.marker.offsetY,i);e.appendChild(o.node);const l=t.label.text?t.label.text:"";let n=this.annoCtx.graphics.drawText({x:a+t.label.offsetX,y:r+t.label.offsetY-t.marker.size-parseFloat(t.label.style.fontSize)/1.6,text:l,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(n.attr({rel:s}),e.appendChild(n.node),t.customSVG.SVG){let s=this.annoCtx.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass});s.attr({transform:`translate(${a+t.customSVG.offsetX}, ${r+t.customSVG.offsetY})`}),s.node.innerHTML=t.customSVG.SVG,e.appendChild(s.node)}if(t.image.path){let e=t.image.width?t.image.width:20,s=t.image.height?t.image.height:20;o=this.annoCtx.addImage({x:a+t.image.offsetX-e/2,y:r+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(){let 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}}const I={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 T{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,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:[]},chart:{animations:{enabled:!0,speed:800,animateGradually:{delay:150,enabled:!0},dynamicAnimation:{enabled:!0,speed:350}},background:"",locales:[I],defaultLocale:"en",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,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},stacked:!1,stackOnlyBar:!0,stackType:"normal",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,zoomedArea:{fill:{color:"#90CAF9",opacity:.4},stroke:{color:"#0D47A1",opacity:.4,width:1}}},accessibility:{enabled:!0,description:void 0,announcements:{enabled:!0},keyboard:{enabled:!0}}},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},candlestick:{colors:{upward:"#00B746",downward:"#EF403C"},wick:{useFillColor:!0}},boxPlot:{colors:{upper:"#00E396",lower:"#008FFB"}},heatmap:{radius:2,enableShades:!0,shadeIntensity:.5,reverseNegativeShade:!1,distributed:!1,useFillColorAsStroke:!1,colorScale:{inverse:!1,ranges:[],min:void 0,max:void 0}},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,hollow:{margin:5,size:"50%",background:"transparent",image:void 0,imageWidth:150,imageHeight:150,imageOffsetX:0,imageOffsetY:0,imageClipped:!0,position:"front",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.globals.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},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:[],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",verticalAlign:"middle",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,custom:void 0,fillSeriesColor:!1,theme:"light",cssClass:"",style:{fontSize:"12px",fontFamily: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 'yy",day:"dd MMM",hour:"HH:mm",minute:"HH:mm:ss",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:!0,offsetY:0,formatter:void 0,style:{fontSize:"12px",fontFamily:void 0}}},yaxis:this.yAxis,theme:{mode:"",palette:"palette1",monochrome:{enabled:!1,color:"#008FFB",shadeTo:"light",shadeIntensity:.65}}}}}class X{constructor(t){this.ctx=t,this.w=t.w,this.graphics=new w(this.ctx),this.w.globals.isBarHorizontal&&(this.invertAxis=!0),this.helpers=new A(this),this.xAxisAnnotations=new C(this),this.yAxisAnnotations=new M(this),this.pointsAnnotations=new P(this),this.w.globals.isBarHorizontal&&this.w.config.yaxis[0].reversed&&(this.inversedReversedAxis=!0),this.xDivision=this.w.globals.gridWidth/this.w.globals.dataPoints}drawAxesAnnotations(){const t=this.w;if(t.globals.axisCharts&&t.globals.dataPoints){let e=this.yAxisAnnotations.drawYAxisAnnotations(),s=this.xAxisAnnotations.drawXAxisAnnotations(),i=this.pointsAnnotations.drawPointAnnotations();const a=t.config.chart.animations.enabled,o=[e,s,i],r=[s.node,e.node,i.node];for(let e=0;e<3;e++)t.globals.dom.elGraphical.add(o[e]),!a||t.globals.resized||t.globals.dataChanged||"scatter"!==t.config.chart.type&&"bubble"!==t.config.chart.type&&t.globals.dataPoints>1&&r[e].classList.add("apexcharts-element-hidden"),t.globals.delayedElements.push({el:r[e],index:0});this.helpers.annotationsBackground()}}drawImageAnnos(){this.w.config.annotations.images.map((t,e)=>{this.addImage(t,e)})}drawTextAnnos(){this.w.config.annotations.texts.map((t,e)=>{this.addText(t,e)})}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:o,fontSize:r,fontFamily:l,fontWeight:n,cssClass:h,backgroundColor:c,borderWidth:d,strokeDashArray:g,borderRadius:p,borderColor:x,appendTo:b=".apexcharts-svg",paddingLeft:f=4,paddingRight:u=4,paddingBottom:m=2,paddingTop:y=2}=t,w=this.w;let v=this.graphics.drawText({x:e,y:s,text:i,textAnchor:a||"start",fontSize:r||"12px",fontWeight:n||"regular",fontFamily:l||w.config.chart.fontFamily,foreColor:o||w.config.chart.foreColor,cssClass:h});const A=w.globals.dom.baseEl.querySelector(b);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+u,C.height+m+y,p,c||"transparent",1,d,x,g);A.insertBefore(t.node,v.node)}}addImage(t){const e=this.w,{path:s,x:i=0,y:a=0,width:o=20,height:r=20,appendTo:l=".apexcharts-svg"}=t;let n=e.globals.dom.Paper.image(s);n.size(o,r).move(i,a);const h=e.globals.dom.baseEl.querySelector(l);return h&&h.appendChild(n.node),n}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 o=s,r=o.w,l=r.globals.dom.baseEl.querySelector(`.apexcharts-${i}-annotations`),n=l.childNodes.length+1,h=new T,c=Object.assign({},"xaxis"===i?h.xAxisAnnotation:"yaxis"===i?h.yAxisAnnotation:h.pointAnnotation),d=u.extend(c,t);switch(i){case"xaxis":this.addXaxisAnnotation(d,l,n);break;case"yaxis":this.addYaxisAnnotation(d,l,n);break;case"point":this.addPointAnnotation(d,l,n)}let g=r.globals.dom.baseEl.querySelector(`.apexcharts-${i}-annotations .apexcharts-${i}-annotation-label[rel='${n}']`);const p=this.helpers.addBackgroundToAnno(g,d);return p&&l.insertBefore(p.node,g),e&&r.globals.memory.methodsToExec.push({context:o,id:d.id?d.id:u.randomId(),method:a,label:"addAnnotation",params:t}),s}clearAnnotations(t){const e=t.w;let s=e.globals.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);s=u.listToArray(s),Array.prototype.forEach.call(s,t=>{for(;t.firstChild;)t.removeChild(t.firstChild)})}removeAnnotation(t,e){const s=t.w;let i=s.globals.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)}))}}const z=({isTimeline:t,ctx:e,seriesIndex:s,dataPointIndex:i,y1:a,y2:o,w:r})=>{var l;let n=r.globals.seriesRangeStart[s][i],h=r.globals.seriesRangeEnd[s][i],c=r.globals.labels[i],d=r.config.series[s].name?r.config.series[s].name:"";const g=r.globals.ttKeyFormatter,p=r.config.tooltip.y.title.formatter,x={w:r,seriesIndex:s,dataPointIndex:i,start:n,end:h};if("function"==typeof p&&(d=p(d,x)),(null==(l=r.config.series[s].data[i])?void 0:l.x)&&(c=r.config.series[s].data[i].x),!t&&"datetime"===r.config.xaxis.type){c=new k(e).xLabelFormat(r.globals.ttKeyFormatter,c,c,{i:void 0,dateFormatter:new S(e).formatDate,w:r})}"function"==typeof g&&(c=g(c,x)),Number.isFinite(a)&&Number.isFinite(o)&&(n=a,h=o);let b="",f="";const u=r.globals.colors[s];if(void 0===r.config.tooltip.x.formatter)if("datetime"===r.config.xaxis.type){let t=new S(e);b=t.formatDate(t.getDate(n),r.config.tooltip.x.format),f=t.formatDate(t.getDate(h),r.config.tooltip.x.format)}else b=n,f=h;else b=r.config.tooltip.x.formatter(n),f=r.config.tooltip.x.formatter(h);return{start:n,end:h,startVal:b,endVal:f,ylabel:c,color:u,seriesName:d}},E=t=>{let{color:e,seriesName:s,ylabel:i,start:a,end:o,seriesIndex:r,dataPointIndex:l}=t;const n=t.ctx.tooltip.tooltipLabels.getFormatters(r);a=n.yLbFormatter(a),o=n.yLbFormatter(o);const h=n.yLbFormatter(t.w.globals.series[r][l]);let c="";const d=`<span class="value start-value">\n ${a}\n </span> <span class="separator">-</span> <span class="value end-value">\n ${o}\n </span>`;return c=t.w.globals.comboCharts?"rangeArea"===t.w.config.series[r].type||"rangeBar"===t.w.config.series[r].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 Y{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 u.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(),n(l({},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}}})}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}}}}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.globals.seriesRangeStart[e][s];return i.globals.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:o}=z(n(l({},t),{isTimeline:!0}));return E(n(l({},t),{color:e,seriesName:s,ylabel:i,start:a,end:o}))})(t):(t=>{const{color:e,seriesName:s,ylabel:i,start:a,end:o}=z(t);return E(n(l({},t),{color:e,seriesName:s,ylabel:i,start:a,end:o}))})(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:o}=z(t);return E(n(l({},t),{color:e,seriesName:s,ylabel:i,start:a,end:o}))})(t)}}}brush(t){return u.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 n(l({},t),{plotOptions:n(l({},t.plotOptions),{bar:n(l({},t.plotOptions.bar),{borderRadiusApplication:"end",borderRadiusWhenStacked:"last"})})})}convertCatToNumeric(t){return t.xaxis.convertedCatToNumeric=!0,t}convertCatToNumericXaxis(t,e,s){t.xaxis.type="numeric",t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return u.isNumber(t)?Math.floor(t):t};const i=t.xaxis.labels.formatter;let a=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return s&&s.length&&(a=s.map(t=>Array.isArray(t)?t:String(t))),a&&a.length&&(t.xaxis.labels.formatter=function(t){return u.isNumber(t)?i(a[Math.floor(t)-1]):i(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}},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 o=t.globals.seriesCandleO[e][s],r=t.globals.seriesCandleH[e][s],l=t.globals.seriesCandleM[e][s],n=t.globals.seriesCandleL[e][s],h=t.globals.seriesCandleC[e][s];return t.config.series[e].type&&t.config.series[e].type!==a?`<div class="apexcharts-custom-tooltip">\n ${t.config.series[e].name?t.config.series[e].name:"series-"+(e+1)}: <strong>${t.globals.series[e][s]}</strong>\n </div>`:`<div class="apexcharts-tooltip-box apexcharts-tooltip-${t.config.chart.type}"><div>${i[0]}: <span class="value">`+o+`</span></div><div>${i[1]}: <span class="value">`+r+"</span></div>"+(l?`<div>${i[2]}: <span class="value">`+l+"</span></div>":"")+`<div>${i[3]}: <span class="value">`+n+`</span></div><div>${i[4]}: <span class="value">`+h+"</span></div></div>"}}class R{constructor(t){this.opts=t}init({responsiveOverride:t}){var e,s,i,a,o,r,l,n,h,c;let d=this.opts,g=new T,p=new Y(d);this.chartType=d.chart.type,d=this.extendYAxis(d),d=this.extendAnnotations(d);let x=g.init(),b={};if(d&&"object"==typeof d){let g={};g=-1!==["line","area","bar","candlestick","boxPlot","rangeBar","rangeArea","bubble","scatter","heatmap","treemap","pie","polarArea","donut","radar","radialBar"].indexOf(d.chart.type)?p[d.chart.type]():p.line(),(null==(s=null==(e=d.plotOptions)?void 0:e.bar)?void 0:s.isFunnel)&&(g=p.funnel()),d.chart.stacked&&"bar"===d.chart.type&&(g=p.stackedBars()),(null==(i=d.chart.brush)?void 0:i.enabled)&&(g=p.brush(g)),(null==(o=null==(a=d.plotOptions)?void 0:a.line)?void 0:o.isSlopeChart)&&(g=p.slope()),d.chart.stacked&&"100%"===d.chart.stackType&&(d=p.stacked100(d)),(null==(l=null==(r=d.plotOptions)?void 0:r.bar)?void 0:l.isDumbbell)&&(d=p.dumbbell(d)),this.checkForDarkTheme(window.Apex),this.checkForDarkTheme(d),d.xaxis=d.xaxis||window.Apex.xaxis||{},t||(d.xaxis.convertedCatToNumeric=!1),d=this.checkForCatToNumericXAxis(this.chartType,g,d),((null==(n=d.chart.sparkline)?void 0:n.enabled)||(null==(c=null==(h=window.Apex.chart)?void 0:h.sparkline)?void 0:c.enabled))&&(g=p.sparkline(g)),b=u.extend(x,g)}let f=u.extend(b,window.Apex);return x=u.extend(f,d),x=this.handleUserInputErrors(x),x}checkForCatToNumericXAxis(t,e,s){var i,a;let o=new Y(s);const r=("bar"===t||"boxPlot"===t)&&(null==(a=null==(i=s.plotOptions)?void 0:i.bar)?void 0:a.horizontal),l="pie"===t||"polarArea"===t||"donut"===t||"radar"===t||"radialBar"===t||"heatmap"===t,n="datetime"!==s.xaxis.type&&"numeric"!==s.xaxis.type;let h=s.xaxis.tickPlacement?s.xaxis.tickPlacement:e.xaxis&&e.xaxis.tickPlacement;return r||l||!n||"between"===h||(s=o.convertCatToNumeric(s)),s}extendYAxis(t,e){let s=new T;(void 0===t.yaxis||!t.yaxis||Array.isArray(t.yaxis)&&0===t.yaxis.length)&&(t.yaxis={}),t.yaxis.constructor!==Array&&window.Apex.yaxis&&window.Apex.yaxis.constructor!==Array&&(t.yaxis=u.extend(t.yaxis,window.Apex.yaxis)),t.yaxis.constructor!==Array?t.yaxis=[u.extend(s.yAxis,t.yaxis)]:t.yaxis=u.extendArray(t.yaxis,s.yAxis);let i=!1;t.yaxis.forEach(t=>{t.logarithmic&&(i=!0)});let a=t.series;return e&&!a&&(a=e.config.series),i&&a.length!==t.yaxis.length&&a.length&&(t.yaxis=a.map((e,i)=>{if(e.name||(a[i].name=`series-${i+1}`),t.yaxis[i])return t.yaxis[i].seriesName=a[i].name,t.yaxis[i];{const e=u.extend(s.yAxis,t.yaxis[0]);return e.show=!1,e}})),i&&a.length>1&&(a.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){let e=new T;return t.annotations.yaxis=u.extendArray(void 0!==t.annotations.yaxis?t.annotations.yaxis:[],e.yAxisAnnotation),t}extendXAxisAnnotations(t){let e=new T;return t.annotations.xaxis=u.extendArray(void 0!==t.annotations.xaxis?t.annotations.xaxis:[],e.xAxisAnnotation),t}extendPointAnnotations(t){let e=new T;return t.annotations.points=u.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){let 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}}class F{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.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.resizeTimer=null,t.selectionResizeTimer=null,t.lastWheelExecution=0,t.delayedElements=[],t.pointsArray=[],t.dataLabelsRects=[],t.textRectsCache=new Map,t.domCache=new Map,t.dimensionCache={},t.cachedSelectors={},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.yLabelsCoords=[],t.yTitleCoords=[],t.barPadForNumericAxis=0,t.padHorizontal=0,t.xRange=0,t.yRange=[],t.zRange=0,t.dataPoints=0,t.xTickAmount=0,t.multiAxisTickAmount=0}globalVars(t){return{chartID:null,cuid:null,events:{beforeMount:[],mounted:[],updated:[],clicked:[],selection:[],dataPointSelection:[],zoomed:[],scrolled:[]},colors:[],clientX:null,clientY:null,fill:{colors:[]},stroke:{colors:[]},dataLabels:{style:{colors:[]}},radarPolygons:{fill:{colors:[]}},markers:{colors:[],size:t.markers.size,largestSize:0},animationEnded:!1,isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isDirty:!1,isExecCalled:!1,initialConfig:null,initialSeries:[],lastXAxis:[],lastYAxis:[],columnSeries:null,labels:[],timescaleLabels:[],noLabelsProvided:!1,allSeriesCollapsed:!1,collapsedSeries:[],collapsedSeriesIndices:[],ancillaryCollapsedSeries:[],ancillaryCollapsedSeriesIndices:[],risingSeries:[],dataFormatXNumeric:!1,capturedSeriesIndex:-1,capturedDataPointIndex:-1,selectedDataPoints:[],invalidLogScale:!1,ignoreYAxisIndexes:[],maxValsInArrayIndex:0,radialSize:0,selection:void 0,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,yaxis:null,mousedown:!1,lastClientPosition:{},visibleXRange:void 0,yValueDecimal:0,total:0,SVGNS:"http://www.w3.org/2000/svg",svgWidth:0,svgHeight:0,noData:!1,locale:{},dom:{},memory:{methodsToExec:[]},domCache:new Map,dimensionCache:{},cachedSelectors:{},resizeObserver:null,shouldAnimate:!0,skipLastTimelinelabel:!1,skipFirstTimelinelabel:!1,delayedElements:[],axisCharts:!0,isDataXYZ:!1,isSlopeChart:t.plotOptions.line.isSlopeChart,resized:!1,resizeTimer:null,comboCharts:!1,dataChanged:!1,previousPaths:[],allSeriesHasEqualX:!0,pointsArray:[],dataLabelsRects:[],lastDrawnDataLabelsIndexes:[],hasNullValues:!1,zoomed:!1,gridWidth:0,gridHeight:0,rotateXLabels:!1,defaultLabels:!1,xLabelFormatter:void 0,yLabelFormatters:[],xaxisTooltipFormatter:void 0,ttKeyFormatter:void 0,ttVal:void 0,ttZFormatter:void 0,LINE_HEIGHT_RATIO:1.618,xAxisLabelsHeight:0,xAxisGroupLabelsHeight:0,xAxisLabelsWidth:0,yAxisLabelsWidth:0,scaleX:1,scaleY:1,translateX:0,translateY:0,translateYAxisX:[],yAxisWidths:[],translateXAxisY:0,translateXAxisX:0,tooltip:null,niceScaleAllowedMagMsd:[[1,1,2,5,5,5,10,10,10,10,10],[1,1,2,5,5,5,10,10,10,10,10]],niceScaleDefaultTicks:[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],seriesYAxisMap:[],seriesYAxisReverseMap:[]}}init(t){let e=this.globalVars(t);return this.initGlobalVars(e),e.initialConfig=u.extend({},t),e.initialSeries=u.clone(t.series),e.lastXAxis=u.clone(e.initialConfig.xaxis),e.lastYAxis=u.clone(e.initialConfig.yaxis),e}}class H{constructor(t){this.opts=t}init(){const t=new R(this.opts).init({responsiveOverride:!1});return{config:t,globals:(new F).init(t)}}}class D{constructor(t){this.ctx=t,this.w=t.w,this.opts=null,this.seriesIndex=0,this.patternIDs=[]}clippedImgArea(t){let e=this.w,s=e.config,i=parseInt(e.globals.gridWidth,10),a=parseInt(e.globals.gridHeight,10),o=i>a?i:a,r=t.image,l=0,n=0;void 0===t.width&&void 0===t.height?void 0!==s.fill.image.width&&void 0!==s.fill.image.height?(l=s.fill.image.width+1,n=s.fill.image.height):(l=o+1,n=o):(l=t.width,n=t.height);let h=document.createElementNS(e.globals.SVGNS,"pattern");w.setAttrs(h,{id:t.patternID,patternUnits:t.patternUnits?t.patternUnits:"userSpaceOnUse",width:l+"px",height:n+"px"});let c=document.createElementNS(e.globals.SVGNS,"image");h.appendChild(c),c.setAttributeNS(window.SVG.xlink,"href",r),w.setAttrs(c,{x:0,y:0,preserveAspectRatio:"none",width:l+"px",height:n+"px"}),c.style.opacity=t.opacity,e.globals.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.globals.series.length,this.seriesIndex}computeColorStops(t,e){const s=this.w;let i=null,a=null;for(let 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 o=i-e.threshold+(e.threshold-a);0===o&&(o=1);let r=100-(e.threshold-a)/o*100;return r=Math.max(0,Math.min(r,100)),[{offset:r,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,o,r;let l=this.w;this.opts=t;let n,h,c,d=this.w.config;this.seriesIndex=this.getSeriesIndex(t);const g=d.plotOptions.line.colors.colorAboveThreshold&&d.plotOptions.line.colors.colorBelowThreshold;let p=this.getFillColors()[this.seriesIndex];void 0!==l.globals.seriesColors[this.seriesIndex]&&(p=l.globals.seriesColors[this.seriesIndex]),"function"==typeof p&&(p=p({seriesIndex:this.seriesIndex,dataPointIndex:t.dataPointIndex,value:t.value,w:l}));let x=t.fillType?t.fillType:this.getFillType(this.seriesIndex),b=Array.isArray(d.fill.opacity)?d.fill.opacity[this.seriesIndex]:d.fill.opacity;const f="gradient"===x||g;t.color&&(p=t.color),(null==(i=null==(s=null==(e=l.config.series[this.seriesIndex])?void 0:e.data)?void 0:s[t.dataPointIndex])?void 0:i.fillColor)&&(p=null==(r=null==(o=null==(a=l.config.series[this.seriesIndex])?void 0:a.data)?void 0:o[t.dataPointIndex])?void 0:r.fillColor),p||(p="#fff"),u.isCSSVariable(p)&&(p=u.getThemeColor(p));let m=p;if(-1===p.indexOf("rgb")?-1===p.indexOf("#")?m=p:p.length<9&&(m=u.hexToRgba(p,b)):p.indexOf("rgba")>-1?b=u.getOpacityFromRGBA(p):m=u.hexToRgba(u.rgb2hex(p),b),t.opacity&&(b=t.opacity),"pattern"===x&&(h=this.handlePatternFill({fillConfig:t.fillConfig,patternFill:h,fillColor:p,fillOpacity:b,defaultColor:m})),f){let e=d.fill.gradient.colorStops?[...d.fill.gradient.colorStops]:[],s=d.fill.gradient.type;g&&(e[this.seriesIndex]=this.computeColorStops(l.globals.series[this.seriesIndex],d.plotOptions.line.colors),s="vertical"),c=this.handleGradientFill({type:s,fillConfig:t.fillConfig,fillColor:p,fillOpacity:b,colorStops:e,i:this.seriesIndex})}if("image"===x){let e=d.fill.image.src,s=t.patternID?t.patternID:"";const i=`pattern${l.globals.cuid}${t.seriesNumber+1}${s}`;-1===this.patternIDs.indexOf(i)&&(this.clippedImgArea({opacity:b,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=f?c:"pattern"===x?h:m;return t.solid&&(n=m),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,fillOpacity:i,defaultColor:a}){let o=this.w.config.fill;t&&(o=t);const r=this.opts;let l=new w(this.ctx),n=Array.isArray(o.pattern.strokeWidth)?o.pattern.strokeWidth[this.seriesIndex]:o.pattern.strokeWidth,h=s;if(Array.isArray(o.pattern.style))if(void 0!==o.pattern.style[r.seriesNumber]){e=l.drawPattern(o.pattern.style[r.seriesNumber],o.pattern.width,o.pattern.height,h,n,i)}else e=a;else e=l.drawPattern(o.pattern.style,o.pattern.width,o.pattern.height,h,n,i);return e}handleGradientFill({type:t,fillColor:e,fillOpacity:s,fillConfig:i,colorStops:a,i:o}){let r=this.w.config.fill;i&&(r=l(l({},r),i));const n=this.opts;let h=new w(this.ctx),c=new u;t=t||r.gradient.type;let d,g=e,p=void 0===r.gradient.opacityFrom?s:Array.isArray(r.gradient.opacityFrom)?r.gradient.opacityFrom[o]:r.gradient.opacityFrom;g.indexOf("rgba")>-1&&(p=u.getOpacityFromRGBA(g));let x=void 0===r.gradient.opacityTo?s:Array.isArray(r.gradient.opacityTo)?r.gradient.opacityTo[o]:r.gradient.opacityTo;if(void 0===r.gradient.gradientToColors||0===r.gradient.gradientToColors.length)d="dark"===r.gradient.shade?c.shadeColor(-1*parseFloat(r.gradient.shadeIntensity),e.indexOf("rgb")>-1?u.rgb2hex(e):e):c.shadeColor(parseFloat(r.gradient.shadeIntensity),e.indexOf("rgb")>-1?u.rgb2hex(e):e);else if(r.gradient.gradientToColors[n.seriesNumber]){const t=r.gradient.gradientToColors[n.seriesNumber];d=t,t.indexOf("rgba")>-1&&(x=u.getOpacityFromRGBA(t))}else d=e;if(r.gradient.gradientFrom&&(g=r.gradient.gradientFrom),r.gradient.gradientTo&&(d=r.gradient.gradientTo),r.gradient.inverseColors){let t=g;g=d,d=t}return g.indexOf("rgb")>-1&&(g=u.rgb2hex(g)),d.indexOf("rgb")>-1&&(d=u.rgb2hex(d)),h.drawGradient(t,g,d,p,x,n.size,r.gradient.stops,a,o)}}class O{constructor(t){this.ctx=t,this.w=t.w,this._filters=new y(this.ctx),this._graphics=new 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.globals.series.length+1)for(let e=0;e<=t.globals.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:o=!1}){let r=this.w,l=e,n=t,h=null,c=new w(this.ctx);const d=r.config.markers.discrete&&r.config.markers.discrete.length;if(Array.isArray(n.x))for(let t=0;t<n.x.length;t++){let g,p=s,x=!u.isNumber(n.y[t]);0===r.globals.markers.largestSize&&r.globals.hasNullValues&&null!==r.globals.series[l][s+1]&&!o&&(x=!0),1===s&&0===t&&(p=0),1===s&&1===t&&(p=1);let b="apexcharts-marker";"line"!==r.config.chart.type&&"area"!==r.config.chart.type||r.globals.comboCharts||r.config.tooltip.intersect||(b+=" no-pointer-events");if((Array.isArray(r.config.markers.size)?r.globals.markers.size[e]>0:r.config.markers.size>0)||a||d){x||(b+=` w${u.randomId()}`);let s=this.getMarkerConfig({cssClass:b,seriesIndex:e,dataPointIndex:p});if(r.config.series[l].data[p]&&(r.config.series[l].data[p].fillColor&&(s.pointFillColor=r.config.series[l].data[p].fillColor),r.config.series[l].data[p].strokeColor&&(s.pointStrokeColor=r.config.series[l].data[p].strokeColor)),void 0!==i&&(s.pSize=i),(n.x[t]<-r.globals.markers.largestSize||n.x[t]>r.globals.gridWidth+r.globals.markers.largestSize||n.y[t]<-r.globals.markers.largestSize||n.y[t]>r.globals.gridHeight+r.globals.markers.largestSize)&&(s.pSize=0),!x){(r.globals.markers.size[e]>0||a||d)&&!h&&(h=c.group({class:a||d?"":"apexcharts-series-markers"}),h.attr("clip-path",`url(#gridRectMarkerMask${r.globals.cuid})`),this.setupMarkerDelegation(h)),g=c.drawMarker(n.x[t],n.y[t],s),g.attr("rel",p),g.attr("j",p),g.attr("index",e),g.node.setAttribute("default-marker-size",s.pSize),this._filters.setSelectionFilter(g,e,p),h&&h.add(g)}}else void 0===r.globals.pointsArray[e]&&(r.globals.pointsArray[e]=[]),r.globals.pointsArray[e].push([n.x[t],n.y[t]])}return h}getMarkerConfig({cssClass:t,seriesIndex:e,dataPointIndex:s=null,radius:i=null,size:a=null,strokeWidth:o=null}){const r=this.w;let l=this.getMarkerStyle(e),n=null===a?r.globals.markers.size[e]:a;const h=r.config.markers;return null!==s&&h.discrete.length&&h.discrete.map(t=>{t.seriesIndex===e&&t.dataPointIndex===s&&(l.pointStrokeColor=t.strokeColor,l.pointFillColor=t.fillColor,n=t.size,l.pointShape=t.shape)}),{pSize:null===i?n:i,pRadius:null!==i?i:h.radius,pointStrokeWidth:null!==o?o:Array.isArray(h.strokeWidth)?h.strokeWidth[e]:h.strokeWidth,pointStrokeColor:l.pointStrokeColor,pointFillColor:l.pointFillColor,shape:l.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){w._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onClick(i)}}),t.node.addEventListener("dblclick",i=>{if(e.config.markers.onDblClick){w._findDelegateTarget(i.target,t.node,s)&&e.config.markers.onDblClick(i)}}),t.node.addEventListener("touchstart",e=>{const i=w._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){let 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 W{constructor(t){this.ctx=t,this.w=t.w,this.initialAnim=this.w.config.chart.animations.enabled,this.anim=new m(this.ctx),this.filters=new y(this.ctx),this.fill=new D(this.ctx),this.markers=new O(this.ctx),this.graphics=new w(this.ctx)}draw(t,e,s){let i=this.w,a=this.graphics,o=s.realIndex,r=s.pointsPos,l=s.zRatio,n=s.elParent,h=a.group({class:`apexcharts-series-markers apexcharts-series-${i.config.chart.type}`});if(h.attr("clip-path",`url(#gridRectMarkerMask${i.globals.cuid})`),this.markers.setupMarkerDelegation(h),Array.isArray(r.x))for(let t=0;t<r.x.length;t++){let s=e+1,a=!0;0===e&&0===t&&(s=0),0===e&&1===t&&(s=1);let c=i.globals.markers.size[o];if(l!==1/0){const t=i.config.plotOptions.bubble;c=i.globals.seriesZ[o][s],t.zScaling&&(c/=l),t.minBubbleRadius&&c<t.minBubbleRadius&&(c=t.minBubbleRadius),t.maxBubbleRadius&&c>t.maxBubbleRadius&&(c=t.maxBubbleRadius)}let d=r.x[t],g=r.y[t];if(c=c||0,null!==g&&void 0!==i.globals.series[o][s]||(a=!1),a){const t=this.drawPoint(d,g,c,o,s,e);h.add(t)}n.add(h)}}drawPoint(t,e,s,i,a,o){const r=this.w;let l=i;const n=this.anim,h=this.filters,c=this.fill,d=this.markers,g=this.graphics,p=d.getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:l,dataPointIndex:a,radius:"bubble"===r.config.chart.type||r.globals.comboCharts&&r.config.series[i]&&"bubble"===r.config.series[i].type?s:null});let x=c.fillPath({seriesNumber:i,dataPointIndex:a,color:p.pointFillColor,patternUnits:"objectBoundingBox",value:r.globals.series[i][o]}),b=g.drawMarker(t,e,p);if(r.config.series[l].data[a]&&r.config.series[l].data[a].fillColor&&(x=r.config.series[l].data[a].fillColor),b.attr({fill:x}),r.config.chart.dropShadow.enabled){const t=r.config.chart.dropShadow;h.dropShadow(b,t,i)}if(!this.initialAnim||r.globals.dataChanged||r.globals.resized)r.globals.animationEnded=!0;else{let t=r.config.chart.animations.speed;n.animateMarker(b,t,r.globals.easing,()=>{window.setTimeout(()=>{n.animationCompleted(b)},100)})}return b.attr({rel:a,j:a,index:i,"default-marker-size":p.pSize}),h.setSelectionFilter(b,i,a),b.node.classList.add("apexcharts-marker"),b}centerTextInBubble(t){let e=this.w;return{y:t+=parseInt(e.config.dataLabels.style.fontSize,10)/4}}}class N{constructor(t){this.ctx=t,this.w=t.w}dataLabelsCorrection(t,e,s,i,a,o,r){let l=this.w,n=!1,h=new w(this.ctx).getTextRects(s,r),c=h.width,d=h.height;e<0&&(e=0),e>l.globals.gridHeight+d&&(e=l.globals.gridHeight+d/2),void 0===l.globals.dataLabelsRects[i]&&(l.globals.dataLabelsRects[i]=[]),l.globals.dataLabelsRects[i].push({x:t,y:e,width:c,height:d});let g=l.globals.dataLabelsRects[i].length-2,p=void 0!==l.globals.lastDrawnDataLabelsIndexes[i]?l.globals.lastDrawnDataLabelsIndexes[i][l.globals.lastDrawnDataLabelsIndexes[i].length-1]:0;if(void 0!==l.globals.dataLabelsRects[i][g]){let s=l.globals.dataLabelsRects[i][p];(t>s.x+s.width||e>s.y+s.height||e+d<s.y||t+c<s.x)&&(n=!0)}return(0===a||o)&&(n=!0),{x:t,y:e,textRects:h,drawnextLabel:n}}drawDataLabel({type:t,pos:e,i:s,j:i,isRangeStart:a,strokeWidth:o=2}){let r=this.w;const l=new w(this.ctx);let n=r.config.dataLabels,h=0,c=0,d=i,g=null;if(-1!==r.globals.collapsedSeriesIndices.indexOf(s)||!n.enabled||!Array.isArray(e.x))return g;g=l.group({class:"apexcharts-data-labels"});for(let l=0;l<e.x.length;l++)if(h=e.x[l]+n.offsetX,c=e.y[l]+n.offsetY+o,!isNaN(h)){1===i&&0===l&&(d=0),1===i&&1===l&&(d=1);let o=r.globals.series[s][d];"rangeArea"===t&&(o=a?r.globals.seriesRangeStart[s][d]:r.globals.seriesRangeEnd[s][d]);let n="";const p=t=>r.config.dataLabels.formatter(t,{ctx:this.ctx,seriesIndex:s,dataPointIndex:d,w:r});if("bubble"===r.config.chart.type){o=r.globals.seriesZ[s][d],n=p(o),c=e.y[l];c=new W(this.ctx).centerTextInBubble(c,s,d).y}else void 0!==o&&(n=p(o));let x=r.config.dataLabels.textAnchor;r.globals.isSlopeChart&&(x=0===d?"end":d===r.config.series[s].data.length-1?"start":"middle"),this.plotDataLabelsText({x:h,y:c,text:n,i:s,j:d,parent:g,offsetCorrection:!0,dataLabelsConfig:r.config.dataLabels,textAnchor:x})}return g}plotDataLabelsText(t){let e=this.w,s=new w(this.ctx),{x:i,y:a,i:o,j:r,text:l,textAnchor:n,fontSize:h,parent:c,dataLabelsConfig:d,color:g,alwaysDrawDataLabel:p,offsetCorrection:x,className:b}=t,f=null;if(Array.isArray(e.config.dataLabels.enabledOnSeries)&&e.config.dataLabels.enabledOnSeries.indexOf(o)<0)return f;let u={x:i,y:a,drawnextLabel:!0,textRects:null};x&&(u=this.dataLabelsCorrection(i,a,l,o,r,p,parseInt(d.style.fontSize,10))),e.globals.zoomed||(i=u.x,a=u.y),u.textRects&&(i<-20-u.textRects.width||i>e.globals.gridWidth+u.textRects.width+30)&&(l="");let m=e.globals.dataLabels.style.colors[o];(("bar"===e.config.chart.type||"rangeBar"===e.config.chart.type)&&e.config.plotOptions.bar.distributed||e.config.dataLabels.distributed)&&(m=e.globals.dataLabels.style.colors[r]),"function"==typeof m&&(m=m({series:e.globals.series,seriesIndex:o,dataPointIndex:r,w:e})),g&&(m=g);let v=d.offsetX,A=d.offsetY;if("bar"!==e.config.chart.type&&"rangeBar"!==e.config.chart.type||(v=0,A=0),e.globals.isSlopeChart&&(0!==r&&(v=-2*d.offsetX+5),0!==r&&r!==e.config.series[o].data.length-1&&(v=0)),u.drawnextLabel){if("middle"===n&&i===e.globals.gridWidth&&(n="end"),f=s.drawText({width:100,height:parseInt(d.style.fontSize,10),x:i+v,y:a+A,foreColor:m,textAnchor:n||d.textAnchor,text:l,fontSize:h||d.style.fontSize,fontFamily:d.style.fontFamily,fontWeight:d.style.fontWeight||"normal"}),f.attr({class:b||"apexcharts-datalabel",cx:i,cy:a}),d.dropShadow.enabled){const t=d.dropShadow;new y(this.ctx).dropShadow(f,t)}c.add(f),void 0===e.globals.lastDrawnDataLabelsIndexes[o]&&(e.globals.lastDrawnDataLabelsIndexes[o]=[]),e.globals.lastDrawnDataLabelsIndexes[o].push(r)}return f}addBackgroundToDataLabel(t,e){const s=this.w,i=s.config.dataLabels.background,a=i.padding,o=i.padding/2,r=e.width,l=e.height,n=new w(this.ctx).drawRect(e.x-a,e.y-o/2,r+2*a,l+o,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 y(this.ctx).dropShadow(n,i.dropShadow)}return n}dataLabelsBackground(){const t=this.w;if("bubble"===t.config.chart.type)return;const e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text");for(let s=0;s<e.length;s++){const i=e[s],a=i.getBBox();let o=null;if(a.width&&a.height&&(o=this.addBackgroundToDataLabel(i,a)),o){i.parentNode.insertBefore(o.node,i);const e=t.config.dataLabels.background.backgroundColor||i.getAttribute("fill");t.config.chart.animations.enabled&&!t.globals.resized&&!t.globals.dataChanged?o.animate().attr({fill:e}):o.attr({fill:e}),i.setAttribute("fill",t.config.dataLabels.background.foreColor)}}}bringForward(){const t=this.w,e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels"),s=t.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child");for(let t=0;t<e.length;t++)s&&s.insertBefore(e[t],s.nextSibling)}}const B=".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 G{constructor(t){this.ctx=t,this.w=t.w,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.globals.dom.baseEl.getElementsByClassName("apexcharts-series")),t.globals.cachedSelectors[e]}getSeriesByName(t){return this.w.globals.dom.baseEl.querySelector(`.apexcharts-inner .apexcharts-series[seriesName='${u.escapeString(t)}']`)}isSeriesHidden(t){const e=this.getSeriesByName(t);let s=parseInt(e.getAttribute("data:realIndex"),10);return{isHidden:e.classList.contains("apexcharts-series-collapsed"),realIndex:s}}addCollapsedClassToSeries(t,e){const s=this.w;function i(s){for(let i=0;i<s.length;i++)s[i].index===e&&t.node.classList.add("apexcharts-series-collapsed")}i(s.globals.collapsedSeries),i(s.globals.ancillaryCollapsedSeries)}toggleSeries(t){let e=this.isSeriesHidden(t);return this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,e.isHidden),e.isHidden}showSeries(t){let e=this.isSeriesHidden(t);e.isHidden&&this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,!0)}hideSeries(t){let e=this.isSeriesHidden(t);e.isHidden||this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex,!1)}resetSeries(t=!0,e=!0,s=!0){const i=this.w;this.clearSeriesCache();let a=u.clone(i.globals.initialSeries);i.globals.previousPaths=[],s?(i.globals.collapsedSeries=[],i.globals.ancillaryCollapsedSeries=[],i.globals.collapsedSeriesIndices=[],i.globals.ancillaryCollapsedSeriesIndices=[]):a=this.emptyCollapsedSeries(a),i.config.series=a,t&&(e&&(i.globals.zoomed=!1,this.ctx.updateHelpers.revertDefaultAxisMinMax()),this.ctx.updateHelpers._updateSeries(a,i.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}highlightSeries(t){const e=this.w,s=this.getSeriesByName(t);let i=parseInt(null==s?void 0:s.getAttribute("data:realIndex"),10);const a="highlightSeriesEls";let o=e.globals.cachedSelectors[a];o||(o=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"),e.globals.cachedSelectors[a]=o);let r=null,l=null,n=null;if(e.globals.axisCharts||"radialBar"===e.config.chart.type)if(e.globals.axisCharts){r=e.globals.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${i}']`),l=e.globals.dom.baseEl.querySelector(`.apexcharts-datalabels[data\\:realIndex='${i}']`);let t=e.globals.seriesYAxisReverseMap[i];n=e.globals.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}']`)}else r=e.globals.dom.baseEl.querySelector(`.apexcharts-series[rel='${i+1}']`);else r=e.globals.dom.baseEl.querySelector(`.apexcharts-series[rel='${i+1}'] path`);for(let t=0;t<o.length;t++)o[t].classList.add(this.legendInactiveClass);if(r)e.globals.axisCharts||r.parentNode.classList.remove(this.legendInactiveClass),r.classList.remove(this.legendInactiveClass),null!==l&&l.classList.remove(this.legendInactiveClass),null!==n&&n.classList.remove(this.legendInactiveClass);else for(let t=0;t<o.length;t++)o[t].classList.remove(this.legendInactiveClass)}toggleSeriesOnHover(t,e){const s=this.w;e||(e=t.target);let i=s.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis");if("mousemove"===t.type){let t=parseInt(e.getAttribute("rel"),10)-1;this.highlightSeries(s.globals.seriesNames[t])}else if("mouseout"===t.type)for(let t=0;t<i.length;t++)i[t].classList.remove(this.legendInactiveClass)}highlightRangeInSeries(t,e){const s=this.w,i=s.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"),a=t=>{for(let e=0;e<i.length;e++)i[e].classList[t](this.legendInactiveClass)},o=(t,e)=>{for(let s=0;s<i.length;s++){const a=Number(i[s].getAttribute("val"));a>=t.from&&(a<t.to||t.to===e&&a===e)&&i[s].classList.remove(this.legendInactiveClass)}};if("mousemove"===t.type){let t=parseInt(e.getAttribute("rel"),10)-1;a("add");const i=s.config.plotOptions.heatmap.colorScale.ranges;o(i[t],i.reduce((t,e)=>Math.max(t,e.to),0))}else"mouseout"===t.type&&a("remove")}getActiveConfigSeriesIndex(t="asc",e=[]){const s=this.w;let i=0;if(s.config.series.length>1){let 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(){let t=this.w;function e(e,s,i){let a=e[s].childNodes,o={type:i,paths:[],realIndex:e[s].getAttribute("data:realIndex")};for(let t=0;t<a.length;t++)if(a[t].hasAttribute("pathTo")){let e=a[t].getAttribute("pathTo");o.paths.push({d:e})}t.globals.previousPaths.push(o)}t.globals.previousPaths=[];["line","area","bar","rangebar","rangeArea","candlestick","radar"].forEach(s=>{const i=(a=s,t.globals.dom.baseEl.querySelectorAll(`.apexcharts-${a}-series .apexcharts-series`));var a;for(let t=0;t<i.length;t++)e(i,t,s)});let s=t.globals.dom.baseEl.querySelectorAll(`.apexcharts-${t.config.chart.type} .apexcharts-series`);if(s.length>0)for(let e=0;e<s.length;e++){let s=t.globals.dom.baseEl.querySelectorAll(`.apexcharts-${t.config.chart.type} .apexcharts-series[data\\:realIndex='${e}'] rect`),i=[];for(let t=0;t<s.length;t++){const e=e=>s[t].getAttribute(e),a={x:parseFloat(e("x")),y:parseFloat(e("y")),width:parseFloat(e("width")),height:parseFloat(e("height"))};i.push({rect:a,color:s[t].getAttribute("color")})}t.globals.previousPaths.push(i)}t.globals.axisCharts||(t.globals.previousPaths=t.globals.series)}clearPreviousPaths(){const t=this.w;t.globals.previousPaths=[],t.globals.allSeriesCollapsed=!1}handleNoData(){const t=this.w,e=t.config.noData,s=new w(this.ctx);let i=t.globals.svgWidth/2,a=t.globals.svgHeight/2,o="middle";if(t.globals.noData=!0,t.globals.animationEnded=!0,"left"===e.align?(i=10,o="start"):"right"===e.align&&(i=t.globals.svgWidth-10,o="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){let r=s.drawText({x:i,y:a,text:e.text,textAnchor:o,fontSize:e.style.fontSize,fontFamily:e.style.fontFamily,foreColor:e.style.color,opacity:1,class:"apexcharts-text-nodata"});t.globals.dom.Paper.add(r)}}setNullSeriesToZeroValues(t){let 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.globals.seriesX.map(t=>t.length>0?t:[])}}class ${constructor(t){this.ctx=t,this.w=t.w,this.twoDSeries=[],this.threeDSeries=[],this.twoDSeriesX=[],this.seriesGoals=[],this.coreUtils=new v(this.ctx)}getFirstDataPoint(){const t=this.w.config.series,e=new G(this.ctx);return this.activeSeriesIndex=e.getActiveConfigSeriesIndex(),t[this.activeSeriesIndex]&&t[this.activeSeriesIndex].data&&t[this.activeSeriesIndex].data.length>0&&null!==t[this.activeSeriesIndex].data[0]&&void 0!==t[this.activeSeriesIndex].data[0]?t[this.activeSeriesIndex].data[0]:null}isMultiFormat(){return this.isFormatXY()||this.isFormat2DArray()}isFormatXY(){const t=this.getFirstDataPoint();return t&&void 0!==t.x}isFormat2DArray(){const t=this.getFirstDataPoint();return t&&Array.isArray(t)}handleFormat2DArray(t,e){const s=this.w.config,i=this.w.globals,a=t[e].data,o="boxPlot"===s.chart.type||"boxPlot"===s.series[e].type;for(let t=0;t<a.length;t++){const e=a[t],r=e[0],l=e[1],n=e[2];if(void 0!==l&&(Array.isArray(l)&&4===l.length&&!o?this.twoDSeries.push(u.parseNumber(l[3])):e.length>=5?this.twoDSeries.push(u.parseNumber(e[4])):this.twoDSeries.push(u.parseNumber(l)),i.dataFormatXNumeric=!0),"datetime"===s.xaxis.type){let t=new Date(r);t=t.getTime(),this.twoDSeriesX.push(t)}else this.twoDSeriesX.push(r);void 0!==n&&(this.threeDSeries.push(n),i.isDataXYZ=!0)}}handleFormatXY(t,e){const s=this.w.config,i=this.w.globals,a=new S(this.ctx),o=t[e].data;let r=e;i.collapsedSeriesIndices.indexOf(e)>-1&&(r=this.activeSeriesIndex);const l=t[r].data;for(let t=0;t<o.length;t++){const s=o[t];if(void 0!==s.y){const t=Array.isArray(s.y)?u.parseNumber(s.y[s.y.length-1]):u.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),i.isDataXYZ=!0)}for(let t=0;t<l.length;t++){const e=l[t].x,o="string"==typeof e,r=Array.isArray(e),n=!r&&!!a.isValidDate(e);if(o||n)if(o||s.xaxis.convertedCatToNumeric){const t=i.isBarHorizontal&&i.isRangeData;"datetime"!==s.xaxis.type||t?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e),isNaN(e)||"category"===this.w.config.xaxis.type||"string"==typeof e||(i.isXNumeric=!0)):this.twoDSeriesX.push(a.parseDate(e))}else"datetime"===s.xaxis.type?this.twoDSeriesX.push(a.parseDate(e.toString())):(i.dataFormatXNumeric=!0,i.isXNumeric=!0,this.twoDSeriesX.push(parseFloat(e)));else r?(this.fallbackToCategory=!0,this.twoDSeriesX.push(e)):(i.isXNumeric=!0,i.dataFormatXNumeric=!0,this.twoDSeriesX.push(e))}}handleRangeData(t,e){const s=this.w.globals;let i={};return this.isFormat2DArray()?i=this.handleRangeDataFormat("array",t,e):this.isFormatXY()&&(i=this.handleRangeDataFormat("xy",t,e)),s.seriesRangeStart[e]=void 0===i.start?[]:i.start,s.seriesRangeEnd[e]=void 0===i.end?[]:i.end,s.seriesRange[e]=i.rangeUniques,s.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],o=a.y1,r=a.y2;for(let l=i+1;l<s;l++){const s=e[l],i=s.y1;o<=s.y2&&i<=r&&(t.overlaps.indexOf(a.rangeName)<0&&t.overlaps.push(a.rangeName),t.overlaps.indexOf(s.rangeName)<0&&t.overlaps.push(s.rangeName))}}})}),i}handleCandleStickBoxData(t,e){const s=this.w.globals;let i={};return this.isFormat2DArray()?i=this.handleCandleStickBoxDataFormat("array",t,e):this.isFormatXY()&&(i=this.handleCandleStickBoxDataFormat("xy",t,e)),s.seriesCandleO[e]=i.o,s.seriesCandleH[e]=i.h,s.seriesCandleM[e]=i.m,s.seriesCandleL[e]=i.l,s.seriesCandleC[e]=i.c,i}handleRangeDataFormat(t,e,s){const i=[],a=[],o=new Map,r=[];if(e[s].data.forEach(t=>{if(!o.has(t.x)){const e={x:t.x,overlaps:[],y:[]};o.set(t.x,e),r.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++){let r=Array.isArray(e[s].data[t].y);const l=u.randomId(),n=e[s].data[t].x,h={y1:r?e[s].data[t].y[0]:e[s].data[t].y,y2:r?e[s].data[t].y[1]:e[s].data[t].y,rangeName:l};e[s].data[t].rangeName=l;const c=o.get(n);c&&c.y.push(h),i.push(h.y1),a.push(h.y2)}return{start:i,end:a,rangeUniques:r}}handleCandleStickBoxDataFormat(t,e,s){const i=this.w,a="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[s].type,o=[],r=[],l=[],n=[],h=[],c=e[s].data;let d;if("array"===t){d=a&&6===c[0].length||!a&&5===c[0].length?t=>t.slice(1):t=>Array.isArray(t[1])?t[1]:[]}else d=t=>Array.isArray(t.y)?t.y:[];for(let t=0;t<c.length;t++){const e=d(c[t]);e&&e.length>=2&&(o.push(e[0]),r.push(e[1]),a?(l.push(e[2]),n.push(e[3]),h.push(e[4])):(n.push(e[2]),h.push(e[3])))}return{o:o,h:r,m:l,l:n,c:h}}parseDataAxisCharts(t,e=this.ctx){const s=this.w.config,i=this.w.globals,a=new S(e),o=s.labels.length>0?s.labels.slice():s.xaxis.categories.slice();i.isRangeBar="rangeBar"===s.chart.type&&i.isBarHorizontal,i.hasXaxisGroups="category"===s.xaxis.type&&s.xaxis.group.groups.length>0,i.hasXaxisGroups&&(i.groups=s.xaxis.group.groups),t.forEach((t,e)=>{void 0!==t.name?i.seriesNames.push(t.name):i.seriesNames.push("series-"+parseInt(e+1,10))}),this.coreUtils.setSeriesYAxisMappings();let r=[],l=[...new Set(s.series.map(t=>t.group))];s.series.forEach((t,e)=>{let s=l.indexOf(t.group);r[s]||(r[s]=[]),r[s].push(i.seriesNames[e])}),i.seriesGroups=r;const n=()=>{for(let t=0;t<o.length;t++)if("string"==typeof o[t]){if(!a.isValidDate(o[t]))throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date");this.twoDSeriesX.push(a.parseDate(o[t]))}else this.twoDSeriesX.push(o[t])};for(let e=0;e<t.length;e++){if(this.twoDSeries=[],this.twoDSeriesX=[],this.threeDSeries=[],void 0===t[e].data)return;if("rangeBar"!==s.chart.type&&"rangeArea"!==s.chart.type&&"rangeBar"!==t[e].type&&"rangeArea"!==t[e].type||(i.isRangeData=!0,this.handleRangeData(t,e)),this.isMultiFormat())this.isFormat2DArray()?this.handleFormat2DArray(t,e):this.isFormatXY()&&this.handleFormatXY(t,e),"candlestick"!==s.chart.type&&"candlestick"!==t[e].type&&"boxPlot"!==s.chart.type&&"boxPlot"!==t[e].type||this.handleCandleStickBoxData(t,e),i.series.push(this.twoDSeries),i.labels.push(this.twoDSeriesX),i.seriesX.push(this.twoDSeriesX),i.seriesGoals=this.seriesGoals,e!==this.activeSeriesIndex||this.fallbackToCategory||(i.isXNumeric=!0);else{"datetime"===s.xaxis.type?(i.isXNumeric=!0,n(),i.seriesX.push(this.twoDSeriesX)):"numeric"===s.xaxis.type&&(i.isXNumeric=!0,o.length>0&&(this.twoDSeriesX=o,i.seriesX.push(this.twoDSeriesX))),i.labels.push(this.twoDSeriesX);const a=t[e].data.map(t=>u.parseNumber(t));i.series.push(a)}i.seriesZ.push(this.threeDSeries),void 0!==t[e].color?i.seriesColors.push(t[e].color):i.seriesColors.push(void 0)}return this.w}parseDataNonAxisCharts(t){const e=this.w.globals,s=this.w.config,i=Array.isArray(t)&&t.every(t=>"number"==typeof t)&&s.labels.length>0;Array.isArray(t)&&t.some(t=>t&&"object"==typeof t&&t.data||t&&"object"==typeof t&&t.parsing);if(i){e.series=t.slice(),e.seriesNames=s.labels.slice();for(let t=0;t<e.series.length;t++)void 0===e.seriesNames[t]&&e.seriesNames.push("series-"+(t+1));return this.w}if(Array.isArray(t)&&t.every(t=>"number"==typeof t)){e.series=t.slice(),e.seriesNames=[];for(let t=0;t<e.series.length;t++)e.seriesNames.push(s.labels[t]||`series-${t+1}`);return this.w}const a=this.extractPieDataFromSeries(t);e.series=a.values,e.seriesNames=a.labels,"radialBar"===s.chart.type&&(e.series=e.series.map(t=>{const e=u.parseNumber(t);return e}));for(let t=0;t<e.series.length;t++)void 0===e.seriesNames[t]&&e.seriesNames.push("series-"+(t+1));return this.w}resetParsingFlags(){const t=this.w;t.globals.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(u.parseNumber(t.y)))})})}handleExternalLabelsData(t){const e=this.w.config,s=this.w.globals;if(e.xaxis.categories.length>0)s.labels=e.xaxis.categories;else if(e.labels.length>0)s.labels=e.labels.slice();else if(this.fallbackToCategory){if(s.labels=s.labels[0],s.seriesRange.length&&(s.seriesRange.map(t=>{t.forEach(t=>{s.labels.indexOf(t.x)<0&&t.x&&s.labels.push(t.x)})}),s.labels=Array.from(new Set(s.labels.map(JSON.stringify)),JSON.parse)),e.xaxis.convertedCatToNumeric){new Y(e).convertCatToNumericXaxis(e,this.ctx,s.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(e.series.length>0)if(this.isFormatXY()){const t=s.series.map(t=>t.data.filter((t,e,s)=>s.findIndex(e=>e.x===t.x)===e)),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<e.series[e.maxValsInArrayIndex].length;t++)i.push(t+1);e.seriesX=[];for(let s=0;s<t.length;s++)e.seriesX.push(i);this.w.globals.isBarHorizontal||(e.isXNumeric=!0)}if(0===i.length){i=e.axisCharts?[]:e.series.map((t,e)=>e+1);for(let s=0;s<t.length;s++)e.seriesX.push(i)}e.labels=i,s.xaxis.convertedCatToNumeric&&(e.categoryLabels=i.map(t=>s.xaxis.labels.formatter(t))),e.noLabelsProvided=!0}parseRawDataIfNeeded(t){const e=this.w.config,s=this.w.globals,i=e.parsing;if(s.dataWasParsed)return t;if(!i&&!t.some(t=>t.parsing))return t;const a=t.map((t,e)=>{var s,a,o;if(!t.data||!Array.isArray(t.data)||0===t.data.length)return t;const r={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==(o=t.parsing)?void 0:o.z)||(null==i?void 0:i.z)};if(!r.x&&!r.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(!r.x||!r.y||Array.isArray(r.y)&&0===r.y.length)return t;const c=t.data.map((t,e)=>{if("object"!=typeof t||null===t)return t;const s=this.getNestedValue(t,r.x);let i,a;if(Array.isArray(r.y)){const e=r.y.map(e=>this.getNestedValue(t,e));i="bubble"===this.w.config.chart.type&&2===e.length?e[0]:e}else i=this.getNestedValue(t,r.y);r.z&&(a=this.getNestedValue(t,r.z));const o={x:s,y:i};if("bubble"===this.w.config.chart.type&&Array.isArray(r.y)&&2===r.y.length){const e=this.getNestedValue(t,r.y[1]);void 0!==e&&(o.z=e)}return void 0!==a&&(o.z=a),o});return n(l({},t),{data:c,__apexParsed:!0})});return s.dataWasParsed=!0,s.originalSeries||(s.originalSeries=u.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}parseData(t){let e=this.w,s=e.config,i=e.globals;if(t=this.parseRawDataIfNeeded(t),s.series=t,i.initialSeries=u.clone(t),this.excludeCollapsedSeriesInYAxis(),this.fallbackToCategory=!1,this.ctx.core.resetGlobals(),this.ctx.core.isMultipleY(),i.axisCharts?(this.parseDataAxisCharts(t),this.coreUtils.getLargestSeries()):this.parseDataNonAxisCharts(t),s.chart.stacked){const t=new G(this.ctx);i.series=t.setNullSeriesToZeroValues(i.series)}this.coreUtils.getSeriesTotals(),i.axisCharts&&(i.stackedSeriesTotals=this.coreUtils.getStackedSeriesTotals(),i.stackedSeriesTotalsByGroups=this.coreUtils.getStackedSeriesTotalsByGroups()),this.coreUtils.getPercentSeries(),i.dataFormatXNumeric||i.isXNumeric&&("numeric"!==s.xaxis.type||0!==s.labels.length||0!==s.xaxis.categories.length)||this.handleExternalLabelsData(t);const a=this.coreUtils.getCategoryLabels(i.labels);for(let t=0;t<a.length;t++)if(Array.isArray(a[t])){i.isMultiLineX=!0;break}}excludeCollapsedSeriesInYAxis(){const t=this.w;let 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 _{constructor(t){this.ctx=t,this.w=t.w}svgStringToNode(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}scaleSvgNode(t,e){let 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)}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,o=s.globals.svgHeight*i,r=s.globals.dom.elWrap.cloneNode(!0);r.style.width=a+"px",r.style.height=o+"px";const l=(new XMLSerializer).serializeToString(r);let n="\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.globals.dom.elLegendWrap&&s.globals.dom.elLegendWrap.children.length>0&&(n+=B);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:${o}px;">\n <style type="text/css">\n ${n}\n </style>\n ${l}\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(/&nbsp;/g,"&#160;"))})})}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 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;t.getContext("2d").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 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.globals.dom.elWrap.style.height,10)*i;const o="transparent"!==s.config.chart.background&&s.config.chart.background?s.config.chart.background:"#fff";let r=a.getContext("2d");r.fillStyle=o,r.fillRect(0,0,a.width*i,a.height*i),this.getSvgString(i).then(t=>{const s="data:image/svg+xml,"+encodeURIComponent(t);let i=new Image;i.crossOrigin="anonymous",i.onload=()=>{if(r.drawImage(i,0,0),a.msToBlob){let t=a.msToBlob();e({blob:t})}else{let 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 o=[],r=[],l="",n=a.globals.series.map((t,e)=>-1===a.globals.collapsedSeriesIndices.indexOf(e)?t:[]);const 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():u.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 $(this.ctx),p=new L(this.ctx),x=t=>{let e="";if(a.globals.axisCharts){if("category"===a.config.xaxis.type||a.config.xaxis.convertedCatToNumeric)if(a.globals.isBarHorizontal){let s=a.globals.yLabelFormatters[0],i=new G(this.ctx).getActiveConfigSeriesIndex();e=s(a.globals.labels[t],{seriesIndex:i,dataPointIndex:t,w:a})}else e=p.getLabel(a.globals.labels,a.globals.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(" ")),u.isNumber(e)?e:e.split(s).join(""))},b=(e,i)=>{var l;if(o.length&&0===i&&r.push(o.join(s)),e.data){e.data=e.data.length&&e.data||[...Array(d)].map(()=>"");for(let d=0;d<e.data.length;d++){o=[];let p=x(d);if("nullvalue"!==p){if(p||(g.isFormatXY()?p=t[i].data[d].x:g.isFormat2DArray()&&(p=t[i].data[d]?t[i].data[d][0]:"")),0===i){o.push(h(p));for(let e=0;e<a.globals.series.length;e++){const s=g.isFormatXY()?null==(l=t[e].data[d])?void 0:l.y:n[e][d];o.push(c(s))}}("candlestick"===a.config.chart.type||e.type&&"candlestick"===e.type)&&(o.pop(),o.push(a.globals.seriesCandleO[i][d]),o.push(a.globals.seriesCandleH[i][d]),o.push(a.globals.seriesCandleL[i][d]),o.push(a.globals.seriesCandleC[i][d])),("boxPlot"===a.config.chart.type||e.type&&"boxPlot"===e.type)&&(o.pop(),o.push(a.globals.seriesCandleO[i][d]),o.push(a.globals.seriesCandleH[i][d]),o.push(a.globals.seriesCandleM[i][d]),o.push(a.globals.seriesCandleL[i][d]),o.push(a.globals.seriesCandleC[i][d])),"rangeBar"===a.config.chart.type&&(o.pop(),o.push(a.globals.seriesRangeStart[i][d]),o.push(a.globals.seriesRangeEnd[i][d])),o.length&&r.push(o.join(s))}}}};o.push(a.config.chart.toolbar.export.csv.headerCategory),"boxPlot"===a.config.chart.type?(o.push("minimum"),o.push("q1"),o.push("median"),o.push("q3"),o.push("maximum")):"candlestick"===a.config.chart.type?(o.push("open"),o.push("high"),o.push("low"),o.push("close")):"rangeBar"===a.config.chart.type?(o.push("minimum"),o.push("maximum")):t.map((t,e)=>{const i=(t.name?t.name:`series-${e}`)+"";a.globals.axisCharts&&o.push(i.split(s).join("")?i.split(s).join(""):`series-${e}`)}),a.globals.axisCharts||(o.push(a.config.chart.toolbar.export.csv.headerValue),r.push(o.join(s))),a.globals.allSeriesHasEqualX||!a.globals.axisCharts||a.config.xaxis.categories.length||a.config.labels.length?t.map((t,e)=>{a.globals.axisCharts?b(t,e):(o=[],o.push(h(a.globals.labels[e])),o.push(c(n[e])),r.push(o.join(s)))}):(()=>{const e=new Set,i={};t.forEach((s,a)=>{null==s||s.data.forEach(s=>{let o,r;if(g.isFormatXY())o=s.x,r=s.y;else{if(!g.isFormat2DArray())return;o=s[0],r=s[1]}i[o]||(i[o]=Array(t.length).fill("")),i[o][a]=c(r),e.add(o)})}),o.length&&r.push(o.join(s)),Array.from(e).sort().forEach(t=>{r.push([h(t),i[t].join(s)])})})(),l+=r.join(i),this.triggerDownload("data:text/csv; charset=utf-8,"+encodeURIComponent("\ufeff"+l),e||a.config.chart.toolbar.export.csv.filename,".csv")}triggerDownload(t,e,s){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)}}class V{constructor(t,e){this.ctx=t,this.elgrid=e,this.w=t.w;const s=this.w;this.axesUtils=new L(t),this.xaxisLabels=s.globals.labels.slice(),s.globals.timescaleLabels.length>0&&!s.globals.isBarHorizontal&&(this.xaxisLabels=s.globals.timescaleLabels.slice()),s.config.xaxis.overwriteCategories&&(this.xaxisLabels=s.config.xaxis.overwriteCategories),this.drawnLabels=[],this.drawnLabelsRects=[],"top"===s.config.xaxis.position?this.offY=0:this.offY=s.globals.gridHeight,this.offY=this.offY+s.config.xaxis.axisBorder.offsetY,this.isCategoryBarHorizontal="bar"===s.config.chart.type&&s.config.plotOptions.bar.horizontal,this.xaxisFontSize=s.config.xaxis.labels.style.fontSize,this.xaxisFontFamily=s.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=s.config.xaxis.labels.style.colors,this.xaxisBorderWidth=s.config.xaxis.axisBorder.width,this.isCategoryBarHorizontal&&(this.xaxisBorderWidth=s.config.yaxis[0].axisBorder.width.toString()),String(this.xaxisBorderWidth).indexOf("%")>-1?this.xaxisBorderWidth=s.globals.gridWidth*parseInt(this.xaxisBorderWidth,10)/100:this.xaxisBorderWidth=parseInt(this.xaxisBorderWidth,10),this.xaxisBorderHeight=s.config.xaxis.axisBorder.height,this.yaxis=s.config.yaxis[0]}drawXaxis(){let t=this.w,e=new w(this.ctx),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.globals.translateXAxisX}, ${t.globals.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.globals.isXNumeric,(t,e)=>e),t.globals.hasXaxisGroups){let s=t.globals.groups;a=[];for(let t=0;t<s.length;t++)a.push(s[t].title);let o={};t.config.xaxis.group.style&&(o.xaxisFontSize=t.config.xaxis.group.style.fontSize,o.xaxisFontFamily=t.config.xaxis.group.style.fontFamily,o.xaxisForeColors=t.config.xaxis.group.style.colors,o.fontWeight=t.config.xaxis.group.style.fontWeight,o.cssClass=t.config.xaxis.group.style.cssClass),this.drawXAxisLabelAndGroup(!1,e,i,a,!1,(t,e)=>s[t].cols*e,o)}if(void 0!==t.config.xaxis.title.text){let i=e.group({class:"apexcharts-xaxis-title"}),a=e.drawText({x:t.globals.gridWidth/2+t.config.xaxis.title.offsetX,y:this.offY+parseFloat(this.xaxisFontSize)+("bottom"===t.config.xaxis.position?t.globals.xAxisLabelsHeight:-t.globals.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;let 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,o,r={}){let l=[],n=[],h=this.w;const c=r.xaxisFontSize||this.xaxisFontSize,d=r.xaxisFontFamily||this.xaxisFontFamily,g=r.xaxisForeColors||this.xaxisForeColors,p=r.fontWeight||h.config.xaxis.labels.style.fontWeight,x=r.cssClass||h.config.xaxis.labels.style.cssClass;let b,f=h.globals.padHorizontal,u=i.length,m="category"===h.config.xaxis.type?h.globals.dataPoints:u;if(0===m&&u>m&&(m=u),a){let t=Math.max(Number(h.config.xaxis.tickAmount)||1,m>1?m-1:m);b=h.globals.gridWidth/Math.min(t,u-1),f=f+o(0,b)/2+h.config.xaxis.labels.offsetX}else b=h.globals.gridWidth/m,f=f+o(0,b)+h.config.xaxis.labels.offsetX;for(let a=0;a<=u-1;a++){let r=f-o(a,b)/2+h.config.xaxis.labels.offsetX;0===a&&1===u&&b/2===f&&1===m&&(r=h.globals.gridWidth/2);let y=this.axesUtils.getLabel(i,h.globals.timescaleLabels,r,a,l,c,t),w=28;h.globals.rotateXLabels&&t&&(w=22),h.config.xaxis.title.text&&"top"===h.config.xaxis.position&&(w+=parseFloat(h.config.xaxis.title.style.fontSize)+2),t||(w=w+parseFloat(c)+(h.globals.xAxisLabelsHeight-h.globals.xAxisGroupLabelsHeight)+(h.globals.rotateXLabels?10:0));y=void 0!==h.config.xaxis.tickAmount&&"dataPoints"!==h.config.xaxis.tickAmount&&"datetime"!==h.config.xaxis.type?this.axesUtils.checkLabelBasedOnTickamount(a,y,u):this.axesUtils.checkForOverflowingLabels(a,y,u,l,n);const v=()=>t&&h.config.xaxis.convertedCatToNumeric?g[h.globals.minX+a-1]:g[a];if(h.config.xaxis.labels.show){let i=e.drawText({x:y.x,y:this.offY+h.config.xaxis.labels.offsetY+w-("top"===h.config.xaxis.position?h.globals.xAxisHeight+h.config.xaxis.axisTicks.height-2:0),text:y.text,textAnchor:"middle",fontWeight:y.isBold?600:p,fontSize:c,fontFamily:d,foreColor:Array.isArray(g)?v():g,isPlainText:!1,cssClass:(t?"apexcharts-xaxis-label ":"apexcharts-xaxis-group-label ")+x});if(s.add(i),i.on("click",t=>{if("function"==typeof h.config.chart.events.xAxisLabelClick){const e=Object.assign({},h,{labelIndex:a});h.config.chart.events.xAxisLabelClick(t,this.ctx,e)}}),t){let t=document.createElementNS(h.globals.SVGNS,"title");t.textContent=Array.isArray(y.text)?y.text.join(" "):y.text,i.node.appendChild(t),""!==y.text&&(l.push(y.text),n.push(y))}}a<u-1&&(f+=o(a+1,b))}}drawXaxisInversed(t){let e,s,i=this.w,a=new w(this.ctx),o=i.config.yaxis[0].opposite?i.globals.translateYAxisX[t]:0,r=a.group({class:"apexcharts-yaxis apexcharts-xaxis-inversed",rel:t}),l=a.group({class:"apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g",transform:"translate("+o+", 0)"});r.add(l);let n=[];if(i.config.yaxis[t].show)for(let t=0;t<this.xaxisLabels.length;t++)n.push(this.xaxisLabels[t]);e=i.globals.gridHeight/n.length,s=-e/2.2;let h=i.globals.yLabelFormatters[0];const c=i.config.yaxis[0].labels;if(c.show)for(let o=0;o<=n.length-1;o++){let r=void 0===n[o]?"":n[o];r=h(r,{seriesIndex:t,dataPointIndex:o,w:i});const d=this.axesUtils.getYAxisForeColor(c.style.colors,t),g=()=>Array.isArray(d)?d[o]:d;let p=0;Array.isArray(r)&&(p=r.length/2*parseInt(c.style.fontSize,10));let x=c.offsetX-15,b="end";this.yaxis.opposite&&(b="start"),"left"===i.config.yaxis[0].labels.align?(x=c.offsetX,b="start"):"center"===i.config.yaxis[0].labels.align?(x=c.offsetX,b="middle"):"right"===i.config.yaxis[0].labels.align&&(b="end");let f=a.drawText({x:x,y:s+e+c.offsetY-p,text:r,textAnchor:b,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});l.add(f),f.on("click",t=>{if("function"==typeof i.config.chart.events.xAxisLabelClick){const e=Object.assign({},i,{labelIndex:o});i.config.chart.events.xAxisLabelClick(t,this.ctx,e)}});let u=document.createElementNS(i.globals.SVGNS,"title");if(u.textContent=Array.isArray(r)?r.join(" "):r,f.node.appendChild(u),0!==i.config.yaxis[t].labels.rotate){let e=a.rotateAroundCenter(f.node);f.node.setAttribute("transform",`rotate(${i.config.yaxis[t].labels.rotate} 0 ${e.y})`)}s+=e}if(void 0!==i.config.yaxis[0].title.text){let t=a.group({class:"apexcharts-yaxis-title apexcharts-xaxis-title-inversed",transform:"translate("+o+", 0)"}),e=a.drawText({x:i.config.yaxis[0].title.offsetX,y:i.globals.gridHeight/2+i.config.yaxis[0].title.offsetY,text:i.config.yaxis[0].title.text,textAnchor:"middle",foreColor:i.config.yaxis[0].title.style.color,fontSize:i.config.yaxis[0].title.style.fontSize,fontWeight:i.config.yaxis[0].title.style.fontWeight,fontFamily:i.config.yaxis[0].title.style.fontFamily,cssClass:"apexcharts-yaxis-title-text "+i.config.yaxis[0].title.style.cssClass});t.add(e),r.add(t)}let d=0;this.isCategoryBarHorizontal&&i.config.yaxis[0].opposite&&(d=i.globals.gridWidth);const g=i.config.xaxis.axisBorder;if(g.show){let t=a.drawLine(i.globals.padHorizontal+g.offsetX+d,1+g.offsetY,i.globals.padHorizontal+g.offsetX+d,i.globals.gridHeight+g.offsetY,g.color,0);this.elgrid&&this.elgrid.elGridBorders&&i.config.grid.show?this.elgrid.elGridBorders.add(t):r.add(t)}return i.config.yaxis[0].axisTicks.show&&this.axesUtils.drawYAxisTicks(d,n.length,i.config.yaxis[0].axisBorder,i.config.yaxis[0].axisTicks,0,e,r),r}drawXaxisTicks(t,e,s){let i=this.w,a=t;if(t<0||t-2>i.globals.gridWidth)return;let o=this.offY+i.config.xaxis.axisTicks.offsetY;if(e=e+o+i.config.xaxis.axisTicks.height,"top"===i.config.xaxis.position&&(e=o-i.config.xaxis.axisTicks.height),i.config.xaxis.axisTicks.show){let r=new w(this.ctx).drawLine(t+i.config.xaxis.axisTicks.offsetX,o+i.config.xaxis.offsetY,a+i.config.xaxis.axisTicks.offsetX,e+i.config.xaxis.offsetY,i.config.xaxis.axisTicks.color);s.add(r),r.node.classList.add("apexcharts-xaxis-tick")}}getXAxisTicksPositions(){const t=this.w;let e=[];const s=this.xaxisLabels.length;let i=t.globals.padHorizontal;if(t.globals.timescaleLabels.length>0)for(let t=0;t<s;t++)i=this.xaxisLabels[t].position,e.push(i);else{let a=s;for(let s=0;s<a;s++){let s=a;t.globals.isXNumeric&&"bar"!==t.config.chart.type&&(s-=1),i+=t.globals.gridWidth/s,e.push(i)}}return e}xAxisLabelCorrections(){let t=this.w,e=new w(this.ctx),s=t.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"),i=t.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"),a=t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"),o=t.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan");if(t.globals.rotateXLabels||t.config.xaxis.labels.rotateAlways)for(let a=0;a<i.length;a++){let o=e.rotateAroundCenter(i[a]);o.y=o.y-1,o.x=o.x+1,i[a].setAttribute("transform",`rotate(${t.config.xaxis.labels.rotate} ${o.x} ${o.y})`),i[a].setAttribute("text-anchor","end"),s.setAttribute("transform","translate(0, -10)");let r=i[a].childNodes;t.config.xaxis.labels.trim&&Array.prototype.forEach.call(r,s=>{e.placeTextWithEllipsis(s,s.textContent,t.globals.xAxisLabelsHeight-("bottom"===t.config.legend.position?20:10))})}else{let s=t.globals.gridWidth/(t.globals.labels.length+1);for(let a=0;a<i.length;a++){let o=i[a].childNodes;t.config.xaxis.labels.trim&&"datetime"!==t.config.xaxis.type&&Array.prototype.forEach.call(o,t=>{e.placeTextWithEllipsis(t,t.textContent,s)})}}if(a.length>0){let s=a[a.length-1].getBBox(),i=a[0].getBBox();s.x<-20&&a[a.length-1].parentNode.removeChild(a[a.length-1]),i.x+i.width>t.globals.gridWidth&&!t.globals.isBarHorizontal&&a[0].parentNode.removeChild(a[0]);for(let s=0;s<o.length;s++)e.placeTextWithEllipsis(o[s],o[s].textContent,t.config.yaxis[0].labels.maxWidth-(t.config.yaxis[0].title.text?2*parseFloat(t.config.yaxis[0].title.style.fontSize):0)-15)}}}class j{constructor(t){this.ctx=t,this.w=t.w;const e=this.w;this.xaxisLabels=e.globals.labels.slice(),this.axesUtils=new L(t),this.isRangeBar=e.globals.seriesRange.length&&e.globals.isBarHorizontal,e.globals.timescaleLabels.length>0&&(this.xaxisLabels=e.globals.timescaleLabels.slice())}drawGridArea(t=null){const e=this.w,s=new w(this.ctx);t||(t=s.group({class:"apexcharts-grid"}));const i=s.drawLine(e.globals.padHorizontal,1,e.globals.padHorizontal,e.globals.gridHeight,"transparent"),a=s.drawLine(e.globals.padHorizontal,e.globals.gridHeight,e.globals.gridWidth,e.globals.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 w(this.ctx),i=Array.isArray(t.config.stroke.width)?Math.max(...t.config.stroke.width):t.config.stroke.width,a=t=>{const s=document.createElementNS(e.SVGNS,"clipPath");return s.setAttribute("id",t),s};e.dom.elGridRectMask=a(`gridRectMask${e.cuid}`),e.dom.elGridRectBarMask=a(`gridRectBarMask${e.cuid}`),e.dom.elGridRectMarkerMask=a(`gridRectMarkerMask${e.cuid}`),e.dom.elForecastMask=a(`forecastMask${e.cuid}`),e.dom.elNonForecastMask=a(`nonForecastMask${e.cuid}`);let o=0,r=0;(["bar","rangeBar","candlestick","boxPlot"].includes(t.config.chart.type)||t.globals.comboBarCount>0)&&t.globals.isXNumeric&&!t.globals.isBarHorizontal&&(o=Math.max(t.config.grid.padding.left,e.barPadForNumericAxis),r=Math.max(t.config.grid.padding.right,e.barPadForNumericAxis)),e.dom.elGridRect=s.drawRect(-i/2-2,-i/2-2,e.gridWidth+i+4,e.gridHeight+i+4,0,"#fff"),e.dom.elGridRectBar=s.drawRect(-i/2-o-2,-i/2-2,e.gridWidth+i+r+o+4,e.gridHeight+i+4,0,"#fff");const l=t.globals.markers.largestSize;e.dom.elGridRectMarker=s.drawRect(Math.min(-i/2-o-2,-l),-l,e.gridWidth+Math.max(i+r+o+4,2*l),e.gridHeight+2*l,0,"#fff"),e.dom.elGridRectMask.appendChild(e.dom.elGridRect.node),e.dom.elGridRectBarMask.appendChild(e.dom.elGridRectBar.node),e.dom.elGridRectMarkerMask.appendChild(e.dom.elGridRectMarker.node);const n=e.dom.baseEl.querySelector("defs");n.appendChild(e.dom.elGridRectMask),n.appendChild(e.dom.elGridRectBarMask),n.appendChild(e.dom.elGridRectMarkerMask),n.appendChild(e.dom.elForecastMask),n.appendChild(e.dom.elNonForecastMask)}_drawGridLines({i:t,x1:e,y1:s,x2:i,y2:a,xCount:o,parent:r}){const l=this.w;if(!(0===t&&l.globals.skipFirstTimelinelabel||t===o-1&&l.globals.skipLastTimelinelabel&&!l.config.xaxis.labels.formatter||"radar"===l.config.chart.type)){l.config.grid.xaxis.lines.show&&this._drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:o,parent:r});let n=0;if(l.globals.hasXaxisGroups&&"between"===l.config.xaxis.tickPlacement){const e=l.globals.groups;if(e){let s=0;for(let i=0;s<t&&i<e.length;i++)s+=e[i].cols;s===t&&(n=.6*l.globals.xAxisLabelsHeight)}}new V(this.ctx).drawXaxisTicks(e,n,l.globals.dom.elGraphical)}}_drawGridLine({i:t,x1:e,y1:s,x2:i,y2:a,xCount:o,parent:r}){const l=this.w,n=r.node.classList.contains("apexcharts-gridlines-horizontal"),h=l.globals.barPadForNumericAxis,c=0===s&&0===a||0===e&&0===i||s===l.globals.gridHeight&&a===l.globals.gridHeight||l.globals.isBarHorizontal&&(0===t||t===o-1),d=new w(this).drawLine(e-(n?h:0),s,i+(n?h:0),a,l.config.grid.borderColor,l.config.grid.strokeDashArray);d.node.classList.add("apexcharts-gridline"),c&&l.config.grid.show?this.elGridBorders.add(d):r.add(d)}_drawGridBandRect({c:t,x1:e,y1:s,x2:i,y2:a,type:o}){const r=this.w,l=new w(this.ctx),n=r.globals.barPadForNumericAxis,h=r.config.grid[o].colors[t],c=l.drawRect(e-("row"===o?n:0),s,i+("row"===o?2*n:0),a,0,h,r.config.grid[o].opacity);this.elg.add(c),c.attr("clip-path",`url(#gridRectMask${r.globals.cuid})`),c.node.classList.add(`apexcharts-grid-${o}`)}_drawXYLines({xCount:t,tickAmount:e}){const s=this.w,i=({xC:e,x1:s,y1:i,x2:a,y2:o})=>{for(let r=0;r<e;r++)s=this.xaxisLabels[r].position,a=this.xaxisLabels[r].position,this._drawGridLines({i:r,x1:s,y1:i,x2:a,y2:o,xCount:t,parent:this.elgridLinesV})},a=({xC:e,x1:i,y1:a,x2:o,y2:r})=>{for(let l=0;l<e+(s.globals.isXNumeric?0:1);l++)0===l&&1===e&&1===s.globals.dataPoints&&(o=i=s.globals.gridWidth/2),this._drawGridLines({i:l,x1:i,y1:a,x2:o,y2:r,xCount:t,parent:this.elgridLinesV}),o=i+=s.globals.gridWidth/(s.globals.isXNumeric?e-1:e)};if(s.config.grid.xaxis.lines.show||s.config.xaxis.axisTicks.show){let e,o=s.globals.padHorizontal,r=0,l=s.globals.gridHeight;s.globals.timescaleLabels.length?i({xC:t,x1:o,y1:r,x2:e,y2:l}):(s.globals.isXNumeric&&(t=s.globals.xAxisScale.result.length),a({xC:t,x1:o,y1:r,x2:e,y2:l}))}if(s.config.grid.yaxis.lines.show){let t=0,i=0,a=0,o=s.globals.gridWidth,r=e+1;this.isRangeBar&&(r=s.globals.labels.length);for(let l=0;l<r+(this.isRangeBar?1:0);l++)this._drawGridLine({i:l,xCount:r+(this.isRangeBar?1:0),x1:t,y1:i,x2:o,y2:a,parent:this.elgridLinesH}),i+=s.globals.gridHeight/(this.isRangeBar?r:e),a=i}}_drawInvertedXYLines({xCount:t}){const e=this.w;if(e.config.grid.xaxis.lines.show||e.config.xaxis.axisTicks.show){let s,i=e.globals.padHorizontal,a=0,o=e.globals.gridHeight;for(let r=0;r<t+1;r++){e.config.grid.xaxis.lines.show&&this._drawGridLine({i:r,xCount:t+1,x1:i,y1:a,x2:s,y2:o,parent:this.elgridLinesV});new V(this.ctx).drawXaxisTicks(i,0,e.globals.dom.elGraphical),i+=e.globals.gridWidth/t,s=i}}if(e.config.grid.yaxis.lines.show){let t=0,s=0,i=0,a=e.globals.gridWidth;for(let o=0;o<e.globals.dataPoints+1;o++)this._drawGridLine({i:o,xCount:e.globals.dataPoints+1,x1:t,y1:s,x2:a,y2:i,parent:this.elgridLinesH}),s+=e.globals.gridHeight/e.globals.dataPoints,i=s}}renderGrid(){var t,e,s;const i=this.w,a=i.globals,o=new w(this.ctx);this.elg=o.group({class:"apexcharts-grid"}),this.elgridLinesH=o.group({class:"apexcharts-gridlines-horizontal"}),this.elgridLinesV=o.group({class:"apexcharts-gridlines-vertical"}),this.elGridBorders=o.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 r=0;for(;r<a.seriesYAxisMap.length&&a.ignoreYAxisIndexes.includes(r);)r++;r===a.seriesYAxisMap.length&&(r=0);let l,n=a.yAxisScale[r].result.length-1;return!a.isBarHorizontal||this.isRangeBar?(l=this.xaxisLabels.length,this.isRangeBar&&(n=a.labels.length,i.config.xaxis.tickAmount&&i.config.xaxis.labels.formatter&&(l=i.config.xaxis.tickAmount),(null==(s=null==(e=null==(t=a.yAxisScale)?void 0:t[r])?void 0:e.result)?void 0:s.length)>0&&"datetime"!==i.config.xaxis.type&&(l=a.yAxisScale[r].result.length-1)),this._drawXYLines({xCount:l,tickAmount:n})):(l=n,n=a.xTickAmount,this._drawInvertedXYLines({xCount:l,tickAmount:n})),this.drawGridBands(l,n),{el:this.elg,elGridBorders:this.elGridBorders,xAxisTickWidth:a.gridWidth/l}}drawGridBands(t,e){var s,i,a;const o=this.w,r=(t,s,i,a,r,l)=>{for(let n=0,h=0;n<s;n++,h++)h>=o.config.grid[t].colors.length&&(h=0),this._drawGridBandRect({c:h,x1:i,y1:a,x2:r,y2:l,type:t}),a+=o.globals.gridHeight/e};if((null==(s=o.config.grid.row.colors)?void 0:s.length)>0&&r("row",e,0,0,o.globals.gridWidth,o.globals.gridHeight/e),(null==(i=o.config.grid.column.colors)?void 0:i.length)>0){let e=o.globals.isBarHorizontal||"on"!==o.config.xaxis.tickPlacement||"category"!==o.config.xaxis.type&&!o.config.xaxis.convertedCatToNumeric?t:t-1;o.globals.isXNumeric&&(e=o.globals.xAxisScale.result.length-1);let s=o.globals.padHorizontal,i=0,r=o.globals.padHorizontal+o.globals.gridWidth/e,l=o.globals.gridHeight;for(let n=0,h=0;n<t;n++,h++)h>=o.config.grid.column.colors.length&&(h=0),"datetime"===o.config.xaxis.type&&(s=this.xaxisLabels[n].position,r=((null==(a=this.xaxisLabels[n+1])?void 0:a.position)||o.globals.gridWidth)-this.xaxisLabels[n].position),this._drawGridBandRect({c:h,x1:s,y1:i,x2:r,y2:l,type:"column"}),s+=o.globals.gridWidth/e}}}class U{constructor(t){this.ctx=t,this.w=t.w,this.coreUtils=new v(this.ctx)}niceScale(t,e,s=0){const i=1e-11,a=this.w,o=a.globals;let r,l,n,h;o.isBarHorizontal?(r=a.config.xaxis,l=Math.max((o.svgWidth-100)/25,2)):(r=a.config.yaxis[s],l=Math.max((o.svgHeight-100)/15,2)),u.isNumber(l)||(l=10),n=void 0!==r.min&&null!==r.min,h=void 0!==r.max&&null!==r.min;let c=void 0!==r.stepSize&&null!==r.stepSize,d=void 0!==r.tickAmount&&null!==r.tickAmount,g=d?r.tickAmount:o.niceScaleDefaultTicks[Math.min(Math.round(l/2),o.niceScaleDefaultTicks.length-1)];if(o.isMultipleYAxis&&!d&&o.multiAxisTickAmount>0&&(g=o.multiAxisTickAmount,d=!0),g="dataPoints"===g?o.dataPoints-1:Math.abs(Math.round(g)),(t===Number.MIN_VALUE&&0===e||!u.isNumber(t)&&!u.isNumber(e)||t===Number.MIN_VALUE&&e===-Number.MAX_VALUE)&&(t=u.isNumber(r.min)?r.min:0,e=u.isNumber(r.max)?r.max:t+g,o.allSeriesCollapsed=!1),t>e){let s=e;e=t,t=s}else t===e&&(t=0===t?0:t-1,e=0===e?2:e+1);let p=[];g<1&&(g=1);let x=g,b=Math.abs(e-t);!n&&t>0&&t/b<.15&&(t=0,n=!0),!h&&e<0&&-e/b<.15&&(e=0,h=!0),b=Math.abs(e-t);let f=b/x,m=f,y=Math.floor(Math.log10(m)),w=Math.pow(10,y),v=Math.ceil(m/w);if(v=o.niceScaleAllowedMagMsd[0===o.yValueDecimal?0:1][v],m=v*w,f=m,o.isBarHorizontal&&r.stepSize&&"datetime"!==r.type?(f=r.stepSize,c=!0):c&&(f=r.stepSize),c&&r.forceNiceScale){let t=Math.floor(Math.log10(f));f*=Math.pow(10,y-t)}if(n&&h){let t=b/x;if(d)if(c)if(0!=u.mod(b,f)){let e=u.getGCD(f,t);f=t/e<10?e:t}else 0==u.mod(f,t)?f=t:(t=f,d=!1);else f=t;else if(c)0==u.mod(b,f)?t=f:f=t;else if(0==u.mod(b,f))t=f;else{x=Math.ceil(b/f),t=b/x;let e=u.getGCD(b,f);b/e<l&&(t=e),f=t}x=Math.round(b/f)}else{if(n||h){if(h)if(d)t=e-f*x;else{let s=t;t=f*Math.floor(t/f),Math.abs(e-t)/u.getGCD(b,f)>l&&(t=e-f*g,t+=f*Math.floor((s-t)/f))}else if(n)if(d)e=t+f*x;else{let s=e;e=f*Math.ceil(e/f),Math.abs(e-t)/u.getGCD(b,f)>l&&(e=t+f*g,e+=f*Math.ceil((s-e)/f))}}else if(o.isMultipleYAxis&&d){let s=f*Math.floor(t/f),i=s+f*x;i<e&&(f*=2),i=e,e=(t=s)+f*x,b=Math.abs(e-t),t>0&&t<Math.abs(i-e)&&(t=0,e=f*x),e<0&&-e<Math.abs(s-t)&&(e=0,t=-f*x)}else t=f*Math.floor(t/f),e=f*Math.ceil(e/f);b=Math.abs(e-t),f=u.getGCD(b,f),x=Math.round(b/f)}if(d||n||h||(x=Math.ceil((b-i)/(f+i)),x>16&&u.getPrimeFactors(x).length<2&&x++),!d&&r.forceNiceScale&&0===o.yValueDecimal&&x>b&&(x=b,f=Math.round(b/x)),x>l&&(!d&&!c||r.forceNiceScale)){let t=u.getPrimeFactors(x),e=t.length-1,s=x;t:for(var A=0;A<e;A++)for(var C=0;C<=e-A;C++){let i=Math.min(C+A,e),a=s,o=1;for(var S=C;S<=i;S++)o*=t[S];if(a/=o,a<l){s=a;break t}}f=s===x?b:b/s,x=Math.round(b/f)}o.isMultipleYAxis&&0==o.multiAxisTickAmount&&o.ignoreYAxisIndexes.indexOf(s)<0&&(o.multiAxisTickAmount=x);let k=t-f,L=f*i;do{k+=f,p.push(u.stripNumber(k,7))}while(e-k>L);return{result:p,niceMin:p[0],niceMax:p[p.length-1]}}linearScale(t,e,s=10,i=0,a=void 0){let o=Math.abs(e-t),r=[];if(t===e)return r=[t],{result:r,niceMin:r[0],niceMax:r[r.length-1]};"dataPoints"===(s=this._adjustTicksForSmallRange(s,i,o))&&(s=this.w.globals.dataPoints-1),a||(a=o/s);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}s===Number.MAX_VALUE&&(s=5,a=1);let l=t;for(;s>=0;)r.push(l),l=u.preciseAddition(l,a),s-=1;return{result:r,niceMin:r[0],niceMax:r[r.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),o=Math.log(t)/Math.log(s),r=a-o,l=Math.round(r),n=r/l;for(let t=0,e=o;t<l;t++,e+=n)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));u.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;let o=i.isBarHorizontal?a.xaxis:a.yaxis[t];void 0===i.yAxisScale[t]&&(i.yAxisScale[t]=[]);let r=Math.abs(s-e);o.logarithmic&&r<=5&&(i.invalidLogScale=!0),o.logarithmic&&r>5?(i.allSeriesCollapsed=!1,i.yAxisScale[t]=o.forceNiceScale?this.logarithmicScaleNice(e,s,o.logBase):this.logarithmicScale(e,s,o.logBase)):s!==-Number.MAX_VALUE&&u.isNumber(s)&&e!==Number.MAX_VALUE&&u.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&&u.isNumber(e)){let 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();let s=e.seriesYAxisMap,i=e.minYArr,a=e.maxYArr;e.allSeriesCollapsed=!0,e.barGroups=[],s.forEach((s,o)=>{let r=[];if(s.forEach(e=>{var s;let i=null==(s=t.series[e])?void 0:s.group;r.indexOf(i)<0&&r.push(i)}),s.length>0){let l,n,h=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=h,g=c;if(t.chart.stacked){let i=new Array(e.dataPoints).fill(0),a=[],p=[],x=[];r.forEach(()=>{a.push(i.map(()=>Number.MIN_VALUE)),p.push(i.map(()=>Number.MIN_VALUE)),x.push(i.map(()=>Number.MIN_VALUE))});for(let i=0;i<s.length;i++){!l&&t.series[s[i]].type&&(l=t.series[s[i]].type);let h=s[i];n=t.series[h].group?t.series[h].group:"axis-".concat(o),!(e.collapsedSeriesIndices.indexOf(h)<0&&e.ancillaryCollapsedSeriesIndices.indexOf(h)<0)||(e.allSeriesCollapsed=!1,r.forEach((s,i)=>{if(t.series[h].group===s)for(let t=0;t<e.series[h].length;t++){let s=e.series[h][t];s>=0?p[i][t]+=s:x[i][t]+=s,a[i][t]+=s,d=Math.min(d,s),g=Math.max(g,s)}})),"bar"!==l&&"column"!==l||e.barGroups.push(n)}l||(l=t.chart.type),"bar"===l||"column"===l?r.forEach((t,e)=>{h=Math.min(h,Math.min.apply(null,x[e])),c=Math.max(c,Math.max.apply(null,p[e]))}):(r.forEach((t,e)=>{d=Math.min(d,Math.min.apply(null,a[e])),g=Math.max(g,Math.max.apply(null,a[e]))}),h=d,c=g),h===Number.MIN_VALUE&&c===Number.MIN_VALUE&&(c=-Number.MAX_VALUE)}else for(let t=0;t<s.length;t++){let o=s[t];h=Math.min(h,i[o]),c=Math.max(c,a[o]),!(e.collapsedSeriesIndices.indexOf(o)<0&&e.ancillaryCollapsedSeriesIndices.indexOf(o)<0)||(e.allSeriesCollapsed=!1)}void 0!==t.yaxis[o].min&&(h="function"==typeof t.yaxis[o].min?t.yaxis[o].min(h):t.yaxis[o].min),void 0!==t.yaxis[o].max&&(c="function"==typeof t.yaxis[o].max?t.yaxis[o].max(c):t.yaxis[o].max),e.barGroups=e.barGroups.filter((t,e,s)=>s.indexOf(t)===e),this.setYScaleForIndex(o,h,c),s.forEach(t=>{i[t]=e.yAxisScale[o].niceMin,a[t]=e.yAxisScale[o].niceMax})}else this.setYScaleForIndex(o,0,-Number.MAX_VALUE)})}}class q{constructor(t){this.ctx=t,this.w=t.w,this.scales=new U(t)}init(){this.setYRange(),this.setXRange(),this.setZRange()}getMinYMaxY(t,e=Number.MAX_VALUE,s=-Number.MAX_VALUE,i=null){var a,o,r,l,n;const h=this.w.config,c=this.w.globals;let d=-Number.MAX_VALUE,g=Number.MIN_VALUE;null===i&&(i=t+1);let p=c.series,x=p,b=p;"candlestick"===h.chart.type?(x=c.seriesCandleL,b=c.seriesCandleH):"boxPlot"===h.chart.type?(x=c.seriesCandleO,b=c.seriesCandleC):c.isRangeData&&(x=c.seriesRangeStart,b=c.seriesRangeEnd);let f=!1;if(c.seriesX.length>=i){let t=null==(a=c.brushSource)?void 0:a.w.config.chart.brush;(h.chart.zoom.enabled&&h.chart.zoom.autoScaleYaxis||(null==t?void 0:t.enabled)&&(null==t?void 0:t.autoScaleYaxis))&&(f=!0)}for(let a=t;a<i;a++){c.dataPoints=Math.max(c.dataPoints,p[a].length);const t=h.series[a].type;c.categoryLabels.length&&(c.dataPoints=c.categoryLabels.filter(t=>void 0!==t).length),c.labels.length&&"datetime"!==h.xaxis.type&&0!==c.series.reduce((t,e)=>t+e.length,0)&&(c.dataPoints=Math.max(c.dataPoints,c.labels.length));let i=0,m=p[a].length-1;if(f){if(h.xaxis.min)for(;i<m&&c.seriesX[a][i]<h.xaxis.min;i++);if(h.xaxis.max)for(;m>i&&c.seriesX[a][m]>h.xaxis.max;m--);}for(let h=i;h<=m&&h<c.series[a].length;h++){let i=p[a][h];if(null!==i&&u.isNumber(i)){switch(void 0!==(null==(o=b[a])?void 0:o[h])&&(d=Math.max(d,b[a][h]),e=Math.min(e,b[a][h])),void 0!==(null==(r=x[a])?void 0:r[h])&&(e=Math.min(e,x[a][h]),s=Math.max(s,x[a][h])),t){case"candlestick":void 0!==c.seriesCandleC[a][h]&&(d=Math.max(d,c.seriesCandleH[a][h]),e=Math.min(e,c.seriesCandleL[a][h]));break;case"boxPlot":void 0!==c.seriesCandleC[a][h]&&(d=Math.max(d,c.seriesCandleC[a][h]),e=Math.min(e,c.seriesCandleO[a][h]))}t&&"candlestick"!==t&&"boxPlot"!==t&&"rangeArea"!==t&&"rangeBar"!==t&&(d=Math.max(d,c.series[a][h]),e=Math.min(e,c.series[a][h])),c.seriesGoals[a]&&c.seriesGoals[a][h]&&Array.isArray(c.seriesGoals[a][h])&&c.seriesGoals[a][h].forEach(t=>{d=Math.max(d,t.value),e=Math.min(e,t.value)}),s=d,i=u.noExponents(i),u.isFloat(i)&&(c.yValueDecimal=Math.max(c.yValueDecimal,i.toString().split(".")[1].length)),g>(null==(l=x[a])?void 0:l[h])&&(null==(n=x[a])?void 0:n[h])<0&&(g=x[a][h])}else c.hasNullValues=!0}"bar"!==t&&"column"!==t||(g<0&&d<0&&(d=0,s=Math.max(s,0)),g===Number.MIN_VALUE&&(g=0,e=Math.min(e,0)))}return"rangeBar"===h.chart.type&&c.seriesRangeStart.length&&c.isBarHorizontal&&(g=e),"bar"===h.chart.type&&(g<0&&d<0&&(d=0),g===Number.MIN_VALUE&&(g=0)),{minY:g,maxY:d,lowestY:e,highestY:s}}setYRange(){let 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<t.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,null,t.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||"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=>{switch(s.type||e.chart.type){case"bar":case"column":t.barGroups.push(s.group);break;case"line":t.lineGroups.push(s.group);break;case"area":t.areaGroups.push(s.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(){let t=this.w.globals,e=this.w.config;const s="numeric"===e.xaxis.type||"datetime"===e.xaxis.type||"category"===e.xaxis.type&&!t.noLabelsProvided||t.noLabelsProvided||t.isXNumeric;if(t.isXNumeric&&(()=>{for(let e=0;e<t.series.length;e++)if(t.labels[e])for(let s=0;s<t.labels[e].length;s++)null!==t.labels[e][s]&&u.isNumber(t.labels[e][s])&&(t.maxX=Math.max(t.maxX,t.labels[e][s]),t.initialMaxX=Math.max(t.maxX,t.labels[e][s]),t.minX=Math.min(t.minX,t.labels[e][s]),t.initialMinX=Math.min(t.minX,t.labels[e][s]))})(),t.noLabelsProvided&&0===e.xaxis.categories.length&&(t.maxX=t.labels[t.labels.length-1],t.initialMaxX=t.labels[t.labels.length-1],t.minX=1,t.initialMinX=1),t.isXNumeric||t.noLabelsProvided||t.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(t.series.length>1&&(i=t.series[t.maxValsInArrayIndex].length-1),t.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&&!t.dataFormatXNumeric){let 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),t.noLabelsProvided&&t.labels.length>0&&(t.xAxisScale=this.scales.linearScale(1,t.labels.length,i-1,0,e.xaxis.stepSize),t.seriesX=t.labels.slice());s&&(t.labels=t.xAxisScale.result.slice())}return t.isBarHorizontal&&t.labels.length&&(t.xTickAmount=t.labels.length),this._handleSingleDataPoint(),this._getMinXDiff(),{minX:t.minX,maxX:t.maxX}}setZRange(){let t=this.w.globals;if(t.isDataXYZ)for(let e=0;e<t.series.length;e++)if(void 0!==t.seriesZ[e])for(let s=0;s<t.seriesZ[e].length;s++)null!==t.seriesZ[e][s]&&u.isNumber(t.seriesZ[e][s])&&(t.maxZ=Math.max(t.maxZ,t.seriesZ[e][s]),t.minZ=Math.min(t.minZ,t.seriesZ[e][s]))}_handleSingleDataPoint(){const t=this.w.globals,e=this.w.config;if(t.minX===t.maxX){let s=new S(this.ctx);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&&!t.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;t.isXNumeric&&t.seriesX.forEach(e=>{if(e.length){1===e.length&&e.push(t.seriesX[t.maxValsInArrayIndex][t.seriesX[t.maxValsInArrayIndex].length-1]);const s=e.slice();s.sort((t,e)=>t-e),s.forEach((e,i)=>{if(i>0){let 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(!t.series.length)return;let e=t.seriesGroups;e.length||(e=[this.w.globals.seriesNames.map(t=>t)]);let s={},i={};e.forEach(e=>{s[e]=[],i[e]=[];this.w.config.series.map((s,i)=>e.indexOf(t.seriesNames[i])>-1?i:null).filter(t=>null!==t).forEach(a=>{var o,r,l,n;for(let h=0;h<t.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==(r=null==(o=this.w.config.series)?void 0:o[a])?void 0:r.type)||"column"===(null==(n=null==(l=this.w.config.series)?void 0:l[a])?void 0:n.type)))&&null!==t.series[a][h]&&u.isNumber(t.series[a][h])&&(t.series[a][h]>0?s[e][h]+=parseFloat(t.series[a][h])+1e-4:i[e][h]+=parseFloat(t.series[a][h]))}})}),Object.entries(s).forEach(([e])=>{s[e].forEach((a,o)=>{t.maxY=Math.max(t.maxY,s[e][o]),t.minY=Math.min(t.minY,i[e][o])})})}}class Z{constructor(t,e){this.ctx=t,this.elgrid=e,this.w=t.w;const s=this.w;this.xaxisFontSize=s.config.xaxis.labels.style.fontSize,this.axisFontFamily=s.config.xaxis.labels.style.fontFamily,this.xaxisForeColors=s.config.xaxis.labels.style.colors,this.isCategoryBarHorizontal="bar"===s.config.chart.type&&s.config.plotOptions.bar.horizontal,this.xAxisoffX="bottom"===s.config.xaxis.position?s.globals.gridHeight:0,this.drawnLabels=[],this.axesUtils=new L(t)}drawYaxis(t){const e=this.w,s=new w(this.ctx),i=e.config.yaxis[t].labels.style,{fontSize:a,fontFamily:o,fontWeight:r}=i,l=s.group({class:"apexcharts-yaxis",rel:t,transform:`translate(${e.globals.translateYAxisX[t]}, 0)`});if(this.axesUtils.isYAxisHidden(t))return l;const n=s.group({class:"apexcharts-yaxis-texts-g"});l.add(n);const h=e.globals.yAxisScale[t].result.length-1,c=e.globals.gridHeight/h,d=e.globals.yLabelFormatters[t];let g=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());if(e.config.yaxis[t].labels.show){let l=e.globals.translateY+e.config.yaxis[t].labels.offsetY;e.globals.isBarHorizontal?l=0:"heatmap"===e.config.chart.type&&(l-=c/2),l+=parseInt(a,10)/3;let p=null;for(let x=h;x>=0;x--){let h=d(g[x],x,e),b=e.config.yaxis[t].labels.padding;e.config.yaxis[t].opposite&&0!==e.config.yaxis.length&&(b*=-1);const f=this.getTextAnchor(e.config.yaxis[t].labels.align,e.config.yaxis[t].opposite),m=this.axesUtils.getYAxisForeColor(i.colors,t),y=Array.isArray(m)?m[x]:m,w=u.listToArray(e.globals.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-label tspan`)).map(t=>t.textContent),v=s.drawText({x:b,y:l,text:w.includes(h)&&!e.config.yaxis[t].labels.showDuplicates?"":h,textAnchor:f,fontSize:a,fontFamily:o,fontWeight:r,maxWidth:e.config.yaxis[t].labels.maxWidth,foreColor:y,isPlainText:!1,cssClass:`apexcharts-yaxis-label ${i.cssClass}`});n.add(v),this.addTooltip(v,h),null===p&&(p=v),0!==e.config.yaxis[t].labels.rotate&&this.rotateLabel(s,v,p,e.config.yaxis[t].labels.rotate),l+=c}}return this.addYAxisTitle(s,l,t),this.addAxisBorder(s,l,t,h,c),l}getTextAnchor(t,e){return"left"===t?"start":"center"===t?"middle":"right"===t?"end":e?"start":"end"}addTooltip(t,e){const s=document.createElementNS(this.w.globals.SVGNS,"title");s.textContent=Array.isArray(e)?e.join(" "):e,t.node.appendChild(s)}rotateLabel(t,e,s,i){const a=t.rotateAroundCenter(s.node),o=t.rotateAroundCenter(e.node);e.node.setAttribute("transform",`rotate(${i} ${a.x} ${o.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"}),o=i.config.yaxis[s].opposite?i.globals.translateYAxisX[s]:0,r=t.drawText({x:o,y:i.globals.gridHeight/2+i.globals.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(r),e.add(a)}}addAxisBorder(t,e,s,i,a){const o=this.w,r=o.config.yaxis[s].axisBorder;let l=31+r.offsetX;if(o.config.yaxis[s].opposite&&(l=-31-r.offsetX),r.show){const s=t.drawLine(l,o.globals.translateY+r.offsetY-2,l,o.globals.gridHeight+o.globals.translateY+r.offsetY+2,r.color,0,r.width);e.add(s)}o.config.yaxis[s].axisTicks.show&&this.axesUtils.drawYAxisTicks(l,i,r,o.config.yaxis[s].axisTicks,s,a,e)}drawYaxisInversed(t){const e=this.w,s=new w(this.ctx),i=s.group({class:"apexcharts-xaxis apexcharts-yaxis-inversed"}),a=s.group({class:"apexcharts-xaxis-texts-g",transform:`translate(${e.globals.translateXAxisX}, ${e.globals.translateXAxisY})`});i.add(a);let o=e.globals.yAxisScale[t].result.length-1;const r=e.globals.gridWidth/o+.1;let l=r+e.config.xaxis.labels.offsetX;const n=e.globals.xLabelFormatter;let h=this.axesUtils.checkForReversedLabels(t,e.globals.yAxisScale[t].result.slice());const c=e.globals.timescaleLabels;if(c.length>0&&(this.xaxisLabels=c.slice(),h=c.slice(),o=h.length),e.config.xaxis.labels.show)for(let i=c.length?0:o;c.length?i<c.length:i>=0;c.length?i++:i--){let o=n(h[i],i,e),d=e.globals.gridWidth+e.globals.padHorizontal-(l-r+e.config.xaxis.labels.offsetX);if(c.length){const t=this.axesUtils.getLabel(h,c,d,i,this.drawnLabels,this.xaxisFontSize);d=t.x,o=t.text,this.drawnLabels.push(t.text),0===i&&e.globals.skipFirstTimelinelabel&&(o=""),i===h.length-1&&e.globals.skipLastTimelinelabel&&(o="")}const g=s.drawText({x:d,y:this.xAxisoffX+e.config.xaxis.labels.offsetY+30-("top"===e.config.xaxis.position?e.globals.xAxisHeight+e.config.xaxis.axisTicks.height-2:0),text:o,textAnchor:"middle",foreColor:Array.isArray(this.xaxisForeColors)?this.xaxisForeColors[t]:this.xaxisForeColors,fontSize:this.xaxisFontSize,fontFamily:this.xaxisFontFamily,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,o),l+=r}return this.inversedYAxisTitleText(i),this.inversedYAxisBorder(i),i}inversedYAxisBorder(t){const e=this.w,s=new w(this.ctx),i=e.config.xaxis.axisBorder;if(i.show){let a=0;"bar"===e.config.chart.type&&e.globals.isXNumeric&&(a-=15);const o=s.drawLine(e.globals.padHorizontal+a+i.offsetX,this.xAxisoffX,e.globals.gridWidth,this.xAxisoffX,i.color,0,i.height);this.elgrid&&this.elgrid.elGridBorders&&e.config.grid.show?this.elgrid.elGridBorders.add(o):t.add(o)}}inversedYAxisTitleText(t){const e=this.w,s=new w(this.ctx);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.globals.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 w(this.ctx),a=s.globals.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-texts-g`),o=a?a.getBoundingClientRect():{width:0,height:0},r=s.globals.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${t}'] .apexcharts-yaxis-title text`),l=r?r.getBoundingClientRect():{width:0,height:0};if(r){const a=this.xPaddingForYAxisTitle(t,o,l,e);r.setAttribute("x",a.xPos-(e?10:0));const n=i.rotateAroundCenter(r);r.setAttribute("transform",`rotate(${e?-1*s.config.yaxis[t].title.rotate:s.config.yaxis[t].title.rotate} ${n.x} ${n.y})`)}}xPaddingForYAxisTitle(t,e,s,i){const a=this.w;let o=0,r=10;return void 0===a.config.yaxis[t].title.text||t<0?{xPos:o,padd:0}:(i?o=e.width+a.config.yaxis[t].title.offsetX+s.width/2+r/2:(o=-1*e.width+a.config.yaxis[t].title.offsetX+r/2+s.width/2,a.globals.isBarHorizontal&&(r=25,o=-1*e.width-a.config.yaxis[t].title.offsetX-r)),{xPos:o,padd:r})}setYAxisXPosition(t,e){const s=this.w;let i=0,a=0,o=18,r=1;s.config.yaxis.length>1&&(this.multipleYs=!0),s.config.yaxis.forEach((l,n)=>{const h=s.globals.ignoreYAxisIndexes.includes(n)||!l.show||l.floating||0===t[n].width,c=t[n].width+e[n].width;l.opposite?s.globals.isBarHorizontal?(a=s.globals.gridWidth+s.globals.translateX-1,s.globals.translateYAxisX[n]=a-l.labels.offsetX):(a=s.globals.gridWidth+s.globals.translateX+r,h||(r+=c+20),s.globals.translateYAxisX[n]=a-l.labels.offsetX+20):(i=s.globals.translateX-o,h||(o+=c+20),s.globals.translateYAxisX[n]=i+l.labels.offsetX)})}setYAxisTextAlignments(){const t=this.w;u.listToArray(t.globals.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.globals.dom.baseEl.querySelector(`.apexcharts-yaxis[rel='${s}'] .apexcharts-yaxis-texts-g`),a=u.listToArray(t.globals.dom.baseEl.querySelectorAll(`.apexcharts-yaxis[rel='${s}'] .apexcharts-yaxis-label`)),o=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(${o.width/2*(i.opposite?1:-1)}, 0)`):"right"===i.labels.align&&i.opposite&&e.setAttribute("transform",`translate(${o.width}, 0)`):e.setAttribute("transform",`translate(-${o.width}, 0)`)}})}}class J{constructor(t){this.ctx=t,this.w=t.w,this.documentEvent=u.bind(this.documentEvent,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;let 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=[]);let 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;let s=t.globals.dom.baseEl.querySelector(t.globals.chartClass);this.ctx.eventList.forEach(i=>{s.addEventListener(i,s=>{let i=null===s.target.getAttribute("i")&&-1!==t.globals.capturedSeriesIndex?t.globals.capturedSeriesIndex:s.target.getAttribute("i"),a=null===s.target.getAttribute("j")&&-1!==t.globals.capturedDataPointIndex?t.globals.capturedDataPointIndex:s.target.getAttribute("j");const o=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&&("function"==typeof t.config.chart.events.keyDown&&t.config.chart.events.keyDown(s,e,o),e.ctx.events.fireEvent("keydown",[s,e,o])):"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,o),e.ctx.events.fireEvent("keyup",[s,e,o])):"mousemove"===s.type||"touchmove"===s.type?"function"==typeof t.config.chart.events.mouseMove&&t.config.chart.events.mouseMove(s,e,o):"mouseleave"===s.type||"touchleave"===s.type?"function"==typeof t.config.chart.events.mouseLeave&&t.config.chart.events.mouseLeave(s,e,o):("mouseup"===s.type&&1===s.which||"touchend"===s.type)&&("function"==typeof t.config.chart.events.click&&t.config.chart.events.click(s,e,o),e.ctx.events.fireEvent("click",[s,e,o]))},{capture:!1,passive:!0})}),this.ctx.eventList.forEach(e=>{t.globals.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){let t=e.globals.dom.baseEl.querySelector(".apexcharts-menu");t&&t.classList.contains("apexcharts-menu-open")&&"apexcharts-menu-icon"!==s&&t.classList.remove("apexcharts-menu-open")}e.globals.clientX="touchmove"===t.type?t.touches[0].clientX:t.clientX,e.globals.clientY="touchmove"===t.type?t.touches[0].clientY:t.clientY}}class K{constructor(t){this.ctx=t,this.w=t.w}setCurrentLocaleValues(t){let e=this.w.config.chart.locales;window.Apex.chart&&window.Apex.chart.locales&&window.Apex.chart.locales.length>0&&(e=this.w.config.chart.locales.concat(window.Apex.chart.locales));const s=e.filter(e=>e.name===t)[0];if(!s)throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options");{let t=u.extend(I,s);this.w.globals.locale=t.options}}}class Q{constructor(t){this.ctx=t,this.w=t.w}drawAxis(t,e){let s=this.w.globals,i=this.w.config,a=new V(this.ctx,e),o=new Z(this.ctx,e);if(s.axisCharts&&"radar"!==t){let t,e;s.isBarHorizontal?(e=o.drawYaxisInversed(0),t=a.drawXaxisInversed(0),s.dom.elGraphical.add(t),s.dom.elGraphical.add(e)):(t=a.drawXaxis(),s.dom.elGraphical.add(t),i.yaxis.map((t,i)=>{if(-1===s.ignoreYAxisIndexes.indexOf(i)&&(e=o.drawYaxis(i),s.dom.Paper.add(e),"back"===this.w.config.grid.position)){const t=s.dom.Paper.children()[1];t.remove(),s.dom.Paper.add(t)}}))}}}class tt{constructor(t){this.ctx=t,this.w=t.w}drawXCrosshairs(){const t=this.w;let e=new w(this.ctx),s=new y(this.ctx),i=t.config.xaxis.crosshairs.fill.gradient,a=t.config.xaxis.crosshairs.dropShadow,o=t.config.xaxis.crosshairs.fill.type,r=i.colorFrom,l=i.colorTo,n=i.opacityFrom,h=i.opacityTo,c=i.stops,d=a.enabled,g=a.left,p=a.top,x=a.blur,b=a.color,f=a.opacity,m=t.config.xaxis.crosshairs.fill.color;if(t.config.xaxis.crosshairs.show){"gradient"===o&&(m=e.drawGradient("vertical",r,l,n,h,null,c,null));let i=e.drawRect();1===t.config.xaxis.crosshairs.width&&(i=e.drawLine());let a=t.globals.gridHeight;(!u.isNumber(a)||a<0)&&(a=0);let y=t.config.xaxis.crosshairs.width;(!u.isNumber(y)||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:x,color:b,opacity:f})),t.globals.dom.elGraphical.add(i)}}drawYCrosshairs(){const t=this.w;let e=new w(this.ctx),s=t.config.yaxis[0].crosshairs;const i=t.globals.barPadForNumericAxis;if(t.config.yaxis[0].crosshairs.show){let a=e.drawLine(-i,0,t.globals.gridWidth+i,0,s.stroke.color,s.stroke.dashArray,s.stroke.width);a.attr({class:"apexcharts-ycrosshairs"}),t.globals.dom.elGraphical.add(a)}let a=e.drawLine(-i,0,t.globals.gridWidth+i,0,s.stroke.color,0,0);a.attr({class:"apexcharts-ycrosshairs-hidden"}),t.globals.dom.elGraphical.add(a)}}class et{constructor(t){this.ctx=t,this.w=t.w}checkResponsiveConfig(t){const e=this.w,s=e.config;if(0===s.responsive.length)return;let i=s.responsive.slice();i.sort((t,e)=>t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0).reverse();let a=new R({});const o=(t={})=>{let s=i[0].breakpoint;const o=window.innerWidth>0?window.innerWidth:screen.width;if(o>s){let s=u.clone(e.globals.initialConfig);s.series=u.clone(e.config.series);let i=v.extendArrayProps(a,s,e);t=u.extend(i,t),t=u.extend(e.config,t),this.overrideResponsiveOptions(t)}else for(let s=0;s<i.length;s++)o<i[s].breakpoint&&(t=v.extendArrayProps(a,i[s].options,e),t=u.extend(e.config,t),this.overrideResponsiveOptions(t))};if(t){let s=v.extendArrayProps(a,t,e);s=u.extend(e.config,s),s=u.extend(s,t),o(s)}else o({})}overrideResponsiveOptions(t){let e=new R(t).init({responsiveOverride:!0});this.w.config=e}}class st{constructor(t){this.ctx=t,this.w=t.w,this.colors=[],this.isColorFn=!1,this.isHeatmapDistributed=this.checkHeatmapDistributed(),this.isBarDistributed=this.checkBarDistributed()}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(){const t=this.w,e=new u;t.globals.dom.elWrap.classList.add(`apexcharts-theme-${t.config.theme.mode||"light"}`);const s=[...t.config.colors||t.config.fill.colors||[]];t.globals.colors=this.getColors(s),this.applySeriesColors(t.globals.seriesColors,t.globals.colors),t.config.theme.monochrome.enabled&&(t.globals.colors=this.getMonochromeColors(t.config.theme.monochrome,t.globals.series,e));const i=t.globals.colors.slice();this.pushExtraColors(t.globals.colors),this.applyColorTypes(["fill","stroke"],i),this.applyDataLabelsColors(i),this.applyRadarPolygonsColors(),this.applyMarkersColors(i)}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)=>{let a=t[i]||t[0];return"function"==typeof a?a({value:e.globals.axisCharts?e.globals.series[i][0]||0:e.globals.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:o}=t,r=this.isBarDistributed||this.isHeatmapDistributed?e[0].length*e.length:e.length,l=1/(r/a);let n=0;return Array.from({length:r},()=>{const t="dark"===o?s.shadeColor(-1*n,i):s.shadeColor(n,i);return n+=l,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.globals.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.globals.series.length&&(a=i.globals.series[i.globals.maxValsInArrayIndex].length*i.globals.series.length),t.length<a){let e=a-t.length;for(let s=0;s<e;s++)t.push(t[s])}}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=this.w.config.theme.palette,e=this.ctx.constructor.getThemePalettes();return e[t]||e.palette1}}class it{constructor(t){this.ctx=t,this.w=t.w}draw(){this.drawTitleSubtitle("title"),this.drawTitleSubtitle("subtitle")}drawTitleSubtitle(t){let e=this.w;const s="title"===t?e.config.title:e.config.subtitle;let i=e.globals.svgWidth/2,a=s.offsetY,o="middle";if("left"===s.align?(i=10,o="start"):"right"===s.align&&(i=e.globals.svgWidth-10,o="end"),i+=s.offsetX,a=a+parseInt(s.style.fontSize,10)+s.margin/2,void 0!==s.text){let r=new w(this.ctx).drawText({x:i,y:a,text:s.text,textAnchor:o,fontSize:s.style.fontSize,fontFamily:s.style.fontFamily,fontWeight:s.style.fontWeight,foreColor:s.style.color,opacity:1});r.node.setAttribute("class",`apexcharts-${t}-text`),e.globals.dom.Paper.add(r)}}}let at=class{constructor(t){this.w=t.w,this.dCtx=t}getTitleSubtitleCoords(t){let e=this.w,s=0,i=0;const a="title"===t?e.config.title.floating:e.config.subtitle.floating;let o=e.globals.dom.baseEl.querySelector(`.apexcharts-${t}-text`);if(null!==o&&!a){let t=o.getBoundingClientRect();s=t.width,i=e.globals.axisCharts?t.height+5:t.height}return{width:s,height:i}}getLegendsRect(){let t=this.w,e=t.globals.dom.elLegendWrap;t.config.legend.height||"top"!==t.config.legend.position&&"bottom"!==t.config.legend.position||(e.style.maxHeight=t.globals.svgHeight/2+"px");let s=Object.assign({},u.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(){let t=this.w,e=[];t.config.series.forEach((s,i)=>{s.data.forEach((s,a)=>{const o=(e=>t.config.dataLabels.formatter(e,{ctx:this.dCtx.ctx,seriesIndex:i,dataPointIndex:a,w:t}))(t.globals.series[i][a]);e.push(o)})});let s=u.getLargestStringFromArr(e),i=new w(this.dCtx.ctx);const a=t.config.dataLabels.style;let o=i.getTextRects(s,parseInt(a.fontSize),a.fontFamily);return{width:1.05*o.width,height:o.height}}getLargestStringFromMultiArr(t,e){let s=t;if(this.w.globals.isMultiLineX){let t=e.map(t=>Array.isArray(t)?t.length:1),i=Math.max(...t);s=e[t.indexOf(i)]}return s}};class ot{constructor(t){this.w=t.w,this.dCtx=t}getxAxisLabelsCoords(){let t,e=this.w,s=e.globals.labels.slice();if(e.config.xaxis.convertedCatToNumeric&&0===s.length&&(s=e.globals.categoryLabels),e.globals.timescaleLabels.length>0){const s=this.getxAxisTimeScaleLabelsCoords();t={width:s.width,height:s.height},e.globals.rotateXLabels=!1}else{this.dCtx.lgWidthForSideLegends="left"!==e.config.legend.position&&"right"!==e.config.legend.position||e.config.legend.floating?0:this.dCtx.lgRect.width;let i=e.globals.xLabelFormatter,a=u.getLargestStringFromArr(s),o=this.dCtx.dimHelpers.getLargestStringFromMultiArr(a,s);e.globals.isBarHorizontal&&(a=e.globals.yAxisScale[0].result.reduce((t,e)=>t.length>e.length?t:e,0),o=a);let r=new k(this.dCtx.ctx),l=a;a=r.xLabelFormat(i,a,l,{i:void 0,dateFormatter:new S(this.dCtx.ctx).formatDate,w:e}),o=r.xLabelFormat(i,o,l,{i:void 0,dateFormatter:new S(this.dCtx.ctx).formatDate,w:e}),(e.config.xaxis.convertedCatToNumeric&&void 0===a||""===String(a).trim())&&(a="1",o=a);let n=new w(this.dCtx.ctx),h=n.getTextRects(a,e.config.xaxis.labels.style.fontSize),c=h;if(a!==o&&(c=n.getTextRects(o,e.config.xaxis.labels.style.fontSize)),t={width:h.width>=c.width?h.width:c.width,height:h.height>=c.height?h.height:c.height},t.width*s.length>e.globals.svgWidth-this.dCtx.lgWidthForSideLegends-this.dCtx.yAxisWidth-this.dCtx.gridPad.left-this.dCtx.gridPad.right&&0!==e.config.xaxis.labels.rotate||e.config.xaxis.labels.rotateAlways){if(!e.globals.isBarHorizontal){e.globals.rotateXLabels=!0;const s=t=>n.getTextRects(t,e.config.xaxis.labels.style.fontSize,e.config.xaxis.labels.style.fontFamily,`rotate(${e.config.xaxis.labels.rotate} 0 0)`,!1);h=s(a),a!==o&&(c=s(o)),t.height=(h.height>c.height?h.height:c.height)/1.5,t.width=h.width>c.width?h.width:c.width}}else e.globals.rotateXLabels=!1}return e.config.xaxis.labels.show||(t={width:0,height:0}),{width:t.width,height:t.height}}getxAxisGroupLabelsCoords(){var t;let e=this.w;if(!e.globals.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;let i,a=e.globals.groups.map(t=>t.title),o=u.getLargestStringFromArr(a),r=this.dCtx.dimHelpers.getLargestStringFromMultiArr(o,a),l=new w(this.dCtx.ctx),n=l.getTextRects(o,s),h=n;return o!==r&&(h=l.getTextRects(r,s)),i={width:n.width>=h.width?n.width:h.width,height:n.height>=h.height?n.height:h.height},e.config.xaxis.labels.show||(i={width:0,height:0}),{width:i.width,height:i.height}}getxAxisTitleCoords(){let t=this.w,e=0,s=0;if(void 0!==t.config.xaxis.title.text){let i=new w(this.dCtx.ctx).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize);e=i.width,s=i.height}return{width:e,height:s}}getxAxisTimeScaleLabelsCoords(){let t,e=this.w;this.dCtx.timescaleLabels=e.globals.timescaleLabels.slice();let s=this.dCtx.timescaleLabels.map(t=>t.value),i=s.reduce((t,e)=>void 0===t?0:t.length>e.length?t:e,0);return t=new w(this.dCtx.ctx).getTextRects(i,e.config.xaxis.labels.style.fontSize),1.05*t.width*s.length>e.globals.gridWidth&&0!==e.config.xaxis.labels.rotate&&(e.globals.overlappingXLabels=!0),t}additionalPaddingXLabels(t){const e=this.w,s=e.globals,i=e.config,a=i.xaxis.type;let o=t.width;s.skipLastTimelinelabel=!1,s.skipFirstTimelinelabel=!1;const r=e.config.yaxis[0].opposite&&e.globals.isBarHorizontal,l=t=>{if(this.dCtx.timescaleLabels&&this.dCtx.timescaleLabels.length){const a=this.dCtx.timescaleLabels[0],r=this.dCtx.timescaleLabels[this.dCtx.timescaleLabels.length-1].position+o/1.75-this.dCtx.yAxisWidthRight,l=a.position-o/1.75+this.dCtx.yAxisWidthLeft;let n="right"===e.config.legend.position&&this.dCtx.lgRect.width>0?this.dCtx.lgRect.width:0;r>s.svgWidth-s.translateX-n&&(s.skipLastTimelinelabel=!0),l<-(t.show&&!t.floating||"bar"!==i.chart.type&&"candlestick"!==i.chart.type&&"rangeBar"!==i.chart.type&&"boxPlot"!==i.chart.type?10:o/1.75)&&(s.skipFirstTimelinelabel=!0)}else"datetime"===a?this.dCtx.gridPad.right<o&&!s.rotateXLabels&&(s.skipLastTimelinelabel=!0):"datetime"!==a&&this.dCtx.gridPad.right<o/2-this.dCtx.yAxisWidthRight&&!s.rotateXLabels&&!e.config.xaxis.labels.trim&&(this.dCtx.xPadRight=o/2+1)},n=(t,e)=>{i.yaxis.length>1&&(t=>-1!==s.collapsedSeriesIndices.indexOf(t))(e)||l(t)};i.yaxis.forEach((t,e)=>{r?(this.dCtx.gridPad.left<o&&(this.dCtx.xPadLeft=o/2+1),this.dCtx.xPadRight=o/2+1):n(t,e)})}}class rt{constructor(t){this.w=t.w,this.dCtx=t}getyAxisLabelsCoords(){let t=this.w,e=[],s=10;const i=new L(this.dCtx.ctx);return t.config.yaxis.map((a,o)=>{const r={seriesIndex:o,dataPointIndex:-1,w:t},l=t.globals.yAxisScale[o];let n=0;if(!i.isYAxisHidden(o)&&a.labels.show&&void 0!==a.labels.minWidth&&(n=a.labels.minWidth),!i.isYAxisHidden(o)&&a.labels.show&&l.result.length){let i=t.globals.yLabelFormatters[o],h=l.niceMin===Number.MIN_VALUE?0:l.niceMin,c=l.result.reduce((t,e)=>{var s,a;return(null==(s=String(i(t,r)))?void 0:s.length)>(null==(a=String(i(e,r)))?void 0:a.length)?t:e},h);c=i(c,r);let d=c;if(void 0!==c&&0!==c.length||(c=l.niceMax),1===String(c).length&&(c+=".0",d=c),t.globals.isBarHorizontal){s=0;let e=t.globals.labels.slice();c=u.getLargestStringFromArr(e),c=i(c,{seriesIndex:o,dataPointIndex:-1,w:t}),d=this.dCtx.dimHelpers.getLargestStringFromMultiArr(c,e)}let g=new w(this.dCtx.ctx),p="rotate(".concat(a.labels.rotate," 0 0)"),x=g.getTextRects(c,a.labels.style.fontSize,a.labels.style.fontFamily,p,!1),b=x;c!==d&&(b=g.getTextRects(d,a.labels.style.fontSize,a.labels.style.fontFamily,p,!1)),e.push({width:(n>b.width||n>x.width?n:b.width>x.width?b.width:x.width)+s,height:b.height>x.height?b.height:x.height})}else e.push({width:0,height:0})}),e}getyAxisTitleCoords(){let t=this.w,e=[];return t.config.yaxis.map(t=>{if(t.show&&void 0!==t.title.text){let s=new w(this.dCtx.ctx),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(){let t=this.w,e=0,s=0,i=0,a=t.globals.yAxisScale.length>1?10:0;const o=new L(this.dCtx.ctx),r=(r,l)=>{let n=t.config.yaxis[l].floating,h=0;r.width>0&&!n?(h=r.width+a,function(e){return t.globals.ignoreYAxisIndexes.indexOf(e)>-1}(l)&&(h=h-r.width-a)):h=n||o.isYAxisHidden(l)?0:5,t.config.yaxis[l].opposite?i+=h:s+=h,e+=h};return t.globals.yLabelsCoords.map((t,e)=>{r(t,e)}),t.globals.yTitleCoords.map((t,e)=>{r(t,e)}),t.globals.isBarHorizontal&&!t.config.yaxis[0].floating&&(e=t.globals.yLabelsCoords[0].width+t.globals.yTitleCoords[0].width+15),this.dCtx.yAxisWidthLeft=s,this.dCtx.yAxisWidthRight=i,e}}class lt{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"].includes(t),o=s.chart.type;let r=0,l=a(o)?s.series.length:1;i.comboBarCount>0&&(l=i.comboBarCount),i.collapsedSeries.forEach(t=>{a(t.type)&&(l-=1)}),s.chart.stacked&&(l=1);const n=a(o)||i.comboBarCount>0;let h=Math.abs(i.initialMaxX-i.initialMinX);if(n&&i.isXNumeric&&!i.isBarHorizontal&&l>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),r=a*parseInt(s.plotOptions.bar.columnWidth,10)/100,r<1&&(r=1),i.barPadForNumericAxis=r}return r}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");e.gridHeight-=i.height+a.height+s,e.translateY+=i.height+a.height+s}setGridXPosForDualYAxis(t,e){const{w:s}=this,i=new L(this.dCtx.ctx);s.config.yaxis.forEach((a,o)=>{-1!==s.globals.ignoreYAxisIndexes.indexOf(o)||a.floating||i.isYAxisHidden(o)||(a.opposite&&(s.globals.translateX-=e[o].width+t[o].width+parseInt(a.labels.style.fontSize,10)/1.2+12),s.globals.translateX<2&&(s.globals.translateX=2))})}}class nt{constructor(t){this.ctx=t,this.w=t.w,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 at(this),this.dimYAxis=new rt(this),this.dimXAxis=new ot(this),this.dimGrid=new lt(this),this.lgWidthForSideLegends=0,this.gridPad=this.w.config.grid.padding,this.xPadRight=0,this.xPadLeft=0}plotCoords(){let 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(),e.gridHeight=e.gridHeight-this.gridPad.top-this.gridPad.bottom,e.gridWidth=e.gridWidth-this.gridPad.left-this.gridPad.right-this.xPadRight-this.xPadLeft;let i=this.dimGrid.gridPadForColumnsInNumericAxis(e.gridWidth);e.gridWidth=e.gridWidth-2*i,e.translateX=e.translateX+this.gridPad.left+this.xPadLeft+(i>0?i:0),e.translateY=e.translateY+this.gridPad.top}setDimensionsForAxisCharts(){let t=this.w,e=t.globals,s=this.dimYAxis.getyAxisLabelsCoords(),i=this.dimYAxis.getyAxisTitleCoords();e.isSlopeChart&&(this.datalabelsCoords=this.dimHelpers.getDatalabelsRect()),t.globals.yLabelsCoords=[],t.globals.yTitleCoords=[],t.config.yaxis.map((e,a)=>{t.globals.yLabelsCoords.push({width:s[a].width,index:a}),t.globals.yTitleCoords.push({width:i[a].width,index:a})}),this.yAxisWidth=this.dimYAxis.getTotalYAxisWidth();let a=this.dimXAxis.getxAxisLabelsCoords(),o=this.dimXAxis.getxAxisGroupLabelsCoords(),r=this.dimXAxis.getxAxisTitleCoords();this.conditionalChecksForAxisCoords(a,r,o),e.translateXAxisY=t.globals.rotateXLabels?this.xAxisHeight/8:-4,e.translateXAxisX=t.globals.rotateXLabels&&t.globals.isXNumeric&&t.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,t.globals.isBarHorizontal&&(e.rotateXLabels=!1,e.translateXAxisY=parseInt(t.config.xaxis.labels.style.fontSize,10)/1.5*-1),e.translateXAxisY=e.translateXAxisY+t.config.xaxis.labels.offsetY,e.translateXAxisX=e.translateXAxisX+t.config.xaxis.labels.offsetX;let l=this.yAxisWidth,n=this.xAxisHeight;e.xAxisLabelsHeight=this.xAxisHeight-r.height,e.xAxisGroupLabelsHeight=e.xAxisLabelsHeight-a.height,e.xAxisLabelsWidth=this.xAxisWidth,e.xAxisHeight=this.xAxisHeight;let h=10;("radar"===t.config.chart.type||this.isSparkline)&&(l=0,n=0),this.isSparkline&&(this.lgRect={height:0,width:0}),(this.isSparkline||"treemap"===t.config.chart.type)&&(l=0,n=0,h=0),this.isSparkline||"treemap"===t.config.chart.type||this.dimXAxis.additionalPaddingXLabels(a);const c=()=>{e.translateX=l+this.datalabelsCoords.width,e.gridHeight=e.svgHeight-this.lgRect.height-n-(this.isSparkline||"treemap"===t.config.chart.type?0:t.globals.rotateXLabels?10:15),e.gridWidth=e.svgWidth-l-2*this.datalabelsCoords.width};switch("top"===t.config.xaxis.position&&(h=e.xAxisHeight-t.config.xaxis.axisTicks.height-5),t.config.legend.position){case"bottom":e.translateY=h,c();break;case"top":e.translateY=this.lgRect.height+h,c();break;case"left":e.translateY=h,e.translateX=this.lgRect.width+l+this.datalabelsCoords.width,e.gridHeight=e.svgHeight-n-12,e.gridWidth=e.svgWidth-this.lgRect.width-l-2*this.datalabelsCoords.width;break;case"right":e.translateY=h,e.translateX=l+this.datalabelsCoords.width,e.gridHeight=e.svgHeight-n-12,e.gridWidth=e.svgWidth-this.lgRect.width-l-2*this.datalabelsCoords.width-5;break;default:throw new Error("Legend position not supported")}this.dimGrid.setGridXPosForDualYAxis(i,s),new Z(this.ctx).setYAxisXPosition(s,i)}setDimensionsForNonAxisCharts(){let t=this.w,e=t.globals,s=t.config,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";let o=s.plotOptions[a].offsetY,r=s.plotOptions[a].offsetX;if(!s.legend.show||s.legend.floating){e.gridHeight=e.svgHeight;const t=e.dom.elWrap.getBoundingClientRect().width;return e.gridWidth=Math.min(t,e.gridHeight),e.translateY=o,void(e.translateX=r+(e.svgWidth-e.gridWidth)/2)}switch(s.legend.position){case"bottom":e.gridHeight=e.svgHeight-this.lgRect.height,e.gridWidth=e.svgWidth,e.translateY=o-10,e.translateX=r+(e.svgWidth-e.gridWidth)/2;break;case"top":e.gridHeight=e.svgHeight-this.lgRect.height,e.gridWidth=e.svgWidth,e.translateY=this.lgRect.height+o+10,e.translateX=r+(e.svgWidth-e.gridWidth)/2;break;case"left":e.gridWidth=e.svgWidth-this.lgRect.width-i,e.gridHeight="auto"!==s.chart.height?e.svgHeight:e.gridWidth,e.translateY=o,e.translateX=r+this.lgRect.width+i;break;case"right":e.gridWidth=e.svgWidth-this.lgRect.width-i-5,e.gridHeight="auto"!==s.chart.height?e.svgHeight:e.gridWidth,e.translateY=o,e.translateX=r+10;break;default:throw new Error("Legend position not supported")}}conditionalChecksForAxisCoords(t,e,s){const i=this.w,a=i.globals.hasXaxisGroups?2:1,o=s.height+t.height+e.height,r=i.globals.isMultiLineX?1.2:i.globals.LINE_HEIGHT_RATIO,l=i.globals.rotateXLabels?22:10,n=i.globals.rotateXLabels&&"bottom"===i.config.legend.position?10:0;this.xAxisHeight=o*r+a*l+n,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)}}let ht=class{constructor(t){this.w=t.w,this.lgCtx=t}getLegendStyles(){var t,e,s;let i=document.createElement("style");i.setAttribute("type","text/css");const a=(null==(s=null==(e=null==(t=this.lgCtx.ctx)?void 0:t.opts)?void 0:e.chart)?void 0:s.nonce)||this.w.config.chart.nonce;a&&i.setAttribute("nonce",a);const o=document.createTextNode(B);return i.appendChild(o),i}getLegendDimensions(){let t=this.w.globals.dom.baseEl.querySelector(".apexcharts-legend"),{width:e,height:s}=t.getBoundingClientRect();return{clwh:s,clww:e}}appendToForeignObject(){const t=this.w.globals;!1!==this.w.config.chart.injectStyleSheet&&t.dom.elLegendForeign.appendChild(this.getLegendStyles())}toggleDataSeries(t,e){const s=this.w;if(s.globals.axisCharts||"radialBar"===s.config.chart.type){s.globals.resized=!0;let i=null,a=null;if(s.globals.risingSeries=[],s.globals.axisCharts){if(i=s.globals.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${t}']`),!i)return;a=parseInt(i.getAttribute("data:realIndex"),10)}else{if(i=s.globals.dom.baseEl.querySelector(`.apexcharts-series[rel='${t+1}']`),!i)return;a=parseInt(i.getAttribute("rel"),10)-1}if(e){[{cs:s.globals.collapsedSeries,csi:s.globals.collapsedSeriesIndices},{cs:s.globals.ancillaryCollapsedSeries,csi:s.globals.ancillaryCollapsedSeriesIndices}].forEach(t=>{this.riseCollapsedSeries(t.cs,t.csi,a)})}else this.hideSeries({seriesEl:i,realIndex:a});if(s.config.chart.accessibility.enabled){const e=s.globals.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=s.globals.collapsedSeriesIndices.includes(a)||s.globals.ancillaryCollapsedSeriesIndices.includes(a);e.setAttribute("aria-pressed",i?"true":"false");const o=e.querySelector(".apexcharts-legend-text"),r=o?o.textContent:s.globals.seriesNames[t],l=i?"hidden":"visible";e.setAttribute("aria-label",`${r}, ${l}. Press Enter or Space to toggle.`)}}}else{let e=s.globals.dom.Paper.findOne(` .apexcharts-series[rel='${t+1}'] path`);const i=s.config.chart.type;if("pie"===i||"polarArea"===i||"donut"===i){let t=s.config.plotOptions.pie.donut.labels;new w(this.lgCtx.ctx).pathMouseDown(e,null),this.lgCtx.ctx.pie.printDataLabelsInner(e.node,t)}if(s.config.chart.accessibility.enabled){const e=s.globals.dom.baseEl.querySelector(`.apexcharts-legend-series[rel="${t+1}"]`);if(e){const i=s.globals.collapsedSeriesIndices.includes(t);e.setAttribute("aria-pressed",i?"true":"false");const a=e.querySelector(".apexcharts-legend-text"),o=a?a.textContent:s.globals.seriesNames[t],r=i?"hidden":"visible";e.setAttribute("aria-label",`${o}, ${r}. Press Enter or Space to toggle.`)}}}}getSeriesAfterCollapsing({realIndex:t}){const e=this.w,s=e.globals;let i=u.clone(e.config.series);if(s.axisCharts){let a=e.config.yaxis[s.seriesYAxisReverseMap[t]];const o={index:t,data:i[t].data.slice(),type:i[t].type||e.config.chart.type};if(a&&a.show&&a.showAlways)s.ancillaryCollapsedSeriesIndices.indexOf(t)<0&&(s.ancillaryCollapsedSeries.push(o),s.ancillaryCollapsedSeriesIndices.push(t));else if(s.collapsedSeriesIndices.indexOf(t)<0){s.collapsedSeries.push(o),s.collapsedSeriesIndices.push(t);let e=s.risingSeries.indexOf(t);s.risingSeries.splice(e,1)}}else s.collapsedSeries.push({index:t,data:i[t]}),s.collapsedSeriesIndices.push(t);return s.allSeriesCollapsed=s.collapsedSeries.length+s.ancillaryCollapsedSeries.length===e.config.series.length,this._getSeriesBasedOnCollapsedState(i)}hideSeries({seriesEl:t,realIndex:e}){const s=this.w;let 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.ctx.updateHelpers._updateSeries(i,s.config.chart.animations.dynamicAnimation.enabled)}riseCollapsedSeries(t,e,s){const i=this.w;let a=u.clone(i.config.series);if(t.length>0){for(let o=0;o<t.length;o++)t[o].index===s&&(i.globals.axisCharts?a[s].data=t[o].data.slice():a[s]=t[o].data,"number"!=typeof a[s]&&(a[s].hidden=!1),t.splice(o,1),e.splice(o,1),i.globals.risingSeries.push(s),o--);a=this._getSeriesBasedOnCollapsedState(a),this.lgCtx.ctx.updateHelpers._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}};class ct{constructor(t){this.ctx=t,this.w=t.w,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 ht(this)}init(){const t=this.w,e=t.globals,s=t.config,i=s.legend.showForSingleSeries&&1===e.series.length||this.isBarsDistributed||e.series.length>1;if(this.legendHelpers.appendToForeignObject(),(i||!e.axisCharts)&&s.legend.show){for(;e.dom.elLegendWrap.firstChild;)e.dom.elLegendWrap.removeChild(e.dom.elLegendWrap.firstChild);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=document.createElement("span");i.classList.add("apexcharts-legend-marker");let a=s.config.legend.markers.shape||s.config.markers.shape,o=a;Array.isArray(a)&&(o=a[t]);let r=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),c=Array.isArray(s.config.legend.markers.offsetY)?parseFloat(s.config.legend.markers.offsetY[t]):parseFloat(s.config.legend.markers.offsetY),d=Array.isArray(s.config.legend.markers.strokeWidth)?parseFloat(s.config.legend.markers.strokeWidth[t]):parseFloat(s.config.legend.markers.strokeWidth),g=i.style;if(g.height=2*(r+d)+"px",g.width=2*(r+d)+"px",g.left=h+"px",g.top=c+"px",s.config.legend.markers.customHTML)g.background="transparent",g.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 O(this.ctx).getMarkerConfig({cssClass:`apexcharts-legend-marker apexcharts-marker apexcharts-marker-${o}`,seriesIndex:t,strokeWidth:d,size:r}),h=window.SVG().addTo(i).size("100%","100%"),c=new w(this.ctx).drawMarker(0,0,n(l({},a),{pointFillColor:Array.isArray(e)?e[t]:a.pointFillColor,shape:o}));s.globals.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(c)}return i}drawLegends(){var t;let e=this,s=this.w,i=s.config.legend.fontFamily,a=s.globals.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;a=t.map(t=>t.name?t.name:t.from+" - "+t.to),o=t.map(t=>t.color)}else this.isBarsDistributed&&(a=s.globals.labels.slice());s.config.legend.customLegendItems.length&&(a=s.config.legend.customLegendItems);let r=s.globals.legendFormatter,l=s.config.legend.inverseOrder,n=[];s.globals.seriesGroups.length>1&&s.config.legend.clusterGroupedSeries&&s.globals.seriesGroups.forEach((t,e)=>{n[e]=document.createElement("div"),n[e].classList.add("apexcharts-legend-group",`apexcharts-legend-group-${e}`),"horizontal"===s.config.legend.clusterGroupedSeriesOrientation?s.globals.dom.elLegendWrap.classList.add("apexcharts-legend-group-horizontal"):n[e].classList.add("apexcharts-legend-group-vertical")});for(let e=l?a.length-1:0;l?e>=0:e<=a.length-1;l?e--:e++){let l=r(a[e],{seriesIndex:e,w:s}),h=!1,c=!1;if(s.globals.collapsedSeries.length>0)for(let t=0;t<s.globals.collapsedSeries.length;t++)s.globals.collapsedSeries[t].index===e&&(h=!0);if(s.globals.ancillaryCollapsedSeriesIndices.length>0)for(let t=0;t<s.globals.ancillaryCollapsedSeriesIndices.length;t++)s.globals.ancillaryCollapsedSeriesIndices[t]===e&&(c=!0);let d=this.createLegendMarker({i:e,fillcolor:o});w.setAttrs(d,{rel:e+1,"data:collapsed":h||c}),(h||c)&&d.classList.add("apexcharts-inactive-legend");let g=document.createElement("div");if(s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled){g.setAttribute("role","button"),g.setAttribute("tabindex","0");const t=Array.isArray(l)?l.join(" "):l,e=h||c,s=e?"hidden":"visible";g.setAttribute("aria-label",`${t}, ${s}. Press Enter or Space to toggle.`),g.setAttribute("aria-pressed",e?"true":"false")}let p=document.createElement("span");p.classList.add("apexcharts-legend-text"),p.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),p.style.color=x,p.style.fontSize=s.config.legend.fontSize,p.style.fontWeight=s.config.legend.fontWeight,p.style.fontFamily=i||s.config.chart.fontFamily,w.setAttrs(p,{rel:e+1,i:e,"data:default-text":encodeURIComponent(l),"data:collapsed":h||c}),g.appendChild(d),g.appendChild(p);const b=new v(this.ctx);if(!s.config.legend.showForZeroSeries){0===b.getSeriesTotalByIndex(e)&&b.seriesHaveSameValues(e)&&!b.isSeriesNull(e)&&-1===s.globals.collapsedSeriesIndices.indexOf(e)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&g.classList.add("apexcharts-hidden-zero-series")}s.config.legend.showForNullSeries||b.isSeriesNull(e)&&-1===s.globals.collapsedSeriesIndices.indexOf(e)&&-1===s.globals.ancillaryCollapsedSeriesIndices.indexOf(e)&&g.classList.add("apexcharts-hidden-null-series"),n.length?s.globals.seriesGroups.forEach((t,i)=>{var a;t.includes(null==(a=s.config.series[e])?void 0:a.name)&&(s.globals.dom.elLegendWrap.appendChild(n[i]),n[i].appendChild(g))}):s.globals.dom.elLegendWrap.appendChild(g),s.globals.dom.elLegendWrap.classList.add(`apexcharts-align-${s.config.legend.horizontalAlign}`),s.globals.dom.elLegendWrap.classList.add("apx-legend-position-"+s.config.legend.position),g.classList.add("apexcharts-legend-series"),g.style.margin=`${s.config.legend.itemMargin.vertical}px ${s.config.legend.itemMargin.horizontal}px`,s.globals.dom.elLegendWrap.style.width=s.config.legend.width?s.config.legend.width+"px":"",s.globals.dom.elLegendWrap.style.height=s.config.legend.height?s.config.legend.height+"px":"",w.setAttrs(g,{rel:e+1,seriesName:u.escapeString(a[e]),"data:collapsed":h||c}),(h||c)&&g.classList.add("apexcharts-inactive-legend"),s.config.legend.onItemClick.toggleDataSeries||g.classList.add("apexcharts-no-click")}s.globals.dom.elWrap.addEventListener("click",e.onLegendClick,!0),s.config.legend.onItemHover.highlightDataSeries&&0===s.config.legend.customLegendItems.length&&(s.globals.dom.elWrap.addEventListener("mousemove",e.onLegendHovered,!0),s.globals.dom.elWrap.addEventListener("mouseout",e.onLegendHovered,!0)),s.config.chart.accessibility.enabled&&s.config.chart.accessibility.keyboard.enabled&&s.globals.dom.elWrap.addEventListener("keydown",e.onLegendKeyDown.bind(e),!0)}setLegendWrapXY(t,e){let s=this.w,i=s.globals.dom.elLegendWrap;const a=i.clientHeight;let o=0,r=0;if("bottom"===s.config.legend.position)r=s.globals.svgHeight-Math.min(a,s.globals.svgHeight/2)-5;else if("top"===s.config.legend.position){const t=new nt(this.ctx),e=t.dimHelpers.getTitleSubtitleCoords("title").height,s=t.dimHelpers.getTitleSubtitleCoords("subtitle").height;r=(e>0?e-10:0)+(s>0?s-10:0)}i.style.position="absolute",o=o+t+s.config.legend.offsetX,r=r+e+s.config.legend.offsetY,i.style.left=o+"px",i.style.top=r+"px","right"===s.config.legend.position&&(i.style.left="auto",i.style.right=25+s.config.legend.offsetX+"px");["width","height"].forEach(t=>{i.style[t]&&(i.style[t]=parseInt(s.config.legend[t],10)+"px")})}legendAlignHorizontal(){let t=this.w;t.globals.dom.elLegendWrap.style.right=0;let e=new nt(this.ctx),s=e.dimHelpers.getTitleSubtitleCoords("title"),i=e.dimHelpers.getTitleSubtitleCoords("subtitle"),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(){let t=this.w,e=this.legendHelpers.getLegendDimensions(),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){const e=this.w,s=t.target.classList.contains("apexcharts-legend-series")||t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker");if("heatmap"===e.config.chart.type||this.isBarsDistributed){if(s){let e=parseInt(t.target.getAttribute("rel"),10)-1;this.ctx.events.fireEvent("legendHover",[this.ctx,e,this.w]),new G(this.ctx).highlightRangeInSeries(t,t.target)}}else if(!t.target.classList.contains("apexcharts-inactive-legend")&&s){new G(this.ctx).toggleSeriesOnHover(t,t.target)}}onLegendKeyDown(t){const e=this;(t.target.classList.contains("apexcharts-legend-series")||t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker"))&&("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.onLegendClick(t)))}onLegendClick(t){const e=this.w;if(!e.config.legend.customLegendItems.length&&(t.target.classList.contains("apexcharts-legend-series")||t.target.classList.contains("apexcharts-legend-text")||t.target.classList.contains("apexcharts-legend-marker"))){let s=parseInt(t.target.getAttribute("rel"),10)-1,i="true"===t.target.getAttribute("data:collapsed");const a=this.w.config.chart.events.legendClick;"function"==typeof a&&a(this.ctx,s,this.w),this.ctx.events.fireEvent("legendClick",[this.ctx,s,this.w]);const o=this.w.config.legend.markers.onClick;"function"==typeof o&&t.target.classList.contains("apexcharts-legend-marker")&&(o(this.ctx,s,this.w),this.ctx.events.fireEvent("legendMarkerClick",[this.ctx,s,this.w]));"treemap"!==e.config.chart.type&&"heatmap"!==e.config.chart.type&&!this.isBarsDistributed&&e.config.legend.onItemClick.toggleDataSeries&&this.legendHelpers.toggleDataSeries(s,i)}}}class dt{constructor(t){this.ctx=t,this.w=t.w;const e=this.w;this.ev=this.w.config.chart.events,this.selectedClass="apexcharts-selected",this.localeValues=this.w.globals.locale.toolbar,this.minX=e.globals.minX,this.maxX=e.globals.maxX}createToolbar(){let t=this.w;const e=()=>document.createElement("div"),s=e();if(s.setAttribute("class","apexcharts-toolbar"),s.style.top=t.config.chart.toolbar.offsetY+"px",s.style.right=3-t.config.chart.toolbar.offsetX+"px",t.globals.dom.elWrap.appendChild(s),this.elZoom=e(),this.elZoomIn=e(),this.elZoomOut=e(),this.elPan=e(),this.elSelection=e(),this.elZoomReset=e(),this.elMenuIcon=e(),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(e());let i=[];const a=(e,s,a)=>{const o=e.toLowerCase();this.t[o]&&t.config.chart.zoom.enabled&&i.push({el:s,icon:"string"==typeof this.t[o]?this.t[o]:a,title:this.localeValues[e],class:`apexcharts-${o}-icon`})};a("zoomIn",this.elZoomIn,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n'),a("zoomOut",this.elZoomOut,'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>\n</svg>\n');const o=e=>{this.t[e]&&t.config.chart[e].enabled&&i.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" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>\n <path d="M0 0h24v24H0V0z" fill="none"/>\n <path d="M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"/>\n</svg>':'<svg fill="#6E8192" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2z"/>\n</svg>',title:this.localeValues["zoom"===e?"selectionZoom":"selection"],class:`apexcharts-${e}-icon`})};o("zoom"),o("selection"),this.t.pan&&t.config.chart.zoom.enabled&&i.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000" height="24" viewBox="0 0 24 24" width="24">\n <defs>\n <path d="M0 0h24v24H0z" id="a"/>\n </defs>\n <clipPath id="b">\n <use overflow="visible" xlink:href="#a"/>\n </clipPath>\n <path clip-path="url(#b)" d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z"/>\n</svg>',title:this.localeValues.pan,class:"apexcharts-pan-icon"}),a("reset",this.elZoomReset,'<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">\n <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>\n <path d="M0 0h24v24H0z" fill="none"/>\n</svg>'),this.t.download&&i.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"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(let t=0;t<this.elCustomIcons.length;t++)i.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});i.forEach((t,e)=>{t.index&&u.moveIndexInArray(i,e,t.index)});for(let t=0;t<i.length;t++)w.setAttrs(i[t].el,{class:i[t].class,title:i[t].title}),i[t].el.innerHTML=i[t].icon,s.appendChild(i[t].el);this._createHamburgerMenu(s),t.globals.zoomEnabled?this.elZoom.classList.add(this.selectedClass):t.globals.panEnabled?this.elPan.classList.add(this.selectedClass):t.globals.selectionEnabled&&this.elSelection.classList.add(this.selectedClass),this.addToolbarEventListeners()}_createHamburgerMenu(t){this.elMenuItems=[],t.appendChild(this.elMenu),w.setAttrs(this.elMenu,{class:"apexcharts-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(document.createElement("div")),this.elMenuItems[t].innerHTML=e[t].title,w.setAttrs(this.elMenuItems[t],{class:`apexcharts-menu-item ${e[t].name}`,title:e[t].title}),this.elMenu.appendChild(this.elMenuItems[t])}addToolbarEventListeners(){this.elZoomReset.addEventListener("click",this.handleZoomReset.bind(this)),this.elSelection.addEventListener("click",this.toggleZoomSelection.bind(this,"selection")),this.elZoom.addEventListener("click",this.toggleZoomSelection.bind(this,"zoom")),this.elZoomIn.addEventListener("click",this.handleZoomIn.bind(this)),this.elZoomOut.addEventListener("click",this.handleZoomOut.bind(this)),this.elPan.addEventListener("click",this.togglePanning.bind(this)),this.elMenuIcon.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))}toggleZoomSelection(t){this.ctx.getSyncedCharts().forEach(e=>{e.ctx.toolbar.toggleOtherControls();let 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)})}getToolbarIconsReference(){const t=this.w;this.elZoom||(this.elZoom=t.globals.dom.baseEl.querySelector(".apexcharts-zoom-icon")),this.elPan||(this.elPan=t.globals.dom.baseEl.querySelector(".apexcharts-pan-icon")),this.elSelection||(this.elSelection=t.globals.dom.baseEl.querySelector(".apexcharts-selection-icon"))}enableZoomPanFromToolbar(t){this.toggleOtherControls(),"pan"===t?this.w.globals.panEnabled=!0:this.w.globals.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.globals.panEnabled=!t.w.globals.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)})}toggleOtherControls(){const t=this.w;t.globals.panEnabled=!1,t.globals.zoomEnabled=!1,t.globals.selectionEnabled=!1,this.getToolbarIconsReference();[this.elPan,this.elSelection,this.elZoom].forEach(t=>{t&&t.classList.remove(this.selectedClass)})}handleZoomIn(){const t=this.w;t.globals.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY);const e=(this.minX+this.maxX)/2;let s=(this.minX+e)/2,i=(this.maxX+e)/2;const a=this._getNewMinXMaxX(s,i);t.globals.disableZoomIn||this.zoomUpdateOptions(a.minX,a.maxX)}handleZoomOut(){const t=this.w;if(t.globals.isRangeBar&&(this.minX=t.globals.minY,this.maxX=t.globals.maxY),"datetime"===t.config.xaxis.type&&new Date(this.minX).getUTCFullYear()<1e3)return;const e=(this.minX+this.maxX)/2;let s=this.minX-(e-this.minX),i=this.maxX-(e-this.maxX);const a=this._getNewMinXMaxX(s,i);t.globals.disableZoomOut||this.zoomUpdateOptions(a.minX,a.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);a&&(i=a.xaxis);let o={xaxis:i},r=u.clone(s.globals.initialConfig.yaxis);s.config.chart.group||(o.yaxis=r),this.w.globals.zoomed=!0,this.ctx.updateHelpers._updateOptions(o,!1,this.w.config.chart.animations.dynamicAnimation.enabled),this.zoomCallback(i,r)}zoomCallback(t,e){"function"==typeof this.ev.zoomed&&(this.ev.zoomed(this.ctx,{xaxis:t,yaxis:e}),this.ctx.events.fireEvent("zoomed",{xaxis:t,yaxis:e}))}getBeforeZoomRange(t,e){let s=null;return"function"==typeof this.ev.beforeZoom&&(s=this.ev.beforeZoom(this,{xaxis:t,yaxis:e})),s}toggleMenu(){window.setTimeout(()=>{this.elMenu.classList.contains("apexcharts-menu-open")?this.elMenu.classList.remove("apexcharts-menu-open"):this.elMenu.classList.add("apexcharts-menu-open")},0)}handleDownload(t){const e=this.w,s=new _(this.ctx);switch(t){case"svg":s.exportToSVG(this.ctx);break;case"png":s.exportToPng(this.ctx);break;case"csv":s.exportToCSV({series:e.config.series,columnDelimiter:e.config.chart.toolbar.export.csv.columnDelimiter})}}handleZoomReset(){this.ctx.getSyncedCharts().forEach(t=>{let e=t.w;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}),e.globals.zoomed=!1;let s=t.ctx.series.emptyCollapsedSeries(u.clone(e.globals.initialSeries));t.updateHelpers._updateSeries(s,e.config.chart.animations.dynamicAnimation.enabled)})}destroy(){this.elZoom=null,this.elZoomIn=null,this.elZoomOut=null,this.elPan=null,this.elSelection=null,this.elZoomReset=null,this.elMenuIcon=null}}class gt{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 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 gt(t))}findOne(t){const e=this.node.querySelector(t);return e?e.instance||new gt(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 gt(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 gt(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=document.createElementNS("http://www.w3.org/2000/svg","tspan");return e.textContent=t,this.node.appendChild(e),new gt(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}}const pt="http://www.w3.org/2000/svg";class xt{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 xt(this.x,this.y)}}class bt{constructor(t,e,s,i,a,o){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!=o?o:0}rotate(t){const e=t*Math.PI/180,s=Math.cos(e),i=Math.sin(e);return this.multiply(new bt(s,i,-i,s,0,0))}scale(t,e){return this.multiply(new bt(t,0,0,null!=e?e:t,0,0))}multiply(t){return new bt(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 xt(this.a*t.x+this.c*t.y+this.e,this.b*t.x+this.d*t.y+this.f)}}class ft{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}}let ut=0;class mt extends gt{constructor(t,e,s){const i="radial"===e?"radialGradient":"linearGradient";super(f.createElementNS(pt,i)),this._id="SvgjsGradient"+ ++ut,this.attr("id",this._id),"function"==typeof s&&s(new yt(this));let a=t.node.querySelector("defs");a||(a=f.createElementNS(pt,"defs"),t.node.appendChild(a)),a.appendChild(this.node)}stop(t,e,s){const i=f.createElementNS(pt,"stop");return i.setAttribute("offset",t),i.setAttribute("stop-color",e),void 0!==s&&i.setAttribute("stop-opacity",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 yt{constructor(t){this.gradient=t}stop(t,e,s){return this.gradient.stop(t,e,s),this}}let wt=0;class vt extends gt{constructor(t,e,s,i){if(super(f.createElementNS(pt,"pattern")),this._id="SvgjsPattern"+ ++wt,this.attr({id:this._id,width:e,height:s,patternUnits:"userSpaceOnUse"}),"function"==typeof i){i(new At(this.node))}let a=t.node.querySelector("defs");a||(a=f.createElementNS(pt,"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 At extends gt{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=f.createElementNS(pt,"text");e.textContent=t;const s=new gt(e);return this.node.appendChild(e),s}text(t){const e=f.createElementNS(pt,"text"),s=new gt(e);return this.node.appendChild(e),"function"==typeof t&&t(new Ct(e)),s}image(t,e){const s=f.createElementNS(pt,"image");s.setAttributeNS("http://www.w3.org/1999/xlink","href",t);const i=new gt(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 mt(this,t,e)}pattern(t,e,s){return new vt(this,t,e,s)}_make(t){const e=f.createElementNS(pt,t);return this.node.appendChild(e),new gt(e)}_makeContainer(t){const e=f.createElementNS(pt,t);return this.node.appendChild(e),new At(e)}}class Ct{constructor(t){this.textNode=t}tspan(t){const e=f.createElementNS(pt,"tspan");return e.textContent=t,this.textNode.appendChild(e),new St(e,this.textNode)}}class St{constructor(t,e){this.node=t,this.textNode=e}newLine(){return this.node.setAttribute("dy","1.1em"),this.node.dataset.newline="1",this}}let kt=0;class Lt extends gt{constructor(){super(f.createElementNS(pt,"filter")),this._id="SvgjsFilter"+ ++kt,this.attr("id",this._id)}size(t,e,s,i){return this.attr({width:t,height:e,x:s,y:i})}}class Mt{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=f.createElementNS(pt,"feMerge");return t.forEach(t=>{const s=f.createElementNS(pt,"feMergeNode");s.setAttribute("in",t),e.appendChild(s)}),this.filter.node.appendChild(e),new gt(e)}_primitive(t,e){const s=f.createElementNS(pt,t);for(const t in e)s.setAttribute(t,e[t]);return this.filter.node.appendChild(s),new gt(s)}}function Pt(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 o=[],r=[];for(;null!==(a=s.exec(t));)o.push(a[1]),r.push(a.index);for(let s=0;s<o.length;s++){const a=r[s]+o[s].length,l=s+1<r.length?r[s+1]:t.length,n=t.substring(a,l),h=[];let c;for(i.lastIndex=0;null!==(c=i.exec(n));)h.push(parseFloat(c[0]));const d=o[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 It(t){let e=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEach(t=>{for(let o=1;o<t.length;o+=2)if(o+1<=t.length){const r=t[o],l=t[o+1];"number"==typeof r&&"number"==typeof l&&(r<e&&(e=r),r>i&&(i=r),l<s&&(s=l),l>a&&(a=l))}}),e===1/0?{x:0,y:0,width:0,height:0}:{x:e,y:s,width:i-e,height:a-s}}function Tt(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 Xt(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 zt(t){var e=[t];switch(t[0]){case"M":return this.pos=this.start=[t[1],t[2]],e;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":e=function(t,e){var s,i,a,o,r,l,n,h,c,d,g,p,x,b,f,u,m,y,w,v,A,C,S,k,L,M,P=Math.abs(e[1]),I=Math.abs(e[2]),T=e[3]%360,X=e[4],z=e[5],E=e[6],Y=e[7],R=new xt(t[0],t[1]),F=new xt(E,Y),H=[];if(0===P||0===I||R.x===F.x&&R.y===F.y)return[["C",R.x,R.y,F.x,F.y,F.x,F.y]];s=new xt((R.x-F.x)/2,(R.y-F.y)/2).transform((new bt).rotate(T)),(i=s.x*s.x/(P*P)+s.y*s.y/(I*I))>1&&(P*=i=Math.sqrt(i),I*=i);a=(new bt).rotate(T).scale(1/P,1/I).rotate(-T),R=R.transform(a),F=F.transform(a),o=[F.x-R.x,F.y-R.y],l=o[0]*o[0]+o[1]*o[1],r=Math.sqrt(l),o[0]/=r,o[1]/=r,n=l<4?Math.sqrt(1-l/4):0,X===z&&(n*=-1);h=new xt((F.x+R.x)/2+n*-o[1],(F.y+R.y)/2+n*o[0]),c=new xt(R.x-h.x,R.y-h.y),d=new xt(F.x-h.x,F.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);z&&g>p&&(p+=2*Math.PI);!z&&g<p&&(p-=2*Math.PI);for(b=Math.ceil(2*Math.abs(g-p)/Math.PI),u=[],m=g,x=(p-g)/b,f=4*Math.tan(x/4)/3,A=0;A<=b;A++)w=Math.cos(m),y=Math.sin(m),v=new xt(h.x+w,h.y+y),u[A]=[new xt(v.x+f*y,v.y-f*w),v,new xt(v.x-f*y,v.y+f*w)],m+=x;for(u[0][0]=u[0][1].clone(),u[u.length-1][2]=u[u.length-1][1].clone(),a=(new bt).rotate(T).scale(P,I).rotate(-T),A=0,C=u.length;A<C;A++)u[A][0]=u[A][0].transform(a),u[A][1]=u[A][1].transform(a),u[A][2]=u[A][2].transform(a);for(A=1,C=u.length;A<C;A++)S=(v=u[A-1][2]).x,k=v.y,L=(v=u[A][0]).x,M=v.y,E=(v=u[A][1]).x,Y=v.y,H.push(["C",S,k,L,M,E,Y]);return H}(this.pos,t),t=e[0]}return t[0]="C",this.pos=[t[5],t[6]],this.reflection=[2*t[5]-t[3],2*t[6]-t[4]],e}function Et(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 Yt(t,e,s,i,a,o){for(var r=t.slice(e,s||void 0),l=i.slice(a,o||void 0),n=0,h={pos:[0,0],start:[0,0]},c={pos:[0,0],start:[0,0]};r[n]=Tt.call(h,r[n]),l[n]=Tt.call(c,l[n]),r[n][0]!=l[n][0]||"M"==r[n][0]||"A"==r[n][0]&&(r[n][4]!=l[n][4]||r[n][5]!=l[n][5])?(Array.prototype.splice.apply(r,[n,1].concat(zt.call(h,r[n]))),Array.prototype.splice.apply(l,[n,1].concat(zt.call(c,l[n])))):(r[n]=Xt.call(h,r[n]),l[n]=Xt.call(c,l[n])),++n!=r.length||n!=l.length;)n==r.length&&r.push(["C",h.pos[0],h.pos[1],h.pos[0],h.pos[1],h.pos[0],h.pos[1]]),n==l.length&&l.push(["C",c.pos[0],c.pos[1],c.pos[0],c.pos[1],c.pos[0],c.pos[1]]);return{start:r,dest:l}}function Rt(t,e){var s=function(t,e){for(var s,i=Pt(t),a=Pt(e),o=0,r=0,l=!1,n=!1;!1!==o||!1!==r;){if(l=Et(i,!1!==o&&o+1),n=Et(a,!1!==r&&r+1),!1===o){let t=It(s.start);o=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===r){let t=It(s.dest);r=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=Yt(i,o,l,a,r,n),i=i.slice(0,o).concat(s.start,!1===l?[]:i.slice(l)),a=a.slice(0,r).concat(s.dest,!1===n?[]:a.slice(n)),o=!1!==l&&o+s.start.length,r=!1!==n&&r+s.dest.length}return{start:i,dest:a}}(t,e),i=s.start,a=s.dest;return function(t){var e=i.map(function(e,s){return a[s].map(function(i,o){return 0===o?i:e[o]+(a[s][o]-e[o])*t})});return e.map(t=>t.join(" ")).join(" ")}}function Ft(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 Ht(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 Dt{constructor(t,e,s){this.el=t,this.duration=null!=e?e:300,this.delay=s||0,this._attrTarget=null,this._plotTarget=null,this._afterCb=null,this._duringCb=null,this._next=null,this._root=null,this._scheduled=!1}attr(t){return this._attrTarget=t,this._schedule(),this}plot(t){return this._plotTarget=t,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 Dt(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._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 o=e.attr(s);t[s]=o;const r=Ft(o),l=Ft(String(this._attrTarget[s]));r&&l&&(i[s]=r,a[s]=l)}let o=null;if(this._plotTarget){const t=e.attr("d")||"";try{o=Rt(t,this._plotTarget)}catch(t){o=null}}const r=performance.now(),l=n=>{const h=n-r,c=Math.min(h/s,1),d=(g=c,-Math.cos(g*Math.PI)/2+.5);var g;if(this._attrTarget)if(c>=1)e.attr(this._attrTarget);else{const s={};for(const e of Object.keys(this._attrTarget))if(i[e]&&a[e])s[e]=Ht(i[e],a[e],d);else{const i=parseFloat(t[e]),a=parseFloat(this._attrTarget[e]);isNaN(i)||isNaN(a)||(s[e]=i+(a-i)*d)}e.attr(s)}o&&c<1&&e.attr("d",o(d)),this._duringCb&&this._duringCb(d),c<1?requestAnimationFrame(l):(this._plotTarget&&e.attr("d",this._plotTarget),this._afterCb&&this._afterCb.call(e))};requestAnimationFrame(l)};t>0?setTimeout(i,t):i()}}var Ot;function Wt(){const t=f.createElementNS(pt,"svg"),e=new At(t);return e.attr({xmlns:pt}),e}(Ot=gt).prototype.filterWith=function(t){const e=new Lt;this._filter=e;let s=this.node;for(;s&&"svg"!==s.nodeName;)s=s.parentNode;if(s){let t=s.querySelector("defs");t||(t=f.createElementNS(pt,"defs"),s.insertBefore(t,s.firstChild)),t.appendChild(e.node)}return t(new Mt(e)),this.attr("filter","url(#"+e._id+")"),this},Ot.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},Ot.prototype.filterer=function(){return this._filter},function(t){t.prototype.animate=function(t,e){return new Dt(this,t,e)}}(gt),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,o=parseFloat(a.getAttribute("x"))||0,r=parseFloat(a.getAttribute("y"))||0,l=i.clientX,n=i.clientY,h=a.ownerSVGElement;let c=null;h&&(c=h.getScreenCTM());const d=t=>{const e="touchmove"===t.type?t.touches[0]:t;let i=e.clientX-l,h=e.clientY-n;c&&(i/=c.a,h/=c.d);let d=o+i,g=r+h;const p=parseFloat(a.getAttribute("width"))||0,x=parseFloat(a.getAttribute("height"))||0;void 0!==s.minX&&d<s.minX&&(d=s.minX),void 0!==s.minY&&g<s.minY&&(g=s.minY),void 0!==s.maxX&&d+p>s.maxX&&(d=s.maxX-p),void 0!==s.maxY&&g+x>s.maxY&&(g=s.maxY-x);const b=new CustomEvent("dragmove",{detail:{handler:{move:function(t,e){a.setAttribute("x",t),a.setAttribute("y",e)}},box:{x:d,y:g,w:p,h:x,x2:d+p,y2:g+x}}});a.dispatchEvent(b)},g=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("touchmove",d),document.removeEventListener("mouseup",g),document.removeEventListener("touchend",g)};document.addEventListener("mousemove",d),document.addEventListener("touchmove",d),document.addEventListener("mouseup",g),document.addEventListener("touchend",g)};return e.node.addEventListener("mousedown",i),e.node.addEventListener("touchstart",i),e._dragCleanup=()=>{e.node.removeEventListener("mousedown",i),e.node.removeEventListener("touchstart",i)},e}}(gt),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(pt,"g");a.setAttribute("class","svg_select_points");const o=e.node.parentNode;o&&o.appendChild(a);const r={},l=["t","b","l","r","lt","rt","lb","rb"];l.forEach((t,e)=>{const i=new At(document.createElementNS(pt,"g"));a.appendChild(i.node);const o=s(i,[0,0],e,[],t);r[t]={group:i,handle:o}});const n=()=>{const t=parseFloat(e.attr("x"))||0,s=parseFloat(e.attr("y"))||0,o=parseFloat(e.attr("width"))||0,n=parseFloat(e.attr("height"))||0,h=e.node.getAttribute("transform");h?a.setAttribute("transform",h):a.removeAttribute("transform");const c={t:[t+o/2,s],b:[t+o/2,s+n],l:[t,s+n/2],r:[t+o,s+n/2],lt:[t,s],rt:[t+o,s],lb:[t,s+n],rb:[t+o,s+n]};l.forEach(t=>{r[t]&&c[t]&&i(r[t].group,c[t])})};return n(),e._selectHandles=a,e._selectHandlesMap=r,e._updateSelectPositions=n,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 o=a.group.node,r=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 o=null;a&&(o=a.getScreenCTM());const r=parseFloat(e.attr("x"))||0,l=parseFloat(e.attr("width"))||0,n=s=>{let a=("touchmove"===s.type?s.touches[0]:s).clientX-i;o&&(a/=o.a);let n=r,h=l;"l"===t?(n=r+a,h=l-a):"r"===t&&(h=l+a),h<0&&(h=0),e.attr({x:n,width:h}),e._updateSelectPositions&&e._updateSelectPositions();const c=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(c)},h=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("touchmove",n),document.removeEventListener("mouseup",h),document.removeEventListener("touchend",h);const t=new CustomEvent("resize",{detail:{el:e}});e.node.dispatchEvent(t)};document.addEventListener("mousemove",n),document.addEventListener("touchmove",n),document.addEventListener("mouseup",h),document.addEventListener("touchend",h)};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r),i.push(()=>{o.removeEventListener("mousedown",r),o.removeEventListener("touchstart",r)})};return a("l"),a("r"),e._resizeCleanup=()=>{i.forEach(t=>t())},e}}(gt),Wt.xlink="http://www.w3.org/1999/xlink",h.isBrowser()&&void 0===window.SVG&&(window.SVG=Wt);class Nt extends dt{constructor(t){super(t),this.ctx=t,this.w=t.w,this.dragged=!1,this.graphics=new w(this.ctx),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}){let 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.globals.dom.baseEl.querySelector(".apexcharts-grid"),this.constraints=new ft(0,0,e.globals.gridWidth,e.globals.gridHeight),this.zoomRect.node.classList.add("apexcharts-zoom-rect"),this.selectionRect.node.classList.add("apexcharts-selection-rect"),e.globals.dom.Paper.add(this.zoomRect),e.globals.dom.Paper.add(this.selectionRect),"x"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,minY:0,maxX:e.globals.gridWidth,maxY:e.globals.gridHeight}).on("dragmove.namespace",this.selectionDragging.bind(this,"dragging")):"y"===e.config.chart.selection.type?this.slDraggableRect=this.selectionRect.draggable({minX:0,maxX:e.globals.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.globals.dom.baseEl.querySelector(`${e.globals.chartClass} .apexcharts-svg`),this.hoverArea.classList.add("apexcharts-zoomable"),this.eventList.forEach(e=>{this.hoverArea.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})}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){let s=this.w;const i=this.ctx.toolbar;let a=s.globals.zoomEnabled?s.config.chart.zoom.type:s.config.chart.selection.type;const o=s.config.chart.toolbar.autoSelected;if(e.shiftKey?(this.shiftWasPressed=!0,i.enableZoomPanFromToolbar("pan"===o?"zoom":"pan")):this.shiftWasPressed&&(i.enableZoomPanFromToolbar(o),this.shiftWasPressed=!1),!e.target)return;const r=e.target.classList;let l;e.target.parentNode&&null!==e.target.parentNode&&(l=e.target.parentNode.classList);if(!(r.contains("apexcharts-legend-marker")||r.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){let t=this.gridRect.getBoundingClientRect();this.startX=this.clientX-t.left-s.globals.barPadForNumericAxis,this.startY=this.clientY-t.top,this.dragged=!1,this.w.globals.mousedown=!0}("mousemove"===e.type&&1===e.which||"touchmove"===e.type)&&(this.dragged=!0,s.globals.panEnabled?(s.globals.selection=null,this.w.globals.mousedown&&this.panDragging({context:this,zoomtype:a,xyRatios:t})):(this.w.globals.mousedown&&s.globals.zoomEnabled||this.w.globals.mousedown&&s.globals.selectionEnabled)&&(this.selection=this.selectionDrawing({context:this,zoomtype:a}))),"mouseup"!==e.type&&"touchend"!==e.type&&"mouseleave"!==e.type||this.handleMouseUp({zoomtype:a}),this.makeSelectionRectDraggable()}}handleMouseUp({zoomtype:t,isResized:e}){var s;const i=this.w;let a=null==(s=this.gridRect)?void 0:s.getBoundingClientRect();a&&(this.w.globals.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.globals.zoomEnabled||i.globals.selectionEnabled)&&this.selectionDrawn({context:this,zoomtype:t})),i.globals.zoomEnabled&&this.hideSelectionRect(this.selectionRect),this.dragged=!1,this.w.globals.mousedown=!1}mouseWheelEvent(t){const e=this.w;t.preventDefault();const s=Date.now();s-e.globals.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.globals.lastWheelExecution=s),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{s-e.globals.lastWheelExecution>this.wheelDelay&&(this.executeMouseWheelZoom(t),e.globals.lastWheelExecution=s)},this.debounceDelay)}executeMouseWheelZoom(t){var e;const s=this.w;this.minX=s.globals.isRangeBar?s.globals.minY:s.globals.minX,this.maxX=s.globals.isRangeBar?s.globals.maxY:s.globals.maxX;const i=null==(e=this.gridRect)?void 0:e.getBoundingClientRect();if(!i)return;const a=(t.clientX-i.left)/i.width,o=this.minX,r=this.maxX,l=r-o;let n,h,c;if(t.deltaY<0){n=.5*l;const t=o+a*l;h=t-n/2,c=t+n/2}else n=1.5*l,h=o-n/2,c=r+n/2;if(!s.globals.isRangeBar){h=Math.max(h,s.globals.initialMinX),c=Math.min(c,s.globals.initialMaxX);const t=.01*(s.globals.initialMaxX-s.globals.initialMinX);if(c-h<t){const e=(h+c)/2;h=e-t/2,c=e+t/2}}const d=this._getNewMinXMaxX(h,c);isNaN(d.minX)||isNaN(d.maxX)||this.zoomUpdateOptions(d.minX,d.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",()=>{let e=t.globals.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.globals.zoomEnabled)if(void 0!==t.globals.selection&&null!==t.globals.selection)this.drawSelectionRect(n(l({},t.globals.selection),{translateX:t.globals.translateX,translateY:t.globals.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.globals.gridWidth-(t.globals.maxX-t.config.chart.selection.xaxis.max)/e.xRatio-s;t.globals.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);let a={x:s,y:0,width:i,height:t.globals.gridHeight,translateX:t.globals.translateX,translateY:t.globals.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:o=0}){const r=this.w,l=this.zoomRect,n=this.selectionRect;if(this.dragged||null!==r.globals.selection){let h={transform:"translate("+a+", "+o+")"};r.globals.zoomEnabled&&this.dragged&&(s<0&&(s=1),l.attr({x:t,y:e,width:s,height:i,fill:r.config.chart.zoom.zoomedArea.fill.color,"fill-opacity":r.config.chart.zoom.zoomedArea.fill.opacity,stroke:r.config.chart.zoom.zoomedArea.stroke.color,"stroke-width":r.config.chart.zoom.zoomedArea.stroke.width,"stroke-opacity":r.config.chart.zoom.zoomedArea.stroke.opacity}),w.setAttrs(l.node,h)),r.globals.selectionEnabled&&(n.attr({x:t,y:e,width:s>0?s:0,height:i>0?i:0,fill:r.config.chart.selection.fill.color,"fill-opacity":r.config.chart.selection.fill.opacity,stroke:r.config.chart.selection.stroke.color,"stroke-width":r.config.chart.selection.stroke.width,"stroke-dasharray":r.config.chart.selection.stroke.dashArray,"stroke-opacity":r.config.chart.selection.stroke.opacity}),w.setAttrs(n.node,h))}}hideSelectionRect(t){t&&t.attr({x:0,y:0,width:0,height:0})}selectionDrawing({context:t,zoomtype:e}){const s=this.w;let i=t,a=this.gridRect.getBoundingClientRect(),o=i.startX-1,r=i.startY,h=!1,c=!1;const d=i.clientX-a.left-s.globals.barPadForNumericAxis,g=i.clientY-a.top;let p=d-o,x=g-r,b={translateX:s.globals.translateX,translateY:s.globals.translateY};return Math.abs(p+o)>s.globals.gridWidth?p=s.globals.gridWidth-o:d<0&&(p=o),o>d&&(h=!0,p=Math.abs(p)),r>g&&(c=!0,x=Math.abs(x)),b="x"===e?{x:h?o-p:o,y:0,width:p,height:s.globals.gridHeight}:"y"===e?{x:0,y:c?r-x:r,width:s.globals.gridWidth,height:x}:{x:h?o-p:o,y:c?r-x:r,width:p,height:x},b=n(l({},b),{translateX:s.globals.translateX,translateY:s.globals.translateY}),i.drawSelectionRect(b),i.selectionDragging("resizing"),b}selectionDragging(t,e){const s=this.w;if(!e)return;e.preventDefault();const{handler:i,box:a}=e.detail;let{x:o,y:r}=a;o<this.constraints.x&&(o=this.constraints.x),r<this.constraints.y&&(r=this.constraints.y),a.x2>this.constraints.x2&&(o=this.constraints.x2-a.w),a.y2>this.constraints.y2&&(r=this.constraints.y2-a.h),i.move(o,r);const l=this.xyRatios,n=this.selectionRect;let h=0;"resizing"===t&&(h=30);const c=t=>parseFloat(n.node.getAttribute(t)),d={x:c("x"),y:c("y"),width:c("width"),height:c("height")};s.globals.selection=d,"function"==typeof s.config.chart.events.selection&&s.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout(()=>{const t=this.gridRect.getBoundingClientRect(),e=n.node.getBoundingClientRect();let i,a,o,r;s.globals.isRangeBar?(i=s.globals.yAxisScale[0].niceMin+(e.left-t.left)*l.invertedYRatio,a=s.globals.yAxisScale[0].niceMin+(e.right-t.left)*l.invertedYRatio,o=0,r=1):(i=s.globals.xAxisScale.niceMin+(e.left-t.left)*l.xRatio,a=s.globals.xAxisScale.niceMin+(e.right-t.left)*l.xRatio,o=s.globals.yAxisScale[0].niceMin+(t.bottom-e.bottom)*l.yRatio[0],r=s.globals.yAxisScale[0].niceMax-(e.top-t.top)*l.yRatio[0]);const h={xaxis:{min:i,max:a},yaxis:{min:o,max:r}};s.config.chart.events.selection(this.ctx,h),s.config.chart.brush.enabled&&void 0!==s.config.chart.events.brushScrolled&&s.config.chart.events.brushScrolled(this.ctx,h)},h))}selectionDrawn({context:t,zoomtype:e}){const s=this.w,i=t,a=this.xyRatios,o=this.ctx.toolbar,r=s.globals.zoomEnabled?i.zoomRect.node.getBoundingClientRect():i.selectionRect.node.getBoundingClientRect(),l=i.gridRect.getBoundingClientRect(),n=r.left-l.left-s.globals.barPadForNumericAxis,h=r.right-l.left-s.globals.barPadForNumericAxis,c=r.top-l.top,d=r.bottom-l.top;let g,p;s.globals.isRangeBar?(g=s.globals.yAxisScale[0].niceMin+n*a.invertedYRatio,p=s.globals.yAxisScale[0].niceMin+h*a.invertedYRatio):(g=s.globals.xAxisScale.niceMin+n*a.xRatio,p=s.globals.xAxisScale.niceMin+h*a.xRatio);let x=[],b=[];if(s.config.yaxis.forEach((t,e)=>{let i=s.globals.seriesYAxisMap[e][0],o=s.globals.yAxisScale[e].niceMax-a.yRatio[i]*c,r=s.globals.yAxisScale[e].niceMax-a.yRatio[i]*d;x.push(o),b.push(r)}),i.dragged&&(i.dragX>10||i.dragY>10)&&g!==p)if(s.globals.zoomEnabled){let t=u.clone(s.globals.initialConfig.yaxis),a=u.clone(s.globals.initialConfig.xaxis);if(s.globals.zoomed=!0,s.config.xaxis.convertedCatToNumeric&&(g=Math.floor(g),p=Math.floor(p),g<1&&(g=1,p=s.globals.dataPoints),p-g<2&&(p=g+1)),"xy"!==e&&"x"!==e||(a={min:g,max:p}),"xy"!==e&&"y"!==e||t.forEach((e,s)=>{t[s].min=b[s],t[s].max=x[s]}),o){let e=o.getBeforeZoomRange(a,t);e&&(a=e.xaxis?e.xaxis:a,t=e.yaxis?e.yaxis:t)}let r={xaxis:a};s.config.chart.group||(r.yaxis=t),i.ctx.updateHelpers._updateOptions(r,!1,i.w.config.chart.animations.dynamicAnimation.enabled),"function"==typeof s.config.chart.events.zoomed&&o.zoomCallback(a,t)}else if(s.globals.selectionEnabled){let t=null,a=null;a={min:g,max:p},"xy"!==e&&"y"!==e||(t=u.clone(s.config.yaxis),t.forEach((e,s)=>{t[s].min=b[s],t[s].max=x[s]})),s.globals.selection=i.selection,"function"==typeof s.config.chart.events.selection&&s.config.chart.events.selection(i.ctx,{xaxis:a,yaxis:t})}}panDragging({context:t}){const e=this.w;let s=t;if(void 0!==e.globals.lastClientPosition.x){const t=e.globals.lastClientPosition.x-s.clientX,i=e.globals.lastClientPosition.y-s.clientY;Math.abs(t)>Math.abs(i)&&t>0?this.moveDirection="left":Math.abs(t)>Math.abs(i)&&t<0?this.moveDirection="right":Math.abs(i)>Math.abs(t)&&i>0?this.moveDirection="up":Math.abs(i)>Math.abs(t)&&i<0&&(this.moveDirection="down")}e.globals.lastClientPosition={x:s.clientX,y:s.clientY};let i=e.globals.isRangeBar?e.globals.minY:e.globals.minX,a=e.globals.isRangeBar?e.globals.maxY:e.globals.maxX;s.panScrolled(i,a)}panScrolled(t,e){const s=this.w,i=this.xyRatios;let a=u.clone(s.globals.initialConfig.yaxis),o=i.xRatio,r=s.globals.minX,l=s.globals.maxX;s.globals.isRangeBar&&(o=i.invertedYRatio,r=s.globals.minY,l=s.globals.maxY),"left"===this.moveDirection?(t=r+s.globals.gridWidth/15*o,e=l+s.globals.gridWidth/15*o):"right"===this.moveDirection&&(t=r-s.globals.gridWidth/15*o,e=l-s.globals.gridWidth/15*o),s.globals.isRangeBar||(t<s.globals.initialMinX||e>s.globals.initialMaxX)&&(t=r,e=l);let n={xaxis:{min:t,max:e}};s.config.chart.group||(n.yaxis=a),this.updateScrolledChart(n,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)}}}class Bt{constructor(t){this.w=t.w,this.ttCtx=t,this.ctx=t.ctx}getNearestValues({hoverArea:t,elGrid:e,clientX:s,clientY:i}){let a=this.w;const o=e.getBoundingClientRect(),r=o.width,l=o.height;let n=r/(a.globals.dataPoints-1),h=l/a.globals.dataPoints;const c=this.hasBars();!a.globals.comboCharts&&!c||a.config.xaxis.convertedCatToNumeric||(n=r/a.globals.dataPoints);let d=s-o.left-a.globals.barPadForNumericAxis,g=i-o.top;d<0||g<0||d>r||g>l?(t.classList.remove("hovering-zoom"),t.classList.remove("hovering-pan")):a.globals.zoomEnabled?(t.classList.remove("hovering-pan"),t.classList.add("hovering-zoom")):a.globals.panEnabled&&(t.classList.remove("hovering-zoom"),t.classList.add("hovering-pan"));let p=Math.round(d/n),x=Math.floor(g/h);c&&!a.config.xaxis.convertedCatToNumeric&&(p=Math.ceil(d/n),p-=1);let b=null,f=null,m=a.globals.seriesXvalues.map(t=>t.filter(t=>u.isNumber(t))),y=a.globals.seriesYvalues.map(t=>t.filter(t=>u.isNumber(t)));if(a.globals.isXNumeric){const t=this.ttCtx.getElGrid().getBoundingClientRect(),e=d*(t.width/r),s=g*(t.height/l);f=this.closestInMultiArray(e,s,m,y),b=f.index,p=f.j,null!==b&&a.globals.hasNullValues&&(m=a.globals.seriesXvalues[b],f=this.closestInArray(e,m),p=f.j)}return a.globals.capturedSeriesIndex=null===b?-1:b,(!p||p<1)&&(p=0),a.globals.isBarHorizontal?a.globals.capturedDataPointIndex=x:a.globals.capturedDataPointIndex=p,{capturedSeries:b,j:a.globals.isBarHorizontal?x:p,hoverX:d,hoverY:g}}getFirstActiveXArray(t){const e=this.w;let s=0,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,o=t=>-1===a.globals.collapsedSeriesIndices.indexOf(t)&&-1===a.globals.ancillaryCollapsedSeriesIndices.indexOf(t);let r=1/0,l=null,n=null;for(let h=0;h<s.length;h++){if(!o(h))continue;const c=s[h],d=i[h],g=Math.min(c.length,d.length);for(let s=0;s<g;s++){const i=t-c[s];let o=Math.sqrt(i*i);if(!a.globals.allSeriesHasEqualX){const t=e-d[s];o=Math.sqrt(i*i+t*t)}o<r&&(r=o,l=h,n=s)}}return{index:l,j:n}}closestInArray(t,e){let s=e[0],i=null,a=Math.abs(t-s);for(let s=0;s<e.length;s++){let o=Math.abs(t-e[s]);o<a&&(a=o,i=s)}return{j:i}}isXoverlap(t){let e=[];const s=this.w.globals.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;let e=!0;const s=(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<s.length-1;t++)if(s[t].data.length!==s[t+1].data.length){e=!1;break}return e}getBarsHeight(t){return[...t].reduce((t,e)=>t+e.getBBox().height,0)}getElMarkers(t){return"number"==typeof t?this.w.globals.dom.baseEl.querySelectorAll(`.apexcharts-series[data\\:realIndex='${t}'] .apexcharts-series-markers-wrap > *`):this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *")}getAllMarkers(t=!1){let e=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap");e=[...e],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});let s=[];return e.forEach(t=>{s.push(t.querySelector(".apexcharts-marker"))}),s}hasMarkers(t){return this.getElMarkers(t).length>0}getPathFromPoint(t,e){let s=Number(t.getAttribute("cx")),i=Number(t.getAttribute("cy")),a=t.getAttribute("shape");return new w(this.ctx).getMarkerPath(s,i,a,e)}getElBars(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-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){let e=this.w;const s=this.ttCtx;0===s.allTooltipSeriesGroups.length&&(s.allTooltipSeriesGroups=e.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group"));let 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 Gt{constructor(t){this.w=t.w,this.ctx=t.ctx,this.ttCtx=t,this.tooltipUtil=new Bt(t)}drawSeriesTexts({shared:t=!0,ttItems:e,i:s=0,j:i=null,y1:a,y2:o,e:r}){let l=this.w;void 0!==l.config.tooltip.custom?this.handleCustomTooltip({i:s,j:i,y1:a,y2:o,w:l}):this.toggleActiveInactiveSeries(t,s);let n=this.getValuesToPrint({i:s,j:i});this.printLabels({i:s,j:i,values:n,ttItems:e,shared:t,e:r});const h=this.ttCtx.getElTooltip();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:o}){var r;const h=this.w;let c,d=[];const g=t=>h.globals.seriesGoals[t]&&h.globals.seriesGoals[t][e]&&Array.isArray(h.globals.seriesGoals[t][e]),{xVal:p,zVal:x,xAxisTTVal:b}=s;let f="",u=h.globals.colors[t];null!==e&&h.config.plotOptions.bar.distributed&&(u=h.globals.colors[e]);for(let s=0,m=h.globals.series.length-1;s<h.globals.series.length;s++,m--){let y=this.getFormatters(t);f=this.getSeriesName({fn:y.yLbTitleFormatter,index:t,seriesIndex:t,j:e}),"treemap"===h.config.chart.type&&(f=y.yLbTitleFormatter(String(h.config.series[t].data[e].x),{series:h.globals.series,seriesIndex:t,dataPointIndex:e,w:h}));const w=h.config.tooltip.inverseOrder?m:s;if(h.globals.axisCharts){const s=t=>{var s,i,a,o;return h.globals.isRangeData?y.yLbFormatter(null==(i=null==(s=h.globals.seriesRangeStart)?void 0:s[t])?void 0:i[e],{series:h.globals.seriesRangeStart,seriesIndex:t,dataPointIndex:e,w:h})+" - "+y.yLbFormatter(null==(o=null==(a=h.globals.seriesRangeEnd)?void 0:a[t])?void 0:o[e],{series:h.globals.seriesRangeEnd,seriesIndex:t,dataPointIndex:e,w:h}):y.yLbFormatter(h.globals.series[t][e],{series:h.globals.series,seriesIndex:t,dataPointIndex:e,w:h})};if(a)y=this.getFormatters(w),f=this.getSeriesName({fn:y.yLbTitleFormatter,index:w,seriesIndex:t,j:e}),u=h.globals.colors[w],c=s(w),g(w)&&(d=h.globals.seriesGoals[w][e].map(t=>({attrs:t,val:y.yLbFormatter(t.value,{seriesIndex:w,dataPointIndex:e,w:h})})));else{const i=null==(r=null==o?void 0:o.target)?void 0:r.getAttribute("fill");i&&(-1!==i.indexOf("url")?-1!==i.indexOf("Pattern")&&(u=h.globals.dom.baseEl.querySelector(i.substr(4).slice(0,-1)).childNodes[0].getAttribute("stroke")):u=i),c=s(t),g(t)&&Array.isArray(h.globals.seriesGoals[t][e])&&(d=h.globals.seriesGoals[t][e].map(s=>({attrs:s,val:y.yLbFormatter(s.value,{seriesIndex:t,dataPointIndex:e,w:h})})))}}null===e&&(c=y.yLbFormatter(h.globals.series[t],n(l({},h),{seriesIndex:t,dataPointIndex:t}))),this.DOMHandling({i:t,t:w,j:e,ttItems:i,values:{val:c,goalVals:d,xVal:p,xAxisTTVal:b,zVal:x},seriesName:f,shared:a,pColor:u})}}getFormatters(t){const e=this.w;let s,i=e.globals.yLabelFormatters[t];return void 0!==e.globals.ttVal?Array.isArray(e.globals.ttVal)?(i=e.globals.ttVal[t]&&e.globals.ttVal[t].formatter,s=e.globals.ttVal[t]&&e.globals.ttVal[t].title&&e.globals.ttVal[t].title.formatter):(i=e.globals.ttVal.formatter,"function"==typeof e.globals.ttVal.title.formatter&&(s=e.globals.ttVal.title.formatter)):s=e.config.tooltip.y.title.formatter,"function"!=typeof i&&(i=e.globals.yLabelFormatters[0]?e.globals.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.globals.seriesNames[e]),{series:a.globals.series,seriesIndex:s,dataPointIndex:i,w:a})}DOMHandling({t:t,j:e,ttItems:s,values:i,seriesName:a,shared:o,pColor:r}){const l=this.w,n=this.ttCtx,{val:h,goalVals:c,xVal:d,xAxisTTVal:g,zVal:p}=i;let x=null;x=s[t].children,l.config.tooltip.fillSeriesColor&&(s[t].style.backgroundColor=r,x[0].style.display="none"),n.showTooltipTitle&&(null===n.tooltipTitle&&(n.tooltipTitle=l.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")),n.tooltipTitle.innerHTML=d),n.isXAxisTooltipEnabled&&(n.xaxisTooltipText.innerHTML=""!==g?g:d);const b=s[t].querySelector(".apexcharts-tooltip-text-y-label");b&&(b.innerHTML=a||"");const f=s[t].querySelector(".apexcharts-tooltip-text-y-value");f&&(f.innerHTML=void 0!==h?h:""),x[0]&&x[0].classList.contains("apexcharts-tooltip-marker")&&(l.config.tooltip.marker.fillColors&&Array.isArray(l.config.tooltip.marker.fillColors)&&(r=l.config.tooltip.marker.fillColors[t]),l.config.tooltip.fillSeriesColor?x[0].style.backgroundColor=r:x[0].style.color=r),l.config.tooltip.marker.show||(x[0].style.display="none");const u=s[t].querySelector(".apexcharts-tooltip-text-goals-label"),m=s[t].querySelector(".apexcharts-tooltip-text-goals-value");if(c.length&&l.globals.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>`}),u.innerHTML=t+"</div>",m.innerHTML=e+"</div>"};o?l.globals.seriesGoals[t][e]&&Array.isArray(l.globals.seriesGoals[t][e])?s():(u.innerHTML="",m.innerHTML=""):s()}else u.innerHTML="",m.innerHTML="";if(null!==p){s[t].querySelector(".apexcharts-tooltip-text-z-label").innerHTML=l.config.tooltip.z.title;s[t].querySelector(".apexcharts-tooltip-text-z-value").innerHTML=void 0!==p?p:""}if(o&&x[0]){if(l.config.tooltip.hideEmptySeries){let 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||l.globals.ancillaryCollapsedSeriesIndices.indexOf(t)>-1||l.globals.collapsedSeriesIndices.indexOf(t)>-1||Array.isArray(n.tConfig.enabledOnSeries)&&-1===n.tConfig.enabledOnSeries.indexOf(t)?x[0].parentNode.style.display="none":x[0].parentNode.style.display=l.config.tooltip.items.display}else Array.isArray(n.tConfig.enabledOnSeries)&&-1===n.tConfig.enabledOnSeries.indexOf(t)&&(x[0].parentNode.style.display="none")}toggleActiveInactiveSeries(t,e){const s=this.w;if(t)this.tooltipUtil.toggleAllTooltipSeriesGroups("enable");else{this.tooltipUtil.toggleAllTooltipSeriesGroups("disable");let t=s.globals.dom.baseEl.querySelector(`.apexcharts-tooltip-series-group-${e}`);t&&(t.classList.add("apexcharts-active"),t.style.display=s.config.tooltip.items.display)}}getValuesToPrint({i:t,j:e}){const s=this.w,i=this.ctx.series.filteredSeriesX();let a="",o="",r=null,l=null;const n={series:s.globals.series,seriesIndex:t,dataPointIndex:e,w:s};let h=s.globals.ttZFormatter;if(null===e)l=s.globals.series[t];else if(s.globals.isXNumeric&&"treemap"!==s.config.chart.type){if(a=i[t][e],0===i[t].length){a=i[this.tooltipUtil.getFirstActiveXArray(i)][e]}}else{a=new $(this.ctx).isFormatXY()?void 0!==s.config.series[t].data[e]?s.config.series[t].data[e].x:"":void 0!==s.globals.labels[e]?s.globals.labels[e]:""}let c=a;if(s.globals.isXNumeric&&"datetime"===s.config.xaxis.type){a=new k(this.ctx).xLabelFormat(s.globals.ttKeyFormatter,c,c,{i:void 0,dateFormatter:new S(this.ctx).formatDate,w:this.w})}else a=s.globals.isBarHorizontal?s.globals.yLabelFormatters[0](c,n):s.globals.xLabelFormatter(c,n);return void 0!==s.config.tooltip.x.formatter&&(a=s.globals.ttKeyFormatter(c,n)),s.globals.seriesZ.length>0&&s.globals.seriesZ[t].length>0&&(r=h(s.globals.seriesZ[t][e],s)),o="function"==typeof s.config.xaxis.tooltip.formatter?s.globals.xaxisTooltipFormatter(c,n):a,{val:Array.isArray(l)?l.join(" "):l,xVal:Array.isArray(a)?a.join(" "):a,xAxisTTVal:Array.isArray(o)?o.join(" "):o,zVal:r}}handleCustomTooltip({i:t,j:e,y1:s,y2:i,w:a}){const o=this.ttCtx.getElTooltip();let r=a.config.tooltip.custom;Array.isArray(r)&&r[t]&&(r=r[t]);const l=r({ctx:this.ctx,series:a.globals.series,seriesIndex:t,dataPointIndex:e,y1:s,y2:i,w:a});"string"==typeof l||"number"==typeof l?o.innerHTML=l:(l instanceof Element||"string"==typeof l.nodeName)&&(o.innerHTML="",o.appendChild(l.cloneNode(!0)))}}class $t{constructor(t){this.ttCtx=t,this.ctx=t.ctx,this.w=t.w}moveXCrosshairs(t,e=null){const s=this.ttCtx;let i=this.w;const a=s.getElXCrosshairs();let o=t-s.xcrosshairsWidth/2,r=i.globals.labels.slice().length;if(null!==e&&(o=i.globals.gridWidth/r*e),null===a||i.globals.isBarHorizontal||(a.setAttribute("x",o),a.setAttribute("x1",o),a.setAttribute("x2",o),a.setAttribute("y2",i.globals.gridHeight),a.classList.add("apexcharts-active")),o<0&&(o=0),o>i.globals.gridWidth&&(o=i.globals.gridWidth),s.isXAxisTooltipEnabled){let t=o;"tickWidth"!==i.config.xaxis.crosshairs.width&&"barWidth"!==i.config.xaxis.crosshairs.width||(t=o+s.xcrosshairsWidth/2),this.moveXAxisTooltip(t)}}moveYCrosshairs(t){const e=this.ttCtx;null!==e.ycrosshairs&&w.setAttrs(e.ycrosshairs,{y1:t,y2:t}),null!==e.ycrosshairsHidden&&w.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t})}moveXAxisTooltip(t){let e=this.w;const s=this.ttCtx;if(null!==s.xaxisTooltip&&0!==s.xcrosshairsWidth){s.xaxisTooltip.classList.add("apexcharts-active");let i=s.xaxisOffY+e.config.xaxis.tooltip.offsetY+e.globals.translateY+1+e.config.xaxis.offsetY;if(t-=s.xaxisTooltip.getBoundingClientRect().width/2,!isNaN(t)){t+=e.globals.translateX;let a=0;a=new w(this.ctx).getTextRects(s.xaxisTooltipText.innerHTML),s.xaxisTooltipText.style.minWidth=a.width+"px",s.xaxisTooltip.style.left=t+"px",s.xaxisTooltip.style.top=i+"px"}}}moveYAxisTooltip(t){const e=this.w,s=this.ttCtx;null===s.yaxisTTEls&&(s.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));const i=parseInt(s.ycrosshairsHidden.getAttribute("y1"),10);let a=e.globals.translateY+i;const o=s.yaxisTTEls[t].getBoundingClientRect(),r=o.height;let l=e.globals.translateYAxisX[t]-2;e.config.yaxis[t].opposite&&(l-=o.width),a-=r/2,-1===e.globals.ignoreYAxisIndexes.indexOf(t)&&a>0&&a<e.globals.gridHeight?(s.yaxisTTEls[t].classList.add("apexcharts-active"),s.yaxisTTEls[t].style.top=a+"px",s.yaxisTTEls[t].style.left=l+e.config.yaxis[t].tooltip.offsetX+"px"):s.yaxisTTEls[t].classList.remove("apexcharts-active")}moveTooltip(t,e,s=null){let i=this.w,a=this.ttCtx;const o=a.getElTooltip();let r=a.tooltipRect,l=null!==s?parseFloat(s):1,n=parseFloat(t)+l+5,h=parseFloat(e)+l/2;if(n>i.globals.gridWidth/2&&(n=n-r.ttWidth-l-10),n>i.globals.gridWidth-r.ttWidth-10&&(n=i.globals.gridWidth-r.ttWidth),n<-20&&(n=-20),i.config.tooltip.followCursor){const t=a.getElGrid().getBoundingClientRect();n=a.e.clientX-t.left,n>i.globals.gridWidth/2&&(n-=a.tooltipRect.ttWidth),h=a.e.clientY+i.globals.translateY-t.top,h>i.globals.gridHeight/2&&(h-=a.tooltipRect.ttHeight)}else i.globals.isBarHorizontal||r.ttHeight/2+h>i.globals.gridHeight&&(h=i.globals.gridHeight-r.ttHeight+i.globals.translateY);isNaN(n)||(n+=i.globals.translateX,o.style.left=n+"px",o.style.top=h+"px")}moveMarkers(t,e){let s=this.w,i=this.ttCtx;if(s.globals.markers.size[t]>0){let a=s.globals.dom.baseEl.querySelectorAll(` .apexcharts-series[data\\:realIndex='${t}'] .apexcharts-marker`);for(let t=0;t<a.length;t++)parseInt(a[t].getAttribute("rel"),10)===e&&(i.marker.resetPointsSize(),i.marker.enlargeCurrentPoint(e,a[t]))}else i.marker.resetPointsSize(),this.moveDynamicPointOnHover(e,t)}moveDynamicPointOnHover(t,e){var s,i;let a=this.w,o=this.ttCtx,r=0,l=0;const n=new w(this.ctx);let h=a.globals.pointsArray,c=o.tooltipUtil.getHoverMarkerSize(e);const d=a.config.series[e].type;if(d&&("column"===d||"candlestick"===d||"boxPlot"===d))return;r=null==(s=h[e][t])?void 0:s[0],l=(null==(i=h[e][t])?void 0:i[1])||0;let g=a.globals.dom.baseEl.querySelector(`.apexcharts-series[data\\:realIndex='${e}'] .apexcharts-series-markers path`);if(g&&l<a.globals.gridHeight&&l>0){const t=g.getAttribute("shape"),e=n.getMarkerPath(r,l,t,1.5*c);g.setAttribute("d",e)}this.moveXCrosshairs(r),o.fixedTooltip||this.moveTooltip(r,l,c)}moveDynamicPointsOnHover(t){const e=this.ttCtx;let s=e.w,i=0,a=0,o=0,r=s.globals.pointsArray,l=new G(this.ctx);const n=new w(this.ctx);o=l.getActiveConfigSeriesIndex("asc",["line","area","scatter","bubble"]);let h=e.tooltipUtil.getHoverMarkerSize(o);if(r[o]&&(i=r[o][t][0],a=r[o][t][1]),isNaN(i))return;let c=e.tooltipUtil.getAllMarkers();if(c.length)for(let e=0;e<s.globals.series.length;e++){let a=r[e];if(s.globals.comboCharts&&void 0===a&&c.splice(e,0,null),a&&a.length){let a,o=r[e][t][1];c[e].setAttribute("cx",i);const l=c[e].getAttribute("shape");if("rangeArea"===s.config.chart.type&&!s.globals.comboCharts){const i=t+s.globals.series[e].length;a=r[e][i][1];o-=Math.abs(o-a)/2}if(null!==o&&!isNaN(o)&&o<s.globals.gridHeight+h&&o+h>0){const t=n.getMarkerPath(i,o,l,h);c[e].setAttribute("d",t)}else c[e].setAttribute("d","")}}this.moveXCrosshairs(i),e.fixedTooltip||this.moveTooltip(i,a||s.globals.gridHeight,h)}moveStickyTooltipOverBars(t,e){const s=this.w,i=this.ttCtx;let a=s.globals.columnSeries?s.globals.columnSeries.length:s.globals.series.length;s.config.chart.stacked&&(a=s.globals.barGroups.length);let o=a>=2&&a%2==0?Math.floor(a/2):Math.floor(a/2)+1;if(s.globals.isBarHorizontal){o=new G(this.ctx).getActiveConfigSeriesIndex("desc")+1}let r=s.globals.dom.baseEl.querySelector(`.apexcharts-bar-series .apexcharts-series[rel='${o}'] path[j='${t}'], .apexcharts-candlestick-series .apexcharts-series[rel='${o}'] path[j='${t}'], .apexcharts-boxPlot-series .apexcharts-series[rel='${o}'] path[j='${t}'], .apexcharts-rangebar-series .apexcharts-series[rel='${o}'] path[j='${t}']`);r||"number"!=typeof e||(r=s.globals.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-rangebar-series .apexcharts-series[data\\:realIndex='${e}'] path[j='${t}']`));let l=r?parseFloat(r.getAttribute("cx")):0,n=r?parseFloat(r.getAttribute("cy")):0,h=r?parseFloat(r.getAttribute("barWidth")):0;let c=i.getElGrid().getBoundingClientRect();const d=r&&(r.classList.contains("apexcharts-candlestick-area")||r.classList.contains("apexcharts-boxPlot-area"));s.globals.isXNumeric?(r&&!d&&(l-=a%2!=0?h/2:0),r&&d&&(l-=h/2)):s.globals.isBarHorizontal||(l=i.xAxisTicksPositions[t-1]+i.dataPointsDividedWidth/2,isNaN(l)&&(l=i.xAxisTicksPositions[t]-i.dataPointsDividedWidth/2)),s.globals.isBarHorizontal?n-=i.tooltipRect.ttHeight:s.config.tooltip.followCursor?n=i.e.clientY-c.top-i.tooltipRect.ttHeight/2:n+i.tooltipRect.ttHeight+15>s.globals.gridHeight&&(n=s.globals.gridHeight),s.globals.isBarHorizontal||this.moveXCrosshairs(l),i.fixedTooltip||this.moveTooltip(l,n||s.globals.gridHeight)}}class _t{constructor(t){this.w=t.w,this.ttCtx=t,this.ctx=t.ctx,this.tooltipPosition=new $t(t)}drawDynamicPoints(){let t=this.w,e=new w(this.ctx),s=new O(this.ctx),i=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series");i=[...i],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++){let o=i[a].querySelector(".apexcharts-series-markers-wrap");if(null!==o){let i,a=`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||(a+=" no-pointer-events");let r=s.getMarkerConfig({cssClass:a,seriesIndex:Number(o.getAttribute("data:realIndex"))});i=e.drawMarker(0,0,r),i.node.setAttribute("default-marker-size",0);let l=document.createElementNS(t.globals.SVGNS,"g");l.classList.add("apexcharts-series-markers"),l.appendChild(i.node),o.appendChild(l)}}}enlargeCurrentPoint(t,e,s=null,i=null){let a=this.w;"bubble"!==a.config.chart.type&&this.newPointSize(t,e);let o=e.getAttribute("cx"),r=e.getAttribute("cy");if(null!==s&&null!==i&&(o=s,r=i),this.tooltipPosition.moveXCrosshairs(o),!this.fixedTooltip){if("radar"===a.config.chart.type){const t=this.ttCtx.getElGrid().getBoundingClientRect();o=this.ttCtx.e.clientX-t.left}this.tooltipPosition.moveTooltip(o,r,a.config.markers.hover.size)}}enlargePoints(t){let e=this.w,s=this;const i=this.ttCtx;let a=t,o=e.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"),r=e.config.markers.hover.size;for(let t=0;t<o.length;t++){let l=o[t].getAttribute("rel"),n=o[t].getAttribute("index");if(void 0===r&&(r=e.globals.markers.size[n]+e.config.markers.hover.sizeOffset),a===parseInt(l,10)){s.newPointSize(a,o[t]);let e=o[t].getAttribute("cx"),l=o[t].getAttribute("cy");s.tooltipPosition.moveXCrosshairs(e),i.fixedTooltip||s.tooltipPosition.moveTooltip(e,l,r)}else s.oldPointSize(o[t])}}newPointSize(t,e){let s=this.w,i=s.config.markers.hover.size,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 o=this.ttCtx.tooltipUtil.getPathFromPoint(e,i);e.setAttribute("d",o)}}oldPointSize(t){const e=parseFloat(t.getAttribute("default-marker-size")),s=this.ttCtx.tooltipUtil.getPathFromPoint(t,e);t.setAttribute("d",s)}resetPointsSize(){let t=this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker");for(let e=0;e<t.length;e++){const s=parseFloat(t[e].getAttribute("default-marker-size"));if(u.isNumber(s)&&s>0){const i=this.ttCtx.tooltipUtil.getPathFromPoint(t[e],s);t[e].setAttribute("d",i)}else t[e].setAttribute("d","M0,0")}}}class Vt{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){return parseFloat(t.target.getAttribute(e))}handleHeatTreeTooltip({e:t,opt:e,x:s,y:i,type:a}){const o=this.ttCtx,r=this.w;if(t.target.classList.contains(`apexcharts-${a}-rect`)){let a=this.getAttr(t,"i"),l=this.getAttr(t,"j"),n=this.getAttr(t,"cx"),h=this.getAttr(t,"cy"),c=this.getAttr(t,"width"),d=this.getAttr(t,"height");if(o.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:a,j:l,shared:!1,e:t}),r.globals.capturedSeriesIndex=a,r.globals.capturedDataPointIndex=l,s=n+o.tooltipRect.ttWidth/2+c,i=h+o.tooltipRect.ttHeight/2-d/2,o.tooltipPosition.moveXCrosshairs(n+c/2),s>r.globals.gridWidth/2&&(s=n-o.tooltipRect.ttWidth/2+c),o.w.config.tooltip.followCursor){let t=r.globals.dom.elWrap.getBoundingClientRect();s=r.globals.clientX-t.left-(s>r.globals.gridWidth/2?o.tooltipRect.ttWidth:0),i=r.globals.clientY-t.top-(i>r.globals.gridHeight/2?o.tooltipRect.ttHeight:0)}}return{x:s,y:i}}handleMarkerTooltip({e:t,opt:e,x:s,y:i}){let a=this.w;const o=this.ttCtx;let r,l;if(t.target.classList.contains("apexcharts-marker")){let n=parseInt(e.paths.getAttribute("cx"),10),h=parseInt(e.paths.getAttribute("cy"),10),c=parseFloat(e.paths.getAttribute("val"));if(l=parseInt(e.paths.getAttribute("rel"),10),r=parseInt(e.paths.parentNode.parentNode.parentNode.getAttribute("rel"),10)-1,o.intersect){const t=u.findAncestor(e.paths,"apexcharts-series");t&&(r=parseInt(t.getAttribute("data:realIndex"),10))}if(o.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:r,j:l,shared:!o.showOnIntersect&&a.config.tooltip.shared,e:t}),"mouseup"===t.type&&o.markerClick(t,r,l),a.globals.capturedSeriesIndex=r,a.globals.capturedDataPointIndex=l,s=n,i=h+a.globals.translateY-1.4*o.tooltipRect.ttHeight,o.w.config.tooltip.followCursor){const t=o.getElGrid().getBoundingClientRect();i=o.e.clientY+a.globals.translateY-t.top}c<0&&(i=h),o.marker.enlargeCurrentPoint(l,e.paths,s,i)}return{x:s,y:i}}handleBarTooltip({e:t,opt:e}){const s=this.w,i=this.ttCtx,a=i.getElTooltip();let o,r=0,l=0,n=0,h=0,c=this.getBarTooltipXY({e:t,opt:e});if(null===c.j&&0===c.barHeight&&0===c.barWidth)return;h=c.i;let d=c.j;if(s.globals.capturedSeriesIndex=h,s.globals.capturedDataPointIndex=d,s.globals.isBarHorizontal&&i.tooltipUtil.hasBars()||!s.config.tooltip.shared?(l=c.x,n=c.y,o=Array.isArray(s.config.stroke.width)?s.config.stroke.width[h]:s.config.stroke.width,r=l):s.globals.comboCharts||s.config.tooltip.shared||(r/=2),isNaN(n)&&(n=s.globals.svgHeight-i.tooltipRect.ttHeight),l+i.tooltipRect.ttWidth>s.globals.gridWidth?l-=i.tooltipRect.ttWidth:l<0&&(l=0),i.w.config.tooltip.followCursor){const t=i.getElGrid().getBoundingClientRect();n=i.e.clientY-t.top}null===i.tooltip&&(i.tooltip=s.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),s.config.tooltip.shared||(s.globals.comboBarCount>0?i.tooltipPosition.moveXCrosshairs(r+o/2):i.tooltipPosition.moveXCrosshairs(r)),!i.fixedTooltip&&(!s.config.tooltip.shared||s.globals.isBarHorizontal&&i.tooltipUtil.hasBars())&&(n=n+s.globals.translateY-i.tooltipRect.ttHeight/2,a.style.left=l+s.globals.translateX+"px",a.style.top=n+"px")}getBarTooltipXY({e:t,opt:e}){let s=this.w,i=null;const a=this.ttCtx;let o=0,r=0,l=0,n=0,h=0;const c=t.target.classList;if(c.contains("apexcharts-bar-area")||c.contains("apexcharts-candlestick-area")||c.contains("apexcharts-boxPlot-area")||c.contains("apexcharts-rangebar-area")){let c=t.target,d=c.getBoundingClientRect(),g=e.elGrid.getBoundingClientRect(),p=d.height;h=d.height;let x=d.width,b=parseInt(c.getAttribute("cx"),10),f=parseInt(c.getAttribute("cy"),10);n=parseFloat(c.getAttribute("barWidth"));const u="touchmove"===t.type?t.touches[0].clientX:t.clientX;i=parseInt(c.getAttribute("j"),10),o=parseInt(c.parentNode.getAttribute("rel"),10)-1;let m=c.getAttribute("data-range-y1"),y=c.getAttribute("data-range-y2");s.globals.comboCharts&&(o=parseInt(c.parentNode.getAttribute("data:realIndex"),10));const w=t=>s.globals.isXNumeric?b-x/2:this.isVerticalGroupedRangeBar?b+x/2:b-a.dataPointsDividedWidth+x/2,v=()=>f-a.dataPointsDividedHeight+p/2-a.tooltipRect.ttHeight/2;a.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:o,j:i,y1:m?parseInt(m,10):null,y2:y?parseInt(y,10):null,shared:!a.showOnIntersect&&s.config.tooltip.shared,e:t}),s.config.tooltip.followCursor?s.globals.isBarHorizontal?(r=u-g.left+15,l=v()):(r=w(r),l=t.clientY-g.top-a.tooltipRect.ttHeight/2-15):s.globals.isBarHorizontal?(r=b,r<a.xyRatios.baseLineInvertedY&&(r=b-a.tooltipRect.ttWidth),l=v()):(r=w(r),l=f)}return{x:r,y:l,barHeight:h,barWidth:n,i:o,j:i}}}class jt{constructor(t){this.w=t.w,this.ttCtx=t}drawXaxisTooltip(){let t=this.w;const e=this.ttCtx,s="bottom"===t.config.xaxis.position;e.xaxisOffY=s?t.globals.gridHeight+1:-t.globals.xAxisHeight-t.config.xaxis.axisTicks.height+3;const i=s?"apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom":"apexcharts-xaxistooltip apexcharts-xaxistooltip-top";let a=t.globals.dom.elWrap;if(e.isXAxisTooltipEnabled){null===t.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip")&&(e.xaxisTooltip=document.createElement("div"),e.xaxisTooltip.setAttribute("class",i+" apexcharts-theme-"+t.config.tooltip.theme),a.appendChild(e.xaxisTooltip),e.xaxisTooltipText=document.createElement("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(){let t=this.w;const 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.globals.gridWidth+1:1;let a=i?`apexcharts-yaxistooltip apexcharts-yaxistooltip-${s} apexcharts-yaxistooltip-right`:`apexcharts-yaxistooltip apexcharts-yaxistooltip-${s} apexcharts-yaxistooltip-left`,o=t.globals.dom.elWrap;null===t.globals.dom.baseEl.querySelector(`.apexcharts-yaxistooltip apexcharts-yaxistooltip-${s}`)&&(e.yaxisTooltip=document.createElement("div"),e.yaxisTooltip.setAttribute("class",a+" apexcharts-theme-"+t.config.tooltip.theme),o.appendChild(e.yaxisTooltip),0===s&&(e.yaxisTooltipText=[]),e.yaxisTooltipText[s]=document.createElement("div"),e.yaxisTooltipText[s].classList.add("apexcharts-yaxistooltip-text"),e.yaxisTooltip.appendChild(e.yaxisTooltipText[s]))}}setXCrosshairWidth(){let t=this.w;const e=this.ttCtx,s=e.getElXCrosshairs();if(e.xcrosshairsWidth=parseInt(t.config.xaxis.crosshairs.width,10),t.globals.comboCharts){let s=t.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==s&&"barWidth"===t.config.xaxis.crosshairs.width){let t=parseFloat(s.getAttribute("barWidth"));e.xcrosshairsWidth=t}else if("tickWidth"===t.config.xaxis.crosshairs.width){let s=t.globals.labels.length;e.xcrosshairsWidth=t.globals.gridWidth/s}}else if("tickWidth"===t.config.xaxis.crosshairs.width){let s=t.globals.labels.length;e.xcrosshairsWidth=t.globals.gridWidth/s}else if("barWidth"===t.config.xaxis.crosshairs.width){let s=t.globals.dom.baseEl.querySelector(".apexcharts-bar-area");if(null!==s){let t=parseFloat(s.getAttribute("barWidth"));e.xcrosshairsWidth=t}else e.xcrosshairsWidth=1}t.globals.isBarHorizontal&&(e.xcrosshairsWidth=0),null!==s&&e.xcrosshairsWidth>0&&s.setAttribute("width",e.xcrosshairsWidth)}handleYCrosshair(){let t=this.w;const e=this.ttCtx;e.ycrosshairs=t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"),e.ycrosshairsHidden=t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden")}drawYaxisTooltipText(t,e,s){const i=this.ttCtx,a=this.w,o=a.globals,r=o.seriesYAxisMap[t];if(i.yaxisTooltips[t]&&r.length>0){const l=o.yLabelFormatters[t],n=i.getElGrid().getBoundingClientRect(),h=r[0];let c=0;s.yRatio.length>1&&(c=h);const d=(e-n.top)*s.yRatio[c],g=o.maxYArr[h]-o.minYArr[h];let p=o.minYArr[h]+(g-d);a.config.yaxis[t].reversed&&(p=o.maxYArr[h]-(g-d)),i.tooltipPosition.moveYCrosshairs(e-n.top),i.yaxisTooltipText[t].innerHTML=l(p),i.tooltipPosition.moveYAxisTooltip(t)}}}class Ut{constructor(t){this.ctx=t,this.w=t.w;const e=this.w;this.tConfig=e.config.tooltip,this.tooltipUtil=new Bt(this),this.tooltipLabels=new Gt(this),this.tooltipPosition=new $t(this),this.marker=new _t(this),this.intersect=new Vt(this),this.axesTooltip=new jt(this),this.showOnIntersect=this.tConfig.intersect,this.showTooltipTitle=this.tConfig.x.show,this.fixedTooltip=this.tConfig.fixed.enabled,this.xaxisTooltip=null,this.yaxisTTEls=null,this.isBarShared=!e.globals.isBarHorizontal&&this.tConfig.shared,this.lastHoverTime=Date.now(),this.dimensionUpdateScheduled=!1}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.globals.dom.baseEl?t.w.globals.dom.baseEl.querySelector(".apexcharts-tooltip"):null}getElXCrosshairs(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs")}getElGrid(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid")}drawTooltip(t){let 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=document.createElement("div");if(s.classList.add("apexcharts-tooltip"),e.config.tooltip.cssClass&&s.classList.add(e.config.tooltip.cssClass),s.classList.add(`apexcharts-theme-${this.tConfig.theme||"light"}`),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&(s.setAttribute("role","tooltip"),s.setAttribute("aria-live","polite"),s.setAttribute("aria-atomic","true"),s.setAttribute("aria-hidden","true")),e.globals.dom.elWrap.appendChild(s),e.globals.axisCharts){this.axesTooltip.drawXaxisTooltip(),this.axesTooltip.drawYaxisTooltip(),this.axesTooltip.setXCrosshairWidth(),this.axesTooltip.handleYCrosshair();let t=new V(this.ctx);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(this),e.globals.collapsedSeries.length===e.globals.series.length)return;this.dataPointsDividedHeight=e.globals.gridHeight/e.globals.dataPoints,this.dataPointsDividedWidth=e.globals.gridWidth/e.globals.dataPoints,this.showTooltipTitle&&(this.tooltipTitle=document.createElement("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,s.appendChild(this.tooltipTitle));let i=e.globals.series.length;(e.globals.xyCharts||e.globals.comboCharts)&&this.tConfig.shared&&(i=this.showOnIntersect?1:e.globals.series.length),this.legendLabels=e.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"),this.ttItems=this.createTTElements(i),this.addSVGEvents(),this.setupDimensionCache()}createTTElements(t){const e=this.w;let s=[];const i=this.getElTooltip();for(let a=0;a<t;a++){let o=document.createElement("div");o.classList.add("apexcharts-tooltip-series-group",`apexcharts-tooltip-series-group-${a}`),o.style.order=e.config.tooltip.inverseOrder?t-a:a+1;let r=document.createElement("span");r.classList.add("apexcharts-tooltip-marker"),e.config.tooltip.fillSeriesColor?r.style.backgroundColor=e.globals.colors[a]:r.style.color=e.globals.colors[a];let l=e.config.markers.shape,n=l;Array.isArray(l)&&(n=l[a]),r.setAttribute("shape",n),o.appendChild(r);const h=document.createElement("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=document.createElement("div");e.classList.add(`apexcharts-tooltip-${t}-group`);let s=document.createElement("span");s.classList.add(`apexcharts-tooltip-text-${t}-label`),e.appendChild(s);let i=document.createElement("span");i.classList.add(`apexcharts-tooltip-text-${t}-value`),e.appendChild(i),h.appendChild(e)}),o.appendChild(h),i.appendChild(o),s.push(o)}return s}addSVGEvents(){const t=this.w;let e=t.config.chart.type;const s=this.getElTooltip(),i=!("bar"!==e&&"candlestick"!==e&&"boxPlot"!==e&&"rangeBar"!==e),a="area"===e||"line"===e||"scatter"===e||"bubble"===e||"radar"===e;let o=t.globals.dom.Paper.node;const r=this.getElGrid();r&&(this.seriesBound=r.getBoundingClientRect());let l,n=[],h=[],c={hoverArea:o,elGrid:r,tooltipEl:s,tooltipY:n,tooltipX:h,ttItems:this.ttItems};if(t.globals.axisCharts&&(a?l=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker"):i?l=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-bar-area, .apexcharts-series .apexcharts-candlestick-area, .apexcharts-series .apexcharts-boxPlot-area, .apexcharts-series .apexcharts-rangebar-area"):"heatmap"!==e&&"treemap"!==e||(l=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")),l&&l.length))for(let t=0;t<l.length;t++)n.push(l[t].getAttribute("cy")),h.push(l[t].getAttribute("cx"));if(t.globals.xyCharts&&!this.showOnIntersect||t.globals.comboCharts&&!this.showOnIntersect||i&&this.tooltipUtil.hasBars()&&this.tConfig.shared)this.addPathsEventListeners([o],c);else if(i&&!t.globals.comboCharts||a&&this.showOnIntersect)this.addDatapointEventsListeners(c);else if(!t.globals.axisCharts||"heatmap"===e||"treemap"===e){let e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-series");this.addPathsEventListeners(e,c)}if(this.showOnIntersect){let e=t.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker");e.length>0&&this.addPathsEventListeners(e,c),this.tooltipUtil.hasBars()&&!this.tConfig.shared&&this.addDatapointEventsListeners(c)}}drawFixedTooltipRect(){let t=this.w;const e=this.getElTooltip();let s=e.getBoundingClientRect(),i=s.width+10,a=s.height+10,o=this.tConfig.fixed.offsetX,r=this.tConfig.fixed.offsetY;const l=this.tConfig.fixed.position.toLowerCase();return l.indexOf("right")>-1&&(o=o+t.globals.svgWidth-i+10),l.indexOf("bottom")>-1&&(r=r+t.globals.svgHeight-a-10),e.style.left=o+"px",e.style.top=r+"px",{x:o,y:r,ttWidth:i,ttHeight:a}}addDatapointEventsListeners(t){let e=this.w.globals.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){let s=this;for(let i=0;i<t.length;i++){let 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;i.config.chart.group&&(s=this.ctx.getGroupedCharts()),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}){let a=t.w;if(!this.getElTooltip(t))return;const o=e.getCachedDimensions();if(e.tooltipRect={x:0,y:0,ttWidth:o.ttWidth,ttHeight:o.ttHeight},e.e=i,e.tooltipUtil.hasBars()&&!a.globals.comboCharts&&!e.isBarShared&&this.tConfig.onDatasetHover.highlightDataSeries){new G(t).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}){let s,i,a=this.w,o=e.elGrid.getBoundingClientRect();const r="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=r,a.globals.capturedSeriesIndex=-1,a.globals.capturedDataPointIndex=-1,l<o.top||l>o.top+o.height)return void this.handleMouseOut(e);if(Array.isArray(this.tConfig.enabledOnSeries)&&!a.config.tooltip.shared){const t=parseInt(e.paths.getAttribute("index"),10);if(this.tConfig.enabledOnSeries.indexOf(t)<0)return void this.handleMouseOut(e)}const n=this.getElTooltip(),h=this.getElXCrosshairs();let c=[];a.config.chart.group&&(c=this.ctx.getSyncedCharts());let d=a.globals.xyCharts||"bar"===a.config.chart.type&&!a.globals.isBarHorizontal&&this.tooltipUtil.hasBars()&&this.tConfig.shared||a.globals.comboCharts&&this.tooltipUtil.hasBars();if("mousemove"===t.type||"touchmove"===t.type||"mouseup"===t.type){if(a.globals.collapsedSeries.length+a.globals.ancillaryCollapsedSeries.length===a.globals.series.length)return;null!==h&&h.classList.add("apexcharts-active");const o=this.yaxisTooltips.filter(t=>!0===t);if(null!==this.ycrosshairs&&o.length&&this.ycrosshairs.classList.add("apexcharts-active"),d&&!this.showOnIntersect||c.length>1)this.handleStickyTooltip(t,r,l,e);else if("heatmap"===a.config.chart.type||"treemap"===a.config.chart.type){let o=this.intersect.handleHeatTreeTooltip({e:t,opt:e,x:s,y:i,type:a.config.chart.type});s=o.x,i=o.y,n.style.left=s+"px",n.style.top=i+"px"}else this.tooltipUtil.hasBars()&&this.intersect.handleBarTooltip({e:t,opt:e}),this.tooltipUtil.hasMarkers()&&this.intersect.handleMarkerTooltip({e:t,opt:e,x:s,y:i});if(this.yaxisTooltips.length)for(let t=0;t<a.config.yaxis.length;t++)this.axesTooltip.drawYaxisTooltipText(t,l,this.xyRatios);a.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),e.tooltipEl.classList.add("apexcharts-active"),a.config.chart.accessibility.enabled&&a.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}){let i=this.w,a=e.paths.getAttribute("rel");const o=this.getElTooltip();let r=i.globals.dom.elWrap.getBoundingClientRect();if("mousemove"===t.type||"touchmove"===t.type){i.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"),o.classList.add("apexcharts-active"),i.config.chart.accessibility.enabled&&i.config.chart.accessibility.announcements.enabled&&o.removeAttribute("aria-hidden"),this.tooltipLabels.drawSeriesTexts({ttItems:e.ttItems,i:parseInt(a,10)-1,shared:!1});let t=i.globals.clientX-r.left-s.ttWidth/2,l=i.globals.clientY-r.top-s.ttHeight-10;if(o.style.left=t+"px",o.style.top=l+"px",i.config.legend.tooltipHoverFormatter){const t=a-1;let e=(0,i.config.legend.tooltipHoverFormatter)(this.legendLabels[t].getAttribute("data:default-text"),{seriesIndex:t,dataPointIndex:t,w:i});this.legendLabels[t].innerHTML=e}}else"mouseout"!==t.type&&"touchend"!==t.type||(o.classList.remove("apexcharts-active"),i.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),i.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(e)}))}handleStickyTooltip(t,e,s,i){const a=this.w;let o=this.tooltipUtil.getNearestValues({context:this,hoverArea:i.hoverArea,elGrid:i.elGrid,clientX:e,clientY:s}),r=o.j,l=o.capturedSeries;a.globals.collapsedSeriesIndices.includes(l)&&(l=null);const n=i.elGrid.getBoundingClientRect();if(o.hoverX<0||o.hoverX>n.width)this.handleMouseOut(i);else if(null!==l)this.handleStickyCapturedSeries(t,l,i,r);else if(this.tooltipUtil.isXoverlap(r)||a.globals.isBarHorizontal){const e=a.globals.series.findIndex((t,e)=>!a.globals.collapsedSeriesIndices.includes(e));this.create(t,this,e,r,i.ttItems)}}handleStickyCapturedSeries(t,e,s,i){const a=this.w;if(!this.tConfig.shared){if(null===a.globals.series[e][i])return void this.handleMouseOut(s)}if(void 0!==a.globals.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.globals.series.findIndex((t,e)=>!a.globals.collapsedSeriesIndices.includes(e));this.create(t,this,e,i,s.ttItems)}}deactivateHoverFilter(){let t=this.w,e=new w(this.ctx),s=t.globals.dom.Paper.find(".apexcharts-bar-area");for(let t=0;t<s.length;t++)e.pathMouseLeave(s[t])}handleMouseOut(t){const e=this.w,s=this.getElXCrosshairs();if(e.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"),t.tooltipEl.classList.remove("apexcharts-active"),e.config.chart.accessibility.enabled&&e.config.chart.accessibility.announcements.enabled&&t.tooltipEl.setAttribute("aria-hidden","true"),this.deactivateHoverFilter(),"bubble"!==e.config.chart.type&&this.marker.resetPointsSize(),null!==s&&s.classList.remove("apexcharts-active"),null!==this.ycrosshairs&&this.ycrosshairs.classList.remove("apexcharts-active"),this.isXAxisTooltipEnabled&&this.xaxisTooltip.classList.remove("apexcharts-active"),this.yaxisTooltips.length){null===this.yaxisTTEls&&(this.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip"));for(let t=0;t<this.yaxisTTEls.length;t++)this.yaxisTTEls[t].classList.remove("apexcharts-active")}e.config.legend.tooltipHoverFormatter&&this.legendLabels.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(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}])}create(t,e,s,i,a,o=null){var r,h,c,d,g,p,x,b,f,u,m,y,v,A,C,S;let k=this.w,L=e;"mouseup"===t.type&&this.markerClick(t,s,i),null===o&&(o=this.tConfig.shared);const M=this.tooltipUtil.hasMarkers(s),P=this.tooltipUtil.getElBars(),I=()=>{k.globals.markers.largestSize>0?L.marker.enlargePoints(i):L.tooltipPosition.moveDynamicPointsOnHover(i)};if(k.config.legend.tooltipHoverFormatter){let t=k.config.legend.tooltipHoverFormatter,e=Array.from(this.legendLabels);e.forEach(t=>{const e=t.getAttribute("data:default-text");t.innerHTML=decodeURIComponent(e)});for(let a=0;a<e.length;a++){const r=e[a],l=parseInt(r.getAttribute("i"),10),n=decodeURIComponent(r.getAttribute("data:default-text"));let h=t(n,{seriesIndex:o?l:s,dataPointIndex:i,w:k});if(o)r.innerHTML=k.globals.collapsedSeriesIndices.indexOf(l)<0?h:n;else if(r.innerHTML=l===s?h:n,s===l)break}}const T=l(l({ttItems:a,i:s,j:i},void 0!==(null==(d=null==(c=null==(h=null==(r=k.globals.seriesRange)?void 0:r[s])?void 0:h[i])?void 0:c.y[0])?void 0:d.y1)&&{y1:null==(b=null==(x=null==(p=null==(g=k.globals.seriesRange)?void 0:g[s])?void 0:p[i])?void 0:x.y[0])?void 0:b.y1}),void 0!==(null==(y=null==(m=null==(u=null==(f=k.globals.seriesRange)?void 0:f[s])?void 0:u[i])?void 0:m.y[0])?void 0:y.y2)&&{y2:null==(S=null==(C=null==(A=null==(v=k.globals.seriesRange)?void 0:v[s])?void 0:A[i])?void 0:C.y[0])?void 0:S.y2});if(o){if(L.tooltipLabels.drawSeriesTexts(n(l({},T),{shared:!this.showOnIntersect&&this.tConfig.shared})),M)I();else if(this.tooltipUtil.hasBars()&&(this.barSeriesHeight=this.tooltipUtil.getBarsHeight(P),this.barSeriesHeight>0)){let t=new w(this.ctx),e=k.globals.dom.Paper.find(`.apexcharts-bar-area[j='${i}']`);this.deactivateHoverFilter(),L.tooltipUtil.getAllMarkers(!0).length&&!this.barSeriesHeight&&I(),L.tooltipPosition.moveStickyTooltipOverBars(i,s);for(let s=0;s<e.length;s++)t.pathMouseEnter(e[s])}}else L.tooltipLabels.drawSeriesTexts(l({shared:!1},T)),this.tooltipUtil.hasBars()&&L.tooltipPosition.moveStickyTooltipOverBars(i,s),M&&L.tooltipPosition.moveMarkers(s,i)}}const qt=86400,Zt=10/qt;class Jt{constructor(t){this.ctx=t,this.w=t.w,this.timeScaleArray=[],this.utc=this.w.config.xaxis.labels.datetimeUTC}calculateTimeScaleTicks(t,e){let s=this.w;if(s.globals.allSeriesCollapsed)return s.globals.labels=[],s.globals.timescaleLabels=[],[];let i=new S(this.ctx);const a=(e-t)/864e5;this.determineInterval(a),s.globals.disableZoomIn=!1,s.globals.disableZoomOut=!1,a<Zt?s.globals.disableZoomIn=!0:a>5e4&&(s.globals.disableZoomOut=!0);const o=i.getTimeUnitsfromTimestamp(t,e,this.utc),r=s.globals.gridWidth/a,h=r/24,c=h/60,d=c/60;let g=Math.floor(24*a),p=Math.floor(1440*a),x=Math.floor(a*qt),b=Math.floor(a),f=Math.floor(a/30),u=Math.floor(a/365);const m={minMillisecond:o.minMillisecond,minSecond:o.minSecond,minMinute:o.minMinute,minHour:o.minHour,minDate:o.minDate,minMonth:o.minMonth,minYear:o.minYear};const y={firstVal:m,currentMillisecond:m.minMillisecond,currentSecond:m.minSecond,currentMinute:m.minMinute,currentHour:m.minHour,currentMonthDate:m.minDate,currentDate:m.minDate,currentMonth:m.minMonth,currentYear:m.minYear,daysWidthOnXAxis:r,hoursWidthOnXAxis:h,minutesWidthOnXAxis:c,secondsWidthOnXAxis:d,numberOfSeconds:x,numberOfMinutes:p,numberOfHours:g,numberOfDays:b,numberOfMonths:f,numberOfYears:u};switch(this.tickInterval){case"years":this.generateYearScale(y);break;case"months":case"half_year":this.generateMonthScale(y);break;case"months_days":case"months_fortnight":case"days":case"week_days":this.generateDayScale(y);break;case"hours":this.generateHourScale(y);break;case"minutes_fives":case"minutes":this.generateMinuteScale(y);break;case"seconds_tens":case"seconds_fives":case"seconds":this.generateSecondScale(y)}const w=this.timeScaleArray.map(t=>{let e={position:t.position,unit:t.unit,year:t.year,day:t.day?t.day:1,hour:t.hour?t.hour:0,month:t.month+1};return"month"===t.unit?n(l({},e),{day:1,value:t.value+1}):"day"===t.unit||"hour"===t.unit?n(l({},e),{value:t.value}):"minute"===t.unit?n(l({},e),{value:t.value,minute:t.value}):"second"===t.unit?n(l({},e),{value:t.value,minute:t.minute,second:t.second}):t});return w.filter(t=>{let e=1,i=Math.ceil(s.globals.gridWidth/120),a=t.value;void 0!==s.config.xaxis.tickAmount&&(i=s.config.xaxis.tickAmount),w.length>i&&(e=Math.floor(w.length/i));let o=!1,r=!1;switch(this.tickInterval){case"years":"year"===t.unit&&(o=!0);break;case"half_year":e=7,"year"===t.unit&&(o=!0);break;case"months":e=1,"year"===t.unit&&(o=!0);break;case"months_fortnight":e=15,"year"!==t.unit&&"month"!==t.unit||(o=!0),30===a&&(r=!0);break;case"months_days":e=10,"month"===t.unit&&(o=!0),30===a&&(r=!0);break;case"week_days":e=8,"month"===t.unit&&(o=!0);break;case"days":e=1,"month"===t.unit&&(o=!0);break;case"hours":"day"===t.unit&&(o=!0);break;case"minutes_fives":case"seconds_fives":a%5!=0&&(r=!0);break;case"seconds_tens":a%10!=0&&(r=!0)}if("hours"===this.tickInterval||"minutes_fives"===this.tickInterval||"seconds_tens"===this.tickInterval||"seconds_fives"===this.tickInterval){if(!r)return!0}else if((a%e===0||o)&&!r)return!0})}recalcDimensionsBasedOnFormat(t){const e=this.w,s=this.formatDates(t),i=this.removeOverlappingTS(s);e.globals.timescaleLabels=i.slice(),new nt(this.ctx).plotCoords()}determineInterval(t){const e=24*t,s=60*e;switch(!0){case t/365>5:this.tickInterval="years";break;case t>800:this.tickInterval="half_year";break;case t>180:this.tickInterval="months";break;case t>90:this.tickInterval="months_fortnight";break;case t>60:this.tickInterval="months_days";break;case t>30:this.tickInterval="week_days";break;case t>2:this.tickInterval="days";break;case e>2.4:this.tickInterval="hours";break;case s>15:this.tickInterval="minutes_fives";break;case s>5:this.tickInterval="minutes";break;case s>1:this.tickInterval="seconds_tens";break;case 60*s>20:this.tickInterval="seconds_fives";break;default:this.tickInterval="seconds"}}generateYearScale({firstVal:t,currentMonth:e,currentYear:s,daysWidthOnXAxis:i,numberOfYears:a}){let o=t.minYear,r=0;const l=new S(this.ctx);let n="year";if(t.minDate>1||t.minMonth>0){let s=l.determineRemainingDaysOfYear(t.minYear,t.minMonth,t.minDate);r=(l.determineDaysOfYear(t.minYear)-s+1)*i,o=t.minYear+1,this.timeScaleArray.push({position:r,value:o,unit:n,year:o,month:u.monthMod(e+1)})}else 1===t.minDate&&0===t.minMonth&&this.timeScaleArray.push({position:r,value:o,unit:n,year:s,month:u.monthMod(e+1)});let h=o,c=r;for(let t=0;t<a;t++)h++,c=l.determineDaysOfYear(h-1)*i+c,this.timeScaleArray.push({position:c,value:h,unit:n,year:h,month:1})}generateMonthScale({firstVal:t,currentMonthDate:e,currentMonth:s,currentYear:i,daysWidthOnXAxis:a,numberOfMonths:o}){let r=s,l=0;const n=new S(this.ctx);let h="month",c=0;if(t.minDate>1){l=(n.determineDaysOfMonths(s+1,t.minYear)-e+1)*a,r=u.monthMod(s+1);let o=i+c,d=u.monthMod(r),g=r;0===r&&(h="year",g=o,d=1,c+=1,o+=c),this.timeScaleArray.push({position:l,value:g,unit:h,year:o,month:d})}else this.timeScaleArray.push({position:l,value:r,unit:h,year:i,month:u.monthMod(s)});let d=r+1,g=l;for(let t=0,e=1;t<o;t++,e++){d=u.monthMod(d),0===d?(h="year",c+=1):h="month";let t=this._getYear(i,d,c);g=n.determineDaysOfMonths(d,t)*a+g;let e=0===d?t:d;this.timeScaleArray.push({position:g,value:e,unit:h,year:t,month:0===d?1:d}),d++}}generateDayScale({firstVal:t,currentMonth:e,currentYear:s,hoursWidthOnXAxis:i,numberOfDays:a}){const o=new S(this.ctx);let r="day",l=t.minDate+1,n=l;const h=(t,e,s)=>t>o.determineDaysOfMonths(e+1,s)?(n=1,r="month",d=e+=1,e):e;let c=(24-t.minHour)*i,d=l,g=h(n,e,s);0===t.minHour&&1===t.minDate?(c=0,d=u.monthMod(t.minMonth),r="month",n=t.minDate):1!==t.minDate&&0===t.minHour&&0===t.minMinute&&(c=0,l=t.minDate,n=l,d=l,g=h(n,e,s),1!==d&&(r="day")),this.timeScaleArray.push({position:c,value:d,unit:r,year:this._getYear(s,g,0),month:u.monthMod(g),day:n});let p=c;for(let t=0;t<a;t++){n+=1,r="day",g=h(n,g,this._getYear(s,g,0));let t=this._getYear(s,g,0);p=24*i+p;let e=1===n?u.monthMod(g):n;this.timeScaleArray.push({position:p,value:e,unit:r,year:t,month:u.monthMod(g),day:e})}}generateHourScale({firstVal:t,currentDate:e,currentMonth:s,currentYear:i,minutesWidthOnXAxis:a,numberOfHours:o}){const r=new S(this.ctx);let l="hour";const n=(t,e)=>(t>r.determineDaysOfMonths(e+1,i)&&(x=1,e+=1),{month:e,date:x}),h=(t,e)=>t>r.determineDaysOfMonths(e+1,i)?e+=1:e;let c=60-(t.minMinute+t.minSecond/60),d=c*a,g=t.minHour+1,p=g;60===c&&(d=0,g=t.minHour,p=g);let x=e;p>=24&&(p=0,x+=1,l="day",g=x);let b=n(x,s).month;b=h(x,b),g>31&&(x=1,g=x),this.timeScaleArray.push({position:d,value:g,unit:l,day:x,hour:p,year:i,month:u.monthMod(b)}),p++;let f=d;for(let t=0;t<o;t++){if(l="hour",p>=24){p=0,x+=1,l="day";b=n(x,b).month,b=h(x,b)}let t=this._getYear(i,b,0);f=60*a+f;let e=0===p?x:p;this.timeScaleArray.push({position:f,value:e,unit:l,hour:p,day:x,year:t,month:u.monthMod(b)}),p++}}generateMinuteScale({currentMillisecond:t,currentSecond:e,currentMinute:s,currentHour:i,currentDate:a,currentMonth:o,currentYear:r,minutesWidthOnXAxis:l,secondsWidthOnXAxis:n,numberOfMinutes:h}){let c=s+1,d=a,g=o,p=r,x=i,b=(60-e-t/1e3)*n;for(let t=0;t<h;t++)c>=60&&(c=0,x+=1,24===x&&(x=0)),this.timeScaleArray.push({position:b,value:c,unit:"minute",hour:x,minute:c,day:d,year:this._getYear(p,g,0),month:u.monthMod(g)}),b+=l,c++}generateSecondScale({currentMillisecond:t,currentSecond:e,currentMinute:s,currentHour:i,currentDate:a,currentMonth:o,currentYear:r,secondsWidthOnXAxis:l,numberOfSeconds:n}){let h=e+1,c=s,d=a,g=o,p=r,x=i,b=(1e3-t)/1e3*l;for(let t=0;t<n;t++)h>=60&&(c++,h=0,c>=60&&(x++,c=0,24===x&&(x=0))),this.timeScaleArray.push({position:b,value:h,unit:"second",hour:x,minute:c,second:h,day:d,year:this._getYear(p,g,0),month:u.monthMod(g)}),b+=l,h++}createRawDateString(t,e){let s=t.year;return 0===t.month&&(t.month=1),s+="-"+("0"+t.month.toString()).slice(-2),"day"===t.unit?s+="day"===t.unit?"-"+("0"+e).slice(-2):"-01":s+="-"+("0"+(t.day?t.day:"1")).slice(-2),"hour"===t.unit?s+="hour"===t.unit?"T"+("0"+e).slice(-2):"T00":s+="T"+("0"+(t.hour?t.hour:"0")).slice(-2),"minute"===t.unit?s+=":"+("0"+e).slice(-2):s+=":"+(t.minute?("0"+t.minute).slice(-2):"00"),"second"===t.unit?s+=":"+("0"+e).slice(-2):s+=":00",this.utc&&(s+=".000Z"),s}formatDates(t){const e=this.w;return t.map(t=>{let s=t.value.toString(),i=new S(this.ctx);const a=this.createRawDateString(t,s);let o=i.getDate(i.parseDate(a));if(this.utc||(o=i.getDate(i.parseDateWithTimezone(a))),void 0===e.config.xaxis.labels.format){let a="dd MMM";const r=e.config.xaxis.labels.datetimeFormatter;"year"===t.unit&&(a=r.year),"month"===t.unit&&(a=r.month),"day"===t.unit&&(a=r.day),"hour"===t.unit&&(a=r.hour),"minute"===t.unit&&(a=r.minute),"second"===t.unit&&(a=r.second),s=i.formatDate(o,a)}else s=i.formatDate(o,e.config.xaxis.labels.format);return{dateString:a,position:t.position,value:s,unit:t.unit,year:t.year,month:t.month}})}removeOverlappingTS(t){const e=new w(this.ctx);let s,i=!1;t.length>0&&t[0].value&&t.every(e=>e.value.length===t[0].value.length)&&(i=!0,s=e.getTextRects(t[0].value).width);let a=0,o=t.map((o,r)=>{if(r>0&&this.w.config.xaxis.labels.hideOverlappingLabels){const l=i?s:e.getTextRects(t[a].value).width,n=t[a].position;return o.position>n+l+10?(a=r,o):null}return o});return o=o.filter(t=>null!==t),o}_getYear(t,e,s){return t+Math.floor(e/12)+s}}class Kt{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){let e,s,{x:i,y:a,y1:o,y2:r,i:h,j:c,realIndex:d,columnGroupIndex:g,series:p,barHeight:x,barWidth:b,barXPosition:f,barYPosition:u,visibleSeries:m}=t,y=this.w,v=new w(this.barCtx.ctx),A=Array.isArray(this.barCtx.strokeWidth)?this.barCtx.strokeWidth[d]:this.barCtx.strokeWidth;y.globals.isXNumeric&&!y.globals.isBarHorizontal?(e=i+parseFloat(b*(m+1)),s=a+parseFloat(x*(m+1))-A):(e=i+parseFloat(b*m),s=a+parseFloat(x*m));let C=null,S=null,k=i,L=a,M={},P=y.config.dataLabels,I=this.barCtx.barOptions.dataLabels,T=this.barCtx.barOptions.dataLabels.total;void 0!==u&&this.barCtx.isRangeBar&&(s=u,L=u),void 0!==f&&this.barCtx.isVerticalGroupedRangeBar&&(e=f,k=f);const X=P.offsetX,z=P.offsetY;let E={width:0,height:0};if(y.config.dataLabels.enabled){const t=y.globals.series[h][c];E=v.getTextRects(y.config.dataLabels.formatter?y.config.dataLabels.formatter(t,n(l({},y),{seriesIndex:h,dataPointIndex:c,w:y})):y.globals.yLabelFormatters[0](t),parseFloat(P.style.fontSize))}const Y={x:i,y:a,i:h,j:c,realIndex:d,columnGroupIndex:g,bcx:e,bcy:s,barHeight:x,barWidth:b,textRects:E,strokeWidth:A,dataLabelsX:k,dataLabelsY:L,dataLabelsConfig:P,barDataLabelsConfig:I,barTotalDataLabelsConfig:T,offX:X,offY:z};return M=this.barCtx.isHorizontal?this.calculateBarsDataLabelsPosition(Y):this.calculateColumnsDataLabelsPosition(Y),C=this.drawCalculatedDataLabels({x:M.dataLabelsX,y:M.dataLabelsY,val:this.barCtx.isRangeBar?[o,r]:"100%"===y.config.chart.stackType?p[d][c]:y.globals.series[d][c],i:d,j:c,barWidth:b,barHeight:x,textRects:E,dataLabelsConfig:P}),y.config.chart.stacked&&T.enabled&&(S=this.drawTotalDataLabels({x:M.totalDataLabelsX,y:M.totalDataLabelsY,barWidth:b,barHeight:x,realIndex:d,textAnchor:M.totalDataLabelsAnchor,val:this.getStackedTotalDataLabel({realIndex:d,j:c}),dataLabelsConfig:P,barTotalDataLabelsConfig:T})),{dataLabelsPos:M,dataLabels:C,totalDataLabels:S}}getStackedTotalDataLabel({realIndex:t,j:e}){const s=this.w;let i=this.barCtx.stackedSeriesTotals[e];return this.totalFormatter&&(i=this.totalFormatter(i,n(l({},s),{seriesIndex:t,dataPointIndex:e,w:s}))),i}calculateColumnsDataLabelsPosition(t){const e=this.w;let s,i,{i:a,j:o,realIndex:r,y:l,bcx:n,barWidth:h,barHeight:c,textRects:d,dataLabelsX:g,dataLabelsY:p,dataLabelsConfig:x,barDataLabelsConfig:b,barTotalDataLabelsConfig:f,strokeWidth:u,offX:m,offY:y}=t,v=n;c=Math.abs(c);let A="vertical"===e.config.plotOptions.bar.dataLabels.orientation;const{zeroEncounters:C}=this.barCtx.barHelpers.getZeroValueEncounters({i:a,j:o});n-=u/2;let S=e.globals.gridWidth/e.globals.dataPoints;if(this.barCtx.isVerticalGroupedRangeBar?g+=h/2:(g=e.globals.isXNumeric?n-h/2+m:n-S+h/2+m,!e.config.chart.stacked&&C>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(g-=h*C)),A){const t=2;g=g+d.height/2-u/2-t}let k=e.globals.series[a][o]<0,L=l;switch(this.barCtx.isReversed&&(L=l+(k?c:-c)),b.position){case"center":p=A?k?L-c/2+y:L+c/2-y:k?L-c/2+d.height/2+y:L+c/2+d.height/2-y;break;case"bottom":p=A?k?L-c+y:L+c-y:k?L-c+d.height+u+y:L+c-d.height/2+u-y;break;case"top":p=A?k?L+y:L-y:k?L-d.height/2-y:L+d.height+y}let M=L;if(e.globals.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevY.forEach(t=>{M=k?Math.max(t[o],M):Math.min(t[o],M)})}),this.barCtx.lastActiveBarSerieIndex===r&&f.enabled){const t=18,a=new w(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:r,j:o}),x.fontSize);s=k?M-a.height/2-y-f.offsetY+t:M+a.height+y+f.offsetY-t;let l=S;i=v+(e.globals.isXNumeric?-h*e.globals.barGroups.length/2:e.globals.barGroups.length*h/2-(e.globals.barGroups.length-1)*h-l)+f.offsetX}return e.config.chart.stacked||(p<0?p=0+u:p+d.height/3>e.globals.gridHeight&&(p=e.globals.gridHeight-u)),{bcx:n,bcy:l,dataLabelsX:g,dataLabelsY:p,totalDataLabelsX:i,totalDataLabelsY:s,totalDataLabelsAnchor:"middle"}}calculateBarsDataLabelsPosition(t){const e=this.w;let{x:s,i:i,j:a,realIndex:o,bcy:r,barHeight:l,barWidth:n,textRects:h,dataLabelsX:c,strokeWidth:d,dataLabelsConfig:g,barDataLabelsConfig:p,barTotalDataLabelsConfig:x,offX:b,offY:f}=t,u=e.globals.gridHeight/e.globals.dataPoints;const{zeroEncounters:m}=this.barCtx.barHelpers.getZeroValueEncounters({i:i,j:a});n=Math.abs(n);let y,v,A=r-(this.barCtx.isRangeBar?0:u)+l/2+h.height/2+f-3;!e.config.chart.stacked&&m>0&&e.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(A-=l*m);let C="start",S=e.globals.series[i][a]<0,k=s;switch(this.barCtx.isReversed&&(k=s+(S?-n:n),C=S?"start":"end"),p.position){case"center":c=S?k+n/2-b:Math.max(h.width/2,k-n/2)+b;break;case"bottom":c=S?k+n-d-b:k-n+d+b;break;case"top":c=S?k-d-b:k-d+b}let L=k;if(e.globals.seriesGroups.forEach(t=>{var e;null==(e=this.barCtx[t.join(",")])||e.prevX.forEach(t=>{L=S?Math.min(t[a],L):Math.max(t[a],L)})}),this.barCtx.lastActiveBarSerieIndex===o&&x.enabled){const t=new w(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({realIndex:o,j:a}),g.fontSize);S?(y=L-d-b-x.offsetX,C="end"):y=L+b+x.offsetX+(this.barCtx.isReversed?-(n+d):d),v=A-h.height/2+t.height/2+x.offsetY+d,e.globals.barGroups.length>1&&(v-=e.globals.barGroups.length/2*(l/2))}return e.config.chart.stacked||("start"===g.textAnchor?c-h.width<0?c=S?h.width+d:d:c+h.width>e.globals.gridWidth&&(c=S?e.globals.gridWidth-d:e.globals.gridWidth-h.width-d):"middle"===g.textAnchor?c-h.width/2<0?c=h.width/2+d:c+h.width/2>e.globals.gridWidth&&(c=e.globals.gridWidth-h.width/2-d):"end"===g.textAnchor&&(c<1?c=h.width+d:c+1>e.globals.gridWidth&&(c=e.globals.gridWidth-h.width-d))),{bcx:s,bcy:r,dataLabelsX:c,dataLabelsY:A,totalDataLabelsX:y,totalDataLabelsY:v,totalDataLabelsAnchor:C}}drawCalculatedDataLabels({x:t,y:e,val:s,i:i,j:a,textRects:o,barHeight:r,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 N(this.barCtx.ctx),x=new w(this.barCtx.ctx),b=c.formatter;let f=null;const u=d.globals.collapsedSeriesIndices.indexOf(i)>-1;if(c.enabled&&!u){f=x.group({class:"apexcharts-data-labels",transform:g});let u="";void 0!==s&&(u=b(s,n(l({},d),{seriesIndex:i,dataPointIndex:a,w:d}))),!s&&d.config.plotOptions.bar.hideZeroBarsWhenGrouped&&(u="");let m=d.globals.series[i][a]<0,y=d.config.plotOptions.bar.dataLabels.position;if("vertical"===d.config.plotOptions.bar.dataLabels.orientation&&("top"===y&&(c.textAnchor=m?"end":"start"),"center"===y&&(c.textAnchor="middle"),"bottom"===y&&(c.textAnchor=m?"end":"start")),this.barCtx.isRangeBar&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels){h<x.getTextRects(u,parseFloat(c.style.fontSize)).width&&(u="")}d.config.chart.stacked&&this.barCtx.barOptions.dataLabels.hideOverflowingLabels&&(this.barCtx.isHorizontal?o.width/1.6>Math.abs(h)&&(u=""):o.height/1.6>Math.abs(r)&&(u=""));let w=l({},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:u,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:o}){const r=new w(this.barCtx.ctx);let l;return o.enabled&&void 0!==t&&void 0!==e&&this.barCtx.lastActiveBarSerieIndex===i&&(l=r.drawText({x:t,y:e,foreColor:o.style.color,text:s,textAnchor:a,fontFamily:o.style.fontFamily,fontSize:o.style.fontSize,fontWeight:o.style.fontWeight})),l}}let Qt=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.globals.isXNumeric)for(let i=0;i<t[s].length;i++)e.globals.seriesX[s][i]>e.globals.minX&&e.globals.seriesX[s][i]<e.globals.maxX&&this.barCtx.visibleItems++;else this.barCtx.visibleItems=e.globals.dataPoints;this.arrBorderRadius=this.createBorderRadiusArr(e.globals.series),u.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){let e,s,i,a,o,r,l,n,h=this.w,c=h.globals.dataPoints;this.barCtx.isRangeBar&&(c=h.globals.labels.length);let d=this.barCtx.seriesLen;if(h.config.plotOptions.bar.rangeBarGroupRows&&(d=1),this.barCtx.isHorizontal)i=h.globals.gridHeight/c,o=i/d,h.globals.isXNumeric&&(i=h.globals.gridHeight/this.barCtx.totalItems,o=i/this.barCtx.seriesLen),o=o*parseInt(this.barCtx.barOptions.barHeight,10)/100,-1===String(this.barCtx.barOptions.barHeight).indexOf("%")&&(o=parseInt(this.barCtx.barOptions.barHeight,10)),n=this.barCtx.baseLineInvertedY+h.globals.padHorizontal+(this.barCtx.isReversed?h.globals.gridWidth:0)-(this.barCtx.isReversed?2*this.barCtx.baseLineInvertedY:0),this.barCtx.isFunnel&&(n=h.globals.gridWidth/2),s=(i-o*this.barCtx.seriesLen)/2;else{if(a=h.globals.gridWidth/this.barCtx.visibleItems,h.config.xaxis.convertedCatToNumeric&&(a=h.globals.gridWidth/h.globals.dataPoints),r=a/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,h.globals.isXNumeric){let t=this.barCtx.xRatio;h.globals.minXDiff&&.5!==h.globals.minXDiff&&h.globals.minXDiff/t>0&&(a=h.globals.minXDiff/t),r=a/d*parseInt(this.barCtx.barOptions.columnWidth,10)/100,r<1&&(r=1)}if(-1===String(this.barCtx.barOptions.columnWidth).indexOf("%")&&(r=parseInt(this.barCtx.barOptions.columnWidth,10)),l=h.globals.gridHeight-this.barCtx.baseLineY[this.barCtx.translationsIndex]-(this.barCtx.isReversed?h.globals.gridHeight:0)+(this.barCtx.isReversed?2*this.barCtx.baseLineY[this.barCtx.translationsIndex]:0),h.globals.isXNumeric){e=this.barCtx.getBarXForNumericXAxis({x:e,j:0,realIndex:t,barWidth:r}).x}else e=h.globals.padHorizontal+u.noExponents(a-r*this.barCtx.seriesLen)/2}return h.globals.barHeight=o,h.globals.barWidth=r,{x:e,y:s,yDivision:i,xDivision:a,barHeight:o,barWidth:r,zeroH:l,zeroW:n}}initializeStackedPrevVars(t){t.w.globals.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.globals.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,o,r,l;const n=this.w;let h=this.barCtx.ctx.fill,c=null,d=this.barCtx.barOptions.distributed?s:e,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=n.config.series[e].data[s])?void 0:a.fill,fillType:(null==(r=null==(o=n.config.series[e].data[s])?void 0:o.fill)?void 0:r.type)?null==(l=n.config.series[e].data[s])?void 0:l.fill.type:Array.isArray(n.config.fill.type)?n.config.fill.type[i]:n.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,o=0|(null==(e=t[0])?void 0:e.length),r=Array.from({length:a},()=>Array(o).fill(i?"top":"none"));if(i)return r;const l=this.w.config.chart.type;for(let e=0;e<o;e++){let s=[],i=[],n=0;for(let o=0;o<a;o++){const a=t[o][e];a>0?(s.push(o),n++):a<0&&(i.push(o),n++)}if(s.length>0&&0===i.length)if(1===s.length)r[s[0]][e]="bar"===l&&1===o?"top":"both";else{const t=s[0],i=s[s.length-1];for(let a of s)r[a][e]=a===t?"bar"===l&&1===o?"top":"bottom":a===i?"top":"none"}else if(i.length>0&&0===s.length)if(1===i.length)r[i[0]][e]="both";else{const t=Math.max(...i),s=Math.min(...i);for(let a of i)r[a][e]=a===t?"bottom":a===s?"top":"none"}else if(s.length>0&&i.length>0){const t=s[s.length-1];for(let i of s)r[i][e]=i===t?"top":"none";const a=Math.max(...i);for(let t of i)r[t][e]=t===a?"bottom":"none"}else if(1===n){r[s[0]||i[0]][e]="both"}}return r}barBackground({j:t,i:e,x1:s,x2:i,y1:a,y2:o,elSeries:r}){const l=this.w,n=new w(this.barCtx.ctx);let h=new G(this.barCtx.ctx).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);let e=this.barCtx.barOptions.colors.backgroundBarColors[t],h=n.drawRect(void 0!==s?s:0,void 0!==a?a:0,void 0!==i?i:l.globals.gridWidth,void 0!==o?o:l.globals.gridHeight,this.barCtx.barOptions.colors.backgroundBarRadius,e,this.barCtx.barOptions.colors.backgroundBarOpacity);r.add(h),h.node.classList.add("apexcharts-backgroundBar")}}getColumnPaths({barWidth:t,barXPosition:e,y1:s,y2:i,strokeWidth:a,isReversed:o,series:r,seriesGroup:l,realIndex:n,i:h,j:c,w:d}){var g;const p=new w(this.barCtx.ctx);(a=Array.isArray(a)?a[n]:a)||(a=0);let x=t,b=e;(null==(g=d.config.series[n].data[c])?void 0:g.columnWidthOffset)&&(b=e-d.config.series[n].data[c].columnWidthOffset/2,x=t+d.config.series[n].data[c].columnWidthOffset);let f=a/2;const u=b+f,m=b+x-f;let y=(r[h][c]>=0?1:-1)*(o?-1:1);s+=.001-f*y,i+=.001+f*y;let v=p.move(u,s),A=p.move(u,s);const C=p.line(m,s);if(d.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(n,c,!1)),v=v+p.line(u,i)+p.line(m,i)+C+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][c]?" Z":" z"),A=A+p.line(u,s)+C+C+C+C+C+p.line(u,s)+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][c]?" Z":" z"),"none"!==this.arrBorderRadius[n][c]&&(v=p.roundPathCorners(v,d.config.plotOptions.bar.borderRadius)),d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.yArrj.push(i-f*y),t.yArrjF.push(Math.abs(s-i+a*y)),t.yArrjVal.push(this.barCtx.series[h][c])}return{pathTo:v,pathFrom:A}}getBarpaths({barYPosition:t,barHeight:e,x1:s,x2:i,strokeWidth:a,isReversed:o,series:r,seriesGroup:l,realIndex:n,i:h,j:c,w:d}){var g;const p=new w(this.barCtx.ctx);(a=Array.isArray(a)?a[n]:a)||(a=0);let x=t,b=e;(null==(g=d.config.series[n].data[c])?void 0:g.barHeightOffset)&&(x=t-d.config.series[n].data[c].barHeightOffset/2,b=e+d.config.series[n].data[c].barHeightOffset);let f=a/2;const u=x+f,m=x+b-f;let y=(r[h][c]>=0?1:-1)*(o?-1:1);s+=.001+f*y,i+=.001-f*y;let v=p.move(s,u),A=p.move(s,u);d.globals.previousPaths.length>0&&(A=this.barCtx.getPreviousPath(n,c,!1));const C=p.line(s,m);if(v=v+p.line(i,u)+p.line(i,m)+C+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][c]?" Z":" z"),A=A+p.line(s,u)+C+C+C+C+C+p.line(s,u)+("around"===d.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[n][c]?" Z":" z"),"none"!==this.arrBorderRadius[n][c]&&(v=p.roundPathCorners(v,d.config.plotOptions.bar.borderRadius)),d.config.chart.stacked){let t=this.barCtx;t=this.barCtx[l],t.xArrj.push(i+f*y),t.xArrjF.push(Math.abs(s-i-a*y)),t.xArrjVal.push(this.barCtx.series[h][c])}return{pathTo:v,pathFrom:A}}checkZeroSeries({series:t}){let 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,o){const r=this.w;let h=[];const c=(i,a)=>{h.push({[t]:"x"===t?this.getXForValue(i,e,!1):this.getYForValue(i,s,o,!1),attrs:a})};if(r.globals.seriesGoals[i]&&r.globals.seriesGoals[i][a]&&Array.isArray(r.globals.seriesGoals[i][a])&&r.globals.seriesGoals[i][a].forEach(t=>{c(t.value,t)}),this.barCtx.barOptions.isDumbbell&&r.globals.seriesRange.length){let e=this.barCtx.barOptions.dumbbellColors?this.barCtx.barOptions.dumbbellColors:r.globals.colors;const s={strokeHeight:"x"===t?0:r.globals.markers.size[i],strokeWidth:"x"===t?r.globals.markers.size[i]:0,strokeDashArray:0,strokeLineCap:"round",strokeColor:Array.isArray(e[i])?e[i][0]:e[i]};c(r.globals.seriesRangeStart[i][a],s),c(r.globals.seriesRangeEnd[i][a],n(l({},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:o}){let r=new w(this.barCtx.ctx);const l=r.group({className:"apexcharts-bar-goals-groups"});l.node.classList.add("apexcharts-element-hidden"),this.barCtx.w.globals.delayedElements.push({el:l.node}),l.attr("clip-path",`url(#gridRectMarkerMask${this.barCtx.w.globals.cuid})`);let n=null;return this.barCtx.isHorizontal?Array.isArray(s)&&s.forEach(t=>{if(t.x>=-1&&t.x<=r.w.globals.gridWidth+1){let s=void 0!==t.attrs.strokeHeight?t.attrs.strokeHeight:o/2,i=e+s+o/2;n=r.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),l.add(n)}}):Array.isArray(i)&&i.forEach(e=>{if(e.y>=-1&&e.y<=r.w.globals.gridHeight+1){let s=void 0!==e.attrs.strokeWidth?e.attrs.strokeWidth:a/2,i=t+s+a/2;n=r.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),l.add(n)}}),l}drawBarShadow({prevPaths:t,currPaths:e,color:s,realIndex:i,j:a}){const o=this.w,{x:r,x1:l,barYPosition:n}=t,{x:h,x1:c,barYPosition:d}=e,g=n+e.barHeight,p=new w(this.barCtx.ctx),x=new u,b=p.move(l,g)+p.line(r,g)+p.line(h,d)+p.line(c,d)+p.line(l,g)+("around"===o.config.plotOptions.bar.borderRadiusApplication||"both"===this.arrBorderRadius[i][a]?" Z":" z");return p.drawPath({d:b,fill:x.shadeColor(.5,u.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,o=0;return(i.config.plotOptions.bar.horizontal?i.globals.series.map((t,e)=>e):(null==(s=i.globals.columnSeries)?void 0:s.i.map(t=>t))||[]).forEach(s=>{let r=i.globals.seriesPercent[s][e];r&&a++,s<t&&0===r&&o++}),{nonZeroColumns:a,zeroEncounters:o}}getGroupIndex(t){const e=this.w;let s=e.globals.seriesGroups.findIndex(s=>s.indexOf(e.globals.seriesNames[t])>-1),i=this.barCtx.columnGroupIndices,a=i.indexOf(s);return a<0&&(i.push(s),a=i.length-1),{groupIndex:s,columnGroupIndex:a}}};class te{constructor(t,e){this.ctx=t,this.w=t.w;const s=this.w;this.barOptions=s.config.plotOptions.bar,this.isHorizontal=this.barOptions.horizontal,this.strokeWidth=s.config.stroke.width,this.isNullValue=!1,this.isRangeBar=s.globals.seriesRange.length&&this.isHorizontal,this.isVerticalGroupedRangeBar=!s.globals.isBarHorizontal&&s.globals.seriesRange.length&&s.config.plotOptions.bar.rangeBarGroupRows,this.isFunnel=this.barOptions.isFunnel,this.xyRatios=e,null!==this.xyRatios&&(this.xRatio=e.xRatio,this.yRatio=e.yRatio,this.invertedXRatio=e.invertedXRatio,this.invertedYRatio=e.invertedYRatio,this.baseLineY=e.baseLineY,this.baseLineInvertedY=e.baseLineInvertedY),this.yaxisIndex=0,this.translationsIndex=0,this.seriesLen=0,this.pathArr=[];const i=new G(this.ctx);this.lastActiveBarSerieIndex=i.getActiveConfigSeriesIndex("desc",["bar","column"]),this.columnGroupIndices=[];const a=i.getBarSeriesIndices(),o=new v(this.ctx);this.stackedSeriesTotals=o.getStackedSeriesTotals(this.w.config.series.map((t,e)=>-1===a.indexOf(e)?e:-1).filter(t=>-1!==t)),this.barHelpers=new Qt(this)}draw(t,e){var s;let i=this.w,a=new w(this.ctx);const o=new v(this.ctx);t=o.getLogSeries(t),this.series=t,this.yRatio=o.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);let r=a.group({class:"apexcharts-bar-series apexcharts-plot-series"});i.config.dataLabels.enabled&&(this.totalItems,this.barOptions.dataLabels.maxItems);for(let o=0,h=0;o<t.length;o++,h++){let c,d,g,p,x,b,f=[],m=[],w=i.globals.comboCharts?e[o]:o,{columnGroupIndex:v}=this.barHelpers.getGroupIndex(w),A=a.group({class:"apexcharts-series",rel:o+1,seriesName:u.escapeString(i.globals.seriesNames[w]),"data:realIndex":w});this.ctx.series.addCollapsedClassToSeries(A,w),t[o].length>0&&(this.visibleI=this.visibleI+1);let C=0,S=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[w],this.translationsIndex=w);let k=this.translationsIndex;this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed;let L=this.barHelpers.initialPositions(w);d=L.y,C=L.barHeight,p=L.yDivision,b=L.zeroW,c=L.x,S=L.barWidth,g=L.xDivision,x=L.zeroH,this.isHorizontal||m.push(c+S/2);let M=a.group({class:"apexcharts-datalabels","data:realIndex":w});i.globals.delayedElements.push({el:M.node}),M.node.classList.add("apexcharts-element-hidden");let P=a.group({class:"apexcharts-bar-goals-markers"}),I=a.group({class:"apexcharts-bar-shadows"});i.globals.delayedElements.push({el:I.node}),I.node.classList.add("apexcharts-element-hidden");for(let e=0;e<t[o].length;e++){const a=this.barHelpers.getStrokeWidth(o,e,w);let r=null;const L={indexes:{i:o,j:e,realIndex:w,translationsIndex:k,bc:h},x:c,y:d,strokeWidth:a,elSeries:A};this.isHorizontal?(r=this.drawBarPaths(n(l({},L),{barHeight:C,zeroW:b,yDivision:p})),S=this.series[o][e]/this.invertedYRatio):(r=this.drawColumnPaths(n(l({},L),{xDivision:g,barWidth:S,zeroH:x})),C=this.series[o][e]/this.yRatio[k]);let T=this.barHelpers.getPathFillColor(t,o,e,w);if(this.isFunnel&&this.barOptions.isFunnel3d&&this.pathArr.length&&e>0){const t=this.barHelpers.drawBarShadow({color:"string"==typeof T.color&&-1===(null==(s=T.color)?void 0:s.indexOf("url"))?T.color:u.hexToRgba(i.globals.colors[o]),prevPaths:this.pathArr[this.pathArr.length-1],currPaths:r,realIndex:w,j:e});if(I.add(t),i.config.chart.dropShadow.enabled){new y(this.ctx).dropShadow(t,i.config.chart.dropShadow,w)}}this.pathArr.push(r);const X=this.barHelpers.drawGoalLine({barXPosition:r.barXPosition,barYPosition:r.barYPosition,goalX:r.goalX,goalY:r.goalY,barHeight:C,barWidth:S});X&&P.add(X),d=r.y,c=r.x,e>0&&m.push(c+S/2),f.push(d),this.renderSeries(n(l({realIndex:w,pathFill:T.color},T.useRangeColor?{lineFill:T.color}:{}),{j:e,i:o,columnGroupIndex:v,pathFrom:r.pathFrom,pathTo:r.pathTo,strokeWidth:a,elSeries:A,x:c,y:d,series:t,barHeight:Math.abs(r.barHeight?r.barHeight:C),barWidth:Math.abs(r.barWidth?r.barWidth:S),elDataLabelsWrap:M,elGoalsMarkers:P,elBarShadows:I,visibleSeries:this.visibleI,type:"bar"}))}i.globals.seriesXvalues[w]=m,i.globals.seriesYvalues[w]=f,r.add(A)}return r}renderSeries({realIndex:t,pathFill:e,lineFill:s,j:i,i:a,columnGroupIndex:o,pathFrom:r,pathTo:l,strokeWidth:n,elSeries:h,x:c,y:d,y1:g,y2:p,series:x,barHeight:b,barWidth:f,barXPosition:u,barYPosition:m,elDataLabelsWrap:v,elGoalsMarkers:A,elBarShadows:C,visibleSeries:S,type:k,classes:L}){const M=this.w,P=new w(this.ctx);let I=!1;if(h._bindingsDelegated||(h._bindingsDelegated=!0,P.setupEventDelegation(h,`.apexcharts-${k}-area`)),!s){let e=function(t){const e=M.config.stroke.colors;let s;return Array.isArray(e)&&e.length>0&&(s=e[t],s||(s=""),"function"==typeof s)?s({value:M.globals.series[t][i],dataPointIndex:i,w:M}):s};const a="function"==typeof M.globals.stroke.colors[t]?e(t):M.globals.stroke.colors[t];s=this.barOptions.distributed?M.globals.stroke.colors[i]:a}let T=new Kt(this).handleBarDataLabels({x:c,y:d,y1:g,y2:p,i:a,j:i,series:x,realIndex:t,columnGroupIndex:o,barHeight:b,barWidth:f,barXPosition:u,barYPosition:m,visibleSeries:S});M.globals.isBarHorizontal||(T.dataLabelsPos.dataLabelsX+Math.max(f,M.globals.barPadForNumericAxis)<0||T.dataLabelsPos.dataLabelsX-Math.max(f,M.globals.barPadForNumericAxis)>M.globals.gridWidth)&&(I=!0),M.config.series[a].data[i]&&M.config.series[a].data[i].strokeColor&&(s=M.config.series[a].data[i].strokeColor),this.isNullValue&&(e="none");let X=i/M.config.chart.animations.animateGradually.delay*(M.config.chart.animations.speed/M.globals.dataPoints)/2.4;if(!I){let o=P.renderPaths({i:a,j:i,realIndex:t,pathFrom:r,pathTo:l,stroke:s,strokeWidth:n,strokeLineCap:M.config.stroke.lineCap,fill:e,animationDelay:X,initialSpeed:M.config.chart.animations.speed,dataChangeSpeed:M.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${k}-area ${L}`,chartType:k,bindEventsOnPaths:!1});o.attr("clip-path",`url(#gridRectBarMask${M.globals.cuid})`);const c=M.config.forecastDataPoints;c.count>0&&i>=M.globals.dataPoints-c.count&&(o.node.setAttribute("stroke-dasharray",c.dashArray),o.node.setAttribute("stroke-width",c.strokeWidth),o.node.setAttribute("fill-opacity",c.fillOpacity)),void 0!==g&&void 0!==p&&(o.attr("data-range-y1",g),o.attr("data-range-y2",p));new y(this.ctx).setSelectionFilter(o,t,i),h.add(o),o.attr({cy:T.dataLabelsPos.bcy,cx:T.dataLabelsPos.bcx,j:i,val:M.globals.series[a][i],barHeight:b,barWidth:f}),null!==T.dataLabels&&v.add(T.dataLabels),T.totalDataLabels&&v.add(T.totalDataLabels),h.add(v),A&&h.add(A),C&&h.add(C)}return h}drawBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:o,yDivision:r,elSeries:l}){let n,h=this.w,c=t.i,d=t.j;if(h.globals.isXNumeric)n=(o=(h.globals.seriesX[c][d]-h.globals.minX)/this.invertedXRatio-e)+e*this.visibleI;else if(h.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:c,j:d});t>0&&(e=this.seriesLen*e/t),n=o+e*this.visibleI,n-=e*s}else n=o+e*this.visibleI;this.isFunnel&&(i-=(this.barHelpers.getXForValue(this.series[c][d],i)-i)/2),a=this.barHelpers.getXForValue(this.series[c][d],i);const g=this.barHelpers.getBarpaths({barYPosition:n,barHeight:e,x1:i,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,i:c,j:d,w:h});return h.globals.isXNumeric||(o+=r),this.barHelpers.barBackground({j:d,i:c,y1:n-e*this.visibleI,y2:e*this.seriesLen,elSeries:l}),{pathTo:g.pathTo,pathFrom:g.pathFrom,x1:i,x:a,y:o,goalX:this.barHelpers.getGoalValues("x",i,null,c,d),barYPosition:n,barHeight:e}}drawColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:o,strokeWidth:r,elSeries:l}){let n,h=this.w,c=t.realIndex,d=t.translationsIndex,g=t.i,p=t.j,x=t.bc;if(h.globals.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:p,realIndex:c,barWidth:a});e=t.x,n=t.barXPosition}else if(h.config.plotOptions.bar.hideZeroBarsWhenGrouped){const{nonZeroColumns:t,zeroEncounters:s}=this.barHelpers.getZeroValueEncounters({i:g,j:p});t>0&&(a=this.seriesLen*a/t),n=e+a*this.visibleI,n-=a*s}else n=e+a*this.visibleI;s=this.barHelpers.getYForValue(this.series[g][p],o,d);const b=this.barHelpers.getColumnPaths({barXPosition:n,barWidth:a,y1:o,y2:s,strokeWidth:r,isReversed:this.isReversed,series:this.series,realIndex:c,i:g,j:p,w:h});return h.globals.isXNumeric||(e+=i),this.barHelpers.barBackground({bc:x,j:p,i:g,x1:n-r/2-a*this.visibleI,x2:a*this.seriesLen+r/2,elSeries:l}),{pathTo:b.pathTo,pathFrom:b.pathFrom,x:e,y:s,goalY:this.barHelpers.getGoalValues("y",null,o,g,p,d),barXPosition:n,barWidth:a}}getBarXForNumericXAxis({x:t,barWidth:e,realIndex:s,j:i}){const a=this.w;let o=s;return a.globals.seriesX[s].length||(o=a.globals.maxValsInArrayIndex),u.isNumber(a.globals.seriesX[o][i])&&(t=(a.globals.seriesX[o][i]-a.globals.minX)/this.xRatio-e*this.seriesLen/2),{barXPosition:t+e*this.visibleI,x:t}}getPreviousPath(t,e){let s=this.w,i="M 0 0";for(let a=0;a<s.globals.previousPaths.length;a++){let o=s.globals.previousPaths[a];o.paths&&o.paths.length>0&&parseInt(o.realIndex,10)===parseInt(t,10)&&void 0!==s.globals.previousPaths[a].paths[e]&&(i=s.globals.previousPaths[a].paths[e].d)}return i}}class ee extends te{draw(t,e){let s=this.w;this.graphics=new w(this.ctx),this.bar=new te(this.ctx,this.xyRatios);const i=new v(this.ctx);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);let a=this.graphics.group({class:"apexcharts-bar-series apexcharts-plot-series"}),o=0,r=0;for(let i=0,h=0;i<t.length;i++,h++){let c,d,g,p,x=s.globals.comboCharts?e[i]:i,{groupIndex:b,columnGroupIndex:f}=this.barHelpers.getGroupIndex(x);this.groupCtx=this[s.globals.seriesGroups[b]];let m=[],y=[],w=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[x][0],w=x),this.isReversed=s.config.yaxis[this.yaxisIndex]&&s.config.yaxis[this.yaxisIndex].reversed;let v=this.graphics.group({class:"apexcharts-series",seriesName:u.escapeString(s.globals.seriesNames[x]),rel:i+1,"data:realIndex":x});this.ctx.series.addCollapsedClassToSeries(v,x);let A=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":x}),C=this.graphics.group({class:"apexcharts-bar-goals-markers"}),S=0,k=0,L=this.initialPositions(o,r,c,d,g,p,w);r=L.y,S=L.barHeight,d=L.yDivision,p=L.zeroW,o=L.x,k=L.barWidth,c=L.xDivision,g=L.zeroH,s.globals.barHeight=S,s.globals.barWidth=k,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(()=>g),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,x),u={indexes:{i:i,j:e,realIndex:x,translationsIndex:w,bc:h},strokeWidth:a,x:o,y:r,elSeries:v,columnGroupIndex:f,seriesGroup:s.globals.seriesGroups[b]};let L=null;this.isHorizontal?(L=this.drawStackedBarPaths(n(l({},u),{zeroW:p,barHeight:S,yDivision:d})),k=this.series[i][e]/this.invertedYRatio):(L=this.drawStackedColumnPaths(n(l({},u),{xDivision:c,barWidth:k,zeroH:g})),S=this.series[i][e]/this.yRatio[w]);const M=this.barHelpers.drawGoalLine({barXPosition:L.barXPosition,barYPosition:L.barYPosition,goalX:L.goalX,goalY:L.goalY,barHeight:S,barWidth:k});M&&C.add(M),r=L.y,o=L.x,m.push(o),y.push(r);let P=this.barHelpers.getPathFillColor(t,i,e,x),I="";const T=s.globals.isBarHorizontal?"apexcharts-flip-x":"apexcharts-flip-y";("bottom"===this.barHelpers.arrBorderRadius[x][e]&&s.globals.series[x][e]>0||"top"===this.barHelpers.arrBorderRadius[x][e]&&s.globals.series[x][e]<0)&&(I=T),v=this.renderSeries(n(l({realIndex:x,pathFill:P.color},P.useRangeColor?{lineFill:P.color}:{}),{j:e,i:i,columnGroupIndex:f,pathFrom:L.pathFrom,pathTo:L.pathTo,strokeWidth:a,elSeries:v,x:o,y:r,series:t,barHeight:S,barWidth:k,elDataLabelsWrap:A,elGoalsMarkers:C,type:"bar",visibleSeries:f,classes:I}))}s.globals.seriesXvalues[x]=m,s.globals.seriesYvalues[x]=y,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(v)}return a}initialPositions(t,e,s,i,a,o,r){let l,n,h=this.w;if(this.isHorizontal){i=h.globals.gridHeight/h.globals.dataPoints;let t=h.config.plotOptions.bar.barHeight;l=-1===String(t).indexOf("%")?parseInt(t,10):i*parseInt(t,10)/100,o=h.globals.padHorizontal+(this.isReversed?h.globals.gridWidth-this.baseLineInvertedY:this.baseLineInvertedY),e=(i-l)/2}else{n=s=h.globals.gridWidth/h.globals.dataPoints;let e=h.config.plotOptions.bar.columnWidth;h.globals.isXNumeric&&h.globals.dataPoints>1?n=(s=h.globals.minXDiff/this.xRatio)*parseInt(this.barOptions.columnWidth,10)/100:-1===String(e).indexOf("%")?n=parseInt(e,10):n*=parseInt(e,10)/100,a=this.isReversed?this.baseLineY[r]:h.globals.gridHeight-this.baseLineY[r],t=h.globals.padHorizontal+(s-n)/2}let c=h.globals.barGroups.length||1;return{x:t,y:e,yDivision:i,xDivision:s,barHeight:l/c,barWidth:n/c,zeroH:a,zeroW:o}}drawStackedBarPaths({indexes:t,barHeight:e,strokeWidth:s,zeroW:i,x:a,y:o,columnGroupIndex:r,seriesGroup:l,yDivision:n,elSeries:h}){let c,d=this.w,g=o+r*e,p=t.i,x=t.j,b=t.realIndex,f=t.translationsIndex,u=0;for(let t=0;t<this.groupCtx.prevXF.length;t++)u+=this.groupCtx.prevXF[t][x];let m=p;if(d.config.series[b].name&&(m=l.indexOf(d.config.series[b].name)),m>0){let t=i;this.groupCtx.prevXVal[m-1][x]<0?t=this.series[p][x]>=0?this.groupCtx.prevX[m-1][x]+u-2*(this.isReversed?u:0):this.groupCtx.prevX[m-1][x]:this.groupCtx.prevXVal[m-1][x]>=0&&(t=this.series[p][x]>=0?this.groupCtx.prevX[m-1][x]:this.groupCtx.prevX[m-1][x]-u+2*(this.isReversed?u:0)),c=t}else c=i;a=null===this.series[p][x]?c:c+this.series[p][x]/this.invertedYRatio-2*(this.isReversed?this.series[p][x]/this.invertedYRatio:0);const y=this.barHelpers.getBarpaths({barYPosition:g,barHeight:e,x1:c,x2:a,strokeWidth:s,isReversed:this.isReversed,series:this.series,realIndex:t.realIndex,seriesGroup:l,i:p,j:x,w:d});return this.barHelpers.barBackground({j:x,i:p,y1:g,y2:e,elSeries:h}),o+=n,{pathTo:y.pathTo,pathFrom:y.pathFrom,goalX:this.barHelpers.getGoalValues("x",i,null,p,x,f),barXPosition:c,barYPosition:g,x:a,y:o}}drawStackedColumnPaths({indexes:t,x:e,y:s,xDivision:i,barWidth:a,zeroH:o,columnGroupIndex:r,seriesGroup:l,elSeries:n}){var h,c,d,g;let p=this.w,x=t.i,b=t.j,f=t.bc,u=t.realIndex,m=t.translationsIndex;if(p.globals.isXNumeric){let t=p.globals.seriesX[u][b];t||(t=0),e=(t-p.globals.minX)/this.xRatio-a/2*p.globals.barGroups.length}let y,w=e+r*a,v=0;for(let t=0;t<this.groupCtx.prevYF.length;t++)v+=isNaN(this.groupCtx.prevYF[t][b])?0:this.groupCtx.prevYF[t][b];let A=x;if(l&&(A=l.indexOf(p.globals.seriesNames[u])),A>0&&!p.globals.isXNumeric||A>0&&p.globals.isXNumeric&&p.globals.seriesX[u-1][b]===p.globals.seriesX[u][b]){let t,e;const s=Math.min(this.yRatio.length+1,u+1);if(void 0!==this.groupCtx.prevY[A-1]&&this.groupCtx.prevY[A-1].length)for(let t=1;t<s;t++)if(!isNaN(null==(h=this.groupCtx.prevY[A-t])?void 0:h[b])){e=this.groupCtx.prevY[A-t][b];break}for(let i=1;i<s;i++){if((null==(c=this.groupCtx.prevYVal[A-i])?void 0:c[b])<0){t=this.series[x][b]>=0?e-v+2*(this.isReversed?v:0):e;break}if((null==(d=this.groupCtx.prevYVal[A-i])?void 0:d[b])>=0){t=this.series[x][b]>=0?e:e+v-2*(this.isReversed?v:0);break}}void 0===t&&(t=p.globals.gridHeight),y=(null==(g=this.groupCtx.prevYF[0])?void 0:g.every(t=>0===t))&&this.groupCtx.prevYF.slice(1,A).every(t=>t.every(t=>isNaN(t)))?o:t}else y=o;s=this.series[x][b]?y-this.series[x][b]/this.yRatio[m]+2*(this.isReversed?this.series[x][b]/this.yRatio[m]:0):y;const C=this.barHelpers.getColumnPaths({barXPosition:w,barWidth:a,y1:y,y2:s,yRatio:this.yRatio[m],strokeWidth:this.strokeWidth,isReversed:this.isReversed,series:this.series,seriesGroup:l,realIndex:t.realIndex,i:x,j:b,w:p});return this.barHelpers.barBackground({bc:f,j:b,i:x,x1:w,x2:a,elSeries:n}),{pathTo:C.pathTo,pathFrom:C.pathFrom,goalY:this.barHelpers.getGoalValues("y",null,o,x,b),barXPosition:w,x:p.globals.isXNumeric?e:e+i,y:s}}}class se extends te{draw(t,e,s){const i=this.w,a=new w(this.ctx),o=i.globals.comboCharts?e:i.config.chart.type,r=new D(this.ctx);this.candlestickOptions=this.w.config.plotOptions.candlestick,this.boxOptions=this.w.config.plotOptions.boxPlot,this.isHorizontal=i.config.plotOptions.bar.horizontal,this.isOHLC=this.candlestickOptions&&"ohlc"===this.candlestickOptions.type,this.coreUtils=new v(this.ctx),t=this.coreUtils.getLogSeries(t),this.series=t,this.yRatio=this.coreUtils.getLogYRatios(this.yRatio),this.barHelpers.initVariables(t);const h=a.group({class:`apexcharts-${o}-series apexcharts-plot-series`});for(let e=0;e<t.length;e++){let o,c,d,g,p,x;this.isBoxPlot="boxPlot"===i.config.chart.type||"boxPlot"===i.config.series[e].type;const b=[],f=[],m=i.globals.comboCharts?s[e]:e,{columnGroupIndex:y}=this.barHelpers.getGroupIndex(m),w=a.group({class:"apexcharts-series",seriesName:u.escapeString(i.globals.seriesNames[m]),rel:e+1,"data:realIndex":m});this.ctx.series.addCollapsedClassToSeries(w,m),t[e].length>0&&(this.visibleI=this.visibleI+1);let v=0,A=0,C=0;this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[m][0],C=m);const S=this.barHelpers.initialPositions(m);c=S.y,v=S.barHeight,g=S.yDivision,x=S.zeroW,o=S.x,A=S.barWidth,d=S.xDivision,p=S.zeroH,f.push(o+A/2);const k=a.group({class:"apexcharts-datalabels","data:realIndex":m}),L=a.group({class:"apexcharts-bar-goals-markers"});for(let s=0;s<i.globals.dataPoints;s++){const a=this.barHelpers.getStrokeWidth(e,s,m);let h=null;const u={indexes:{i:e,j:s,realIndex:m,translationsIndex:C},x:o,y:c,strokeWidth:a,elSeries:w};h=this.isHorizontal?this.drawHorizontalBoxPaths(n(l({},u),{yDivision:g,barHeight:v,zeroW:x})):this.drawVerticalBoxPaths(n(l({},u),{xDivision:d,barWidth:A,zeroH:p})),c=h.y,o=h.x;const S=this.barHelpers.drawGoalLine({barXPosition:h.barXPosition,barYPosition:h.barYPosition,goalX:h.goalX,goalY:h.goalY,barHeight:v,barWidth:A});S&&L.add(S),s>0&&f.push(o+A/2),b.push(c),h.pathTo.forEach((l,n)=>{const d=!this.isBoxPlot&&this.candlestickOptions.wick.useFillColor?h.color[n]:i.globals.stroke.colors[e],g=r.fillPath({seriesNumber:m,dataPointIndex:s,color:h.color[n],value:t[e][s]});this.renderSeries({realIndex:m,pathFill:g,lineFill:d,j:s,i:e,pathFrom:h.pathFrom,pathTo:l,strokeWidth:a,elSeries:w,x:o,y:c,series:t,columnGroupIndex:y,barHeight:v,barWidth:A,elDataLabelsWrap:k,elGoalsMarkers:L,visibleSeries:this.visibleI,type:i.config.chart.type})})}i.globals.seriesXvalues[m]=f,i.globals.seriesYvalues[m]=b,h.add(w)}return h}drawVerticalBoxPaths({indexes:t,x:e,xDivision:s,barWidth:i,zeroH:a,strokeWidth:o}){const r=this.w,l=new w(this.ctx),n=t.i,h=t.j,{colors:c}=r.config.plotOptions.candlestick,{colors:d}=this.boxOptions,g=t.realIndex,p=t=>Array.isArray(t)?t[g]:t,x=p(c.upward),b=p(c.downward),f=this.yRatio[t.translationsIndex],u=this.getOHLCValue(g,h);let m=a,y=a,v=u.o<u.c?[x]:[b];this.isBoxPlot&&(v=[p(d.lower),p(d.upper)]);let A=Math.min(u.o,u.c),C=Math.max(u.o,u.c),S=u.m;r.globals.isXNumeric&&(e=(r.globals.seriesX[g][h]-r.globals.minX)/this.xRatio-i/2);const k=e+i*this.visibleI;let L;void 0===this.series[n][h]||null===this.series[n][h]?(A=a,C=a):(A=a-A/f,C=a-C/f,m=a-u.h/f,y=a-u.l/f,S=a-u.m/f);let M=l.move(k+i/2,A);if(r.globals.previousPaths.length>0&&(M=this.getPreviousPath(g,h,!0)),this.isOHLC){const t=k+i/2,e=a-u.o/f,s=a-u.c/f;L=[l.move(t,m)+l.line(t,y)+l.move(t,e)+l.line(k,e)+l.move(t,s)+l.line(k+i,s)]}else L=this.isBoxPlot?[l.move(k,A)+l.line(k+i/2,A)+l.line(k+i/2,m)+l.line(k+i/4,m)+l.line(k+i-i/4,m)+l.line(k+i/2,m)+l.line(k+i/2,A)+l.line(k+i,A)+l.line(k+i,S)+l.line(k,S)+l.line(k,A+o/2),l.move(k,S)+l.line(k+i,S)+l.line(k+i,C)+l.line(k+i/2,C)+l.line(k+i/2,y)+l.line(k+i-i/4,y)+l.line(k+i/4,y)+l.line(k+i/2,y)+l.line(k+i/2,C)+l.line(k,C)+l.line(k,S)+"z"]:[l.move(k,C)+l.line(k+i/2,C)+l.line(k+i/2,m)+l.line(k+i/2,C)+l.line(k+i,C)+l.line(k+i,A)+l.line(k+i/2,A)+l.line(k+i/2,y)+l.line(k+i/2,A)+l.line(k,A)+l.line(k,C-o/2)];return M+=l.move(k,A),r.globals.isXNumeric||(e+=s),{pathTo:L,pathFrom:M,x:e,y:C,goalY:this.barHelpers.getGoalValues("y",null,a,n,h,t.translationsIndex),barXPosition:k,color:v}}drawHorizontalBoxPaths({indexes:t,y:e,yDivision:s,barHeight:i,zeroW:a,strokeWidth:o}){const r=this.w,l=new w(this.ctx),n=t.i,h=t.j,c=t.realIndex,{colors:d}=r.config.plotOptions.candlestick,{colors:g}=this.boxOptions,p=t=>Array.isArray(t)?t[c]:t,x=this.invertedYRatio,b=this.getOHLCValue(c,h);let f=b.o<b.c?[p(d.upward)]:[p(d.downward)];this.isBoxPlot&&(f=[p(g.lower),p(g.upper)]);let u=a,m=a,y=Math.min(b.o,b.c),v=Math.max(b.o,b.c),A=b.m;r.globals.isXNumeric&&(e=(r.globals.seriesX[c][h]-r.globals.minX)/this.invertedXRatio-i/2);const C=e+i*this.visibleI;let S;void 0===this.series[n][h]||null===this.series[n][h]?(y=a,v=a):(y=a+y/x,v=a+v/x,u=a+b.h/x,m=a+b.l/x,A=a+b.m/x);let k=l.move(y,C+i/2);return r.globals.previousPaths.length>0&&(k=this.getPreviousPath(c,h,!0)),S=[l.move(y,C)+l.line(y,C+i/2)+l.line(u,C+i/2)+l.line(u,C+i/2-i/4)+l.line(u,C+i/2+i/4)+l.line(u,C+i/2)+l.line(y,C+i/2)+l.line(y,C+i)+l.line(A,C+i)+l.line(A,C)+l.line(y+o/2,C),l.move(A,C)+l.line(A,C+i)+l.line(v,C+i)+l.line(v,C+i/2)+l.line(m,C+i/2)+l.line(m,C+i-i/4)+l.line(m,C+i/4)+l.line(m,C+i/2)+l.line(v,C+i/2)+l.line(v,C)+l.line(A,C)+"z"],k+=l.move(y,C),r.globals.isXNumeric||(e+=s),{pathTo:S,pathFrom:k,x:v,y:e,goalX:this.barHelpers.getGoalValues("x",a,null,n,h),barYPosition:C,color:f}}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,o=a(s.globals.seriesCandleH),r=a(s.globals.seriesCandleO),l=a(s.globals.seriesCandleM),n=a(s.globals.seriesCandleC),h=a(s.globals.seriesCandleL);return{o:this.isBoxPlot?o:r,h:this.isBoxPlot?r:o,m:l,l:this.isBoxPlot?n:h,c:this.isBoxPlot?h:n}}}class ie{constructor(t){this.ctx=t,this.w=t.w}checkColorRange(){const t=this.w;let e=!1,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 o=1,r=a.config.plotOptions[t].shadeIntensity;const l=this.determineColor(t,e,s);a.globals.hasNegs||i?o=a.config.plotOptions[t].reverseNegativeShade?l.percent<0?l.percent/100*(1.25*r):(1-l.percent/100)*(1.25*r):l.percent<=0?1-(1+l.percent/100)*r:(1-l.percent/100)*r:(o=1-l.percent/100,"treemap"===t&&(o=(1-l.percent/100)*(1.25*r)));let n=l.color,h=new u;if(a.config.plotOptions[t].enableShades)if("dark"===this.w.config.theme.mode){const t=h.shadeColor(-1*o,l.color);n=u.hexToRgba(u.isColorHex(t)?t:u.rgb2hex(t),a.config.fill.opacity)}else{const t=h.shadeColor(o,l.color);n=u.hexToRgba(u.isColorHex(t)?t:u.rgb2hex(t),a.config.fill.opacity)}return{color:n,colorProps:l}}determineColor(t,e,s){const i=this.w;let a=i.globals.series[e][s],o=i.config.plotOptions[t],r=o.colorScale.inverse?s:e;o.distributed&&"treemap"===i.config.chart.type&&(r=s);let l=i.globals.colors[r],n=null,h=Math.min(...i.globals.series[e]),c=Math.max(...i.globals.series[e]);o.distributed||"heatmap"!==t||(h=i.globals.minY,c=i.globals.maxY),void 0!==o.colorScale.min&&(h=o.colorScale.min<i.globals.minY?o.colorScale.min:i.globals.minY,c=o.colorScale.max>i.globals.maxY?o.colorScale.max:i.globals.maxY);let d=Math.abs(c)+Math.abs(h),g=100*a/(0===d?d-1e-6:d);if(o.colorScale.ranges.length>0){o.colorScale.ranges.map(t=>{if(a>=t.from&&a<=t.to){l=t.color,n=t.foreColor?t.foreColor:null,h=t.from,c=t.to;let e=Math.abs(c)+Math.abs(h);g=100*a/(0===e?e-1e-6:e)}})}return{color:l,foreColor:n,percent:g}}calculateDataLabels({text:t,x:e,y:s,i:i,j:a,colorProps:o,fontSize:r}){let l=this.w.config.dataLabels;const n=new w(this.ctx);let h=new N(this.ctx),c=null;if(l.enabled){c=n.group({class:"apexcharts-data-labels"});const d=l.offsetX,g=l.offsetY;let p=e+d,x=s+parseFloat(l.style.fontSize)/3+g;h.plotDataLabelsText({x:p,y:x,text:t,i:i,j:a,color:o.foreColor,parent:c,fontSize:r,dataLabelsConfig:l})}return c}}class ae{constructor(t,e){this.ctx=t,this.w=t.w,this.xRatio=e.xRatio,this.yRatio=e.yRatio,this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.helpers=new ie(t),this.rectRadius=this.w.config.plotOptions.heatmap.radius,this.strokeWidth=this.w.config.stroke.show?this.w.config.stroke.width:0}draw(t){let e=this.w;const s=new w(this.ctx);let i=s.group({class:"apexcharts-heatmap"});i.attr("clip-path",`url(#gridRectMask${e.globals.cuid})`);let a=e.globals.gridWidth/e.globals.dataPoints,o=e.globals.gridHeight/e.globals.series.length,r=0,l=!1;this.negRange=this.helpers.checkColorRange();let n=t.slice();e.config.yaxis[0].reversed&&(l=!0,n.reverse());for(let h=l?0:n.length-1;l?h<n.length:h>=0;l?h++:h--){let l=s.group({class:"apexcharts-series apexcharts-heatmap-series",seriesName:u.escapeString(e.globals.seriesNames[h]),rel:h+1,"data:realIndex":h});if(this.ctx.series.addCollapsedClassToSeries(l,h),s.setupEventDelegation(l,".apexcharts-heatmap-rect"),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;new y(this.ctx).dropShadow(l,t,h)}let c=0,d=e.config.plotOptions.heatmap.shadeIntensity,g=0;for(let i=0;i<e.globals.dataPoints;i++){if(e.globals.seriesX.length&&!e.globals.allSeriesHasEqualX&&e.globals.minX+e.globals.minXDiff*i<e.globals.seriesX[h][g]){c+=a;continue}if(g>=n[h].length)break;let p=this.helpers.getShadeColor(e.config.chart.type,h,g,this.negRange),x=p.color,b=p.colorProps;if("image"===e.config.fill.type){x=new D(this.ctx).fillPath({seriesNumber:h,dataPointIndex:g,opacity:e.globals.hasNegs?b.percent<0?1-(1+b.percent/100):d+b.percent/100:b.percent/100,patternID:u.randomId(),width:e.config.fill.image.width?e.config.fill.image.width:a,height:e.config.fill.image.height?e.config.fill.image.height:o})}let f=this.rectRadius,m=s.drawRect(c,r,a,o,f);if(m.attr({cx:c,cy:r}),m.node.classList.add("apexcharts-heatmap-rect"),l.add(m),m.attr({fill:x,i:h,index:h,j:g,val:t[h][g],"stroke-width":this.strokeWidth,stroke:e.config.plotOptions.heatmap.useFillColorAsStroke?x:e.globals.stroke.colors[0],color:x}),e.config.chart.animations.enabled&&!e.globals.dataChanged){let t=1;e.globals.resized||(t=e.config.chart.animations.speed),this.animateHeatMap(m,c,r,a,o,t)}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,u.isColorHex(s)?s:u.rgb2hex(s),u.isColorHex(x)?x:u.rgb2hex(x),t)}}let y=(0,e.config.dataLabels.formatter)(e.globals.series[h][g],{value:e.globals.series[h][g],seriesIndex:h,dataPointIndex:g,w:e}),w=this.helpers.calculateDataLabels({text:y,x:c+a/2,y:r+o/2,i:h,j:g,colorProps:b,series:n});null!==w&&l.add(w),c+=a,g++}r+=o,i.add(l)}let 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,o){const r=new m(this.ctx);r.animateRect(t,{x:e+i/2,y:s+a/2,width:0,height:0},{x:e,y:s,width:i,height:a},o,()=>{r.animationCompleted(t)})}animateHeatColor(t,e,s,i){t.attr({fill:e}).animate(i).attr({fill:s})}}class oe{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 v(this.lineCtx.ctx).seriesHaveSameValues(t)){let 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:o,prevY:r}){let l=this.w,n=[],h=[],c=this.lineCtx.categoryAxisCorrection+l.config.markers.offsetX;return l.globals.isXNumeric&&(c=(l.globals.seriesX[e][0]-l.globals.minX)/this.lineCtx.xRatio+l.config.markers.offsetX),0===o&&(n.push(c),h.push(u.isNumber(t[a][0])?r+l.config.markers.offsetY:null)),n.push(s+l.config.markers.offsetX),h.push(u.isNumber(t[a][o+1])?i+l.config.markers.offsetY:null),{x:n,y:h}}checkPreviousPaths({pathFromLine:t,pathFromArea:e,realIndex:s}){let i=this.w;for(let a=0;a<i.globals.previousPaths.length;a++){let o=i.globals.previousPaths[a];("line"===o.type||"area"===o.type)&&o.paths.length>0&&parseInt(o.realIndex,10)===parseInt(s,10)&&("line"===o.type?(this.lineCtx.appendPathFrom=!1,t=i.globals.previousPaths[a].paths[0].d):"area"===o.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:o}){var r,l,n;let 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==(r=this.w.config.series[e])?void 0:r.type)||"column"===(null==(l=this.w.config.series[e])?void 0:l.type));if(void 0!==(null==(n=s[t])?void 0:n[0]))i=(a=c&&t>0?this.lineCtx.prevSeriesY[t-1][0]:this.lineCtx.zeroY)-s[t][0]/this.lineCtx.yRatio[o]+2*(this.lineCtx.isReversed?s[t][0]/this.lineCtx.yRatio[o]: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}}}const re=t=>{const e=function(t){const e=[];let s=t[0],i=t[1],a=e[0]=ne(s,i),o=1;for(let r=t.length-1;o<r;o++)s=i,i=t[o+1],e[o]=.5*(a+(a=ne(s,i)));return e[o]=a,e}(t),s=t.length-1,i=[];let a,o,r,l;for(let i=0;i<s;i++)r=ne(t[i],t[i+1]),Math.abs(r)<1e-6?e[i]=e[i+1]=0:(a=e[i]/r,o=e[i+1]/r,l=a*a+o*o,l>9&&(l=3*r/Math.sqrt(l),e[i]=l*a,e[i+1]=l*o));for(let a=0;a<=s;a++)l=(t[Math.min(s,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+e[a]*e[a])),i.push([l||0,e[a]*l||0]);return i},le={points(t){const e=re(t),s=t[1],i=t[0],a=[],o=e[1],r=e[0];a.push(i,[i[0]+r[0],i[1]+r[1],s[0]-o[0],s[1]-o[1],s[0],s[1]]);for(let s=2,i=e.length;s<i;s++){const i=t[s],o=e[s];a.push([i[0]-o[0],i[1]-o[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 ne(t,e){return(e[1]-t[1])/(e[0]-t[0])}class he{constructor(t,e,s){this.ctx=t,this.w=t.w,this.xyRatios=e,this.pointsChart=!("bubble"!==this.w.config.chart.type&&"scatter"!==this.w.config.chart.type)||s,this.scatter=new W(this.ctx),this.noNegatives=this.w.globals.minX===Number.MAX_VALUE,this.lineHelpers=new oe(this),this.markers=new O(this.ctx),this.prevSeriesY=[],this.categoryAxisCorrection=0,this.yaxisIndex=0}draw(t,e,s,i){var a;let o=this.w,r=new w(this.ctx),h=o.globals.comboCharts?e:o.config.chart.type,c=r.group({class:`apexcharts-${h}-series apexcharts-plot-series`});const d=new v(this.ctx);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=[];let g=[];for(let e=0;e<t.length;e++){t=this.lineHelpers.sameValueSeriesFix(e,t);let a=o.globals.comboCharts?s[e]:e,r=this.yRatio.length>1?a:0;this._initSerieVariables(t,e,a);let c=[],d=[],p=[],x=o.globals.padHorizontal+this.categoryAxisCorrection,b=1,f=[],u=[];this.ctx.series.addCollapsedClassToSeries(this.elSeries,a),o.globals.isXNumeric&&o.globals.seriesX.length>0&&(x=(o.globals.seriesX[a][0]-o.globals.minX)/this.xRatio),p.push(x);let m,y,w,v=x,A=v,C=this.zeroY,S=this.zeroY,k=0;C=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:t,prevY:C,lineYPosition:k,translationsIndex:r}).prevY,"monotoneCubic"===o.config.stroke.curve&&null===t[e][0]?c.push(null):c.push(C),m=C,"rangeArea"===h&&(w=this.lineHelpers.determineFirstPrevY({i:e,realIndex:a,series:i,prevY:S,lineYPosition:k,translationsIndex:r}),S=w.prevY,y=S,d.push(null!==c[0]?S:null));let L=this._calculatePathsFrom({type:h,series:t,i:e,realIndex:a,translationsIndex:r,prevX:A,prevY:C,prevY2:S}),M=[c[0]],P=[d[0]];const I={type:h,series:t,realIndex:a,translationsIndex:r,i:e,x:x,y:b,pX:v,pY:m,pathsFrom:L,linePaths:f,areaPaths:u,seriesIndex:s,lineYPosition:k,xArrj:p,yArrj:c,y2Arrj:d,seriesRangeEnd:i};let T=this._iterateOverDataPoints(n(l({},I),{iterations:"rangeArea"===h?t[e].length-1:void 0,isRangeStart:!0}));if("rangeArea"===h){let t=this._calculatePathsFrom({series:i,i:e,realIndex:a,prevX:A,prevY:S}),s=this._iterateOverDataPoints(n(l({},I),{series:i,xArrj:[x],yArrj:M,y2Arrj:P,pY:y,areaPaths:T.areaPaths,pathsFrom:t,iterations:i[e].length-1,isRangeStart:!1})),o=T.linePaths.length/2;for(let t=0;t<o;t++)T.linePaths[t]=s.linePaths[t+o]+T.linePaths[t];T.linePaths.splice(o),T.pathFromLine=s.pathFromLine+T.pathFromLine}else T.pathFromArea+="z";this._handlePaths({type:h,realIndex:a,i:e,paths:T}),this.elSeries.add(this.elPointsMain),this.elSeries.add(this.elDataLabelsWrap),g.push(this.elSeries)}if(void 0!==(null==(a=o.config.series[0])?void 0:a.zIndex)&&g.sort((t,e)=>Number(t.node.getAttribute("zIndex"))-Number(e.node.getAttribute("zIndex"))),o.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 w(this.ctx);this.xDivision=i.globals.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 o=0;if(this.yRatio.length>1&&(this.yaxisIndex=i.globals.seriesYAxisReverseMap[s],o=s),this.isReversed=i.config.yaxis[this.yaxisIndex]&&i.config.yaxis[this.yaxisIndex].reversed,this.zeroY=i.globals.gridHeight-this.baseLineY[o]-(this.isReversed?i.globals.gridHeight:0)+(this.isReversed?2*this.baseLineY[o]:0),this.areaBottomY=this.zeroY,(this.zeroY>i.globals.gridHeight||"end"===i.config.plotOptions.area.fillTo)&&(this.areaBottomY=i.globals.gridHeight),this.categoryAxisCorrection=this.xDivision/2,this.elSeries=a.group({class:"apexcharts-series",zIndex:void 0!==i.config.series[s].zIndex?i.config.series[s].zIndex:s,seriesName:u.escapeString(i.globals.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.globals.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});let r=t[e].length===i.globals.dataPoints;this.elSeries.attr({"data:longestSeries":r,rel:e+1,"data:realIndex":s}),this.appendPathFrom=!0}_calculatePathsFrom({type:t,series:e,i:s,realIndex:i,translationsIndex:a,prevX:o,prevY:r,prevY2:l}){const n=this.w,h=new w(this.ctx);let c,d,g,p;if(null===e[s][0]){for(let t=0;t<e[s].length;t++)if(null!==e[s][t]){o=this.xDivision*t,r=this.zeroY-e[s][t]/this.yRatio[a],c=h.move(o,r),d=h.move(o,this.areaBottomY);break}}else c=h.move(o,r),"rangeArea"===t&&(c=h.move(o,l)+h.line(o,r)),d=h.move(o,this.areaBottomY)+h.line(o,r);if(g=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),p=h.move(0,this.areaBottomY)+h.line(0,this.areaBottomY),n.globals.previousPaths.length>0){const t=this.lineHelpers.checkPreviousPaths({pathFromLine:g,pathFromArea:p,realIndex:i});g=t.pathFromLine,p=t.pathFromArea}return{prevX:o,prevY:r,linePath:c,areaPath:d,pathFromLine:g,pathFromArea:p}}_handlePaths({type:t,realIndex:e,i:s,paths:i}){const a=this.w,o=new w(this.ctx),r=new D(this.ctx);this.prevSeriesY.push(i.yArrj),a.globals.seriesXvalues[e]=i.xArrj,a.globals.seriesYvalues[e]=i.yArrj;const h=a.config.forecastDataPoints;if(h.count>0&&"rangeArea"!==t){const t=a.globals.seriesXvalues[e][a.globals.seriesXvalues[e].length-h.count-1],s=o.drawRect(t,0,a.globals.gridWidth,a.globals.gridHeight,0);a.globals.dom.elForecastMask.appendChild(s.node);const i=o.drawRect(0,0,t,a.globals.gridHeight,0);a.globals.dom.elNonForecastMask.appendChild(i.node)}this.pointsChart||a.globals.delayedElements.push({el:this.elPointsMain.node,index:e});const c={i:s,realIndex:e,animationDelay:s,initialSpeed:a.config.chart.animations.speed,dataChangeSpeed:a.config.chart.animations.dynamicAnimation.speed,className:`apexcharts-${t}`};if("area"===t){let t=r.fillPath({seriesNumber:e});for(let e=0;e<i.areaPaths.length;e++){let s=o.renderPaths(n(l({},c),{pathFrom:i.pathFromArea,pathTo:i.areaPaths[e],stroke:"none",strokeWidth:0,strokeLineCap:null,fill:t}));this.elSeries.add(s)}}if(a.config.stroke.show&&!this.pointsChart){let d=null;if("line"===t)d=r.fillPath({seriesNumber:e,i:s});else if("solid"===a.config.stroke.fill.type)d=a.globals.stroke.colors[e];else{const t=a.config.fill;a.config.fill=a.config.stroke.fill,d=r.fillPath({seriesNumber:e,i:s}),a.config.fill=t}for(let s=0;s<i.linePaths.length;s++){let g=d;"rangeArea"===t&&(g=r.fillPath({seriesNumber:e}));const p=n(l({},c),{pathFrom:i.pathFromLine,pathTo:i.linePaths[s],stroke:d,strokeWidth:this.strokeWidth,strokeLineCap:a.config.stroke.lineCap,fill:"rangeArea"===t?g:"none"});let x=o.renderPaths(p);if(this.elSeries.add(x),x.attr("fill-rule","evenodd"),h.count>0&&"rangeArea"!==t){let t=o.renderPaths(p);t.node.setAttribute("stroke-dasharray",h.dashArray),h.strokeWidth&&t.node.setAttribute("stroke-width",h.strokeWidth),this.elSeries.add(t),t.attr("clip-path",`url(#forecastMask${a.globals.cuid})`),x.attr("clip-path",`url(#nonForecastMask${a.globals.cuid})`)}}}}_iterateOverDataPoints({type:t,series:e,iterations:s,realIndex:i,translationsIndex:a,i:o,x:r,y:l,pX:n,pY:h,pathsFrom:c,linePaths:d,areaPaths:g,seriesIndex:p,lineYPosition:x,xArrj:b,yArrj:f,y2Arrj:m,isRangeStart:y,seriesRangeEnd:v}){var A,C;const S=this.w;let k=new w(this.ctx),L=this.yRatio,{prevY:M,linePath:P,areaPath:I,pathFromLine:T,pathFromArea:X}=c;const z=u.isNumber(S.globals.minYArr[i])?S.globals.minYArr[i]:S.globals.minY;s||(s=S.globals.dataPoints>1?S.globals.dataPoints-1:S.globals.dataPoints);const E=(t,e)=>e-t/L[a]+2*(this.isReversed?t/L[a]:0);let Y=l,R=S.config.chart.stacked&&!S.globals.comboCharts||S.config.chart.stacked&&S.globals.comboCharts&&(!this.w.config.chart.stackOnlyBar||"bar"===(null==(A=this.w.config.series[i])?void 0:A.type)||"column"===(null==(C=this.w.config.series[i])?void 0:C.type)),F=S.config.stroke.curve;Array.isArray(F)&&(F=Array.isArray(p)?F[p[o]]:F[o]);let H,D=0;for(let a=0;a<s&&0!==e[o].length;a++){const c=void 0===e[o][a+1]||null===e[o][a+1];if(S.globals.isXNumeric){let t=S.globals.seriesX[i][a+1];void 0===S.globals.seriesX[i][a+1]&&(t=S.globals.seriesX[i][s-1]),r=(t-S.globals.minX)/this.xRatio}else r+=this.xDivision;if(R)if(o>0&&S.globals.collapsedSeries.length<S.config.series.length-1){const t=t=>{for(let e=t;e>0;e--){if(!(S.globals.collapsedSeriesIndices.indexOf((null==p?void 0:p[e])||e)>-1))return e;e--}return 0};x=this.prevSeriesY[t(o-1)][a+1]}else x=this.zeroY;else x=this.zeroY;c?l=E(z,x):(l=E(e[o][a+1],x),"rangeArea"===t&&(Y=E(v[o][a+1],x))),b.push(null===e[o][a+1]?null:r),!c||"smooth"!==S.config.stroke.curve&&"monotoneCubic"!==S.config.stroke.curve?(f.push(l),m.push(Y)):(f.push(null),m.push(null));let u=this.lineHelpers.calculatePoints({series:e,x:r,y:l,realIndex:i,i:o,j:a,prevY:M}),w=this._createPaths({type:t,series:e,i:o,j:a,x:r,y:l,y2:Y,xArrj:b,yArrj:f,y2Arrj:m,pX:n,pY:h,pathState:D,segmentStartX:H,linePath:P,areaPath:I,linePaths:d,areaPaths:g,curve:F,isRangeStart:y});g=w.areaPaths,d=w.linePaths,n=w.pX,h=w.pY,D=w.pathState,H=w.segmentStartX,I=w.areaPath,P=w.linePath,!this.appendPathFrom||S.globals.hasNullValues||"monotoneCubic"===F&&"rangeArea"===t||(T+=k.line(r,this.areaBottomY),X+=k.line(r,this.areaBottomY)),this.handleNullDataPoints(e,u,o,a,i),this._handleMarkersAndLabels({type:t,pointsPos:u,i:o,j:a,realIndex:i,isRangeStart:y})}return{yArrj:f,xArrj:b,pathFromArea:X,areaPaths:g,pathFromLine:T,linePaths:d,linePath:P,areaPath:I}}_handleMarkersAndLabels({type:t,pointsPos:e,isRangeStart:s,i:i,j:a,realIndex:o}){const r=this.w;let l=new N(this.ctx);if(this.pointsChart)this.scatter.draw(this.elSeries,a,{realIndex:o,pointsPos:e,zRatio:this.zRatio,elParent:this.elPointsMain});else{r.globals.series[i].length>1&&this.elPointsMain.node.classList.add("apexcharts-element-hidden");let t=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:o,j:a+1});null!==t&&this.elPointsMain.add(t)}let n=l.drawDataLabel({type:t,isRangeStart:s,pos:e,i:o,j:a+1});null!==n&&this.elDataLabelsWrap.add(n)}_createPaths({type:t,series:e,i:s,j:i,x:a,y:o,xArrj:r,yArrj:l,y2:n,y2Arrj:h,pX:c,pY:d,pathState:g,segmentStartX:p,linePath:x,areaPath:b,linePaths:f,areaPaths:u,curve:m,isRangeStart:y}){let v=new w(this.ctx);const A=this.areaBottomY;let C="rangeArea"===t,S="rangeArea"===t&&y;switch(m){case"monotoneCubic":{let t=y?l:h,a=(t,e)=>t.map((t,s)=>[t,e[s]]).filter(t=>null!==t[1]),o=t=>{let e=[],s=0;return t.forEach(t=>{null!==t?s++:s>0&&(e.push(s),s=0)}),s>0&&e.push(s),e},n=(t,e)=>{let s=o(t),i=[];for(let t=0,a=0;t<s.length;a+=s[t++])i[t]=le.slice(e,a,a+s[t]);return i};switch(g){case 0:if(null===t[i+1])break;g=1;case 1:if(!(C?r.length===e[s].length:i===e[s].length-2))break;case 2:{const e=y?r:r.slice().reverse(),s=y?t:t.slice().reverse(),i=a(e,s),o=i.length>1?le.points(i):i;let l=[];C&&(S?u=i:l=u.reverse());let h=0,c=0;if(n(s,o).forEach(t=>{h++;let e=(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})(t),s=c;c+=t.length;let a=c-1;S?x=v.move(i[s][0],i[s][1])+e:C?x=v.move(l[s][0],l[s][1])+v.line(i[s][0],i[s][1])+e+v.line(l[a][0],l[a][1]):(x=v.move(i[s][0],i[s][1])+e,b=x+v.line(i[a][0],A)+v.line(i[s][0],A)+"z",u.push(b)),f.push(x)}),C&&h>1&&!S){let t=f.slice(h).reverse();f.splice(h),t.forEach(t=>f.push(t))}g=0;break}}break}case"smooth":{let t=.35*(a-c);if(null===e[s][i])g=0;else switch(g){case 0:if(p=c,x=S?v.move(c,h[i])+v.line(c,d):v.move(c,d),b=v.move(c,d),null===e[s][i+1]||void 0===e[s][i+1]){f.push(x),u.push(b);break}if(g=1,i<e[s].length-2){let e=v.curve(c+t,d,a-t,o,a,o);x+=e,b+=e;break}case 1:if(null===e[s][i+1])x+=S?v.line(c,n):v.move(c,d),b+=v.line(c,A)+v.line(p,A)+"z",f.push(x),u.push(b),g=-1;else{let r=v.curve(c+t,d,a-t,o,a,o);x+=r,b+=r,i>=e[s].length-2&&(S&&(x+=v.curve(a,o,a,o,a,n)+v.move(a,n)),b+=v.curve(a,o,a,o,a,A)+v.line(p,A)+"z",f.push(x),u.push(b),g=-1)}}c=a,d=o;break}default:{let t=(t,e,s)=>{let i=[];switch(t){case"stepline":i=v.line(e,null,"H")+v.line(null,s,"V");break;case"linestep":i=v.line(null,s,"V")+v.line(e,null,"H");break;case"straight":i=v.line(e,s)}return i};if(null===e[s][i])g=0;else switch(g){case 0:if(p=c,x=S?v.move(c,h[i])+v.line(c,d):v.move(c,d),b=v.move(c,d),null===e[s][i+1]||void 0===e[s][i+1]){f.push(x),u.push(b);break}if(g=1,i<e[s].length-2){let e=t(m,a,o);x+=e,b+=e;break}case 1:if(null===e[s][i+1])x+=S?v.line(c,n):v.move(c,d),b+=v.line(c,A)+v.line(p,A)+"z",f.push(x),u.push(b),g=-1;else{let r=t(m,a,o);x+=r,b+=r,i>=e[s].length-2&&(S&&(x+=v.line(a,n)),b+=v.line(a,A)+v.line(p,A)+"z",f.push(x),u.push(b),g=-1)}}c=a,d=o;break}}return{linePaths:f,areaPaths:u,pX:c,pY:d,pathState:g,segmentStartX:p,linePath:x,areaPath:b}}handleNullDataPoints(t,e,s,i,a){const o=this.w;if(null===t[s][i]&&o.config.markers.showNullDataPoints||1===t[s].length){let t=this.strokeWidth-o.config.markers.strokeWidth/2;t>0||(t=0);let s=this.markers.plotChartMarkers({pointsPos:e,seriesIndex:a,j:i+1,pSize:t,alwaysDrawMarker:!0});null!==s&&this.elPointsMain.add(s)}}}class ce{constructor(t){this.ctx=t,this.w=t.w}drawYAxisTexts(t,e,s,i){const a=this.w,o=a.config.yaxis[0],r=a.globals.yLabelFormatters[0];return new w(this.ctx).drawText({x:t+o.labels.offsetX,y:e+o.labels.offsetY,text:r(i,s),textAnchor:"middle",fontSize:o.labels.style.fontSize,fontFamily:o.labels.style.fontFamily,foreColor:Array.isArray(o.labels.style.colors)?o.labels.style.colors[s]:o.labels.style.colors})}}class de{constructor(t){this.ctx=t,this.w=t.w;const e=this.w;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!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=Math.min(e.globals.gridWidth,e.globals.gridHeight),this.centerY=this.defaultSize/2,this.centerX=e.globals.gridWidth/2,"radialBar"===e.config.chart.type?this.fullAngle=360:this.fullAngle=Math.abs(e.config.plotOptions.pie.endAngle-e.config.plotOptions.pie.startAngle),this.initialAngle=e.config.plotOptions.pie.startAngle%this.fullAngle,e.globals.radialSize=this.defaultSize/2.05-e.config.stroke.width-(e.config.chart.sparkline.enabled?0:e.config.chart.dropShadow.blur),this.donutSize=e.globals.radialSize*parseInt(e.config.plotOptions.pie.donut.size,10)/100;let s=e.config.plotOptions.pie.customScale,i=e.globals.gridWidth/2,a=e.globals.gridHeight/2;this.translateX=i-i*s,this.translateY=a-a*s,this.dataLabelsGroup=new w(this.ctx).group({class:"apexcharts-datalabels-group",transform:`translate(${this.translateX}, ${this.translateY}) scale(${s})`}),this.maxY=0,this.sliceLabels=[],this.sliceSizes=[],this.prevSectorAngleArr=[]}draw(t){let e=this.w;const s=new w(this.ctx);let i=s.group({class:"apexcharts-pie"});if(e.globals.noData)return i;let a=0;for(let e=0;e<t.length;e++)a+=u.negToZero(t[e]);let o=[],r=s.group();0===a&&(a=1e-5),t.forEach(t=>{this.maxY=Math.max(this.maxY,t)}),e.config.yaxis[0].max&&(this.maxY=e.config.yaxis[0].max),"back"===e.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(i);for(let s=0;s<t.length;s++){let i=this.fullAngle*u.negToZero(t[s])/a;o.push(i),"polarArea"===this.chartType?(o[s]=this.fullAngle/t.length,this.sliceSizes.push(e.globals.radialSize*t[s]/this.maxY)):this.sliceSizes.push(e.globals.radialSize)}if(e.globals.dataChanged){let t,s=0;for(let t=0;t<e.globals.previousPaths.length;t++)s+=u.negToZero(e.globals.previousPaths[t]);for(let i=0;i<e.globals.previousPaths.length;i++)t=this.fullAngle*u.negToZero(e.globals.previousPaths[i])/s,this.prevSectorAngleArr.push(t)}if(this.donutSize<0&&(this.donutSize=0),"donut"===this.chartType){const t=s.drawCircle(this.donutSize);t.attr({cx:this.centerX,cy:this.centerY,fill:e.config.plotOptions.pie.donut.background?e.config.plotOptions.pie.donut.background:"transparent"}),r.add(t)}let l=this.drawArcs(o,t);if(this.sliceLabels.forEach(t=>{l.add(t)}),r.attr({transform:`translate(${this.translateX}, ${this.translateY}) scale(${e.config.plotOptions.pie.customScale})`}),r.add(l),i.add(r),this.donutDataLabels.show){let t=this.renderInnerDataLabels(this.dataLabelsGroup,this.donutDataLabels,{hollowSize:this.donutSize,centerX:this.centerX,centerY:this.centerY,opacity:this.donutDataLabels.show});i.add(t)}return"front"===e.config.grid.position&&"polarArea"===this.chartType&&this.drawPolarElements(i),i}drawArcs(t,e){let s=this.w;const i=new y(this.ctx);let a=new w(this.ctx),o=new D(this.ctx),r=a.group({class:"apexcharts-slices"}),l=this.initialAngle,n=this.initialAngle,h=this.initialAngle,c=this.initialAngle;this.strokeWidth=s.config.stroke.show?s.config.stroke.width:0;for(let d=0;d<t.length;d++){let g=a.group({class:"apexcharts-series apexcharts-pie-series",seriesName:u.escapeString(s.globals.seriesNames[d]),rel:d+1,"data:realIndex":d});r.add(g),l=h,n=c,h=l+t[d],c=n+this.prevSectorAngleArr[d];const p=h<l?this.fullAngle+h-l:h-l;let x=o.fillPath({seriesNumber:d,size:this.sliceSizes[d],value:e[d]}),b=this.getChangedPath(n,c),f=a.drawPath({d:b,stroke:Array.isArray(this.lineColorArr)?this.lineColorArr[d]:this.lineColorArr,strokeWidth:0,fill:x,fillOpacity:s.config.fill.opacity,classes:`apexcharts-pie-area apexcharts-${this.chartType.toLowerCase()}-slice-${d}`});if(f.attr({index:0,j:d}),i.setSelectionFilter(f,0,d),s.config.chart.dropShadow.enabled){const t=s.config.chart.dropShadow;i.dropShadow(f,t,d)}this.addListeners(f,this.donutDataLabels),w.setAttrs(f.node,{"data:angle":p,"data:startAngle":l,"data:strokeWidth":this.strokeWidth,"data:value":e[d]});let m={x:0,y:0};"pie"===this.chartType||"polarArea"===this.chartType?m=u.polarToCartesian(this.centerX,this.centerY,s.globals.radialSize/1.25+s.config.plotOptions.pie.dataLabels.offset,(l+p/2)%this.fullAngle):"donut"===this.chartType&&(m=u.polarToCartesian(this.centerX,this.centerY,(s.globals.radialSize+this.donutSize)/2+s.config.plotOptions.pie.dataLabels.offset,(l+p/2)%this.fullAngle)),g.add(f);let y=0;if(!this.initialAnim||s.globals.resized||s.globals.dataChanged?this.animBeginArr.push(0):(y=p/this.fullAngle*s.config.chart.animations.speed,0===y&&(y=1),this.animDur=y+this.animDur,this.animBeginArr.push(this.animDur)),this.dynamicAnim&&s.globals.dataChanged?this.animatePaths(f,{size:this.sliceSizes[d],endAngle:h,startAngle:l,prevStartAngle:n,prevEndAngle:c,animateStartingPos:!0,i:d,animBeginArr:this.animBeginArr,shouldSetPrevPaths:!0,dur:s.config.chart.animations.dynamicAnimation.speed}):this.animatePaths(f,{size:this.sliceSizes[d],endAngle:h,startAngle:l,i:d,totalItems:t.length-1,animBeginArr:this.animBeginArr,dur:y}),s.config.plotOptions.pie.expandOnClick&&"polarArea"!==this.chartType&&f.node.addEventListener("mouseup",this.pieClicked.bind(this,d)),void 0!==s.globals.selectedDataPoints[0]&&s.globals.selectedDataPoints[0].indexOf(d)>-1&&this.pieClicked(d),s.config.dataLabels.enabled){let e=m.x,o=m.y,r=100*p/this.fullAngle+"%";if(0!==p&&s.config.plotOptions.pie.dataLabels.minAngleToShowLabel<t[d]){let t=s.config.dataLabels.formatter;void 0!==t&&(r=t(s.globals.seriesPercent[d][0],{seriesIndex:d,w:s}));let l=s.globals.dataLabels.style.colors[d];const n=a.group({class:"apexcharts-datalabels"});let h=a.drawText({x:e,y:o,text:r,textAnchor:"middle",fontSize:s.config.dataLabels.style.fontSize,fontFamily:s.config.dataLabels.style.fontFamily,fontWeight:s.config.dataLabels.style.fontWeight,foreColor:l});if(n.add(h),s.config.dataLabels.dropShadow.enabled){const t=s.config.dataLabels.dropShadow;i.dropShadow(h,t)}h.node.classList.add("apexcharts-pie-label"),s.config.chart.animations.animate&&!1===s.globals.resized&&(h.node.classList.add("apexcharts-pie-label-delay"),h.node.style.animationDelay=s.config.chart.animations.speed/940+"s"),this.sliceLabels.push(n)}}}return r}addListeners(t,e){const s=new w(this.ctx);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,e)),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){let s=this.w,i=e.endAngle<e.startAngle?this.fullAngle+e.endAngle-e.startAngle:e.endAngle-e.startAngle,a=i,o=e.startAngle,r=e.startAngle;void 0!==e.prevStartAngle&&void 0!==e.prevEndAngle&&(o=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+r>this.fullAngle?e.endAngle=e.endAngle-(i+r):i+r<this.fullAngle&&(e.endAngle=e.endAngle+(this.fullAngle-(i+r)))),i===this.fullAngle&&(i=this.fullAngle-.01),this.animateArc(t,o,r,i,a,e)}animateArc(t,e,s,i,a,o){let r=this;const l=this.w,n=new m(this.ctx);let h,c=o.size;(isNaN(e)||isNaN(a))&&(e=s,a=i,o.dur=0);let d=i,g=s,p=e<s?this.fullAngle+e-s:e-s;l.globals.dataChanged&&o.shouldSetPrevPaths&&o.prevEndAngle&&(h=r.getPiePath({me:r,startAngle:o.prevStartAngle,angle:o.prevEndAngle<o.prevStartAngle?this.fullAngle+o.prevEndAngle-o.prevStartAngle:o.prevEndAngle-o.prevStartAngle,size:c}),t.attr({d:h})),0!==o.dur?t.animate(o.dur,o.animBeginArr[o.i]).after(function(){"pie"!==r.chartType&&"donut"!==r.chartType&&"polarArea"!==r.chartType||this.animate(l.config.chart.animations.dynamicAnimation.speed).attr({"stroke-width":r.strokeWidth}),o.i===l.config.series.length-1&&n.animationCompleted(t)}).during(l=>{d=p+(i-p)*l,o.animateStartingPos&&(d=a+(i-a)*l,g=e-a+(s-(e-a))*l),h=r.getPiePath({me:r,startAngle:g,angle:d,size:c}),t.node.setAttribute("data:pathOrig",h),t.attr({d:h})}):(h=r.getPiePath({me:r,startAngle:g,angle:i,size:c}),o.isTrack||(l.globals.animationEnded=!0),t.node.setAttribute("data:pathOrig",h),t.attr({d:h,"stroke-width":r.strokeWidth}))}pieClicked(t){let e,s=this.w,i=this,a=i.sliceSizes[t]+(s.config.plotOptions.pie.expandOnClick?4:0),o=s.globals.dom.Paper.findOne(`.apexcharts-${i.chartType.toLowerCase()}-slice-${t}`);if("true"===o.attr("data:pieClicked")){o.attr({"data:pieClicked":"false"}),this.revertDataLabelsInner(o.node,this.donutDataLabels);let t=o.attr("data:pathOrig");return void o.attr({d:t})}{let e=s.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area");Array.prototype.forEach.call(e,t=>{t.setAttribute("data:pieClicked","false");let e=t.getAttribute("data:pathOrig");e&&t.setAttribute("d",e)}),s.globals.capturedDataPointIndex=t,o.attr("data:pieClicked","true")}let r=parseInt(o.attr("data:startAngle"),10),l=parseInt(o.attr("data:angle"),10);e=i.getPiePath({me:i,startAngle:r,angle:l,size:a}),360!==l&&o.plot(e)}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 o=new w(this.ctx);let r=e,l=Math.PI*(r-90)/180,n=s+e;Math.ceil(n)>=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle&&(n=this.fullAngle+this.w.config.plotOptions.pie.startAngle%this.fullAngle-.01),Math.ceil(n)>this.fullAngle&&(n-=this.fullAngle);let h=Math.PI*(n-90)/180,c=t.centerX+i*Math.cos(l),d=t.centerY+i*Math.sin(l),g=t.centerX+i*Math.cos(h),p=t.centerY+i*Math.sin(h),x=u.polarToCartesian(t.centerX,t.centerY,t.donutSize,n),b=u.polarToCartesian(t.centerX,t.centerY,t.donutSize,r),f=s>180?1:0;const m=["M",c,d,"A",i,i,0,f,1,g,p];return a="donut"===t.chartType?[...m,"L",x.x,x.y,"A",t.donutSize,t.donutSize,0,f,0,b.x,b.y,"L",c,d,"z"].join(" "):"pie"===t.chartType||"polarArea"===t.chartType?[...m,"L",t.centerX,t.centerY,"L",c,d].join(" "):[...m].join(" "),o.roundPathCorners(a,2*this.strokeWidth)}drawPolarElements(t){const e=this.w,s=new U(this.ctx),i=new w(this.ctx),a=new ce(this.ctx),o=i.group(),r=i.group(),l=s.niceScale(0,Math.ceil(this.maxY),0),n=l.result.reverse();let h=l.result.length;this.maxY=l.niceMax;let c=e.globals.radialSize,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,n[t]);r.add(s)}o.add(s),c-=d}this.drawSpokes(t),t.add(o),t.add(r)}renderInnerDataLabels(t,e,s){let i=this.w;const a=new w(this.ctx),o=e.total.show;t.node.innerHTML="",t.node.style.opacity=s.opacity;let r,l,n=s.centerX,h=this.donutDataLabels.total.label?s.centerY:s.centerY-s.centerY/6;r=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;l=void 0===e.value.color?i.config.chart.foreColor:e.value.color;let p=e.value.formatter,x="",b="";if(o?(r=e.total.color,c=e.total.fontSize,d=e.total.fontFamily,g=e.total.fontWeight,b=this.donutDataLabels.total.label?e.total.label:"",x=e.total.formatter(i)):1===i.globals.series.length&&(x=p(i.globals.series[0],i),b=i.globals.seriesNames[0]),b&&(b=e.name.formatter(b,e.total.show,i)),e.name.show){let s=a.drawText({x:n,y:h+parseFloat(e.name.offsetY),text:b,textAnchor:"middle",foreColor:r,fontSize:c,fontWeight:g,fontFamily:d});s.node.classList.add("apexcharts-datalabel-label"),t.add(s)}if(e.value.show){let s=e.name.show?parseFloat(e.value.offsetY)+16:e.value.offsetY,i=a.drawText({x:n,y:h+s,text:x,textAnchor:"middle",foreColor:l,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 o;i?o=void 0===t.name.color?a.globals.colors[parseInt(i.parentNode.getAttribute("rel"),10)-1]:t.name.color:a.globals.series.length>1&&t.total.show&&(o=t.total.color);let r=a.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"),l=a.globals.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 n=e===t.total.label;e=this.donutDataLabels.total.label?t.name.formatter(e,n,a):"",null!==r&&(r.textContent=e),null!==l&&(l.textContent=s),null!==r&&(r.style.fill=o)}printDataLabelsInner(t,e){let s=this.w,i=t.getAttribute("data:value"),a=s.globals.seriesNames[parseInt(t.parentNode.getAttribute("rel"),10)-1];s.globals.series.length>1&&this.printInnerLabels(e,a,i,t);let o=s.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group");null!==o&&(o.style.opacity=1)}drawSpokes(t){const e=this.w,s=new w(this.ctx),i=e.config.plotOptions.polarArea.spokes;if(0===i.strokeWidth)return;let a=[],o=360/e.globals.series.length;for(let t=0;t<e.globals.series.length;t++)a.push(u.polarToCartesian(this.centerX,this.centerY,e.globals.radialSize,e.config.plotOptions.pie.startAngle+o*t));a.forEach((e,a)=>{const o=s.drawLine(e.x,e.y,this.centerX,this.centerY,Array.isArray(i.connectorColors)?i.connectorColors[a]:i.connectorColors);t.add(o)})}revertDataLabelsInner(){const t=this.w;if(this.donutDataLabels.show){let e=t.globals.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.globals.dom.Paper.findOne(".apexcharts-radialbar, .apexcharts-pie").add(s)}}}class ge{constructor(t){this.ctx=t,this.w=t.w,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;const e=this.w;this.graphics=new w(this.ctx),this.lineColorArr=void 0!==e.globals.stroke.colors?e.globals.stroke.colors:e.globals.colors,this.defaultSize=e.globals.svgHeight<e.globals.svgWidth?e.globals.gridHeight:e.globals.gridWidth,this.isLog=e.config.yaxis[0].logarithmic,this.logBase=e.config.yaxis[0].logBase,this.coreUtils=new v(this.ctx),this.maxValue=this.isLog?this.coreUtils.getLogVal(this.logBase,e.globals.maxY,0):e.globals.maxY,this.minValue=this.isLog?this.coreUtils.getLogVal(this.logBase,this.w.globals.minY,0):e.globals.minY,this.polygons=e.config.plotOptions.radar.polygons,this.strokeWidth=e.config.stroke.show?e.config.stroke.width:0,this.size=this.defaultSize/2.1-this.strokeWidth-e.config.chart.dropShadow.blur,e.config.xaxis.labels.show&&(this.size=this.size-e.globals.xAxisLabelsWidth/1.75),void 0!==e.config.plotOptions.radar.size&&(this.size=e.config.plotOptions.radar.size),this.dataRadiusOfPercent=[],this.dataRadius=[],this.angleArr=[],this.yaxisLabelsTextsPos=[]}draw(t){let e=this.w;const s=new D(this.ctx),i=[],a=new N(this.ctx);t.length&&(this.dataPointsLen=t[e.globals.maxValsInArrayIndex].length),this.disAngle=2*Math.PI/this.dataPointsLen;let o=e.globals.gridWidth/2,r=e.globals.gridHeight/2,h=o+e.config.plotOptions.radar.offsetX,c=r+e.config.plotOptions.radar.offsetY,d=this.graphics.group({class:"apexcharts-radar-series apexcharts-plot-series",transform:`translate(${h||0}, ${c||0})`}),g=[],p=null,x=null;if(this.yaxisLabels=this.graphics.group({class:"apexcharts-yaxis"}),t.forEach((t,o)=>{let r=t.length===e.globals.dataPoints,h=this.graphics.group().attr({class:"apexcharts-series","data:longestSeries":r,seriesName:u.escapeString(e.globals.seriesNames[o]),rel:o+1,"data:realIndex":o});this.dataRadiusOfPercent[o]=[],this.dataRadius[o]=[],this.angleArr[o]=[],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[o][e]=t/s,this.dataRadius[o][e]=this.dataRadiusOfPercent[o][e]*this.size,this.angleArr[o][e]=e*this.disAngle}),g=this.getDataPointsPos(this.dataRadius[o],this.angleArr[o]);const c=this.createPaths(g,{x:0,y:0});p=this.graphics.group({class:"apexcharts-series-markers-wrap apexcharts-element-hidden"}),x=this.graphics.group({class:"apexcharts-datalabels","data:realIndex":o}),e.globals.delayedElements.push({el:p.node,index:o});const d={i:o,realIndex:o,animationDelay:o,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[o],strokeLineCap:e.config.stroke.lineCap};let b=null;e.globals.previousPaths.length>0&&(b=this.getPreviousPath(o));for(let t=0;t<c.linePathsTo.length;t++){let i=this.graphics.renderPaths(n(l({},d),{pathFrom:null===b?c.linePathsFrom[t]:b,pathTo:c.linePathsTo[t],strokeWidth:Array.isArray(this.strokeWidth)?this.strokeWidth[o]:this.strokeWidth,fill:"none",drawShadow:!1}));h.add(i);let a=s.fillPath({seriesNumber:o}),r=this.graphics.renderPaths(n(l({},d),{pathFrom:null===b?c.areaPathsFrom[t]:b,pathTo:c.areaPathsTo[t],strokeWidth:0,fill:a,drawShadow:!1}));if(e.config.chart.dropShadow.enabled){const t=new y(this.ctx),s=e.config.chart.dropShadow;t.dropShadow(r,Object.assign({},s,{noUserSpaceOnUse:!0}),o)}h.add(r)}t.forEach((t,s)=>{let i=new O(this.ctx).getMarkerConfig({cssClass:"apexcharts-marker",seriesIndex:o,dataPointIndex:s}),r=this.graphics.drawMarker(g[s].x,g[s].y,i);r.attr("rel",s),r.attr("j",s),r.attr("index",o),r.node.setAttribute("default-marker-size",i.pSize);let n=this.graphics.group({class:"apexcharts-series-markers"});n&&n.add(r),p.add(n),h.add(p);const c=e.config.dataLabels;if(c.enabled){let t=c.formatter(e.globals.series[o][s],{seriesIndex:o,dataPointIndex:s,w:e});a.plotDataLabelsText({x:g[s].x,y:g[s].y,text:t,textAnchor:"middle",i:o,j:o,parent:x,offsetCorrection:!1,dataLabelsConfig:l({},c)})}h.add(x)}),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 ce(this.ctx),a=e.globals.yAxisScale[0].result.reverse(),o=a.length;let r=[],l=this.size/(o-1);for(let t=0;t<o;t++)r[t]=l*t;r.reverse();let n=[],h=[];r.forEach((t,e)=>{const s=u.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+" "}),n.push(i)}),n.forEach((t,i)=>{const a=this.polygons.strokeColors,o=this.polygons.strokeWidth,r=this.graphics.drawPolygon(t,Array.isArray(a)?a[i]:a,Array.isArray(o)?o[i]:o,e.globals.radarPolygons.fill.colors[i]);s.add(r)}),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;let s=this.graphics.group({class:"apexcharts-xaxis"}),i=u.getPolygonPos(this.size,this.dataPointsLen);return t.globals.labels.forEach((a,o)=>{let r=t.config.xaxis.labels.formatter,n=new N(this.ctx);if(i[o]){let h=this.getTextPos(i[o],this.size),c=r(a,{seriesIndex:-1,dataPointIndex:o,w:t});n.plotDataLabelsText({x:h.newX,y:h.newY,text:c,textAnchor:h.textAnchor,i:o,j:o,parent:s,className:"apexcharts-xaxis-label",color:Array.isArray(e.style.colors)&&e.style.colors[o]?e.style.colors[o]:"#a8a8a8",dataLabelsConfig:l({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:o});t.config.chart.events.xAxisLabelClick(e,this.ctx,s)}})}}),s}createPaths(t,e){let s=[],i=[],a=[],o=[];if(t.length){i=[this.graphics.move(e.x,e.y)],o=[this.graphics.move(e.x,e.y)];let r=this.graphics.move(t[0].x,t[0].y),l=this.graphics.move(t[0].x,t[0].y);t.forEach((e,s)=>{r+=this.graphics.line(e.x,e.y),l+=this.graphics.line(e.x,e.y),s===t.length-1&&(r+="Z",l+="Z")}),s.push(r),a.push(l)}return{linePathsFrom:i,linePathsTo:s,areaPathsFrom:o,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){let e=this.w,s=null;for(let i=0;i<e.globals.previousPaths.length;i++){let a=e.globals.previousPaths[i];a.paths.length>0&&parseInt(a.realIndex,10)===parseInt(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||[];let i=[];for(let a=0;a<s;a++){let s={};s.x=t[a]*Math.sin(e[a]),s.y=-t[a]*Math.cos(e[a]),i.push(s)}return i}}class pe extends de{constructor(t){super(t),this.ctx=t,this.w=t.w,this.animBeginArr=[0],this.animDur=0;const e=this.w;this.startAngle=e.config.plotOptions.radialBar.startAngle,this.endAngle=e.config.plotOptions.radialBar.endAngle,this.totalAngle=Math.abs(e.config.plotOptions.radialBar.endAngle-e.config.plotOptions.radialBar.startAngle),this.trackStartAngle=e.config.plotOptions.radialBar.track.startAngle,this.trackEndAngle=e.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(e.config.plotOptions.radialBar.track.margin,10),this.onBarLabelClick=this.onBarLabelClick.bind(this)}draw(t){let e=this.w;const s=new w(this.ctx);let i=s.group({class:"apexcharts-radialbar"});if(e.globals.noData)return i;let a=s.group(),o=this.defaultSize/2,r=e.globals.gridWidth/2,l=this.defaultSize/2.05;e.config.chart.sparkline.enabled||(l=l-e.config.stroke.width-e.config.chart.dropShadow.blur);let n=e.globals.fill.colors;if(e.config.plotOptions.radialBar.track.show){let e=this.drawTracks({size:l,centerX:r,centerY:o,colorArr:n,series:t});a.add(e)}let h=this.drawArcs({size:l,centerX:r,centerY:o,colorArr:n,series:t}),c=360;e.config.plotOptions.radialBar.startAngle<0&&(c=this.totalAngle);let d=(360-c)/360;if(e.globals.radialSize=l-l*d,this.radialDataLabels.value.show){let t=Math.max(this.radialDataLabels.value.offsetY,this.radialDataLabels.name.offsetY);e.globals.radialSize+=t*d}return a.add(h.g),"front"===e.config.plotOptions.radialBar.hollow.position&&(h.g.add(h.elHollow),h.dataLabels&&h.g.add(h.dataLabels)),i.add(a),i}drawTracks(t){let e=this.w;const s=new w(this.ctx);let i=s.group({class:"apexcharts-tracks"}),a=new y(this.ctx),o=new D(this.ctx),r=this.getStrokeWidth(t);t.size=t.size-r/2;for(let l=0;l<t.series.length;l++){let n=s.group({class:"apexcharts-radialbar-track apexcharts-track"});i.add(n),n.attr({rel:l+1}),t.size=t.size-r-this.margin;const h=e.config.plotOptions.radialBar.track;let c=o.fillPath({seriesNumber:0,size:t.size,fillColors:Array.isArray(h.background)?h.background[l]:h.background,solid:!0}),d=this.trackStartAngle,g=this.trackEndAngle;Math.abs(g)+Math.abs(d)>=360&&(g=360-Math.abs(this.startAngle)-.1);let p=s.drawPath({d:"",stroke:c,strokeWidth:r*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)}n.add(p),p.attr("id","apexcharts-radialbarTrack-"+l),this.animatePaths(p,{centerX:t.centerX,centerY:t.centerY,endAngle:g,startAngle:d,size:t.size,i:l,totalItems:2,animBeginArr:0,dur:0,isTrack:!0})}return i}drawArcs(t){let e=this.w,s=new w(this.ctx),i=new D(this.ctx),a=new y(this.ctx),o=s.group(),r=this.getStrokeWidth(t);t.size=t.size-r/2;let l=e.config.plotOptions.radialBar.hollow.background,n=t.size-r*t.series.length-this.margin*t.series.length-r*parseInt(e.config.plotOptions.radialBar.track.strokeWidth,10)/100/2,h=n-e.config.plotOptions.radialBar.hollow.margin;void 0!==e.config.plotOptions.radialBar.hollow.image&&(l=this.drawHollowImage(t,o,n,l));let c=this.drawHollow({size:h,centerX:t.centerX,centerY:t.centerY,fill:l||"transparent"});if(e.config.plotOptions.radialBar.hollow.dropShadow.enabled){const t=e.config.plotOptions.radialBar.hollow.dropShadow;a.dropShadow(c,t)}let d=1;!this.radialDataLabels.total.show&&e.globals.series.length>1&&(d=0);let g=null;if(this.radialDataLabels.show){let s=e.globals.dom.Paper.findOne(".apexcharts-datalabels-group");g=this.renderInnerDataLabels(s,this.radialDataLabels,{hollowSize:n,centerX:t.centerX,centerY:t.centerY,opacity:d})}"back"===e.config.plotOptions.radialBar.hollow.position&&(o.add(c),g&&o.add(g));let p=!1;e.config.plotOptions.radialBar.inverseOrder&&(p=!0);for(let l=p?t.series.length-1:0;p?l>=0:l<t.series.length;p?l--:l++){let n=s.group({class:"apexcharts-series apexcharts-radial-series",seriesName:u.escapeString(e.globals.seriesNames[l])});o.add(n),n.attr({rel:l+1,"data:realIndex":l}),this.ctx.series.addCollapsedClassToSeries(n,l),t.size=t.size-r-this.margin;let h,c=i.fillPath({seriesNumber:l,size:t.size,value:t.series[l]}),d=this.startAngle;const g=u.negToZero(t.series[l]>100?100:t.series[l])/100;let p,x=Math.round(this.totalAngle*g)+this.startAngle;e.globals.dataChanged&&(h=this.startAngle,p=Math.round(this.totalAngle*u.negToZero(e.globals.previousPaths[l])/100)+h);Math.abs(x)+Math.abs(d)>360&&(x-=.01);Math.abs(p)+Math.abs(h)>360&&(p-=.01);let b=x-d;const f=Array.isArray(e.config.stroke.dashArray)?e.config.stroke.dashArray[l]:e.config.stroke.dashArray;let m=s.drawPath({d:"",stroke:c,strokeWidth:r,fill:"none",fillOpacity:e.config.fill.opacity,classes:"apexcharts-radialbar-area apexcharts-radialbar-slice-"+l,strokeDashArray:f});if(w.setAttrs(m.node,{"data:angle":b,"data:value":t.series[l]}),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;a.dropShadow(m,t,l)}if(a.setSelectionFilter(m,0,l),this.addListeners(m,this.radialDataLabels),n.add(m),m.attr({index:0,j:l}),this.barLabels.enabled){let i=u.polarToCartesian(t.centerX,t.centerY,t.size,d),a=this.barLabels.formatter(e.globals.seriesNames[l],{seriesIndex:l,w:e}),o=["apexcharts-radialbar-label"];this.barLabels.onClick||o.push("apexcharts-no-click");let r=this.barLabels.useSeriesColors?e.globals.colors[l]:e.config.chart.foreColor;r||(r=e.config.chart.foreColor);const h=i.x+this.barLabels.offsetX,c=i.y+this.barLabels.offsetY;let g=s.drawText({x:h,y:c,text:a,textAnchor:"end",dominantBaseline:"middle",fontFamily:this.barLabels.fontFamily,fontWeight:this.barLabels.fontWeight,fontSize:this.barLabels.fontSize,foreColor:r,cssClass:o.join(" ")});g.on("click",this.onBarLabelClick),g.attr({rel:l+1}),0!==d&&g.attr({"transform-origin":`${h} ${c}`,transform:`rotate(${d} 0 0)`}),n.add(g)}let y=0;!this.initialAnim||e.globals.resized||e.globals.dataChanged||(y=e.config.chart.animations.speed),e.globals.dataChanged&&(y=e.config.chart.animations.dynamicAnimation.speed),this.animDur=y/(1.2*t.series.length)+this.animDur,this.animBeginArr.push(this.animDur),this.animatePaths(m,{centerX:t.centerX,centerY:t.centerY,endAngle:x,startAngle:d,prevEndAngle:p,prevStartAngle:h,size:t.size,i:l,totalItems:2,animBeginArr:this.animBeginArr,dur:y,shouldSetPrevPaths:!0})}return{g:o,elHollow:c,dataLabels:g}}drawHollow(t){let e=new w(this.ctx).drawCircle(2*t.size);return e.attr({class:"apexcharts-radialbar-hollow",cx:t.centerX,cy:t.centerY,r:t.size,fill:t.fill}),e}drawHollowImage(t,e,s,i){const a=this.w;let o=new D(this.ctx),r=u.randomId(),l=a.config.plotOptions.radialBar.hollow.image;if(a.config.plotOptions.radialBar.hollow.imageClipped)o.clippedImgArea({width:s,height:s,image:l,patternID:`pattern${a.globals.cuid}${r}`}),i=`url(#pattern${a.globals.cuid}${r})`;else{const s=a.config.plotOptions.radialBar.hollow.imageWidth,i=a.config.plotOptions.radialBar.hollow.imageHeight;if(void 0===s&&void 0===i){let s=a.globals.dom.Paper.image(l,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{let o=a.globals.dom.Paper.image(l,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(o)}}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){let e=parseInt(t.target.getAttribute("rel"),10)-1;const s=this.barLabels.onClick,i=this.w;s&&s(i.globals.seriesNames[e],{w:i,seriesIndex:e})}}class xe extends te{draw(t,e){let s=this.w,i=new w(this.ctx);this.rangeBarOptions=this.w.config.plotOptions.rangeBar,this.series=t,this.seriesRangeStart=s.globals.seriesRangeStart,this.seriesRangeEnd=s.globals.seriesRangeEnd,this.barHelpers.initVariables(t);let a=i.group({class:"apexcharts-rangebar-series apexcharts-plot-series"});for(let o=0;o<t.length;o++){let r,n,h,c,d,g,p=s.globals.comboCharts?e[o]:o,{columnGroupIndex:x}=this.barHelpers.getGroupIndex(p),b=i.group({class:"apexcharts-series",seriesName:u.escapeString(s.globals.seriesNames[p]),rel:o+1,"data:realIndex":p});this.ctx.series.addCollapsedClassToSeries(b,p),t[o].length>0&&(this.visibleI=this.visibleI+1);let f=0,m=0,y=0;this.yRatio.length>1&&(this.yaxisIndex=s.globals.seriesYAxisReverseMap[p][0],y=p);let w=this.barHelpers.initialPositions(p);n=w.y,g=w.zeroW,r=w.x,m=w.barWidth,f=w.barHeight,h=w.xDivision,c=w.yDivision,d=w.zeroH;let v=i.group({class:"apexcharts-datalabels","data:realIndex":p}),A=i.group({class:"apexcharts-rangebar-goals-markers"});for(let e=0;e<s.globals.dataPoints;e++){const i=this.barHelpers.getStrokeWidth(o,e,p),a=this.seriesRangeStart[o][e],u=this.seriesRangeEnd[o][e];let C=null,S=null,k=null;const L={x:r,y:n,strokeWidth:i,elSeries:b};let M=this.seriesLen;if(s.config.plotOptions.bar.rangeBarGroupRows&&(M=1),void 0===s.config.series[o].data[e])break;if(this.isHorizontal){k=n+f*this.visibleI;let t=(c-f*M)/2;if(s.config.series[o].data[e].x){let s=this.detectOverlappingBars({i:o,j:e,barYPosition:k,srty:t,barHeight:f,yDivision:c,initPositions:w});f=s.barHeight,k=s.barYPosition}C=this.drawRangeBarPaths(l({indexes:{i:o,j:e,realIndex:p},barHeight:f,barYPosition:k,zeroW:g,yDivision:c,y1:a,y2:u},L)),m=C.barWidth}else{s.globals.isXNumeric&&(r=(s.globals.seriesX[o][e]-s.globals.minX)/this.xRatio-m/2),S=r+m*this.visibleI;let t=(h-m*M)/2;if(s.config.series[o].data[e].x){let s=this.detectOverlappingBars({i:o,j:e,barXPosition:S,srtx:t,barWidth:m,xDivision:h,initPositions:w});m=s.barWidth,S=s.barXPosition}C=this.drawRangeColumnPaths(l({indexes:{i:o,j:e,realIndex:p,translationsIndex:y},barWidth:m,barXPosition:S,zeroH:d,xDivision:h},L)),f=C.barHeight}const P=this.barHelpers.drawGoalLine({barXPosition:C.barXPosition,barYPosition:k,goalX:C.goalX,goalY:C.goalY,barHeight:f,barWidth:m});P&&A.add(P),n=C.y,r=C.x;let I=this.barHelpers.getPathFillColor(t,o,e,p);this.renderSeries({realIndex:p,pathFill:I.color,lineFill:I.useRangeColor?I.color:s.globals.stroke.colors[p],j:e,i:o,x:r,y:n,y1:a,y2:u,pathFrom:C.pathFrom,pathTo:C.pathTo,strokeWidth:i,elSeries:b,series:t,barHeight:f,barWidth:m,barXPosition:S,barYPosition:k,columnGroupIndex:x,elDataLabelsWrap:v,elGoalsMarkers:A,visibleSeries:this.visibleI,type:"rangebar"})}a.add(b)}return a}detectOverlappingBars({i:t,j:e,barYPosition:s,barXPosition:i,srty:a,srtx:o,barHeight:r,barWidth:l,yDivision:n,xDivision:h,initPositions:c}){const d=this.w;let g=[],p=d.config.series[t].data[e].rangeName;const x=d.config.series[t].data[e].x,b=Array.isArray(x)?x.join(" "):x,f=d.globals.labels.map(t=>Array.isArray(t)?t.join(" "):t).indexOf(b),u=d.globals.seriesRange[t].findIndex(t=>t.x===b&&t.overlaps.length>0);return this.isHorizontal?(s=d.config.plotOptions.bar.rangeBarGroupRows?a+n*f:a+r*this.visibleI+n*f,u>-1&&!d.config.plotOptions.bar.rangeBarOverlap&&(g=d.globals.seriesRange[t][u].overlaps,g.indexOf(p)>-1&&(s=(r=c.barHeight/g.length)*this.visibleI+n*(100-parseInt(this.barOptions.barHeight,10))/100/2+r*(this.visibleI+g.indexOf(p))+n*f))):(f>-1&&!d.globals.timescaleLabels.length&&(i=d.config.plotOptions.bar.rangeBarGroupRows?o+h*f:o+l*this.visibleI+h*f),u>-1&&!d.config.plotOptions.bar.rangeBarOverlap&&(g=d.globals.seriesRange[t][u].overlaps,g.indexOf(p)>-1&&(i=(l=c.barWidth/g.length)*this.visibleI+h*(100-parseInt(this.barOptions.barWidth,10))/100/2+l*(this.visibleI+g.indexOf(p))+h*f))),{barYPosition:s,barXPosition:i,barHeight:r,barWidth:l}}drawRangeColumnPaths({indexes:t,x:e,xDivision:s,barWidth:i,barXPosition:a,zeroH:o}){let r=this.w;const{i:l,j:n,realIndex:h,translationsIndex:c}=t,d=this.yRatio[c],g=this.getRangeValue(h,n);let p=Math.min(g.start,g.end),x=Math.max(g.start,g.end);void 0===this.series[l][n]||null===this.series[l][n]?p=o:(p=o-p/d,x=o-x/d);const b=Math.abs(x-p),f=this.barHelpers.getColumnPaths({barXPosition:a,barWidth:i,y1:p,y2:x,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,realIndex:h,i:h,j:n,w:r});if(r.globals.isXNumeric){const t=this.getBarXForNumericXAxis({x:e,j:n,realIndex:h,barWidth:i});e=t.x,a=t.barXPosition}else e+=s;return{pathTo:f.pathTo,pathFrom:f.pathFrom,barHeight:b,x:e,y:g.start<0&&g.end<0?p:x,goalY:this.barHelpers.getGoalValues("y",null,o,l,n,c),barXPosition:a}}preventBarOverflow(t){const e=this.w;return t<0&&(t=0),t>e.globals.gridWidth&&(t=e.globals.gridWidth),t}drawRangeBarPaths({indexes:t,y:e,y1:s,y2:i,yDivision:a,barHeight:o,barYPosition:r,zeroW:l}){let n=this.w;const{realIndex:h,j:c}=t;let d=this.preventBarOverflow(l+s/this.invertedYRatio),g=this.preventBarOverflow(l+i/this.invertedYRatio);const p=this.getRangeValue(h,c),x=Math.abs(g-d),b=this.barHelpers.getBarpaths({barYPosition:r,barHeight:o,x1:d,x2:g,strokeWidth:this.strokeWidth,series:this.seriesRangeEnd,i:h,realIndex:h,j:c,w:n});return n.globals.isXNumeric||(e+=a),{pathTo:b.pathTo,pathFrom:b.pathFrom,barWidth:x,x:p.start<0&&p.end<0?d:g,goalX:this.barHelpers.getGoalValues("x",l,null,h,c),y:e}}getRangeValue(t,e){const s=this.w;return{start:s.globals.seriesRangeStart[t][e],end:s.globals.seriesRangeEnd[t][e]}}}function be(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 fe(t,e,s,i){const a=i*i,o=s*s;return Math.max(a*e/o,o/(a*t))}function ue(t,e,s,i,a,o){if(0===t)return!0;return fe(e,s,i,o)>=fe(Math.min(e,a),Math.max(s,a),i+a,o)}function me(t,e,s,i,a,o,r,l){if(r>=l){const r=i/l;let n=o;for(let i=0;i<s;i++){const s=e[i]/r;t.push([a,n,a+r,n+s]),n+=s}}else{const l=i/r;let n=a;for(let i=0;i<s;i++){const s=e[i]/l;t.push([n,o,n+s,o+l]),n+=s}}}function ye(t,e,s,i,a){const o=[],r=t.length;if(0===r)return o;const l=new Array(r);let n=0,h=0,c=1/0,d=-1/0,g=0;for(;g<r;){const r=Math.min(i,a),p=t[g];if(ue(n,c,d,h,p,r))l[n]=p,n++,h+=p,p<c&&(c=p),p>d&&(d=p),g++;else{if(me(o,l,n,h,e,s,i,a),i>=a){const t=h/a;e+=t,i-=t}else{const t=h/i;s+=t,a-=t}n=0,h=0,c=1/0,d=-1/0}}return n>0&&me(o,l,n,h,e,s,i,a),o}const we={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 o=ye(be(a,e*s),0,0,e,s),r=new Array(i);for(let e=0;e<i;e++){const s=o[e],i=s[0],a=s[1],l=s[2]-i,n=s[3]-a;r[e]=ye(be(t[e],l*n),i,a,l,n)}return r}};class ve{constructor(t){this.ctx=t,this.w=t.w,this.strokeWidth=this.w.config.stroke.width,this.helpers=new ie(t),this.dynamicAnim=this.w.config.chart.animations.dynamicAnimation,this.labels=[]}draw(t){let e=this.w;const s=new w(this.ctx),i=new D(this.ctx);let a=s.group({class:"apexcharts-treemap"});if(e.globals.noData)return a;let o=[];t.forEach(t=>{let e=t.map(t=>Math.abs(t));o.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 we.generate(o,e.globals.gridWidth,e.globals.gridHeight).forEach((o,r)=>{let l=s.group({class:"apexcharts-series apexcharts-treemap-series",seriesName:u.escapeString(e.globals.seriesNames[r]),rel:r+1,"data:realIndex":r});if(s.setupEventDelegation(l,".apexcharts-treemap-rect"),e.config.chart.dropShadow.enabled){const t=e.config.chart.dropShadow;new y(this.ctx).dropShadow(a,t,r)}let n=s.group({class:"apexcharts-data-labels"}),h={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0};o.forEach((a,o)=>{const n=a[0],c=a[1],d=a[2],g=a[3];h.xMin=Math.min(h.xMin,n),h.yMin=Math.min(h.yMin,c),h.xMax=Math.max(h.xMax,d),h.yMax=Math.max(h.yMax,g);let p=this.helpers.getShadeColor(e.config.chart.type,r,o,this.negRange),x=p.color,b=i.fillPath({color:x,seriesNumber:r,dataPointIndex:o}),f=s.drawRect(n,c,d-n,g-c,e.config.plotOptions.treemap.borderRadius,"#fff",1,this.strokeWidth,e.config.plotOptions.treemap.useFillColorAsStroke?x:e.globals.stroke.colors[r]);f.attr({cx:n,cy:c,index:r,i:r,j:o,width:d-n,height:g-c,fill:b}),f.node.classList.add("apexcharts-treemap-rect");let u={x:n+(d-n)/2,y:c+(g-c)/2,width:0,height:0},m={x:n,y:c,width:d-n,height:g-c};if(e.config.chart.animations.enabled&&!e.globals.dataChanged){let t=1;e.globals.resized||(t=e.config.chart.animations.speed),this.animateTreemap(f,u,m,t)}if(e.globals.dataChanged){let t=1;this.dynamicAnim.enabled&&e.globals.shouldAnimate&&(t=this.dynamicAnim.speed,e.globals.previousPaths[r]&&e.globals.previousPaths[r][o]&&e.globals.previousPaths[r][o].rect&&(u=e.globals.previousPaths[r][o].rect),this.animateTreemap(f,u,m,t))}let y=this.getFontSize(a),w=e.config.dataLabels.formatter(this.labels[r][o],{value:e.globals.series[r][o],seriesIndex:r,dataPointIndex:o,w:e});"truncate"===e.config.plotOptions.treemap.dataLabels.format&&(y=parseInt(e.config.dataLabels.style.fontSize,10),w=this.truncateLabels(w,y,n,c,d,g));let v=null;e.globals.series[r][o]&&(v=this.helpers.calculateDataLabels({text:w,x:(n+d)/2,y:(c+g)/2+this.strokeWidth/2+y/3,i:r,j:o,colorProps:p,fontSize:y,series:t})),e.config.dataLabels.enabled&&v&&this.rotateToFitLabel(v,y,w,n,c,d,g),l.add(f),null!==v&&l.add(v)});const c=e.config.plotOptions.treemap.seriesTitle;if(e.config.series.length>1&&c&&c.show){const t=e.config.series[r].name||"";if(t&&h.xMin<1/0&&h.yMin<1/0){const{offsetX:i,offsetY:a,borderColor:o,borderWidth:r,borderRadius:n,style:d}=c,g=d.color||e.config.chart.foreColor,p={left:d.padding.left,right:d.padding.right,top:d.padding.top,bottom:d.padding.bottom},x=s.getTextRects(t,d.fontSize,d.fontFamily),b=x.width+p.left+p.right,f=x.height+p.top+p.bottom,u=h.xMin+(i||0),m=h.yMin+(a||0),y=s.drawRect(u,m,b,f,n,d.background,1,r,o),w=s.drawText({x:u+p.left,y:m+p.top+.75*x.height,text:t,fontSize:d.fontSize,fontFamily:d.fontFamily,fontWeight:d.fontWeight,foreColor:g,cssClass:d.cssClass||""});l.add(y),l.add(w)}}l.add(n),a.add(l)}),a}getFontSize(t){const e=this.w;let 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){let a=t*i,o=Math.pow(a,.5);return Math.min(o/s,parseInt(e.config.dataLabels.style.fontSize,10))}(t[2]-t[0],t[3]-t[1])}rotateToFitLabel(t,e,s,i,a,o,r){const l=new w(this.ctx),n=l.getTextRects(s,e);if(n.width+this.w.config.stroke.width+5>o-i&&n.width<=r-a){let e=l.rotateAroundCenter(t.node);t.node.setAttribute("transform",`rotate(-90 ${e.x} ${e.y}) translate(${n.height/3})`)}}truncateLabels(t,e,s,i,a,o){const r=new w(this.ctx),l=r.getTextRects(t,e).width+this.w.config.stroke.width+5>a-s&&o-i>a-s?o-i:a-s,n=r.getTextBasedOnMaxWidth({text:t,maxWidth:l,fontSize:e});return t.length!==n.length&&l/e<5?"":n}animateTreemap(t,e,s,i){const a=new m(this.ctx);a.animateRect(t,e,s,i,()=>{a.animationCompleted(t)})}}class Ae{constructor(t,e){this.ctx=e,this.w=e.w,this.el=t}setupElements(){const{globals:t,config:e}=this.w,s=e.chart.type;t.axisCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble","radar","heatmap","treemap"].includes(s),t.xyCharts=["line","area","bar","rangeBar","rangeArea","candlestick","boxPlot","scatter","bubble"].includes(s),t.isBarHorizontal=["bar","rangeBar","boxPlot"].includes(s)&&e.plotOptions.bar.horizontal,t.chartClass=`.apexcharts${t.chartID}`,t.dom.baseEl=this.el,t.dom.elWrap=f.createElementNS("http://www.w3.org/1999/xhtml","div"),w.setAttrs(t.dom.elWrap,{id:t.chartClass.substring(1),class:`apexcharts-canvas ${t.chartClass.substring(1)}`}),this.el.appendChild(t.dom.elWrap);const i=h.isBrowser()?window.SVG:global.SVG;if(t.dom.Paper=i().addTo(t.dom.elWrap),t.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:`translate(${e.chart.offsetX}, ${e.chart.offsetY})`}),t.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(),t.dom.elLegendForeign=document.createElementNS(t.SVGNS,"foreignObject"),w.setAttrs(t.dom.elLegendForeign,{x:0,y:0,width:t.svgWidth,height:t.svgHeight}),t.dom.elLegendWrap=document.createElement("div"),t.dom.elLegendWrap.classList.add("apexcharts-legend"),t.dom.elWrap.appendChild(t.dom.elLegendWrap),t.dom.Paper.node.appendChild(t.dom.elLegendForeign),e.chart.accessibility.enabled){const s=this.getAccessibleChartLabel();t.dom.Paper.attr({role:"img","aria-label":s});const i=document.createElementNS(t.SVGNS,"title");if(i.textContent=e.title.text||"Chart",t.dom.Paper.node.insertBefore(i,t.dom.elLegendForeign.nextSibling),e.chart.accessibility.description){const s=document.createElementNS(t.SVGNS,"desc");s.textContent=e.chart.accessibility.description,t.dom.Paper.node.insertBefore(s,i.nextSibling)}}t.dom.elGraphical=t.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),t.dom.elDefs=t.dom.Paper.defs(),t.dom.Paper.add(t.dom.elGraphical),t.dom.elGraphical.add(t.dom.elDefs)}plotChartType(t,e){const{w:s,ctx:i}=this,{config:a,globals:o}=s,r={line:{series:[],i:[]},area:{series:[],i:[]},scatter:{series:[],i:[]},bubble:{series:[],i:[]},bar:{series:[],i:[]},candlestick:{series:[],i:[]},boxPlot:{series:[],i:[]},rangeBar:{series:[],i:[]},rangeArea:{series:[],seriesRangeEnd:[],i:[]}},l=a.chart.type||"line";let n=null,h=0;o.series.forEach((e,i)=>{var a,c;const d="column"===(null==(a=t[i])?void 0:a.type)?"bar":(null==(c=t[i])?void 0:c.type)||("column"===l?"bar":l);r[d]?("rangeArea"===d?(r[d].series.push(o.seriesRangeStart[i]),r[d].seriesRangeEnd.push(o.seriesRangeEnd[i])):r[d].series.push(e),r[d].i.push(i),"bar"===d&&(s.globals.columnSeries=r.bar)):["heatmap","treemap","pie","donut","polarArea","radialBar","radar"].includes(d)&&(n=d),l!==d&&"scatter"!==d&&h++}),h>0&&r.bar.series.length>0&&a.plotOptions.bar.horizontal&&(h-=r.bar.series.length,r.bar={series:[],i:[]},s.globals.columnSeries={series:[],i:[]}),o.comboCharts||(o.comboCharts=h>0);const c=new he(i,e),d=new se(i,e);i.pie=new de(i);const g=new pe(i);i.rangeBar=new xe(i,e);const p=new ge(i);let x=[];if(o.comboCharts){const t=new v(i);if(r.area.series.length>0&&x.push(...t.drawSeriesByGroup(r.area,o.areaGroups,"area",c)),r.bar.series.length>0)if(a.chart.stacked){const t=new ee(i,e);x.push(t.draw(r.bar.series,r.bar.i))}else i.bar=new te(i,e),x.push(i.bar.draw(r.bar.series,r.bar.i));if(r.rangeArea.series.length>0&&x.push(c.draw(r.rangeArea.series,"rangeArea",r.rangeArea.i,r.rangeArea.seriesRangeEnd)),r.line.series.length>0&&x.push(...t.drawSeriesByGroup(r.line,o.lineGroups,"line",c)),r.candlestick.series.length>0&&x.push(d.draw(r.candlestick.series,"candlestick",r.candlestick.i)),r.boxPlot.series.length>0&&x.push(d.draw(r.boxPlot.series,"boxPlot",r.boxPlot.i)),r.rangeBar.series.length>0&&x.push(i.rangeBar.draw(r.rangeBar.series,r.rangeBar.i)),r.scatter.series.length>0){const t=new he(i,e,!0);x.push(t.draw(r.scatter.series,"scatter",r.scatter.i))}if(r.bubble.series.length>0){const t=new he(i,e,!0);x.push(t.draw(r.bubble.series,"bubble",r.bubble.i))}}else switch(a.chart.type){case"line":x=c.draw(o.series,"line");break;case"area":x=c.draw(o.series,"area");break;case"bar":if(a.chart.stacked){x=new ee(i,e).draw(o.series)}else i.bar=new te(i,e),x=i.bar.draw(o.series);break;case"candlestick":x=new se(i,e).draw(o.series,"candlestick");break;case"boxPlot":x=new se(i,e).draw(o.series,a.chart.type);break;case"rangeBar":x=i.rangeBar.draw(o.series);break;case"rangeArea":x=c.draw(o.seriesRangeStart,"rangeArea",void 0,o.seriesRangeEnd);break;case"heatmap":x=new ae(i,e).draw(o.series);break;case"treemap":x=new ve(i).draw(o.series);break;case"pie":case"donut":case"polarArea":x=i.pie.draw(o.series);break;case"radialBar":x=g.draw(o.series);break;case"radar":x=p.draw(o.series);break;default:x=c.draw(o.series)}return x}setSVGDimensions(){const{globals:t,config:e}=this.w;e.chart.width=e.chart.width||"100%",e.chart.height=e.chart.height||"auto",t.svgWidth=e.chart.width,t.svgHeight=e.chart.height;let s=u.getDimensions(this.el);const i=e.chart.width.toString().split(/[0-9]+/g).pop();"%"===i?u.isNumber(s[0])&&(0===s[0].width&&(s=u.getDimensions(this.el.parentNode)),t.svgWidth=s[0]*parseInt(e.chart.width,10)/100):"px"!==i&&""!==i||(t.svgWidth=parseInt(e.chart.width,10));const a=String(e.chart.height).toString().split(/[0-9]+/g).pop();if("auto"!==t.svgHeight&&""!==t.svgHeight)if("%"===a){const s=u.getDimensions(this.el.parentNode);t.svgHeight=s[1]*parseInt(e.chart.height,10)/100}else t.svgHeight=parseInt(e.chart.height,10);else t.svgHeight=t.axisCharts?t.svgWidth/1.61:t.svgWidth/1.2;if(t.svgWidth=Math.max(t.svgWidth,0),t.svgHeight=Math.max(t.svgHeight,0),w.setAttrs(t.dom.Paper.node,{width:t.svgWidth,height:t.svgHeight}),"%"!==a){const s=e.chart.sparkline.enabled?0:t.axisCharts?e.chart.parentHeightOffset:0;t.dom.Paper.node.parentNode.parentNode.style.minHeight=`${t.svgHeight+s}px`}t.dom.elWrap.style.width=`${t.svgWidth}px`,t.dom.elWrap.style.height=`${t.svgHeight}px`}shiftGraphPosition(){const{globals:t}=this.w,{translateY:e,translateX:s}=t;w.setAttrs(t.dom.elGraphical.node,{transform:`translate(${s}, ${e})`})}resizeNonAxisCharts(){const{w:t}=this,{globals:e}=t;let s=0,i=t.config.chart.sparkline.enabled?1:15;i+=t.config.grid.padding.bottom,["top","bottom"].includes(t.config.legend.position)&&t.config.legend.show&&!t.config.legend.floating&&(s=new ct(this.ctx).legendHelpers.getLegendDimensions().clwh+7);const a=t.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie");let o=2.05*t.globals.radialSize;if(a&&!t.config.chart.sparkline.enabled&&0!==t.config.plotOptions.radialBar.startAngle){const e=u.getBoundingClientRect(a);o=e.bottom;const s=e.bottom-e.top;o=Math.max(2.05*t.globals.radialSize,s)}const r=Math.ceil(o+e.translateY+s+i);e.dom.elLegendForeign&&e.dom.elLegendForeign.setAttribute("height",r),t.config.chart.height&&String(t.config.chart.height).includes("%")||(e.dom.elWrap.style.height=`${r}px`,w.setAttrs(e.dom.Paper.node,{height:r}),e.dom.Paper.node.parentNode.parentNode.style.minHeight=`${r}px`)}coreCalculations(){new q(this.ctx).init()}resetGlobals(){const t=()=>this.w.config.series.map(()=>[]),e=new F,{globals:s}=this.w,i={dataWasParsed:s.dataWasParsed,originalSeries:s.originalSeries};e.initGlobalVars(s),s.seriesXvalues=t(),s.seriesYvalues=t(),i.dataWasParsed&&(s.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 tt(this.ctx).drawXCrosshairs(),"back"===t.config.yaxis[0].crosshairs.position&&new tt(this.ctx).drawYCrosshairs(),"datetime"===t.config.xaxis.type&&void 0===t.config.xaxis.labels.formatter){this.ctx.timeScale=new Jt(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 v(this.ctx).getCalculatedRatios()}return e}updateSourceChart(t){this.ctx.w.globals.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;let s="";if(e.chart.accessibility&&e.chart.accessibility.description)s=e.chart.accessibility.description;else if(e.title.text){const t=e.chart.type;s=`${e.title.text}. ${t} chart`,e.subtitle.text&&(s+=`. ${e.subtitle.text}`)}else{s=`${e.chart.type} chart with ${t.globals.series.length||(e.series?e.series.length:0)} data series`}return s}}class Ce{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],o=Date.now();if(a&&a.lastUpdate&&o-a.lastUpdate<i)return a.value;const r=s();return t.globals.dimensionCache[e]={value:r,lastUpdate:o},r}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 Se{constructor(t){this.ctx=t,this.w=t.w}_updateOptions(t,e=!1,s=!0,i=!0,a=!1){return new Promise(o=>{let r=[this.ctx];i&&(r=this.ctx.getSyncedCharts()),this.ctx.w.globals.isExecCalled&&(r=[this.ctx],this.ctx.w.globals.isExecCalled=!1),r.forEach((i,l)=>{let n=i.w;if(n.globals.shouldAnimate=s,e||(n.globals.resized=!0,n.globals.dataChanged=!0,s&&i.series.getPreviousPaths()),t&&"object"==typeof t&&(i.config=new R(t),t=v.extendArrayProps(i.config,t,n),i.w.globals.chartID!==this.ctx.w.globals.chartID&&delete t.series,n.config=u.extend(n.config,t),a&&(n.globals.lastXAxis=t.xaxis?u.clone(t.xaxis):[],n.globals.lastYAxis=t.yaxis?u.clone(t.yaxis):[],n.globals.initialConfig=u.extend({},n.config),n.globals.initialSeries=u.clone(n.config.series),t.series))){for(let t=0;t<n.globals.collapsedSeriesIndices.length;t++){let e=n.config.series[n.globals.collapsedSeriesIndices[t]];n.globals.collapsedSeries[t].data=n.globals.axisCharts?e.data.slice():e}for(let t=0;t<n.globals.ancillaryCollapsedSeriesIndices.length;t++){let e=n.config.series[n.globals.ancillaryCollapsedSeriesIndices[t]];n.globals.ancillaryCollapsedSeries[t].data=n.globals.axisCharts?e.data.slice():e}i.series.emptyCollapsedSeries(n.config.series)}return i.update(t).then(()=>{l===r.length-1&&o(i)})})})}_updateSeries(t,e,s=!1){return new Promise(i=>{const a=this.w;return a.globals.shouldAnimate=e,a.globals.dataChanged=!0,Ce.invalidateSelectors(a),e&&this.ctx.series.getPreviousPaths(),this.ctx.data.resetParsingFlags(),this.ctx.data.parseData(t),s&&(a.globals.initialConfig.series=u.clone(a.config.series),a.globals.initialSeries=u.clone(a.config.series)),this.ctx.update().then(()=>{i(this.ctx)})})}_extendSeries(t,e){const s=this.w,i=s.config.series[e];return n(l({},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.globals.dom.Paper.findOne(`${a} path[j='${e}'], ${a} circle[j='${e}'], ${a} rect[j='${e}']`):void 0===e&&(i=s.globals.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 w(this.ctx).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 Y(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),e.config.xaxis.min=s.min,e.config.xaxis.max=s.max;const a=t=>{void 0!==i[t]&&(e.config.yaxis[t].min=i[t].min,e.config.yaxis[t].max=i[t].max)};e.config.yaxis.map((t,s)=>{e.globals.zoomed||void 0!==i[s]?a(s):void 0!==this.ctx.opts.yaxis[s]&&(t.min=this.ctx.opts.yaxis[s].min,t.max=this.ctx.opts.yaxis[s].max)})}}h.isBrowser()?(void 0===window.SVG&&(window.SVG=Wt),void 0===window.Apex&&(window.Apex={})):"undefined"!=typeof global&&void 0===global.Apex&&(global.Apex={});class ke{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","paper","destroy"],this.ctx.eventList=["click","mousedown","mousemove","mouseleave","touchstart","touchmove","touchleave","mouseup","touchend","keydown","keyup"],this.ctx.animations=new m(this.ctx),this.ctx.axes=new Q(this.ctx),this.ctx.core=new Ae(this.ctx.el,this.ctx),this.ctx.config=new R({}),this.ctx.data=new $(this.ctx),this.ctx.grid=new j(this.ctx),this.ctx.graphics=new w(this.ctx),this.ctx.coreUtils=new v(this.ctx),this.ctx.crosshairs=new tt(this.ctx),this.ctx.events=new J(this.ctx),this.ctx.exports=new _(this.ctx),this.ctx.fill=new D(this.ctx),this.ctx.localization=new K(this.ctx),this.ctx.options=new T,this.ctx.responsive=new et(this.ctx),this.ctx.series=new G(this.ctx),this.ctx.theme=new st(this.ctx),this.ctx.formatters=new k(this.ctx),this.ctx.titleSubtitle=new it(this.ctx),this.ctx.legend=new ct(this.ctx),this.ctx.toolbar=new dt(this.ctx),this.ctx.tooltip=new Ut(this.ctx),this.ctx.dimensions=new nt(this.ctx),this.ctx.updateHelpers=new Se(this.ctx),this.ctx.zoomPanSelection=new Nt(this.ctx),this.ctx.w.globals.tooltip=new Ut(this.ctx)}}class Le{constructor(t){this.ctx=t,this.w=t.w}clear({isUpdating:t}){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),Ce.invalidateAll(this.w),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.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.globals.dom.Paper.node;e.parentNode&&e.parentNode.parentNode&&!t&&(e.parentNode.parentNode.style.minHeight="unset");const s=this.w.globals.dom.baseEl;s&&this.ctx.eventList.forEach(t=>{s.removeEventListener(t,this.ctx.events.documentEvent)});const i=this.w.globals.dom;if(null!==this.ctx.el)for(;this.ctx.el.firstChild;)this.ctx.el.removeChild(this.ctx.el.firstChild);this.killSVG(i.Paper),i.Paper.remove(),i.elWrap=null,i.elGraphical=null,i.elLegendWrap=null,i.elLegendForeign=null,i.baseEl=null,i.elGridRect=null,i.elGridRectMask=null,i.elGridRectBarMask=null,i.elGridRectMarkerMask=null,i.elForecastMask=null,i.elNonForecastMask=null,i.elDefs=null}}let Me=new WeakMap;class Pe{constructor(t,e){this.opts=e,this.ctx=this,this.w=new H(e).init(),this.el=t,this.w.globals.cuid=u.randomId(),this.w.globals.chartID=this.w.config.chart.id?u.escapeString(this.w.config.chart.id):this.w.globals.cuid;new ke(this).initModules(),this.lastUpdateOptions=null,this.create=u.bind(this.create,this),h.isBrowser()&&(this.windowResizeHandler=this._windowResizeHandler.bind(this),this.parentResizeHandler=this._parentResizeCallback.bind(this))}render(){return new Promise((t,e)=>{var s;if(u.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]),h.isBrowser()){window.addEventListener("resize",this.windowResizeHandler),function(t,e){if(h.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)}let 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),Me.set(e,i)}(this.el.parentNode,this.parentResizeHandler);let t=this.el.getRootNode&&this.el.getRootNode(),e=u.is("ShadowRoot",t),i=this.el.ownerDocument,a=e?t.getElementById("apexcharts-css"):i.getElementById("apexcharts-css");if(!a){a=f.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}\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.apexcharts-legend-text {\n padding-left: 15px;\n margin-left: -15px;\n}\n\n.apexcharts-legend-series[role="button"]:focus {\n outline: 2px solid #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 #008FFB;\n outline-offset: 2px;\n}\n\n.apexcharts-series-collapsed {\n opacity: 0\n}\n\n.apexcharts-tooltip {\n border-radius: 5px;\n box-shadow: 2px 2px 6px -4px #999;\n cursor: default;\n font-size: 14px;\n left: 62px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n top: 20px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n white-space: nowrap;\n z-index: 12;\n transition: .15s ease all\n}\n\n.apexcharts-tooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-tooltip.apexcharts-theme-light {\n border: 1px solid #e3e3e3;\n background: rgba(255, 255, 255, .96)\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark {\n color: #fff;\n background: rgba(30, 30, 30, .8)\n}\n\n.apexcharts-tooltip * {\n font-family: inherit\n}\n\n.apexcharts-tooltip-title {\n padding: 6px;\n font-size: 15px;\n margin-bottom: 4px\n}\n\n.apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title {\n background: #eceff1;\n border-bottom: 1px solid #ddd\n}\n\n.apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title {\n background: rgba(0, 0, 0, .7);\n border-bottom: 1px solid #333\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-block;\n position: relative;\n width: 16px;\n height: 16px;\n font-size: 16px;\n line-height: 16px;\n margin-right: 4px;\n text-align: center;\n vertical-align: middle;\n color: inherit;\n}\n\n.apexcharts-tooltip-marker::before {\n content: "";\n display: inline-block;\n width: 100%;\n text-align: center;\n color: currentcolor;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n font-size: 26px;\n font-family: Arial, Helvetica, sans-serif;\n line-height: 14px;\n font-weight: 900;\n}\n\n.apexcharts-tooltip-marker[shape="circle"]::before {\n content: "\\25CF";\n}\n\n.apexcharts-tooltip-marker[shape="square"]::before,\n.apexcharts-tooltip-marker[shape="rect"]::before {\n content: "\\25A0";\n transform: translate(-1px, -2px);\n}\n\n.apexcharts-tooltip-marker[shape="line"]::before {\n content: "\\2500";\n}\n\n.apexcharts-tooltip-marker[shape="diamond"]::before {\n content: "\\25C6";\n font-size: 28px;\n}\n\n.apexcharts-tooltip-marker[shape="triangle"]::before {\n content: "\\25B2";\n font-size: 22px;\n}\n\n.apexcharts-tooltip-marker[shape="cross"]::before {\n content: "\\2715";\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="plus"]::before {\n content: "\\2715";\n transform: rotate(45deg) translate(-1px, -1px);\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="star"]::before {\n content: "\\2605";\n font-size: 18px;\n}\n\n.apexcharts-tooltip-marker[shape="sparkle"]::before {\n content: "\\2726";\n font-size: 20px;\n}\n\n.apexcharts-tooltip-series-group {\n padding: 0 10px;\n display: none;\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,\n.apexcharts-tooltip-series-group:last-child {\n padding-bottom: 4px\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.apexcharts-xaxistooltip,\n.apexcharts-yaxistooltip {\n opacity: 0;\n pointer-events: none;\n color: #373d3f;\n font-size: 13px;\n text-align: center;\n border-radius: 2px;\n position: absolute;\n z-index: 10;\n background: #eceff1;\n border: 1px solid #90a4ae\n}\n\n.apexcharts-xaxistooltip {\n padding: 9px 10px;\n transition: .15s ease all\n}\n\n.apexcharts-xaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, .7);\n border: 1px solid rgba(0, 0, 0, .5);\n color: #fff\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.apexcharts-xaxistooltip:after {\n border-color: transparent;\n border-width: 6px;\n margin-left: -6px\n}\n\n.apexcharts-xaxistooltip:before {\n border-color: transparent;\n border-width: 7px;\n margin-left: -7px\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: #eceff1\n}\n\n.apexcharts-xaxistooltip-bottom:before {\n border-bottom-color: #90a4ae\n}\n\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:after,\n.apexcharts-xaxistooltip-bottom.apexcharts-theme-dark:before {\n border-bottom-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-xaxistooltip-top:after {\n border-top-color: #eceff1\n}\n\n.apexcharts-xaxistooltip-top:before {\n border-top-color: #90a4ae\n}\n\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:after,\n.apexcharts-xaxistooltip-top.apexcharts-theme-dark:before {\n border-top-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-xaxistooltip.apexcharts-active {\n opacity: 1;\n transition: .15s ease all\n}\n\n.apexcharts-yaxistooltip {\n padding: 4px 10px\n}\n\n.apexcharts-yaxistooltip.apexcharts-theme-dark {\n background: rgba(0, 0, 0, .7);\n border: 1px solid rgba(0, 0, 0, .5);\n color: #fff\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: 6px;\n margin-top: -6px\n}\n\n.apexcharts-yaxistooltip:before {\n border-color: transparent;\n border-width: 7px;\n margin-top: -7px\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: #eceff1\n}\n\n.apexcharts-yaxistooltip-left:before {\n border-left-color: #90a4ae\n}\n\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:after,\n.apexcharts-yaxistooltip-left.apexcharts-theme-dark:before {\n border-left-color: rgba(0, 0, 0, .5)\n}\n\n.apexcharts-yaxistooltip-right:after {\n border-right-color: #eceff1\n}\n\n.apexcharts-yaxistooltip-right:before {\n border-right-color: #90a4ae\n}\n\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:after,\n.apexcharts-yaxistooltip-right.apexcharts-theme-dark:before {\n border-right-color: rgba(0, 0, 0, .5)\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 width: 20px;\n height: 20px;\n line-height: 24px;\n color: #6e8192;\n text-align: center\n}\n\n.apexcharts-menu-icon svg,\n.apexcharts-reset-icon svg,\n.apexcharts-zoom-icon svg,\n.apexcharts-zoomin-icon svg,\n.apexcharts-zoomout-icon svg {\n fill: #6e8192\n}\n\n.apexcharts-selection-icon svg {\n fill: #444;\n transform: scale(.76)\n}\n\n.apexcharts-theme-dark .apexcharts-menu-icon svg,\n.apexcharts-theme-dark .apexcharts-pan-icon svg,\n.apexcharts-theme-dark .apexcharts-reset-icon svg,\n.apexcharts-theme-dark .apexcharts-selection-icon svg,\n.apexcharts-theme-dark .apexcharts-toolbar-custom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoom-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomin-icon svg,\n.apexcharts-theme-dark .apexcharts-zoomout-icon svg {\n fill: #f3f4f5\n}\n\n.apexcharts-canvas .apexcharts-reset-zoom-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-selection-icon.apexcharts-selected svg,\n.apexcharts-canvas .apexcharts-zoom-icon.apexcharts-selected svg {\n fill: #008ffb\n}\n\n.apexcharts-theme-light .apexcharts-menu-icon:hover svg,\n.apexcharts-theme-light .apexcharts-reset-icon:hover svg,\n.apexcharts-theme-light .apexcharts-selection-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoom-icon:not(.apexcharts-selected):hover svg,\n.apexcharts-theme-light .apexcharts-zoomin-icon:hover svg,\n.apexcharts-theme-light .apexcharts-zoomout-icon:hover svg {\n fill: #333\n}\n\n.apexcharts-menu-icon,\n.apexcharts-selection-icon {\n position: relative\n}\n\n.apexcharts-reset-icon {\n margin-left: 5px\n}\n\n.apexcharts-menu-icon,\n.apexcharts-reset-icon,\n.apexcharts-zoom-icon {\n transform: scale(.85)\n}\n\n.apexcharts-zoomin-icon,\n.apexcharts-zoomout-icon {\n transform: scale(.7)\n}\n\n.apexcharts-zoomout-icon {\n margin-right: 3px\n}\n\n.apexcharts-pan-icon {\n transform: scale(.62);\n position: relative;\n left: 1px;\n top: 0\n}\n\n.apexcharts-pan-icon svg {\n fill: #fff;\n stroke: #6e8192;\n stroke-width: 2\n}\n\n.apexcharts-pan-icon.apexcharts-selected svg {\n stroke: #008ffb\n}\n\n.apexcharts-pan-icon:not(.apexcharts-selected):hover svg {\n stroke: #333\n}\n\n.apexcharts-toolbar {\n position: absolute;\n z-index: 11;\n max-width: 176px;\n text-align: right;\n border-radius: 3px;\n padding: 0 6px 2px;\n display: flex;\n justify-content: space-between;\n align-items: center\n}\n\n.apexcharts-menu {\n background: #fff;\n position: absolute;\n top: 100%;\n border: 1px solid #ddd;\n border-radius: 3px;\n padding: 3px;\n right: 10px;\n opacity: 0;\n min-width: 110px;\n transition: .15s ease all;\n pointer-events: none\n}\n\n.apexcharts-menu.apexcharts-menu-open {\n opacity: 1;\n pointer-events: all;\n transition: .15s ease all\n}\n\n.apexcharts-menu-item {\n padding: 6px 7px;\n font-size: 12px;\n cursor: pointer\n}\n\n.apexcharts-theme-light .apexcharts-menu-item:hover {\n background: #eee\n}\n\n.apexcharts-theme-dark .apexcharts-menu {\n background: rgba(0, 0, 0, .7);\n color: #fff\n}\n\n@media screen and (min-width:768px) {\n .apexcharts-canvas:hover .apexcharts-toolbar {\n opacity: 1\n }\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 cursor: default;\n pointer-events: 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-disable-transitions * {\n transition: none !important;\n}';const o=(null==(s=this.opts.chart)?void 0:s.nonce)||this.w.config.chart.nonce;o&&a.setAttribute("nonce",o),e?t.prepend(a):!1!==this.w.config.chart.injectStyleSheet&&i.head.appendChild(a)}}let 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=>{e(t)})}else e(new Error("Element not found"))})}create(t,e){let s=this.w;new ke(this).initModules();let i=this.w.globals;if(i.noData=!1,i.animationEnded=!1,!u.elementExists(this.el))return i.animationEnded=!0,null;if(this.responsive.checkResponsiveConfig(e),s.config.xaxis.convertedCatToNumeric){new Y(s.config).convertCatToNumericXaxis(s.config,this.ctx)}if(this.core.setupElements(),"treemap"===s.config.chart.type&&(s.config.grid.show=!1,s.config.yaxis[0].show=!1),0===i.svgWidth)return i.animationEnded=!0,null;let a=t;t.forEach((t,e)=>{t.hidden&&(a=this.legend.legendHelpers.getSeriesAfterCollapsing({realIndex:e}))});const o=v.checkComboSeries(a,s.config.chart.type);i.comboCharts=o.comboCharts,i.comboBarCount=o.comboBarCount;const r=a.every(t=>t.data&&0===t.data.length);(0===a.length||r&&i.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(a),this.theme.init();new O(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),i.noData&&i.collapsedSeries.length!==i.series.length&&!s.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),i.axisCharts&&(this.core.coreCalculations(),"category"!==s.config.xaxis.type&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=s.globals.minX,this.ctx.toolbar.maxX=s.globals.maxX),this.formatters.heatmapLabelFormatters();new v(this).getLargestMarkerSize(),this.dimensions.plotCoords();const l=this.core.xySettings();this.grid.createGridMask();const n=this.core.plotChartType(a,l),h=new N(this);h.bringForward(),s.config.dataLabels.background.enabled&&h.dataLabelsBackground(),this.core.shiftGraphPosition(),s.globals.dataPoints>50&&s.globals.dom.elWrap.classList.add("apexcharts-disable-transitions");return{elGraph:n,xyRatios:l,dimensions:{plot:{left:s.globals.translateX,top:s.globals.translateY,width:s.globals.gridWidth,height:s.globals.gridHeight}}}}mount(t=null){let e=this,s=e.w;return new Promise((i,a)=>{var o,r;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 j(e);let l=e.grid.drawGrid();if(e.annotations=new X(e),e.annotations.drawImageAnnos(),e.annotations.drawTextAnnos(),"back"===s.config.grid.position&&(l&&s.globals.dom.elGraphical.add(l.el),(null==(o=null==l?void 0:l.elGridBorders)?void 0:o.node)&&s.globals.dom.elGraphical.add(l.elGridBorders)),Array.isArray(t.elGraph))for(let e=0;e<t.elGraph.length;e++)s.globals.dom.elGraphical.add(t.elGraph[e]);else s.globals.dom.elGraphical.add(t.elGraph);"front"===s.config.grid.position&&(l&&s.globals.dom.elGraphical.add(l.el),(null==(r=null==l?void 0:l.elGridBorders)?void 0:r.node)&&s.globals.dom.elGraphical.add(l.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,l);let n=new V(this.ctx,l),h=new Z(this.ctx,l);if(null!==l&&(n.xAxisLabelCorrections(l.xAxisTickWidth),h.setYAxisTextAlignments(),s.config.yaxis.map((t,e)=>{-1===s.globals.ignoreYAxisIndexes.indexOf(e)&&h.yAxisTitleRotate(e,t.opposite)})),e.annotations.drawAxesAnnotations(),!s.globals.noData){if(s.config.tooltip.enabled&&!s.globals.noData&&e.w.globals.tooltip.drawTooltip(t.xyRatios),s.globals.axisCharts&&(s.globals.isXNumeric||s.config.xaxis.convertedCatToNumeric||s.globals.isRangeBar))(s.config.chart.zoom.enabled||s.config.chart.selection&&s.config.chart.selection.enabled||s.config.chart.pan&&s.config.chart.pan.enabled)&&e.zoomPanSelection.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&&e.toolbar.createToolbar()}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(){h.isBrowser()&&(window.removeEventListener("resize",this.windowResizeHandler),function(t,e){if(h.isSSR())return;let s=Me.get(e);s&&(s.disconnect(),Me.delete(e))}(this.el.parentNode,this.parentResizeHandler));const t=this.w.config.chart.id;t&&Apex._chartInstances.forEach((e,s)=>{e.id===u.escapeString(t)&&Apex._chartInstances.splice(s,1)}),new Le(this.ctx).clear({isUpdating:!1})}updateOptions(t,e=!1,s=!0,i=!0,a=!0){const o=this.w;if(o.globals.selection=void 0,this.lastUpdateOptions){if(u.shallowEqual(this.lastUpdateOptions,t))return this;if(t.series&&this.lastUpdateOptions.series&&JSON.stringify(this.lastUpdateOptions.series)===JSON.stringify(t.series)){const e=l({},t),s=l({},this.lastUpdateOptions);if(delete e.series,delete s.series,u.shallowEqual(e,s))return 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)),o.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){let s=this;s.data.resetParsingFlags(),s.w.globals.dataChanged=!0,s.series.getPreviousPaths();let i=s.w.config.series.slice();for(let e=0;e<i.length;e++)if(null!==t[e]&&void 0!==t[e])for(let s=0;s<t[e].data.length;s++)i[e].data.push(t[e].data[s]);return s.w.config.series=i,e&&(s.w.globals.initialSeries=u.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=u.clone(t),new Le(this.ctx).clear({isUpdating:!0});const i=this.create(this.w.config.series,t);if(!i)return e(this);this.mount(i).then(()=>{"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)})})}getSyncedCharts(){const t=this.getGroupedCharts();let e=[this];return t.length&&(e=[],t.forEach(t=>{e.push(t)})),e}getGroupedCharts(){return Apex._chartInstances.filter(t=>{if(t.group)return!0}).map(t=>this.w.config.chart.group===t.group?t.chart:this)}static getChartByID(t){const e=u.escapeString(t);if(!Apex._chartInstances)return;const s=Apex._chartInstances.filter(t=>t.id===e)[0];return s&&s.chart}static initOnLoad(){const t=document.querySelectorAll("[data-apexcharts]");for(let e=0;e<t.length;e++){const s=t[e],i=JSON.parse(t[e].getAttribute("data-options"));new Pe(s,i).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 u.extend(t,e)}static getThemePalettes(){return{palette1:["#008FFB","#00E396","#FEB019","#FF4560","#775DD0"],palette2:["#3F51B5","#03A9F4","#4CAF50","#F9CE1D","#FF9800"],palette3:["#33B2DF","#546E7A","#D4526E","#13D8AA","#A5978B"],palette4:["#4ECDC4","#C7F464","#81D4FA","#FD6A6A","#546E7A"],palette5:["#2B908F","#F9A3A4","#90EE7E","#FA4443","#69D2E7"],palette6:["#449DD1","#F86624","#EA3546","#662E9B","#C5D86D"],palette7:["#D7263D","#1B998B","#2E294E","#F46036","#E2C044"],palette8:["#662E9B","#F86624","#F9C80E","#EA3546","#43BCCD"],palette9:["#5C4742","#A5978B","#8D5B4C","#5A2A27","#C4BBAF"],palette10:["#A300D6","#7D02EB","#5653FE","#2983FF","#00B1F2"]}}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){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){let i=this;s&&(i=s),i.annotations.addXaxisAnnotationExternal(t,e,i)}addYaxisAnnotation(t,e=!0,s=void 0){let i=this;s&&(i=s),i.annotations.addYaxisAnnotationExternal(t,e,i)}addPointAnnotation(t,e=!0,s=void 0){let i=this;s&&(i=s),i.annotations.addPointAnnotationExternal(t,e,i)}clearAnnotations(t=void 0){let e=this;t&&(e=t),e.annotations.clearAnnotations(e)}removeAnnotation(t,e=void 0){let s=this;e&&(s=e),s.annotations.removeAnnotation(s,t)}getChartArea(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}getSeriesTotalXRange(t,e){return this.coreUtils.getSeriesTotalsXRange(t,e)}getHighestValueInSeries(t=0){return new q(this.ctx).getMinYMaxY(t).highestY}getLowestValueInSeries(t=0){return new q(this.ctx).getMinYMaxY(t).lowestY}getSeriesTotal(){return this.w.globals.seriesTotals}toggleDataPointSelection(t,e){return this.updateHelpers.toggleDataPointSelection(t,e)}zoomX(t,e){this.ctx.toolbar.zoomUpdateOptions(t,e)}setLocale(t){this.localization.setCurrentLocaleValues(t)}dataURI(t){return new _(this.ctx).dataURI(t)}getSvgString(t){return new _(this.ctx).getSvgString(t)}exportToCSV(t={}){return new _(this.ctx).exportToCSV(t)}paper(){return this.w.globals.dom.Paper}_parentResizeCallback(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}_windowResize(){clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(()=>{this.w.globals.resized=!0,this.w.globals.dataChanged=!1,this.ctx.update()},150)}_windowResizeHandler(){let{redrawOnWindowResize:t}=this.w.config.chart;"function"==typeof t&&(t=t()),t&&this._windowResize()}}module.exports=Pe;