" } }]), t }(), D = function () { function t(e) { i(this, t), this.opts = e } return s(t, [{ key: "init", value: function (t) { var e = t.responsiveOverride, i = this.opts, a = new X, s = new F(i); this.chartType = i.chart.type, i = this.extendYAxis(i), i = this.extendAnnotations(i); var r = a.init(), o = {}; if (i && "object" === b(i)) { var n, l, h, c, d, g, u, f, p, x, v = {}; v = -1 !== ["line", "area", "bar", "candlestick", "boxPlot", "rangeBar", "rangeArea", "bubble", "scatter", "heatmap", "treemap", "pie", "polarArea", "donut", "radar", "radialBar"].indexOf(i.chart.type) ? s[i.chart.type]() : s.line(), null !== (n = i.plotOptions) && void 0 !== n && null !== (l = n.bar) && void 0 !== l && l.isFunnel && (v = s.funnel()), i.chart.stacked && "bar" === i.chart.type && (v = s.stackedBars()), null !== (h = i.chart.brush) && void 0 !== h && h.enabled && (v = s.brush(v)), null !== (c = i.plotOptions) && void 0 !== c && null !== (d = c.line) && void 0 !== d && d.isSlopeChart && (v = s.slope()), i.chart.stacked && "100%" === i.chart.stackType && (i = s.stacked100(i)), null !== (g = i.plotOptions) && void 0 !== g && null !== (u = g.bar) && void 0 !== u && u.isDumbbell && (i = s.dumbbell(i)), this.checkForDarkTheme(window.Apex), this.checkForDarkTheme(i), i.xaxis = i.xaxis || window.Apex.xaxis || {}, e || (i.xaxis.convertedCatToNumeric = !1), (null !== (f = (i = this.checkForCatToNumericXAxis(this.chartType, v, i)).chart.sparkline) && void 0 !== f && f.enabled || null !== (p = window.Apex.chart) && void 0 !== p && null !== (x = p.sparkline) && void 0 !== x && x.enabled) && (v = s.sparkline(v)), o = m.extend(r, v) } var y = m.extend(o, window.Apex); return r = m.extend(y, i), r = this.handleUserInputErrors(r) } }, { key: "checkForCatToNumericXAxis", value: function (t, e, i) { var a, s, r = new F(i), o = ("bar" === t || "boxPlot" === t) && (null === (a = i.plotOptions) || void 0 === a || null === (s = a.bar) || void 0 === s ? void 0 : s.horizontal), n = "pie" === t || "polarArea" === t || "donut" === t || "radar" === t || "radialBar" === t || "heatmap" === t, l = "datetime" !== i.xaxis.type && "numeric" !== i.xaxis.type, h = i.xaxis.tickPlacement ? i.xaxis.tickPlacement : e.xaxis && e.xaxis.tickPlacement; return o || n || !l || "between" === h || (i = r.convertCatToNumeric(i)), i } }, { key: "extendYAxis", value: function (t, e) { var i = new X; (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 = m.extend(t.yaxis, window.Apex.yaxis)), t.yaxis.constructor !== Array ? t.yaxis = [m.extend(i.yAxis, t.yaxis)] : t.yaxis = m.extendArray(t.yaxis, i.yAxis); var a = !1; t.yaxis.forEach((function (t) { t.logarithmic && (a = !0) })); var s = t.series; return e && !s && (s = e.config.series), a && s.length !== t.yaxis.length && s.length && (t.yaxis = s.map((function (e, a) { if (e.name || (s[a].name = "series-".concat(a + 1)), t.yaxis[a]) return t.yaxis[a].seriesName = s[a].name, t.yaxis[a]; var r = m.extend(i.yAxis, t.yaxis[0]); return r.show = !1, r }))), a && s.length > 1 && s.length !== t.yaxis.length && console.warn("A multi-series logarithmic chart should have equal number of series and y-axes"), t } }, { key: "extendAnnotations", value: function (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) } }, { key: "extendYAxisAnnotations", value: function (t) { var e = new X; return t.annotations.yaxis = m.extendArray(void 0 !== t.annotations.yaxis ? t.annotations.yaxis : [], e.yAxisAnnotation), t } }, { key: "extendXAxisAnnotations", value: function (t) { var e = new X; return t.annotations.xaxis = m.extendArray(void 0 !== t.annotations.xaxis ? t.annotations.xaxis : [], e.xAxisAnnotation), t } }, { key: "extendPointAnnotations", value: function (t) { var e = new X; return t.annotations.points = m.extendArray(void 0 !== t.annotations.points ? t.annotations.points : [], e.pointAnnotation), t } }, { key: "checkForDarkTheme", value: function (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")) } }, { key: "handleUserInputErrors", value: function (t) { var 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 && (console.warn("Reversed y-axis in ".concat(e.chart.type, " chart is not supported.")), e.yaxis[0].reversed = !1), e } }]), t }(), H = function () { function t() { i(this, t) } return s(t, [{ key: "initGlobalVars", value: function (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.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.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 } }, { key: "globalVars", value: function (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: [] }, 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, easing: null, 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: [] } } }, { key: "init", value: function (t) { var e = this.globalVars(t); return this.initGlobalVars(e), e.initialConfig = m.extend({}, t), e.initialSeries = m.clone(t.series), e.lastXAxis = m.clone(e.initialConfig.xaxis), e.lastYAxis = m.clone(e.initialConfig.yaxis), e } }]), t }(), O = function () { function t(e) { i(this, t), this.opts = e } return s(t, [{ key: "init", value: function () { var t = new D(this.opts).init({ responsiveOverride: !1 }); return { config: t, globals: (new H).init(t) } } }]), t }(), N = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w, this.opts = null, this.seriesIndex = 0, this.patternIDs = [] } return s(t, [{ key: "clippedImgArea", value: function (t) { var e = this.w, i = e.config, a = parseInt(e.globals.gridWidth, 10), s = parseInt(e.globals.gridHeight, 10), r = a > s ? a : s, o = t.image, n = 0, l = 0; void 0 === t.width && void 0 === t.height ? void 0 !== i.fill.image.width && void 0 !== i.fill.image.height ? (n = i.fill.image.width + 1, l = i.fill.image.height) : (n = r + 1, l = r) : (n = t.width, l = t.height); var h = document.createElementNS(e.globals.SVGNS, "pattern"); k.setAttrs(h, { id: t.patternID, patternUnits: t.patternUnits ? t.patternUnits : "userSpaceOnUse", width: n + "px", height: l + "px" }); var c = document.createElementNS(e.globals.SVGNS, "image"); h.appendChild(c), c.setAttributeNS(window.SVG.xlink, "href", o), k.setAttrs(c, { x: 0, y: 0, preserveAspectRatio: "none", width: n + "px", height: l + "px" }), c.style.opacity = t.opacity, e.globals.dom.elDefs.node.appendChild(h) } }, { key: "getSeriesIndex", value: function (t) { var e = this.w, i = e.config.chart.type; return ("bar" === i || "rangeBar" === i) && e.config.plotOptions.bar.distributed || "heatmap" === i || "treemap" === i ? this.seriesIndex = t.seriesNumber : this.seriesIndex = t.seriesNumber % e.globals.series.length, this.seriesIndex } }, { key: "fillPath", value: function (t) { var e = this.w; this.opts = t; var i, a, s, r = this.w.config; this.seriesIndex = this.getSeriesIndex(t); var o = this.getFillColors()[this.seriesIndex]; void 0 !== e.globals.seriesColors[this.seriesIndex] && (o = e.globals.seriesColors[this.seriesIndex]), "function" == typeof o && (o = o({ seriesIndex: this.seriesIndex, dataPointIndex: t.dataPointIndex, value: t.value, w: e })); var n = t.fillType ? t.fillType : this.getFillType(this.seriesIndex), l = Array.isArray(r.fill.opacity) ? r.fill.opacity[this.seriesIndex] : r.fill.opacity; t.color && (o = t.color), o || (o = "#fff", console.warn("undefined color - ApexCharts")); var h = o; if (-1 === o.indexOf("rgb") ? o.length < 9 && (h = m.hexToRgba(o, l)) : o.indexOf("rgba") > -1 && (l = m.getOpacityFromRGBA(o)), t.opacity && (l = t.opacity), "pattern" === n && (a = this.handlePatternFill({ fillConfig: t.fillConfig, patternFill: a, fillColor: o, fillOpacity: l, defaultColor: h })), "gradient" === n && (s = this.handleGradientFill({ fillConfig: t.fillConfig, fillColor: o, fillOpacity: l, i: this.seriesIndex })), "image" === n) { var c = r.fill.image.src, d = t.patternID ? t.patternID : "", g = "pattern".concat(e.globals.cuid).concat(t.seriesNumber + 1).concat(d); -1 === this.patternIDs.indexOf(g) && (this.clippedImgArea({ opacity: l, image: Array.isArray(c) ? t.seriesNumber < c.length ? c[t.seriesNumber] : c[0] : c, width: t.width ? t.width : void 0, height: t.height ? t.height : void 0, patternUnits: t.patternUnits, patternID: g }), this.patternIDs.push(g)), i = "url(#".concat(g, ")") } else i = "gradient" === n ? s : "pattern" === n ? a : h; return t.solid && (i = h), i } }, { key: "getFillType", value: function (t) { var e = this.w; return Array.isArray(e.config.fill.type) ? e.config.fill.type[t] : e.config.fill.type } }, { key: "getFillColors", value: function () { var t = this.w, e = t.config, i = this.opts, a = []; return t.globals.comboCharts ? "line" === t.config.series[this.seriesIndex].type ? Array.isArray(t.globals.stroke.colors) ? a = t.globals.stroke.colors : a.push(t.globals.stroke.colors) : Array.isArray(t.globals.fill.colors) ? a = t.globals.fill.colors : a.push(t.globals.fill.colors) : "line" === e.chart.type ? Array.isArray(t.globals.stroke.colors) ? a = t.globals.stroke.colors : a.push(t.globals.stroke.colors) : Array.isArray(t.globals.fill.colors) ? a = t.globals.fill.colors : a.push(t.globals.fill.colors), void 0 !== i.fillColors && (a = [], Array.isArray(i.fillColors) ? a = i.fillColors.slice() : a.push(i.fillColors)), a } }, { key: "handlePatternFill", value: function (t) { var e = t.fillConfig, i = t.patternFill, a = t.fillColor, s = t.fillOpacity, r = t.defaultColor, o = this.w.config.fill; e && (o = e); var n = this.opts, l = new k(this.ctx), h = Array.isArray(o.pattern.strokeWidth) ? o.pattern.strokeWidth[this.seriesIndex] : o.pattern.strokeWidth, c = a; Array.isArray(o.pattern.style) ? i = void 0 !== o.pattern.style[n.seriesNumber] ? l.drawPattern(o.pattern.style[n.seriesNumber], o.pattern.width, o.pattern.height, c, h, s) : r : i = l.drawPattern(o.pattern.style, o.pattern.width, o.pattern.height, c, h, s); return i } }, { key: "handleGradientFill", value: function (t) { var e = t.fillColor, i = t.fillOpacity, a = t.fillConfig, s = t.i, r = this.w.config.fill; a && (r = g(g({}, r), a)); var o, n = this.opts, l = new k(this.ctx), h = new m, c = r.gradient.type, d = e, u = void 0 === r.gradient.opacityFrom ? i : Array.isArray(r.gradient.opacityFrom) ? r.gradient.opacityFrom[s] : r.gradient.opacityFrom; d.indexOf("rgba") > -1 && (u = m.getOpacityFromRGBA(d)); var f = void 0 === r.gradient.opacityTo ? i : Array.isArray(r.gradient.opacityTo) ? r.gradient.opacityTo[s] : r.gradient.opacityTo; if (void 0 === r.gradient.gradientToColors || 0 === r.gradient.gradientToColors.length) o = "dark" === r.gradient.shade ? h.shadeColor(-1 * parseFloat(r.gradient.shadeIntensity), e.indexOf("rgb") > -1 ? m.rgb2hex(e) : e) : h.shadeColor(parseFloat(r.gradient.shadeIntensity), e.indexOf("rgb") > -1 ? m.rgb2hex(e) : e); else if (r.gradient.gradientToColors[n.seriesNumber]) { var p = r.gradient.gradientToColors[n.seriesNumber]; o = p, p.indexOf("rgba") > -1 && (f = m.getOpacityFromRGBA(p)) } else o = e; if (r.gradient.gradientFrom && (d = r.gradient.gradientFrom), r.gradient.gradientTo && (o = r.gradient.gradientTo), r.gradient.inverseColors) { var x = d; d = o, o = x } return d.indexOf("rgb") > -1 && (d = m.rgb2hex(d)), o.indexOf("rgb") > -1 && (o = m.rgb2hex(o)), l.drawGradient(c, d, o, u, f, n.size, r.gradient.stops, r.gradient.colorStops, s) } }]), t }(), W = function () { function t(e, a) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "setGlobalMarkerSize", value: function () { var 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 (var 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((function (e) { return t.config.markers.size })) } }, { key: "plotChartMarkers", value: function (t, e, i, a) { var s, r = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], o = this.w, n = e, l = t, h = null, c = new k(this.ctx), d = o.config.markers.discrete && o.config.markers.discrete.length; if ((o.globals.markers.size[e] > 0 || r || d) && (h = c.group({ class: r || d ? "" : "apexcharts-series-markers" })).attr("clip-path", "url(#gridRectMarkerMask".concat(o.globals.cuid, ")")), Array.isArray(l.x)) for (var g = 0; g < l.x.length; g++) { var u = i; 1 === i && 0 === g && (u = 0), 1 === i && 1 === g && (u = 1); var f = "apexcharts-marker"; if ("line" !== o.config.chart.type && "area" !== o.config.chart.type || o.globals.comboCharts || o.config.tooltip.intersect || (f += " no-pointer-events"), (Array.isArray(o.config.markers.size) ? o.globals.markers.size[e] > 0 : o.config.markers.size > 0) || r || d) { m.isNumber(l.y[g]) ? f += " w".concat(m.randomId()) : f = "apexcharts-nullpoint"; var p = this.getMarkerConfig({ cssClass: f, seriesIndex: e, dataPointIndex: u }); o.config.series[n].data[u] && (o.config.series[n].data[u].fillColor && (p.pointFillColor = o.config.series[n].data[u].fillColor), o.config.series[n].data[u].strokeColor && (p.pointStrokeColor = o.config.series[n].data[u].strokeColor)), void 0 !== a && (p.pSize = a), (l.x[g] < -o.globals.markers.largestSize || l.x[g] > o.globals.gridWidth + o.globals.markers.largestSize || l.y[g] < -o.globals.markers.largestSize || l.y[g] > o.globals.gridHeight + o.globals.markers.largestSize) && (p.pSize = 0), (s = c.drawMarker(l.x[g], l.y[g], p)).attr("rel", u), s.attr("j", u), s.attr("index", e), s.node.setAttribute("default-marker-size", p.pSize), new w(this.ctx).setSelectionFilter(s, e, u), this.addEvents(s), h && h.add(s) } else void 0 === o.globals.pointsArray[e] && (o.globals.pointsArray[e] = []), o.globals.pointsArray[e].push([l.x[g], l.y[g]]) } return h } }, { key: "getMarkerConfig", value: function (t) { var e = t.cssClass, i = t.seriesIndex, a = t.dataPointIndex, s = void 0 === a ? null : a, r = t.radius, o = void 0 === r ? null : r, n = t.size, l = void 0 === n ? null : n, h = t.strokeWidth, c = void 0 === h ? null : h, d = this.w, g = this.getMarkerStyle(i), u = null === l ? d.globals.markers.size[i] : l, f = d.config.markers; return null !== s && f.discrete.length && f.discrete.map((function (t) { t.seriesIndex === i && t.dataPointIndex === s && (g.pointStrokeColor = t.strokeColor, g.pointFillColor = t.fillColor, u = t.size, g.pointShape = t.shape) })), { pSize: null === o ? u : o, pRadius: null !== o ? o : f.radius, pointStrokeWidth: null !== c ? c : Array.isArray(f.strokeWidth) ? f.strokeWidth[i] : f.strokeWidth, pointStrokeColor: g.pointStrokeColor, pointFillColor: g.pointFillColor, shape: g.pointShape || (Array.isArray(f.shape) ? f.shape[i] : f.shape), class: e, pointStrokeOpacity: Array.isArray(f.strokeOpacity) ? f.strokeOpacity[i] : f.strokeOpacity, pointStrokeDashArray: Array.isArray(f.strokeDashArray) ? f.strokeDashArray[i] : f.strokeDashArray, pointFillOpacity: Array.isArray(f.fillOpacity) ? f.fillOpacity[i] : f.fillOpacity, seriesIndex: i } } }, { key: "addEvents", value: function (t) { var e = this.w, i = new k(this.ctx); t.node.addEventListener("mouseenter", i.pathMouseEnter.bind(this.ctx, t)), t.node.addEventListener("mouseleave", i.pathMouseLeave.bind(this.ctx, t)), t.node.addEventListener("mousedown", i.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", i.pathMouseDown.bind(this.ctx, t), { passive: !0 }) } }, { key: "getMarkerStyle", value: function (t) { var e = this.w, i = e.globals.markers.colors, a = e.config.markers.strokeColor || e.config.markers.strokeColors; return { pointStrokeColor: Array.isArray(a) ? a[t] : a, pointFillColor: Array.isArray(i) ? i[t] : i } } }]), t }(), B = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w, this.initialAnim = this.w.config.chart.animations.enabled } return s(t, [{ key: "draw", value: function (t, e, i) { var a = this.w, s = new k(this.ctx), r = i.realIndex, o = i.pointsPos, n = i.zRatio, l = i.elParent, h = s.group({ class: "apexcharts-series-markers apexcharts-series-".concat(a.config.chart.type) }); if (h.attr("clip-path", "url(#gridRectMarkerMask".concat(a.globals.cuid, ")")), Array.isArray(o.x)) for (var c = 0; c < o.x.length; c++) { var d = e + 1, g = !0; 0 === e && 0 === c && (d = 0), 0 === e && 1 === c && (d = 1); var u = a.globals.markers.size[r]; if (n !== 1 / 0) { var f = a.config.plotOptions.bubble; u = a.globals.seriesZ[r][d], f.zScaling && (u /= n), f.minBubbleRadius && u < f.minBubbleRadius && (u = f.minBubbleRadius), f.maxBubbleRadius && u > f.maxBubbleRadius && (u = f.maxBubbleRadius) } var p = o.x[c], x = o.y[c]; if (u = u || 0, null !== x && void 0 !== a.globals.series[r][d] || (g = !1), g) { var b = this.drawPoint(p, x, u, r, d, e); h.add(b) } l.add(h) } } }, { key: "drawPoint", value: function (t, e, i, a, s, r) { var o = this.w, n = a, l = new y(this.ctx), h = new w(this.ctx), c = new N(this.ctx), d = new W(this.ctx), g = new k(this.ctx), u = d.getMarkerConfig({ cssClass: "apexcharts-marker", seriesIndex: n, dataPointIndex: s, radius: "bubble" === o.config.chart.type || o.globals.comboCharts && o.config.series[a] && "bubble" === o.config.series[a].type ? i : null }), f = c.fillPath({ seriesNumber: a, dataPointIndex: s, color: u.pointFillColor, patternUnits: "objectBoundingBox", value: o.globals.series[a][r] }), p = g.drawMarker(t, e, u); if (o.config.series[n].data[s] && o.config.series[n].data[s].fillColor && (f = o.config.series[n].data[s].fillColor), p.attr({ fill: f }), o.config.chart.dropShadow.enabled) { var x = o.config.chart.dropShadow; h.dropShadow(p, x, a) } if (!this.initialAnim || o.globals.dataChanged || o.globals.resized) o.globals.animationEnded = !0; else { var b = o.config.chart.animations.speed; l.animateMarker(p, b, o.globals.easing, (function () { window.setTimeout((function () { l.animationCompleted(p) }), 100) })) } return p.attr({ rel: s, j: s, index: a, "default-marker-size": u.pSize }), h.setSelectionFilter(p, a, s), d.addEvents(p), p.node.classList.add("apexcharts-marker"), p } }, { key: "centerTextInBubble", value: function (t) { var e = this.w; return { y: t += parseInt(e.config.dataLabels.style.fontSize, 10) / 4 } } }]), t }(), G = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "dataLabelsCorrection", value: function (t, e, i, a, s, r, o) { var n = this.w, l = !1, h = new k(this.ctx).getTextRects(i, o), c = h.width, d = h.height; e < 0 && (e = 0), e > n.globals.gridHeight + d && (e = n.globals.gridHeight + d / 2), void 0 === n.globals.dataLabelsRects[a] && (n.globals.dataLabelsRects[a] = []), n.globals.dataLabelsRects[a].push({ x: t, y: e, width: c, height: d }); var g = n.globals.dataLabelsRects[a].length - 2, u = void 0 !== n.globals.lastDrawnDataLabelsIndexes[a] ? n.globals.lastDrawnDataLabelsIndexes[a][n.globals.lastDrawnDataLabelsIndexes[a].length - 1] : 0; if (void 0 !== n.globals.dataLabelsRects[a][g]) { var f = n.globals.dataLabelsRects[a][u]; (t > f.x + f.width || e > f.y + f.height || e + d < f.y || t + c < f.x) && (l = !0) } return (0 === s || r) && (l = !0), { x: t, y: e, textRects: h, drawnextLabel: l } } }, { key: "drawDataLabel", value: function (t) { var e = this, i = t.type, a = t.pos, s = t.i, r = t.j, o = t.isRangeStart, n = t.strokeWidth, l = void 0 === n ? 2 : n, h = this.w, c = new k(this.ctx), d = h.config.dataLabels, g = 0, u = 0, f = r, p = null; if (-1 !== h.globals.collapsedSeriesIndices.indexOf(s) || !d.enabled || !Array.isArray(a.x)) return p; p = c.group({ class: "apexcharts-data-labels" }); for (var x = 0; x < a.x.length; x++)if (g = a.x[x] + d.offsetX, u = a.y[x] + d.offsetY + l, !isNaN(g)) { 1 === r && 0 === x && (f = 0), 1 === r && 1 === x && (f = 1); var b = h.globals.series[s][f]; "rangeArea" === i && (b = o ? h.globals.seriesRangeStart[s][f] : h.globals.seriesRangeEnd[s][f]); var v = "", m = function (t) { return h.config.dataLabels.formatter(t, { ctx: e.ctx, seriesIndex: s, dataPointIndex: f, w: h }) }; if ("bubble" === h.config.chart.type) v = m(b = h.globals.seriesZ[s][f]), u = a.y[x], u = new B(this.ctx).centerTextInBubble(u, s, f).y; else void 0 !== b && (v = m(b)); var y = h.config.dataLabels.textAnchor; h.globals.isSlopeChart && (y = 0 === f ? "end" : f === h.config.series[s].data.length - 1 ? "start" : "middle"), this.plotDataLabelsText({ x: g, y: u, text: v, i: s, j: f, parent: p, offsetCorrection: !0, dataLabelsConfig: h.config.dataLabels, textAnchor: y }) } return p } }, { key: "plotDataLabelsText", value: function (t) { var e = this.w, i = new k(this.ctx), a = t.x, s = t.y, r = t.i, o = t.j, n = t.text, l = t.textAnchor, h = t.fontSize, c = t.parent, d = t.dataLabelsConfig, g = t.color, u = t.alwaysDrawDataLabel, f = t.offsetCorrection, p = t.className, x = null; if (Array.isArray(e.config.dataLabels.enabledOnSeries) && e.config.dataLabels.enabledOnSeries.indexOf(r) < 0) return x; var b = { x: a, y: s, drawnextLabel: !0, textRects: null }; f && (b = this.dataLabelsCorrection(a, s, n, r, o, u, parseInt(d.style.fontSize, 10))), e.globals.zoomed || (a = b.x, s = b.y), b.textRects && (a < -20 - b.textRects.width || a > e.globals.gridWidth + b.textRects.width + 30) && (n = ""); var v = e.globals.dataLabels.style.colors[r]; (("bar" === e.config.chart.type || "rangeBar" === e.config.chart.type) && e.config.plotOptions.bar.distributed || e.config.dataLabels.distributed) && (v = e.globals.dataLabels.style.colors[o]), "function" == typeof v && (v = v({ series: e.globals.series, seriesIndex: r, dataPointIndex: o, w: e })), g && (v = g); var m = d.offsetX, y = d.offsetY; if ("bar" !== e.config.chart.type && "rangeBar" !== e.config.chart.type || (m = 0, y = 0), e.globals.isSlopeChart && (0 !== o && (m = -2 * d.offsetX + 5), 0 !== o && o !== e.config.series[r].data.length - 1 && (m = 0)), b.drawnextLabel) { if ((x = i.drawText({ width: 100, height: parseInt(d.style.fontSize, 10), x: a + m, y: s + y, foreColor: v, textAnchor: l || d.textAnchor, text: n, fontSize: h || d.style.fontSize, fontFamily: d.style.fontFamily, fontWeight: d.style.fontWeight || "normal" })).attr({ class: p || "apexcharts-datalabel", cx: a, cy: s }), d.dropShadow.enabled) { var A = d.dropShadow; new w(this.ctx).dropShadow(x, A) } c.add(x), void 0 === e.globals.lastDrawnDataLabelsIndexes[r] && (e.globals.lastDrawnDataLabelsIndexes[r] = []), e.globals.lastDrawnDataLabelsIndexes[r].push(o) } return x } }, { key: "addBackgroundToDataLabel", value: function (t, e) { var i = this.w, a = i.config.dataLabels.background, s = a.padding, r = a.padding / 2, o = e.width, n = e.height, l = new k(this.ctx).drawRect(e.x - s, e.y - r / 2, o + 2 * s, n + r, a.borderRadius, "transparent" !== i.config.chart.background && i.config.chart.background ? i.config.chart.background : "#fff", a.opacity, a.borderWidth, a.borderColor); a.dropShadow.enabled && new w(this.ctx).dropShadow(l, a.dropShadow); return l } }, { key: "dataLabelsBackground", value: function () { var t = this.w; if ("bubble" !== t.config.chart.type) for (var e = t.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels text"), i = 0; i < e.length; i++) { var a = e[i], s = a.getBBox(), r = null; if (s.width && s.height && (r = this.addBackgroundToDataLabel(a, s)), r) { a.parentNode.insertBefore(r.node, a); var o = a.getAttribute("fill"); t.config.chart.animations.enabled && !t.globals.resized && !t.globals.dataChanged ? r.animate().attr({ fill: o }) : r.attr({ fill: o }), a.setAttribute("fill", t.config.dataLabels.background.foreColor) } } } }, { key: "bringForward", value: function () { for (var t = this.w, e = t.globals.dom.baseEl.querySelectorAll(".apexcharts-datalabels"), i = t.globals.dom.baseEl.querySelector(".apexcharts-plot-series:last-child"), a = 0; a < e.length; a++)i && i.insertBefore(e[a], i.nextSibling) } }]), t }(), V = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w, this.legendInactiveClass = "legend-mouseover-inactive" } return s(t, [{ key: "getAllSeriesEls", value: function () { return this.w.globals.dom.baseEl.getElementsByClassName("apexcharts-series") } }, { key: "getSeriesByName", value: function (t) { return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner .apexcharts-series[seriesName='".concat(m.escapeString(t), "']")) } }, { key: "isSeriesHidden", value: function (t) { var e = this.getSeriesByName(t), i = parseInt(e.getAttribute("data:realIndex"), 10); return { isHidden: e.classList.contains("apexcharts-series-collapsed"), realIndex: i } } }, { key: "addCollapsedClassToSeries", value: function (t, e) { var i = this.w; function a(i) { for (var a = 0; a < i.length; a++)i[a].index === e && t.node.classList.add("apexcharts-series-collapsed") } a(i.globals.collapsedSeries), a(i.globals.ancillaryCollapsedSeries) } }, { key: "toggleSeries", value: function (t) { var e = this.isSeriesHidden(t); return this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex, e.isHidden), e.isHidden } }, { key: "showSeries", value: function (t) { var e = this.isSeriesHidden(t); e.isHidden && this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex, !0) } }, { key: "hideSeries", value: function (t) { var e = this.isSeriesHidden(t); e.isHidden || this.ctx.legend.legendHelpers.toggleDataSeries(e.realIndex, !1) } }, { key: "resetSeries", value: function () { var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0], e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], a = this.w, s = m.clone(a.globals.initialSeries); a.globals.previousPaths = [], i ? (a.globals.collapsedSeries = [], a.globals.ancillaryCollapsedSeries = [], a.globals.collapsedSeriesIndices = [], a.globals.ancillaryCollapsedSeriesIndices = []) : s = this.emptyCollapsedSeries(s), a.config.series = s, t && (e && (a.globals.zoomed = !1, this.ctx.updateHelpers.revertDefaultAxisMinMax()), this.ctx.updateHelpers._updateSeries(s, a.config.chart.animations.dynamicAnimation.enabled)) } }, { key: "emptyCollapsedSeries", value: function (t) { for (var e = this.w, i = 0; i < t.length; i++)e.globals.collapsedSeriesIndices.indexOf(i) > -1 && (t[i].data = []); return t } }, { key: "highlightSeries", value: function (t) { var e = this.w, i = this.getSeriesByName(t), a = parseInt(null == i ? void 0 : i.getAttribute("data:realIndex"), 10), s = e.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"), r = null, o = 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='".concat(a, "']")), o = e.globals.dom.baseEl.querySelector(".apexcharts-datalabels[data\\:realIndex='".concat(a, "']")); var l = e.globals.seriesYAxisReverseMap[a]; n = e.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(l, "']")) } else r = e.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(a + 1, "']")); else r = e.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(a + 1, "'] path")); for (var h = 0; h < s.length; h++)s[h].classList.add(this.legendInactiveClass); if (r) e.globals.axisCharts || r.parentNode.classList.remove(this.legendInactiveClass), r.classList.remove(this.legendInactiveClass), null !== o && o.classList.remove(this.legendInactiveClass), null !== n && n.classList.remove(this.legendInactiveClass); else for (var c = 0; c < s.length; c++)s[c].classList.remove(this.legendInactiveClass) } }, { key: "toggleSeriesOnHover", value: function (t, e) { var i = this.w; e || (e = t.target); var a = i.globals.dom.baseEl.querySelectorAll(".apexcharts-series, .apexcharts-datalabels, .apexcharts-yaxis"); if ("mousemove" === t.type) { var s = parseInt(e.getAttribute("rel"), 10) - 1; this.highlightSeries(i.globals.seriesNames[s]) } else if ("mouseout" === t.type) for (var r = 0; r < a.length; r++)a[r].classList.remove(this.legendInactiveClass) } }, { key: "highlightRangeInSeries", value: function (t, e) { var i = this, a = this.w, s = a.globals.dom.baseEl.getElementsByClassName("apexcharts-heatmap-rect"), r = function (t) { for (var e = 0; e < s.length; e++)s[e].classList[t](i.legendInactiveClass) }; if ("mousemove" === t.type) { var o = parseInt(e.getAttribute("rel"), 10) - 1; r("add"); var n = a.config.plotOptions.heatmap.colorScale.ranges; !function (t, e) { for (var a = 0; a < s.length; a++) { var r = Number(s[a].getAttribute("val")); r >= t.from && (r < t.to || t.to === e && r === e) && s[a].classList.remove(i.legendInactiveClass) } }(n[o], n.reduce((function (t, e) { return Math.max(t, e.to) }), 0)) } else "mouseout" === t.type && r("remove") } }, { key: "getActiveConfigSeriesIndex", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "asc", e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], i = this.w, a = 0; if (i.config.series.length > 1) for (var s = i.config.series.map((function (t, a) { return t.data && t.data.length > 0 && -1 === i.globals.collapsedSeriesIndices.indexOf(a) && (!i.globals.comboCharts || 0 === e.length || e.length && e.indexOf(i.config.series[a].type) > -1) ? a : -1 })), r = "asc" === t ? 0 : s.length - 1; "asc" === t ? r < s.length : r >= 0; "asc" === t ? r++ : r--)if (-1 !== s[r]) { a = s[r]; break } return a } }, { key: "getBarSeriesIndices", value: function () { return this.w.globals.comboCharts ? this.w.config.series.map((function (t, e) { return "bar" === t.type || "column" === t.type ? e : -1 })).filter((function (t) { return -1 !== t })) : this.w.config.series.map((function (t, e) { return e })) } }, { key: "getPreviousPaths", value: function () { var t = this.w; function e(e, i, a) { for (var s = e[i].childNodes, r = { type: a, paths: [], realIndex: e[i].getAttribute("data:realIndex") }, o = 0; o < s.length; o++)if (s[o].hasAttribute("pathTo")) { var n = s[o].getAttribute("pathTo"); r.paths.push({ d: n }) } t.globals.previousPaths.push(r) } t.globals.previousPaths = [];["line", "area", "bar", "rangebar", "rangeArea", "candlestick", "radar"].forEach((function (i) { for (var a, s = (a = i, t.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(a, "-series .apexcharts-series"))), r = 0; r < s.length; r++)e(s, r, i) })), this.handlePrevBubbleScatterPaths("bubble"), this.handlePrevBubbleScatterPaths("scatter"); var i = t.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(t.config.chart.type, " .apexcharts-series")); if (i.length > 0) for (var a = function (e) { for (var i = t.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(t.config.chart.type, " .apexcharts-series[data\\:realIndex='").concat(e, "'] rect")), a = [], s = function (t) { var e = function (e) { return i[t].getAttribute(e) }, s = { x: parseFloat(e("x")), y: parseFloat(e("y")), width: parseFloat(e("width")), height: parseFloat(e("height")) }; a.push({ rect: s, color: i[t].getAttribute("color") }) }, r = 0; r < i.length; r++)s(r); t.globals.previousPaths.push(a) }, s = 0; s < i.length; s++)a(s); t.globals.axisCharts || (t.globals.previousPaths = t.globals.series) } }, { key: "handlePrevBubbleScatterPaths", value: function (t) { var e = this.w, i = e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(t, "-series .apexcharts-series")); if (i.length > 0) for (var a = 0; a < i.length; a++) { for (var s = e.globals.dom.baseEl.querySelectorAll(".apexcharts-".concat(t, "-series .apexcharts-series[data\\:realIndex='").concat(a, "'] circle")), r = [], o = 0; o < s.length; o++)r.push({ x: s[o].getAttribute("cx"), y: s[o].getAttribute("cy"), r: s[o].getAttribute("r") }); e.globals.previousPaths.push(r) } } }, { key: "clearPreviousPaths", value: function () { var t = this.w; t.globals.previousPaths = [], t.globals.allSeriesCollapsed = !1 } }, { key: "handleNoData", value: function () { var t = this.w, e = t.config.noData, i = new k(this.ctx), a = t.globals.svgWidth / 2, s = t.globals.svgHeight / 2, r = "middle"; if (t.globals.noData = !0, t.globals.animationEnded = !0, "left" === e.align ? (a = 10, r = "start") : "right" === e.align && (a = t.globals.svgWidth - 10, r = "end"), "top" === e.verticalAlign ? s = 50 : "bottom" === e.verticalAlign && (s = t.globals.svgHeight - 50), a += e.offsetX, s = s + parseInt(e.style.fontSize, 10) + 2 + e.offsetY, void 0 !== e.text && "" !== e.text) { var o = i.drawText({ x: a, y: s, text: e.text, textAnchor: r, fontSize: e.style.fontSize, fontFamily: e.style.fontFamily, foreColor: e.style.color, opacity: 1, class: "apexcharts-text-nodata" }); t.globals.dom.Paper.add(o) } } }, { key: "setNullSeriesToZeroValues", value: function (t) { for (var e = this.w, i = 0; i < t.length; i++)if (0 === t[i].length) for (var a = 0; a < t[e.globals.maxValsInArrayIndex].length; a++)t[i].push(0); return t } }, { key: "hasAllSeriesEqualX", value: function () { for (var t = !0, e = this.w, i = this.filteredSeriesX(), a = 0; a < i.length - 1; a++)if (i[a][0] !== i[a + 1][0]) { t = !1; break } return e.globals.allSeriesHasEqualX = t, t } }, { key: "filteredSeriesX", value: function () { var t = this.w.globals.seriesX.map((function (t) { return t.length > 0 ? t : [] })); return t } }]), t }(), _ = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w, this.twoDSeries = [], this.threeDSeries = [], this.twoDSeriesX = [], this.seriesGoals = [], this.coreUtils = new A(this.ctx) } return s(t, [{ key: "isMultiFormat", value: function () { return this.isFormatXY() || this.isFormat2DArray() } }, { key: "isFormatXY", value: function () { var t = this.w.config.series.slice(), e = new V(this.ctx); if (this.activeSeriesIndex = e.getActiveConfigSeriesIndex(), void 0 !== t[this.activeSeriesIndex].data && t[this.activeSeriesIndex].data.length > 0 && null !== t[this.activeSeriesIndex].data[0] && void 0 !== t[this.activeSeriesIndex].data[0].x && null !== t[this.activeSeriesIndex].data[0]) return !0 } }, { key: "isFormat2DArray", value: function () { var t = this.w.config.series.slice(), e = new V(this.ctx); if (this.activeSeriesIndex = e.getActiveConfigSeriesIndex(), void 0 !== t[this.activeSeriesIndex].data && t[this.activeSeriesIndex].data.length > 0 && void 0 !== t[this.activeSeriesIndex].data[0] && null !== t[this.activeSeriesIndex].data[0] && t[this.activeSeriesIndex].data[0].constructor === Array) return !0 } }, { key: "handleFormat2DArray", value: function (t, e) { for (var i = this.w.config, a = this.w.globals, s = "boxPlot" === i.chart.type || "boxPlot" === i.series[e].type, r = 0; r < t[e].data.length; r++)if (void 0 !== t[e].data[r][1] && (Array.isArray(t[e].data[r][1]) && 4 === t[e].data[r][1].length && !s ? this.twoDSeries.push(m.parseNumber(t[e].data[r][1][3])) : t[e].data[r].length >= 5 ? this.twoDSeries.push(m.parseNumber(t[e].data[r][4])) : this.twoDSeries.push(m.parseNumber(t[e].data[r][1])), a.dataFormatXNumeric = !0), "datetime" === i.xaxis.type) { var o = new Date(t[e].data[r][0]); o = new Date(o).getTime(), this.twoDSeriesX.push(o) } else this.twoDSeriesX.push(t[e].data[r][0]); for (var n = 0; n < t[e].data.length; n++)void 0 !== t[e].data[n][2] && (this.threeDSeries.push(t[e].data[n][2]), a.isDataXYZ = !0) } }, { key: "handleFormatXY", value: function (t, e) { var i = this.w.config, a = this.w.globals, s = new L(this.ctx), r = e; a.collapsedSeriesIndices.indexOf(e) > -1 && (r = this.activeSeriesIndex); for (var o = 0; o < t[e].data.length; o++)void 0 !== t[e].data[o].y && (Array.isArray(t[e].data[o].y) ? this.twoDSeries.push(m.parseNumber(t[e].data[o].y[t[e].data[o].y.length - 1])) : this.twoDSeries.push(m.parseNumber(t[e].data[o].y))), void 0 !== t[e].data[o].goals && Array.isArray(t[e].data[o].goals) ? (void 0 === this.seriesGoals[e] && (this.seriesGoals[e] = []), this.seriesGoals[e].push(t[e].data[o].goals)) : (void 0 === this.seriesGoals[e] && (this.seriesGoals[e] = []), this.seriesGoals[e].push(null)); for (var n = 0; n < t[r].data.length; n++) { var l = "string" == typeof t[r].data[n].x, h = Array.isArray(t[r].data[n].x), c = !h && !!s.isValidDate(t[r].data[n].x); if (l || c) if (l || i.xaxis.convertedCatToNumeric) { var d = a.isBarHorizontal && a.isRangeData; "datetime" !== i.xaxis.type || d ? (this.fallbackToCategory = !0, this.twoDSeriesX.push(t[r].data[n].x), isNaN(t[r].data[n].x) || "category" === this.w.config.xaxis.type || "string" == typeof t[r].data[n].x || (a.isXNumeric = !0)) : this.twoDSeriesX.push(s.parseDate(t[r].data[n].x)) } else "datetime" === i.xaxis.type ? this.twoDSeriesX.push(s.parseDate(t[r].data[n].x.toString())) : (a.dataFormatXNumeric = !0, a.isXNumeric = !0, this.twoDSeriesX.push(parseFloat(t[r].data[n].x))); else h ? (this.fallbackToCategory = !0, this.twoDSeriesX.push(t[r].data[n].x)) : (a.isXNumeric = !0, a.dataFormatXNumeric = !0, this.twoDSeriesX.push(t[r].data[n].x)) } if (t[e].data[0] && void 0 !== t[e].data[0].z) { for (var g = 0; g < t[e].data.length; g++)this.threeDSeries.push(t[e].data[g].z); a.isDataXYZ = !0 } } }, { key: "handleRangeData", value: function (t, e) { var i = this.w.globals, a = {}; return this.isFormat2DArray() ? a = this.handleRangeDataFormat("array", t, e) : this.isFormatXY() && (a = this.handleRangeDataFormat("xy", t, e)), i.seriesRangeStart.push(void 0 === a.start ? [] : a.start), i.seriesRangeEnd.push(void 0 === a.end ? [] : a.end), i.seriesRange.push(a.rangeUniques), i.seriesRange.forEach((function (t, e) { t && t.forEach((function (t, e) { t.y.forEach((function (e, i) { for (var a = 0; a < t.y.length; a++)if (i !== a) { var s = e.y1, r = e.y2, o = t.y[a].y1; s <= t.y[a].y2 && o <= r && (t.overlaps.indexOf(e.rangeName) < 0 && t.overlaps.push(e.rangeName), t.overlaps.indexOf(t.y[a].rangeName) < 0 && t.overlaps.push(t.y[a].rangeName)) } })) })) })), a } }, { key: "handleCandleStickBoxData", value: function (t, e) { var i = this.w.globals, a = {}; return this.isFormat2DArray() ? a = this.handleCandleStickBoxDataFormat("array", t, e) : this.isFormatXY() && (a = this.handleCandleStickBoxDataFormat("xy", t, e)), i.seriesCandleO[e] = a.o, i.seriesCandleH[e] = a.h, i.seriesCandleM[e] = a.m, i.seriesCandleL[e] = a.l, i.seriesCandleC[e] = a.c, a } }, { key: "handleRangeDataFormat", value: function (t, e, i) { var a = [], s = [], r = e[i].data.filter((function (t, e, i) { return e === i.findIndex((function (e) { return e.x === t.x })) })).map((function (t, e) { return { x: t.x, overlaps: [], y: [] } })); if ("array" === t) for (var o = 0; o < e[i].data.length; o++)Array.isArray(e[i].data[o]) ? (a.push(e[i].data[o][1][0]), s.push(e[i].data[o][1][1])) : (a.push(e[i].data[o]), s.push(e[i].data[o])); else if ("xy" === t) for (var n = function (t) { var o = Array.isArray(e[i].data[t].y), n = m.randomId(), l = e[i].data[t].x, h = { y1: o ? e[i].data[t].y[0] : e[i].data[t].y, y2: o ? e[i].data[t].y[1] : e[i].data[t].y, rangeName: n }; e[i].data[t].rangeName = n; var c = r.findIndex((function (t) { return t.x === l })); r[c].y.push(h), a.push(h.y1), s.push(h.y2) }, l = 0; l < e[i].data.length; l++)n(l); return { start: a, end: s, rangeUniques: r } } }, { key: "handleCandleStickBoxDataFormat", value: function (t, e, i) { var a = this.w, s = "boxPlot" === a.config.chart.type || "boxPlot" === a.config.series[i].type, r = [], o = [], n = [], l = [], h = []; if ("array" === t) if (s && 6 === e[i].data[0].length || !s && 5 === e[i].data[0].length) for (var c = 0; c < e[i].data.length; c++)r.push(e[i].data[c][1]), o.push(e[i].data[c][2]), s ? (n.push(e[i].data[c][3]), l.push(e[i].data[c][4]), h.push(e[i].data[c][5])) : (l.push(e[i].data[c][3]), h.push(e[i].data[c][4])); else for (var d = 0; d < e[i].data.length; d++)Array.isArray(e[i].data[d][1]) && (r.push(e[i].data[d][1][0]), o.push(e[i].data[d][1][1]), s ? (n.push(e[i].data[d][1][2]), l.push(e[i].data[d][1][3]), h.push(e[i].data[d][1][4])) : (l.push(e[i].data[d][1][2]), h.push(e[i].data[d][1][3]))); else if ("xy" === t) for (var g = 0; g < e[i].data.length; g++)Array.isArray(e[i].data[g].y) && (r.push(e[i].data[g].y[0]), o.push(e[i].data[g].y[1]), s ? (n.push(e[i].data[g].y[2]), l.push(e[i].data[g].y[3]), h.push(e[i].data[g].y[4])) : (l.push(e[i].data[g].y[2]), h.push(e[i].data[g].y[3]))); return { o: r, h: o, m: n, l: l, c: h } } }, { key: "parseDataAxisCharts", value: function (t) { var e = this, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.ctx, a = this.w.config, s = this.w.globals, r = new L(i), o = a.labels.length > 0 ? a.labels.slice() : a.xaxis.categories.slice(); s.isRangeBar = "rangeBar" === a.chart.type && s.isBarHorizontal, s.hasXaxisGroups = "category" === a.xaxis.type && a.xaxis.group.groups.length > 0, s.hasXaxisGroups && (s.groups = a.xaxis.group.groups), t.forEach((function (t, e) { void 0 !== t.name ? s.seriesNames.push(t.name) : s.seriesNames.push("series-" + parseInt(e + 1, 10)) })), this.coreUtils.setSeriesYAxisMappings(); var n = [], l = p(new Set(a.series.map((function (t) { return t.group })))); a.series.forEach((function (t, e) { var i = l.indexOf(t.group); n[i] || (n[i] = []), n[i].push(s.seriesNames[e]) })), s.seriesGroups = n; for (var h = function () { for (var t = 0; t < o.length; t++)if ("string" == typeof o[t]) { if (!r.isValidDate(o[t])) throw new Error("You have provided invalid Date format. Please provide a valid JavaScript Date"); e.twoDSeriesX.push(r.parseDate(o[t])) } else e.twoDSeriesX.push(o[t]) }, c = 0; c < t.length; c++) { if (this.twoDSeries = [], this.twoDSeriesX = [], this.threeDSeries = [], void 0 === t[c].data) return void console.error("It is a possibility that you may have not included 'data' property in series."); if ("rangeBar" !== a.chart.type && "rangeArea" !== a.chart.type && "rangeBar" !== t[c].type && "rangeArea" !== t[c].type || (s.isRangeData = !0, "rangeBar" !== a.chart.type && "rangeArea" !== a.chart.type || this.handleRangeData(t, c)), this.isMultiFormat()) this.isFormat2DArray() ? this.handleFormat2DArray(t, c) : this.isFormatXY() && this.handleFormatXY(t, c), "candlestick" !== a.chart.type && "candlestick" !== t[c].type && "boxPlot" !== a.chart.type && "boxPlot" !== t[c].type || this.handleCandleStickBoxData(t, c), s.series.push(this.twoDSeries), s.labels.push(this.twoDSeriesX), s.seriesX.push(this.twoDSeriesX), s.seriesGoals = this.seriesGoals, c !== this.activeSeriesIndex || this.fallbackToCategory || (s.isXNumeric = !0); else { "datetime" === a.xaxis.type ? (s.isXNumeric = !0, h(), s.seriesX.push(this.twoDSeriesX)) : "numeric" === a.xaxis.type && (s.isXNumeric = !0, o.length > 0 && (this.twoDSeriesX = o, s.seriesX.push(this.twoDSeriesX))), s.labels.push(this.twoDSeriesX); var d = t[c].data.map((function (t) { return m.parseNumber(t) })); s.series.push(d) } s.seriesZ.push(this.threeDSeries), void 0 !== t[c].color ? s.seriesColors.push(t[c].color) : s.seriesColors.push(void 0) } return this.w } }, { key: "parseDataNonAxisCharts", value: function (t) { var e = this.w.globals, i = this.w.config; e.series = t.slice(), e.seriesNames = i.labels.slice(); for (var a = 0; a < e.series.length; a++)void 0 === e.seriesNames[a] && e.seriesNames.push("series-" + (a + 1)); return this.w } }, { key: "handleExternalLabelsData", value: function (t) { var e = this.w.config, i = this.w.globals; if (e.xaxis.categories.length > 0) i.labels = e.xaxis.categories; else if (e.labels.length > 0) i.labels = e.labels.slice(); else if (this.fallbackToCategory) { if (i.labels = i.labels[0], i.seriesRange.length && (i.seriesRange.map((function (t) { t.forEach((function (t) { i.labels.indexOf(t.x) < 0 && t.x && i.labels.push(t.x) })) })), i.labels = Array.from(new Set(i.labels.map(JSON.stringify)), JSON.parse)), e.xaxis.convertedCatToNumeric) new F(e).convertCatToNumericXaxis(e, this.ctx, i.seriesX[0]), this._generateExternalLabels(t) } else this._generateExternalLabels(t) } }, { key: "_generateExternalLabels", value: function (t) { var e = this.w.globals, i = this.w.config, a = []; if (e.axisCharts) { if (e.series.length > 0) if (this.isFormatXY()) for (var s = i.series.map((function (t, e) { return t.data.filter((function (t, e, i) { return i.findIndex((function (e) { return e.x === t.x })) === e })) })), r = s.reduce((function (t, e, i, a) { return a[t].length > e.length ? t : i }), 0), o = 0; o < s[r].length; o++)a.push(o + 1); else for (var n = 0; n < e.series[e.maxValsInArrayIndex].length; n++)a.push(n + 1); e.seriesX = []; for (var l = 0; l < t.length; l++)e.seriesX.push(a); this.w.globals.isBarHorizontal || (e.isXNumeric = !0) } if (0 === a.length) { a = e.axisCharts ? [] : e.series.map((function (t, e) { return e + 1 })); for (var h = 0; h < t.length; h++)e.seriesX.push(a) } e.labels = a, i.xaxis.convertedCatToNumeric && (e.categoryLabels = a.map((function (t) { return i.xaxis.labels.formatter(t) }))), e.noLabelsProvided = !0 } }, { key: "parseData", value: function (t) { var e = this.w, i = e.config, a = e.globals; if (this.excludeCollapsedSeriesInYAxis(), this.fallbackToCategory = !1, this.ctx.core.resetGlobals(), this.ctx.core.isMultipleY(), a.axisCharts ? (this.parseDataAxisCharts(t), this.coreUtils.getLargestSeries()) : this.parseDataNonAxisCharts(t), i.chart.stacked) { var s = new V(this.ctx); a.series = s.setNullSeriesToZeroValues(a.series) } this.coreUtils.getSeriesTotals(), a.axisCharts && (a.stackedSeriesTotals = this.coreUtils.getStackedSeriesTotals(), a.stackedSeriesTotalsByGroups = this.coreUtils.getStackedSeriesTotalsByGroups()), this.coreUtils.getPercentSeries(), a.dataFormatXNumeric || a.isXNumeric && ("numeric" !== i.xaxis.type || 0 !== i.labels.length || 0 !== i.xaxis.categories.length) || this.handleExternalLabelsData(t); for (var r = this.coreUtils.getCategoryLabels(a.labels), o = 0; o < r.length; o++)if (Array.isArray(r[o])) { a.isMultiLineX = !0; break } } }, { key: "excludeCollapsedSeriesInYAxis", value: function () { var t = this.w, e = []; t.globals.seriesYAxisMap.forEach((function (i, a) { var s = 0; i.forEach((function (e) { -1 !== t.globals.collapsedSeriesIndices.indexOf(e) && s++ })), s > 0 && s == i.length && e.push(a) })), t.globals.ignoreYAxisIndexes = e.map((function (t) { return t })) } }]), t }(), U = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "scaleSvgNode", value: function (t, e) { var i = parseFloat(t.getAttributeNS(null, "width")), a = parseFloat(t.getAttributeNS(null, "height")); t.setAttributeNS(null, "width", i * e), t.setAttributeNS(null, "height", a * e), t.setAttributeNS(null, "viewBox", "0 0 " + i + " " + a) } }, { key: "getSvgString", value: function () { var t = this; return new Promise((function (e) { var i = t.w, a = i.config.chart.toolbar.export.width, s = i.config.chart.toolbar.export.scale || a / i.globals.svgWidth; s || (s = 1); var r = t.w.globals.dom.Paper.svg(), o = t.w.globals.dom.Paper.node.cloneNode(!0); 1 !== s && t.scaleSvgNode(o, s), t.convertImagesToBase64(o).then((function () { r = (new XMLSerializer).serializeToString(o), e(r.replace(/ /g, " ")) })) })) } }, { key: "convertImagesToBase64", value: function (t) { var e = this, i = t.getElementsByTagName("image"), a = Array.from(i).map((function (t) { var i = t.getAttributeNS("http://www.w3.org/1999/xlink", "href"); return i && !i.startsWith("data:") ? e.getBase64FromUrl(i).then((function (e) { t.setAttributeNS("http://www.w3.org/1999/xlink", "href", e) })).catch((function (t) { console.error("Error converting image to base64:", t) })) : Promise.resolve() })); return Promise.all(a) } }, { key: "getBase64FromUrl", value: function (t) { return new Promise((function (e, i) { var a = new Image; a.crossOrigin = "Anonymous", a.onload = function () { var t = document.createElement("canvas"); t.width = a.width, t.height = a.height, t.getContext("2d").drawImage(a, 0, 0), e(t.toDataURL()) }, a.onerror = i, a.src = t })) } }, { key: "cleanup", value: function () { var t = this.w, e = t.globals.dom.baseEl.getElementsByClassName("apexcharts-xcrosshairs"), i = t.globals.dom.baseEl.getElementsByClassName("apexcharts-ycrosshairs"), a = t.globals.dom.baseEl.querySelectorAll(".apexcharts-zoom-rect, .apexcharts-selection-rect"); Array.prototype.forEach.call(a, (function (t) { t.setAttribute("width", 0) })), e && e[0] && (e[0].setAttribute("x", -500), e[0].setAttribute("x1", -500), e[0].setAttribute("x2", -500)), i && i[0] && (i[0].setAttribute("y", -100), i[0].setAttribute("y1", -100), i[0].setAttribute("y2", -100)) } }, { key: "svgUrl", value: function () { var t = this; return new Promise((function (e) { t.cleanup(), t.getSvgString().then((function (t) { var i = new Blob([t], { type: "image/svg+xml;charset=utf-8" }); e(URL.createObjectURL(i)) })) })) } }, { key: "dataURI", value: function (t) { var e = this; return new Promise((function (i) { var a = e.w, s = t ? t.scale || t.width / a.globals.svgWidth : 1; e.cleanup(); var r = document.createElement("canvas"); r.width = a.globals.svgWidth * s, r.height = parseInt(a.globals.dom.elWrap.style.height, 10) * s; var o = "transparent" !== a.config.chart.background && a.config.chart.background ? a.config.chart.background : "#fff", n = r.getContext("2d"); n.fillStyle = o, n.fillRect(0, 0, r.width * s, r.height * s), e.getSvgString().then((function (t) { var e = "data:image/svg+xml," + encodeURIComponent(t), a = new Image; a.crossOrigin = "anonymous", a.onload = function () { if (n.drawImage(a, 0, 0), r.msToBlob) { var t = r.msToBlob(); i({ blob: t }) } else { var e = r.toDataURL("image/png"); i({ imgURI: e }) } }, a.src = e })) })) } }, { key: "exportToSVG", value: function () { var t = this; this.svgUrl().then((function (e) { t.triggerDownload(e, t.w.config.chart.toolbar.export.svg.filename, ".svg") })) } }, { key: "exportToPng", value: function () { var t = this, e = this.w.config.chart.toolbar.export.scale, i = this.w.config.chart.toolbar.export.width, a = e ? { scale: e } : i ? { width: i } : void 0; this.dataURI(a).then((function (e) { var i = e.imgURI, a = e.blob; a ? navigator.msSaveOrOpenBlob(a, t.w.globals.chartID + ".png") : t.triggerDownload(i, t.w.config.chart.toolbar.export.png.filename, ".png") })) } }, { key: "exportToCSV", value: function (t) { var e = this, i = t.series, a = t.fileName, s = t.columnDelimiter, r = void 0 === s ? "," : s, o = t.lineDelimiter, n = void 0 === o ? "\n" : o, l = this.w; i || (i = l.config.series); var h, c, d = [], g = [], u = "", f = l.globals.series.map((function (t, e) { return -1 === l.globals.collapsedSeriesIndices.indexOf(e) ? t : [] })), x = function (t) { return "function" == typeof l.config.chart.toolbar.export.csv.categoryFormatter ? l.config.chart.toolbar.export.csv.categoryFormatter(t) : "datetime" === l.config.xaxis.type && String(t).length >= 10 ? new Date(t).toDateString() : m.isNumber(t) ? t : t.split(r).join("") }, b = function (t) { return "function" == typeof l.config.chart.toolbar.export.csv.valueFormatter ? l.config.chart.toolbar.export.csv.valueFormatter(t) : t }, v = Math.max.apply(Math, p(i.map((function (t) { return t.data ? t.data.length : 0 })))), y = new _(this.ctx), w = new M(this.ctx), k = function (t) { var i = ""; if (l.globals.axisCharts) { if ("category" === l.config.xaxis.type || l.config.xaxis.convertedCatToNumeric) if (l.globals.isBarHorizontal) { var a = l.globals.yLabelFormatters[0], s = new V(e.ctx).getActiveConfigSeriesIndex(); i = a(l.globals.labels[t], { seriesIndex: s, dataPointIndex: t, w: l }) } else i = w.getLabel(l.globals.labels, l.globals.timescaleLabels, 0, t).text; "datetime" === l.config.xaxis.type && (l.config.xaxis.categories.length ? i = l.config.xaxis.categories[t] : l.config.labels.length && (i = l.config.labels[t])) } else i = l.config.labels[t]; return null === i ? "nullvalue" : (Array.isArray(i) && (i = i.join(" ")), m.isNumber(i) ? i : i.split(r).join("")) }, A = function (t, e) { if (d.length && 0 === e && g.push(d.join(r)), t.data) { t.data = t.data.length && t.data || p(Array(v)).map((function () { return "" })); for (var a = 0; a < t.data.length; a++) { d = []; var s = k(a); if ("nullvalue" !== s) { if (s || (y.isFormatXY() ? s = i[e].data[a].x : y.isFormat2DArray() && (s = i[e].data[a] ? i[e].data[a][0] : "")), 0 === e) { d.push(x(s)); for (var o = 0; o < l.globals.series.length; o++) { var n, h = y.isFormatXY() ? null === (n = i[o].data[a]) || void 0 === n ? void 0 : n.y : f[o][a]; d.push(b(h)) } } ("candlestick" === l.config.chart.type || t.type && "candlestick" === t.type) && (d.pop(), d.push(l.globals.seriesCandleO[e][a]), d.push(l.globals.seriesCandleH[e][a]), d.push(l.globals.seriesCandleL[e][a]), d.push(l.globals.seriesCandleC[e][a])), ("boxPlot" === l.config.chart.type || t.type && "boxPlot" === t.type) && (d.pop(), d.push(l.globals.seriesCandleO[e][a]), d.push(l.globals.seriesCandleH[e][a]), d.push(l.globals.seriesCandleM[e][a]), d.push(l.globals.seriesCandleL[e][a]), d.push(l.globals.seriesCandleC[e][a])), "rangeBar" === l.config.chart.type && (d.pop(), d.push(l.globals.seriesRangeStart[e][a]), d.push(l.globals.seriesRangeEnd[e][a])), d.length && g.push(d.join(r)) } } } }; d.push(l.config.chart.toolbar.export.csv.headerCategory), "boxPlot" === l.config.chart.type ? (d.push("minimum"), d.push("q1"), d.push("median"), d.push("q3"), d.push("maximum")) : "candlestick" === l.config.chart.type ? (d.push("open"), d.push("high"), d.push("low"), d.push("close")) : "rangeBar" === l.config.chart.type ? (d.push("minimum"), d.push("maximum")) : i.map((function (t, e) { var i = (t.name ? t.name : "series-".concat(e)) + ""; l.globals.axisCharts && d.push(i.split(r).join("") ? i.split(r).join("") : "series-".concat(e)) })), l.globals.axisCharts || (d.push(l.config.chart.toolbar.export.csv.headerValue), g.push(d.join(r))), l.globals.allSeriesHasEqualX || !l.globals.axisCharts || l.config.xaxis.categories.length || l.config.labels.length ? i.map((function (t, e) { l.globals.axisCharts ? A(t, e) : ((d = []).push(x(l.globals.labels[e])), d.push(b(f[e])), g.push(d.join(r))) })) : (h = new Set, c = {}, i.forEach((function (t, e) { null == t || t.data.forEach((function (t) { var a, s; if (y.isFormatXY()) a = t.x, s = t.y; else { if (!y.isFormat2DArray()) return; a = t[0], s = t[1] } c[a] || (c[a] = Array(i.length).fill("")), c[a][e] = b(s), h.add(a) })) })), d.length && g.push(d.join(r)), Array.from(h).sort().forEach((function (t) { g.push([x(t), c[t].join(r)]) }))), u += g.join(n), this.triggerDownload("data:text/csv; charset=utf-8," + encodeURIComponent("\ufeff" + u), a || l.config.chart.toolbar.export.csv.filename, ".csv") } }, { key: "triggerDownload", value: function (t, e, i) { var a = document.createElement("a"); a.href = t, a.download = (e || this.w.globals.chartID) + i, document.body.appendChild(a), a.click(), document.body.removeChild(a) } }]), t }(), q = function () { function t(e, a) { i(this, t), this.ctx = e, this.elgrid = a, this.w = e.w; var s = this.w; this.axesUtils = new M(e), 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()), 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] } return s(t, [{ key: "drawXaxis", value: function () { var t = this.w, e = new k(this.ctx), i = e.group({ class: "apexcharts-xaxis", transform: "translate(".concat(t.config.xaxis.offsetX, ", ").concat(t.config.xaxis.offsetY, ")") }), a = e.group({ class: "apexcharts-xaxis-texts-g", transform: "translate(".concat(t.globals.translateXAxisX, ", ").concat(t.globals.translateXAxisY, ")") }); i.add(a); for (var s = [], r = 0; r < this.xaxisLabels.length; r++)s.push(this.xaxisLabels[r]); if (this.drawXAxisLabelAndGroup(!0, e, a, s, t.globals.isXNumeric, (function (t, e) { return e })), t.globals.hasXaxisGroups) { var o = t.globals.groups; s = []; for (var n = 0; n < o.length; n++)s.push(o[n].title); var l = {}; t.config.xaxis.group.style && (l.xaxisFontSize = t.config.xaxis.group.style.fontSize, l.xaxisFontFamily = t.config.xaxis.group.style.fontFamily, l.xaxisForeColors = t.config.xaxis.group.style.colors, l.fontWeight = t.config.xaxis.group.style.fontWeight, l.cssClass = t.config.xaxis.group.style.cssClass), this.drawXAxisLabelAndGroup(!1, e, a, s, !1, (function (t, e) { return o[t].cols * e }), l) } if (void 0 !== t.config.xaxis.title.text) { var h = e.group({ class: "apexcharts-xaxis-title" }), c = 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 }); h.add(c), i.add(h) } if (t.config.xaxis.axisBorder.show) { var d = t.globals.barPadForNumericAxis, g = e.drawLine(t.globals.padHorizontal + t.config.xaxis.axisBorder.offsetX - d, this.offY, this.xaxisBorderWidth + d, this.offY, t.config.xaxis.axisBorder.color, 0, this.xaxisBorderHeight); this.elgrid && this.elgrid.elGridBorders && t.config.grid.show ? this.elgrid.elGridBorders.add(g) : i.add(g) } return i } }, { key: "drawXAxisLabelAndGroup", value: function (t, e, i, a, s, r) { var o, n = this, l = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : {}, h = [], c = [], d = this.w, g = l.xaxisFontSize || this.xaxisFontSize, u = l.xaxisFontFamily || this.xaxisFontFamily, f = l.xaxisForeColors || this.xaxisForeColors, p = l.fontWeight || d.config.xaxis.labels.style.fontWeight, x = l.cssClass || d.config.xaxis.labels.style.cssClass, b = d.globals.padHorizontal, v = a.length, m = "category" === d.config.xaxis.type ? d.globals.dataPoints : v; if (0 === m && v > m && (m = v), s) { var y = m > 1 ? m - 1 : m; o = d.globals.gridWidth / Math.min(y, v - 1), b = b + r(0, o) / 2 + d.config.xaxis.labels.offsetX } else o = d.globals.gridWidth / m, b = b + r(0, o) + d.config.xaxis.labels.offsetX; for (var w = function (s) { var l = b - r(s, o) / 2 + d.config.xaxis.labels.offsetX; 0 === s && 1 === v && o / 2 === b && 1 === m && (l = d.globals.gridWidth / 2); var y = n.axesUtils.getLabel(a, d.globals.timescaleLabels, l, s, h, g, t), w = 28; d.globals.rotateXLabels && t && (w = 22), d.config.xaxis.title.text && "top" === d.config.xaxis.position && (w += parseFloat(d.config.xaxis.title.style.fontSize) + 2), t || (w = w + parseFloat(g) + (d.globals.xAxisLabelsHeight - d.globals.xAxisGroupLabelsHeight) + (d.globals.rotateXLabels ? 10 : 0)), y = void 0 !== d.config.xaxis.tickAmount && "dataPoints" !== d.config.xaxis.tickAmount && "datetime" !== d.config.xaxis.type ? n.axesUtils.checkLabelBasedOnTickamount(s, y, v) : n.axesUtils.checkForOverflowingLabels(s, y, v, h, c); if (d.config.xaxis.labels.show) { var k = e.drawText({ x: y.x, y: n.offY + d.config.xaxis.labels.offsetY + w - ("top" === d.config.xaxis.position ? d.globals.xAxisHeight + d.config.xaxis.axisTicks.height - 2 : 0), text: y.text, textAnchor: "middle", fontWeight: y.isBold ? 600 : p, fontSize: g, fontFamily: u, foreColor: Array.isArray(f) ? t && d.config.xaxis.convertedCatToNumeric ? f[d.globals.minX + s - 1] : f[s] : f, isPlainText: !1, cssClass: (t ? "apexcharts-xaxis-label " : "apexcharts-xaxis-group-label ") + x }); if (i.add(k), k.on("click", (function (t) { if ("function" == typeof d.config.chart.events.xAxisLabelClick) { var e = Object.assign({}, d, { labelIndex: s }); d.config.chart.events.xAxisLabelClick(t, n.ctx, e) } })), t) { var A = document.createElementNS(d.globals.SVGNS, "title"); A.textContent = Array.isArray(y.text) ? y.text.join(" ") : y.text, k.node.appendChild(A), "" !== y.text && (h.push(y.text), c.push(y)) } } s < v - 1 && (b += r(s + 1, o)) }, k = 0; k <= v - 1; k++)w(k) } }, { key: "drawXaxisInversed", value: function (t) { var e, i, a = this, s = this.w, r = new k(this.ctx), o = s.config.yaxis[0].opposite ? s.globals.translateYAxisX[t] : 0, n = r.group({ class: "apexcharts-yaxis apexcharts-xaxis-inversed", rel: t }), l = r.group({ class: "apexcharts-yaxis-texts-g apexcharts-xaxis-inversed-texts-g", transform: "translate(" + o + ", 0)" }); n.add(l); var h = []; if (s.config.yaxis[t].show) for (var c = 0; c < this.xaxisLabels.length; c++)h.push(this.xaxisLabels[c]); e = s.globals.gridHeight / h.length, i = -e / 2.2; var d = s.globals.yLabelFormatters[0], g = s.config.yaxis[0].labels; if (g.show) for (var u = function (o) { var n = void 0 === h[o] ? "" : h[o]; n = d(n, { seriesIndex: t, dataPointIndex: o, w: s }); var c = a.axesUtils.getYAxisForeColor(g.style.colors, t), u = 0; Array.isArray(n) && (u = n.length / 2 * parseInt(g.style.fontSize, 10)); var f = g.offsetX - 15, p = "end"; a.yaxis.opposite && (p = "start"), "left" === s.config.yaxis[0].labels.align ? (f = g.offsetX, p = "start") : "center" === s.config.yaxis[0].labels.align ? (f = g.offsetX, p = "middle") : "right" === s.config.yaxis[0].labels.align && (p = "end"); var x = r.drawText({ x: f, y: i + e + g.offsetY - u, text: n, textAnchor: p, foreColor: Array.isArray(c) ? c[o] : c, fontSize: g.style.fontSize, fontFamily: g.style.fontFamily, fontWeight: g.style.fontWeight, isPlainText: !1, cssClass: "apexcharts-yaxis-label " + g.style.cssClass, maxWidth: g.maxWidth }); l.add(x), x.on("click", (function (t) { if ("function" == typeof s.config.chart.events.xAxisLabelClick) { var e = Object.assign({}, s, { labelIndex: o }); s.config.chart.events.xAxisLabelClick(t, a.ctx, e) } })); var b = document.createElementNS(s.globals.SVGNS, "title"); if (b.textContent = Array.isArray(n) ? n.join(" ") : n, x.node.appendChild(b), 0 !== s.config.yaxis[t].labels.rotate) { var v = r.rotateAroundCenter(x.node); x.node.setAttribute("transform", "rotate(".concat(s.config.yaxis[t].labels.rotate, " 0 ").concat(v.y, ")")) } i += e }, f = 0; f <= h.length - 1; f++)u(f); if (void 0 !== s.config.yaxis[0].title.text) { var p = r.group({ class: "apexcharts-yaxis-title apexcharts-xaxis-title-inversed", transform: "translate(" + o + ", 0)" }), x = r.drawText({ x: s.config.yaxis[0].title.offsetX, y: s.globals.gridHeight / 2 + s.config.yaxis[0].title.offsetY, text: s.config.yaxis[0].title.text, textAnchor: "middle", foreColor: s.config.yaxis[0].title.style.color, fontSize: s.config.yaxis[0].title.style.fontSize, fontWeight: s.config.yaxis[0].title.style.fontWeight, fontFamily: s.config.yaxis[0].title.style.fontFamily, cssClass: "apexcharts-yaxis-title-text " + s.config.yaxis[0].title.style.cssClass }); p.add(x), n.add(p) } var b = 0; this.isCategoryBarHorizontal && s.config.yaxis[0].opposite && (b = s.globals.gridWidth); var v = s.config.xaxis.axisBorder; if (v.show) { var m = r.drawLine(s.globals.padHorizontal + v.offsetX + b, 1 + v.offsetY, s.globals.padHorizontal + v.offsetX + b, s.globals.gridHeight + v.offsetY, v.color, 0); this.elgrid && this.elgrid.elGridBorders && s.config.grid.show ? this.elgrid.elGridBorders.add(m) : n.add(m) } return s.config.yaxis[0].axisTicks.show && this.axesUtils.drawYAxisTicks(b, h.length, s.config.yaxis[0].axisBorder, s.config.yaxis[0].axisTicks, 0, e, n), n } }, { key: "drawXaxisTicks", value: function (t, e, i) { var a = this.w, s = t; if (!(t < 0 || t - 2 > a.globals.gridWidth)) { var r = this.offY + a.config.xaxis.axisTicks.offsetY; if (e = e + r + a.config.xaxis.axisTicks.height, "top" === a.config.xaxis.position && (e = r - a.config.xaxis.axisTicks.height), a.config.xaxis.axisTicks.show) { var o = new k(this.ctx).drawLine(t + a.config.xaxis.axisTicks.offsetX, r + a.config.xaxis.offsetY, s + a.config.xaxis.axisTicks.offsetX, e + a.config.xaxis.offsetY, a.config.xaxis.axisTicks.color); i.add(o), o.node.classList.add("apexcharts-xaxis-tick") } } } }, { key: "getXAxisTicksPositions", value: function () { var t = this.w, e = [], i = this.xaxisLabels.length, a = t.globals.padHorizontal; if (t.globals.timescaleLabels.length > 0) for (var s = 0; s < i; s++)a = this.xaxisLabels[s].position, e.push(a); else for (var r = i, o = 0; o < r; o++) { var n = r; t.globals.isXNumeric && "bar" !== t.config.chart.type && (n -= 1), a += t.globals.gridWidth / n, e.push(a) } return e } }, { key: "xAxisLabelCorrections", value: function () { var t = this.w, e = new k(this.ctx), i = t.globals.dom.baseEl.querySelector(".apexcharts-xaxis-texts-g"), a = t.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-texts-g text:not(.apexcharts-xaxis-group-label)"), s = t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis-inversed text"), r = t.globals.dom.baseEl.querySelectorAll(".apexcharts-xaxis-inversed-texts-g text tspan"); if (t.globals.rotateXLabels || t.config.xaxis.labels.rotateAlways) for (var o = 0; o < a.length; o++) { var n = e.rotateAroundCenter(a[o]); n.y = n.y - 1, n.x = n.x + 1, a[o].setAttribute("transform", "rotate(".concat(t.config.xaxis.labels.rotate, " ").concat(n.x, " ").concat(n.y, ")")), a[o].setAttribute("text-anchor", "end"); i.setAttribute("transform", "translate(0, ".concat(-10, ")")); var l = a[o].childNodes; t.config.xaxis.labels.trim && Array.prototype.forEach.call(l, (function (i) { e.placeTextWithEllipsis(i, i.textContent, t.globals.xAxisLabelsHeight - ("bottom" === t.config.legend.position ? 20 : 10)) })) } else !function () { for (var i = t.globals.gridWidth / (t.globals.labels.length + 1), s = 0; s < a.length; s++) { var r = a[s].childNodes; t.config.xaxis.labels.trim && "datetime" !== t.config.xaxis.type && Array.prototype.forEach.call(r, (function (t) { e.placeTextWithEllipsis(t, t.textContent, i) })) } }(); if (s.length > 0) { var h = s[s.length - 1].getBBox(), c = s[0].getBBox(); h.x < -20 && s[s.length - 1].parentNode.removeChild(s[s.length - 1]), c.x + c.width > t.globals.gridWidth && !t.globals.isBarHorizontal && s[0].parentNode.removeChild(s[0]); for (var d = 0; d < r.length; d++)e.placeTextWithEllipsis(r[d], r[d].textContent, t.config.yaxis[0].labels.maxWidth - (t.config.yaxis[0].title.text ? 2 * parseFloat(t.config.yaxis[0].title.style.fontSize) : 0) - 15) } } }]), t }(), Z = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w; var a = this.w; this.xaxisLabels = a.globals.labels.slice(), this.axesUtils = new M(e), this.isRangeBar = a.globals.seriesRange.length && a.globals.isBarHorizontal, a.globals.timescaleLabels.length > 0 && (this.xaxisLabels = a.globals.timescaleLabels.slice()) } return s(t, [{ key: "drawGridArea", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, e = this.w, i = new k(this.ctx); t || (t = i.group({ class: "apexcharts-grid" })); var a = i.drawLine(e.globals.padHorizontal, 1, e.globals.padHorizontal, e.globals.gridHeight, "transparent"), s = i.drawLine(e.globals.padHorizontal, e.globals.gridHeight, e.globals.gridWidth, e.globals.gridHeight, "transparent"); return t.add(s), t.add(a), t } }, { key: "drawGrid", value: function () { if (this.w.globals.axisCharts) { var t = this.renderGrid(); return this.drawGridArea(t.el), t } return null } }, { key: "createGridMask", value: function () { var t = this.w, e = t.globals, i = new k(this.ctx), a = Array.isArray(t.config.stroke.width) ? Math.max.apply(Math, p(t.config.stroke.width)) : t.config.stroke.width, s = function (t) { var i = document.createElementNS(e.SVGNS, "clipPath"); return i.setAttribute("id", t), i }; e.dom.elGridRectMask = s("gridRectMask".concat(e.cuid)), e.dom.elGridRectBarMask = s("gridRectBarMask".concat(e.cuid)), e.dom.elGridRectMarkerMask = s("gridRectMarkerMask".concat(e.cuid)), e.dom.elForecastMask = s("forecastMask".concat(e.cuid)), e.dom.elNonForecastMask = s("nonForecastMask".concat(e.cuid)); var r = 0, o = 0; (["bar", "rangeBar", "candlestick", "boxPlot"].includes(t.config.chart.type) || t.globals.comboBarCount > 0) && t.globals.isXNumeric && !t.globals.isBarHorizontal && (r = Math.max(t.config.grid.padding.left, e.barPadForNumericAxis), o = Math.max(t.config.grid.padding.right, e.barPadForNumericAxis)), e.dom.elGridRect = i.drawRect(0, 0, e.gridWidth, e.gridHeight, 0, "#fff"), e.dom.elGridRectBar = i.drawRect(-a / 2 - r - 2, -a / 2 - 2, e.gridWidth + a + o + r + 4, e.gridHeight + a + 4, 0, "#fff"); var n = t.globals.markers.largestSize; e.dom.elGridRectMarker = i.drawRect(-n, -n, e.gridWidth + 2 * n, e.gridHeight + 2 * n, 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); var l = e.dom.baseEl.querySelector("defs"); l.appendChild(e.dom.elGridRectMask), l.appendChild(e.dom.elGridRectBarMask), l.appendChild(e.dom.elGridRectMarkerMask), l.appendChild(e.dom.elForecastMask), l.appendChild(e.dom.elNonForecastMask) } }, { key: "_drawGridLines", value: function (t) { var e = t.i, i = t.x1, a = t.y1, s = t.x2, r = t.y2, o = t.xCount, n = t.parent, l = this.w; if (!(0 === e && l.globals.skipFirstTimelinelabel || e === o - 1 && l.globals.skipLastTimelinelabel && !l.config.xaxis.labels.formatter || "radar" === l.config.chart.type)) { l.config.grid.xaxis.lines.show && this._drawGridLine({ i: e, x1: i, y1: a, x2: s, y2: r, xCount: o, parent: n }); var h = 0; if (l.globals.hasXaxisGroups && "between" === l.config.xaxis.tickPlacement) { var c = l.globals.groups; if (c) { for (var d = 0, g = 0; d < e && g < c.length; g++)d += c[g].cols; d === e && (h = .6 * l.globals.xAxisLabelsHeight) } } new q(this.ctx).drawXaxisTicks(i, h, l.globals.dom.elGraphical) } } }, { key: "_drawGridLine", value: function (t) { var e = t.i, i = t.x1, a = t.y1, s = t.x2, r = t.y2, o = t.xCount, n = t.parent, l = this.w, h = n.node.classList.contains("apexcharts-gridlines-horizontal"), c = l.globals.barPadForNumericAxis, d = 0 === a && 0 === r || 0 === i && 0 === s || a === l.globals.gridHeight && r === l.globals.gridHeight || l.globals.isBarHorizontal && (0 === e || e === o - 1), g = new k(this).drawLine(i - (h ? c : 0), a, s + (h ? c : 0), r, l.config.grid.borderColor, l.config.grid.strokeDashArray); g.node.classList.add("apexcharts-gridline"), d && l.config.grid.show ? this.elGridBorders.add(g) : n.add(g) } }, { key: "_drawGridBandRect", value: function (t) { var e = t.c, i = t.x1, a = t.y1, s = t.x2, r = t.y2, o = t.type, n = this.w, l = new k(this.ctx), h = n.globals.barPadForNumericAxis, c = n.config.grid[o].colors[e], d = l.drawRect(i - ("row" === o ? h : 0), a, s + ("row" === o ? 2 * h : 0), r, 0, c, n.config.grid[o].opacity); this.elg.add(d), d.attr("clip-path", "url(#gridRectMask".concat(n.globals.cuid, ")")), d.node.classList.add("apexcharts-grid-".concat(o)) } }, { key: "_drawXYLines", value: function (t) { var e = this, i = t.xCount, a = t.tickAmount, s = this.w; if (s.config.grid.xaxis.lines.show || s.config.xaxis.axisTicks.show) { var r, o = s.globals.padHorizontal, n = s.globals.gridHeight; s.globals.timescaleLabels.length ? function (t) { for (var a = t.xC, s = t.x1, r = t.y1, o = t.x2, n = t.y2, l = 0; l < a; l++)s = e.xaxisLabels[l].position, o = e.xaxisLabels[l].position, e._drawGridLines({ i: l, x1: s, y1: r, x2: o, y2: n, xCount: i, parent: e.elgridLinesV }) }({ xC: i, x1: o, y1: 0, x2: r, y2: n }) : (s.globals.isXNumeric && (i = s.globals.xAxisScale.result.length), function (t) { for (var a = t.xC, r = t.x1, o = t.y1, n = t.x2, l = t.y2, h = 0; h < a + (s.globals.isXNumeric ? 0 : 1); h++)0 === h && 1 === a && 1 === s.globals.dataPoints && (n = r = s.globals.gridWidth / 2), e._drawGridLines({ i: h, x1: r, y1: o, x2: n, y2: l, xCount: i, parent: e.elgridLinesV }), n = r += s.globals.gridWidth / (s.globals.isXNumeric ? a - 1 : a) }({ xC: i, x1: o, y1: 0, x2: r, y2: n })) } if (s.config.grid.yaxis.lines.show) { var l = 0, h = 0, c = s.globals.gridWidth, d = a + 1; this.isRangeBar && (d = s.globals.labels.length); for (var g = 0; g < d + (this.isRangeBar ? 1 : 0); g++)this._drawGridLine({ i: g, xCount: d + (this.isRangeBar ? 1 : 0), x1: 0, y1: l, x2: c, y2: h, parent: this.elgridLinesH }), h = l += s.globals.gridHeight / (this.isRangeBar ? d : a) } } }, { key: "_drawInvertedXYLines", value: function (t) { var e = t.xCount, i = this.w; if (i.config.grid.xaxis.lines.show || i.config.xaxis.axisTicks.show) for (var a, s = i.globals.padHorizontal, r = i.globals.gridHeight, o = 0; o < e + 1; o++) { i.config.grid.xaxis.lines.show && this._drawGridLine({ i: o, xCount: e + 1, x1: s, y1: 0, x2: a, y2: r, parent: this.elgridLinesV }), new q(this.ctx).drawXaxisTicks(s, 0, i.globals.dom.elGraphical), a = s += i.globals.gridWidth / e } if (i.config.grid.yaxis.lines.show) for (var n = 0, l = 0, h = i.globals.gridWidth, c = 0; c < i.globals.dataPoints + 1; c++)this._drawGridLine({ i: c, xCount: i.globals.dataPoints + 1, x1: 0, y1: n, x2: h, y2: l, parent: this.elgridLinesH }), l = n += i.globals.gridHeight / i.globals.dataPoints } }, { key: "renderGrid", value: function () { var t = this.w, e = t.globals, i = new k(this.ctx); this.elg = i.group({ class: "apexcharts-grid" }), this.elgridLinesH = i.group({ class: "apexcharts-gridlines-horizontal" }), this.elgridLinesV = i.group({ class: "apexcharts-gridlines-vertical" }), this.elGridBorders = i.group({ class: "apexcharts-grid-borders" }), this.elg.add(this.elgridLinesH), this.elg.add(this.elgridLinesV), t.config.grid.show || (this.elgridLinesV.hide(), this.elgridLinesH.hide(), this.elGridBorders.hide()); for (var a = 0; a < e.seriesYAxisMap.length && e.ignoreYAxisIndexes.includes(a);)a++; a === e.seriesYAxisMap.length && (a = 0); var s, r = e.yAxisScale[a].result.length - 1; if (!e.isBarHorizontal || this.isRangeBar) { var o, n, l; if (s = this.xaxisLabels.length, this.isRangeBar) r = e.labels.length, t.config.xaxis.tickAmount && t.config.xaxis.labels.formatter && (s = t.config.xaxis.tickAmount), (null === (o = e.yAxisScale) || void 0 === o || null === (n = o[a]) || void 0 === n || null === (l = n.result) || void 0 === l ? void 0 : l.length) > 0 && "datetime" !== t.config.xaxis.type && (s = e.yAxisScale[a].result.length - 1); this._drawXYLines({ xCount: s, tickAmount: r }) } else s = r, r = e.xTickAmount, this._drawInvertedXYLines({ xCount: s, tickAmount: r }); return this.drawGridBands(s, r), { el: this.elg, elGridBorders: this.elGridBorders, xAxisTickWidth: e.gridWidth / s } } }, { key: "drawGridBands", value: function (t, e) { var i, a, s = this, r = this.w; if ((null === (i = r.config.grid.row.colors) || void 0 === i ? void 0 : i.length) > 0 && function (t, i, a, o, n, l) { for (var h = 0, c = 0; h < i; h++, c++)c >= r.config.grid[t].colors.length && (c = 0), s._drawGridBandRect({ c: c, x1: a, y1: o, x2: n, y2: l, type: t }), o += r.globals.gridHeight / e }("row", e, 0, 0, r.globals.gridWidth, r.globals.gridHeight / e), (null === (a = r.config.grid.column.colors) || void 0 === a ? void 0 : a.length) > 0) { var o = r.globals.isBarHorizontal || "on" !== r.config.xaxis.tickPlacement || "category" !== r.config.xaxis.type && !r.config.xaxis.convertedCatToNumeric ? t : t - 1; r.globals.isXNumeric && (o = r.globals.xAxisScale.result.length - 1); for (var n = r.globals.padHorizontal, l = r.globals.padHorizontal + r.globals.gridWidth / o, h = r.globals.gridHeight, c = 0, d = 0; c < t; c++, d++) { var g; if (d >= r.config.grid.column.colors.length && (d = 0), "datetime" === r.config.xaxis.type) n = this.xaxisLabels[c].position, l = ((null === (g = this.xaxisLabels[c + 1]) || void 0 === g ? void 0 : g.position) || r.globals.gridWidth) - this.xaxisLabels[c].position; this._drawGridBandRect({ c: d, x1: n, y1: 0, x2: l, y2: h, type: "column" }), n += r.globals.gridWidth / o } } } }]), t }(), $ = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w, this.coreUtils = new A(this.ctx) } return s(t, [{ key: "niceScale", value: function (t, e) { var i, a, s, r, o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, n = 1e-11, l = this.w, h = l.globals; h.isBarHorizontal ? (i = l.config.xaxis, a = Math.max((h.svgWidth - 100) / 25, 2)) : (i = l.config.yaxis[o], a = Math.max((h.svgHeight - 100) / 15, 2)), m.isNumber(a) || (a = 10), s = void 0 !== i.min && null !== i.min, r = void 0 !== i.max && null !== i.min; var c = void 0 !== i.stepSize && null !== i.stepSize, d = void 0 !== i.tickAmount && null !== i.tickAmount, g = d ? i.tickAmount : h.niceScaleDefaultTicks[Math.min(Math.round(a / 2), h.niceScaleDefaultTicks.length - 1)]; if (h.isMultipleYAxis && !d && h.multiAxisTickAmount > 0 && (g = h.multiAxisTickAmount, d = !0), g = "dataPoints" === g ? h.dataPoints - 1 : Math.abs(Math.round(g)), (t === Number.MIN_VALUE && 0 === e || !m.isNumber(t) && !m.isNumber(e) || t === Number.MIN_VALUE && e === -Number.MAX_VALUE) && (t = m.isNumber(i.min) ? i.min : 0, e = m.isNumber(i.max) ? i.max : t + g, h.allSeriesCollapsed = !1), t > e) { console.warn("axis.min cannot be greater than axis.max: swapping min and max"); var u = e; e = t, t = u } else t === e && (t = 0 === t ? 0 : t - 1, e = 0 === e ? 2 : e + 1); var f = []; g < 1 && (g = 1); var p = g, x = Math.abs(e - t); !s && t > 0 && t / x < .15 && (t = 0, s = !0), !r && e < 0 && -e / x < .15 && (e = 0, r = !0); var b = (x = Math.abs(e - t)) / p, v = b, y = Math.floor(Math.log10(v)), w = Math.pow(10, y), k = Math.ceil(v / w); if (b = v = (k = h.niceScaleAllowedMagMsd[0 === h.yValueDecimal ? 0 : 1][k]) * w, h.isBarHorizontal && i.stepSize && "datetime" !== i.type ? (b = i.stepSize, c = !0) : c && (b = i.stepSize), c && i.forceNiceScale) { var A = Math.floor(Math.log10(b)); b *= Math.pow(10, y - A) } if (s && r) { var S = x / p; if (d) if (c) if (0 != m.mod(x, b)) { var C = m.getGCD(b, S); b = S / C < 10 ? C : S } else 0 == m.mod(b, S) ? b = S : (S = b, d = !1); else b = S; else if (c) 0 == m.mod(x, b) ? S = b : b = S; else if (0 == m.mod(x, b)) S = b; else { S = x / (p = Math.ceil(x / b)); var L = m.getGCD(x, b); x / L < a && (S = L), b = S } p = Math.round(x / b) } else { if (s || r) { if (r) if (d) t = e - b * p; else { var P = t; t = b * Math.floor(t / b), Math.abs(e - t) / m.getGCD(x, b) > a && (t = e - b * g, t += b * Math.floor((P - t) / b)) } else if (s) if (d) e = t + b * p; else { var M = e; e = b * Math.ceil(e / b), Math.abs(e - t) / m.getGCD(x, b) > a && (e = t + b * g, e += b * Math.ceil((M - e) / b)) } } else if (h.isMultipleYAxis && d) { var I = b * Math.floor(t / b), T = I + b * p; T < e && (b *= 2), T = e, e = (t = I) + b * p, x = Math.abs(e - t), t > 0 && t < Math.abs(T - e) && (t = 0, e = b * p), e < 0 && -e < Math.abs(I - t) && (e = 0, t = -b * p) } else t = b * Math.floor(t / b), e = b * Math.ceil(e / b); x = Math.abs(e - t), b = m.getGCD(x, b), p = Math.round(x / b) } if (d || s || r || (p = Math.ceil((x - n) / (b + n))) > 16 && m.getPrimeFactors(p).length < 2 && p++, !d && i.forceNiceScale && 0 === h.yValueDecimal && p > x && (p = x, b = Math.round(x / p)), p > a && (!d && !c || i.forceNiceScale)) { var z = m.getPrimeFactors(p), X = z.length - 1, E = p; t: for (var Y = 0; Y < X; Y++)for (var R = 0; R <= X - Y; R++) { for (var F = Math.min(R + Y, X), D = E, H = 1, O = R; O <= F; O++)H *= z[O]; if ((D /= H) < a) { E = D; break t } } b = E === p ? x : x / E, p = Math.round(x / b) } h.isMultipleYAxis && 0 == h.multiAxisTickAmount && h.ignoreYAxisIndexes.indexOf(o) < 0 && (h.multiAxisTickAmount = p); var N = t - b, W = b * n; do { N += b, f.push(m.stripNumber(N, 7)) } while (e - N > W); return { result: f, niceMin: f[0], niceMax: f[f.length - 1] } } }, { key: "linearScale", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 10, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : void 0, r = Math.abs(e - t), o = []; if (t === e) return { result: o = [t], niceMin: o[0], niceMax: o[o.length - 1] }; "dataPoints" === (i = this._adjustTicksForSmallRange(i, a, r)) && (i = this.w.globals.dataPoints - 1), s || (s = r / i), s = Math.round(10 * (s + Number.EPSILON)) / 10, i === Number.MAX_VALUE && (i = 5, s = 1); for (var n = t; i >= 0;)o.push(n), n = m.preciseAddition(n, s), i -= 1; return { result: o, niceMin: o[0], niceMax: o[o.length - 1] } } }, { key: "logarithmicScaleNice", value: function (t, e, i) { e <= 0 && (e = Math.max(t, i)), t <= 0 && (t = Math.min(e, i)); for (var a = [], s = Math.ceil(Math.log(e) / Math.log(i) + 1), r = Math.floor(Math.log(t) / Math.log(i)); r < s; r++)a.push(Math.pow(i, r)); return { result: a, niceMin: a[0], niceMax: a[a.length - 1] } } }, { key: "logarithmicScale", value: function (t, e, i) { e <= 0 && (e = Math.max(t, i)), t <= 0 && (t = Math.min(e, i)); for (var a = [], s = Math.log(e) / Math.log(i), r = Math.log(t) / Math.log(i), o = s - r, n = Math.round(o), l = o / n, h = 0, c = r; h < n; h++, c += l)a.push(Math.pow(i, c)); return a.push(Math.pow(i, s)), { result: a, niceMin: t, niceMax: e } } }, { key: "_adjustTicksForSmallRange", value: function (t, e, i) { var a = t; if (void 0 !== e && this.w.config.yaxis[e].labels.formatter && void 0 === this.w.config.yaxis[e].tickAmount) { var s = Number(this.w.config.yaxis[e].labels.formatter(1)); m.isNumber(s) && 0 === this.w.globals.yValueDecimal && (a = Math.ceil(i)) } return a < t ? a : t } }, { key: "setYScaleForIndex", value: function (t, e, i) { var a = this.w.globals, s = this.w.config, r = a.isBarHorizontal ? s.xaxis : s.yaxis[t]; void 0 === a.yAxisScale[t] && (a.yAxisScale[t] = []); var o = Math.abs(i - e); r.logarithmic && o <= 5 && (a.invalidLogScale = !0), r.logarithmic && o > 5 ? (a.allSeriesCollapsed = !1, a.yAxisScale[t] = r.forceNiceScale ? this.logarithmicScaleNice(e, i, r.logBase) : this.logarithmicScale(e, i, r.logBase)) : i !== -Number.MAX_VALUE && m.isNumber(i) && e !== Number.MAX_VALUE && m.isNumber(e) ? (a.allSeriesCollapsed = !1, a.yAxisScale[t] = this.niceScale(e, i, t)) : a.yAxisScale[t] = this.niceScale(Number.MIN_VALUE, 0, t) } }, { key: "setXScale", value: function (t, e) { var i = this.w, a = i.globals, s = Math.abs(e - t); if (e !== -Number.MAX_VALUE && m.isNumber(e)) { var r = a.xTickAmount + 1; s < 10 && s > 1 && (r = s), a.xAxisScale = this.linearScale(t, e, r, 0, i.config.xaxis.stepSize) } else a.xAxisScale = this.linearScale(0, 10, 10); return a.xAxisScale } }, { key: "scaleMultipleYAxes", value: function () { var t = this, e = this.w.config, i = this.w.globals; this.coreUtils.setSeriesYAxisMappings(); var a = i.seriesYAxisMap, s = i.minYArr, r = i.maxYArr; i.allSeriesCollapsed = !0, i.barGroups = [], a.forEach((function (a, o) { var n = []; a.forEach((function (t) { var i = e.series[t].group; n.indexOf(i) < 0 && n.push(i) })), a.length > 0 ? function () { var l, h, c = Number.MAX_VALUE, d = -Number.MAX_VALUE, g = c, u = d; if (e.chart.stacked) !function () { var t = new Array(i.dataPoints).fill(0), s = [], r = [], f = []; n.forEach((function () { s.push(t.map((function () { return Number.MIN_VALUE }))), r.push(t.map((function () { return Number.MIN_VALUE }))), f.push(t.map((function () { return Number.MIN_VALUE }))) })); for (var p = function (t) { !l && e.series[a[t]].type && (l = e.series[a[t]].type); var c = a[t]; h = e.series[c].group ? e.series[c].group : "axis-".concat(o), !(i.collapsedSeriesIndices.indexOf(c) < 0 && i.ancillaryCollapsedSeriesIndices.indexOf(c) < 0) || (i.allSeriesCollapsed = !1, n.forEach((function (t, a) { if (e.series[c].group === t) for (var o = 0; o < i.series[c].length; o++) { var n = i.series[c][o]; n >= 0 ? r[a][o] += n : f[a][o] += n, s[a][o] += n, g = Math.min(g, n), u = Math.max(u, n) } }))), "bar" !== l && "column" !== l || i.barGroups.push(h) }, x = 0; x < a.length; x++)p(x); l || (l = e.chart.type), "bar" === l || "column" === l ? n.forEach((function (t, e) { c = Math.min(c, Math.min.apply(null, f[e])), d = Math.max(d, Math.max.apply(null, r[e])) })) : (n.forEach((function (t, e) { g = Math.min(g, Math.min.apply(null, s[e])), u = Math.max(u, Math.max.apply(null, s[e])) })), c = g, d = u), c === Number.MIN_VALUE && d === Number.MIN_VALUE && (d = -Number.MAX_VALUE) }(); else for (var f = 0; f < a.length; f++) { var p = a[f]; c = Math.min(c, s[p]), d = Math.max(d, r[p]), !(i.collapsedSeriesIndices.indexOf(p) < 0 && i.ancillaryCollapsedSeriesIndices.indexOf(p) < 0) || (i.allSeriesCollapsed = !1) } void 0 !== e.yaxis[o].min && (c = "function" == typeof e.yaxis[o].min ? e.yaxis[o].min(c) : e.yaxis[o].min), void 0 !== e.yaxis[o].max && (d = "function" == typeof e.yaxis[o].max ? e.yaxis[o].max(d) : e.yaxis[o].max), i.barGroups = i.barGroups.filter((function (t, e, i) { return i.indexOf(t) === e })), t.setYScaleForIndex(o, c, d), a.forEach((function (t) { s[t] = i.yAxisScale[o].niceMin, r[t] = i.yAxisScale[o].niceMax })) }() : t.setYScaleForIndex(o, 0, -Number.MAX_VALUE) })) } }]), t }(), J = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w, this.scales = new $(e) } return s(t, [{ key: "init", value: function () { this.setYRange(), this.setXRange(), this.setZRange() } }, { key: "getMinYMaxY", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Number.MAX_VALUE, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : -Number.MAX_VALUE, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null, s = this.w.config, r = this.w.globals, o = -Number.MAX_VALUE, n = Number.MIN_VALUE; null === a && (a = t + 1); var l = r.series, h = l, c = l; "candlestick" === s.chart.type ? (h = r.seriesCandleL, c = r.seriesCandleH) : "boxPlot" === s.chart.type ? (h = r.seriesCandleO, c = r.seriesCandleC) : r.isRangeData && (h = r.seriesRangeStart, c = r.seriesRangeEnd); var d = !1; if (r.seriesX.length >= a) { var g, u = null === (g = r.brushSource) || void 0 === g ? void 0 : g.w.config.chart.brush; (s.chart.zoom.enabled && s.chart.zoom.autoScaleYaxis || null != u && u.enabled && null != u && u.autoScaleYaxis) && (d = !0) } for (var f = t; f < a; f++) { r.dataPoints = Math.max(r.dataPoints, l[f].length); var p = s.series[f].type; r.categoryLabels.length && (r.dataPoints = r.categoryLabels.filter((function (t) { return void 0 !== t })).length), r.labels.length && "datetime" !== s.xaxis.type && 0 !== r.series.reduce((function (t, e) { return t + e.length }), 0) && (r.dataPoints = Math.max(r.dataPoints, r.labels.length)); var x = 0, b = l[f].length - 1; if (d) { if (s.xaxis.min) for (; x < b && r.seriesX[f][x] < s.xaxis.min; x++); if (s.xaxis.max) for (; b > x && r.seriesX[f][b] > s.xaxis.max; b--); } for (var v = x; v <= b && v < r.series[f].length; v++) { var y = l[f][v]; if (null !== y && m.isNumber(y)) { switch (void 0 !== c[f][v] && (o = Math.max(o, c[f][v]), e = Math.min(e, c[f][v])), void 0 !== h[f][v] && (e = Math.min(e, h[f][v]), i = Math.max(i, h[f][v])), p) { case "candlestick": void 0 !== r.seriesCandleC[f][v] && (o = Math.max(o, r.seriesCandleH[f][v]), e = Math.min(e, r.seriesCandleL[f][v])); break; case "boxPlot": void 0 !== r.seriesCandleC[f][v] && (o = Math.max(o, r.seriesCandleC[f][v]), e = Math.min(e, r.seriesCandleO[f][v])) }p && "candlestick" !== p && "boxPlot" !== p && "rangeArea" !== p && "rangeBar" !== p && (o = Math.max(o, r.series[f][v]), e = Math.min(e, r.series[f][v])), i = o, r.seriesGoals[f] && r.seriesGoals[f][v] && Array.isArray(r.seriesGoals[f][v]) && r.seriesGoals[f][v].forEach((function (t) { n !== Number.MIN_VALUE && (n = Math.min(n, t.value), e = n), o = Math.max(o, t.value), i = o })), m.isFloat(y) && (y = m.noExponents(y), r.yValueDecimal = Math.max(r.yValueDecimal, y.toString().split(".")[1].length)), n > h[f][v] && h[f][v] < 0 && (n = h[f][v]) } else r.hasNullValues = !0 } "bar" !== p && "column" !== p || (n < 0 && o < 0 && (o = 0, i = Math.max(i, 0)), n === Number.MIN_VALUE && (n = 0, e = Math.min(e, 0))) } return "rangeBar" === s.chart.type && r.seriesRangeStart.length && r.isBarHorizontal && (n = e), "bar" === s.chart.type && (n < 0 && o < 0 && (o = 0), n === Number.MIN_VALUE && (n = 0)), { minY: n, maxY: o, lowestY: e, highestY: i } } }, { key: "setYRange", value: function () { var t = this.w.globals, e = this.w.config; t.maxY = -Number.MAX_VALUE, t.minY = Number.MIN_VALUE; var i, a = Number.MAX_VALUE; if (t.isMultipleYAxis) { a = Number.MAX_VALUE; for (var s = 0; s < t.series.length; s++)i = this.getMinYMaxY(s), t.minYArr[s] = i.lowestY, t.maxYArr[s] = i.highestY, a = Math.min(a, i.lowestY) } if (i = this.getMinYMaxY(0, a, null, t.series.length), "bar" === e.chart.type ? (t.minY = i.minY, t.maxY = i.maxY) : (t.minY = i.lowestY, t.maxY = i.highestY), a = i.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 && a !== -Number.MAX_VALUE && a !== t.maxY && (t.minY = a) : t.minY = t.minY !== Number.MIN_VALUE ? Math.min(i.minY, t.minY) : i.minY, e.yaxis.forEach((function (e, i) { void 0 !== e.max && ("number" == typeof e.max ? t.maxYArr[i] = e.max : "function" == typeof e.max && (t.maxYArr[i] = e.max(t.isMultipleYAxis ? t.maxYArr[i] : t.maxY)), t.maxY = t.maxYArr[i]), void 0 !== e.min && ("number" == typeof e.min ? t.minYArr[i] = e.min : "function" == typeof e.min && (t.minYArr[i] = e.min(t.isMultipleYAxis ? t.minYArr[i] === Number.MIN_VALUE ? 0 : t.minYArr[i] : t.minY)), t.minY = t.minYArr[i]) })), t.isBarHorizontal) { ["min", "max"].forEach((function (i) { void 0 !== e.xaxis[i] && "number" == typeof e.xaxis[i] && ("min" === i ? t.minY = e.xaxis[i] : t.maxY = e.xaxis[i]) })) } return t.isMultipleYAxis ? (this.scales.scaleMultipleYAxes(), t.minY = a) : (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((function (i) { switch (i.type || e.chart.type) { case "bar": case "column": t.barGroups.push(i.group); break; case "line": t.lineGroups.push(i.group); break; case "area": t.areaGroups.push(i.group) } })), t.barGroups = t.barGroups.filter((function (t, e, i) { return i.indexOf(t) === e })), t.lineGroups = t.lineGroups.filter((function (t, e, i) { return i.indexOf(t) === e })), t.areaGroups = t.areaGroups.filter((function (t, e, i) { return i.indexOf(t) === e })), { minY: t.minY, maxY: t.maxY, minYArr: t.minYArr, maxYArr: t.maxYArr, yAxisScale: t.yAxisScale } } }, { key: "setXRange", value: function () { var t = this.w.globals, e = this.w.config, i = "numeric" === e.xaxis.type || "datetime" === e.xaxis.type || "category" === e.xaxis.type && !t.noLabelsProvided || t.noLabelsProvided || t.isXNumeric; if (t.isXNumeric && function () { for (var e = 0; e < t.series.length; e++)if (t.labels[e]) for (var i = 0; i < t.labels[e].length; i++)null !== t.labels[e][i] && m.isNumber(t.labels[e][i]) && (t.maxX = Math.max(t.maxX, t.labels[e][i]), t.initialMaxX = Math.max(t.maxX, t.labels[e][i]), t.minX = Math.min(t.minX, t.labels[e][i]), t.initialMinX = Math.min(t.minX, t.labels[e][i])) }(), 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) { var a = 10; if (void 0 === e.xaxis.tickAmount) a = Math.round(t.svgWidth / 150), "numeric" === e.xaxis.type && t.dataPoints < 30 && (a = t.dataPoints - 1), a > t.dataPoints && 0 !== t.dataPoints && (a = t.dataPoints - 1); else if ("dataPoints" === e.xaxis.tickAmount) { if (t.series.length > 1 && (a = t.series[t.maxValsInArrayIndex].length - 1), t.isXNumeric) { var s = t.maxX - t.minX; s < 30 && (a = s - 1) } } else a = e.xaxis.tickAmount; if (t.xTickAmount = a, 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) { for (var r = [], o = t.minX - 1; o < t.maxX; o++)r.push(o + 1); t.xAxisScale = { result: r, niceMin: r[0], niceMax: r[r.length - 1] } } else t.xAxisScale = this.scales.setXScale(t.minX, t.maxX); else t.xAxisScale = this.scales.linearScale(0, a, a, 0, e.xaxis.stepSize), t.noLabelsProvided && t.labels.length > 0 && (t.xAxisScale = this.scales.linearScale(1, t.labels.length, a - 1, 0, e.xaxis.stepSize), t.seriesX = t.labels.slice()); i && (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 } } }, { key: "setZRange", value: function () { var t = this.w.globals; if (t.isDataXYZ) for (var e = 0; e < t.series.length; e++)if (void 0 !== t.seriesZ[e]) for (var i = 0; i < t.seriesZ[e].length; i++)null !== t.seriesZ[e][i] && m.isNumber(t.seriesZ[e][i]) && (t.maxZ = Math.max(t.maxZ, t.seriesZ[e][i]), t.minZ = Math.min(t.minZ, t.seriesZ[e][i])) } }, { key: "_handleSingleDataPoint", value: function () { var t = this.w.globals, e = this.w.config; if (t.minX === t.maxX) { var i = new L(this.ctx); if ("datetime" === e.xaxis.type) { var a = i.getDate(t.minX); e.xaxis.labels.datetimeUTC ? a.setUTCDate(a.getUTCDate() - 2) : a.setDate(a.getDate() - 2), t.minX = new Date(a).getTime(); var s = i.getDate(t.maxX); e.xaxis.labels.datetimeUTC ? s.setUTCDate(s.getUTCDate() + 2) : s.setDate(s.getDate() + 2), t.maxX = new Date(s).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) } } }, { key: "_getMinXDiff", value: function () { var t = this.w.globals; t.isXNumeric && t.seriesX.forEach((function (e, i) { 1 === e.length && e.push(t.seriesX[t.maxValsInArrayIndex][t.seriesX[t.maxValsInArrayIndex].length - 1]); var a = e.slice(); a.sort((function (t, e) { return t - e })), a.forEach((function (e, i) { if (i > 0) { var s = e - a[i - 1]; s > 0 && (t.minXDiff = Math.min(s, t.minXDiff)) } })), 1 !== t.dataPoints && t.minXDiff !== Number.MAX_VALUE || (t.minXDiff = .5) })) } }, { key: "_setStackedMinMax", value: function () { var t = this, e = this.w.globals; if (e.series.length) { var i = e.seriesGroups; i.length || (i = [this.w.globals.seriesNames.map((function (t) { return t }))]); var a = {}, s = {}; i.forEach((function (i) { a[i] = [], s[i] = [], t.w.config.series.map((function (t, a) { return i.indexOf(e.seriesNames[a]) > -1 ? a : null })).filter((function (t) { return null !== t })).forEach((function (r) { for (var o = 0; o < e.series[e.maxValsInArrayIndex].length; o++) { var n, l, h, c; void 0 === a[i][o] && (a[i][o] = 0, s[i][o] = 0), (t.w.config.chart.stacked && !e.comboCharts || t.w.config.chart.stacked && e.comboCharts && (!t.w.config.chart.stackOnlyBar || "bar" === (null === (n = t.w.config.series) || void 0 === n || null === (l = n[r]) || void 0 === l ? void 0 : l.type) || "column" === (null === (h = t.w.config.series) || void 0 === h || null === (c = h[r]) || void 0 === c ? void 0 : c.type))) && null !== e.series[r][o] && m.isNumber(e.series[r][o]) && (e.series[r][o] > 0 ? a[i][o] += parseFloat(e.series[r][o]) + 1e-4 : s[i][o] += parseFloat(e.series[r][o])) } })) })), Object.entries(a).forEach((function (t) { var i = f(t, 1)[0]; a[i].forEach((function (t, r) { e.maxY = Math.max(e.maxY, a[i][r]), e.minY = Math.min(e.minY, s[i][r]) })) })) } } }]), t }(), Q = function () { function t(e, a) { i(this, t), this.ctx = e, this.elgrid = a, this.w = e.w; var 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 M(e) } return s(t, [{ key: "drawYaxis", value: function (t) { var e = this.w, i = new k(this.ctx), a = e.config.yaxis[t].labels.style, s = a.fontSize, r = a.fontFamily, o = a.fontWeight, n = i.group({ class: "apexcharts-yaxis", rel: t, transform: "translate(".concat(e.globals.translateYAxisX[t], ", 0)") }); if (this.axesUtils.isYAxisHidden(t)) return n; var l = i.group({ class: "apexcharts-yaxis-texts-g" }); n.add(l); var h = e.globals.yAxisScale[t].result.length - 1, c = e.globals.gridHeight / h, d = e.globals.yLabelFormatters[t], g = this.axesUtils.checkForReversedLabels(t, e.globals.yAxisScale[t].result.slice()); if (e.config.yaxis[t].labels.show) { var u = e.globals.translateY + e.config.yaxis[t].labels.offsetY; e.globals.isBarHorizontal ? u = 0 : "heatmap" === e.config.chart.type && (u -= c / 2), u += parseInt(s, 10) / 3; for (var f = h; f >= 0; f--) { var p = d(g[f], f, e), x = e.config.yaxis[t].labels.padding; e.config.yaxis[t].opposite && 0 !== e.config.yaxis.length && (x *= -1); var b = this.getTextAnchor(e.config.yaxis[t].labels.align, e.config.yaxis[t].opposite), v = this.axesUtils.getYAxisForeColor(a.colors, t), y = Array.isArray(v) ? v[f] : v, w = m.listToArray(e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(t, "'] .apexcharts-yaxis-label tspan"))).map((function (t) { return t.textContent })), A = i.drawText({ x: x, y: u, text: w.includes(p) && !e.config.yaxis[t].labels.showDuplicates ? "" : p, textAnchor: b, fontSize: s, fontFamily: r, fontWeight: o, maxWidth: e.config.yaxis[t].labels.maxWidth, foreColor: y, isPlainText: !1, cssClass: "apexcharts-yaxis-label ".concat(a.cssClass) }); l.add(A), this.addTooltip(A, p), 0 !== e.config.yaxis[t].labels.rotate && this.rotateLabel(i, A, firstLabel, e.config.yaxis[t].labels.rotate), u += c } } return this.addYAxisTitle(i, n, t), this.addAxisBorder(i, n, t, h, c), n } }, { key: "getTextAnchor", value: function (t, e) { return "left" === t ? "start" : "center" === t ? "middle" : "right" === t ? "end" : e ? "start" : "end" } }, { key: "addTooltip", value: function (t, e) { var i = document.createElementNS(this.w.globals.SVGNS, "title"); i.textContent = Array.isArray(e) ? e.join(" ") : e, t.node.appendChild(i) } }, { key: "rotateLabel", value: function (t, e, i, a) { var s = t.rotateAroundCenter(i.node), r = t.rotateAroundCenter(e.node); e.node.setAttribute("transform", "rotate(".concat(a, " ").concat(s.x, " ").concat(r.y, ")")) } }, { key: "addYAxisTitle", value: function (t, e, i) { var a = this.w; if (void 0 !== a.config.yaxis[i].title.text) { var s = t.group({ class: "apexcharts-yaxis-title" }), r = a.config.yaxis[i].opposite ? a.globals.translateYAxisX[i] : 0, o = t.drawText({ x: r, y: a.globals.gridHeight / 2 + a.globals.translateY + a.config.yaxis[i].title.offsetY, text: a.config.yaxis[i].title.text, textAnchor: "end", foreColor: a.config.yaxis[i].title.style.color, fontSize: a.config.yaxis[i].title.style.fontSize, fontWeight: a.config.yaxis[i].title.style.fontWeight, fontFamily: a.config.yaxis[i].title.style.fontFamily, cssClass: "apexcharts-yaxis-title-text ".concat(a.config.yaxis[i].title.style.cssClass) }); s.add(o), e.add(s) } } }, { key: "addAxisBorder", value: function (t, e, i, a, s) { var r = this.w, o = r.config.yaxis[i].axisBorder, n = 31 + o.offsetX; if (r.config.yaxis[i].opposite && (n = -31 - o.offsetX), o.show) { var l = t.drawLine(n, r.globals.translateY + o.offsetY - 2, n, r.globals.gridHeight + r.globals.translateY + o.offsetY + 2, o.color, 0, o.width); e.add(l) } r.config.yaxis[i].axisTicks.show && this.axesUtils.drawYAxisTicks(n, a, o, r.config.yaxis[i].axisTicks, i, s, e) } }, { key: "drawYaxisInversed", value: function (t) { var e = this.w, i = new k(this.ctx), a = i.group({ class: "apexcharts-xaxis apexcharts-yaxis-inversed" }), s = i.group({ class: "apexcharts-xaxis-texts-g", transform: "translate(".concat(e.globals.translateXAxisX, ", ").concat(e.globals.translateXAxisY, ")") }); a.add(s); var r = e.globals.yAxisScale[t].result.length - 1, o = e.globals.gridWidth / r + .1, n = o + e.config.xaxis.labels.offsetX, l = e.globals.xLabelFormatter, h = this.axesUtils.checkForReversedLabels(t, e.globals.yAxisScale[t].result.slice()), c = e.globals.timescaleLabels; if (c.length > 0 && (this.xaxisLabels = c.slice(), r = (h = c.slice()).length), e.config.xaxis.labels.show) for (var d = c.length ? 0 : r; c.length ? d < c.length : d >= 0; c.length ? d++ : d--) { var g = l(h[d], d, e), u = e.globals.gridWidth + e.globals.padHorizontal - (n - o + e.config.xaxis.labels.offsetX); if (c.length) { var f = this.axesUtils.getLabel(h, c, u, d, this.drawnLabels, this.xaxisFontSize); u = f.x, g = f.text, this.drawnLabels.push(f.text), 0 === d && e.globals.skipFirstTimelinelabel && (g = ""), d === h.length - 1 && e.globals.skipLastTimelinelabel && (g = "") } var p = i.drawText({ x: u, 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: g, 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 ".concat(e.config.xaxis.labels.style.cssClass) }); s.add(p), p.tspan(g), this.addTooltip(p, g), n += o } return this.inversedYAxisTitleText(a), this.inversedYAxisBorder(a), a } }, { key: "inversedYAxisBorder", value: function (t) { var e = this.w, i = new k(this.ctx), a = e.config.xaxis.axisBorder; if (a.show) { var s = 0; "bar" === e.config.chart.type && e.globals.isXNumeric && (s -= 15); var r = i.drawLine(e.globals.padHorizontal + s + a.offsetX, this.xAxisoffX, e.globals.gridWidth, this.xAxisoffX, a.color, 0, a.height); this.elgrid && this.elgrid.elGridBorders && e.config.grid.show ? this.elgrid.elGridBorders.add(r) : t.add(r) } } }, { key: "inversedYAxisTitleText", value: function (t) { var e = this.w, i = new k(this.ctx); if (void 0 !== e.config.xaxis.title.text) { var a = i.group({ class: "apexcharts-xaxis-title apexcharts-yaxis-title-inversed" }), s = i.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 ".concat(e.config.xaxis.title.style.cssClass) }); a.add(s), t.add(a) } } }, { key: "yAxisTitleRotate", value: function (t, e) { var i = this.w, a = new k(this.ctx), s = i.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(t, "'] .apexcharts-yaxis-texts-g")), r = s ? s.getBoundingClientRect() : { width: 0, height: 0 }, o = i.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(t, "'] .apexcharts-yaxis-title text")), n = o ? o.getBoundingClientRect() : { width: 0, height: 0 }; if (o) { var l = this.xPaddingForYAxisTitle(t, r, n, e); o.setAttribute("x", l.xPos - (e ? 10 : 0)); var h = a.rotateAroundCenter(o); o.setAttribute("transform", "rotate(".concat(e ? -1 * i.config.yaxis[t].title.rotate : i.config.yaxis[t].title.rotate, " ").concat(h.x, " ").concat(h.y, ")")) } } }, { key: "xPaddingForYAxisTitle", value: function (t, e, i, a) { var s = this.w, r = 0, o = 10; return void 0 === s.config.yaxis[t].title.text || t < 0 ? { xPos: r, padd: 0 } : (a ? r = e.width + s.config.yaxis[t].title.offsetX + i.width / 2 + o / 2 : (r = -1 * e.width + s.config.yaxis[t].title.offsetX + o / 2 + i.width / 2, s.globals.isBarHorizontal && (o = 25, r = -1 * e.width - s.config.yaxis[t].title.offsetX - o)), { xPos: r, padd: o }) } }, { key: "setYAxisXPosition", value: function (t, e) { var i = this.w, a = 0, s = 0, r = 18, o = 1; i.config.yaxis.length > 1 && (this.multipleYs = !0), i.config.yaxis.forEach((function (n, l) { var h = i.globals.ignoreYAxisIndexes.includes(l) || !n.show || n.floating || 0 === t[l].width, c = t[l].width + e[l].width; n.opposite ? i.globals.isBarHorizontal ? (s = i.globals.gridWidth + i.globals.translateX - 1, i.globals.translateYAxisX[l] = s - n.labels.offsetX) : (s = i.globals.gridWidth + i.globals.translateX + o, h || (o += c + 20), i.globals.translateYAxisX[l] = s - n.labels.offsetX + 20) : (a = i.globals.translateX - r, h || (r += c + 20), i.globals.translateYAxisX[l] = a + n.labels.offsetX) })) } }, { key: "setYAxisTextAlignments", value: function () { var t = this.w; m.listToArray(t.globals.dom.baseEl.getElementsByClassName("apexcharts-yaxis")).forEach((function (e, i) { var a = t.config.yaxis[i]; if (a && !a.floating && void 0 !== a.labels.align) { var s = t.globals.dom.baseEl.querySelector(".apexcharts-yaxis[rel='".concat(i, "'] .apexcharts-yaxis-texts-g")), r = m.listToArray(t.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxis[rel='".concat(i, "'] .apexcharts-yaxis-label"))), o = s.getBoundingClientRect(); r.forEach((function (t) { t.setAttribute("text-anchor", a.labels.align) })), "left" !== a.labels.align || a.opposite ? "center" === a.labels.align ? s.setAttribute("transform", "translate(".concat(o.width / 2 * (a.opposite ? 1 : -1), ", 0)")) : "right" === a.labels.align && a.opposite && s.setAttribute("transform", "translate(".concat(o.width, ", 0)")) : s.setAttribute("transform", "translate(-".concat(o.width, ", 0)")) } })) } }]), t }(), K = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w, this.documentEvent = m.bind(this.documentEvent, this) } return s(t, [{ key: "addEventListener", value: function (t, e) { var i = this.w; i.globals.events.hasOwnProperty(t) ? i.globals.events[t].push(e) : i.globals.events[t] = [e] } }, { key: "removeEventListener", value: function (t, e) { var i = this.w; if (i.globals.events.hasOwnProperty(t)) { var a = i.globals.events[t].indexOf(e); -1 !== a && i.globals.events[t].splice(a, 1) } } }, { key: "fireEvent", value: function (t, e) { var i = this.w; if (i.globals.events.hasOwnProperty(t)) { e && e.length || (e = []); for (var a = i.globals.events[t], s = a.length, r = 0; r < s; r++)a[r].apply(null, e) } } }, { key: "setupEventHandlers", value: function () { var t = this, e = this.w, i = this.ctx, a = e.globals.dom.baseEl.querySelector(e.globals.chartClass); this.ctx.eventList.forEach((function (t) { a.addEventListener(t, (function (t) { var a = Object.assign({}, e, { seriesIndex: e.globals.axisCharts ? e.globals.capturedSeriesIndex : 0, dataPointIndex: e.globals.capturedDataPointIndex }); "mousemove" === t.type || "touchmove" === t.type ? "function" == typeof e.config.chart.events.mouseMove && e.config.chart.events.mouseMove(t, i, a) : "mouseleave" === t.type || "touchleave" === t.type ? "function" == typeof e.config.chart.events.mouseLeave && e.config.chart.events.mouseLeave(t, i, a) : ("mouseup" === t.type && 1 === t.which || "touchend" === t.type) && ("function" == typeof e.config.chart.events.click && e.config.chart.events.click(t, i, a), i.ctx.events.fireEvent("click", [t, i, a])) }), { capture: !1, passive: !0 }) })), this.ctx.eventList.forEach((function (i) { e.globals.dom.baseEl.addEventListener(i, t.documentEvent, { passive: !0 }) })), this.ctx.core.setupBrushHandler() } }, { key: "documentEvent", value: function (t) { var e = this.w, i = t.target.className; if ("click" === t.type) { var a = e.globals.dom.baseEl.querySelector(".apexcharts-menu"); a && a.classList.contains("apexcharts-menu-open") && "apexcharts-menu-icon" !== i && a.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 } }]), t }(), tt = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "setCurrentLocaleValues", value: function (t) { var 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)); var i = e.filter((function (e) { return e.name === t }))[0]; if (!i) throw new Error("Wrong locale name provided. Please make sure you set the correct locale name in options"); var a = m.extend(z, i); this.w.globals.locale = a.options } }]), t }(), et = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "drawAxis", value: function (t, e) { var i, a, s = this, r = this.w.globals, o = this.w.config, n = new q(this.ctx, e), l = new Q(this.ctx, e); r.axisCharts && "radar" !== t && (r.isBarHorizontal ? (a = l.drawYaxisInversed(0), i = n.drawXaxisInversed(0), r.dom.elGraphical.add(i), r.dom.elGraphical.add(a)) : (i = n.drawXaxis(), r.dom.elGraphical.add(i), o.yaxis.map((function (t, e) { if (-1 === r.ignoreYAxisIndexes.indexOf(e) && (a = l.drawYaxis(e), r.dom.Paper.add(a), "back" === s.w.config.grid.position)) { var i = r.dom.Paper.children()[1]; i.remove(), r.dom.Paper.add(i) } })))) } }]), t }(), it = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "drawXCrosshairs", value: function () { var t = this.w, e = new k(this.ctx), i = new w(this.ctx), a = t.config.xaxis.crosshairs.fill.gradient, s = t.config.xaxis.crosshairs.dropShadow, r = t.config.xaxis.crosshairs.fill.type, o = a.colorFrom, n = a.colorTo, l = a.opacityFrom, h = a.opacityTo, c = a.stops, d = s.enabled, g = s.left, u = s.top, f = s.blur, p = s.color, x = s.opacity, b = t.config.xaxis.crosshairs.fill.color; if (t.config.xaxis.crosshairs.show) { "gradient" === r && (b = e.drawGradient("vertical", o, n, l, h, null, c, null)); var v = e.drawRect(); 1 === t.config.xaxis.crosshairs.width && (v = e.drawLine()); var y = t.globals.gridHeight; (!m.isNumber(y) || y < 0) && (y = 0); var A = t.config.xaxis.crosshairs.width; (!m.isNumber(A) || A < 0) && (A = 0), v.attr({ class: "apexcharts-xcrosshairs", x: 0, y: 0, y2: y, width: A, height: y, fill: b, 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 && (v = i.dropShadow(v, { left: g, top: u, blur: f, color: p, opacity: x })), t.globals.dom.elGraphical.add(v) } } }, { key: "drawYCrosshairs", value: function () { var t = this.w, e = new k(this.ctx), i = t.config.yaxis[0].crosshairs, a = t.globals.barPadForNumericAxis; if (t.config.yaxis[0].crosshairs.show) { var s = e.drawLine(-a, 0, t.globals.gridWidth + a, 0, i.stroke.color, i.stroke.dashArray, i.stroke.width); s.attr({ class: "apexcharts-ycrosshairs" }), t.globals.dom.elGraphical.add(s) } var r = e.drawLine(-a, 0, t.globals.gridWidth + a, 0, i.stroke.color, 0, 0); r.attr({ class: "apexcharts-ycrosshairs-hidden" }), t.globals.dom.elGraphical.add(r) } }]), t }(), at = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "checkResponsiveConfig", value: function (t) { var e = this, i = this.w, a = i.config; if (0 !== a.responsive.length) { var s = a.responsive.slice(); s.sort((function (t, e) { return t.breakpoint > e.breakpoint ? 1 : e.breakpoint > t.breakpoint ? -1 : 0 })).reverse(); var r = new D({}), o = function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, a = s[0].breakpoint, o = window.innerWidth > 0 ? window.innerWidth : screen.width; if (o > a) { var n = m.clone(i.globals.initialConfig); n.series = m.clone(i.config.series); var l = A.extendArrayProps(r, n, i); t = m.extend(l, t), t = m.extend(i.config, t), e.overrideResponsiveOptions(t) } else for (var h = 0; h < s.length; h++)o < s[h].breakpoint && (t = A.extendArrayProps(r, s[h].options, i), t = m.extend(i.config, t), e.overrideResponsiveOptions(t)) }; if (t) { var n = A.extendArrayProps(r, t, i); n = m.extend(i.config, n), o(n = m.extend(n, t)) } else o({}) } } }, { key: "overrideResponsiveOptions", value: function (t) { var e = new D(t).init({ responsiveOverride: !0 }); this.w.config = e } }]), t }(), st = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w, this.colors = [], this.isColorFn = !1, this.isHeatmapDistributed = this.checkHeatmapDistributed(), this.isBarDistributed = this.checkBarDistributed() } return s(t, [{ key: "checkHeatmapDistributed", value: function () { var t = this.w.config, e = t.chart, i = t.plotOptions; return "treemap" === e.type && i.treemap && i.treemap.distributed || "heatmap" === e.type && i.heatmap && i.heatmap.distributed } }, { key: "checkBarDistributed", value: function () { var t = this.w.config, e = t.chart, i = t.plotOptions; return i.bar && i.bar.distributed && ("bar" === e.type || "rangeBar" === e.type) } }, { key: "init", value: function () { this.setDefaultColors() } }, { key: "setDefaultColors", value: function () { var t = this.w, e = new m; t.globals.dom.elWrap.classList.add("apexcharts-theme-".concat(t.config.theme.mode)); var i = p(t.config.colors || t.config.fill.colors || []); t.globals.colors = this.getColors(i), 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)); var a = t.globals.colors.slice(); this.pushExtraColors(t.globals.colors), this.applyColorTypes(["fill", "stroke"], a), this.applyDataLabelsColors(a), this.applyRadarPolygonsColors(), this.applyMarkersColors(a) } }, { key: "getColors", value: function (t) { var e = this, i = this.w; return t && 0 !== t.length ? Array.isArray(t) && t.length > 0 && "function" == typeof t[0] ? (this.isColorFn = !0, i.config.series.map((function (a, s) { var r = t[s] || t[0]; return "function" == typeof r ? r({ value: i.globals.axisCharts ? i.globals.series[s][0] || 0 : i.globals.series[s], seriesIndex: s, dataPointIndex: s, w: e.w }) : r }))) : t : this.predefined() } }, { key: "applySeriesColors", value: function (t, e) { t.forEach((function (t, i) { t && (e[i] = t) })) } }, { key: "getMonochromeColors", value: function (t, e, i) { var a = t.color, s = t.shadeIntensity, r = t.shadeTo, o = this.isBarDistributed || this.isHeatmapDistributed ? e[0].length * e.length : e.length, n = 1 / (o / s), l = 0; return Array.from({ length: o }, (function () { var t = "dark" === r ? i.shadeColor(-1 * l, a) : i.shadeColor(l, a); return l += n, t })) } }, { key: "applyColorTypes", value: function (t, e) { var i = this, a = this.w; t.forEach((function (t) { a.globals[t].colors = void 0 === a.config[t].colors ? i.isColorFn ? a.config.colors : e : a.config[t].colors.slice(), i.pushExtraColors(a.globals[t].colors) })) } }, { key: "applyDataLabelsColors", value: function (t) { var 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) } }, { key: "applyRadarPolygonsColors", value: function () { var t = this.w; t.globals.radarPolygons.fill.colors = void 0 === t.config.plotOptions.radar.polygons.fill.colors ? ["dark" === t.config.theme.mode ? "#424242" : "none"] : t.config.plotOptions.radar.polygons.fill.colors.slice(), this.pushExtraColors(t.globals.radarPolygons.fill.colors, 20) } }, { key: "applyMarkersColors", value: function (t) { var 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) } }, { key: "pushExtraColors", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = this.w, s = e || a.globals.series.length; if (null === i && (i = this.isBarDistributed || this.isHeatmapDistributed || "heatmap" === a.config.chart.type && a.config.plotOptions.heatmap && a.config.plotOptions.heatmap.colorScale.inverse), i && a.globals.series.length && (s = a.globals.series[a.globals.maxValsInArrayIndex].length * a.globals.series.length), t.length < s) for (var r = s - t.length, o = 0; o < r; o++)t.push(t[o]) } }, { key: "updateThemeOptions", value: function (t) { t.chart = t.chart || {}, t.tooltip = t.tooltip || {}; var e = t.theme.mode, i = "dark" === e ? "palette4" : "light" === e ? "palette1" : t.theme.palette || "palette1", a = "dark" === e ? "#f6f7f8" : "light" === e ? "#373d3f" : t.chart.foreColor || "#373d3f"; return t.tooltip.theme = e || "light", t.chart.foreColor = a, t.theme.palette = i, t } }, { key: "predefined", value: function () { var t = { 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"], default: ["#008FFB", "#00E396", "#FEB019", "#FF4560", "#775DD0"] }; return t[this.w.config.theme.palette] || t.default } }]), t }(), rt = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "draw", value: function () { this.drawTitleSubtitle("title"), this.drawTitleSubtitle("subtitle") } }, { key: "drawTitleSubtitle", value: function (t) { var e = this.w, i = "title" === t ? e.config.title : e.config.subtitle, a = e.globals.svgWidth / 2, s = i.offsetY, r = "middle"; if ("left" === i.align ? (a = 10, r = "start") : "right" === i.align && (a = e.globals.svgWidth - 10, r = "end"), a += i.offsetX, s = s + parseInt(i.style.fontSize, 10) + i.margin / 2, void 0 !== i.text) { var o = new k(this.ctx).drawText({ x: a, y: s, text: i.text, textAnchor: r, fontSize: i.style.fontSize, fontFamily: i.style.fontFamily, fontWeight: i.style.fontWeight, foreColor: i.style.color, opacity: 1 }); o.node.setAttribute("class", "apexcharts-".concat(t, "-text")), e.globals.dom.Paper.add(o) } } }]), t }(), ot = function () { function t(e) { i(this, t), this.w = e.w, this.dCtx = e } return s(t, [{ key: "getTitleSubtitleCoords", value: function (t) { var e = this.w, i = 0, a = 0, s = "title" === t ? e.config.title.floating : e.config.subtitle.floating, r = e.globals.dom.baseEl.querySelector(".apexcharts-".concat(t, "-text")); if (null !== r && !s) { var o = r.getBoundingClientRect(); i = o.width, a = e.globals.axisCharts ? o.height + 5 : o.height } return { width: i, height: a } } }, { key: "getLegendsRect", value: function () { var 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"); var i = Object.assign({}, m.getBoundingClientRect(e)); return null !== e && !t.config.legend.floating && t.config.legend.show ? this.dCtx.lgRect = { x: i.x, y: i.y, height: i.height, width: 0 === i.height ? 0 : i.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 } }, { key: "getDatalabelsRect", value: function () { var t = this, e = this.w, i = []; e.config.series.forEach((function (s, r) { s.data.forEach((function (s, o) { var n; n = e.globals.series[r][o], a = e.config.dataLabels.formatter(n, { ctx: t.dCtx.ctx, seriesIndex: r, dataPointIndex: o, w: e }), i.push(a) })) })); var a = m.getLargestStringFromArr(i), s = new k(this.dCtx.ctx), r = e.config.dataLabels.style, o = s.getTextRects(a, parseInt(r.fontSize), r.fontFamily); return { width: 1.05 * o.width, height: o.height } } }, { key: "getLargestStringFromMultiArr", value: function (t, e) { var i = t; if (this.w.globals.isMultiLineX) { var a = e.map((function (t, e) { return Array.isArray(t) ? t.length : 1 })), s = Math.max.apply(Math, p(a)); i = e[a.indexOf(s)] } return i } }]), t }(), nt = function () { function t(e) { i(this, t), this.w = e.w, this.dCtx = e } return s(t, [{ key: "getxAxisLabelsCoords", value: function () { var t, e = this.w, i = e.globals.labels.slice(); if (e.config.xaxis.convertedCatToNumeric && 0 === i.length && (i = e.globals.categoryLabels), e.globals.timescaleLabels.length > 0) { var a = this.getxAxisTimeScaleLabelsCoords(); t = { width: a.width, height: a.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; var s = e.globals.xLabelFormatter, r = m.getLargestStringFromArr(i), o = this.dCtx.dimHelpers.getLargestStringFromMultiArr(r, i); e.globals.isBarHorizontal && (o = r = e.globals.yAxisScale[0].result.reduce((function (t, e) { return t.length > e.length ? t : e }), 0)); var n = new P(this.dCtx.ctx), l = r; r = n.xLabelFormat(s, r, l, { i: void 0, dateFormatter: new L(this.dCtx.ctx).formatDate, w: e }), o = n.xLabelFormat(s, o, l, { i: void 0, dateFormatter: new L(this.dCtx.ctx).formatDate, w: e }), (e.config.xaxis.convertedCatToNumeric && void 0 === r || "" === String(r).trim()) && (o = r = "1"); var h = new k(this.dCtx.ctx), c = h.getTextRects(r, e.config.xaxis.labels.style.fontSize), d = c; if (r !== o && (d = h.getTextRects(o, e.config.xaxis.labels.style.fontSize)), (t = { width: c.width >= d.width ? c.width : d.width, height: c.height >= d.height ? c.height : d.height }).width * i.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; var g = function (t) { return h.getTextRects(t, e.config.xaxis.labels.style.fontSize, e.config.xaxis.labels.style.fontFamily, "rotate(".concat(e.config.xaxis.labels.rotate, " 0 0)"), !1) }; c = g(r), r !== o && (d = g(o)), t.height = (c.height > d.height ? c.height : d.height) / 1.5, t.width = c.width > d.width ? c.width : d.width } } else e.globals.rotateXLabels = !1 } return e.config.xaxis.labels.show || (t = { width: 0, height: 0 }), { width: t.width, height: t.height } } }, { key: "getxAxisGroupLabelsCoords", value: function () { var t, e = this.w; if (!e.globals.hasXaxisGroups) return { width: 0, height: 0 }; var i, a = (null === (t = e.config.xaxis.group.style) || void 0 === t ? void 0 : t.fontSize) || e.config.xaxis.labels.style.fontSize, s = e.globals.groups.map((function (t) { return t.title })), r = m.getLargestStringFromArr(s), o = this.dCtx.dimHelpers.getLargestStringFromMultiArr(r, s), n = new k(this.dCtx.ctx), l = n.getTextRects(r, a), h = l; return r !== o && (h = n.getTextRects(o, a)), i = { width: l.width >= h.width ? l.width : h.width, height: l.height >= h.height ? l.height : h.height }, e.config.xaxis.labels.show || (i = { width: 0, height: 0 }), { width: i.width, height: i.height } } }, { key: "getxAxisTitleCoords", value: function () { var t = this.w, e = 0, i = 0; if (void 0 !== t.config.xaxis.title.text) { var a = new k(this.dCtx.ctx).getTextRects(t.config.xaxis.title.text, t.config.xaxis.title.style.fontSize); e = a.width, i = a.height } return { width: e, height: i } } }, { key: "getxAxisTimeScaleLabelsCoords", value: function () { var t, e = this.w; this.dCtx.timescaleLabels = e.globals.timescaleLabels.slice(); var i = this.dCtx.timescaleLabels.map((function (t) { return t.value })), a = i.reduce((function (t, e) { return void 0 === t ? (console.error("You have possibly supplied invalid Date format. Please supply a valid JavaScript Date"), 0) : t.length > e.length ? t : e }), 0); return 1.05 * (t = new k(this.dCtx.ctx).getTextRects(a, e.config.xaxis.labels.style.fontSize)).width * i.length > e.globals.gridWidth && 0 !== e.config.xaxis.labels.rotate && (e.globals.overlappingXLabels = !0), t } }, { key: "additionalPaddingXLabels", value: function (t) { var e = this, i = this.w, a = i.globals, s = i.config, r = s.xaxis.type, o = t.width; a.skipLastTimelinelabel = !1, a.skipFirstTimelinelabel = !1; var n = i.config.yaxis[0].opposite && i.globals.isBarHorizontal, l = function (t, n) { s.yaxis.length > 1 && function (t) { return -1 !== a.collapsedSeriesIndices.indexOf(t) }(n) || function (t) { if (e.dCtx.timescaleLabels && e.dCtx.timescaleLabels.length) { var n = e.dCtx.timescaleLabels[0], l = e.dCtx.timescaleLabels[e.dCtx.timescaleLabels.length - 1].position + o / 1.75 - e.dCtx.yAxisWidthRight, h = n.position - o / 1.75 + e.dCtx.yAxisWidthLeft, c = "right" === i.config.legend.position && e.dCtx.lgRect.width > 0 ? e.dCtx.lgRect.width : 0; l > a.svgWidth - a.translateX - c && (a.skipLastTimelinelabel = !0), h < -(t.show && !t.floating || "bar" !== s.chart.type && "candlestick" !== s.chart.type && "rangeBar" !== s.chart.type && "boxPlot" !== s.chart.type ? 10 : o / 1.75) && (a.skipFirstTimelinelabel = !0) } else "datetime" === r ? e.dCtx.gridPad.right < o && !a.rotateXLabels && (a.skipLastTimelinelabel = !0) : "datetime" !== r && e.dCtx.gridPad.right < o / 2 - e.dCtx.yAxisWidthRight && !a.rotateXLabels && !i.config.xaxis.labels.trim && (e.dCtx.xPadRight = o / 2 + 1) }(t) }; s.yaxis.forEach((function (t, i) { n ? (e.dCtx.gridPad.left < o && (e.dCtx.xPadLeft = o / 2 + 1), e.dCtx.xPadRight = o / 2 + 1) : l(t, i) })) } }]), t }(), lt = function () { function t(e) { i(this, t), this.w = e.w, this.dCtx = e } return s(t, [{ key: "getyAxisLabelsCoords", value: function () { var t = this, e = this.w, i = [], a = 10, s = new M(this.dCtx.ctx); return e.config.yaxis.map((function (r, o) { var n = { seriesIndex: o, dataPointIndex: -1, w: e }, l = e.globals.yAxisScale[o], h = 0; if (!s.isYAxisHidden(o) && r.labels.show && void 0 !== r.labels.minWidth && (h = r.labels.minWidth), !s.isYAxisHidden(o) && r.labels.show && l.result.length) { var c = e.globals.yLabelFormatters[o], d = l.niceMin === Number.MIN_VALUE ? 0 : l.niceMin, g = l.result.reduce((function (t, e) { var i, a; return (null === (i = String(c(t, n))) || void 0 === i ? void 0 : i.length) > (null === (a = String(c(e, n))) || void 0 === a ? void 0 : a.length) ? t : e }), d), u = g = c(g, n); if (void 0 !== g && 0 !== g.length || (g = l.niceMax), e.globals.isBarHorizontal) { a = 0; var f = e.globals.labels.slice(); g = m.getLargestStringFromArr(f), g = c(g, { seriesIndex: o, dataPointIndex: -1, w: e }), u = t.dCtx.dimHelpers.getLargestStringFromMultiArr(g, f) } var p = new k(t.dCtx.ctx), x = "rotate(".concat(r.labels.rotate, " 0 0)"), b = p.getTextRects(g, r.labels.style.fontSize, r.labels.style.fontFamily, x, !1), v = b; g !== u && (v = p.getTextRects(u, r.labels.style.fontSize, r.labels.style.fontFamily, x, !1)), i.push({ width: (h > v.width || h > b.width ? h : v.width > b.width ? v.width : b.width) + a, height: v.height > b.height ? v.height : b.height }) } else i.push({ width: 0, height: 0 }) })), i } }, { key: "getyAxisTitleCoords", value: function () { var t = this, e = this.w, i = []; return e.config.yaxis.map((function (e, a) { if (e.show && void 0 !== e.title.text) { var s = new k(t.dCtx.ctx), r = "rotate(".concat(e.title.rotate, " 0 0)"), o = s.getTextRects(e.title.text, e.title.style.fontSize, e.title.style.fontFamily, r, !1); i.push({ width: o.width, height: o.height }) } else i.push({ width: 0, height: 0 }) })), i } }, { key: "getTotalYAxisWidth", value: function () { var t = this.w, e = 0, i = 0, a = 0, s = t.globals.yAxisScale.length > 1 ? 10 : 0, r = new M(this.dCtx.ctx), o = function (o, n) { var l = t.config.yaxis[n].floating, h = 0; o.width > 0 && !l ? (h = o.width + s, function (e) { return t.globals.ignoreYAxisIndexes.indexOf(e) > -1 }(n) && (h = h - o.width - s)) : h = l || r.isYAxisHidden(n) ? 0 : 5, t.config.yaxis[n].opposite ? a += h : i += h, e += h }; return t.globals.yLabelsCoords.map((function (t, e) { o(t, e) })), t.globals.yTitleCoords.map((function (t, e) { o(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 = i, this.dCtx.yAxisWidthRight = a, e } }]), t }(), ht = function () { function t(e) { i(this, t), this.w = e.w, this.dCtx = e } return s(t, [{ key: "gridPadForColumnsInNumericAxis", value: function (t) { var e = this.w, i = e.config, a = e.globals; if (a.noData || a.collapsedSeries.length + a.ancillaryCollapsedSeries.length === i.series.length) return 0; var s = function (t) { return ["bar", "rangeBar", "candlestick", "boxPlot"].includes(t) }, r = i.chart.type, o = 0, n = s(r) ? i.series.length : 1; a.comboBarCount > 0 && (n = a.comboBarCount), a.collapsedSeries.forEach((function (t) { s(t.type) && (n -= 1) })), i.chart.stacked && (n = 1); var l = s(r) || a.comboBarCount > 0, h = Math.abs(a.initialMaxX - a.initialMinX); if (l && a.isXNumeric && !a.isBarHorizontal && n > 0 && 0 !== h) { h <= 3 && (h = a.dataPoints); var c = h / t, d = a.minXDiff && a.minXDiff / c > 0 ? a.minXDiff / c : 0; d > t / 2 && (d /= 2), (o = d * parseInt(i.plotOptions.bar.columnWidth, 10) / 100) < 1 && (o = 1), a.barPadForNumericAxis = o } return o } }, { key: "gridPadFortitleSubtitle", value: function () { var t = this, e = this.w, i = e.globals, a = this.dCtx.isSparkline || !i.axisCharts ? 0 : 10;["title", "subtitle"].forEach((function (s) { void 0 !== e.config[s].text ? a += e.config[s].margin : a += t.dCtx.isSparkline || !i.axisCharts ? 0 : 5 })), !e.config.legend.show || "bottom" !== e.config.legend.position || e.config.legend.floating || i.axisCharts || (a += 10); var s = this.dCtx.dimHelpers.getTitleSubtitleCoords("title"), r = this.dCtx.dimHelpers.getTitleSubtitleCoords("subtitle"); i.gridHeight -= s.height + r.height + a, i.translateY += s.height + r.height + a } }, { key: "setGridXPosForDualYAxis", value: function (t, e) { var i = this.w, a = new M(this.dCtx.ctx); i.config.yaxis.forEach((function (s, r) { -1 !== i.globals.ignoreYAxisIndexes.indexOf(r) || s.floating || a.isYAxisHidden(r) || (s.opposite && (i.globals.translateX -= e[r].width + t[r].width + parseInt(s.labels.style.fontSize, 10) / 1.2 + 12), i.globals.translateX < 2 && (i.globals.translateX = 2)) })) } }]), t }(), ct = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.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 ot(this), this.dimYAxis = new lt(this), this.dimXAxis = new nt(this), this.dimGrid = new ht(this), this.lgWidthForSideLegends = 0, this.gridPad = this.w.config.grid.padding, this.xPadRight = 0, this.xPadLeft = 0 } return s(t, [{ key: "plotCoords", value: function () { var t = this, e = this.w, i = e.globals; this.lgRect = this.dimHelpers.getLegendsRect(), this.datalabelsCoords = { width: 0, height: 0 }; var a = Array.isArray(e.config.stroke.width) ? Math.max.apply(Math, p(e.config.stroke.width)) : e.config.stroke.width; this.isSparkline && ((e.config.markers.discrete.length > 0 || e.config.markers.size > 0) && Object.entries(this.gridPad).forEach((function (e) { var i = f(e, 2), a = i[0], s = i[1]; t.gridPad[a] = Math.max(s, t.w.globals.markers.largestSize / 1.5) })), this.gridPad.top = Math.max(a / 2, this.gridPad.top), this.gridPad.bottom = Math.max(a / 2, this.gridPad.bottom)), i.axisCharts ? this.setDimensionsForAxisCharts() : this.setDimensionsForNonAxisCharts(), this.dimGrid.gridPadFortitleSubtitle(), i.gridHeight = i.gridHeight - this.gridPad.top - this.gridPad.bottom, i.gridWidth = i.gridWidth - this.gridPad.left - this.gridPad.right - this.xPadRight - this.xPadLeft; var s = this.dimGrid.gridPadForColumnsInNumericAxis(i.gridWidth); i.gridWidth = i.gridWidth - 2 * s, i.translateX = i.translateX + this.gridPad.left + this.xPadLeft + (s > 0 ? s : 0), i.translateY = i.translateY + this.gridPad.top } }, { key: "setDimensionsForAxisCharts", value: function () { var t = this, e = this.w, i = e.globals, a = this.dimYAxis.getyAxisLabelsCoords(), s = this.dimYAxis.getyAxisTitleCoords(); i.isSlopeChart && (this.datalabelsCoords = this.dimHelpers.getDatalabelsRect()), e.globals.yLabelsCoords = [], e.globals.yTitleCoords = [], e.config.yaxis.map((function (t, i) { e.globals.yLabelsCoords.push({ width: a[i].width, index: i }), e.globals.yTitleCoords.push({ width: s[i].width, index: i }) })), this.yAxisWidth = this.dimYAxis.getTotalYAxisWidth(); var r = this.dimXAxis.getxAxisLabelsCoords(), o = this.dimXAxis.getxAxisGroupLabelsCoords(), n = this.dimXAxis.getxAxisTitleCoords(); this.conditionalChecksForAxisCoords(r, n, o), i.translateXAxisY = e.globals.rotateXLabels ? this.xAxisHeight / 8 : -4, i.translateXAxisX = e.globals.rotateXLabels && e.globals.isXNumeric && e.config.xaxis.labels.rotate <= -45 ? -this.xAxisWidth / 4 : 0, e.globals.isBarHorizontal && (i.rotateXLabels = !1, i.translateXAxisY = parseInt(e.config.xaxis.labels.style.fontSize, 10) / 1.5 * -1), i.translateXAxisY = i.translateXAxisY + e.config.xaxis.labels.offsetY, i.translateXAxisX = i.translateXAxisX + e.config.xaxis.labels.offsetX; var l = this.yAxisWidth, h = this.xAxisHeight; i.xAxisLabelsHeight = this.xAxisHeight - n.height, i.xAxisGroupLabelsHeight = i.xAxisLabelsHeight - r.height, i.xAxisLabelsWidth = this.xAxisWidth, i.xAxisHeight = this.xAxisHeight; var c = 10; ("radar" === e.config.chart.type || this.isSparkline) && (l = 0, h = 0), this.isSparkline && (this.lgRect = { height: 0, width: 0 }), (this.isSparkline || "treemap" === e.config.chart.type) && (l = 0, h = 0, c = 0), this.isSparkline || "treemap" === e.config.chart.type || this.dimXAxis.additionalPaddingXLabels(r); var d = function () { i.translateX = l + t.datalabelsCoords.width, i.gridHeight = i.svgHeight - t.lgRect.height - h - (t.isSparkline || "treemap" === e.config.chart.type ? 0 : e.globals.rotateXLabels ? 10 : 15), i.gridWidth = i.svgWidth - l - 2 * t.datalabelsCoords.width }; switch ("top" === e.config.xaxis.position && (c = i.xAxisHeight - e.config.xaxis.axisTicks.height - 5), e.config.legend.position) { case "bottom": i.translateY = c, d(); break; case "top": i.translateY = this.lgRect.height + c, d(); break; case "left": i.translateY = c, i.translateX = this.lgRect.width + l + this.datalabelsCoords.width, i.gridHeight = i.svgHeight - h - 12, i.gridWidth = i.svgWidth - this.lgRect.width - l - 2 * this.datalabelsCoords.width; break; case "right": i.translateY = c, i.translateX = l + this.datalabelsCoords.width, i.gridHeight = i.svgHeight - h - 12, i.gridWidth = i.svgWidth - this.lgRect.width - l - 2 * this.datalabelsCoords.width - 5; break; default: throw new Error("Legend position not supported") }this.dimGrid.setGridXPosForDualYAxis(s, a), new Q(this.ctx).setYAxisXPosition(a, s) } }, { key: "setDimensionsForNonAxisCharts", value: function () { var t = this.w, e = t.globals, i = t.config, a = 0; t.config.legend.show && !t.config.legend.floating && (a = 20); var s = "pie" === i.chart.type || "polarArea" === i.chart.type || "donut" === i.chart.type ? "pie" : "radialBar", r = i.plotOptions[s].offsetY, o = i.plotOptions[s].offsetX; if (!i.legend.show || i.legend.floating) { e.gridHeight = e.svgHeight; var n = e.dom.elWrap.getBoundingClientRect().width; return e.gridWidth = Math.min(n, e.gridHeight), e.translateY = r, void (e.translateX = o + (e.svgWidth - e.gridWidth) / 2) } switch (i.legend.position) { case "bottom": e.gridHeight = e.svgHeight - this.lgRect.height, e.gridWidth = e.svgWidth, e.translateY = r - 10, e.translateX = o + (e.svgWidth - e.gridWidth) / 2; break; case "top": e.gridHeight = e.svgHeight - this.lgRect.height, e.gridWidth = e.svgWidth, e.translateY = this.lgRect.height + r + 10, e.translateX = o + (e.svgWidth - e.gridWidth) / 2; break; case "left": e.gridWidth = e.svgWidth - this.lgRect.width - a, e.gridHeight = "auto" !== i.chart.height ? e.svgHeight : e.gridWidth, e.translateY = r, e.translateX = o + this.lgRect.width + a; break; case "right": e.gridWidth = e.svgWidth - this.lgRect.width - a - 5, e.gridHeight = "auto" !== i.chart.height ? e.svgHeight : e.gridWidth, e.translateY = r, e.translateX = o + 10; break; default: throw new Error("Legend position not supported") } } }, { key: "conditionalChecksForAxisCoords", value: function (t, e, i) { var a = this.w, s = a.globals.hasXaxisGroups ? 2 : 1, r = i.height + t.height + e.height, o = a.globals.isMultiLineX ? 1.2 : a.globals.LINE_HEIGHT_RATIO, n = a.globals.rotateXLabels ? 22 : 10, l = a.globals.rotateXLabels && "bottom" === a.config.legend.position ? 10 : 0; this.xAxisHeight = r * o + s * n + l, this.xAxisWidth = t.width, this.xAxisHeight - e.height > a.config.xaxis.labels.maxHeight && (this.xAxisHeight = a.config.xaxis.labels.maxHeight), a.config.xaxis.labels.minHeight && this.xAxisHeight < a.config.xaxis.labels.minHeight && (this.xAxisHeight = a.config.xaxis.labels.minHeight), a.config.xaxis.floating && (this.xAxisHeight = 0); var h = 0, c = 0; a.config.yaxis.forEach((function (t) { h += t.labels.minWidth, c += t.labels.maxWidth })), this.yAxisWidth < h && (this.yAxisWidth = h), this.yAxisWidth > c && (this.yAxisWidth = c) } }]), t }(), dt = function () { function t(e) { i(this, t), this.w = e.w, this.lgCtx = e } return s(t, [{ key: "getLegendStyles", value: function () { var t, e, i, a = document.createElement("style"); a.setAttribute("type", "text/css"); var s = (null === (t = this.lgCtx.ctx) || void 0 === t || null === (e = t.opts) || void 0 === e || null === (i = e.chart) || void 0 === i ? void 0 : i.nonce) || this.w.config.chart.nonce; s && a.setAttribute("nonce", s); var r = document.createTextNode("\n .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.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 }\n .apexcharts-legend.apx-legend-position-bottom.apexcharts-align-center, .apexcharts-legend.apx-legend-position-top.apexcharts-align-center {\n justify-content: 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 }\n .apexcharts-legend-series {\n cursor: pointer;\n line-height: normal;\n display: flex;\n align-items: center;\n }\n .apexcharts-legend-text {\n position: relative;\n font-size: 14px;\n }\n .apexcharts-legend-text *, .apexcharts-legend-marker * {\n pointer-events: none;\n }\n .apexcharts-legend-marker {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin-right: 1px;\n }\n\n .apexcharts-legend-series.apexcharts-no-click {\n cursor: auto;\n }\n .apexcharts-legend .apexcharts-hidden-zero-series, .apexcharts-legend .apexcharts-hidden-null-series {\n display: none !important;\n }\n .apexcharts-inactive-legend {\n opacity: 0.45;\n }"); return a.appendChild(r), a } }, { key: "getLegendDimensions", value: function () { var t = this.w.globals.dom.baseEl.querySelector(".apexcharts-legend").getBoundingClientRect(), e = t.width; return { clwh: t.height, clww: e } } }, { key: "appendToForeignObject", value: function () { this.w.globals.dom.elLegendForeign.appendChild(this.getLegendStyles()) } }, { key: "toggleDataSeries", value: function (t, e) { var i = this, a = this.w; if (a.globals.axisCharts || "radialBar" === a.config.chart.type) { a.globals.resized = !0; var s = null, r = null; if (a.globals.risingSeries = [], a.globals.axisCharts ? (s = a.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(t, "']")), r = parseInt(s.getAttribute("data:realIndex"), 10)) : (s = a.globals.dom.baseEl.querySelector(".apexcharts-series[rel='".concat(t + 1, "']")), r = parseInt(s.getAttribute("rel"), 10) - 1), e) [{ cs: a.globals.collapsedSeries, csi: a.globals.collapsedSeriesIndices }, { cs: a.globals.ancillaryCollapsedSeries, csi: a.globals.ancillaryCollapsedSeriesIndices }].forEach((function (t) { i.riseCollapsedSeries(t.cs, t.csi, r) })); else this.hideSeries({ seriesEl: s, realIndex: r }) } else { var o = a.globals.dom.Paper.select(" .apexcharts-series[rel='".concat(t + 1, "'] path")), n = a.config.chart.type; if ("pie" === n || "polarArea" === n || "donut" === n) { var l = a.config.plotOptions.pie.donut.labels; new k(this.lgCtx.ctx).pathMouseDown(o.members[0], null), this.lgCtx.ctx.pie.printDataLabelsInner(o.members[0].node, l) } o.fire("click") } } }, { key: "getSeriesAfterCollapsing", value: function (t) { var e = t.realIndex, i = this.w, a = i.globals, s = m.clone(i.config.series); if (a.axisCharts) { var r = i.config.yaxis[a.seriesYAxisReverseMap[e]], o = { index: e, data: s[e].data.slice(), type: s[e].type || i.config.chart.type }; if (r && r.show && r.showAlways) a.ancillaryCollapsedSeriesIndices.indexOf(e) < 0 && (a.ancillaryCollapsedSeries.push(o), a.ancillaryCollapsedSeriesIndices.push(e)); else if (a.collapsedSeriesIndices.indexOf(e) < 0) { a.collapsedSeries.push(o), a.collapsedSeriesIndices.push(e); var n = a.risingSeries.indexOf(e); a.risingSeries.splice(n, 1) } } else a.collapsedSeries.push({ index: e, data: s[e] }), a.collapsedSeriesIndices.push(e); return a.allSeriesCollapsed = a.collapsedSeries.length + a.ancillaryCollapsedSeries.length === i.config.series.length, this._getSeriesBasedOnCollapsedState(s) } }, { key: "hideSeries", value: function (t) { for (var e = t.seriesEl, i = t.realIndex, a = this.w, s = this.getSeriesAfterCollapsing({ realIndex: i }), r = e.childNodes, o = 0; o < r.length; o++)r[o].classList.contains("apexcharts-series-markers-wrap") && (r[o].classList.contains("apexcharts-hide") ? r[o].classList.remove("apexcharts-hide") : r[o].classList.add("apexcharts-hide")); this.lgCtx.ctx.updateHelpers._updateSeries(s, a.config.chart.animations.dynamicAnimation.enabled) } }, { key: "riseCollapsedSeries", value: function (t, e, i) { var a = this.w, s = m.clone(a.config.series); if (t.length > 0) { for (var r = 0; r < t.length; r++)t[r].index === i && (a.globals.axisCharts ? s[i].data = t[r].data.slice() : s[i] = t[r].data, s[i].hidden = !1, t.splice(r, 1), e.splice(r, 1), a.globals.risingSeries.push(i)); s = this._getSeriesBasedOnCollapsedState(s), this.lgCtx.ctx.updateHelpers._updateSeries(s, a.config.chart.animations.dynamicAnimation.enabled) } } }, { key: "_getSeriesBasedOnCollapsedState", value: function (t) { var e = this.w, i = 0; return e.globals.axisCharts ? t.forEach((function (a, s) { e.globals.collapsedSeriesIndices.indexOf(s) < 0 && e.globals.ancillaryCollapsedSeriesIndices.indexOf(s) < 0 || (t[s].data = [], i++) })) : t.forEach((function (a, s) { !e.globals.collapsedSeriesIndices.indexOf(s) < 0 && (t[s] = 0, i++) })), e.globals.allSeriesCollapsed = i === t.length, t } }]), t }(), gt = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.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 dt(this) } return s(t, [{ key: "init", value: function () { var t = this.w, e = t.globals, i = t.config, a = i.legend.showForSingleSeries && 1 === e.series.length || this.isBarsDistributed || e.series.length > 1; if (this.legendHelpers.appendToForeignObject(), (a || !e.axisCharts) && i.legend.show) { for (; e.dom.elLegendWrap.firstChild;)e.dom.elLegendWrap.removeChild(e.dom.elLegendWrap.firstChild); this.drawLegends(), "bottom" === i.legend.position || "top" === i.legend.position ? this.legendAlignHorizontal() : "right" !== i.legend.position && "left" !== i.legend.position || this.legendAlignVertical() } } }, { key: "createLegendMarker", value: function (t) { var e = t.i, i = t.fillcolor, a = this.w, s = document.createElement("span"); s.classList.add("apexcharts-legend-marker"); var r = a.config.legend.markers.shape || a.config.markers.shape, o = r; Array.isArray(r) && (o = r[e]); var n = Array.isArray(a.config.legend.markers.size) ? parseFloat(a.config.legend.markers.size[e]) : parseFloat(a.config.legend.markers.size), l = Array.isArray(a.config.legend.markers.offsetX) ? parseFloat(a.config.legend.markers.offsetX[e]) : parseFloat(a.config.legend.markers.offsetX), h = Array.isArray(a.config.legend.markers.offsetY) ? parseFloat(a.config.legend.markers.offsetY[e]) : parseFloat(a.config.legend.markers.offsetY), c = Array.isArray(a.config.legend.markers.strokeWidth) ? parseFloat(a.config.legend.markers.strokeWidth[e]) : parseFloat(a.config.legend.markers.strokeWidth), d = s.style; if (d.height = 2 * (n + c) + "px", d.width = 2 * (n + c) + "px", d.left = l + "px", d.top = h + "px", a.config.legend.markers.customHTML) d.background = "transparent", d.color = i[e], Array.isArray(a.config.legend.markers.customHTML) ? a.config.legend.markers.customHTML[e] && (s.innerHTML = a.config.legend.markers.customHTML[e]()) : s.innerHTML = a.config.legend.markers.customHTML(); else { var u = new W(this.ctx).getMarkerConfig({ cssClass: "apexcharts-legend-marker apexcharts-marker apexcharts-marker-".concat(o), seriesIndex: e, strokeWidth: c, size: n }), f = SVG(s).size("100%", "100%"), p = new k(this.ctx).drawMarker(0, 0, g(g({}, u), {}, { pointFillColor: Array.isArray(i) ? i[e] : u.pointFillColor, shape: o })); SVG.select(".apexcharts-legend-marker.apexcharts-marker").members.forEach((function (t) { t.node.classList.contains("apexcharts-marker-triangle") ? t.node.style.transform = "translate(50%, 45%)" : t.node.style.transform = "translate(50%, 50%)" })), f.add(p) } return s } }, { key: "drawLegends", value: function () { var t = this, e = this.w, i = e.config.legend.fontFamily, a = e.globals.seriesNames, s = e.config.legend.markers.fillColors ? e.config.legend.markers.fillColors.slice() : e.globals.colors.slice(); if ("heatmap" === e.config.chart.type) { var r = e.config.plotOptions.heatmap.colorScale.ranges; a = r.map((function (t) { return t.name ? t.name : t.from + " - " + t.to })), s = r.map((function (t) { return t.color })) } else this.isBarsDistributed && (a = e.globals.labels.slice()); e.config.legend.customLegendItems.length && (a = e.config.legend.customLegendItems); for (var o = e.globals.legendFormatter, n = e.config.legend.inverseOrder, l = n ? a.length - 1 : 0; n ? l >= 0 : l <= a.length - 1; n ? l-- : l++) { var h, c = o(a[l], { seriesIndex: l, w: e }), d = !1, g = !1; if (e.globals.collapsedSeries.length > 0) for (var u = 0; u < e.globals.collapsedSeries.length; u++)e.globals.collapsedSeries[u].index === l && (d = !0); if (e.globals.ancillaryCollapsedSeriesIndices.length > 0) for (var f = 0; f < e.globals.ancillaryCollapsedSeriesIndices.length; f++)e.globals.ancillaryCollapsedSeriesIndices[f] === l && (g = !0); var p = this.createLegendMarker({ i: l, fillcolor: s }); k.setAttrs(p, { rel: l + 1, "data:collapsed": d || g }), (d || g) && p.classList.add("apexcharts-inactive-legend"); var x = document.createElement("div"), b = document.createElement("span"); b.classList.add("apexcharts-legend-text"), b.innerHTML = Array.isArray(c) ? c.join(" ") : c; var v = e.config.legend.labels.useSeriesColors ? e.globals.colors[l] : Array.isArray(e.config.legend.labels.colors) ? null === (h = e.config.legend.labels.colors) || void 0 === h ? void 0 : h[l] : e.config.legend.labels.colors; v || (v = e.config.chart.foreColor), b.style.color = v, b.style.fontSize = parseFloat(e.config.legend.fontSize) + "px", b.style.fontWeight = e.config.legend.fontWeight, b.style.fontFamily = i || e.config.chart.fontFamily, k.setAttrs(b, { rel: l + 1, i: l, "data:default-text": encodeURIComponent(c), "data:collapsed": d || g }), x.appendChild(p), x.appendChild(b); var y = new A(this.ctx); if (!e.config.legend.showForZeroSeries) 0 === y.getSeriesTotalByIndex(l) && y.seriesHaveSameValues(l) && !y.isSeriesNull(l) && -1 === e.globals.collapsedSeriesIndices.indexOf(l) && -1 === e.globals.ancillaryCollapsedSeriesIndices.indexOf(l) && x.classList.add("apexcharts-hidden-zero-series"); e.config.legend.showForNullSeries || y.isSeriesNull(l) && -1 === e.globals.collapsedSeriesIndices.indexOf(l) && -1 === e.globals.ancillaryCollapsedSeriesIndices.indexOf(l) && x.classList.add("apexcharts-hidden-null-series"), e.globals.dom.elLegendWrap.appendChild(x), e.globals.dom.elLegendWrap.classList.add("apexcharts-align-".concat(e.config.legend.horizontalAlign)), e.globals.dom.elLegendWrap.classList.add("apx-legend-position-" + e.config.legend.position), x.classList.add("apexcharts-legend-series"), x.style.margin = "".concat(e.config.legend.itemMargin.vertical, "px ").concat(e.config.legend.itemMargin.horizontal, "px"), e.globals.dom.elLegendWrap.style.width = e.config.legend.width ? e.config.legend.width + "px" : "", e.globals.dom.elLegendWrap.style.height = e.config.legend.height ? e.config.legend.height + "px" : "", k.setAttrs(x, { rel: l + 1, seriesName: m.escapeString(a[l]), "data:collapsed": d || g }), (d || g) && x.classList.add("apexcharts-inactive-legend"), e.config.legend.onItemClick.toggleDataSeries || x.classList.add("apexcharts-no-click") } e.globals.dom.elWrap.addEventListener("click", t.onLegendClick, !0), e.config.legend.onItemHover.highlightDataSeries && 0 === e.config.legend.customLegendItems.length && (e.globals.dom.elWrap.addEventListener("mousemove", t.onLegendHovered, !0), e.globals.dom.elWrap.addEventListener("mouseout", t.onLegendHovered, !0)) } }, { key: "setLegendWrapXY", value: function (t, e) { var i = this.w, a = i.globals.dom.elLegendWrap, s = a.clientHeight, r = 0, o = 0; if ("bottom" === i.config.legend.position) o = i.globals.svgHeight - Math.min(s, i.globals.svgHeight / 2) - 5; else if ("top" === i.config.legend.position) { var n = new ct(this.ctx), l = n.dimHelpers.getTitleSubtitleCoords("title").height, h = n.dimHelpers.getTitleSubtitleCoords("subtitle").height; o = (l > 0 ? l - 10 : 0) + (h > 0 ? h - 10 : 0) } a.style.position = "absolute", r = r + t + i.config.legend.offsetX, o = o + e + i.config.legend.offsetY, a.style.left = r + "px", a.style.top = o + "px", "right" === i.config.legend.position && (a.style.left = "auto", a.style.right = 25 + i.config.legend.offsetX + "px");["width", "height"].forEach((function (t) { a.style[t] && (a.style[t] = parseInt(i.config.legend[t], 10) + "px") })) } }, { key: "legendAlignHorizontal", value: function () { var t = this.w; t.globals.dom.elLegendWrap.style.right = 0; var e = new ct(this.ctx), i = e.dimHelpers.getTitleSubtitleCoords("title"), a = e.dimHelpers.getTitleSubtitleCoords("subtitle"), s = 0; "top" === t.config.legend.position && (s = i.height + a.height + t.config.title.margin + t.config.subtitle.margin - 10), this.setLegendWrapXY(20, s) } }, { key: "legendAlignVertical", value: function () { var t = this.w, e = this.legendHelpers.getLegendDimensions(), i = 0; "left" === t.config.legend.position && (i = 20), "right" === t.config.legend.position && (i = t.globals.svgWidth - e.clww - 10), this.setLegendWrapXY(i, 20) } }, { key: "onLegendHovered", value: function (t) { var e = this.w, i = 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 (i) { var a = parseInt(t.target.getAttribute("rel"), 10) - 1; this.ctx.events.fireEvent("legendHover", [this.ctx, a, this.w]), new V(this.ctx).highlightRangeInSeries(t, t.target) } } else !t.target.classList.contains("apexcharts-inactive-legend") && i && new V(this.ctx).toggleSeriesOnHover(t, t.target) } }, { key: "onLegendClick", value: function (t) { var 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"))) { var i = parseInt(t.target.getAttribute("rel"), 10) - 1, a = "true" === t.target.getAttribute("data:collapsed"), s = this.w.config.chart.events.legendClick; "function" == typeof s && s(this.ctx, i, this.w), this.ctx.events.fireEvent("legendClick", [this.ctx, i, this.w]); var r = this.w.config.legend.markers.onClick; "function" == typeof r && t.target.classList.contains("apexcharts-legend-marker") && (r(this.ctx, i, this.w), this.ctx.events.fireEvent("legendMarkerClick", [this.ctx, i, this.w])), "treemap" !== e.config.chart.type && "heatmap" !== e.config.chart.type && !this.isBarsDistributed && e.config.legend.onItemClick.toggleDataSeries && this.legendHelpers.toggleDataSeries(i, a) } } }]), t }(), ut = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w; var a = this.w; this.ev = this.w.config.chart.events, this.selectedClass = "apexcharts-selected", this.localeValues = this.w.globals.locale.toolbar, this.minX = a.globals.minX, this.maxX = a.globals.maxX } return s(t, [{ key: "createToolbar", value: function () { var t = this, e = this.w, i = function () { return document.createElement("div") }, a = i(); if (a.setAttribute("class", "apexcharts-toolbar"), a.style.top = e.config.chart.toolbar.offsetY + "px", a.style.right = 3 - e.config.chart.toolbar.offsetX + "px", e.globals.dom.elWrap.appendChild(a), this.elZoom = i(), this.elZoomIn = i(), this.elZoomOut = i(), this.elPan = i(), this.elSelection = i(), this.elZoomReset = i(), this.elMenuIcon = i(), this.elMenu = i(), this.elCustomIcons = [], this.t = e.config.chart.toolbar.tools, Array.isArray(this.t.customIcons)) for (var s = 0; s < this.t.customIcons.length; s++)this.elCustomIcons.push(i()); var r = [], o = function (i, a, s) { var o = i.toLowerCase(); t.t[o] && e.config.chart.zoom.enabled && r.push({ el: a, icon: "string" == typeof t.t[o] ? t.t[o] : s, title: t.localeValues[i], class: "apexcharts-".concat(o, "-icon") }) }; o("zoomIn", this.elZoomIn, '\n'), o("zoomOut", this.elZoomOut, '\n'); var n = function (i) { t.t[i] && e.config.chart[i].enabled && r.push({ el: "zoom" === i ? t.elZoom : t.elSelection, icon: "string" == typeof t.t[i] ? t.t[i] : "zoom" === i ? '' : '', title: t.localeValues["zoom" === i ? "selectionZoom" : "selection"], class: e.globals.isTouchDevice ? "apexcharts-element-hidden" : "apexcharts-".concat(i, "-icon") }) }; n("zoom"), n("selection"), this.t.pan && e.config.chart.zoom.enabled && r.push({ el: this.elPan, icon: "string" == typeof this.t.pan ? this.t.pan : '', title: this.localeValues.pan, class: e.globals.isTouchDevice ? "apexcharts-element-hidden" : "apexcharts-pan-icon" }), o("reset", this.elZoomReset, ''), this.t.download && r.push({ el: this.elMenuIcon, icon: "string" == typeof this.t.download ? this.t.download : '', title: this.localeValues.menu, class: "apexcharts-menu-icon" }); for (var l = 0; l < this.elCustomIcons.length; l++)r.push({ el: this.elCustomIcons[l], icon: this.t.customIcons[l].icon, title: this.t.customIcons[l].title, index: this.t.customIcons[l].index, class: "apexcharts-toolbar-custom-icon " + this.t.customIcons[l].class }); r.forEach((function (t, e) { t.index && m.moveIndexInArray(r, e, t.index) })); for (var h = 0; h < r.length; h++)k.setAttrs(r[h].el, { class: r[h].class, title: r[h].title }), r[h].el.innerHTML = r[h].icon, a.appendChild(r[h].el); this._createHamburgerMenu(a), e.globals.zoomEnabled ? this.elZoom.classList.add(this.selectedClass) : e.globals.panEnabled ? this.elPan.classList.add(this.selectedClass) : e.globals.selectionEnabled && this.elSelection.classList.add(this.selectedClass), this.addToolbarEventListeners() } }, { key: "_createHamburgerMenu", value: function (t) { this.elMenuItems = [], t.appendChild(this.elMenu), k.setAttrs(this.elMenu, { class: "apexcharts-menu" }); for (var e = [{ name: "exportSVG", title: this.localeValues.exportToSVG }, { name: "exportPNG", title: this.localeValues.exportToPNG }, { name: "exportCSV", title: this.localeValues.exportToCSV }], i = 0; i < e.length; i++)this.elMenuItems.push(document.createElement("div")), this.elMenuItems[i].innerHTML = e[i].title, k.setAttrs(this.elMenuItems[i], { class: "apexcharts-menu-item ".concat(e[i].name), title: e[i].title }), this.elMenu.appendChild(this.elMenuItems[i]) } }, { key: "addToolbarEventListeners", value: function () { var t = this; 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((function (e) { e.classList.contains("exportSVG") ? e.addEventListener("click", t.handleDownload.bind(t, "svg")) : e.classList.contains("exportPNG") ? e.addEventListener("click", t.handleDownload.bind(t, "png")) : e.classList.contains("exportCSV") && e.addEventListener("click", t.handleDownload.bind(t, "csv")) })); for (var e = 0; e < this.t.customIcons.length; e++)this.elCustomIcons[e].addEventListener("click", this.t.customIcons[e].click.bind(this, this.ctx, this.ctx.w)) } }, { key: "toggleZoomSelection", value: function (t) { this.ctx.getSyncedCharts().forEach((function (e) { e.ctx.toolbar.toggleOtherControls(); var i = "selection" === t ? e.ctx.toolbar.elSelection : e.ctx.toolbar.elZoom, a = "selection" === t ? "selectionEnabled" : "zoomEnabled"; e.w.globals[a] = !e.w.globals[a], i.classList.contains(e.ctx.toolbar.selectedClass) ? i.classList.remove(e.ctx.toolbar.selectedClass) : i.classList.add(e.ctx.toolbar.selectedClass) })) } }, { key: "getToolbarIconsReference", value: function () { var 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")) } }, { key: "enableZoomPanFromToolbar", value: function (t) { this.toggleOtherControls(), "pan" === t ? this.w.globals.panEnabled = !0 : this.w.globals.zoomEnabled = !0; var e = "pan" === t ? this.elPan : this.elZoom, i = "pan" === t ? this.elZoom : this.elPan; e && e.classList.add(this.selectedClass), i && i.classList.remove(this.selectedClass) } }, { key: "togglePanning", value: function () { this.ctx.getSyncedCharts().forEach((function (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) })) } }, { key: "toggleOtherControls", value: function () { var t = this, e = this.w; e.globals.panEnabled = !1, e.globals.zoomEnabled = !1, e.globals.selectionEnabled = !1, this.getToolbarIconsReference(), [this.elPan, this.elSelection, this.elZoom].forEach((function (e) { e && e.classList.remove(t.selectedClass) })) } }, { key: "handleZoomIn", value: function () { var t = this.w; t.globals.isRangeBar && (this.minX = t.globals.minY, this.maxX = t.globals.maxY); var e = (this.minX + this.maxX) / 2, i = (this.minX + e) / 2, a = (this.maxX + e) / 2, s = this._getNewMinXMaxX(i, a); t.globals.disableZoomIn || this.zoomUpdateOptions(s.minX, s.maxX) } }, { key: "handleZoomOut", value: function () { var 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)) { var e = (this.minX + this.maxX) / 2, i = this.minX - (e - this.minX), a = this.maxX - (e - this.maxX), s = this._getNewMinXMaxX(i, a); t.globals.disableZoomOut || this.zoomUpdateOptions(s.minX, s.maxX) } } }, { key: "_getNewMinXMaxX", value: function (t, e) { var i = this.w.config.xaxis.convertedCatToNumeric; return { minX: i ? Math.floor(t) : t, maxX: i ? Math.floor(e) : e } } }, { key: "zoomUpdateOptions", value: function (t, e) { var i = this.w; if (void 0 !== t || void 0 !== e) { if (!(i.config.xaxis.convertedCatToNumeric && (t < 1 && (t = 1, e = i.globals.dataPoints), e - t < 2))) { var a = { min: t, max: e }, s = this.getBeforeZoomRange(a); s && (a = s.xaxis); var r = { xaxis: a }, o = m.clone(i.globals.initialConfig.yaxis); i.config.chart.group || (r.yaxis = o), this.w.globals.zoomed = !0, this.ctx.updateHelpers._updateOptions(r, !1, this.w.config.chart.animations.dynamicAnimation.enabled), this.zoomCallback(a, o) } } else this.handleZoomReset() } }, { key: "zoomCallback", value: function (t, e) { "function" == typeof this.ev.zoomed && this.ev.zoomed(this.ctx, { xaxis: t, yaxis: e }) } }, { key: "getBeforeZoomRange", value: function (t, e) { var i = null; return "function" == typeof this.ev.beforeZoom && (i = this.ev.beforeZoom(this, { xaxis: t, yaxis: e })), i } }, { key: "toggleMenu", value: function () { var t = this; window.setTimeout((function () { t.elMenu.classList.contains("apexcharts-menu-open") ? t.elMenu.classList.remove("apexcharts-menu-open") : t.elMenu.classList.add("apexcharts-menu-open") }), 0) } }, { key: "handleDownload", value: function (t) { var e = this.w, i = new U(this.ctx); switch (t) { case "svg": i.exportToSVG(this.ctx); break; case "png": i.exportToPng(this.ctx); break; case "csv": i.exportToCSV({ series: e.config.series, columnDelimiter: e.config.chart.toolbar.export.csv.columnDelimiter }) } } }, { key: "handleZoomReset", value: function (t) { this.ctx.getSyncedCharts().forEach((function (t) { var 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) { var i = e.config.chart.events.beforeResetZoom(t, e); i && t.updateHelpers.revertDefaultAxisMinMax(i) } "function" == typeof e.config.chart.events.zoomed && t.ctx.toolbar.zoomCallback({ min: e.config.xaxis.min, max: e.config.xaxis.max }), e.globals.zoomed = !1; var a = t.ctx.series.emptyCollapsedSeries(m.clone(e.globals.initialSeries)); t.updateHelpers._updateSeries(a, e.config.chart.animations.dynamicAnimation.enabled) })) } }, { key: "destroy", value: function () { this.elZoom = null, this.elZoomIn = null, this.elZoomOut = null, this.elPan = null, this.elSelection = null, this.elZoomReset = null, this.elMenuIcon = null } }]), t }(), ft = function (t) { h(a, ut); var e = o(a); function a(t) { var s; return i(this, a), (s = e.call(this, t)).ctx = t, s.w = t.w, s.dragged = !1, s.graphics = new k(s.ctx), s.eventList = ["mousedown", "mouseleave", "mousemove", "touchstart", "touchmove", "mouseup", "touchend", "wheel"], s.clientX = 0, s.clientY = 0, s.startX = 0, s.endX = 0, s.dragX = 0, s.startY = 0, s.endY = 0, s.dragY = 0, s.moveDirection = "none", s.debounceTimer = null, s.debounceDelay = 100, s.wheelDelay = 400, s } return s(a, [{ key: "init", value: function (t) { var e = this, i = t.xyRatios, a = this.w, s = this; this.xyRatios = i, this.zoomRect = this.graphics.drawRect(0, 0, 0, 0), this.selectionRect = this.graphics.drawRect(0, 0, 0, 0), this.gridRect = a.globals.dom.baseEl.querySelector(".apexcharts-grid"), this.zoomRect.node.classList.add("apexcharts-zoom-rect"), this.selectionRect.node.classList.add("apexcharts-selection-rect"), a.globals.dom.elGraphical.add(this.zoomRect), a.globals.dom.elGraphical.add(this.selectionRect), "x" === a.config.chart.selection.type ? this.slDraggableRect = this.selectionRect.draggable({ minX: 0, minY: 0, maxX: a.globals.gridWidth, maxY: a.globals.gridHeight }).on("dragmove", this.selectionDragging.bind(this, "dragging")) : "y" === a.config.chart.selection.type ? this.slDraggableRect = this.selectionRect.draggable({ minX: 0, maxX: a.globals.gridWidth }).on("dragmove", this.selectionDragging.bind(this, "dragging")) : this.slDraggableRect = this.selectionRect.draggable().on("dragmove", this.selectionDragging.bind(this, "dragging")), this.preselectedSelection(), this.hoverArea = a.globals.dom.baseEl.querySelector("".concat(a.globals.chartClass, " .apexcharts-svg")), this.hoverArea.classList.add("apexcharts-zoomable"), this.eventList.forEach((function (t) { e.hoverArea.addEventListener(t, s.svgMouseEvents.bind(s, i), { capture: !1, passive: !0 }) })), a.config.chart.zoom.allowMouseWheelZoom && this.hoverArea.addEventListener("wheel", s.mouseWheelEvent.bind(s), { capture: !1, passive: !1 }) } }, { key: "destroy", value: function () { this.slDraggableRect && (this.slDraggableRect.draggable(!1), this.slDraggableRect.off(), this.selectionRect.off()), this.selectionRect = null, this.zoomRect = null, this.gridRect = null } }, { key: "svgMouseEvents", value: function (t, e) { var i = this.w, a = this, s = this.ctx.toolbar, r = i.globals.zoomEnabled ? i.config.chart.zoom.type : i.config.chart.selection.type, o = i.config.chart.toolbar.autoSelected; if (e.shiftKey ? (this.shiftWasPressed = !0, s.enableZoomPanFromToolbar("pan" === o ? "zoom" : "pan")) : this.shiftWasPressed && (s.enableZoomPanFromToolbar(o), this.shiftWasPressed = !1), e.target) { var n, l = e.target.classList; if (e.target.parentNode && null !== e.target.parentNode && (n = e.target.parentNode.classList), !(l.contains("apexcharts-selection-rect") || l.contains("apexcharts-legend-marker") || l.contains("apexcharts-legend-text") || n && n.contains("apexcharts-toolbar"))) { if (a.clientX = "touchmove" === e.type || "touchstart" === e.type ? e.touches[0].clientX : "touchend" === e.type ? e.changedTouches[0].clientX : e.clientX, a.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) { var h = a.gridRect.getBoundingClientRect(); a.startX = a.clientX - h.left, a.startY = a.clientY - h.top, a.dragged = !1, a.w.globals.mousedown = !0 } if (("mousemove" === e.type && 1 === e.which || "touchmove" === e.type) && (a.dragged = !0, i.globals.panEnabled ? (i.globals.selection = null, a.w.globals.mousedown && a.panDragging({ context: a, zoomtype: r, xyRatios: t })) : (a.w.globals.mousedown && i.globals.zoomEnabled || a.w.globals.mousedown && i.globals.selectionEnabled) && (a.selection = a.selectionDrawing({ context: a, zoomtype: r }))), "mouseup" === e.type || "touchend" === e.type || "mouseleave" === e.type) { var c, d = null === (c = a.gridRect) || void 0 === c ? void 0 : c.getBoundingClientRect(); d && a.w.globals.mousedown && (a.endX = a.clientX - d.left, a.endY = a.clientY - d.top, a.dragX = Math.abs(a.endX - a.startX), a.dragY = Math.abs(a.endY - a.startY), (i.globals.zoomEnabled || i.globals.selectionEnabled) && a.selectionDrawn({ context: a, zoomtype: r }), i.globals.panEnabled && i.config.xaxis.convertedCatToNumeric && a.delayedPanScrolled()), i.globals.zoomEnabled && a.hideSelectionRect(this.selectionRect), a.dragged = !1, a.w.globals.mousedown = !1 } this.makeSelectionRectDraggable() } } } }, { key: "mouseWheelEvent", value: function (t) { var e = this, i = this.w; t.preventDefault(); var a = Date.now(); a - i.globals.lastWheelExecution > this.wheelDelay && (this.executeMouseWheelZoom(t), i.globals.lastWheelExecution = a), this.debounceTimer && clearTimeout(this.debounceTimer), this.debounceTimer = setTimeout((function () { a - i.globals.lastWheelExecution > e.wheelDelay && (e.executeMouseWheelZoom(t), i.globals.lastWheelExecution = a) }), this.debounceDelay) } }, { key: "executeMouseWheelZoom", value: function (t) { var e, i = this.w; this.minX = i.globals.isRangeBar ? i.globals.minY : i.globals.minX, this.maxX = i.globals.isRangeBar ? i.globals.maxY : i.globals.maxX; var a = null === (e = this.gridRect) || void 0 === e ? void 0 : e.getBoundingClientRect(); if (a) { var s, r, o, n = (t.clientX - a.left) / a.width, l = this.minX, h = this.maxX, c = h - l; if (t.deltaY < 0) { var d = l + n * c; r = d - (s = .5 * c) / 2, o = d + s / 2 } else r = l - (s = 1.5 * c) / 2, o = h + s / 2; if (!i.globals.isRangeBar) { r = Math.max(r, i.globals.initialMinX), o = Math.min(o, i.globals.initialMaxX); var g = .01 * (i.globals.initialMaxX - i.globals.initialMinX); if (o - r < g) { var u = (r + o) / 2; r = u - g / 2, o = u + g / 2 } } var f = this._getNewMinXMaxX(r, o); isNaN(f.minX) || isNaN(f.maxX) || this.zoomUpdateOptions(f.minX, f.maxX) } } }, { key: "makeSelectionRectDraggable", value: function () { var t = this.w; if (this.selectionRect) { var e = this.selectionRect.node.getBoundingClientRect(); e.width > 0 && e.height > 0 && this.slDraggableRect.selectize({ points: "l, r", pointSize: 8, pointType: "rect" }).resize({ constraint: { minX: 0, minY: 0, maxX: t.globals.gridWidth, maxY: t.globals.gridHeight } }).on("resizing", this.selectionDragging.bind(this, "resizing")) } } }, { key: "preselectedSelection", value: function () { var t = this.w, e = this.xyRatios; if (!t.globals.zoomEnabled) if (void 0 !== t.globals.selection && null !== t.globals.selection) this.drawSelectionRect(t.globals.selection); else if (void 0 !== t.config.chart.selection.xaxis.min && void 0 !== t.config.chart.selection.xaxis.max) { var i = (t.config.chart.selection.xaxis.min - t.globals.minX) / e.xRatio, a = t.globals.gridWidth - (t.globals.maxX - t.config.chart.selection.xaxis.max) / e.xRatio - i; t.globals.isRangeBar && (i = (t.config.chart.selection.xaxis.min - t.globals.yAxisScale[0].niceMin) / e.invertedYRatio, a = (t.config.chart.selection.xaxis.max - t.config.chart.selection.xaxis.min) / e.invertedYRatio); var s = { x: i, y: 0, width: a, height: t.globals.gridHeight, translateX: 0, translateY: 0, selectionEnabled: !0 }; this.drawSelectionRect(s), 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: {} }) } } }, { key: "drawSelectionRect", value: function (t) { var e = t.x, i = t.y, a = t.width, s = t.height, r = t.translateX, o = void 0 === r ? 0 : r, n = t.translateY, l = void 0 === n ? 0 : n, h = this.w, c = this.zoomRect, d = this.selectionRect; if (this.dragged || null !== h.globals.selection) { var g = { transform: "translate(" + o + ", " + l + ")" }; h.globals.zoomEnabled && this.dragged && (a < 0 && (a = 1), c.attr({ x: e, y: i, width: a, height: s, fill: h.config.chart.zoom.zoomedArea.fill.color, "fill-opacity": h.config.chart.zoom.zoomedArea.fill.opacity, stroke: h.config.chart.zoom.zoomedArea.stroke.color, "stroke-width": h.config.chart.zoom.zoomedArea.stroke.width, "stroke-opacity": h.config.chart.zoom.zoomedArea.stroke.opacity }), k.setAttrs(c.node, g)), h.globals.selectionEnabled && (d.attr({ x: e, y: i, width: a > 0 ? a : 0, height: s > 0 ? s : 0, fill: h.config.chart.selection.fill.color, "fill-opacity": h.config.chart.selection.fill.opacity, stroke: h.config.chart.selection.stroke.color, "stroke-width": h.config.chart.selection.stroke.width, "stroke-dasharray": h.config.chart.selection.stroke.dashArray, "stroke-opacity": h.config.chart.selection.stroke.opacity }), k.setAttrs(d.node, g)) } } }, { key: "hideSelectionRect", value: function (t) { t && t.attr({ x: 0, y: 0, width: 0, height: 0 }) } }, { key: "selectionDrawing", value: function (t) { var e = t.context, i = t.zoomtype, a = this.w, s = e, r = this.gridRect.getBoundingClientRect(), o = s.startX - 1, n = s.startY, l = !1, h = !1, c = s.clientX - r.left - o, d = s.clientY - r.top - n, g = {}; return Math.abs(c + o) > a.globals.gridWidth ? c = a.globals.gridWidth - o : s.clientX - r.left < 0 && (c = o), o > s.clientX - r.left && (l = !0, c = Math.abs(c)), n > s.clientY - r.top && (h = !0, d = Math.abs(d)), g = "x" === i ? { x: l ? o - c : o, y: 0, width: c, height: a.globals.gridHeight } : "y" === i ? { x: 0, y: h ? n - d : n, width: a.globals.gridWidth, height: d } : { x: l ? o - c : o, y: h ? n - d : n, width: c, height: d }, s.drawSelectionRect(g), s.selectionDragging("resizing"), g } }, { key: "selectionDragging", value: function (t, e) { var i = this, a = this.w, s = this.xyRatios, r = this.selectionRect, o = 0; "resizing" === t && (o = 30); var n = function (t) { return parseFloat(r.node.getAttribute(t)) }, l = { x: n("x"), y: n("y"), width: n("width"), height: n("height") }; a.globals.selection = l, "function" == typeof a.config.chart.events.selection && a.globals.selectionEnabled && (clearTimeout(this.w.globals.selectionResizeTimer), this.w.globals.selectionResizeTimer = window.setTimeout((function () { var t, e, o, n, l = i.gridRect.getBoundingClientRect(), h = r.node.getBoundingClientRect(); a.globals.isRangeBar ? (t = a.globals.yAxisScale[0].niceMin + (h.left - l.left) * s.invertedYRatio, e = a.globals.yAxisScale[0].niceMin + (h.right - l.left) * s.invertedYRatio, o = 0, n = 1) : (t = a.globals.xAxisScale.niceMin + (h.left - l.left) * s.xRatio, e = a.globals.xAxisScale.niceMin + (h.right - l.left) * s.xRatio, o = a.globals.yAxisScale[0].niceMin + (l.bottom - h.bottom) * s.yRatio[0], n = a.globals.yAxisScale[0].niceMax - (h.top - l.top) * s.yRatio[0]); var c = { xaxis: { min: t, max: e }, yaxis: { min: o, max: n } }; a.config.chart.events.selection(i.ctx, c), a.config.chart.brush.enabled && void 0 !== a.config.chart.events.brushScrolled && a.config.chart.events.brushScrolled(i.ctx, c) }), o)) } }, { key: "selectionDrawn", value: function (t) { var e = t.context, i = t.zoomtype, a = this.w, s = e, r = this.xyRatios, o = this.ctx.toolbar; if (s.startX > s.endX) { var n = s.startX; s.startX = s.endX, s.endX = n } if (s.startY > s.endY) { var l = s.startY; s.startY = s.endY, s.endY = l } var h = void 0, c = void 0; a.globals.isRangeBar ? (h = a.globals.yAxisScale[0].niceMin + s.startX * r.invertedYRatio, c = a.globals.yAxisScale[0].niceMin + s.endX * r.invertedYRatio) : (h = a.globals.xAxisScale.niceMin + s.startX * r.xRatio, c = a.globals.xAxisScale.niceMin + s.endX * r.xRatio); var d = [], g = []; if (a.config.yaxis.forEach((function (t, e) { var i = a.globals.seriesYAxisMap[e][0]; d.push(a.globals.yAxisScale[e].niceMax - r.yRatio[i] * s.startY), g.push(a.globals.yAxisScale[e].niceMax - r.yRatio[i] * s.endY) })), s.dragged && (s.dragX > 10 || s.dragY > 10) && h !== c) if (a.globals.zoomEnabled) { var u = m.clone(a.globals.initialConfig.yaxis), f = m.clone(a.globals.initialConfig.xaxis); if (a.globals.zoomed = !0, a.config.xaxis.convertedCatToNumeric && (h = Math.floor(h), c = Math.floor(c), h < 1 && (h = 1, c = a.globals.dataPoints), c - h < 2 && (c = h + 1)), "xy" !== i && "x" !== i || (f = { min: h, max: c }), "xy" !== i && "y" !== i || u.forEach((function (t, e) { u[e].min = g[e], u[e].max = d[e] })), o) { var p = o.getBeforeZoomRange(f, u); p && (f = p.xaxis ? p.xaxis : f, u = p.yaxis ? p.yaxis : u) } var x = { xaxis: f }; a.config.chart.group || (x.yaxis = u), s.ctx.updateHelpers._updateOptions(x, !1, s.w.config.chart.animations.dynamicAnimation.enabled), "function" == typeof a.config.chart.events.zoomed && o.zoomCallback(f, u) } else if (a.globals.selectionEnabled) { var b, v = null; b = { min: h, max: c }, "xy" !== i && "y" !== i || (v = m.clone(a.config.yaxis)).forEach((function (t, e) { v[e].min = g[e], v[e].max = d[e] })), a.globals.selection = s.selection, "function" == typeof a.config.chart.events.selection && a.config.chart.events.selection(s.ctx, { xaxis: b, yaxis: v }) } } }, { key: "panDragging", value: function (t) { var e = t.context, i = this.w, a = e; if (void 0 !== i.globals.lastClientPosition.x) { var s = i.globals.lastClientPosition.x - a.clientX, r = i.globals.lastClientPosition.y - a.clientY; Math.abs(s) > Math.abs(r) && s > 0 ? this.moveDirection = "left" : Math.abs(s) > Math.abs(r) && s < 0 ? this.moveDirection = "right" : Math.abs(r) > Math.abs(s) && r > 0 ? this.moveDirection = "up" : Math.abs(r) > Math.abs(s) && r < 0 && (this.moveDirection = "down") } i.globals.lastClientPosition = { x: a.clientX, y: a.clientY }; var o = i.globals.isRangeBar ? i.globals.minY : i.globals.minX, n = i.globals.isRangeBar ? i.globals.maxY : i.globals.maxX; i.config.xaxis.convertedCatToNumeric || a.panScrolled(o, n) } }, { key: "delayedPanScrolled", value: function () { var t = this.w, e = t.globals.minX, i = t.globals.maxX, a = (t.globals.maxX - t.globals.minX) / 2; "left" === this.moveDirection ? (e = t.globals.minX + a, i = t.globals.maxX + a) : "right" === this.moveDirection && (e = t.globals.minX - a, i = t.globals.maxX - a), e = Math.floor(e), i = Math.floor(i), this.updateScrolledChart({ xaxis: { min: e, max: i } }, e, i) } }, { key: "panScrolled", value: function (t, e) { var i = this.w, a = this.xyRatios, s = m.clone(i.globals.initialConfig.yaxis), r = a.xRatio, o = i.globals.minX, n = i.globals.maxX; i.globals.isRangeBar && (r = a.invertedYRatio, o = i.globals.minY, n = i.globals.maxY), "left" === this.moveDirection ? (t = o + i.globals.gridWidth / 15 * r, e = n + i.globals.gridWidth / 15 * r) : "right" === this.moveDirection && (t = o - i.globals.gridWidth / 15 * r, e = n - i.globals.gridWidth / 15 * r), i.globals.isRangeBar || (t < i.globals.initialMinX || e > i.globals.initialMaxX) && (t = o, e = n); var l = { xaxis: { min: t, max: e } }; i.config.chart.group || (l.yaxis = s), this.updateScrolledChart(l, t, e) } }, { key: "updateScrolledChart", value: function (t, e, i) { var a = this.w; this.ctx.updateHelpers._updateOptions(t, !1, !1), "function" == typeof a.config.chart.events.scrolled && a.config.chart.events.scrolled(this.ctx, { xaxis: { min: e, max: i } }) } }]), a }(), pt = function () { function t(e) { i(this, t), this.w = e.w, this.ttCtx = e, this.ctx = e.ctx } return s(t, [{ key: "getNearestValues", value: function (t) { var e = t.hoverArea, i = t.elGrid, a = t.clientX, s = t.clientY, r = this.w, o = i.getBoundingClientRect(), n = o.width, l = o.height, h = n / (r.globals.dataPoints - 1), c = l / r.globals.dataPoints, d = this.hasBars(); !r.globals.comboCharts && !d || r.config.xaxis.convertedCatToNumeric || (h = n / r.globals.dataPoints); var g = a - o.left - r.globals.barPadForNumericAxis, u = s - o.top; g < 0 || u < 0 || g > n || u > l ? (e.classList.remove("hovering-zoom"), e.classList.remove("hovering-pan")) : r.globals.zoomEnabled ? (e.classList.remove("hovering-pan"), e.classList.add("hovering-zoom")) : r.globals.panEnabled && (e.classList.remove("hovering-zoom"), e.classList.add("hovering-pan")); var f = Math.round(g / h), p = Math.floor(u / c); d && !r.config.xaxis.convertedCatToNumeric && (f = Math.ceil(g / h), f -= 1); var x = null, b = null, v = r.globals.seriesXvalues.map((function (t) { return t.filter((function (t) { return m.isNumber(t) })) })), y = r.globals.seriesYvalues.map((function (t) { return t.filter((function (t) { return m.isNumber(t) })) })); if (r.globals.isXNumeric) { var w = this.ttCtx.getElGrid().getBoundingClientRect(), k = g * (w.width / n), A = u * (w.height / l); x = (b = this.closestInMultiArray(k, A, v, y)).index, f = b.j, null !== x && (v = r.globals.seriesXvalues[x], f = (b = this.closestInArray(k, v)).index) } return r.globals.capturedSeriesIndex = null === x ? -1 : x, (!f || f < 1) && (f = 0), r.globals.isBarHorizontal ? r.globals.capturedDataPointIndex = p : r.globals.capturedDataPointIndex = f, { capturedSeries: x, j: r.globals.isBarHorizontal ? p : f, hoverX: g, hoverY: u } } }, { key: "closestInMultiArray", value: function (t, e, i, a) { var s = this.w, r = 0, o = null, n = -1; s.globals.series.length > 1 ? r = this.getFirstActiveXArray(i) : o = 0; var l = i[r][0], h = Math.abs(t - l); if (i.forEach((function (e) { e.forEach((function (e, i) { var a = Math.abs(t - e); a <= h && (h = a, n = i) })) })), -1 !== n) { var c = a[r][n], d = Math.abs(e - c); o = r, a.forEach((function (t, i) { var a = Math.abs(e - t[n]); a <= d && (d = a, o = i) })) } return { index: o, j: n } } }, { key: "getFirstActiveXArray", value: function (t) { for (var e = this.w, i = 0, a = t.map((function (t, e) { return t.length > 0 ? e : -1 })), s = 0; s < a.length; s++)if (-1 !== a[s] && -1 === e.globals.collapsedSeriesIndices.indexOf(s) && -1 === e.globals.ancillaryCollapsedSeriesIndices.indexOf(s)) { i = a[s]; break } return i } }, { key: "closestInArray", value: function (t, e) { for (var i = e[0], a = null, s = Math.abs(t - i), r = 0; r < e.length; r++) { var o = Math.abs(t - e[r]); o < s && (s = o, a = r) } return { index: a } } }, { key: "isXoverlap", value: function (t) { var e = [], i = this.w.globals.seriesX.filter((function (t) { return void 0 !== t[0] })); if (i.length > 0) for (var a = 0; a < i.length - 1; a++)void 0 !== i[a][t] && void 0 !== i[a + 1][t] && i[a][t] !== i[a + 1][t] && e.push("unEqual"); return 0 === e.length } }, { key: "isInitialSeriesSameLen", value: function () { for (var t = !0, e = this.w.globals.initialSeries, i = 0; i < e.length - 1; i++)if (e[i].data.length !== e[i + 1].data.length) { t = !1; break } return t } }, { key: "getBarsHeight", value: function (t) { return p(t).reduce((function (t, e) { return t + e.getBBox().height }), 0) } }, { key: "getElMarkers", value: function (t) { return "number" == typeof t ? this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:realIndex='".concat(t, "'] .apexcharts-series-markers-wrap > *")) : this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap > *") } }, { key: "getAllMarkers", value: function () { var t = this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series-markers-wrap"); (t = p(t)).sort((function (t, e) { var i = Number(t.getAttribute("data:realIndex")), a = Number(e.getAttribute("data:realIndex")); return a < i ? 1 : a > i ? -1 : 0 })); var e = []; return t.forEach((function (t) { e.push(t.querySelector(".apexcharts-marker")) })), e } }, { key: "hasMarkers", value: function (t) { return this.getElMarkers(t).length > 0 } }, { key: "getPathFromPoint", value: function (t, e) { var i = Number(t.getAttribute("cx")), a = Number(t.getAttribute("cy")), s = t.getAttribute("shape"); return new k(this.ctx).getMarkerPath(i, a, s, e) } }, { key: "getElBars", value: function () { return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-bar-series, .apexcharts-candlestick-series, .apexcharts-boxPlot-series, .apexcharts-rangebar-series") } }, { key: "hasBars", value: function () { return this.getElBars().length > 0 } }, { key: "getHoverMarkerSize", value: function (t) { var e = this.w, i = e.config.markers.hover.size; return void 0 === i && (i = e.globals.markers.size[t] + e.config.markers.hover.sizeOffset), i } }, { key: "toggleAllTooltipSeriesGroups", value: function (t) { var e = this.w, i = this.ttCtx; 0 === i.allTooltipSeriesGroups.length && (i.allTooltipSeriesGroups = e.globals.dom.baseEl.querySelectorAll(".apexcharts-tooltip-series-group")); for (var a = i.allTooltipSeriesGroups, s = 0; s < a.length; s++)"enable" === t ? (a[s].classList.add("apexcharts-active"), a[s].style.display = e.config.tooltip.items.display) : (a[s].classList.remove("apexcharts-active"), a[s].style.display = "none") } }]), t }(), xt = function () { function t(e) { i(this, t), this.w = e.w, this.ctx = e.ctx, this.ttCtx = e, this.tooltipUtil = new pt(e) } return s(t, [{ key: "drawSeriesTexts", value: function (t) { var e = t.shared, i = void 0 === e || e, a = t.ttItems, s = t.i, r = void 0 === s ? 0 : s, o = t.j, n = void 0 === o ? null : o, l = t.y1, h = t.y2, c = t.e, d = this.w; void 0 !== d.config.tooltip.custom ? this.handleCustomTooltip({ i: r, j: n, y1: l, y2: h, w: d }) : this.toggleActiveInactiveSeries(i, r); var g = this.getValuesToPrint({ i: r, j: n }); this.printLabels({ i: r, j: n, values: g, ttItems: a, shared: i, e: c }); var u = this.ttCtx.getElTooltip(); this.ttCtx.tooltipRect.ttWidth = u.getBoundingClientRect().width, this.ttCtx.tooltipRect.ttHeight = u.getBoundingClientRect().height } }, { key: "printLabels", value: function (t) { var e, i = this, a = t.i, s = t.j, r = t.values, o = t.ttItems, n = t.shared, l = t.e, h = this.w, c = [], d = function (t) { return h.globals.seriesGoals[t] && h.globals.seriesGoals[t][s] && Array.isArray(h.globals.seriesGoals[t][s]) }, u = r.xVal, f = r.zVal, p = r.xAxisTTVal, x = "", b = h.globals.colors[a]; null !== s && h.config.plotOptions.bar.distributed && (b = h.globals.colors[s]); for (var v = function (t, r) { var v = i.getFormatters(a); x = i.getSeriesName({ fn: v.yLbTitleFormatter, index: a, seriesIndex: a, j: s }), "treemap" === h.config.chart.type && (x = v.yLbTitleFormatter(String(h.config.series[a].data[s].x), { series: h.globals.series, seriesIndex: a, dataPointIndex: s, w: h })); var m = h.config.tooltip.inverseOrder ? r : t; if (h.globals.axisCharts) { var y = function (t) { var e, i, a, r; return h.globals.isRangeData ? v.yLbFormatter(null === (e = h.globals.seriesRangeStart) || void 0 === e || null === (i = e[t]) || void 0 === i ? void 0 : i[s], { series: h.globals.seriesRangeStart, seriesIndex: t, dataPointIndex: s, w: h }) + " - " + v.yLbFormatter(null === (a = h.globals.seriesRangeEnd) || void 0 === a || null === (r = a[t]) || void 0 === r ? void 0 : r[s], { series: h.globals.seriesRangeEnd, seriesIndex: t, dataPointIndex: s, w: h }) : v.yLbFormatter(h.globals.series[t][s], { series: h.globals.series, seriesIndex: t, dataPointIndex: s, w: h }) }; if (n) v = i.getFormatters(m), x = i.getSeriesName({ fn: v.yLbTitleFormatter, index: m, seriesIndex: a, j: s }), b = h.globals.colors[m], e = y(m), d(m) && (c = h.globals.seriesGoals[m][s].map((function (t) { return { attrs: t, val: v.yLbFormatter(t.value, { seriesIndex: m, dataPointIndex: s, w: h }) } }))); else { var w, k = null == l || null === (w = l.target) || void 0 === w ? void 0 : w.getAttribute("fill"); k && (-1 !== k.indexOf("url") ? -1 !== k.indexOf("Pattern") && (b = h.globals.dom.baseEl.querySelector(k.substr(4).slice(0, -1)).childNodes[0].getAttribute("stroke")) : b = k), e = y(a), d(a) && Array.isArray(h.globals.seriesGoals[a][s]) && (c = h.globals.seriesGoals[a][s].map((function (t) { return { attrs: t, val: v.yLbFormatter(t.value, { seriesIndex: a, dataPointIndex: s, w: h }) } }))) } } null === s && (e = v.yLbFormatter(h.globals.series[a], g(g({}, h), {}, { seriesIndex: a, dataPointIndex: a }))), i.DOMHandling({ i: a, t: m, j: s, ttItems: o, values: { val: e, goalVals: c, xVal: u, xAxisTTVal: p, zVal: f }, seriesName: x, shared: n, pColor: b }) }, m = 0, y = h.globals.series.length - 1; m < h.globals.series.length; m++, y--)v(m, y) } }, { key: "getFormatters", value: function (t) { var e, i = this.w, a = i.globals.yLabelFormatters[t]; return void 0 !== i.globals.ttVal ? Array.isArray(i.globals.ttVal) ? (a = i.globals.ttVal[t] && i.globals.ttVal[t].formatter, e = i.globals.ttVal[t] && i.globals.ttVal[t].title && i.globals.ttVal[t].title.formatter) : (a = i.globals.ttVal.formatter, "function" == typeof i.globals.ttVal.title.formatter && (e = i.globals.ttVal.title.formatter)) : e = i.config.tooltip.y.title.formatter, "function" != typeof a && (a = i.globals.yLabelFormatters[0] ? i.globals.yLabelFormatters[0] : function (t) { return t }), "function" != typeof e && (e = function (t) { return t }), { yLbFormatter: a, yLbTitleFormatter: e } } }, { key: "getSeriesName", value: function (t) { var e = t.fn, i = t.index, a = t.seriesIndex, s = t.j, r = this.w; return e(String(r.globals.seriesNames[i]), { series: r.globals.series, seriesIndex: a, dataPointIndex: s, w: r }) } }, { key: "DOMHandling", value: function (t) { t.i; var e = t.t, i = t.j, a = t.ttItems, s = t.values, r = t.seriesName, o = t.shared, n = t.pColor, l = this.w, h = this.ttCtx, c = s.val, d = s.goalVals, g = s.xVal, u = s.xAxisTTVal, f = s.zVal, p = null; p = a[e].children, l.config.tooltip.fillSeriesColor && (a[e].style.backgroundColor = n, p[0].style.display = "none"), h.showTooltipTitle && (null === h.tooltipTitle && (h.tooltipTitle = l.globals.dom.baseEl.querySelector(".apexcharts-tooltip-title")), h.tooltipTitle.innerHTML = g), h.isXAxisTooltipEnabled && (h.xaxisTooltipText.innerHTML = "" !== u ? u : g); var x = a[e].querySelector(".apexcharts-tooltip-text-y-label"); x && (x.innerHTML = r || ""); var b = a[e].querySelector(".apexcharts-tooltip-text-y-value"); b && (b.innerHTML = void 0 !== c ? c : ""), p[0] && p[0].classList.contains("apexcharts-tooltip-marker") && (l.config.tooltip.marker.fillColors && Array.isArray(l.config.tooltip.marker.fillColors) && (n = l.config.tooltip.marker.fillColors[e]), p[0].style.backgroundColor = n), l.config.tooltip.marker.show || (p[0].style.display = "none"); var v = a[e].querySelector(".apexcharts-tooltip-text-goals-label"), m = a[e].querySelector(".apexcharts-tooltip-text-goals-value"); if (d.length && l.globals.seriesGoals[e]) { var y = function () { var t = "
", e = "
"; d.forEach((function (i, a) { t += '
').concat(i.attrs.name, "
"), e += "
".concat(i.val, "
") })), v.innerHTML = t + "
", m.innerHTML = e + "
" }; o ? l.globals.seriesGoals[e][i] && Array.isArray(l.globals.seriesGoals[e][i]) ? y() : (v.innerHTML = "", m.innerHTML = "") : y() } else v.innerHTML = "", m.innerHTML = ""; null !== f && (a[e].querySelector(".apexcharts-tooltip-text-z-label").innerHTML = l.config.tooltip.z.title, a[e].querySelector(".apexcharts-tooltip-text-z-value").innerHTML = void 0 !== f ? f : ""); if (o && p[0]) { if (l.config.tooltip.hideEmptySeries) { var w = a[e].querySelector(".apexcharts-tooltip-marker"), k = a[e].querySelector(".apexcharts-tooltip-text"); 0 == parseFloat(c) ? (w.style.display = "none", k.style.display = "none") : (w.style.display = "block", k.style.display = "block") } null == c || l.globals.ancillaryCollapsedSeriesIndices.indexOf(e) > -1 || l.globals.collapsedSeriesIndices.indexOf(e) > -1 || Array.isArray(h.tConfig.enabledOnSeries) && -1 === h.tConfig.enabledOnSeries.indexOf(e) ? p[0].parentNode.style.display = "none" : p[0].parentNode.style.display = l.config.tooltip.items.display } else Array.isArray(h.tConfig.enabledOnSeries) && -1 === h.tConfig.enabledOnSeries.indexOf(e) && (p[0].parentNode.style.display = "none") } }, { key: "toggleActiveInactiveSeries", value: function (t, e) { var i = this.w; if (t) this.tooltipUtil.toggleAllTooltipSeriesGroups("enable"); else { this.tooltipUtil.toggleAllTooltipSeriesGroups("disable"); var a = i.globals.dom.baseEl.querySelector(".apexcharts-tooltip-series-group-".concat(e)); a && (a.classList.add("apexcharts-active"), a.style.display = i.config.tooltip.items.display) } } }, { key: "getValuesToPrint", value: function (t) { var e = t.i, i = t.j, a = this.w, s = this.ctx.series.filteredSeriesX(), r = "", o = "", n = null, l = null, h = { series: a.globals.series, seriesIndex: e, dataPointIndex: i, w: a }, c = a.globals.ttZFormatter; null === i ? l = a.globals.series[e] : a.globals.isXNumeric && "treemap" !== a.config.chart.type ? (r = s[e][i], 0 === s[e].length && (r = s[this.tooltipUtil.getFirstActiveXArray(s)][i])) : r = new _(this.ctx).isFormatXY() ? void 0 !== a.config.series[e].data[i] ? a.config.series[e].data[i].x : "" : void 0 !== a.globals.labels[i] ? a.globals.labels[i] : ""; var d = r; a.globals.isXNumeric && "datetime" === a.config.xaxis.type ? r = new P(this.ctx).xLabelFormat(a.globals.ttKeyFormatter, d, d, { i: void 0, dateFormatter: new L(this.ctx).formatDate, w: this.w }) : r = a.globals.isBarHorizontal ? a.globals.yLabelFormatters[0](d, h) : a.globals.xLabelFormatter(d, h); return void 0 !== a.config.tooltip.x.formatter && (r = a.globals.ttKeyFormatter(d, h)), a.globals.seriesZ.length > 0 && a.globals.seriesZ[e].length > 0 && (n = c(a.globals.seriesZ[e][i], a)), o = "function" == typeof a.config.xaxis.tooltip.formatter ? a.globals.xaxisTooltipFormatter(d, h) : r, { val: Array.isArray(l) ? l.join(" ") : l, xVal: Array.isArray(r) ? r.join(" ") : r, xAxisTTVal: Array.isArray(o) ? o.join(" ") : o, zVal: n } } }, { key: "handleCustomTooltip", value: function (t) { var e = t.i, i = t.j, a = t.y1, s = t.y2, r = t.w, o = this.ttCtx.getElTooltip(), n = r.config.tooltip.custom; Array.isArray(n) && n[e] && (n = n[e]), o.innerHTML = n({ ctx: this.ctx, series: r.globals.series, seriesIndex: e, dataPointIndex: i, y1: a, y2: s, w: r }) } }]), t }(), bt = function () { function t(e) { i(this, t), this.ttCtx = e, this.ctx = e.ctx, this.w = e.w } return s(t, [{ key: "moveXCrosshairs", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null, i = this.ttCtx, a = this.w, s = i.getElXCrosshairs(), r = t - i.xcrosshairsWidth / 2, o = a.globals.labels.slice().length; if (null !== e && (r = a.globals.gridWidth / o * e), null === s || a.globals.isBarHorizontal || (s.setAttribute("x", r), s.setAttribute("x1", r), s.setAttribute("x2", r), s.setAttribute("y2", a.globals.gridHeight), s.classList.add("apexcharts-active")), r < 0 && (r = 0), r > a.globals.gridWidth && (r = a.globals.gridWidth), i.isXAxisTooltipEnabled) { var n = r; "tickWidth" !== a.config.xaxis.crosshairs.width && "barWidth" !== a.config.xaxis.crosshairs.width || (n = r + i.xcrosshairsWidth / 2), this.moveXAxisTooltip(n) } } }, { key: "moveYCrosshairs", value: function (t) { var e = this.ttCtx; null !== e.ycrosshairs && k.setAttrs(e.ycrosshairs, { y1: t, y2: t }), null !== e.ycrosshairsHidden && k.setAttrs(e.ycrosshairsHidden, { y1: t, y2: t }) } }, { key: "moveXAxisTooltip", value: function (t) { var e = this.w, i = this.ttCtx; if (null !== i.xaxisTooltip && 0 !== i.xcrosshairsWidth) { i.xaxisTooltip.classList.add("apexcharts-active"); var a = i.xaxisOffY + e.config.xaxis.tooltip.offsetY + e.globals.translateY + 1 + e.config.xaxis.offsetY; if (t -= i.xaxisTooltip.getBoundingClientRect().width / 2, !isNaN(t)) { t += e.globals.translateX; var s; s = new k(this.ctx).getTextRects(i.xaxisTooltipText.innerHTML), i.xaxisTooltipText.style.minWidth = s.width + "px", i.xaxisTooltip.style.left = t + "px", i.xaxisTooltip.style.top = a + "px" } } } }, { key: "moveYAxisTooltip", value: function (t) { var e = this.w, i = this.ttCtx; null === i.yaxisTTEls && (i.yaxisTTEls = e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")); var a = parseInt(i.ycrosshairsHidden.getAttribute("y1"), 10), s = e.globals.translateY + a, r = i.yaxisTTEls[t].getBoundingClientRect().height, o = e.globals.translateYAxisX[t] - 2; e.config.yaxis[t].opposite && (o -= 26), s -= r / 2, -1 === e.globals.ignoreYAxisIndexes.indexOf(t) ? (i.yaxisTTEls[t].classList.add("apexcharts-active"), i.yaxisTTEls[t].style.top = s + "px", i.yaxisTTEls[t].style.left = o + e.config.yaxis[t].tooltip.offsetX + "px") : i.yaxisTTEls[t].classList.remove("apexcharts-active") } }, { key: "moveTooltip", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = this.w, s = this.ttCtx, r = s.getElTooltip(), o = s.tooltipRect, n = null !== i ? parseFloat(i) : 1, l = parseFloat(t) + n + 5, h = parseFloat(e) + n / 2; if (l > a.globals.gridWidth / 2 && (l = l - o.ttWidth - n - 10), l > a.globals.gridWidth - o.ttWidth - 10 && (l = a.globals.gridWidth - o.ttWidth), l < -20 && (l = -20), a.config.tooltip.followCursor) { var c = s.getElGrid().getBoundingClientRect(); (l = s.e.clientX - c.left) > a.globals.gridWidth / 2 && (l -= s.tooltipRect.ttWidth), (h = s.e.clientY + a.globals.translateY - c.top) > a.globals.gridHeight / 2 && (h -= s.tooltipRect.ttHeight) } else a.globals.isBarHorizontal || o.ttHeight / 2 + h > a.globals.gridHeight && (h = a.globals.gridHeight - o.ttHeight + a.globals.translateY); isNaN(l) || (l += a.globals.translateX, r.style.left = l + "px", r.style.top = h + "px") } }, { key: "moveMarkers", value: function (t, e) { var i = this.w, a = this.ttCtx; if (i.globals.markers.size[t] > 0) for (var s = i.globals.dom.baseEl.querySelectorAll(" .apexcharts-series[data\\:realIndex='".concat(t, "'] .apexcharts-marker")), r = 0; r < s.length; r++)parseInt(s[r].getAttribute("rel"), 10) === e && (a.marker.resetPointsSize(), a.marker.enlargeCurrentPoint(e, s[r])); else a.marker.resetPointsSize(), this.moveDynamicPointOnHover(e, t) } }, { key: "moveDynamicPointOnHover", value: function (t, e) { var i, a, s, r, o = this.w, n = this.ttCtx, l = new k(this.ctx), h = o.globals.pointsArray, c = n.tooltipUtil.getHoverMarkerSize(e), d = o.config.series[e].type; if (!d || "column" !== d && "candlestick" !== d && "boxPlot" !== d) { s = null === (i = h[e][t]) || void 0 === i ? void 0 : i[0], r = (null === (a = h[e][t]) || void 0 === a ? void 0 : a[1]) || 0; var g = o.globals.dom.baseEl.querySelector(".apexcharts-series[data\\:realIndex='".concat(e, "'] .apexcharts-series-markers path")); if (g && r < o.globals.gridHeight && r > 0) { var u = g.getAttribute("shape"), f = l.getMarkerPath(s, r, u, 1.5 * c); g.setAttribute("d", f) } this.moveXCrosshairs(s), n.fixedTooltip || this.moveTooltip(s, r, c) } } }, { key: "moveDynamicPointsOnHover", value: function (t) { var e, i = this.ttCtx, a = i.w, s = 0, r = 0, o = a.globals.pointsArray, n = new V(this.ctx), l = new k(this.ctx); e = n.getActiveConfigSeriesIndex("asc", ["line", "area", "scatter", "bubble"]); var h = i.tooltipUtil.getHoverMarkerSize(e); o[e] && (s = o[e][t][0], r = o[e][t][1]); var c = i.tooltipUtil.getAllMarkers(); if (null !== c) for (var d = 0; d < a.globals.series.length; d++) { var g = o[d]; if (a.globals.comboCharts && void 0 === g && c.splice(d, 0, null), g && g.length) { var u = o[d][t][1], f = void 0; c[d].setAttribute("cx", s); var p = c[d].getAttribute("shape"); if ("rangeArea" === a.config.chart.type && !a.globals.comboCharts) { var x = t + a.globals.series[d].length; f = o[d][x][1], u -= Math.abs(u - f) / 2 } if (null !== u && !isNaN(u) && u < a.globals.gridHeight + h && u + h > 0) { var b = l.getMarkerPath(s, u, p, h); c[d].setAttribute("d", b) } else c[d].setAttribute("d", "") } } this.moveXCrosshairs(s), i.fixedTooltip || this.moveTooltip(s, r || a.globals.gridHeight, h) } }, { key: "moveStickyTooltipOverBars", value: function (t, e) { var i = this.w, a = this.ttCtx, s = i.globals.columnSeries ? i.globals.columnSeries.length : i.globals.series.length, r = s >= 2 && s % 2 == 0 ? Math.floor(s / 2) : Math.floor(s / 2) + 1; i.globals.isBarHorizontal && (r = new V(this.ctx).getActiveConfigSeriesIndex("desc") + 1); var o = i.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[rel='".concat(r, "'] path[j='").concat(t, "'], .apexcharts-candlestick-series .apexcharts-series[rel='").concat(r, "'] path[j='").concat(t, "'], .apexcharts-boxPlot-series .apexcharts-series[rel='").concat(r, "'] path[j='").concat(t, "'], .apexcharts-rangebar-series .apexcharts-series[rel='").concat(r, "'] path[j='").concat(t, "']")); o || "number" != typeof e || (o = i.globals.dom.baseEl.querySelector(".apexcharts-bar-series .apexcharts-series[data\\:realIndex='".concat(e, "'] path[j='").concat(t, "'],\n .apexcharts-candlestick-series .apexcharts-series[data\\:realIndex='").concat(e, "'] path[j='").concat(t, "'],\n .apexcharts-boxPlot-series .apexcharts-series[data\\:realIndex='").concat(e, "'] path[j='").concat(t, "'],\n .apexcharts-rangebar-series .apexcharts-series[data\\:realIndex='").concat(e, "'] path[j='").concat(t, "']"))); var n = o ? parseFloat(o.getAttribute("cx")) : 0, l = o ? parseFloat(o.getAttribute("cy")) : 0, h = o ? parseFloat(o.getAttribute("barWidth")) : 0, c = a.getElGrid().getBoundingClientRect(), d = o && (o.classList.contains("apexcharts-candlestick-area") || o.classList.contains("apexcharts-boxPlot-area")); i.globals.isXNumeric ? (o && !d && (n -= s % 2 != 0 ? h / 2 : 0), o && d && i.globals.comboCharts && (n -= h / 2)) : i.globals.isBarHorizontal || (n = a.xAxisTicksPositions[t - 1] + a.dataPointsDividedWidth / 2, isNaN(n) && (n = a.xAxisTicksPositions[t] - a.dataPointsDividedWidth / 2)), i.globals.isBarHorizontal ? l -= a.tooltipRect.ttHeight : i.config.tooltip.followCursor ? l = a.e.clientY - c.top - a.tooltipRect.ttHeight / 2 : l + a.tooltipRect.ttHeight + 15 > i.globals.gridHeight && (l = i.globals.gridHeight), i.globals.isBarHorizontal || this.moveXCrosshairs(n), a.fixedTooltip || this.moveTooltip(n, l || i.globals.gridHeight) } }]), t }(), vt = function () { function t(e) { i(this, t), this.w = e.w, this.ttCtx = e, this.ctx = e.ctx, this.tooltipPosition = new bt(e) } return s(t, [{ key: "drawDynamicPoints", value: function () { var t = this.w, e = new k(this.ctx), i = new W(this.ctx), a = t.globals.dom.baseEl.querySelectorAll(".apexcharts-series"); a = p(a), t.config.chart.stacked && a.sort((function (t, e) { return parseFloat(t.getAttribute("data:realIndex")) - parseFloat(e.getAttribute("data:realIndex")) })); for (var s = 0; s < a.length; s++) { var r = a[s].querySelector(".apexcharts-series-markers-wrap"); if (null !== r) { var o = void 0, n = "apexcharts-marker w".concat((Math.random() + 1).toString(36).substring(4)); "line" !== t.config.chart.type && "area" !== t.config.chart.type || t.globals.comboCharts || t.config.tooltip.intersect || (n += " no-pointer-events"); var l = i.getMarkerConfig({ cssClass: n, seriesIndex: Number(r.getAttribute("data:realIndex")) }); (o = e.drawMarker(0, 0, l)).node.setAttribute("default-marker-size", 0); var h = document.createElementNS(t.globals.SVGNS, "g"); h.classList.add("apexcharts-series-markers"), h.appendChild(o.node), r.appendChild(h) } } } }, { key: "enlargeCurrentPoint", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null, s = this.w; "bubble" !== s.config.chart.type && this.newPointSize(t, e); var r = e.getAttribute("cx"), o = e.getAttribute("cy"); if (null !== i && null !== a && (r = i, o = a), this.tooltipPosition.moveXCrosshairs(r), !this.fixedTooltip) { if ("radar" === s.config.chart.type) { var n = this.ttCtx.getElGrid().getBoundingClientRect(); r = this.ttCtx.e.clientX - n.left } this.tooltipPosition.moveTooltip(r, o, s.config.markers.hover.size) } } }, { key: "enlargePoints", value: function (t) { for (var e = this.w, i = this, a = this.ttCtx, s = t, r = e.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"), o = e.config.markers.hover.size, n = 0; n < r.length; n++) { var l = r[n].getAttribute("rel"), h = r[n].getAttribute("index"); if (void 0 === o && (o = e.globals.markers.size[h] + e.config.markers.hover.sizeOffset), s === parseInt(l, 10)) { i.newPointSize(s, r[n]); var c = r[n].getAttribute("cx"), d = r[n].getAttribute("cy"); i.tooltipPosition.moveXCrosshairs(c), a.fixedTooltip || i.tooltipPosition.moveTooltip(c, d, o) } else i.oldPointSize(r[n]) } } }, { key: "newPointSize", value: function (t, e) { var i = this.w, a = i.config.markers.hover.size, s = 0 === t ? e.parentNode.firstChild : e.parentNode.lastChild; if ("0" !== s.getAttribute("default-marker-size")) { var r = parseInt(s.getAttribute("index"), 10); void 0 === a && (a = i.globals.markers.size[r] + i.config.markers.hover.sizeOffset), a < 0 && (a = 0); var o = this.ttCtx.tooltipUtil.getPathFromPoint(e, a); e.setAttribute("d", o) } } }, { key: "oldPointSize", value: function (t) { var e = parseFloat(t.getAttribute("default-marker-size")), i = this.ttCtx.tooltipUtil.getPathFromPoint(t, e); t.setAttribute("d", i) } }, { key: "resetPointsSize", value: function () { for (var t = this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series:not(.apexcharts-series-collapsed) .apexcharts-marker"), e = 0; e < t.length; e++) { var i = parseFloat(t[e].getAttribute("default-marker-size")); if (m.isNumber(i) && i >= 0) { var a = this.ttCtx.tooltipUtil.getPathFromPoint(t[e], i); t[e].setAttribute("d", a) } else t[e].setAttribute("d", "M0,0") } } }]), t }(), mt = function () { function t(e) { i(this, t), this.w = e.w; var a = this.w; this.ttCtx = e, this.isVerticalGroupedRangeBar = !a.globals.isBarHorizontal && "rangeBar" === a.config.chart.type && a.config.plotOptions.bar.rangeBarGroupRows } return s(t, [{ key: "getAttr", value: function (t, e) { return parseFloat(t.target.getAttribute(e)) } }, { key: "handleHeatTreeTooltip", value: function (t) { var e = t.e, i = t.opt, a = t.x, s = t.y, r = t.type, o = this.ttCtx, n = this.w; if (e.target.classList.contains("apexcharts-".concat(r, "-rect"))) { var l = this.getAttr(e, "i"), h = this.getAttr(e, "j"), c = this.getAttr(e, "cx"), d = this.getAttr(e, "cy"), g = this.getAttr(e, "width"), u = this.getAttr(e, "height"); if (o.tooltipLabels.drawSeriesTexts({ ttItems: i.ttItems, i: l, j: h, shared: !1, e: e }), n.globals.capturedSeriesIndex = l, n.globals.capturedDataPointIndex = h, a = c + o.tooltipRect.ttWidth / 2 + g, s = d + o.tooltipRect.ttHeight / 2 - u / 2, o.tooltipPosition.moveXCrosshairs(c + g / 2), a > n.globals.gridWidth / 2 && (a = c - o.tooltipRect.ttWidth / 2 + g), o.w.config.tooltip.followCursor) { var f = n.globals.dom.elWrap.getBoundingClientRect(); a = n.globals.clientX - f.left - (a > n.globals.gridWidth / 2 ? o.tooltipRect.ttWidth : 0), s = n.globals.clientY - f.top - (s > n.globals.gridHeight / 2 ? o.tooltipRect.ttHeight : 0) } } return { x: a, y: s } } }, { key: "handleMarkerTooltip", value: function (t) { var e, i, a = t.e, s = t.opt, r = t.x, o = t.y, n = this.w, l = this.ttCtx; if (a.target.classList.contains("apexcharts-marker")) { var h = parseInt(s.paths.getAttribute("cx"), 10), c = parseInt(s.paths.getAttribute("cy"), 10), d = parseFloat(s.paths.getAttribute("val")); if (i = parseInt(s.paths.getAttribute("rel"), 10), e = parseInt(s.paths.parentNode.parentNode.parentNode.getAttribute("rel"), 10) - 1, l.intersect) { var g = m.findAncestor(s.paths, "apexcharts-series"); g && (e = parseInt(g.getAttribute("data:realIndex"), 10)) } if (l.tooltipLabels.drawSeriesTexts({ ttItems: s.ttItems, i: e, j: i, shared: !l.showOnIntersect && n.config.tooltip.shared, e: a }), "mouseup" === a.type && l.markerClick(a, e, i), n.globals.capturedSeriesIndex = e, n.globals.capturedDataPointIndex = i, r = h, o = c + n.globals.translateY - 1.4 * l.tooltipRect.ttHeight, l.w.config.tooltip.followCursor) { var u = l.getElGrid().getBoundingClientRect(); o = l.e.clientY + n.globals.translateY - u.top } d < 0 && (o = c), l.marker.enlargeCurrentPoint(i, s.paths, r, o) } return { x: r, y: o } } }, { key: "handleBarTooltip", value: function (t) { var e, i, a = t.e, s = t.opt, r = this.w, o = this.ttCtx, n = o.getElTooltip(), l = 0, h = 0, c = 0, d = this.getBarTooltipXY({ e: a, opt: s }); e = d.i; var g = d.j; r.globals.capturedSeriesIndex = e, r.globals.capturedDataPointIndex = g, r.globals.isBarHorizontal && o.tooltipUtil.hasBars() || !r.config.tooltip.shared ? (h = d.x, c = d.y, i = Array.isArray(r.config.stroke.width) ? r.config.stroke.width[e] : r.config.stroke.width, l = h) : r.globals.comboCharts || r.config.tooltip.shared || (l /= 2), isNaN(c) && (c = r.globals.svgHeight - o.tooltipRect.ttHeight); var u = parseInt(s.paths.parentNode.getAttribute("data:realIndex"), 10); if (r.globals.isMultipleYAxis ? r.config.yaxis[u] && r.config.yaxis[u].reversed : r.config.yaxis[0].reversed, h + o.tooltipRect.ttWidth > r.globals.gridWidth ? h -= o.tooltipRect.ttWidth : h < 0 && (h = 0), o.w.config.tooltip.followCursor) { var f = o.getElGrid().getBoundingClientRect(); c = o.e.clientY - f.top } null === o.tooltip && (o.tooltip = r.globals.dom.baseEl.querySelector(".apexcharts-tooltip")), r.config.tooltip.shared || (r.globals.comboBarCount > 0 ? o.tooltipPosition.moveXCrosshairs(l + i / 2) : o.tooltipPosition.moveXCrosshairs(l)), !o.fixedTooltip && (!r.config.tooltip.shared || r.globals.isBarHorizontal && o.tooltipUtil.hasBars()) && (c = c + r.globals.translateY - o.tooltipRect.ttHeight / 2, n.style.left = h + r.globals.translateX + "px", n.style.top = c + "px") } }, { key: "getBarTooltipXY", value: function (t) { var e = this, i = t.e, a = t.opt, s = this.w, r = null, o = this.ttCtx, n = 0, l = 0, h = 0, c = 0, d = 0, g = i.target.classList; if (g.contains("apexcharts-bar-area") || g.contains("apexcharts-candlestick-area") || g.contains("apexcharts-boxPlot-area") || g.contains("apexcharts-rangebar-area")) { var u = i.target, f = u.getBoundingClientRect(), p = a.elGrid.getBoundingClientRect(), x = f.height; d = f.height; var b = f.width, v = parseInt(u.getAttribute("cx"), 10), m = parseInt(u.getAttribute("cy"), 10); c = parseFloat(u.getAttribute("barWidth")); var y = "touchmove" === i.type ? i.touches[0].clientX : i.clientX; r = parseInt(u.getAttribute("j"), 10), n = parseInt(u.parentNode.getAttribute("rel"), 10) - 1; var w = u.getAttribute("data-range-y1"), k = u.getAttribute("data-range-y2"); s.globals.comboCharts && (n = parseInt(u.parentNode.getAttribute("data:realIndex"), 10)); var A = function (t) { return s.globals.isXNumeric ? v - b / 2 : e.isVerticalGroupedRangeBar ? v + b / 2 : v - o.dataPointsDividedWidth + b / 2 }, S = function () { return m - o.dataPointsDividedHeight + x / 2 - o.tooltipRect.ttHeight / 2 }; o.tooltipLabels.drawSeriesTexts({ ttItems: a.ttItems, i: n, j: r, y1: w ? parseInt(w, 10) : null, y2: k ? parseInt(k, 10) : null, shared: !o.showOnIntersect && s.config.tooltip.shared, e: i }), s.config.tooltip.followCursor ? s.globals.isBarHorizontal ? (l = y - p.left + 15, h = S()) : (l = A(), h = i.clientY - p.top - o.tooltipRect.ttHeight / 2 - 15) : s.globals.isBarHorizontal ? ((l = v) < o.xyRatios.baseLineInvertedY && (l = v - o.tooltipRect.ttWidth), h = S()) : (l = A(), h = m) } return { x: l, y: h, barHeight: d, barWidth: c, i: n, j: r } } }]), t }(), yt = function () { function t(e) { i(this, t), this.w = e.w, this.ttCtx = e } return s(t, [{ key: "drawXaxisTooltip", value: function () { var t = this.w, e = this.ttCtx, i = "bottom" === t.config.xaxis.position; e.xaxisOffY = i ? t.globals.gridHeight + 1 : -t.globals.xAxisHeight - t.config.xaxis.axisTicks.height + 3; var a = i ? "apexcharts-xaxistooltip apexcharts-xaxistooltip-bottom" : "apexcharts-xaxistooltip apexcharts-xaxistooltip-top", s = t.globals.dom.elWrap; e.isXAxisTooltipEnabled && (null === t.globals.dom.baseEl.querySelector(".apexcharts-xaxistooltip") && (e.xaxisTooltip = document.createElement("div"), e.xaxisTooltip.setAttribute("class", a + " apexcharts-theme-" + t.config.tooltip.theme), s.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))) } }, { key: "drawYaxisTooltip", value: function () { for (var t = this.w, e = this.ttCtx, i = 0; i < t.config.yaxis.length; i++) { var a = t.config.yaxis[i].opposite || t.config.yaxis[i].crosshairs.opposite; e.yaxisOffX = a ? t.globals.gridWidth + 1 : 1; var s = "apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(i, a ? " apexcharts-yaxistooltip-right" : " apexcharts-yaxistooltip-left"), r = t.globals.dom.elWrap; null === t.globals.dom.baseEl.querySelector(".apexcharts-yaxistooltip apexcharts-yaxistooltip-".concat(i)) && (e.yaxisTooltip = document.createElement("div"), e.yaxisTooltip.setAttribute("class", s + " apexcharts-theme-" + t.config.tooltip.theme), r.appendChild(e.yaxisTooltip), 0 === i && (e.yaxisTooltipText = []), e.yaxisTooltipText[i] = document.createElement("div"), e.yaxisTooltipText[i].classList.add("apexcharts-yaxistooltip-text"), e.yaxisTooltip.appendChild(e.yaxisTooltipText[i])) } } }, { key: "setXCrosshairWidth", value: function () { var t = this.w, e = this.ttCtx, i = e.getElXCrosshairs(); if (e.xcrosshairsWidth = parseInt(t.config.xaxis.crosshairs.width, 10), t.globals.comboCharts) { var a = t.globals.dom.baseEl.querySelector(".apexcharts-bar-area"); if (null !== a && "barWidth" === t.config.xaxis.crosshairs.width) { var s = parseFloat(a.getAttribute("barWidth")); e.xcrosshairsWidth = s } else if ("tickWidth" === t.config.xaxis.crosshairs.width) { var r = t.globals.labels.length; e.xcrosshairsWidth = t.globals.gridWidth / r } } else if ("tickWidth" === t.config.xaxis.crosshairs.width) { var o = t.globals.labels.length; e.xcrosshairsWidth = t.globals.gridWidth / o } else if ("barWidth" === t.config.xaxis.crosshairs.width) { var n = t.globals.dom.baseEl.querySelector(".apexcharts-bar-area"); if (null !== n) { var l = parseFloat(n.getAttribute("barWidth")); e.xcrosshairsWidth = l } else e.xcrosshairsWidth = 1 } t.globals.isBarHorizontal && (e.xcrosshairsWidth = 0), null !== i && e.xcrosshairsWidth > 0 && i.setAttribute("width", e.xcrosshairsWidth) } }, { key: "handleYCrosshair", value: function () { var t = this.w, e = this.ttCtx; e.ycrosshairs = t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs"), e.ycrosshairsHidden = t.globals.dom.baseEl.querySelector(".apexcharts-ycrosshairs-hidden") } }, { key: "drawYaxisTooltipText", value: function (t, e, i) { var a = this.ttCtx, s = this.w, r = s.globals, o = r.seriesYAxisMap[t]; if (a.yaxisTooltips[t] && o.length > 0) { var n = r.yLabelFormatters[t], l = a.getElGrid().getBoundingClientRect(), h = o[0], c = 0; i.yRatio.length > 1 && (c = h); var d = (e - l.top) * i.yRatio[c], g = r.maxYArr[h] - r.minYArr[h], u = r.minYArr[h] + (g - d); s.config.yaxis[t].reversed && (u = r.maxYArr[h] - (g - d)), a.tooltipPosition.moveYCrosshairs(e - l.top), a.yaxisTooltipText[t].innerHTML = n(u), a.tooltipPosition.moveYAxisTooltip(t) } } }]), t }(), wt = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w; var a = this.w; this.tConfig = a.config.tooltip, this.tooltipUtil = new pt(this), this.tooltipLabels = new xt(this), this.tooltipPosition = new bt(this), this.marker = new vt(this), this.intersect = new mt(this), this.axesTooltip = new yt(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 = !a.globals.isBarHorizontal && this.tConfig.shared, this.lastHoverTime = Date.now() } return s(t, [{ key: "getElTooltip", value: function (t) { return t || (t = this), t.w.globals.dom.baseEl ? t.w.globals.dom.baseEl.querySelector(".apexcharts-tooltip") : null } }, { key: "getElXCrosshairs", value: function () { return this.w.globals.dom.baseEl.querySelector(".apexcharts-xcrosshairs") } }, { key: "getElGrid", value: function () { return this.w.globals.dom.baseEl.querySelector(".apexcharts-grid") } }, { key: "drawTooltip", value: function (t) { var e = this.w; this.xyRatios = t, this.isXAxisTooltipEnabled = e.config.xaxis.tooltip.enabled && e.globals.axisCharts, this.yaxisTooltips = e.config.yaxis.map((function (t, i) { return !!(t.show && t.tooltip.enabled && e.globals.axisCharts) })), this.allTooltipSeriesGroups = [], e.globals.axisCharts || (this.showTooltipTitle = !1); var i = document.createElement("div"); if (i.classList.add("apexcharts-tooltip"), e.config.tooltip.cssClass && i.classList.add(e.config.tooltip.cssClass), i.classList.add("apexcharts-theme-".concat(this.tConfig.theme)), e.globals.dom.elWrap.appendChild(i), e.globals.axisCharts) { this.axesTooltip.drawXaxisTooltip(), this.axesTooltip.drawYaxisTooltip(), this.axesTooltip.setXCrosshairWidth(), this.axesTooltip.handleYCrosshair(); var a = new q(this.ctx); this.xAxisTicksPositions = a.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) { 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, i.appendChild(this.tooltipTitle)); var s = e.globals.series.length; (e.globals.xyCharts || e.globals.comboCharts) && this.tConfig.shared && (s = this.showOnIntersect ? 1 : e.globals.series.length), this.legendLabels = e.globals.dom.baseEl.querySelectorAll(".apexcharts-legend-text"), this.ttItems = this.createTTElements(s), this.addSVGEvents() } } }, { key: "createTTElements", value: function (t) { for (var e = this, i = this.w, a = [], s = this.getElTooltip(), r = function (r) { var o = document.createElement("div"); o.classList.add("apexcharts-tooltip-series-group", "apexcharts-tooltip-series-group-".concat(r)), o.style.order = i.config.tooltip.inverseOrder ? t - r : r + 1; var n = document.createElement("span"); n.classList.add("apexcharts-tooltip-marker"), n.style.backgroundColor = i.globals.colors[r], o.appendChild(n); var l = document.createElement("div"); l.classList.add("apexcharts-tooltip-text"), l.style.fontFamily = e.tConfig.style.fontFamily || i.config.chart.fontFamily, l.style.fontSize = e.tConfig.style.fontSize, ["y", "goals", "z"].forEach((function (t) { var e = document.createElement("div"); e.classList.add("apexcharts-tooltip-".concat(t, "-group")); var i = document.createElement("span"); i.classList.add("apexcharts-tooltip-text-".concat(t, "-label")), e.appendChild(i); var a = document.createElement("span"); a.classList.add("apexcharts-tooltip-text-".concat(t, "-value")), e.appendChild(a), l.appendChild(e) })), o.appendChild(l), s.appendChild(o), a.push(o) }, o = 0; o < t; o++)r(o); return a } }, { key: "addSVGEvents", value: function () { var t = this.w, e = t.config.chart.type, i = this.getElTooltip(), a = !("bar" !== e && "candlestick" !== e && "boxPlot" !== e && "rangeBar" !== e), s = "area" === e || "line" === e || "scatter" === e || "bubble" === e || "radar" === e, r = t.globals.dom.Paper.node, o = this.getElGrid(); o && (this.seriesBound = o.getBoundingClientRect()); var n, l = [], h = [], c = { hoverArea: r, elGrid: o, tooltipEl: i, tooltipY: l, tooltipX: h, ttItems: this.ttItems }; if (t.globals.axisCharts && (s ? n = t.globals.dom.baseEl.querySelectorAll(".apexcharts-series[data\\:longestSeries='true'] .apexcharts-marker") : a ? n = 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 || (n = t.globals.dom.baseEl.querySelectorAll(".apexcharts-series .apexcharts-heatmap, .apexcharts-series .apexcharts-treemap")), n && n.length)) for (var d = 0; d < n.length; d++)l.push(n[d].getAttribute("cy")), h.push(n[d].getAttribute("cx")); if (t.globals.xyCharts && !this.showOnIntersect || t.globals.comboCharts && !this.showOnIntersect || a && this.tooltipUtil.hasBars() && this.tConfig.shared) this.addPathsEventListeners([r], c); else if (a && !t.globals.comboCharts || s && this.showOnIntersect) this.addDatapointEventsListeners(c); else if (!t.globals.axisCharts || "heatmap" === e || "treemap" === e) { var g = t.globals.dom.baseEl.querySelectorAll(".apexcharts-series"); this.addPathsEventListeners(g, c) } if (this.showOnIntersect) { var u = t.globals.dom.baseEl.querySelectorAll(".apexcharts-line-series .apexcharts-marker, .apexcharts-area-series .apexcharts-marker"); u.length > 0 && this.addPathsEventListeners(u, c), this.tooltipUtil.hasBars() && !this.tConfig.shared && this.addDatapointEventsListeners(c) } } }, { key: "drawFixedTooltipRect", value: function () { var t = this.w, e = this.getElTooltip(), i = e.getBoundingClientRect(), a = i.width + 10, s = i.height + 10, r = this.tConfig.fixed.offsetX, o = this.tConfig.fixed.offsetY, n = this.tConfig.fixed.position.toLowerCase(); return n.indexOf("right") > -1 && (r = r + t.globals.svgWidth - a + 10), n.indexOf("bottom") > -1 && (o = o + t.globals.svgHeight - s - 10), e.style.left = r + "px", e.style.top = o + "px", { x: r, y: o, ttWidth: a, ttHeight: s } } }, { key: "addDatapointEventsListeners", value: function (t) { var 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) } }, { key: "addPathsEventListeners", value: function (t, e) { for (var i = this, a = function (a) { var s = { paths: t[a], tooltipEl: e.tooltipEl, tooltipY: e.tooltipY, tooltipX: e.tooltipX, elGrid: e.elGrid, hoverArea: e.hoverArea, ttItems: e.ttItems };["mousemove", "mouseup", "touchmove", "mouseout", "touchend"].map((function (e) { return t[a].addEventListener(e, i.onSeriesHover.bind(i, s), { capture: !1, passive: !0 }) })) }, s = 0; s < t.length; s++)a(s) } }, { key: "onSeriesHover", value: function (t, e) { var i = this, a = Date.now() - this.lastHoverTime; a >= 100 ? this.seriesHover(t, e) : (clearTimeout(this.seriesHoverTimeout), this.seriesHoverTimeout = setTimeout((function () { i.seriesHover(t, e) }), 100 - a)) } }, { key: "seriesHover", value: function (t, e) { var i = this; this.lastHoverTime = Date.now(); var a = [], s = this.w; s.config.chart.group && (a = this.ctx.getGroupedCharts()), s.globals.axisCharts && (s.globals.minX === -1 / 0 && s.globals.maxX === 1 / 0 || 0 === s.globals.dataPoints) || (a.length ? a.forEach((function (a) { var s = i.getElTooltip(a), r = { paths: t.paths, tooltipEl: s, tooltipY: t.tooltipY, tooltipX: t.tooltipX, elGrid: t.elGrid, hoverArea: t.hoverArea, ttItems: a.w.globals.tooltip.ttItems }; a.w.globals.minX === i.w.globals.minX && a.w.globals.maxX === i.w.globals.maxX && a.w.globals.tooltip.seriesHoverByContext({ chartCtx: a, ttCtx: a.w.globals.tooltip, opt: r, e: e }) })) : this.seriesHoverByContext({ chartCtx: this.ctx, ttCtx: this.w.globals.tooltip, opt: t, e: e })) } }, { key: "seriesHoverByContext", value: function (t) { var e = t.chartCtx, i = t.ttCtx, a = t.opt, s = t.e, r = e.w, o = this.getElTooltip(e); if (o) { if (i.tooltipRect = { x: 0, y: 0, ttWidth: o.getBoundingClientRect().width, ttHeight: o.getBoundingClientRect().height }, i.e = s, i.tooltipUtil.hasBars() && !r.globals.comboCharts && !i.isBarShared) if (this.tConfig.onDatasetHover.highlightDataSeries) new V(e).toggleSeriesOnHover(s, s.target.parentNode); i.fixedTooltip && i.drawFixedTooltipRect(), r.globals.axisCharts ? i.axisChartsTooltips({ e: s, opt: a, tooltipRect: i.tooltipRect }) : i.nonAxisChartsTooltips({ e: s, opt: a, tooltipRect: i.tooltipRect }) } } }, { key: "axisChartsTooltips", value: function (t) { var e, i, a = t.e, s = t.opt, r = this.w, o = s.elGrid.getBoundingClientRect(), n = "touchmove" === a.type ? a.touches[0].clientX : a.clientX, l = "touchmove" === a.type ? a.touches[0].clientY : a.clientY; if (this.clientY = l, this.clientX = n, r.globals.capturedSeriesIndex = -1, r.globals.capturedDataPointIndex = -1, l < o.top || l > o.top + o.height) this.handleMouseOut(s); else { if (Array.isArray(this.tConfig.enabledOnSeries) && !r.config.tooltip.shared) { var h = parseInt(s.paths.getAttribute("index"), 10); if (this.tConfig.enabledOnSeries.indexOf(h) < 0) return void this.handleMouseOut(s) } var c = this.getElTooltip(), d = this.getElXCrosshairs(), g = []; r.config.chart.group && (g = this.ctx.getSyncedCharts()); var u = r.globals.xyCharts || "bar" === r.config.chart.type && !r.globals.isBarHorizontal && this.tooltipUtil.hasBars() && this.tConfig.shared || r.globals.comboCharts && this.tooltipUtil.hasBars(); if ("mousemove" === a.type || "touchmove" === a.type || "mouseup" === a.type) { if (r.globals.collapsedSeries.length + r.globals.ancillaryCollapsedSeries.length === r.globals.series.length) return; null !== d && d.classList.add("apexcharts-active"); var f = this.yaxisTooltips.filter((function (t) { return !0 === t })); if (null !== this.ycrosshairs && f.length && this.ycrosshairs.classList.add("apexcharts-active"), u && !this.showOnIntersect || g.length > 1) this.handleStickyTooltip(a, n, l, s); else if ("heatmap" === r.config.chart.type || "treemap" === r.config.chart.type) { var p = this.intersect.handleHeatTreeTooltip({ e: a, opt: s, x: e, y: i, type: r.config.chart.type }); e = p.x, i = p.y, c.style.left = e + "px", c.style.top = i + "px" } else this.tooltipUtil.hasBars() && this.intersect.handleBarTooltip({ e: a, opt: s }), this.tooltipUtil.hasMarkers() && this.intersect.handleMarkerTooltip({ e: a, opt: s, x: e, y: i }); if (this.yaxisTooltips.length) for (var x = 0; x < r.config.yaxis.length; x++)this.axesTooltip.drawYaxisTooltipText(x, l, this.xyRatios); r.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"), s.tooltipEl.classList.add("apexcharts-active") } else "mouseout" !== a.type && "touchend" !== a.type || this.handleMouseOut(s) } } }, { key: "nonAxisChartsTooltips", value: function (t) { var e = t.e, i = t.opt, a = t.tooltipRect, s = this.w, r = i.paths.getAttribute("rel"), o = this.getElTooltip(), n = s.globals.dom.elWrap.getBoundingClientRect(); if ("mousemove" === e.type || "touchmove" === e.type) { s.globals.dom.baseEl.classList.add("apexcharts-tooltip-active"), o.classList.add("apexcharts-active"), this.tooltipLabels.drawSeriesTexts({ ttItems: i.ttItems, i: parseInt(r, 10) - 1, shared: !1 }); var l = s.globals.clientX - n.left - a.ttWidth / 2, h = s.globals.clientY - n.top - a.ttHeight - 10; if (o.style.left = l + "px", o.style.top = h + "px", s.config.legend.tooltipHoverFormatter) { var c = r - 1, d = (0, s.config.legend.tooltipHoverFormatter)(this.legendLabels[c].getAttribute("data:default-text"), { seriesIndex: c, dataPointIndex: c, w: s }); this.legendLabels[c].innerHTML = d } } else "mouseout" !== e.type && "touchend" !== e.type || (o.classList.remove("apexcharts-active"), s.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"), s.config.legend.tooltipHoverFormatter && this.legendLabels.forEach((function (t) { var e = t.getAttribute("data:default-text"); t.innerHTML = decodeURIComponent(e) }))) } }, { key: "handleStickyTooltip", value: function (t, e, i, a) { var s = this.w, r = this.tooltipUtil.getNearestValues({ context: this, hoverArea: a.hoverArea, elGrid: a.elGrid, clientX: e, clientY: i }), o = r.j, n = r.capturedSeries; s.globals.collapsedSeriesIndices.includes(n) && (n = null); var l = a.elGrid.getBoundingClientRect(); if (r.hoverX < 0 || r.hoverX > l.width) this.handleMouseOut(a); else if (null !== n) this.handleStickyCapturedSeries(t, n, a, o); else if (this.tooltipUtil.isXoverlap(o) || s.globals.isBarHorizontal) { var h = s.globals.series.findIndex((function (t, e) { return !s.globals.collapsedSeriesIndices.includes(e) })); this.create(t, this, h, o, a.ttItems) } } }, { key: "handleStickyCapturedSeries", value: function (t, e, i, a) { var s = this.w; if (!this.tConfig.shared && null === s.globals.series[e][a]) return void this.handleMouseOut(i); if (void 0 !== s.globals.series[e][a]) this.tConfig.shared && this.tooltipUtil.isXoverlap(a) && this.tooltipUtil.isInitialSeriesSameLen() ? this.create(t, this, e, a, i.ttItems) : this.create(t, this, e, a, i.ttItems, !1); else if (this.tooltipUtil.isXoverlap(a)) { var r = s.globals.series.findIndex((function (t, e) { return !s.globals.collapsedSeriesIndices.includes(e) })); this.create(t, this, r, a, i.ttItems) } } }, { key: "deactivateHoverFilter", value: function () { for (var t = this.w, e = new k(this.ctx), i = t.globals.dom.Paper.select(".apexcharts-bar-area"), a = 0; a < i.length; a++)e.pathMouseLeave(i[a]) } }, { key: "handleMouseOut", value: function (t) { var e = this.w, i = this.getElXCrosshairs(); if (e.globals.dom.baseEl.classList.remove("apexcharts-tooltip-active"), t.tooltipEl.classList.remove("apexcharts-active"), this.deactivateHoverFilter(), "bubble" !== e.config.chart.type && this.marker.resetPointsSize(), null !== i && i.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 (var a = 0; a < this.yaxisTTEls.length; a++)this.yaxisTTEls[a].classList.remove("apexcharts-active") } e.config.legend.tooltipHoverFormatter && this.legendLabels.forEach((function (t) { var e = t.getAttribute("data:default-text"); t.innerHTML = decodeURIComponent(e) })) } }, { key: "markerClick", value: function (t, e, i) { var a = this.w; "function" == typeof a.config.chart.events.markerClick && a.config.chart.events.markerClick(t, this.ctx, { seriesIndex: e, dataPointIndex: i, w: a }), this.ctx.events.fireEvent("markerClick", [t, this.ctx, { seriesIndex: e, dataPointIndex: i, w: a }]) } }, { key: "create", value: function (t, e, i, a, s) { var r, o, n, l, h, c, d, u, f, p, x, b, v, m, y, w, A = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : null, S = this.w, C = e; "mouseup" === t.type && this.markerClick(t, i, a), null === A && (A = this.tConfig.shared); var L = this.tooltipUtil.hasMarkers(i), P = this.tooltipUtil.getElBars(); if (S.config.legend.tooltipHoverFormatter) { var M = S.config.legend.tooltipHoverFormatter, I = Array.from(this.legendLabels); I.forEach((function (t) { var e = t.getAttribute("data:default-text"); t.innerHTML = decodeURIComponent(e) })); for (var T = 0; T < I.length; T++) { var z = I[T], X = parseInt(z.getAttribute("i"), 10), E = decodeURIComponent(z.getAttribute("data:default-text")), Y = M(E, { seriesIndex: A ? X : i, dataPointIndex: a, w: S }); if (A) z.innerHTML = S.globals.collapsedSeriesIndices.indexOf(X) < 0 ? Y : E; else if (z.innerHTML = X === i ? Y : E, i === X) break } } var R = g(g({ ttItems: s, i: i, j: a }, void 0 !== (null === (r = S.globals.seriesRange) || void 0 === r || null === (o = r[i]) || void 0 === o || null === (n = o[a]) || void 0 === n || null === (l = n.y[0]) || void 0 === l ? void 0 : l.y1) && { y1: null === (h = S.globals.seriesRange) || void 0 === h || null === (c = h[i]) || void 0 === c || null === (d = c[a]) || void 0 === d || null === (u = d.y[0]) || void 0 === u ? void 0 : u.y1 }), void 0 !== (null === (f = S.globals.seriesRange) || void 0 === f || null === (p = f[i]) || void 0 === p || null === (x = p[a]) || void 0 === x || null === (b = x.y[0]) || void 0 === b ? void 0 : b.y2) && { y2: null === (v = S.globals.seriesRange) || void 0 === v || null === (m = v[i]) || void 0 === m || null === (y = m[a]) || void 0 === y || null === (w = y.y[0]) || void 0 === w ? void 0 : w.y2 }); if (A) { if (C.tooltipLabels.drawSeriesTexts(g(g({}, R), {}, { shared: !this.showOnIntersect && this.tConfig.shared })), L) S.globals.markers.largestSize > 0 ? C.marker.enlargePoints(a) : C.tooltipPosition.moveDynamicPointsOnHover(a); else if (this.tooltipUtil.hasBars() && (this.barSeriesHeight = this.tooltipUtil.getBarsHeight(P), this.barSeriesHeight > 0)) { var F = new k(this.ctx), D = S.globals.dom.Paper.select(".apexcharts-bar-area[j='".concat(a, "']")); this.deactivateHoverFilter(), this.tooltipPosition.moveStickyTooltipOverBars(a, i); for (var H = 0; H < D.length; H++)F.pathMouseEnter(D[H]) } } else C.tooltipLabels.drawSeriesTexts(g({ shared: !1 }, R)), this.tooltipUtil.hasBars() && C.tooltipPosition.moveStickyTooltipOverBars(a, i), L && C.tooltipPosition.moveMarkers(i, a) } }]), t }(), kt = function () { function t(e) { i(this, t), this.w = e.w, this.barCtx = e, this.totalFormatter = this.w.config.plotOptions.bar.dataLabels.total.formatter, this.totalFormatter || (this.totalFormatter = this.w.config.dataLabels.formatter) } return s(t, [{ key: "handleBarDataLabels", value: function (t) { var e, i, a = t.x, s = t.y, r = t.y1, o = t.y2, n = t.i, l = t.j, h = t.realIndex, c = t.columnGroupIndex, d = t.series, u = t.barHeight, f = t.barWidth, p = t.barXPosition, x = t.barYPosition, b = t.visibleSeries, v = t.renderedPath, m = this.w, y = new k(this.barCtx.ctx), w = Array.isArray(this.barCtx.strokeWidth) ? this.barCtx.strokeWidth[h] : this.barCtx.strokeWidth; m.globals.isXNumeric && !m.globals.isBarHorizontal ? (e = a + parseFloat(f * (b + 1)), i = s + parseFloat(u * (b + 1)) - w) : (e = a + parseFloat(f * b), i = s + parseFloat(u * b)); var A, S = null, C = a, L = s, P = {}, M = m.config.dataLabels, I = this.barCtx.barOptions.dataLabels, T = this.barCtx.barOptions.dataLabels.total; void 0 !== x && this.barCtx.isRangeBar && (i = x, L = x), void 0 !== p && this.barCtx.isVerticalGroupedRangeBar && (e = p, C = p); var z = M.offsetX, X = M.offsetY, E = { width: 0, height: 0 }; if (m.config.dataLabels.enabled) { var Y = m.globals.series[n][l]; E = y.getTextRects(m.config.dataLabels.formatter ? m.config.dataLabels.formatter(Y, g(g({}, m), {}, { seriesIndex: n, dataPointIndex: l, w: m })) : m.globals.yLabelFormatters[0](Y), parseFloat(M.style.fontSize)) } var R = { x: a, y: s, i: n, j: l, realIndex: h, columnGroupIndex: c, renderedPath: v, bcx: e, bcy: i, barHeight: u, barWidth: f, textRects: E, strokeWidth: w, dataLabelsX: C, dataLabelsY: L, dataLabelsConfig: M, barDataLabelsConfig: I, barTotalDataLabelsConfig: T, offX: z, offY: X }; return P = this.barCtx.isHorizontal ? this.calculateBarsDataLabelsPosition(R) : this.calculateColumnsDataLabelsPosition(R), v.attr({ cy: P.bcy, cx: P.bcx, j: l, val: m.globals.series[n][l], barHeight: u, barWidth: f }), A = this.drawCalculatedDataLabels({ x: P.dataLabelsX, y: P.dataLabelsY, val: this.barCtx.isRangeBar ? [r, o] : "100%" === m.config.chart.stackType ? d[h][l] : m.globals.series[h][l], i: h, j: l, barWidth: f, barHeight: u, textRects: E, dataLabelsConfig: M }), m.config.chart.stacked && T.enabled && (S = this.drawTotalDataLabels({ x: P.totalDataLabelsX, y: P.totalDataLabelsY, barWidth: f, barHeight: u, realIndex: h, textAnchor: P.totalDataLabelsAnchor, val: this.getStackedTotalDataLabel({ realIndex: h, j: l }), dataLabelsConfig: M, barTotalDataLabelsConfig: T })), { dataLabels: A, totalDataLabels: S } } }, { key: "getStackedTotalDataLabel", value: function (t) { var e = t.realIndex, i = t.j, a = this.w, s = this.barCtx.stackedSeriesTotals[i]; return this.totalFormatter && (s = this.totalFormatter(s, g(g({}, a), {}, { seriesIndex: e, dataPointIndex: i, w: a }))), s } }, { key: "calculateColumnsDataLabelsPosition", value: function (t) { var e = this.w, i = t.i, a = t.j, s = t.realIndex; t.columnGroupIndex; var r, o, n = t.y, l = t.bcx, h = t.barWidth, c = t.barHeight, d = t.textRects, g = t.dataLabelsX, u = t.dataLabelsY, f = t.dataLabelsConfig, p = t.barDataLabelsConfig, x = t.barTotalDataLabelsConfig, b = t.strokeWidth, v = t.offX, m = t.offY, y = l; c = Math.abs(c); var w = "vertical" === e.config.plotOptions.bar.dataLabels.orientation, A = this.barCtx.barHelpers.getZeroValueEncounters({ i: i, j: a }).zeroEncounters; l -= b / 2; var S = e.globals.gridWidth / e.globals.dataPoints; if (this.barCtx.isVerticalGroupedRangeBar ? g += h / 2 : (g = e.globals.isXNumeric ? l - h / 2 + v : l - S + h / 2 + v, A > 0 && e.config.plotOptions.bar.hideZeroBarsWhenGrouped && (g -= h * A)), w) { g = g + d.height / 2 - b / 2 - 2 } var C = e.globals.series[i][a] < 0, L = n; switch (this.barCtx.isReversed && (L = n + (C ? c : -c)), p.position) { case "center": u = w ? C ? L - c / 2 + m : L + c / 2 - m : C ? L - c / 2 + d.height / 2 + m : L + c / 2 + d.height / 2 - m; break; case "bottom": u = w ? C ? L - c + m : L + c - m : C ? L - c + d.height + b + m : L + c - d.height / 2 + b - m; break; case "top": u = w ? C ? L + m : L - m : C ? L - d.height / 2 - m : L + d.height + m }if (this.barCtx.lastActiveBarSerieIndex === s && x.enabled) { var P = new k(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({ realIndex: s, j: a }), f.fontSize); r = C ? L - P.height / 2 - m - x.offsetY + 18 : L + P.height + m + x.offsetY - 18; var M = S; o = y + (e.globals.isXNumeric ? -h * e.globals.barGroups.length / 2 : e.globals.barGroups.length * h / 2 - (e.globals.barGroups.length - 1) * h - M) + x.offsetX } return e.config.chart.stacked || (u < 0 ? u = 0 + b : u + d.height / 3 > e.globals.gridHeight && (u = e.globals.gridHeight - b)), { bcx: l, bcy: n, dataLabelsX: g, dataLabelsY: u, totalDataLabelsX: o, totalDataLabelsY: r, totalDataLabelsAnchor: "middle" } } }, { key: "calculateBarsDataLabelsPosition", value: function (t) { var e = this.w, i = t.x, a = t.i, s = t.j, r = t.realIndex, o = t.bcy, n = t.barHeight, l = t.barWidth, h = t.textRects, c = t.dataLabelsX, d = t.strokeWidth, g = t.dataLabelsConfig, u = t.barDataLabelsConfig, f = t.barTotalDataLabelsConfig, p = t.offX, x = t.offY, b = e.globals.gridHeight / e.globals.dataPoints; l = Math.abs(l); var v, m, y = o - (this.barCtx.isRangeBar ? 0 : b) + n / 2 + h.height / 2 + x - 3, w = "start", A = e.globals.series[a][s] < 0, S = i; switch (this.barCtx.isReversed && (S = i + (A ? -l : l), w = A ? "start" : "end"), u.position) { case "center": c = A ? S + l / 2 - p : Math.max(h.width / 2, S - l / 2) + p; break; case "bottom": c = A ? S + l - d - p : S - l + d + p; break; case "top": c = A ? S - d - p : S - d + p }if (this.barCtx.lastActiveBarSerieIndex === r && f.enabled) { var C = new k(this.barCtx.ctx).getTextRects(this.getStackedTotalDataLabel({ realIndex: r, j: s }), g.fontSize); A ? (v = S - d - p - f.offsetX, w = "end") : v = S + p + f.offsetX + (this.barCtx.isReversed ? -(l + d) : d), m = y - h.height / 2 + C.height / 2 + f.offsetY + d } return e.config.chart.stacked || ("start" === g.textAnchor ? c - h.width < 0 ? c = A ? h.width + d : d : c + h.width > e.globals.gridWidth && (c = A ? 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: i, bcy: o, dataLabelsX: c, dataLabelsY: y, totalDataLabelsX: v, totalDataLabelsY: m, totalDataLabelsAnchor: w } } }, { key: "drawCalculatedDataLabels", value: function (t) { var e = t.x, i = t.y, a = t.val, s = t.i, r = t.j, o = t.textRects, n = t.barHeight, l = t.barWidth, h = t.dataLabelsConfig, c = this.w, d = "rotate(0)"; "vertical" === c.config.plotOptions.bar.dataLabels.orientation && (d = "rotate(-90, ".concat(e, ", ").concat(i, ")")); var u = new G(this.barCtx.ctx), f = new k(this.barCtx.ctx), p = h.formatter, x = null, b = c.globals.collapsedSeriesIndices.indexOf(s) > -1; if (h.enabled && !b) { x = f.group({ class: "apexcharts-data-labels", transform: d }); var v = ""; void 0 !== a && (v = p(a, g(g({}, c), {}, { seriesIndex: s, dataPointIndex: r, w: c }))), !a && c.config.plotOptions.bar.hideZeroBarsWhenGrouped && (v = ""); var m = c.globals.series[s][r] < 0, y = c.config.plotOptions.bar.dataLabels.position; if ("vertical" === c.config.plotOptions.bar.dataLabels.orientation && ("top" === y && (h.textAnchor = m ? "end" : "start"), "center" === y && (h.textAnchor = "middle"), "bottom" === y && (h.textAnchor = m ? "end" : "start")), this.barCtx.isRangeBar && this.barCtx.barOptions.dataLabels.hideOverflowingLabels) l < f.getTextRects(v, parseFloat(h.style.fontSize)).width && (v = ""); c.config.chart.stacked && this.barCtx.barOptions.dataLabels.hideOverflowingLabels && (this.barCtx.isHorizontal ? o.width / 1.6 > Math.abs(l) && (v = "") : o.height / 1.6 > Math.abs(n) && (v = "")); var w = g({}, h); this.barCtx.isHorizontal && a < 0 && ("start" === h.textAnchor ? w.textAnchor = "end" : "end" === h.textAnchor && (w.textAnchor = "start")), u.plotDataLabelsText({ x: e, y: i, text: v, i: s, j: r, parent: x, dataLabelsConfig: w, alwaysDrawDataLabel: !0, offsetCorrection: !0 }) } return x } }, { key: "drawTotalDataLabels", value: function (t) { var e = t.x, i = t.y, a = t.val, s = t.realIndex, r = t.textAnchor, o = t.barTotalDataLabelsConfig; this.w; var n, l = new k(this.barCtx.ctx); return o.enabled && void 0 !== e && void 0 !== i && this.barCtx.lastActiveBarSerieIndex === s && (n = l.drawText({ x: e, y: i, foreColor: o.style.color, text: a, textAnchor: r, fontFamily: o.style.fontFamily, fontSize: o.style.fontSize, fontWeight: o.style.fontWeight })), n } }]), t }(), At = function () { function t(e) { i(this, t), this.w = e.w, this.barCtx = e } return s(t, [{ key: "initVariables", value: function (t) { var e = this.w; this.barCtx.series = t, this.barCtx.totalItems = 0, this.barCtx.seriesLen = 0, this.barCtx.visibleI = -1, this.barCtx.visibleItems = 1; for (var i = 0; i < t.length; i++)if (t[i].length > 0 && (this.barCtx.seriesLen = this.barCtx.seriesLen + 1, this.barCtx.totalItems += t[i].length), e.globals.isXNumeric) for (var a = 0; a < t[i].length; a++)e.globals.seriesX[i][a] > e.globals.minX && e.globals.seriesX[i][a] < e.globals.maxX && this.barCtx.visibleItems++; else this.barCtx.visibleItems = e.globals.dataPoints; this.arrBorderRadius = this.createBorderRadiusArr(e.globals.series), 0 === this.barCtx.seriesLen && (this.barCtx.seriesLen = 1), this.barCtx.zeroSerieses = [], e.globals.comboCharts || this.checkZeroSeries({ series: t }) } }, { key: "initialPositions", value: function () { var t, e, i, a, s, r, o, n, l = this.w, h = l.globals.dataPoints; this.barCtx.isRangeBar && (h = l.globals.labels.length); var c = this.barCtx.seriesLen; if (l.config.plotOptions.bar.rangeBarGroupRows && (c = 1), this.barCtx.isHorizontal) s = (i = l.globals.gridHeight / h) / c, l.globals.isXNumeric && (s = (i = l.globals.gridHeight / this.barCtx.totalItems) / this.barCtx.seriesLen), s = s * parseInt(this.barCtx.barOptions.barHeight, 10) / 100, -1 === String(this.barCtx.barOptions.barHeight).indexOf("%") && (s = parseInt(this.barCtx.barOptions.barHeight, 10)), n = this.barCtx.baseLineInvertedY + l.globals.padHorizontal + (this.barCtx.isReversed ? l.globals.gridWidth : 0) - (this.barCtx.isReversed ? 2 * this.barCtx.baseLineInvertedY : 0), this.barCtx.isFunnel && (n = l.globals.gridWidth / 2), e = (i - s * this.barCtx.seriesLen) / 2; else { if (a = l.globals.gridWidth / this.barCtx.visibleItems, l.config.xaxis.convertedCatToNumeric && (a = l.globals.gridWidth / l.globals.dataPoints), r = a / c * parseInt(this.barCtx.barOptions.columnWidth, 10) / 100, l.globals.isXNumeric) { var d = this.barCtx.xRatio; l.globals.minXDiff && .5 !== l.globals.minXDiff && l.globals.minXDiff / d > 0 && (a = l.globals.minXDiff / d), (r = a / c * parseInt(this.barCtx.barOptions.columnWidth, 10) / 100) < 1 && (r = 1) } -1 === String(this.barCtx.barOptions.columnWidth).indexOf("%") && (r = parseInt(this.barCtx.barOptions.columnWidth, 10)), o = l.globals.gridHeight - this.barCtx.baseLineY[this.barCtx.translationsIndex] - (this.barCtx.isReversed ? l.globals.gridHeight : 0) + (this.barCtx.isReversed ? 2 * this.barCtx.baseLineY[this.barCtx.translationsIndex] : 0), t = l.globals.padHorizontal + (a - r * this.barCtx.seriesLen) / 2 } return l.globals.barHeight = s, l.globals.barWidth = r, { x: t, y: e, yDivision: i, xDivision: a, barHeight: s, barWidth: r, zeroH: o, zeroW: n } } }, { key: "initializeStackedPrevVars", value: function (t) { t.w.globals.seriesGroups.forEach((function (e) { t[e] || (t[e] = {}), t[e].prevY = [], t[e].prevX = [], t[e].prevYF = [], t[e].prevXF = [], t[e].prevYVal = [], t[e].prevXVal = [] })) } }, { key: "initializeStackedXYVars", value: function (t) { t.w.globals.seriesGroups.forEach((function (e) { t[e] || (t[e] = {}), t[e].xArrj = [], t[e].xArrjF = [], t[e].xArrjVal = [], t[e].yArrj = [], t[e].yArrjF = [], t[e].yArrjVal = [] })) } }, { key: "getPathFillColor", value: function (t, e, i, a) { var s, r, o, n, l, h = this.w, c = this.barCtx.ctx.fill, d = null, g = this.barCtx.barOptions.distributed ? i : e; this.barCtx.barOptions.colors.ranges.length > 0 && this.barCtx.barOptions.colors.ranges.map((function (a) { t[e][i] >= a.from && t[e][i] <= a.to && (d = a.color) })); return null !== (s = h.config.series[e].data[i]) && void 0 !== s && s.fillColor && (d = h.config.series[e].data[i].fillColor), c.fillPath({ seriesNumber: this.barCtx.barOptions.distributed ? g : a, dataPointIndex: i, color: d, value: t[e][i], fillConfig: null === (r = h.config.series[e].data[i]) || void 0 === r ? void 0 : r.fill, fillType: null !== (o = h.config.series[e].data[i]) && void 0 !== o && null !== (n = o.fill) && void 0 !== n && n.type ? null === (l = h.config.series[e].data[i]) || void 0 === l ? void 0 : l.fill.type : Array.isArray(h.config.fill.type) ? h.config.fill.type[a] : h.config.fill.type }) } }, { key: "getStrokeWidth", value: function (t, e, i) { var a = 0, s = this.w; return this.barCtx.series[t][e] ? this.barCtx.isNullValue = !1 : this.barCtx.isNullValue = !0, s.config.stroke.show && (this.barCtx.isNullValue || (a = Array.isArray(this.barCtx.strokeWidth) ? this.barCtx.strokeWidth[i] : this.barCtx.strokeWidth)), a } }, { key: "createBorderRadiusArr", value: function (t) { var e = this.w, i = !this.w.config.chart.stacked || "last" !== e.config.plotOptions.bar.borderRadiusWhenStacked || e.config.plotOptions.bar.borderRadius <= 0, a = t.length, s = t[0].length, o = Array.from({ length: a }, (function () { return Array(s).fill(i ? "top" : "none") })); if (i) return o; for (var n = 0; n < s; n++) { for (var l = [], h = [], c = 0, d = 0; d < a; d++) { var g = t[d][n]; g > 0 ? (l.push(d), c++) : g < 0 && (h.push(d), c++) } if (l.length > 0 && 0 === h.length) if (1 === l.length) o[l[0]][n] = "both"; else { var u, f = l[0], p = l[l.length - 1], x = r(l); try { for (x.s(); !(u = x.n()).done;) { var b = u.value; o[b][n] = b === f ? "bottom" : b === p ? "top" : "none" } } catch (t) { x.e(t) } finally { x.f() } } else if (h.length > 0 && 0 === l.length) if (1 === h.length) o[h[0]][n] = "both"; else { var v, m = h[0], y = h[h.length - 1], w = r(h); try { for (w.s(); !(v = w.n()).done;) { var k = v.value; o[k][n] = k === m ? "bottom" : k === y ? "top" : "none" } } catch (t) { w.e(t) } finally { w.f() } } else if (l.length > 0 && h.length > 0) { var A, S = l[l.length - 1], C = r(l); try { for (C.s(); !(A = C.n()).done;) { var L = A.value; o[L][n] = L === S ? "top" : "none" } } catch (t) { C.e(t) } finally { C.f() } var P, M = h[h.length - 1], I = r(h); try { for (I.s(); !(P = I.n()).done;) { var T = P.value; o[T][n] = T === M ? "bottom" : "none" } } catch (t) { I.e(t) } finally { I.f() } } else if (1 === c) { o[l[0] || h[0]][n] = "both" } } return o } }, { key: "barBackground", value: function (t) { var e = t.j, i = t.i, a = t.x1, s = t.x2, r = t.y1, o = t.y2, n = t.elSeries, l = this.w, h = new k(this.barCtx.ctx), c = new V(this.barCtx.ctx).getActiveConfigSeriesIndex(); if (this.barCtx.barOptions.colors.backgroundBarColors.length > 0 && c === i) { e >= this.barCtx.barOptions.colors.backgroundBarColors.length && (e %= this.barCtx.barOptions.colors.backgroundBarColors.length); var d = this.barCtx.barOptions.colors.backgroundBarColors[e], g = h.drawRect(void 0 !== a ? a : 0, void 0 !== r ? r : 0, void 0 !== s ? s : l.globals.gridWidth, void 0 !== o ? o : l.globals.gridHeight, this.barCtx.barOptions.colors.backgroundBarRadius, d, this.barCtx.barOptions.colors.backgroundBarOpacity); n.add(g), g.node.classList.add("apexcharts-backgroundBar") } } }, { key: "getColumnPaths", value: function (t) { var e, i = t.barWidth, a = t.barXPosition, s = t.y1, r = t.y2, o = t.strokeWidth, n = t.isReversed, l = t.series, h = t.seriesGroup, c = t.realIndex, d = t.i, g = t.j, u = t.w, f = new k(this.barCtx.ctx); (o = Array.isArray(o) ? o[c] : o) || (o = 0); var p = i, x = a; null !== (e = u.config.series[c].data[g]) && void 0 !== e && e.columnWidthOffset && (x = a - u.config.series[c].data[g].columnWidthOffset / 2, p = i + u.config.series[c].data[g].columnWidthOffset); var b = o / 2, v = x + b, m = x + p - b, y = (l[d][g] >= 0 ? 1 : -1) * (n ? -1 : 1); s += .001 - b * y, r += .001 + b * y; var w = f.move(v, s), A = f.move(v, s), S = f.line(m, s); if (u.globals.previousPaths.length > 0 && (A = this.barCtx.getPreviousPath(c, g, !1)), w = w + f.line(v, r) + f.line(m, r) + S + ("around" === u.config.plotOptions.bar.borderRadiusApplication || "both" === this.arrBorderRadius[c][g] ? " Z" : " z"), A = A + f.line(v, s) + S + S + S + S + S + f.line(v, s) + ("around" === u.config.plotOptions.bar.borderRadiusApplication || "both" === this.arrBorderRadius[c][g] ? " Z" : " z"), "none" !== this.arrBorderRadius[c][g] && (w = f.roundPathCorners(w, u.config.plotOptions.bar.borderRadius)), u.config.chart.stacked) { var C = this.barCtx; (C = this.barCtx[h]).yArrj.push(r - b * y), C.yArrjF.push(Math.abs(s - r + o * y)), C.yArrjVal.push(this.barCtx.series[d][g]) } return { pathTo: w, pathFrom: A } } }, { key: "getBarpaths", value: function (t) { var e, i = t.barYPosition, a = t.barHeight, s = t.x1, r = t.x2, o = t.strokeWidth, n = t.isReversed, l = t.series, h = t.seriesGroup, c = t.realIndex, d = t.i, g = t.j, u = t.w, f = new k(this.barCtx.ctx); (o = Array.isArray(o) ? o[c] : o) || (o = 0); var p = i, x = a; null !== (e = u.config.series[c].data[g]) && void 0 !== e && e.barHeightOffset && (p = i - u.config.series[c].data[g].barHeightOffset / 2, x = a + u.config.series[c].data[g].barHeightOffset); var b = o / 2, v = p + b, m = p + x - b, y = (l[d][g] >= 0 ? 1 : -1) * (n ? -1 : 1); s += .001 + b * y, r += .001 - b * y; var w = f.move(s, v), A = f.move(s, v); u.globals.previousPaths.length > 0 && (A = this.barCtx.getPreviousPath(c, g, !1)); var S = f.line(s, m); if (w = w + f.line(r, v) + f.line(r, m) + S + ("around" === u.config.plotOptions.bar.borderRadiusApplication || "both" === this.arrBorderRadius[c][g] ? " Z" : " z"), A = A + f.line(s, v) + S + S + S + S + S + f.line(s, v) + ("around" === u.config.plotOptions.bar.borderRadiusApplication || "both" === this.arrBorderRadius[c][g] ? " Z" : " z"), "none" !== this.arrBorderRadius[c][g] && (w = f.roundPathCorners(w, u.config.plotOptions.bar.borderRadius)), u.config.chart.stacked) { var C = this.barCtx; (C = this.barCtx[h]).xArrj.push(r + b * y), C.xArrjF.push(Math.abs(s - r - o * y)), C.xArrjVal.push(this.barCtx.series[d][g]) } return { pathTo: w, pathFrom: A } } }, { key: "checkZeroSeries", value: function (t) { for (var e = t.series, i = this.w, a = 0; a < e.length; a++) { for (var s = 0, r = 0; r < e[i.globals.maxValsInArrayIndex].length; r++)s += e[a][r]; 0 === s && this.barCtx.zeroSerieses.push(a) } } }, { key: "getXForValue", value: function (t, e) { var i = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2] ? e : null; return null != t && (i = e + t / this.barCtx.invertedYRatio - 2 * (this.barCtx.isReversed ? t / this.barCtx.invertedYRatio : 0)), i } }, { key: "getYForValue", value: function (t, e, i) { var a = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3] ? e : null; return null != t && (a = e - t / this.barCtx.yRatio[i] + 2 * (this.barCtx.isReversed ? t / this.barCtx.yRatio[i] : 0)), a } }, { key: "getGoalValues", value: function (t, e, i, a, s, r) { var o = this, l = this.w, h = [], c = function (a, s) { var l; h.push((n(l = {}, t, "x" === t ? o.getXForValue(a, e, !1) : o.getYForValue(a, i, r, !1)), n(l, "attrs", s), l)) }; if (l.globals.seriesGoals[a] && l.globals.seriesGoals[a][s] && Array.isArray(l.globals.seriesGoals[a][s]) && l.globals.seriesGoals[a][s].forEach((function (t) { c(t.value, t) })), this.barCtx.barOptions.isDumbbell && l.globals.seriesRange.length) { var d = this.barCtx.barOptions.dumbbellColors ? this.barCtx.barOptions.dumbbellColors : l.globals.colors, u = { strokeHeight: "x" === t ? 0 : l.globals.markers.size[a], strokeWidth: "x" === t ? l.globals.markers.size[a] : 0, strokeDashArray: 0, strokeLineCap: "round", strokeColor: Array.isArray(d[a]) ? d[a][0] : d[a] }; c(l.globals.seriesRangeStart[a][s], u), c(l.globals.seriesRangeEnd[a][s], g(g({}, u), {}, { strokeColor: Array.isArray(d[a]) ? d[a][1] : d[a] })) } return h } }, { key: "drawGoalLine", value: function (t) { var e = t.barXPosition, i = t.barYPosition, a = t.goalX, s = t.goalY, r = t.barWidth, o = t.barHeight, n = new k(this.barCtx.ctx), l = n.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".concat(this.barCtx.w.globals.cuid, ")")); var h = null; return this.barCtx.isHorizontal ? Array.isArray(a) && a.forEach((function (t) { if (t.x >= -1 && t.x <= n.w.globals.gridWidth + 1) { var e = void 0 !== t.attrs.strokeHeight ? t.attrs.strokeHeight : o / 2, a = i + e + o / 2; h = n.drawLine(t.x, a - 2 * e, t.x, a, t.attrs.strokeColor ? t.attrs.strokeColor : void 0, t.attrs.strokeDashArray, t.attrs.strokeWidth ? t.attrs.strokeWidth : 2, t.attrs.strokeLineCap), l.add(h) } })) : Array.isArray(s) && s.forEach((function (t) { if (t.y >= -1 && t.y <= n.w.globals.gridHeight + 1) { var i = void 0 !== t.attrs.strokeWidth ? t.attrs.strokeWidth : r / 2, a = e + i + r / 2; h = n.drawLine(a - 2 * i, t.y, a, t.y, t.attrs.strokeColor ? t.attrs.strokeColor : void 0, t.attrs.strokeDashArray, t.attrs.strokeHeight ? t.attrs.strokeHeight : 2, t.attrs.strokeLineCap), l.add(h) } })), l } }, { key: "drawBarShadow", value: function (t) { var e = t.prevPaths, i = t.currPaths, a = t.color, s = this.w, r = e.x, o = e.x1, n = e.barYPosition, l = i.x, h = i.x1, c = i.barYPosition, d = n + i.barHeight, g = new k(this.barCtx.ctx), u = new m, f = g.move(o, d) + g.line(r, d) + g.line(l, c) + g.line(h, c) + g.line(o, d) + ("around" === s.config.plotOptions.bar.borderRadiusApplication || "both" === this.arrBorderRadius[realIndex][j] ? " Z" : " z"); return g.drawPath({ d: f, fill: u.shadeColor(.5, m.rgb2hex(a)), stroke: "none", strokeWidth: 0, fillOpacity: 1, classes: "apexcharts-bar-shadows" }) } }, { key: "getZeroValueEncounters", value: function (t) { var e, i = t.i, a = t.j, s = this.w, r = 0, o = 0; return (s.config.plotOptions.bar.horizontal ? s.globals.series.map((function (t, e) { return e })) : (null === (e = s.globals.columnSeries) || void 0 === e ? void 0 : e.i.map((function (t) { return t }))) || []).forEach((function (t) { var e = s.globals.seriesPercent[t][a]; e && r++, t < i && 0 === e && o++ })), { nonZeroColumns: r, zeroEncounters: o } } }, { key: "getGroupIndex", value: function (t) { var e = this.w, i = e.globals.seriesGroups.findIndex((function (i) { return i.indexOf(e.globals.seriesNames[t]) > -1 })), a = this.barCtx.columnGroupIndices, s = a.indexOf(i); return s < 0 && (a.push(i), s = a.length - 1), { groupIndex: i, columnGroupIndex: s } } }]), t }(), St = function () { function t(e, a) { i(this, t), this.ctx = e, this.w = e.w; var 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 = a, null !== this.xyRatios && (this.xRatio = a.xRatio, this.yRatio = a.yRatio, this.invertedXRatio = a.invertedXRatio, this.invertedYRatio = a.invertedYRatio, this.baseLineY = a.baseLineY, this.baseLineInvertedY = a.baseLineInvertedY), this.yaxisIndex = 0, this.translationsIndex = 0, this.seriesLen = 0, this.pathArr = []; var r = new V(this.ctx); this.lastActiveBarSerieIndex = r.getActiveConfigSeriesIndex("desc", ["bar", "column"]), this.columnGroupIndices = []; var o = r.getBarSeriesIndices(), n = new A(this.ctx); this.stackedSeriesTotals = n.getStackedSeriesTotals(this.w.config.series.map((function (t, e) { return -1 === o.indexOf(e) ? e : -1 })).filter((function (t) { return -1 !== t }))), this.barHelpers = new At(this) } return s(t, [{ key: "draw", value: function (t, e) { var i = this.w, a = new k(this.ctx), s = new A(this.ctx, i); t = s.getLogSeries(t), this.series = t, this.yRatio = s.getLogYRatios(this.yRatio), this.barHelpers.initVariables(t); var r = a.group({ class: "apexcharts-bar-series apexcharts-plot-series" }); i.config.dataLabels.enabled && this.totalItems > this.barOptions.dataLabels.maxItems && console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering - ApexCharts"); for (var o = 0, n = 0; o < t.length; o++, n++) { var l, h, c, d, u = void 0, f = void 0, p = [], x = [], b = i.globals.comboCharts ? e[o] : o, v = this.barHelpers.getGroupIndex(b).columnGroupIndex, y = a.group({ class: "apexcharts-series", rel: o + 1, seriesName: m.escapeString(i.globals.seriesNames[b]), "data:realIndex": b }); this.ctx.series.addCollapsedClassToSeries(y, b), t[o].length > 0 && (this.visibleI = this.visibleI + 1); var w = 0, S = 0; this.yRatio.length > 1 && (this.yaxisIndex = i.globals.seriesYAxisReverseMap[b], this.translationsIndex = b); var C = this.translationsIndex; this.isReversed = i.config.yaxis[this.yaxisIndex] && i.config.yaxis[this.yaxisIndex].reversed; var L = this.barHelpers.initialPositions(); f = L.y, w = L.barHeight, h = L.yDivision, d = L.zeroW, u = L.x, S = L.barWidth, l = L.xDivision, c = L.zeroH, this.horizontal || x.push(u + S / 2); var P = a.group({ class: "apexcharts-datalabels", "data:realIndex": b }); i.globals.delayedElements.push({ el: P.node }), P.node.classList.add("apexcharts-element-hidden"); var M = 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 (var T = 0; T < t[o].length; T++) { var z = this.barHelpers.getStrokeWidth(o, T, b), X = null, E = { indexes: { i: o, j: T, realIndex: b, translationsIndex: C, bc: n }, x: u, y: f, strokeWidth: z, elSeries: y }; this.isHorizontal ? (X = this.drawBarPaths(g(g({}, E), {}, { barHeight: w, zeroW: d, yDivision: h })), S = this.series[o][T] / this.invertedYRatio) : (X = this.drawColumnPaths(g(g({}, E), {}, { xDivision: l, barWidth: S, zeroH: c })), w = this.series[o][T] / this.yRatio[C]); var Y = this.barHelpers.getPathFillColor(t, o, T, b); if (this.isFunnel && this.barOptions.isFunnel3d && this.pathArr.length && T > 0) { var R = this.barHelpers.drawBarShadow({ color: "string" == typeof Y && -1 === (null == Y ? void 0 : Y.indexOf("url")) ? Y : m.hexToRgba(i.globals.colors[o]), prevPaths: this.pathArr[this.pathArr.length - 1], currPaths: X }); R && I.add(R) } this.pathArr.push(X); var F = this.barHelpers.drawGoalLine({ barXPosition: X.barXPosition, barYPosition: X.barYPosition, goalX: X.goalX, goalY: X.goalY, barHeight: w, barWidth: S }); F && M.add(F), f = X.y, u = X.x, T > 0 && x.push(u + S / 2), p.push(f), this.renderSeries({ realIndex: b, pathFill: Y, j: T, i: o, columnGroupIndex: v, pathFrom: X.pathFrom, pathTo: X.pathTo, strokeWidth: z, elSeries: y, x: u, y: f, series: t, barHeight: Math.abs(X.barHeight ? X.barHeight : w), barWidth: Math.abs(X.barWidth ? X.barWidth : S), elDataLabelsWrap: P, elGoalsMarkers: M, elBarShadows: I, visibleSeries: this.visibleI, type: "bar" }) } i.globals.seriesXvalues[b] = x, i.globals.seriesYvalues[b] = p, r.add(y) } return r } }, { key: "renderSeries", value: function (t) { var e = t.realIndex, i = t.pathFill, a = t.lineFill, s = t.j, r = t.i, o = t.columnGroupIndex, n = t.pathFrom, l = t.pathTo, h = t.strokeWidth, c = t.elSeries, d = t.x, g = t.y, u = t.y1, f = t.y2, p = t.series, x = t.barHeight, b = t.barWidth, v = t.barXPosition, m = t.barYPosition, y = t.elDataLabelsWrap, A = t.elGoalsMarkers, S = t.elBarShadows, C = t.visibleSeries, L = t.type, P = t.classes, M = this.w, I = new k(this.ctx); if (!a) { var T = "function" == typeof M.globals.stroke.colors[e] ? function (t) { var e, i = M.config.stroke.colors; return Array.isArray(i) && i.length > 0 && ((e = i[t]) || (e = ""), "function" == typeof e) ? e({ value: M.globals.series[t][s], dataPointIndex: s, w: M }) : e }(e) : M.globals.stroke.colors[e]; a = this.barOptions.distributed ? M.globals.stroke.colors[s] : T } M.config.series[r].data[s] && M.config.series[r].data[s].strokeColor && (a = M.config.series[r].data[s].strokeColor), this.isNullValue && (i = "none"); var z = s / M.config.chart.animations.animateGradually.delay * (M.config.chart.animations.speed / M.globals.dataPoints) / 2.4, X = I.renderPaths({ i: r, j: s, realIndex: e, pathFrom: n, pathTo: l, stroke: a, strokeWidth: h, strokeLineCap: M.config.stroke.lineCap, fill: i, animationDelay: z, initialSpeed: M.config.chart.animations.speed, dataChangeSpeed: M.config.chart.animations.dynamicAnimation.speed, className: "apexcharts-".concat(L, "-area ").concat(P), chartType: L }); X.attr("clip-path", "url(#gridRectBarMask".concat(M.globals.cuid, ")")); var E = M.config.forecastDataPoints; E.count > 0 && s >= M.globals.dataPoints - E.count && (X.node.setAttribute("stroke-dasharray", E.dashArray), X.node.setAttribute("stroke-width", E.strokeWidth), X.node.setAttribute("fill-opacity", E.fillOpacity)), void 0 !== u && void 0 !== f && (X.attr("data-range-y1", u), X.attr("data-range-y2", f)), new w(this.ctx).setSelectionFilter(X, e, s), c.add(X); var Y = new kt(this).handleBarDataLabels({ x: d, y: g, y1: u, y2: f, i: r, j: s, series: p, realIndex: e, columnGroupIndex: o, barHeight: x, barWidth: b, barXPosition: v, barYPosition: m, renderedPath: X, visibleSeries: C }); return null !== Y.dataLabels && y.add(Y.dataLabels), Y.totalDataLabels && y.add(Y.totalDataLabels), c.add(y), A && c.add(A), S && c.add(S), c } }, { key: "drawBarPaths", value: function (t) { var e, i = t.indexes, a = t.barHeight, s = t.strokeWidth, r = t.zeroW, o = t.x, n = t.y, l = t.yDivision, h = t.elSeries, c = this.w, d = i.i, g = i.j; if (c.globals.isXNumeric) e = (n = (c.globals.seriesX[d][g] - c.globals.minX) / this.invertedXRatio - a) + a * this.visibleI; else if (c.config.plotOptions.bar.hideZeroBarsWhenGrouped) { var u = 0, f = 0; c.globals.seriesPercent.forEach((function (t, e) { t[g] && u++, e < d && 0 === t[g] && f++ })), u > 0 && (a = this.seriesLen * a / u), e = n + a * this.visibleI, e -= a * f } else e = n + a * this.visibleI; this.isFunnel && (r -= (this.barHelpers.getXForValue(this.series[d][g], r) - r) / 2), o = this.barHelpers.getXForValue(this.series[d][g], r); var p = this.barHelpers.getBarpaths({ barYPosition: e, barHeight: a, x1: r, x2: o, strokeWidth: s, isReversed: this.isReversed, series: this.series, realIndex: i.realIndex, i: d, j: g, w: c }); return c.globals.isXNumeric || (n += l), this.barHelpers.barBackground({ j: g, i: d, y1: e - a * this.visibleI, y2: a * this.seriesLen, elSeries: h }), { pathTo: p.pathTo, pathFrom: p.pathFrom, x1: r, x: o, y: n, goalX: this.barHelpers.getGoalValues("x", r, null, d, g), barYPosition: e, barHeight: a } } }, { key: "drawColumnPaths", value: function (t) { var e, i = t.indexes, a = t.x, s = t.y, r = t.xDivision, o = t.barWidth, n = t.zeroH, l = t.strokeWidth, h = t.elSeries, c = this.w, d = i.realIndex, g = i.translationsIndex, u = i.i, f = i.j, p = i.bc; if (c.globals.isXNumeric) { var x = this.getBarXForNumericXAxis({ x: a, j: f, realIndex: d, barWidth: o }); a = x.x, e = x.barXPosition } else if (c.config.plotOptions.bar.hideZeroBarsWhenGrouped) { var b = this.barHelpers.getZeroValueEncounters({ i: u, j: f }), v = b.nonZeroColumns, m = b.zeroEncounters; v > 0 && (o = this.seriesLen * o / v), e = a + o * this.visibleI, e -= o * m } else e = a + o * this.visibleI; s = this.barHelpers.getYForValue(this.series[u][f], n, g); var y = this.barHelpers.getColumnPaths({ barXPosition: e, barWidth: o, y1: n, y2: s, strokeWidth: l, isReversed: this.isReversed, series: this.series, realIndex: d, i: u, j: f, w: c }); return c.globals.isXNumeric || (a += r), this.barHelpers.barBackground({ bc: p, j: f, i: u, x1: e - l / 2 - o * this.visibleI, x2: o * this.seriesLen + l / 2, elSeries: h }), { pathTo: y.pathTo, pathFrom: y.pathFrom, x: a, y: s, goalY: this.barHelpers.getGoalValues("y", null, n, u, f, g), barXPosition: e, barWidth: o } } }, { key: "getBarXForNumericXAxis", value: function (t) { var e = t.x, i = t.barWidth, a = t.realIndex, s = t.j, r = this.w, o = a; return r.globals.seriesX[a].length || (o = r.globals.maxValsInArrayIndex), r.globals.seriesX[o][s] && (e = (r.globals.seriesX[o][s] - r.globals.minX) / this.xRatio - i * this.seriesLen / 2), { barXPosition: e + i * this.visibleI, x: e } } }, { key: "getPreviousPath", value: function (t, e) { for (var i, a = this.w, s = 0; s < a.globals.previousPaths.length; s++) { var r = a.globals.previousPaths[s]; r.paths && r.paths.length > 0 && parseInt(r.realIndex, 10) === parseInt(t, 10) && void 0 !== a.globals.previousPaths[s].paths[e] && (i = a.globals.previousPaths[s].paths[e].d) } return i } }]), t }(), Ct = function (t) { h(a, St); var e = o(a); function a() { return i(this, a), e.apply(this, arguments) } return s(a, [{ key: "draw", value: function (t, e) { var i = this, a = this.w; this.graphics = new k(this.ctx), this.bar = new St(this.ctx, this.xyRatios); var s = new A(this.ctx, a); t = s.getLogSeries(t), this.yRatio = s.getLogYRatios(this.yRatio), this.barHelpers.initVariables(t), "100%" === a.config.chart.stackType && (t = a.globals.comboCharts ? e.map((function (t) { return a.globals.seriesPercent[t] })) : a.globals.seriesPercent.slice()), this.series = t, this.barHelpers.initializeStackedPrevVars(this); for (var r = this.graphics.group({ class: "apexcharts-bar-series apexcharts-plot-series" }), o = 0, n = 0, l = function (s, l) { var h = void 0, c = void 0, d = void 0, u = void 0, f = a.globals.comboCharts ? e[s] : s, p = i.barHelpers.getGroupIndex(f), x = p.groupIndex, b = p.columnGroupIndex; i.groupCtx = i[a.globals.seriesGroups[x]]; var v = [], y = [], w = 0; i.yRatio.length > 1 && (i.yaxisIndex = a.globals.seriesYAxisReverseMap[f][0], w = f), i.isReversed = a.config.yaxis[i.yaxisIndex] && a.config.yaxis[i.yaxisIndex].reversed; var k = i.graphics.group({ class: "apexcharts-series", seriesName: m.escapeString(a.globals.seriesNames[f]), rel: s + 1, "data:realIndex": f }); i.ctx.series.addCollapsedClassToSeries(k, f); var A = i.graphics.group({ class: "apexcharts-datalabels", "data:realIndex": f }), S = i.graphics.group({ class: "apexcharts-bar-goals-markers" }), C = 0, L = 0, P = i.initialPositions(o, n, h, c, d, u, w); n = P.y, C = P.barHeight, c = P.yDivision, u = P.zeroW, o = P.x, L = P.barWidth, h = P.xDivision, d = P.zeroH, a.globals.barHeight = C, a.globals.barWidth = L, i.barHelpers.initializeStackedXYVars(i), 1 === i.groupCtx.prevY.length && i.groupCtx.prevY[0].every((function (t) { return isNaN(t) })) && (i.groupCtx.prevY[0] = i.groupCtx.prevY[0].map((function () { return d })), i.groupCtx.prevYF[0] = i.groupCtx.prevYF[0].map((function () { return 0 }))); for (var M = 0; M < a.globals.dataPoints; M++) { var I = i.barHelpers.getStrokeWidth(s, M, f), T = { indexes: { i: s, j: M, realIndex: f, translationsIndex: w, bc: l }, strokeWidth: I, x: o, y: n, elSeries: k, columnGroupIndex: b, seriesGroup: a.globals.seriesGroups[x] }, z = null; i.isHorizontal ? (z = i.drawStackedBarPaths(g(g({}, T), {}, { zeroW: u, barHeight: C, yDivision: c })), L = i.series[s][M] / i.invertedYRatio) : (z = i.drawStackedColumnPaths(g(g({}, T), {}, { xDivision: h, barWidth: L, zeroH: d })), C = i.series[s][M] / i.yRatio[w]); var X = i.barHelpers.drawGoalLine({ barXPosition: z.barXPosition, barYPosition: z.barYPosition, goalX: z.goalX, goalY: z.goalY, barHeight: C, barWidth: L }); X && S.add(X), n = z.y, o = z.x, v.push(o), y.push(n); var E = i.barHelpers.getPathFillColor(t, s, M, f), Y = ""; a.globals.isBarHorizontal ? "bottom" === i.barHelpers.arrBorderRadius[f][M] && a.globals.series[f][M] > 0 && (Y = "apexcharts-flip-x") : "bottom" === i.barHelpers.arrBorderRadius[f][M] && a.globals.series[f][M] > 0 && (Y = "apexcharts-flip-y"), k = i.renderSeries({ realIndex: f, pathFill: E, j: M, i: s, columnGroupIndex: b, pathFrom: z.pathFrom, pathTo: z.pathTo, strokeWidth: I, elSeries: k, x: o, y: n, series: t, barHeight: C, barWidth: L, elDataLabelsWrap: A, elGoalsMarkers: S, type: "bar", visibleSeries: b, classes: Y }) } a.globals.seriesXvalues[f] = v, a.globals.seriesYvalues[f] = y, i.groupCtx.prevY.push(i.groupCtx.yArrj), i.groupCtx.prevYF.push(i.groupCtx.yArrjF), i.groupCtx.prevYVal.push(i.groupCtx.yArrjVal), i.groupCtx.prevX.push(i.groupCtx.xArrj), i.groupCtx.prevXF.push(i.groupCtx.xArrjF), i.groupCtx.prevXVal.push(i.groupCtx.xArrjVal), r.add(k) }, h = 0, c = 0; h < t.length; h++, c++)l(h, c); return r } }, { key: "initialPositions", value: function (t, e, i, a, s, r, o) { var n, l, h = this.w; if (this.isHorizontal) { a = h.globals.gridHeight / h.globals.dataPoints; var c = h.config.plotOptions.bar.barHeight; n = -1 === String(c).indexOf("%") ? parseInt(c, 10) : a * parseInt(c, 10) / 100, r = h.globals.padHorizontal + (this.isReversed ? h.globals.gridWidth - this.baseLineInvertedY : this.baseLineInvertedY), e = (a - n) / 2 } else { l = i = h.globals.gridWidth / h.globals.dataPoints; var d = h.config.plotOptions.bar.columnWidth; h.globals.isXNumeric && h.globals.dataPoints > 1 ? l = (i = h.globals.minXDiff / this.xRatio) * parseInt(this.barOptions.columnWidth, 10) / 100 : -1 === String(d).indexOf("%") ? l = parseInt(d, 10) : l *= parseInt(d, 10) / 100, s = this.isReversed ? this.baseLineY[o] : h.globals.gridHeight - this.baseLineY[o], t = h.globals.padHorizontal + (i - l) / 2 } var g = h.globals.barGroups.length || 1; return { x: t, y: e, yDivision: a, xDivision: i, barHeight: n / g, barWidth: l / g, zeroH: s, zeroW: r } } }, { key: "drawStackedBarPaths", value: function (t) { for (var e, i = t.indexes, a = t.barHeight, s = t.strokeWidth, r = t.zeroW, o = t.x, n = t.y, l = t.columnGroupIndex, h = t.seriesGroup, c = t.yDivision, d = t.elSeries, g = this.w, u = n + l * a, f = i.i, p = i.j, x = i.realIndex, b = i.translationsIndex, v = 0, m = 0; m < this.groupCtx.prevXF.length; m++)v += this.groupCtx.prevXF[m][p]; var y; if ((y = h.indexOf(g.config.series[x].name)) > 0) { var w = r; this.groupCtx.prevXVal[y - 1][p] < 0 ? w = this.series[f][p] >= 0 ? this.groupCtx.prevX[y - 1][p] + v - 2 * (this.isReversed ? v : 0) : this.groupCtx.prevX[y - 1][p] : this.groupCtx.prevXVal[y - 1][p] >= 0 && (w = this.series[f][p] >= 0 ? this.groupCtx.prevX[y - 1][p] : this.groupCtx.prevX[y - 1][p] - v + 2 * (this.isReversed ? v : 0)), e = w } else e = r; o = null === this.series[f][p] ? e : e + this.series[f][p] / this.invertedYRatio - 2 * (this.isReversed ? this.series[f][p] / this.invertedYRatio : 0); var k = this.barHelpers.getBarpaths({ barYPosition: u, barHeight: a, x1: e, x2: o, strokeWidth: s, isReversed: this.isReversed, series: this.series, realIndex: i.realIndex, seriesGroup: h, i: f, j: p, w: g }); return this.barHelpers.barBackground({ j: p, i: f, y1: u, y2: a, elSeries: d }), n += c, { pathTo: k.pathTo, pathFrom: k.pathFrom, goalX: this.barHelpers.getGoalValues("x", r, null, f, p, b), barXPosition: e, barYPosition: u, x: o, y: n } } }, { key: "drawStackedColumnPaths", value: function (t) { var e = t.indexes, i = t.x, a = t.y, s = t.xDivision, r = t.barWidth, o = t.zeroH, n = t.columnGroupIndex, l = t.seriesGroup, h = t.elSeries, c = this.w, d = e.i, g = e.j, u = e.bc, f = e.realIndex, p = e.translationsIndex; if (c.globals.isXNumeric) { var x = c.globals.seriesX[f][g]; x || (x = 0), i = (x - c.globals.minX) / this.xRatio - r / 2 * c.globals.barGroups.length } for (var b, v = i + n * r, m = 0, y = 0; y < this.groupCtx.prevYF.length; y++)m += isNaN(this.groupCtx.prevYF[y][g]) ? 0 : this.groupCtx.prevYF[y][g]; var w = d; if (l && (w = l.indexOf(c.globals.seriesNames[f])), w > 0 && !c.globals.isXNumeric || w > 0 && c.globals.isXNumeric && c.globals.seriesX[f - 1][g] === c.globals.seriesX[f][g]) { var k, A, S, C = Math.min(this.yRatio.length + 1, f + 1); if (void 0 !== this.groupCtx.prevY[w - 1] && this.groupCtx.prevY[w - 1].length) for (var L = 1; L < C; L++) { var P; if (!isNaN(null === (P = this.groupCtx.prevY[w - L]) || void 0 === P ? void 0 : P[g])) { S = this.groupCtx.prevY[w - L][g]; break } } for (var M = 1; M < C; M++) { var I, T; if ((null === (I = this.groupCtx.prevYVal[w - M]) || void 0 === I ? void 0 : I[g]) < 0) { A = this.series[d][g] >= 0 ? S - m + 2 * (this.isReversed ? m : 0) : S; break } if ((null === (T = this.groupCtx.prevYVal[w - M]) || void 0 === T ? void 0 : T[g]) >= 0) { A = this.series[d][g] >= 0 ? S : S + m - 2 * (this.isReversed ? m : 0); break } } void 0 === A && (A = c.globals.gridHeight), b = null !== (k = this.groupCtx.prevYF[0]) && void 0 !== k && k.every((function (t) { return 0 === t })) && this.groupCtx.prevYF.slice(1, w).every((function (t) { return t.every((function (t) { return isNaN(t) })) })) ? o : A } else b = o; a = this.series[d][g] ? b - this.series[d][g] / this.yRatio[p] + 2 * (this.isReversed ? this.series[d][g] / this.yRatio[p] : 0) : b; var z = this.barHelpers.getColumnPaths({ barXPosition: v, barWidth: r, y1: b, y2: a, yRatio: this.yRatio[p], strokeWidth: this.strokeWidth, isReversed: this.isReversed, series: this.series, seriesGroup: l, realIndex: e.realIndex, i: d, j: g, w: c }); return this.barHelpers.barBackground({ bc: u, j: g, i: d, x1: v, x2: r, elSeries: h }), { pathTo: z.pathTo, pathFrom: z.pathFrom, goalY: this.barHelpers.getGoalValues("y", null, o, d, g), barXPosition: v, x: c.globals.isXNumeric ? i : i + s, y: a } } }]), a }(), Lt = function (t) { h(a, St); var e = o(a); function a() { return i(this, a), e.apply(this, arguments) } return s(a, [{ key: "draw", value: function (t, e, i) { var a = this, s = this.w, r = new k(this.ctx), o = s.globals.comboCharts ? e : s.config.chart.type, n = new N(this.ctx); this.candlestickOptions = this.w.config.plotOptions.candlestick, this.boxOptions = this.w.config.plotOptions.boxPlot, this.isHorizontal = s.config.plotOptions.bar.horizontal; var l = new A(this.ctx, s); t = l.getLogSeries(t), this.series = t, this.yRatio = l.getLogYRatios(this.yRatio), this.barHelpers.initVariables(t); for (var h = r.group({ class: "apexcharts-".concat(o, "-series apexcharts-plot-series") }), c = function (e) { a.isBoxPlot = "boxPlot" === s.config.chart.type || "boxPlot" === s.config.series[e].type; var o, l, c, d, u = void 0, f = void 0, p = [], x = [], b = s.globals.comboCharts ? i[e] : e, v = a.barHelpers.getGroupIndex(b).columnGroupIndex, y = r.group({ class: "apexcharts-series", seriesName: m.escapeString(s.globals.seriesNames[b]), rel: e + 1, "data:realIndex": b }); a.ctx.series.addCollapsedClassToSeries(y, b), t[e].length > 0 && (a.visibleI = a.visibleI + 1); var w, k, A = 0; a.yRatio.length > 1 && (a.yaxisIndex = s.globals.seriesYAxisReverseMap[b][0], A = b); var S = a.barHelpers.initialPositions(); f = S.y, w = S.barHeight, l = S.yDivision, d = S.zeroW, u = S.x, k = S.barWidth, o = S.xDivision, c = S.zeroH, x.push(u + k / 2); for (var C = r.group({ class: "apexcharts-datalabels", "data:realIndex": b }), L = function (i) { var r = a.barHelpers.getStrokeWidth(e, i, b), h = null, m = { indexes: { i: e, j: i, realIndex: b, translationsIndex: A }, x: u, y: f, strokeWidth: r, elSeries: y }; h = a.isHorizontal ? a.drawHorizontalBoxPaths(g(g({}, m), {}, { yDivision: l, barHeight: w, zeroW: d })) : a.drawVerticalBoxPaths(g(g({}, m), {}, { xDivision: o, barWidth: k, zeroH: c })), f = h.y, u = h.x, i > 0 && x.push(u + k / 2), p.push(f), h.pathTo.forEach((function (o, l) { var c = !a.isBoxPlot && a.candlestickOptions.wick.useFillColor ? h.color[l] : s.globals.stroke.colors[e], d = n.fillPath({ seriesNumber: b, dataPointIndex: i, color: h.color[l], value: t[e][i] }); a.renderSeries({ realIndex: b, pathFill: d, lineFill: c, j: i, i: e, pathFrom: h.pathFrom, pathTo: o, strokeWidth: r, elSeries: y, x: u, y: f, series: t, columnGroupIndex: v, barHeight: w, barWidth: k, elDataLabelsWrap: C, visibleSeries: a.visibleI, type: s.config.chart.type }) })) }, P = 0; P < s.globals.dataPoints; P++)L(P); s.globals.seriesXvalues[b] = x, s.globals.seriesYvalues[b] = p, h.add(y) }, d = 0; d < t.length; d++)c(d); return h } }, { key: "drawVerticalBoxPaths", value: function (t) { var e = t.indexes, i = t.x; t.y; var a = t.xDivision, s = t.barWidth, r = t.zeroH, o = t.strokeWidth, n = this.w, l = new k(this.ctx), h = e.i, c = e.j, d = !0, g = n.config.plotOptions.candlestick.colors.upward, u = n.config.plotOptions.candlestick.colors.downward, f = ""; this.isBoxPlot && (f = [this.boxOptions.colors.lower, this.boxOptions.colors.upper]); var p = this.yRatio[e.translationsIndex], x = e.realIndex, b = this.getOHLCValue(x, c), v = r, m = r; b.o > b.c && (d = !1); var y = Math.min(b.o, b.c), w = Math.max(b.o, b.c), A = b.m; n.globals.isXNumeric && (i = (n.globals.seriesX[x][c] - n.globals.minX) / this.xRatio - s / 2); var S = i + s * this.visibleI; void 0 === this.series[h][c] || null === this.series[h][c] ? (y = r, w = r) : (y = r - y / p, w = r - w / p, v = r - b.h / p, m = r - b.l / p, A = r - b.m / p); var C = l.move(S, r), L = l.move(S + s / 2, y); return n.globals.previousPaths.length > 0 && (L = this.getPreviousPath(x, c, !0)), C = this.isBoxPlot ? [l.move(S, y) + l.line(S + s / 2, y) + l.line(S + s / 2, v) + l.line(S + s / 4, v) + l.line(S + s - s / 4, v) + l.line(S + s / 2, v) + l.line(S + s / 2, y) + l.line(S + s, y) + l.line(S + s, A) + l.line(S, A) + l.line(S, y + o / 2), l.move(S, A) + l.line(S + s, A) + l.line(S + s, w) + l.line(S + s / 2, w) + l.line(S + s / 2, m) + l.line(S + s - s / 4, m) + l.line(S + s / 4, m) + l.line(S + s / 2, m) + l.line(S + s / 2, w) + l.line(S, w) + l.line(S, A) + "z"] : [l.move(S, w) + l.line(S + s / 2, w) + l.line(S + s / 2, v) + l.line(S + s / 2, w) + l.line(S + s, w) + l.line(S + s, y) + l.line(S + s / 2, y) + l.line(S + s / 2, m) + l.line(S + s / 2, y) + l.line(S, y) + l.line(S, w - o / 2)], L += l.move(S, y), n.globals.isXNumeric || (i += a), { pathTo: C, pathFrom: L, x: i, y: w, barXPosition: S, color: this.isBoxPlot ? f : d ? [g] : [u] } } }, { key: "drawHorizontalBoxPaths", value: function (t) { var e = t.indexes; t.x; var i = t.y, a = t.yDivision, s = t.barHeight, r = t.zeroW, o = t.strokeWidth, n = this.w, l = new k(this.ctx), h = e.i, c = e.j, d = this.boxOptions.colors.lower; this.isBoxPlot && (d = [this.boxOptions.colors.lower, this.boxOptions.colors.upper]); var g = this.invertedYRatio, u = e.realIndex, f = this.getOHLCValue(u, c), p = r, x = r, b = Math.min(f.o, f.c), v = Math.max(f.o, f.c), m = f.m; n.globals.isXNumeric && (i = (n.globals.seriesX[u][c] - n.globals.minX) / this.invertedXRatio - s / 2); var y = i + s * this.visibleI; void 0 === this.series[h][c] || null === this.series[h][c] ? (b = r, v = r) : (b = r + b / g, v = r + v / g, p = r + f.h / g, x = r + f.l / g, m = r + f.m / g); var w = l.move(r, y), A = l.move(b, y + s / 2); return n.globals.previousPaths.length > 0 && (A = this.getPreviousPath(u, c, !0)), w = [l.move(b, y) + l.line(b, y + s / 2) + l.line(p, y + s / 2) + l.line(p, y + s / 2 - s / 4) + l.line(p, y + s / 2 + s / 4) + l.line(p, y + s / 2) + l.line(b, y + s / 2) + l.line(b, y + s) + l.line(m, y + s) + l.line(m, y) + l.line(b + o / 2, y), l.move(m, y) + l.line(m, y + s) + l.line(v, y + s) + l.line(v, y + s / 2) + l.line(x, y + s / 2) + l.line(x, y + s - s / 4) + l.line(x, y + s / 4) + l.line(x, y + s / 2) + l.line(v, y + s / 2) + l.line(v, y) + l.line(m, y) + "z"], A += l.move(b, y), n.globals.isXNumeric || (i += a), { pathTo: w, pathFrom: A, x: v, y: i, barYPosition: y, color: d } } }, { key: "getOHLCValue", value: function (t, e) { var i = this.w; return { o: this.isBoxPlot ? i.globals.seriesCandleH[t][e] : i.globals.seriesCandleO[t][e], h: this.isBoxPlot ? i.globals.seriesCandleO[t][e] : i.globals.seriesCandleH[t][e], m: i.globals.seriesCandleM[t][e], l: this.isBoxPlot ? i.globals.seriesCandleC[t][e] : i.globals.seriesCandleL[t][e], c: this.isBoxPlot ? i.globals.seriesCandleL[t][e] : i.globals.seriesCandleC[t][e] } } }]), a }(), Pt = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "checkColorRange", value: function () { var t = this.w, e = !1, i = t.config.plotOptions[t.config.chart.type]; return i.colorScale.ranges.length > 0 && i.colorScale.ranges.map((function (t, i) { t.from <= 0 && (e = !0) })), e } }, { key: "getShadeColor", value: function (t, e, i, a) { var s = this.w, r = 1, o = s.config.plotOptions[t].shadeIntensity, n = this.determineColor(t, e, i); s.globals.hasNegs || a ? r = s.config.plotOptions[t].reverseNegativeShade ? n.percent < 0 ? n.percent / 100 * (1.25 * o) : (1 - n.percent / 100) * (1.25 * o) : n.percent <= 0 ? 1 - (1 + n.percent / 100) * o : (1 - n.percent / 100) * o : (r = 1 - n.percent / 100, "treemap" === t && (r = (1 - n.percent / 100) * (1.25 * o))); var l = n.color, h = new m; if (s.config.plotOptions[t].enableShades) if ("dark" === this.w.config.theme.mode) { var c = h.shadeColor(-1 * r, n.color); l = m.hexToRgba(m.isColorHex(c) ? c : m.rgb2hex(c), s.config.fill.opacity) } else { var d = h.shadeColor(r, n.color); l = m.hexToRgba(m.isColorHex(d) ? d : m.rgb2hex(d), s.config.fill.opacity) } return { color: l, colorProps: n } } }, { key: "determineColor", value: function (t, e, i) { var a = this.w, s = a.globals.series[e][i], r = a.config.plotOptions[t], o = r.colorScale.inverse ? i : e; r.distributed && "treemap" === a.config.chart.type && (o = i); var n = a.globals.colors[o], l = null, h = Math.min.apply(Math, p(a.globals.series[e])), c = Math.max.apply(Math, p(a.globals.series[e])); r.distributed || "heatmap" !== t || (h = a.globals.minY, c = a.globals.maxY), void 0 !== r.colorScale.min && (h = r.colorScale.min < a.globals.minY ? r.colorScale.min : a.globals.minY, c = r.colorScale.max > a.globals.maxY ? r.colorScale.max : a.globals.maxY); var d = Math.abs(c) + Math.abs(h), g = 100 * s / (0 === d ? d - 1e-6 : d); r.colorScale.ranges.length > 0 && r.colorScale.ranges.map((function (t, e) { if (s >= t.from && s <= t.to) { n = t.color, l = t.foreColor ? t.foreColor : null, h = t.from, c = t.to; var i = Math.abs(c) + Math.abs(h); g = 100 * s / (0 === i ? i - 1e-6 : i) } })); return { color: n, foreColor: l, percent: g } } }, { key: "calculateDataLabels", value: function (t) { var e = t.text, i = t.x, a = t.y, s = t.i, r = t.j, o = t.colorProps, n = t.fontSize, l = this.w.config.dataLabels, h = new k(this.ctx), c = new G(this.ctx), d = null; if (l.enabled) { d = h.group({ class: "apexcharts-data-labels" }); var g = l.offsetX, u = l.offsetY, f = i + g, p = a + parseFloat(l.style.fontSize) / 3 + u; c.plotDataLabelsText({ x: f, y: p, text: e, i: s, j: r, color: o.foreColor, parent: d, fontSize: n, dataLabelsConfig: l }) } return d } }, { key: "addListeners", value: function (t) { var e = new k(this.ctx); t.node.addEventListener("mouseenter", e.pathMouseEnter.bind(this, t)), t.node.addEventListener("mouseleave", e.pathMouseLeave.bind(this, t)), t.node.addEventListener("mousedown", e.pathMouseDown.bind(this, t)) } }]), t }(), Mt = function () { function t(e, a) { i(this, t), this.ctx = e, this.w = e.w, this.xRatio = a.xRatio, this.yRatio = a.yRatio, this.dynamicAnim = this.w.config.chart.animations.dynamicAnimation, this.helpers = new Pt(e), this.rectRadius = this.w.config.plotOptions.heatmap.radius, this.strokeWidth = this.w.config.stroke.show ? this.w.config.stroke.width : 0 } return s(t, [{ key: "draw", value: function (t) { var e = this.w, i = new k(this.ctx), a = i.group({ class: "apexcharts-heatmap" }); a.attr("clip-path", "url(#gridRectMask".concat(e.globals.cuid, ")")); var s = e.globals.gridWidth / e.globals.dataPoints, r = e.globals.gridHeight / e.globals.series.length, o = 0, n = !1; this.negRange = this.helpers.checkColorRange(); var l = t.slice(); e.config.yaxis[0].reversed && (n = !0, l.reverse()); for (var h = n ? 0 : l.length - 1; n ? h < l.length : h >= 0; n ? h++ : h--) { var c = i.group({ class: "apexcharts-series apexcharts-heatmap-series", seriesName: m.escapeString(e.globals.seriesNames[h]), rel: h + 1, "data:realIndex": h }); if (this.ctx.series.addCollapsedClassToSeries(c, h), e.config.chart.dropShadow.enabled) { var d = e.config.chart.dropShadow; new w(this.ctx).dropShadow(c, d, h) } for (var g = 0, u = e.config.plotOptions.heatmap.shadeIntensity, f = 0; f < l[h].length; f++) { var p = this.helpers.getShadeColor(e.config.chart.type, h, f, this.negRange), x = p.color, b = p.colorProps; if ("image" === e.config.fill.type) x = new N(this.ctx).fillPath({ seriesNumber: h, dataPointIndex: f, opacity: e.globals.hasNegs ? b.percent < 0 ? 1 - (1 + b.percent / 100) : u + b.percent / 100 : b.percent / 100, patternID: m.randomId(), width: e.config.fill.image.width ? e.config.fill.image.width : s, height: e.config.fill.image.height ? e.config.fill.image.height : r }); var v = this.rectRadius, y = i.drawRect(g, o, s, r, v); if (y.attr({ cx: g, cy: o }), y.node.classList.add("apexcharts-heatmap-rect"), c.add(y), y.attr({ fill: x, i: h, index: h, j: f, val: t[h][f], "stroke-width": this.strokeWidth, stroke: e.config.plotOptions.heatmap.useFillColorAsStroke ? x : e.globals.stroke.colors[0], color: x }), this.helpers.addListeners(y), e.config.chart.animations.enabled && !e.globals.dataChanged) { var A = 1; e.globals.resized || (A = e.config.chart.animations.speed), this.animateHeatMap(y, g, o, s, r, A) } if (e.globals.dataChanged) { var S = 1; if (this.dynamicAnim.enabled && e.globals.shouldAnimate) { S = this.dynamicAnim.speed; var C = e.globals.previousPaths[h] && e.globals.previousPaths[h][f] && e.globals.previousPaths[h][f].color; C || (C = "rgba(255, 255, 255, 0)"), this.animateHeatColor(y, m.isColorHex(C) ? C : m.rgb2hex(C), m.isColorHex(x) ? x : m.rgb2hex(x), S) } } var L = (0, e.config.dataLabels.formatter)(e.globals.series[h][f], { value: e.globals.series[h][f], seriesIndex: h, dataPointIndex: f, w: e }), P = this.helpers.calculateDataLabels({ text: L, x: g + s / 2, y: o + r / 2, i: h, j: f, colorProps: b, series: l }); null !== P && c.add(P), g += s } o += r, a.add(c) } var M = e.globals.yAxisScale[0].result.slice(); return e.config.yaxis[0].reversed ? M.unshift("") : M.push(""), e.globals.yAxisScale[0].result = M, a } }, { key: "animateHeatMap", value: function (t, e, i, a, s, r) { var o = new y(this.ctx); o.animateRect(t, { x: e + a / 2, y: i + s / 2, width: 0, height: 0 }, { x: e, y: i, width: a, height: s }, r, (function () { o.animationCompleted(t) })) } }, { key: "animateHeatColor", value: function (t, e, i, a) { t.attr({ fill: e }).animate(a).attr({ fill: i }) } }]), t }(), It = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "drawYAxisTexts", value: function (t, e, i, a) { var s = this.w, r = s.config.yaxis[0], o = s.globals.yLabelFormatters[0]; return new k(this.ctx).drawText({ x: t + r.labels.offsetX, y: e + r.labels.offsetY, text: o(a, i), textAnchor: "middle", fontSize: r.labels.style.fontSize, fontFamily: r.labels.style.fontFamily, foreColor: Array.isArray(r.labels.style.colors) ? r.labels.style.colors[i] : r.labels.style.colors }) } }]), t }(), Tt = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w; var a = 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 !== a.globals.stroke.colors ? a.globals.stroke.colors : a.globals.colors, this.defaultSize = Math.min(a.globals.gridWidth, a.globals.gridHeight), this.centerY = this.defaultSize / 2, this.centerX = a.globals.gridWidth / 2, "radialBar" === a.config.chart.type ? this.fullAngle = 360 : this.fullAngle = Math.abs(a.config.plotOptions.pie.endAngle - a.config.plotOptions.pie.startAngle), this.initialAngle = a.config.plotOptions.pie.startAngle % this.fullAngle, a.globals.radialSize = this.defaultSize / 2.05 - a.config.stroke.width - (a.config.chart.sparkline.enabled ? 0 : a.config.chart.dropShadow.blur), this.donutSize = a.globals.radialSize * parseInt(a.config.plotOptions.pie.donut.size, 10) / 100; var s = a.config.plotOptions.pie.customScale, r = a.globals.gridWidth / 2, o = a.globals.gridHeight / 2; this.translateX = r - r * s, this.translateY = o - o * s, this.dataLabelsGroup = new k(this.ctx).group({ class: "apexcharts-datalabels-group", transform: "translate(".concat(this.translateX, ", ").concat(this.translateY, ") scale(").concat(s, ")") }), this.maxY = 0, this.sliceLabels = [], this.sliceSizes = [], this.prevSectorAngleArr = [] } return s(t, [{ key: "draw", value: function (t) { var e = this, i = this.w, a = new k(this.ctx), s = a.group({ class: "apexcharts-pie" }); if (i.globals.noData) return s; for (var r = 0, o = 0; o < t.length; o++)r += m.negToZero(t[o]); var n = [], l = a.group(); 0 === r && (r = 1e-5), t.forEach((function (t) { e.maxY = Math.max(e.maxY, t) })), i.config.yaxis[0].max && (this.maxY = i.config.yaxis[0].max), "back" === i.config.grid.position && "polarArea" === this.chartType && this.drawPolarElements(s); for (var h = 0; h < t.length; h++) { var c = this.fullAngle * m.negToZero(t[h]) / r; n.push(c), "polarArea" === this.chartType ? (n[h] = this.fullAngle / t.length, this.sliceSizes.push(i.globals.radialSize * t[h] / this.maxY)) : this.sliceSizes.push(i.globals.radialSize) } if (i.globals.dataChanged) { for (var d, g = 0, u = 0; u < i.globals.previousPaths.length; u++)g += m.negToZero(i.globals.previousPaths[u]); for (var f = 0; f < i.globals.previousPaths.length; f++)d = this.fullAngle * m.negToZero(i.globals.previousPaths[f]) / g, this.prevSectorAngleArr.push(d) } if (this.donutSize < 0 && (this.donutSize = 0), "donut" === this.chartType) { var p = a.drawCircle(this.donutSize); p.attr({ cx: this.centerX, cy: this.centerY, fill: i.config.plotOptions.pie.donut.background ? i.config.plotOptions.pie.donut.background : "transparent" }), l.add(p) } var x = this.drawArcs(n, t); if (this.sliceLabels.forEach((function (t) { x.add(t) })), l.attr({ transform: "translate(".concat(this.translateX, ", ").concat(this.translateY, ") scale(").concat(i.config.plotOptions.pie.customScale, ")") }), l.add(x), s.add(l), this.donutDataLabels.show) { var b = this.renderInnerDataLabels(this.dataLabelsGroup, this.donutDataLabels, { hollowSize: this.donutSize, centerX: this.centerX, centerY: this.centerY, opacity: this.donutDataLabels.show }); s.add(b) } return "front" === i.config.grid.position && "polarArea" === this.chartType && this.drawPolarElements(s), s } }, { key: "drawArcs", value: function (t, e) { var i = this.w, a = new w(this.ctx), s = new k(this.ctx), r = new N(this.ctx), o = s.group({ class: "apexcharts-slices" }), n = this.initialAngle, l = this.initialAngle, h = this.initialAngle, c = this.initialAngle; this.strokeWidth = i.config.stroke.show ? i.config.stroke.width : 0; for (var d = 0; d < t.length; d++) { var g = s.group({ class: "apexcharts-series apexcharts-pie-series", seriesName: m.escapeString(i.globals.seriesNames[d]), rel: d + 1, "data:realIndex": d }); o.add(g), l = c, h = (n = h) + t[d], c = l + this.prevSectorAngleArr[d]; var u = h < n ? this.fullAngle + h - n : h - n, f = r.fillPath({ seriesNumber: d, size: this.sliceSizes[d], value: e[d] }), p = this.getChangedPath(l, c), x = s.drawPath({ d: p, stroke: Array.isArray(this.lineColorArr) ? this.lineColorArr[d] : this.lineColorArr, strokeWidth: 0, fill: f, fillOpacity: i.config.fill.opacity, classes: "apexcharts-pie-area apexcharts-".concat(this.chartType.toLowerCase(), "-slice-").concat(d) }); if (x.attr({ index: 0, j: d }), a.setSelectionFilter(x, 0, d), i.config.chart.dropShadow.enabled) { var b = i.config.chart.dropShadow; a.dropShadow(x, b, d) } this.addListeners(x, this.donutDataLabels), k.setAttrs(x.node, { "data:angle": u, "data:startAngle": n, "data:strokeWidth": this.strokeWidth, "data:value": e[d] }); var v = { x: 0, y: 0 }; "pie" === this.chartType || "polarArea" === this.chartType ? v = m.polarToCartesian(this.centerX, this.centerY, i.globals.radialSize / 1.25 + i.config.plotOptions.pie.dataLabels.offset, (n + u / 2) % this.fullAngle) : "donut" === this.chartType && (v = m.polarToCartesian(this.centerX, this.centerY, (i.globals.radialSize + this.donutSize) / 2 + i.config.plotOptions.pie.dataLabels.offset, (n + u / 2) % this.fullAngle)), g.add(x); var y = 0; if (!this.initialAnim || i.globals.resized || i.globals.dataChanged ? this.animBeginArr.push(0) : (0 === (y = u / this.fullAngle * i.config.chart.animations.speed) && (y = 1), this.animDur = y + this.animDur, this.animBeginArr.push(this.animDur)), this.dynamicAnim && i.globals.dataChanged ? this.animatePaths(x, { size: this.sliceSizes[d], endAngle: h, startAngle: n, prevStartAngle: l, prevEndAngle: c, animateStartingPos: !0, i: d, animBeginArr: this.animBeginArr, shouldSetPrevPaths: !0, dur: i.config.chart.animations.dynamicAnimation.speed }) : this.animatePaths(x, { size: this.sliceSizes[d], endAngle: h, startAngle: n, i: d, totalItems: t.length - 1, animBeginArr: this.animBeginArr, dur: y }), i.config.plotOptions.pie.expandOnClick && "polarArea" !== this.chartType && x.node.addEventListener("mouseup", this.pieClicked.bind(this, d)), void 0 !== i.globals.selectedDataPoints[0] && i.globals.selectedDataPoints[0].indexOf(d) > -1 && this.pieClicked(d), i.config.dataLabels.enabled) { var A = v.x, S = v.y, C = 100 * u / this.fullAngle + "%"; if (0 !== u && i.config.plotOptions.pie.dataLabels.minAngleToShowLabel < t[d]) { var L = i.config.dataLabels.formatter; void 0 !== L && (C = L(i.globals.seriesPercent[d][0], { seriesIndex: d, w: i })); var P = i.globals.dataLabels.style.colors[d], M = s.group({ class: "apexcharts-datalabels" }), I = s.drawText({ x: A, y: S, text: C, textAnchor: "middle", fontSize: i.config.dataLabels.style.fontSize, fontFamily: i.config.dataLabels.style.fontFamily, fontWeight: i.config.dataLabels.style.fontWeight, foreColor: P }); if (M.add(I), i.config.dataLabels.dropShadow.enabled) { var T = i.config.dataLabels.dropShadow; a.dropShadow(I, T) } I.node.classList.add("apexcharts-pie-label"), i.config.chart.animations.animate && !1 === i.globals.resized && (I.node.classList.add("apexcharts-pie-label-delay"), I.node.style.animationDelay = i.config.chart.animations.speed / 940 + "s"), this.sliceLabels.push(M) } } } return o } }, { key: "addListeners", value: function (t, e) { var i = new k(this.ctx); t.node.addEventListener("mouseenter", i.pathMouseEnter.bind(this, t)), t.node.addEventListener("mouseleave", i.pathMouseLeave.bind(this, t)), t.node.addEventListener("mouseleave", this.revertDataLabelsInner.bind(this, t.node, e)), t.node.addEventListener("mousedown", i.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))) } }, { key: "animatePaths", value: function (t, e) { var i = this.w, a = e.endAngle < e.startAngle ? this.fullAngle + e.endAngle - e.startAngle : e.endAngle - e.startAngle, s = a, r = e.startAngle, o = e.startAngle; void 0 !== e.prevStartAngle && void 0 !== e.prevEndAngle && (r = e.prevEndAngle, s = e.prevEndAngle < e.prevStartAngle ? this.fullAngle + e.prevEndAngle - e.prevStartAngle : e.prevEndAngle - e.prevStartAngle), e.i === i.config.series.length - 1 && (a + o > this.fullAngle ? e.endAngle = e.endAngle - (a + o) : a + o < this.fullAngle && (e.endAngle = e.endAngle + (this.fullAngle - (a + o)))), a === this.fullAngle && (a = this.fullAngle - .01), this.animateArc(t, r, o, a, s, e) } }, { key: "animateArc", value: function (t, e, i, a, s, r) { var o, n = this, l = this.w, h = new y(this.ctx), c = r.size; (isNaN(e) || isNaN(s)) && (e = i, s = a, r.dur = 0); var d = a, g = i, u = e < i ? this.fullAngle + e - i : e - i; l.globals.dataChanged && r.shouldSetPrevPaths && r.prevEndAngle && (o = n.getPiePath({ me: n, startAngle: r.prevStartAngle, angle: r.prevEndAngle < r.prevStartAngle ? this.fullAngle + r.prevEndAngle - r.prevStartAngle : r.prevEndAngle - r.prevStartAngle, size: c }), t.attr({ d: o })), 0 !== r.dur ? t.animate(r.dur, l.globals.easing, r.animBeginArr[r.i]).afterAll((function () { "pie" !== n.chartType && "donut" !== n.chartType && "polarArea" !== n.chartType || this.animate(l.config.chart.animations.dynamicAnimation.speed).attr({ "stroke-width": n.strokeWidth }), r.i === l.config.series.length - 1 && h.animationCompleted(t) })).during((function (l) { d = u + (a - u) * l, r.animateStartingPos && (d = s + (a - s) * l, g = e - s + (i - (e - s)) * l), o = n.getPiePath({ me: n, startAngle: g, angle: d, size: c }), t.node.setAttribute("data:pathOrig", o), t.attr({ d: o }) })) : (o = n.getPiePath({ me: n, startAngle: g, angle: a, size: c }), r.isTrack || (l.globals.animationEnded = !0), t.node.setAttribute("data:pathOrig", o), t.attr({ d: o, "stroke-width": n.strokeWidth })) } }, { key: "pieClicked", value: function (t) { var e, i = this.w, a = this, s = a.sliceSizes[t] + (i.config.plotOptions.pie.expandOnClick ? 4 : 0), r = i.globals.dom.Paper.select(".apexcharts-".concat(a.chartType.toLowerCase(), "-slice-").concat(t)).members[0]; if ("true" !== r.attr("data:pieClicked")) { var o = i.globals.dom.baseEl.getElementsByClassName("apexcharts-pie-area"); Array.prototype.forEach.call(o, (function (t) { t.setAttribute("data:pieClicked", "false"); var e = t.getAttribute("data:pathOrig"); e && t.setAttribute("d", e) })), i.globals.capturedDataPointIndex = t, r.attr("data:pieClicked", "true"); var n = parseInt(r.attr("data:startAngle"), 10), l = parseInt(r.attr("data:angle"), 10); e = a.getPiePath({ me: a, startAngle: n, angle: l, size: s }), 360 !== l && r.plot(e) } else { r.attr({ "data:pieClicked": "false" }), this.revertDataLabelsInner(r.node, this.donutDataLabels); var h = r.attr("data:pathOrig"); r.attr({ d: h }) } } }, { key: "getChangedPath", value: function (t, e) { var i = ""; return this.dynamicAnim && this.w.globals.dataChanged && (i = this.getPiePath({ me: this, startAngle: t, angle: e - t, size: this.size })), i } }, { key: "getPiePath", value: function (t) { var e, i = t.me, a = t.startAngle, s = t.angle, r = t.size, o = new k(this.ctx), n = a, l = Math.PI * (n - 90) / 180, h = s + a; Math.ceil(h) >= this.fullAngle + this.w.config.plotOptions.pie.startAngle % this.fullAngle && (h = this.fullAngle + this.w.config.plotOptions.pie.startAngle % this.fullAngle - .01), Math.ceil(h) > this.fullAngle && (h -= this.fullAngle); var c = Math.PI * (h - 90) / 180, d = i.centerX + r * Math.cos(l), g = i.centerY + r * Math.sin(l), u = i.centerX + r * Math.cos(c), f = i.centerY + r * Math.sin(c), p = m.polarToCartesian(i.centerX, i.centerY, i.donutSize, h), x = m.polarToCartesian(i.centerX, i.centerY, i.donutSize, n), b = s > 180 ? 1 : 0, v = ["M", d, g, "A", r, r, 0, b, 1, u, f]; return e = "donut" === i.chartType ? [].concat(v, ["L", p.x, p.y, "A", i.donutSize, i.donutSize, 0, b, 0, x.x, x.y, "L", d, g, "z"]).join(" ") : "pie" === i.chartType || "polarArea" === i.chartType ? [].concat(v, ["L", i.centerX, i.centerY, "L", d, g]).join(" ") : [].concat(v).join(" "), o.roundPathCorners(e, 2 * this.strokeWidth) } }, { key: "drawPolarElements", value: function (t) { var e = this.w, i = new $(this.ctx), a = new k(this.ctx), s = new It(this.ctx), r = a.group(), o = a.group(), n = i.niceScale(0, Math.ceil(this.maxY), 0), l = n.result.reverse(), h = n.result.length; this.maxY = n.niceMax; for (var c = e.globals.radialSize, d = c / (h - 1), g = 0; g < h - 1; g++) { var u = a.drawCircle(c); if (u.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) { var f = s.drawYAxisTexts(this.centerX, this.centerY - c + parseInt(e.config.yaxis[0].labels.style.fontSize, 10) / 2, g, l[g]); o.add(f) } r.add(u), c -= d } this.drawSpokes(t), t.add(r), t.add(o) } }, { key: "renderInnerDataLabels", value: function (t, e, i) { var a = this.w, s = new k(this.ctx), r = e.total.show; t.node.innerHTML = "", t.node.style.opacity = i.opacity; var o, n, l = i.centerX, h = this.donutDataLabels.total.label ? i.centerY : i.centerY - i.centerY / 6; o = void 0 === e.name.color ? a.globals.colors[0] : e.name.color; var c = e.name.fontSize, d = e.name.fontFamily, g = e.name.fontWeight; n = void 0 === e.value.color ? a.config.chart.foreColor : e.value.color; var u = e.value.formatter, f = "", p = ""; if (r ? (o = e.total.color, c = e.total.fontSize, d = e.total.fontFamily, g = e.total.fontWeight, p = this.donutDataLabels.total.label ? e.total.label : "", f = e.total.formatter(a)) : 1 === a.globals.series.length && (f = u(a.globals.series[0], a), p = a.globals.seriesNames[0]), p && (p = e.name.formatter(p, e.total.show, a)), e.name.show) { var x = s.drawText({ x: l, y: h + parseFloat(e.name.offsetY), text: p, textAnchor: "middle", foreColor: o, fontSize: c, fontWeight: g, fontFamily: d }); x.node.classList.add("apexcharts-datalabel-label"), t.add(x) } if (e.value.show) { var b = e.name.show ? parseFloat(e.value.offsetY) + 16 : e.value.offsetY, v = s.drawText({ x: l, y: h + b, text: f, textAnchor: "middle", foreColor: n, fontWeight: e.value.fontWeight, fontSize: e.value.fontSize, fontFamily: e.value.fontFamily }); v.node.classList.add("apexcharts-datalabel-value"), t.add(v) } return t } }, { key: "printInnerLabels", value: function (t, e, i, a) { var s, r = this.w; a ? s = void 0 === t.name.color ? r.globals.colors[parseInt(a.parentNode.getAttribute("rel"), 10) - 1] : t.name.color : r.globals.series.length > 1 && t.total.show && (s = t.total.color); var o = r.globals.dom.baseEl.querySelector(".apexcharts-datalabel-label"), n = r.globals.dom.baseEl.querySelector(".apexcharts-datalabel-value"); i = (0, t.value.formatter)(i, r), a || "function" != typeof t.total.formatter || (i = t.total.formatter(r)); var l = e === t.total.label; e = this.donutDataLabels.total.label ? t.name.formatter(e, l, r) : "", null !== o && (o.textContent = e), null !== n && (n.textContent = i), null !== o && (o.style.fill = s) } }, { key: "printDataLabelsInner", value: function (t, e) { var i = this.w, a = t.getAttribute("data:value"), s = i.globals.seriesNames[parseInt(t.parentNode.getAttribute("rel"), 10) - 1]; i.globals.series.length > 1 && this.printInnerLabels(e, s, a, t); var r = i.globals.dom.baseEl.querySelector(".apexcharts-datalabels-group"); null !== r && (r.style.opacity = 1) } }, { key: "drawSpokes", value: function (t) { var e = this, i = this.w, a = new k(this.ctx), s = i.config.plotOptions.polarArea.spokes; if (0 !== s.strokeWidth) { for (var r = [], o = 360 / i.globals.series.length, n = 0; n < i.globals.series.length; n++)r.push(m.polarToCartesian(this.centerX, this.centerY, i.globals.radialSize, i.config.plotOptions.pie.startAngle + o * n)); r.forEach((function (i, r) { var o = a.drawLine(i.x, i.y, e.centerX, e.centerY, Array.isArray(s.connectorColors) ? s.connectorColors[r] : s.connectorColors); t.add(o) })) } } }, { key: "revertDataLabelsInner", value: function () { var t = this.w; if (this.donutDataLabels.show) { var e = t.globals.dom.Paper.select(".apexcharts-datalabels-group").members[0], i = this.renderInnerDataLabels(e, this.donutDataLabels, { hollowSize: this.donutSize, centerX: this.centerX, centerY: this.centerY, opacity: this.donutDataLabels.show }); t.globals.dom.Paper.select(".apexcharts-radialbar, .apexcharts-pie").members[0].add(i) } } }]), t }(), zt = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.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; var a = this.w; this.graphics = new k(this.ctx), this.lineColorArr = void 0 !== a.globals.stroke.colors ? a.globals.stroke.colors : a.globals.colors, this.defaultSize = a.globals.svgHeight < a.globals.svgWidth ? a.globals.gridHeight : a.globals.gridWidth, this.isLog = a.config.yaxis[0].logarithmic, this.logBase = a.config.yaxis[0].logBase, this.coreUtils = new A(this.ctx), this.maxValue = this.isLog ? this.coreUtils.getLogVal(this.logBase, a.globals.maxY, 0) : a.globals.maxY, this.minValue = this.isLog ? this.coreUtils.getLogVal(this.logBase, this.w.globals.minY, 0) : a.globals.minY, this.polygons = a.config.plotOptions.radar.polygons, this.strokeWidth = a.config.stroke.show ? a.config.stroke.width : 0, this.size = this.defaultSize / 2.1 - this.strokeWidth - a.config.chart.dropShadow.blur, a.config.xaxis.labels.show && (this.size = this.size - a.globals.xAxisLabelsWidth / 1.75), void 0 !== a.config.plotOptions.radar.size && (this.size = a.config.plotOptions.radar.size), this.dataRadiusOfPercent = [], this.dataRadius = [], this.angleArr = [], this.yaxisLabelsTextsPos = [] } return s(t, [{ key: "draw", value: function (t) { var e = this, i = this.w, a = new N(this.ctx), s = [], r = new G(this.ctx); t.length && (this.dataPointsLen = t[i.globals.maxValsInArrayIndex].length), this.disAngle = 2 * Math.PI / this.dataPointsLen; var o = i.globals.gridWidth / 2, n = i.globals.gridHeight / 2, l = o + i.config.plotOptions.radar.offsetX, h = n + i.config.plotOptions.radar.offsetY, c = this.graphics.group({ class: "apexcharts-radar-series apexcharts-plot-series", transform: "translate(".concat(l || 0, ", ").concat(h || 0, ")") }), d = [], u = null, f = null; if (this.yaxisLabels = this.graphics.group({ class: "apexcharts-yaxis" }), t.forEach((function (t, o) { var n = t.length === i.globals.dataPoints, l = e.graphics.group().attr({ class: "apexcharts-series", "data:longestSeries": n, seriesName: m.escapeString(i.globals.seriesNames[o]), rel: o + 1, "data:realIndex": o }); e.dataRadiusOfPercent[o] = [], e.dataRadius[o] = [], e.angleArr[o] = [], t.forEach((function (t, i) { var a = Math.abs(e.maxValue - e.minValue); t -= e.minValue, e.isLog && (t = e.coreUtils.getLogVal(e.logBase, t, 0)), e.dataRadiusOfPercent[o][i] = t / a, e.dataRadius[o][i] = e.dataRadiusOfPercent[o][i] * e.size, e.angleArr[o][i] = i * e.disAngle })), d = e.getDataPointsPos(e.dataRadius[o], e.angleArr[o]); var h = e.createPaths(d, { x: 0, y: 0 }); u = e.graphics.group({ class: "apexcharts-series-markers-wrap apexcharts-element-hidden" }), f = e.graphics.group({ class: "apexcharts-datalabels", "data:realIndex": o }), i.globals.delayedElements.push({ el: u.node, index: o }); var c = { i: o, realIndex: o, animationDelay: o, initialSpeed: i.config.chart.animations.speed, dataChangeSpeed: i.config.chart.animations.dynamicAnimation.speed, className: "apexcharts-radar", shouldClipToGrid: !1, bindEventsOnPaths: !1, stroke: i.globals.stroke.colors[o], strokeLineCap: i.config.stroke.lineCap }, p = null; i.globals.previousPaths.length > 0 && (p = e.getPreviousPath(o)); for (var x = 0; x < h.linePathsTo.length; x++) { var b = e.graphics.renderPaths(g(g({}, c), {}, { pathFrom: null === p ? h.linePathsFrom[x] : p, pathTo: h.linePathsTo[x], strokeWidth: Array.isArray(e.strokeWidth) ? e.strokeWidth[o] : e.strokeWidth, fill: "none", drawShadow: !1 })); l.add(b); var v = a.fillPath({ seriesNumber: o }), y = e.graphics.renderPaths(g(g({}, c), {}, { pathFrom: null === p ? h.areaPathsFrom[x] : p, pathTo: h.areaPathsTo[x], strokeWidth: 0, fill: v, drawShadow: !1 })); if (i.config.chart.dropShadow.enabled) { var k = new w(e.ctx), A = i.config.chart.dropShadow; k.dropShadow(y, Object.assign({}, A, { noUserSpaceOnUse: !0 }), o) } l.add(y) } t.forEach((function (t, a) { var s = new W(e.ctx).getMarkerConfig({ cssClass: "apexcharts-marker", seriesIndex: o, dataPointIndex: a }), n = e.graphics.drawMarker(d[a].x, d[a].y, s); n.attr("rel", a), n.attr("j", a), n.attr("index", o), n.node.setAttribute("default-marker-size", s.pSize); var h = e.graphics.group({ class: "apexcharts-series-markers" }); h && h.add(n), u.add(h), l.add(u); var c = i.config.dataLabels; if (c.enabled) { var p = c.formatter(i.globals.series[o][a], { seriesIndex: o, dataPointIndex: a, w: i }); r.plotDataLabelsText({ x: d[a].x, y: d[a].y, text: p, textAnchor: "middle", i: o, j: o, parent: f, offsetCorrection: !1, dataLabelsConfig: g({}, c) }) } l.add(f) })), s.push(l) })), this.drawPolygons({ parent: c }), i.config.xaxis.labels.show) { var p = this.drawXAxisTexts(); c.add(p) } return s.forEach((function (t) { c.add(t) })), c.add(this.yaxisLabels), c } }, { key: "drawPolygons", value: function (t) { for (var e = this, i = this.w, a = t.parent, s = new It(this.ctx), r = i.globals.yAxisScale[0].result.reverse(), o = r.length, n = [], l = this.size / (o - 1), h = 0; h < o; h++)n[h] = l * h; n.reverse(); var c = [], d = []; n.forEach((function (t, i) { var a = m.getPolygonPos(t, e.dataPointsLen), s = ""; a.forEach((function (t, a) { if (0 === i) { var r = e.graphics.drawLine(t.x, t.y, 0, 0, Array.isArray(e.polygons.connectorColors) ? e.polygons.connectorColors[a] : e.polygons.connectorColors); d.push(r) } 0 === a && e.yaxisLabelsTextsPos.push({ x: t.x, y: t.y }), s += t.x + "," + t.y + " " })), c.push(s) })), c.forEach((function (t, s) { var r = e.polygons.strokeColors, o = e.polygons.strokeWidth, n = e.graphics.drawPolygon(t, Array.isArray(r) ? r[s] : r, Array.isArray(o) ? o[s] : o, i.globals.radarPolygons.fill.colors[s]); a.add(n) })), d.forEach((function (t) { a.add(t) })), i.config.yaxis[0].show && this.yaxisLabelsTextsPos.forEach((function (t, i) { var a = s.drawYAxisTexts(t.x, t.y, i, r[i]); e.yaxisLabels.add(a) })) } }, { key: "drawXAxisTexts", value: function () { var t = this, e = this.w, i = e.config.xaxis.labels, a = this.graphics.group({ class: "apexcharts-xaxis" }), s = m.getPolygonPos(this.size, this.dataPointsLen); return e.globals.labels.forEach((function (r, o) { var n = e.config.xaxis.labels.formatter, l = new G(t.ctx); if (s[o]) { var h = t.getTextPos(s[o], t.size), c = n(r, { seriesIndex: -1, dataPointIndex: o, w: e }); l.plotDataLabelsText({ x: h.newX, y: h.newY, text: c, textAnchor: h.textAnchor, i: o, j: o, parent: a, className: "apexcharts-xaxis-label", color: Array.isArray(i.style.colors) && i.style.colors[o] ? i.style.colors[o] : "#a8a8a8", dataLabelsConfig: g({ textAnchor: h.textAnchor, dropShadow: { enabled: !1 } }, i), offsetCorrection: !1 }).on("click", (function (i) { if ("function" == typeof e.config.chart.events.xAxisLabelClick) { var a = Object.assign({}, e, { labelIndex: o }); e.config.chart.events.xAxisLabelClick(i, t.ctx, a) } })) } })), a } }, { key: "createPaths", value: function (t, e) { var i = this, a = [], s = [], r = [], o = []; if (t.length) { s = [this.graphics.move(e.x, e.y)], o = [this.graphics.move(e.x, e.y)]; var n = this.graphics.move(t[0].x, t[0].y), l = this.graphics.move(t[0].x, t[0].y); t.forEach((function (e, a) { n += i.graphics.line(e.x, e.y), l += i.graphics.line(e.x, e.y), a === t.length - 1 && (n += "Z", l += "Z") })), a.push(n), r.push(l) } return { linePathsFrom: s, linePathsTo: a, areaPathsFrom: o, areaPathsTo: r } } }, { key: "getTextPos", value: function (t, e) { var i = "middle", a = t.x, s = t.y; return Math.abs(t.x) >= 10 ? t.x > 0 ? (i = "start", a += 10) : t.x < 0 && (i = "end", a -= 10) : i = "middle", Math.abs(t.y) >= e - 10 && (t.y < 0 ? s -= 10 : t.y > 0 && (s += 10)), { textAnchor: i, newX: a, newY: s } } }, { key: "getPreviousPath", value: function (t) { for (var e = this.w, i = null, a = 0; a < e.globals.previousPaths.length; a++) { var s = e.globals.previousPaths[a]; s.paths.length > 0 && parseInt(s.realIndex, 10) === parseInt(t, 10) && void 0 !== e.globals.previousPaths[a].paths[0] && (i = e.globals.previousPaths[a].paths[0].d) } return i } }, { key: "getDataPointsPos", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.dataPointsLen; t = t || [], e = e || []; for (var a = [], s = 0; s < i; s++) { var r = {}; r.x = t[s] * Math.sin(e[s]), r.y = -t[s] * Math.cos(e[s]), a.push(r) } return a } }]), t }(), Xt = function (t) { h(r, Tt); var a = o(r); function r(t) { var s; i(this, r), (s = a.call(this, t)).ctx = t, s.w = t.w, s.animBeginArr = [0], s.animDur = 0; var o = s.w; return s.startAngle = o.config.plotOptions.radialBar.startAngle, s.endAngle = o.config.plotOptions.radialBar.endAngle, s.totalAngle = Math.abs(o.config.plotOptions.radialBar.endAngle - o.config.plotOptions.radialBar.startAngle), s.trackStartAngle = o.config.plotOptions.radialBar.track.startAngle, s.trackEndAngle = o.config.plotOptions.radialBar.track.endAngle, s.barLabels = s.w.config.plotOptions.radialBar.barLabels, s.donutDataLabels = s.w.config.plotOptions.radialBar.dataLabels, s.radialDataLabels = s.donutDataLabels, s.trackStartAngle || (s.trackStartAngle = s.startAngle), s.trackEndAngle || (s.trackEndAngle = s.endAngle), 360 === s.endAngle && (s.endAngle = 359.99), s.margin = parseInt(o.config.plotOptions.radialBar.track.margin, 10), s.onBarLabelClick = s.onBarLabelClick.bind(e(s)), s } return s(r, [{ key: "draw", value: function (t) { var e = this.w, i = new k(this.ctx), a = i.group({ class: "apexcharts-radialbar" }); if (e.globals.noData) return a; var s = i.group(), r = this.defaultSize / 2, o = e.globals.gridWidth / 2, n = this.defaultSize / 2.05; e.config.chart.sparkline.enabled || (n = n - e.config.stroke.width - e.config.chart.dropShadow.blur); var l = e.globals.fill.colors; if (e.config.plotOptions.radialBar.track.show) { var h = this.drawTracks({ size: n, centerX: o, centerY: r, colorArr: l, series: t }); s.add(h) } var c = this.drawArcs({ size: n, centerX: o, centerY: r, colorArr: l, series: t }), d = 360; e.config.plotOptions.radialBar.startAngle < 0 && (d = this.totalAngle); var g = (360 - d) / 360; if (e.globals.radialSize = n - n * g, this.radialDataLabels.value.show) { var u = Math.max(this.radialDataLabels.value.offsetY, this.radialDataLabels.name.offsetY); e.globals.radialSize += u * g } return s.add(c.g), "front" === e.config.plotOptions.radialBar.hollow.position && (c.g.add(c.elHollow), c.dataLabels && c.g.add(c.dataLabels)), a.add(s), a } }, { key: "drawTracks", value: function (t) { var e = this.w, i = new k(this.ctx), a = i.group({ class: "apexcharts-tracks" }), s = new w(this.ctx), r = new N(this.ctx), o = this.getStrokeWidth(t); t.size = t.size - o / 2; for (var n = 0; n < t.series.length; n++) { var l = i.group({ class: "apexcharts-radialbar-track apexcharts-track" }); a.add(l), l.attr({ rel: n + 1 }), t.size = t.size - o - this.margin; var h = e.config.plotOptions.radialBar.track, c = r.fillPath({ seriesNumber: 0, size: t.size, fillColors: Array.isArray(h.background) ? h.background[n] : h.background, solid: !0 }), d = this.trackStartAngle, g = this.trackEndAngle; Math.abs(g) + Math.abs(d) >= 360 && (g = 360 - Math.abs(this.startAngle) - .1); var u = i.drawPath({ d: "", stroke: c, strokeWidth: o * parseInt(h.strokeWidth, 10) / 100, fill: "none", strokeOpacity: h.opacity, classes: "apexcharts-radialbar-area" }); if (h.dropShadow.enabled) { var f = h.dropShadow; s.dropShadow(u, f) } l.add(u), u.attr("id", "apexcharts-radialbarTrack-" + n), this.animatePaths(u, { centerX: t.centerX, centerY: t.centerY, endAngle: g, startAngle: d, size: t.size, i: n, totalItems: 2, animBeginArr: 0, dur: 0, isTrack: !0, easing: e.globals.easing }) } return a } }, { key: "drawArcs", value: function (t) { var e = this.w, i = new k(this.ctx), a = new N(this.ctx), s = new w(this.ctx), r = i.group(), o = this.getStrokeWidth(t); t.size = t.size - o / 2; var n = e.config.plotOptions.radialBar.hollow.background, l = t.size - o * t.series.length - this.margin * t.series.length - o * parseInt(e.config.plotOptions.radialBar.track.strokeWidth, 10) / 100 / 2, h = l - e.config.plotOptions.radialBar.hollow.margin; void 0 !== e.config.plotOptions.radialBar.hollow.image && (n = this.drawHollowImage(t, r, l, n)); var c = this.drawHollow({ size: h, centerX: t.centerX, centerY: t.centerY, fill: n || "transparent" }); if (e.config.plotOptions.radialBar.hollow.dropShadow.enabled) { var d = e.config.plotOptions.radialBar.hollow.dropShadow; s.dropShadow(c, d) } var g = 1; !this.radialDataLabels.total.show && e.globals.series.length > 1 && (g = 0); var u = null; if (this.radialDataLabels.show) { var f = e.globals.dom.Paper.select(".apexcharts-datalabels-group").members[0]; u = this.renderInnerDataLabels(f, this.radialDataLabels, { hollowSize: l, centerX: t.centerX, centerY: t.centerY, opacity: g }) } "back" === e.config.plotOptions.radialBar.hollow.position && (r.add(c), u && r.add(u)); var p = !1; e.config.plotOptions.radialBar.inverseOrder && (p = !0); for (var x = p ? t.series.length - 1 : 0; p ? x >= 0 : x < t.series.length; p ? x-- : x++) { var b = i.group({ class: "apexcharts-series apexcharts-radial-series", seriesName: m.escapeString(e.globals.seriesNames[x]) }); r.add(b), b.attr({ rel: x + 1, "data:realIndex": x }), this.ctx.series.addCollapsedClassToSeries(b, x), t.size = t.size - o - this.margin; var v = a.fillPath({ seriesNumber: x, size: t.size, value: t.series[x] }), y = this.startAngle, A = void 0, S = m.negToZero(t.series[x] > 100 ? 100 : t.series[x]) / 100, C = Math.round(this.totalAngle * S) + this.startAngle, L = void 0; e.globals.dataChanged && (A = this.startAngle, L = Math.round(this.totalAngle * m.negToZero(e.globals.previousPaths[x]) / 100) + A), Math.abs(C) + Math.abs(y) > 360 && (C -= .01), Math.abs(L) + Math.abs(A) > 360 && (L -= .01); var P = C - y, M = Array.isArray(e.config.stroke.dashArray) ? e.config.stroke.dashArray[x] : e.config.stroke.dashArray, I = i.drawPath({ d: "", stroke: v, strokeWidth: o, fill: "none", fillOpacity: e.config.fill.opacity, classes: "apexcharts-radialbar-area apexcharts-radialbar-slice-" + x, strokeDashArray: M }); if (k.setAttrs(I.node, { "data:angle": P, "data:value": t.series[x] }), e.config.chart.dropShadow.enabled) { var T = e.config.chart.dropShadow; s.dropShadow(I, T, x) } if (s.setSelectionFilter(I, 0, x), this.addListeners(I, this.radialDataLabels), b.add(I), I.attr({ index: 0, j: x }), this.barLabels.enabled) { var z = m.polarToCartesian(t.centerX, t.centerY, t.size, y), X = this.barLabels.formatter(e.globals.seriesNames[x], { seriesIndex: x, w: e }), E = ["apexcharts-radialbar-label"]; this.barLabels.onClick || E.push("apexcharts-no-click"); var Y = this.barLabels.useSeriesColors ? e.globals.colors[x] : e.config.chart.foreColor; Y || (Y = e.config.chart.foreColor); var R = z.x + this.barLabels.offsetX, F = z.y + this.barLabels.offsetY, D = i.drawText({ x: R, y: F, text: X, textAnchor: "end", dominantBaseline: "middle", fontFamily: this.barLabels.fontFamily, fontWeight: this.barLabels.fontWeight, fontSize: this.barLabels.fontSize, foreColor: Y, cssClass: E.join(" ") }); D.on("click", this.onBarLabelClick), D.attr({ rel: x + 1 }), 0 !== y && D.attr({ "transform-origin": "".concat(R, " ").concat(F), transform: "rotate(".concat(y, " 0 0)") }), b.add(D) } var H = 0; !this.initialAnim || e.globals.resized || e.globals.dataChanged || (H = e.config.chart.animations.speed), e.globals.dataChanged && (H = e.config.chart.animations.dynamicAnimation.speed), this.animDur = H / (1.2 * t.series.length) + this.animDur, this.animBeginArr.push(this.animDur), this.animatePaths(I, { centerX: t.centerX, centerY: t.centerY, endAngle: C, startAngle: y, prevEndAngle: L, prevStartAngle: A, size: t.size, i: x, totalItems: 2, animBeginArr: this.animBeginArr, dur: H, shouldSetPrevPaths: !0, easing: e.globals.easing }) } return { g: r, elHollow: c, dataLabels: u } } }, { key: "drawHollow", value: function (t) { var e = new k(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 } }, { key: "drawHollowImage", value: function (t, e, i, a) { var s = this.w, r = new N(this.ctx), o = m.randomId(), n = s.config.plotOptions.radialBar.hollow.image; if (s.config.plotOptions.radialBar.hollow.imageClipped) r.clippedImgArea({ width: i, height: i, image: n, patternID: "pattern".concat(s.globals.cuid).concat(o) }), a = "url(#pattern".concat(s.globals.cuid).concat(o, ")"); else { var l = s.config.plotOptions.radialBar.hollow.imageWidth, h = s.config.plotOptions.radialBar.hollow.imageHeight; if (void 0 === l && void 0 === h) { var c = s.globals.dom.Paper.image(n).loaded((function (e) { this.move(t.centerX - e.width / 2 + s.config.plotOptions.radialBar.hollow.imageOffsetX, t.centerY - e.height / 2 + s.config.plotOptions.radialBar.hollow.imageOffsetY) })); e.add(c) } else { var d = s.globals.dom.Paper.image(n).loaded((function (e) { this.move(t.centerX - l / 2 + s.config.plotOptions.radialBar.hollow.imageOffsetX, t.centerY - h / 2 + s.config.plotOptions.radialBar.hollow.imageOffsetY), this.size(l, h) })); e.add(d) } } return a } }, { key: "getStrokeWidth", value: function (t) { var e = this.w; return t.size * (100 - parseInt(e.config.plotOptions.radialBar.hollow.size, 10)) / 100 / (t.series.length + 1) - this.margin } }, { key: "onBarLabelClick", value: function (t) { var e = parseInt(t.target.getAttribute("rel"), 10) - 1, i = this.barLabels.onClick, a = this.w; i && i(a.globals.seriesNames[e], { w: a, seriesIndex: e }) } }]), r }(), Et = function (t) { h(a, St); var e = o(a); function a() { return i(this, a), e.apply(this, arguments) } return s(a, [{ key: "draw", value: function (t, e) { var i = this.w, a = new k(this.ctx); this.rangeBarOptions = this.w.config.plotOptions.rangeBar, this.series = t, this.seriesRangeStart = i.globals.seriesRangeStart, this.seriesRangeEnd = i.globals.seriesRangeEnd, this.barHelpers.initVariables(t); for (var s = a.group({ class: "apexcharts-rangebar-series apexcharts-plot-series" }), r = 0; r < t.length; r++) { var o, n, l, h, c = void 0, d = void 0, u = i.globals.comboCharts ? e[r] : r, f = this.barHelpers.getGroupIndex(u).columnGroupIndex, p = a.group({ class: "apexcharts-series", seriesName: m.escapeString(i.globals.seriesNames[u]), rel: r + 1, "data:realIndex": u }); this.ctx.series.addCollapsedClassToSeries(p, u), t[r].length > 0 && (this.visibleI = this.visibleI + 1); var x = 0, b = 0, v = 0; this.yRatio.length > 1 && (this.yaxisIndex = i.globals.seriesYAxisReverseMap[u][0], v = u); var y = this.barHelpers.initialPositions(); d = y.y, h = y.zeroW, c = y.x, b = y.barWidth, x = y.barHeight, o = y.xDivision, n = y.yDivision, l = y.zeroH; for (var w = a.group({ class: "apexcharts-datalabels", "data:realIndex": u }), A = a.group({ class: "apexcharts-rangebar-goals-markers" }), S = 0; S < i.globals.dataPoints; S++) { var C = this.barHelpers.getStrokeWidth(r, S, u), L = this.seriesRangeStart[r][S], P = this.seriesRangeEnd[r][S], M = null, I = null, T = null, z = { x: c, y: d, strokeWidth: C, elSeries: p }, X = this.seriesLen; if (i.config.plotOptions.bar.rangeBarGroupRows && (X = 1), void 0 === i.config.series[r].data[S]) break; if (this.isHorizontal) { T = d + x * this.visibleI; var E = (n - x * X) / 2; if (i.config.series[r].data[S].x) { var Y = this.detectOverlappingBars({ i: r, j: S, barYPosition: T, srty: E, barHeight: x, yDivision: n, initPositions: y }); x = Y.barHeight, T = Y.barYPosition } b = (M = this.drawRangeBarPaths(g({ indexes: { i: r, j: S, realIndex: u }, barHeight: x, barYPosition: T, zeroW: h, yDivision: n, y1: L, y2: P }, z))).barWidth } else { i.globals.isXNumeric && (c = (i.globals.seriesX[r][S] - i.globals.minX) / this.xRatio - b / 2), I = c + b * this.visibleI; var R = (o - b * X) / 2; if (i.config.series[r].data[S].x) { var F = this.detectOverlappingBars({ i: r, j: S, barXPosition: I, srtx: R, barWidth: b, xDivision: o, initPositions: y }); b = F.barWidth, I = F.barXPosition } x = (M = this.drawRangeColumnPaths(g({ indexes: { i: r, j: S, realIndex: u, translationsIndex: v }, barWidth: b, barXPosition: I, zeroH: l, xDivision: o }, z))).barHeight } var D = this.barHelpers.drawGoalLine({ barXPosition: M.barXPosition, barYPosition: T, goalX: M.goalX, goalY: M.goalY, barHeight: x, barWidth: b }); D && A.add(D), d = M.y, c = M.x; var H = this.barHelpers.getPathFillColor(t, r, S, u), O = i.globals.stroke.colors[u]; this.renderSeries({ realIndex: u, pathFill: H, lineFill: O, j: S, i: r, x: c, y: d, y1: L, y2: P, pathFrom: M.pathFrom, pathTo: M.pathTo, strokeWidth: C, elSeries: p, series: t, barHeight: x, barWidth: b, barXPosition: I, barYPosition: T, columnGroupIndex: f, elDataLabelsWrap: w, elGoalsMarkers: A, visibleSeries: this.visibleI, type: "rangebar" }) } s.add(p) } return s } }, { key: "detectOverlappingBars", value: function (t) { var e = t.i, i = t.j, a = t.barYPosition, s = t.barXPosition, r = t.srty, o = t.srtx, n = t.barHeight, l = t.barWidth, h = t.yDivision, c = t.xDivision, d = t.initPositions, g = this.w, u = [], f = g.config.series[e].data[i].rangeName, p = g.config.series[e].data[i].x, x = Array.isArray(p) ? p.join(" ") : p, b = g.globals.labels.map((function (t) { return Array.isArray(t) ? t.join(" ") : t })).indexOf(x), v = g.globals.seriesRange[e].findIndex((function (t) { return t.x === x && t.overlaps.length > 0 })); return this.isHorizontal ? (a = g.config.plotOptions.bar.rangeBarGroupRows ? r + h * b : r + n * this.visibleI + h * b, v > -1 && !g.config.plotOptions.bar.rangeBarOverlap && (u = g.globals.seriesRange[e][v].overlaps).indexOf(f) > -1 && (a = (n = d.barHeight / u.length) * this.visibleI + h * (100 - parseInt(this.barOptions.barHeight, 10)) / 100 / 2 + n * (this.visibleI + u.indexOf(f)) + h * b)) : (b > -1 && !g.globals.timescaleLabels.length && (s = g.config.plotOptions.bar.rangeBarGroupRows ? o + c * b : o + l * this.visibleI + c * b), v > -1 && !g.config.plotOptions.bar.rangeBarOverlap && (u = g.globals.seriesRange[e][v].overlaps).indexOf(f) > -1 && (s = (l = d.barWidth / u.length) * this.visibleI + c * (100 - parseInt(this.barOptions.barWidth, 10)) / 100 / 2 + l * (this.visibleI + u.indexOf(f)) + c * b)), { barYPosition: a, barXPosition: s, barHeight: n, barWidth: l } } }, { key: "drawRangeColumnPaths", value: function (t) { var e = t.indexes, i = t.x, a = t.xDivision, s = t.barWidth, r = t.barXPosition, o = t.zeroH, n = this.w, l = e.i, h = e.j, c = e.realIndex, d = e.translationsIndex, g = this.yRatio[d], u = this.getRangeValue(c, h), f = Math.min(u.start, u.end), p = Math.max(u.start, u.end); void 0 === this.series[l][h] || null === this.series[l][h] ? f = o : (f = o - f / g, p = o - p / g); var x = Math.abs(p - f), b = this.barHelpers.getColumnPaths({ barXPosition: r, barWidth: s, y1: f, y2: p, strokeWidth: this.strokeWidth, series: this.seriesRangeEnd, realIndex: c, i: c, j: h, w: n }); if (n.globals.isXNumeric) { var v = this.getBarXForNumericXAxis({ x: i, j: h, realIndex: c, barWidth: s }); i = v.x, r = v.barXPosition } else i += a; return { pathTo: b.pathTo, pathFrom: b.pathFrom, barHeight: x, x: i, y: u.start < 0 && u.end < 0 ? f : p, goalY: this.barHelpers.getGoalValues("y", null, o, l, h, d), barXPosition: r } } }, { key: "preventBarOverflow", value: function (t) { var e = this.w; return t < 0 && (t = 0), t > e.globals.gridWidth && (t = e.globals.gridWidth), t } }, { key: "drawRangeBarPaths", value: function (t) { var e = t.indexes, i = t.y, a = t.y1, s = t.y2, r = t.yDivision, o = t.barHeight, n = t.barYPosition, l = t.zeroW, h = this.w, c = e.realIndex, d = e.j, g = this.preventBarOverflow(l + a / this.invertedYRatio), u = this.preventBarOverflow(l + s / this.invertedYRatio), f = this.getRangeValue(c, d), p = Math.abs(u - g), x = this.barHelpers.getBarpaths({ barYPosition: n, barHeight: o, x1: g, x2: u, strokeWidth: this.strokeWidth, series: this.seriesRangeEnd, i: c, realIndex: c, j: d, w: h }); return h.globals.isXNumeric || (i += r), { pathTo: x.pathTo, pathFrom: x.pathFrom, barWidth: p, x: f.start < 0 && f.end < 0 ? g : u, goalX: this.barHelpers.getGoalValues("x", l, null, c, d), y: i } } }, { key: "getRangeValue", value: function (t, e) { var i = this.w; return { start: i.globals.seriesRangeStart[t][e], end: i.globals.seriesRangeEnd[t][e] } } }]), a }(), Yt = function () { function t(e) { i(this, t), this.w = e.w, this.lineCtx = e } return s(t, [{ key: "sameValueSeriesFix", value: function (t, e) { var i = this.w; if (("gradient" === i.config.fill.type || "gradient" === i.config.fill.type[t]) && new A(this.lineCtx.ctx, i).seriesHaveSameValues(t)) { var a = e[t].slice(); a[a.length - 1] = a[a.length - 1] + 1e-6, e[t] = a } return e } }, { key: "calculatePoints", value: function (t) { var e = t.series, i = t.realIndex, a = t.x, s = t.y, r = t.i, o = t.j, n = t.prevY, l = this.w, h = [], c = []; if (0 === o) { var d = this.lineCtx.categoryAxisCorrection + l.config.markers.offsetX; l.globals.isXNumeric && (d = (l.globals.seriesX[i][0] - l.globals.minX) / this.lineCtx.xRatio + l.config.markers.offsetX), h.push(d), c.push(m.isNumber(e[r][0]) ? n + l.config.markers.offsetY : null), h.push(a + l.config.markers.offsetX), c.push(m.isNumber(e[r][o + 1]) ? s + l.config.markers.offsetY : null) } else h.push(a + l.config.markers.offsetX), c.push(m.isNumber(e[r][o + 1]) ? s + l.config.markers.offsetY : null); return { x: h, y: c } } }, { key: "checkPreviousPaths", value: function (t) { for (var e = t.pathFromLine, i = t.pathFromArea, a = t.realIndex, s = this.w, r = 0; r < s.globals.previousPaths.length; r++) { var o = s.globals.previousPaths[r]; ("line" === o.type || "area" === o.type) && o.paths.length > 0 && parseInt(o.realIndex, 10) === parseInt(a, 10) && ("line" === o.type ? (this.lineCtx.appendPathFrom = !1, e = s.globals.previousPaths[r].paths[0].d) : "area" === o.type && (this.lineCtx.appendPathFrom = !1, i = s.globals.previousPaths[r].paths[0].d, s.config.stroke.show && s.globals.previousPaths[r].paths[1] && (e = s.globals.previousPaths[r].paths[1].d))) } return { pathFromLine: e, pathFromArea: i } } }, { key: "determineFirstPrevY", value: function (t) { var e, i, a, s = t.i, r = t.realIndex, o = t.series, n = t.prevY, l = t.lineYPosition, h = t.translationsIndex, c = this.w, d = c.config.chart.stacked && !c.globals.comboCharts || c.config.chart.stacked && c.globals.comboCharts && (!this.w.config.chart.stackOnlyBar || "bar" === (null === (e = this.w.config.series[r]) || void 0 === e ? void 0 : e.type) || "column" === (null === (i = this.w.config.series[r]) || void 0 === i ? void 0 : i.type)); if (void 0 !== (null === (a = o[s]) || void 0 === a ? void 0 : a[0])) n = (l = d && s > 0 ? this.lineCtx.prevSeriesY[s - 1][0] : this.lineCtx.zeroY) - o[s][0] / this.lineCtx.yRatio[h] + 2 * (this.lineCtx.isReversed ? o[s][0] / this.lineCtx.yRatio[h] : 0); else if (d && s > 0 && void 0 === o[s][0]) for (var g = s - 1; g >= 0; g--)if (null !== o[g][0] && void 0 !== o[g][0]) { n = l = this.lineCtx.prevSeriesY[g][0]; break } return { prevY: n, lineYPosition: l } } }]), t }(), Rt = function (t) { for (var e, i, a, s, r = function (t) { for (var e = [], i = t[0], a = t[1], s = e[0] = Ht(i, a), r = 1, o = t.length - 1; r < o; r++)i = a, a = t[r + 1], e[r] = .5 * (s + (s = Ht(i, a))); return e[r] = s, e }(t), o = t.length - 1, n = [], l = 0; l < o; l++)a = Ht(t[l], t[l + 1]), Math.abs(a) < 1e-6 ? r[l] = r[l + 1] = 0 : (s = (e = r[l] / a) * e + (i = r[l + 1] / a) * i) > 9 && (s = 3 * a / Math.sqrt(s), r[l] = s * e, r[l + 1] = s * i); for (var h = 0; h <= o; h++)s = (t[Math.min(o, h + 1)][0] - t[Math.max(0, h - 1)][0]) / (6 * (1 + r[h] * r[h])), n.push([s || 0, r[h] * s || 0]); return n }, Ft = function (t) { var e = Rt(t), i = t[1], a = t[0], s = [], r = e[1], o = e[0]; s.push(a, [a[0] + o[0], a[1] + o[1], i[0] - r[0], i[1] - r[1], i[0], i[1]]); for (var n = 2, l = e.length; n < l; n++) { var h = t[n], c = e[n]; s.push([h[0] - c[0], h[1] - c[1], h[0], h[1]]) } return s }, Dt = function (t, e, i) { var a = t.slice(e, i); if (e) { if (i - e > 1 && a[1].length < 6) { var s = a[0].length; a[1] = [2 * a[0][s - 2] - a[0][s - 4], 2 * a[0][s - 1] - a[0][s - 3]].concat(a[1]) } a[0] = a[0].slice(-2) } return a }; function Ht(t, e) { return (e[1] - t[1]) / (e[0] - t[0]) } var Ot = function () { function t(e, a, s) { i(this, t), this.ctx = e, this.w = e.w, this.xyRatios = a, this.pointsChart = !("bubble" !== this.w.config.chart.type && "scatter" !== this.w.config.chart.type) || s, this.scatter = new B(this.ctx), this.noNegatives = this.w.globals.minX === Number.MAX_VALUE, this.lineHelpers = new Yt(this), this.markers = new W(this.ctx), this.prevSeriesY = [], this.categoryAxisCorrection = 0, this.yaxisIndex = 0 } return s(t, [{ key: "draw", value: function (t, e, i, a) { var s, r = this.w, o = new k(this.ctx), n = r.globals.comboCharts ? e : r.config.chart.type, l = o.group({ class: "apexcharts-".concat(n, "-series apexcharts-plot-series") }), h = new A(this.ctx, r); this.yRatio = this.xyRatios.yRatio, this.zRatio = this.xyRatios.zRatio, this.xRatio = this.xyRatios.xRatio, this.baseLineY = this.xyRatios.baseLineY, t = h.getLogSeries(t), this.yRatio = h.getLogYRatios(this.yRatio), this.prevSeriesY = []; for (var c = [], d = 0; d < t.length; d++) { t = this.lineHelpers.sameValueSeriesFix(d, t); var u = r.globals.comboCharts ? i[d] : d, f = this.yRatio.length > 1 ? u : 0; this._initSerieVariables(t, d, u); var p = [], x = [], b = [], v = r.globals.padHorizontal + this.categoryAxisCorrection; this.ctx.series.addCollapsedClassToSeries(this.elSeries, u), r.globals.isXNumeric && r.globals.seriesX.length > 0 && (v = (r.globals.seriesX[u][0] - r.globals.minX) / this.xRatio), b.push(v); var m, y = v, w = void 0, S = y, C = this.zeroY, L = this.zeroY; C = this.lineHelpers.determineFirstPrevY({ i: d, realIndex: u, series: t, prevY: C, lineYPosition: 0, translationsIndex: f }).prevY, "monotoneCubic" === r.config.stroke.curve && null === t[d][0] ? p.push(null) : p.push(C), m = C; "rangeArea" === n && (w = L = this.lineHelpers.determineFirstPrevY({ i: d, realIndex: u, series: a, prevY: L, lineYPosition: 0, translationsIndex: f }).prevY, x.push(null !== p[0] ? L : null)); var P = this._calculatePathsFrom({ type: n, series: t, i: d, realIndex: u, translationsIndex: f, prevX: S, prevY: C, prevY2: L }), M = [p[0]], I = [x[0]], T = { type: n, series: t, realIndex: u, translationsIndex: f, i: d, x: v, y: 1, pX: y, pY: m, pathsFrom: P, linePaths: [], areaPaths: [], seriesIndex: i, lineYPosition: 0, xArrj: b, yArrj: p, y2Arrj: x, seriesRangeEnd: a }, z = this._iterateOverDataPoints(g(g({}, T), {}, { iterations: "rangeArea" === n ? t[d].length - 1 : void 0, isRangeStart: !0 })); if ("rangeArea" === n) { for (var X = this._calculatePathsFrom({ series: a, i: d, realIndex: u, prevX: S, prevY: L }), E = this._iterateOverDataPoints(g(g({}, T), {}, { series: a, xArrj: [v], yArrj: M, y2Arrj: I, pY: w, areaPaths: z.areaPaths, pathsFrom: X, iterations: a[d].length - 1, isRangeStart: !1 })), Y = z.linePaths.length / 2, R = 0; R < Y; R++)z.linePaths[R] = E.linePaths[R + Y] + z.linePaths[R]; z.linePaths.splice(Y), z.pathFromLine = E.pathFromLine + z.pathFromLine } else z.pathFromArea += "z"; this._handlePaths({ type: n, realIndex: u, i: d, paths: z }), this.elSeries.add(this.elPointsMain), this.elSeries.add(this.elDataLabelsWrap), c.push(this.elSeries) } if (void 0 !== (null === (s = r.config.series[0]) || void 0 === s ? void 0 : s.zIndex) && c.sort((function (t, e) { return Number(t.node.getAttribute("zIndex")) - Number(e.node.getAttribute("zIndex")) })), r.config.chart.stacked) for (var F = c.length - 1; F >= 0; F--)l.add(c[F]); else for (var D = 0; D < c.length; D++)l.add(c[D]); return l } }, { key: "_initSerieVariables", value: function (t, e, i) { var a = this.w, s = new k(this.ctx); this.xDivision = a.globals.gridWidth / (a.globals.dataPoints - ("on" === a.config.xaxis.tickPlacement ? 1 : 0)), this.strokeWidth = Array.isArray(a.config.stroke.width) ? a.config.stroke.width[i] : a.config.stroke.width; var r = 0; this.yRatio.length > 1 && (this.yaxisIndex = a.globals.seriesYAxisReverseMap[i], r = i), this.isReversed = a.config.yaxis[this.yaxisIndex] && a.config.yaxis[this.yaxisIndex].reversed, this.zeroY = a.globals.gridHeight - this.baseLineY[r] - (this.isReversed ? a.globals.gridHeight : 0) + (this.isReversed ? 2 * this.baseLineY[r] : 0), this.areaBottomY = this.zeroY, (this.zeroY > a.globals.gridHeight || "end" === a.config.plotOptions.area.fillTo) && (this.areaBottomY = a.globals.gridHeight), this.categoryAxisCorrection = this.xDivision / 2, this.elSeries = s.group({ class: "apexcharts-series", zIndex: void 0 !== a.config.series[i].zIndex ? a.config.series[i].zIndex : i, seriesName: m.escapeString(a.globals.seriesNames[i]) }), this.elPointsMain = s.group({ class: "apexcharts-series-markers-wrap", "data:realIndex": i }), this.elDataLabelsWrap = s.group({ class: "apexcharts-datalabels", "data:realIndex": i }); var o = t[e].length === a.globals.dataPoints; this.elSeries.attr({ "data:longestSeries": o, rel: e + 1, "data:realIndex": i }), this.appendPathFrom = !0 } }, { key: "_calculatePathsFrom", value: function (t) { var e, i, a, s, r = t.type, o = t.series, n = t.i, l = t.realIndex, h = t.translationsIndex, c = t.prevX, d = t.prevY, g = t.prevY2, u = this.w, f = new k(this.ctx); if (null === o[n][0]) { for (var p = 0; p < o[n].length; p++)if (null !== o[n][p]) { c = this.xDivision * p, d = this.zeroY - o[n][p] / this.yRatio[h], e = f.move(c, d), i = f.move(c, this.areaBottomY); break } } else e = f.move(c, d), "rangeArea" === r && (e = f.move(c, g) + f.line(c, d)), i = f.move(c, this.areaBottomY) + f.line(c, d); if (a = f.move(0, this.zeroY) + f.line(0, this.zeroY), s = f.move(0, this.zeroY) + f.line(0, this.zeroY), u.globals.previousPaths.length > 0) { var x = this.lineHelpers.checkPreviousPaths({ pathFromLine: a, pathFromArea: s, realIndex: l }); a = x.pathFromLine, s = x.pathFromArea } return { prevX: c, prevY: d, linePath: e, areaPath: i, pathFromLine: a, pathFromArea: s } } }, { key: "_handlePaths", value: function (t) { var e = t.type, i = t.realIndex, a = t.i, s = t.paths, r = this.w, o = new k(this.ctx), n = new N(this.ctx); this.prevSeriesY.push(s.yArrj), r.globals.seriesXvalues[i] = s.xArrj, r.globals.seriesYvalues[i] = s.yArrj; var l = r.config.forecastDataPoints; if (l.count > 0 && "rangeArea" !== e) { var h = r.globals.seriesXvalues[i][r.globals.seriesXvalues[i].length - l.count - 1], c = o.drawRect(h, 0, r.globals.gridWidth, r.globals.gridHeight, 0); r.globals.dom.elForecastMask.appendChild(c.node); var d = o.drawRect(0, 0, h, r.globals.gridHeight, 0); r.globals.dom.elNonForecastMask.appendChild(d.node) } this.pointsChart || r.globals.delayedElements.push({ el: this.elPointsMain.node, index: i }); var u = { i: a, realIndex: i, animationDelay: a, initialSpeed: r.config.chart.animations.speed, dataChangeSpeed: r.config.chart.animations.dynamicAnimation.speed, className: "apexcharts-".concat(e) }; if ("area" === e) for (var f = n.fillPath({ seriesNumber: i }), p = 0; p < s.areaPaths.length; p++) { var x = o.renderPaths(g(g({}, u), {}, { pathFrom: s.pathFromArea, pathTo: s.areaPaths[p], stroke: "none", strokeWidth: 0, strokeLineCap: null, fill: f })); this.elSeries.add(x) } if (r.config.stroke.show && !this.pointsChart) { var b = null; if ("line" === e) b = n.fillPath({ seriesNumber: i, i: a }); else if ("solid" === r.config.stroke.fill.type) b = r.globals.stroke.colors[i]; else { var v = r.config.fill; r.config.fill = r.config.stroke.fill, b = n.fillPath({ seriesNumber: i, i: a }), r.config.fill = v } for (var m = 0; m < s.linePaths.length; m++) { var y = b; "rangeArea" === e && (y = n.fillPath({ seriesNumber: i })); var w = g(g({}, u), {}, { pathFrom: s.pathFromLine, pathTo: s.linePaths[m], stroke: b, strokeWidth: this.strokeWidth, strokeLineCap: r.config.stroke.lineCap, fill: "rangeArea" === e ? y : "none" }), A = o.renderPaths(w); if (this.elSeries.add(A), A.attr("fill-rule", "evenodd"), l.count > 0 && "rangeArea" !== e) { var S = o.renderPaths(w); S.node.setAttribute("stroke-dasharray", l.dashArray), l.strokeWidth && S.node.setAttribute("stroke-width", l.strokeWidth), this.elSeries.add(S), S.attr("clip-path", "url(#forecastMask".concat(r.globals.cuid, ")")), A.attr("clip-path", "url(#nonForecastMask".concat(r.globals.cuid, ")")) } } } } }, { key: "_iterateOverDataPoints", value: function (t) { var e, i, a = this, s = t.type, r = t.series, o = t.iterations, n = t.realIndex, l = t.translationsIndex, h = t.i, c = t.x, d = t.y, g = t.pX, u = t.pY, f = t.pathsFrom, p = t.linePaths, x = t.areaPaths, b = t.seriesIndex, v = t.lineYPosition, y = t.xArrj, w = t.yArrj, A = t.y2Arrj, S = t.isRangeStart, C = t.seriesRangeEnd, L = this.w, P = new k(this.ctx), M = this.yRatio, I = f.prevY, T = f.linePath, z = f.areaPath, X = f.pathFromLine, E = f.pathFromArea, Y = m.isNumber(L.globals.minYArr[n]) ? L.globals.minYArr[n] : L.globals.minY; o || (o = L.globals.dataPoints > 1 ? L.globals.dataPoints - 1 : L.globals.dataPoints); var R = function (t, e) { return e - t / M[l] + 2 * (a.isReversed ? t / M[l] : 0) }, F = d, D = L.config.chart.stacked && !L.globals.comboCharts || L.config.chart.stacked && L.globals.comboCharts && (!this.w.config.chart.stackOnlyBar || "bar" === (null === (e = this.w.config.series[n]) || void 0 === e ? void 0 : e.type) || "column" === (null === (i = this.w.config.series[n]) || void 0 === i ? void 0 : i.type)), H = L.config.stroke.curve; Array.isArray(H) && (H = Array.isArray(b) ? H[b[h]] : H[h]); for (var O, N = 0, W = 0; W < o; W++) { var B = void 0 === r[h][W + 1] || null === r[h][W + 1]; if (L.globals.isXNumeric) { var G = L.globals.seriesX[n][W + 1]; void 0 === L.globals.seriesX[n][W + 1] && (G = L.globals.seriesX[n][o - 1]), c = (G - L.globals.minX) / this.xRatio } else c += this.xDivision; if (D) if (h > 0 && L.globals.collapsedSeries.length < L.config.series.length - 1) { v = this.prevSeriesY[function (t) { for (var e = t; e > 0; e--) { if (!(L.globals.collapsedSeriesIndices.indexOf((null == b ? void 0 : b[e]) || e) > -1)) return e; e-- } return 0 }(h - 1)][W + 1] } else v = this.zeroY; else v = this.zeroY; B ? d = R(Y, v) : (d = R(r[h][W + 1], v), "rangeArea" === s && (F = R(C[h][W + 1], v))), y.push(c), !B || "smooth" !== L.config.stroke.curve && "monotoneCubic" !== L.config.stroke.curve ? (w.push(d), A.push(F)) : (w.push(null), A.push(null)); var V = this.lineHelpers.calculatePoints({ series: r, x: c, y: d, realIndex: n, i: h, j: W, prevY: I }), j = this._createPaths({ type: s, series: r, i: h, realIndex: n, j: W, x: c, y: d, y2: F, xArrj: y, yArrj: w, y2Arrj: A, pX: g, pY: u, pathState: N, segmentStartX: O, linePath: T, areaPath: z, linePaths: p, areaPaths: x, curve: H, isRangeStart: S }); x = j.areaPaths, p = j.linePaths, g = j.pX, u = j.pY, N = j.pathState, O = j.segmentStartX, z = j.areaPath, T = j.linePath, !this.appendPathFrom || "monotoneCubic" === H && "rangeArea" === s || (X += P.line(c, this.zeroY), E += P.line(c, this.zeroY)), this.handleNullDataPoints(r, V, h, W, n), this._handleMarkersAndLabels({ type: s, pointsPos: V, i: h, j: W, realIndex: n, isRangeStart: S }) } return { yArrj: w, xArrj: y, pathFromArea: E, areaPaths: x, pathFromLine: X, linePaths: p, linePath: T, areaPath: z } } }, { key: "_handleMarkersAndLabels", value: function (t) { var e = t.type, i = t.pointsPos, a = t.isRangeStart, s = t.i, r = t.j, o = t.realIndex, n = this.w, l = new G(this.ctx); if (this.pointsChart) this.scatter.draw(this.elSeries, r, { realIndex: o, pointsPos: i, zRatio: this.zRatio, elParent: this.elPointsMain }); else { n.globals.series[s].length > 1 && this.elPointsMain.node.classList.add("apexcharts-element-hidden"); var h = this.markers.plotChartMarkers(i, o, r + 1); null !== h && this.elPointsMain.add(h) } var c = l.drawDataLabel({ type: e, isRangeStart: a, pos: i, i: o, j: r + 1 }); null !== c && this.elDataLabelsWrap.add(c) } }, { key: "_createPaths", value: function (t) { var e = t.type, i = t.series, a = t.i; t.realIndex; var s, r = t.j, o = t.x, n = t.y, l = t.xArrj, h = t.yArrj, c = t.y2, d = t.y2Arrj, g = t.pX, u = t.pY, f = t.pathState, p = t.segmentStartX, x = t.linePath, b = t.areaPath, v = t.linePaths, m = t.areaPaths, y = t.curve, w = t.isRangeStart, A = new k(this.ctx), S = this.areaBottomY, C = "rangeArea" === e, L = "rangeArea" === e && w; switch (y) { case "monotoneCubic": var P = w ? h : d; switch (f) { case 0: if (null === P[r + 1]) break; f = 1; case 1: if (!(C ? l.length === i[a].length : r === i[a].length - 2)) break; case 2: var M = w ? l : l.slice().reverse(), I = w ? P : P.slice().reverse(), T = (s = I, M.map((function (t, e) { return [t, s[e]] })).filter((function (t) { return null !== t[1] }))), z = T.length > 1 ? Ft(T) : T, X = []; C && (L ? m = T : X = m.reverse()); var E = 0, Y = 0; if (function (t, e) { for (var i = function (t) { var e = [], i = 0; return t.forEach((function (t) { null !== t ? i++ : i > 0 && (e.push(i), i = 0) })), i > 0 && e.push(i), e }(t), a = [], s = 0, r = 0; s < i.length; r += i[s++])a[s] = Dt(e, r, r + i[s]); return a }(I, z).forEach((function (t) { E++; var e = function (t) { for (var e = "", i = 0; i < t.length; i++) { var a = t[i], s = a.length; s > 4 ? (e += "C".concat(a[0], ", ").concat(a[1]), e += ", ".concat(a[2], ", ").concat(a[3]), e += ", ".concat(a[4], ", ").concat(a[5])) : s > 2 && (e += "S".concat(a[0], ", ").concat(a[1]), e += ", ".concat(a[2], ", ").concat(a[3])) } return e }(t), i = Y, a = (Y += t.length) - 1; L ? x = A.move(T[i][0], T[i][1]) + e : C ? x = A.move(X[i][0], X[i][1]) + A.line(T[i][0], T[i][1]) + e + A.line(X[a][0], X[a][1]) : (x = A.move(T[i][0], T[i][1]) + e, b = x + A.line(T[a][0], S) + A.line(T[i][0], S) + "z", m.push(b)), v.push(x) })), C && E > 1 && !L) { var R = v.slice(E).reverse(); v.splice(E), R.forEach((function (t) { return v.push(t) })) } f = 0 }break; case "smooth": var F = .35 * (o - g); if (null === i[a][r]) f = 0; else switch (f) { case 0: if (p = g, x = L ? A.move(g, d[r]) + A.line(g, u) : A.move(g, u), b = A.move(g, u), null === i[a][r + 1]) { v.push(x), m.push(b); break } if (f = 1, r < i[a].length - 2) { var D = A.curve(g + F, u, o - F, n, o, n); x += D, b += D; break } case 1: if (null === i[a][r + 1]) x += L ? A.line(g, c) : A.move(g, u), b += A.line(g, S) + A.line(p, S) + "z", v.push(x), m.push(b), f = -1; else { var H = A.curve(g + F, u, o - F, n, o, n); x += H, b += H, r >= i[a].length - 2 && (L && (x += A.curve(o, n, o, n, o, c) + A.move(o, c)), b += A.curve(o, n, o, n, o, S) + A.line(p, S) + "z", v.push(x), m.push(b), f = -1) } }g = o, u = n; break; default: var O = function (t, e, i) { var a = []; switch (t) { case "stepline": a = A.line(e, null, "H") + A.line(null, i, "V"); break; case "linestep": a = A.line(null, i, "V") + A.line(e, null, "H"); break; case "straight": a = A.line(e, i) }return a }; if (null === i[a][r]) f = 0; else switch (f) { case 0: if (p = g, x = L ? A.move(g, d[r]) + A.line(g, u) : A.move(g, u), b = A.move(g, u), null === i[a][r + 1]) { v.push(x), m.push(b); break } if (f = 1, r < i[a].length - 2) { var N = O(y, o, n); x += N, b += N; break } case 1: if (null === i[a][r + 1]) x += L ? A.line(g, c) : A.move(g, u), b += A.line(g, S) + A.line(p, S) + "z", v.push(x), m.push(b), f = -1; else { var W = O(y, o, n); x += W, b += W, r >= i[a].length - 2 && (L && (x += A.line(o, c)), b += A.line(o, S) + A.line(p, S) + "z", v.push(x), m.push(b), f = -1) } }g = o, u = n }return { linePaths: v, areaPaths: m, pX: g, pY: u, pathState: f, segmentStartX: p, linePath: x, areaPath: b } } }, { key: "handleNullDataPoints", value: function (t, e, i, a, s) { var r = this.w; if (null === t[i][a] && r.config.markers.showNullDataPoints || 1 === t[i].length) { var o = this.strokeWidth - r.config.markers.strokeWidth / 2; o > 0 || (o = 0); var n = this.markers.plotChartMarkers(e, s, a + 1, o, !0); null !== n && this.elPointsMain.add(n) } } }]), t }(); window.TreemapSquared = {}, window.TreemapSquared.generate = function () { function t(e, i, a, s) { this.xoffset = e, this.yoffset = i, this.height = s, this.width = a, this.shortestEdge = function () { return Math.min(this.height, this.width) }, this.getCoordinates = function (t) { var e, i = [], a = this.xoffset, s = this.yoffset, o = r(t) / this.height, n = r(t) / this.width; if (this.width >= this.height) for (e = 0; e < t.length; e++)i.push([a, s, a + o, s + t[e] / o]), s += t[e] / o; else for (e = 0; e < t.length; e++)i.push([a, s, a + t[e] / n, s + n]), a += t[e] / n; return i }, this.cutArea = function (e) { var i; if (this.width >= this.height) { var a = e / this.height, s = this.width - a; i = new t(this.xoffset + a, this.yoffset, s, this.height) } else { var r = e / this.width, o = this.height - r; i = new t(this.xoffset, this.yoffset + r, this.width, o) } return i } } function e(e, a, s, o, n) { o = void 0 === o ? 0 : o, n = void 0 === n ? 0 : n; var l = i(function (t, e) { var i, a = [], s = e / r(t); for (i = 0; i < t.length; i++)a[i] = t[i] * s; return a }(e, a * s), [], new t(o, n, a, s), []); return function (t) { var e, i, a = []; for (e = 0; e < t.length; e++)for (i = 0; i < t[e].length; i++)a.push(t[e][i]); return a }(l) } function i(t, e, s, o) { var n, l, h; if (0 !== t.length) return n = s.shortestEdge(), function (t, e, i) { var s; if (0 === t.length) return !0; (s = t.slice()).push(e); var r = a(t, i), o = a(s, i); return r >= o }(e, l = t[0], n) ? (e.push(l), i(t.slice(1), e, s, o)) : (h = s.cutArea(r(e), o), o.push(s.getCoordinates(e)), i(t, [], h, o)), o; o.push(s.getCoordinates(e)) } function a(t, e) { var i = Math.min.apply(Math, t), a = Math.max.apply(Math, t), s = r(t); return Math.max(Math.pow(e, 2) * a / Math.pow(s, 2), Math.pow(s, 2) / (Math.pow(e, 2) * i)) } function s(t) { return t && t.constructor === Array } function r(t) { var e, i = 0; for (e = 0; e < t.length; e++)i += t[e]; return i } function o(t) { var e, i = 0; if (s(t[0])) for (e = 0; e < t.length; e++)i += o(t[e]); else i = r(t); return i } return function t(i, a, r, n, l) { n = void 0 === n ? 0 : n, l = void 0 === l ? 0 : l; var h, c, d = [], g = []; if (s(i[0])) { for (c = 0; c < i.length; c++)d[c] = o(i[c]); for (h = e(d, a, r, n, l), c = 0; c < i.length; c++)g.push(t(i[c], h[c][2] - h[c][0], h[c][3] - h[c][1], h[c][0], h[c][1])) } else g = e(i, a, r, n, l); return g } }(); var Nt, Wt, Bt = function () { function t(e, a) { i(this, t), this.ctx = e, this.w = e.w, this.strokeWidth = this.w.config.stroke.width, this.helpers = new Pt(e), this.dynamicAnim = this.w.config.chart.animations.dynamicAnimation, this.labels = [] } return s(t, [{ key: "draw", value: function (t) { var e = this, i = this.w, a = new k(this.ctx), s = new N(this.ctx), r = a.group({ class: "apexcharts-treemap" }); if (i.globals.noData) return r; var o = []; return t.forEach((function (t) { var e = t.map((function (t) { return Math.abs(t) })); o.push(e) })), this.negRange = this.helpers.checkColorRange(), i.config.series.forEach((function (t, i) { t.data.forEach((function (t) { Array.isArray(e.labels[i]) || (e.labels[i] = []), e.labels[i].push(t.x) })) })), window.TreemapSquared.generate(o, i.globals.gridWidth, i.globals.gridHeight).forEach((function (o, n) { var l = a.group({ class: "apexcharts-series apexcharts-treemap-series", seriesName: m.escapeString(i.globals.seriesNames[n]), rel: n + 1, "data:realIndex": n }); if (i.config.chart.dropShadow.enabled) { var h = i.config.chart.dropShadow; new w(e.ctx).dropShadow(r, h, n) } var c = a.group({ class: "apexcharts-data-labels" }); o.forEach((function (r, o) { var h = r[0], c = r[1], d = r[2], g = r[3], u = a.drawRect(h, c, d - h, g - c, i.config.plotOptions.treemap.borderRadius, "#fff", 1, e.strokeWidth, i.config.plotOptions.treemap.useFillColorAsStroke ? p : i.globals.stroke.colors[n]); u.attr({ cx: h, cy: c, index: n, i: n, j: o, width: d - h, height: g - c }); var f = e.helpers.getShadeColor(i.config.chart.type, n, o, e.negRange), p = f.color; void 0 !== i.config.series[n].data[o] && i.config.series[n].data[o].fillColor && (p = i.config.series[n].data[o].fillColor); var x = s.fillPath({ color: p, seriesNumber: n, dataPointIndex: o }); u.node.classList.add("apexcharts-treemap-rect"), u.attr({ fill: x }), e.helpers.addListeners(u); var b = { x: h + (d - h) / 2, y: c + (g - c) / 2, width: 0, height: 0 }, v = { x: h, y: c, width: d - h, height: g - c }; if (i.config.chart.animations.enabled && !i.globals.dataChanged) { var m = 1; i.globals.resized || (m = i.config.chart.animations.speed), e.animateTreemap(u, b, v, m) } if (i.globals.dataChanged) { var y = 1; e.dynamicAnim.enabled && i.globals.shouldAnimate && (y = e.dynamicAnim.speed, i.globals.previousPaths[n] && i.globals.previousPaths[n][o] && i.globals.previousPaths[n][o].rect && (b = i.globals.previousPaths[n][o].rect), e.animateTreemap(u, b, v, y)) } var w = e.getFontSize(r), k = i.config.dataLabels.formatter(e.labels[n][o], { value: i.globals.series[n][o], seriesIndex: n, dataPointIndex: o, w: i }); "truncate" === i.config.plotOptions.treemap.dataLabels.format && (w = parseInt(i.config.dataLabels.style.fontSize, 10), k = e.truncateLabels(k, w, h, c, d, g)); var A = null; i.globals.series[n][o] && (A = e.helpers.calculateDataLabels({ text: k, x: (h + d) / 2, y: (c + g) / 2 + e.strokeWidth / 2 + w / 3, i: n, j: o, colorProps: f, fontSize: w, series: t })), i.config.dataLabels.enabled && A && e.rotateToFitLabel(A, w, k, h, c, d, g), l.add(u), null !== A && l.add(A) })), l.add(c), r.add(l) })), r } }, { key: "getFontSize", value: function (t) { var e = this.w; var i, a, s, r, o = function t(e) { var i, a = 0; if (Array.isArray(e[0])) for (i = 0; i < e.length; i++)a += t(e[i]); else for (i = 0; i < e.length; i++)a += e[i].length; return a }(this.labels) / function t(e) { var i, a = 0; if (Array.isArray(e[0])) for (i = 0; i < e.length; i++)a += t(e[i]); else for (i = 0; i < e.length; i++)a += 1; return a }(this.labels); return i = t[2] - t[0], a = t[3] - t[1], s = i * a, r = Math.pow(s, .5), Math.min(r / o, parseInt(e.config.dataLabels.style.fontSize, 10)) } }, { key: "rotateToFitLabel", value: function (t, e, i, a, s, r, o) { var n = new k(this.ctx), l = n.getTextRects(i, e); if (l.width + this.w.config.stroke.width + 5 > r - a && l.width <= o - s) { var h = n.rotateAroundCenter(t.node); t.node.setAttribute("transform", "rotate(-90 ".concat(h.x, " ").concat(h.y, ") translate(").concat(l.height / 3, ")")) } } }, { key: "truncateLabels", value: function (t, e, i, a, s, r) { var o = new k(this.ctx), n = o.getTextRects(t, e).width + this.w.config.stroke.width + 5 > s - i && r - a > s - i ? r - a : s - i, l = o.getTextBasedOnMaxWidth({ text: t, maxWidth: n, fontSize: e }); return t.length !== l.length && n / e < 5 ? "" : l } }, { key: "animateTreemap", value: function (t, e, i, a) { var s = new y(this.ctx); s.animateRect(t, { x: e.x, y: e.y, width: e.width, height: e.height }, { x: i.x, y: i.y, width: i.width, height: i.height }, a, (function () { s.animationCompleted(t) })) } }]), t }(), Gt = 86400, Vt = 10 / Gt, jt = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w, this.timeScaleArray = [], this.utc = this.w.config.xaxis.labels.datetimeUTC } return s(t, [{ key: "calculateTimeScaleTicks", value: function (t, e) { var i = this, a = this.w; if (a.globals.allSeriesCollapsed) return a.globals.labels = [], a.globals.timescaleLabels = [], []; var s = new L(this.ctx), r = (e - t) / 864e5; this.determineInterval(r), a.globals.disableZoomIn = !1, a.globals.disableZoomOut = !1, r < Vt ? a.globals.disableZoomIn = !0 : r > 5e4 && (a.globals.disableZoomOut = !0); var o = s.getTimeUnitsfromTimestamp(t, e, this.utc), n = a.globals.gridWidth / r, l = n / 24, h = l / 60, c = h / 60, d = Math.floor(24 * r), u = Math.floor(1440 * r), f = Math.floor(r * Gt), p = Math.floor(r), x = Math.floor(r / 30), b = Math.floor(r / 365), v = { minMillisecond: o.minMillisecond, minSecond: o.minSecond, minMinute: o.minMinute, minHour: o.minHour, minDate: o.minDate, minMonth: o.minMonth, minYear: o.minYear }, m = { firstVal: v, currentMillisecond: v.minMillisecond, currentSecond: v.minSecond, currentMinute: v.minMinute, currentHour: v.minHour, currentMonthDate: v.minDate, currentDate: v.minDate, currentMonth: v.minMonth, currentYear: v.minYear, daysWidthOnXAxis: n, hoursWidthOnXAxis: l, minutesWidthOnXAxis: h, secondsWidthOnXAxis: c, numberOfSeconds: f, numberOfMinutes: u, numberOfHours: d, numberOfDays: p, numberOfMonths: x, numberOfYears: b }; switch (this.tickInterval) { case "years": this.generateYearScale(m); break; case "months": case "half_year": this.generateMonthScale(m); break; case "months_days": case "months_fortnight": case "days": case "week_days": this.generateDayScale(m); break; case "hours": this.generateHourScale(m); break; case "minutes_fives": case "minutes": this.generateMinuteScale(m); break; case "seconds_tens": case "seconds_fives": case "seconds": this.generateSecondScale(m) }var y = this.timeScaleArray.map((function (t) { var 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 ? g(g({}, e), {}, { day: 1, value: t.value + 1 }) : "day" === t.unit || "hour" === t.unit ? g(g({}, e), {}, { value: t.value }) : "minute" === t.unit ? g(g({}, e), {}, { value: t.value, minute: t.value }) : "second" === t.unit ? g(g({}, e), {}, { value: t.value, minute: t.minute, second: t.second }) : t })); return y.filter((function (t) { var e = 1, s = Math.ceil(a.globals.gridWidth / 120), r = t.value; void 0 !== a.config.xaxis.tickAmount && (s = a.config.xaxis.tickAmount), y.length > s && (e = Math.floor(y.length / s)); var o = !1, n = !1; switch (i.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 === r && (n = !0); break; case "months_days": e = 10, "month" === t.unit && (o = !0), 30 === r && (n = !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": r % 5 != 0 && (n = !0); break; case "seconds_tens": r % 10 != 0 && (n = !0) }if ("hours" === i.tickInterval || "minutes_fives" === i.tickInterval || "seconds_tens" === i.tickInterval || "seconds_fives" === i.tickInterval) { if (!n) return !0 } else if ((r % e == 0 || o) && !n) return !0 })) } }, { key: "recalcDimensionsBasedOnFormat", value: function (t, e) { var i = this.w, a = this.formatDates(t), s = this.removeOverlappingTS(a); i.globals.timescaleLabels = s.slice(), new ct(this.ctx).plotCoords() } }, { key: "determineInterval", value: function (t) { var e = 24 * t, i = 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 i > 15: this.tickInterval = "minutes_fives"; break; case i > 5: this.tickInterval = "minutes"; break; case i > 1: this.tickInterval = "seconds_tens"; break; case 60 * i > 20: this.tickInterval = "seconds_fives"; break; default: this.tickInterval = "seconds" } } }, { key: "generateYearScale", value: function (t) { var e = t.firstVal, i = t.currentMonth, a = t.currentYear, s = t.daysWidthOnXAxis, r = t.numberOfYears, o = e.minYear, n = 0, l = new L(this.ctx), h = "year"; if (e.minDate > 1 || e.minMonth > 0) { var c = l.determineRemainingDaysOfYear(e.minYear, e.minMonth, e.minDate); n = (l.determineDaysOfYear(e.minYear) - c + 1) * s, o = e.minYear + 1, this.timeScaleArray.push({ position: n, value: o, unit: h, year: o, month: m.monthMod(i + 1) }) } else 1 === e.minDate && 0 === e.minMonth && this.timeScaleArray.push({ position: n, value: o, unit: h, year: a, month: m.monthMod(i + 1) }); for (var d = o, g = n, u = 0; u < r; u++)d++, g = l.determineDaysOfYear(d - 1) * s + g, this.timeScaleArray.push({ position: g, value: d, unit: h, year: d, month: 1 }) } }, { key: "generateMonthScale", value: function (t) { var e = t.firstVal, i = t.currentMonthDate, a = t.currentMonth, s = t.currentYear, r = t.daysWidthOnXAxis, o = t.numberOfMonths, n = a, l = 0, h = new L(this.ctx), c = "month", d = 0; if (e.minDate > 1) { l = (h.determineDaysOfMonths(a + 1, e.minYear) - i + 1) * r, n = m.monthMod(a + 1); var g = s + d, u = m.monthMod(n), f = n; 0 === n && (c = "year", f = g, u = 1, g += d += 1), this.timeScaleArray.push({ position: l, value: f, unit: c, year: g, month: u }) } else this.timeScaleArray.push({ position: l, value: n, unit: c, year: s, month: m.monthMod(a) }); for (var p = n + 1, x = l, b = 0, v = 1; b < o; b++, v++) { 0 === (p = m.monthMod(p)) ? (c = "year", d += 1) : c = "month"; var y = this._getYear(s, p, d); x = h.determineDaysOfMonths(p, y) * r + x; var w = 0 === p ? y : p; this.timeScaleArray.push({ position: x, value: w, unit: c, year: y, month: 0 === p ? 1 : p }), p++ } } }, { key: "generateDayScale", value: function (t) { var e = t.firstVal, i = t.currentMonth, a = t.currentYear, s = t.hoursWidthOnXAxis, r = t.numberOfDays, o = new L(this.ctx), n = "day", l = e.minDate + 1, h = l, c = function (t, e, i) { return t > o.determineDaysOfMonths(e + 1, i) ? (h = 1, n = "month", g = e += 1, e) : e }, d = (24 - e.minHour) * s, g = l, u = c(h, i, a); 0 === e.minHour && 1 === e.minDate ? (d = 0, g = m.monthMod(e.minMonth), n = "month", h = e.minDate) : 1 !== e.minDate && 0 === e.minHour && 0 === e.minMinute && (d = 0, l = e.minDate, g = l, u = c(h = l, i, a)), this.timeScaleArray.push({ position: d, value: g, unit: n, year: this._getYear(a, u, 0), month: m.monthMod(u), day: h }); for (var f = d, p = 0; p < r; p++) { n = "day", u = c(h += 1, u, this._getYear(a, u, 0)); var x = this._getYear(a, u, 0); f = 24 * s + f; var b = 1 === h ? m.monthMod(u) : h; this.timeScaleArray.push({ position: f, value: b, unit: n, year: x, month: m.monthMod(u), day: b }) } } }, { key: "generateHourScale", value: function (t) { var e = t.firstVal, i = t.currentDate, a = t.currentMonth, s = t.currentYear, r = t.minutesWidthOnXAxis, o = t.numberOfHours, n = new L(this.ctx), l = "hour", h = function (t, e) { return t > n.determineDaysOfMonths(e + 1, s) && (p = 1, e += 1), { month: e, date: p } }, c = function (t, e) { return t > n.determineDaysOfMonths(e + 1, s) ? e += 1 : e }, d = 60 - (e.minMinute + e.minSecond / 60), g = d * r, u = e.minHour + 1, f = u; 60 === d && (g = 0, f = u = e.minHour); var p = i; f >= 24 && (f = 0, p += 1, l = "day"); var x = h(p, a).month; x = c(p, x), this.timeScaleArray.push({ position: g, value: u, unit: l, day: p, hour: f, year: s, month: m.monthMod(x) }), f++; for (var b = g, v = 0; v < o; v++) { if (l = "hour", f >= 24) f = 0, l = "day", x = h(p += 1, x).month, x = c(p, x); var y = this._getYear(s, x, 0); b = 60 * r + b; var w = 0 === f ? p : f; this.timeScaleArray.push({ position: b, value: w, unit: l, hour: f, day: p, year: y, month: m.monthMod(x) }), f++ } } }, { key: "generateMinuteScale", value: function (t) { for (var e = t.currentMillisecond, i = t.currentSecond, a = t.currentMinute, s = t.currentHour, r = t.currentDate, o = t.currentMonth, n = t.currentYear, l = t.minutesWidthOnXAxis, h = t.secondsWidthOnXAxis, c = t.numberOfMinutes, d = a + 1, g = r, u = o, f = n, p = s, x = (60 - i - e / 1e3) * h, b = 0; b < c; b++)d >= 60 && (d = 0, 24 === (p += 1) && (p = 0)), this.timeScaleArray.push({ position: x, value: d, unit: "minute", hour: p, minute: d, day: g, year: this._getYear(f, u, 0), month: m.monthMod(u) }), x += l, d++ } }, { key: "generateSecondScale", value: function (t) { for (var e = t.currentMillisecond, i = t.currentSecond, a = t.currentMinute, s = t.currentHour, r = t.currentDate, o = t.currentMonth, n = t.currentYear, l = t.secondsWidthOnXAxis, h = t.numberOfSeconds, c = i + 1, d = a, g = r, u = o, f = n, p = s, x = (1e3 - e) / 1e3 * l, b = 0; b < h; b++)c >= 60 && (c = 0, ++d >= 60 && (d = 0, 24 === ++p && (p = 0))), this.timeScaleArray.push({ position: x, value: c, unit: "second", hour: p, minute: d, second: c, day: g, year: this._getYear(f, u, 0), month: m.monthMod(u) }), x += l, c++ } }, { key: "createRawDateString", value: function (t, e) { var i = t.year; return 0 === t.month && (t.month = 1), i += "-" + ("0" + t.month.toString()).slice(-2), "day" === t.unit ? i += "day" === t.unit ? "-" + ("0" + e).slice(-2) : "-01" : i += "-" + ("0" + (t.day ? t.day : "1")).slice(-2), "hour" === t.unit ? i += "hour" === t.unit ? "T" + ("0" + e).slice(-2) : "T00" : i += "T" + ("0" + (t.hour ? t.hour : "0")).slice(-2), "minute" === t.unit ? i += ":" + ("0" + e).slice(-2) : i += ":" + (t.minute ? ("0" + t.minute).slice(-2) : "00"), "second" === t.unit ? i += ":" + ("0" + e).slice(-2) : i += ":00", this.utc && (i += ".000Z"), i } }, { key: "formatDates", value: function (t) { var e = this, i = this.w; return t.map((function (t) { var a = t.value.toString(), s = new L(e.ctx), r = e.createRawDateString(t, a), o = s.getDate(s.parseDate(r)); if (e.utc || (o = s.getDate(s.parseDateWithTimezone(r))), void 0 === i.config.xaxis.labels.format) { var n = "dd MMM", l = i.config.xaxis.labels.datetimeFormatter; "year" === t.unit && (n = l.year), "month" === t.unit && (n = l.month), "day" === t.unit && (n = l.day), "hour" === t.unit && (n = l.hour), "minute" === t.unit && (n = l.minute), "second" === t.unit && (n = l.second), a = s.formatDate(o, n) } else a = s.formatDate(o, i.config.xaxis.labels.format); return { dateString: r, position: t.position, value: a, unit: t.unit, year: t.year, month: t.month } })) } }, { key: "removeOverlappingTS", value: function (t) { var e, i = this, a = new k(this.ctx), s = !1; t.length > 0 && t[0].value && t.every((function (e) { return e.value.length === t[0].value.length })) && (s = !0, e = a.getTextRects(t[0].value).width); var r = 0, o = t.map((function (o, n) { if (n > 0 && i.w.config.xaxis.labels.hideOverlappingLabels) { var l = s ? e : a.getTextRects(t[r].value).width, h = t[r].position; return o.position > h + l + 10 ? (r = n, o) : null } return o })); return o = o.filter((function (t) { return null !== t })) } }, { key: "_getYear", value: function (t, e, i) { return t + Math.floor(e / 12) + i } }]), t }(), _t = function () { function t(e, a) { i(this, t), this.ctx = a, this.w = a.w, this.el = e } return s(t, [{ key: "setupElements", value: function () { var t = this.w, e = t.globals, i = t.config, a = i.chart.type; e.axisCharts = ["line", "area", "bar", "rangeBar", "rangeArea", "candlestick", "boxPlot", "scatter", "bubble", "radar", "heatmap", "treemap"].includes(a), e.xyCharts = ["line", "area", "bar", "rangeBar", "rangeArea", "candlestick", "boxPlot", "scatter", "bubble"].includes(a), e.isBarHorizontal = ["bar", "rangeBar", "boxPlot"].includes(a) && i.plotOptions.bar.horizontal, e.chartClass = ".apexcharts".concat(e.chartID), e.dom.baseEl = this.el, e.dom.elWrap = document.createElement("div"), k.setAttrs(e.dom.elWrap, { id: e.chartClass.substring(1), class: "apexcharts-canvas ".concat(e.chartClass.substring(1)) }), this.el.appendChild(e.dom.elWrap), e.dom.Paper = new window.SVG.Doc(e.dom.elWrap), e.dom.Paper.attr({ class: "apexcharts-svg", "xmlns:data": "ApexChartsNS", transform: "translate(".concat(i.chart.offsetX, ", ").concat(i.chart.offsetY, ")") }), e.dom.Paper.node.style.background = "dark" !== i.theme.mode || i.chart.background ? "light" !== i.theme.mode || i.chart.background ? i.chart.background : "#fff" : "#424242", this.setSVGDimensions(), e.dom.elLegendForeign = document.createElementNS(e.SVGNS, "foreignObject"), k.setAttrs(e.dom.elLegendForeign, { x: 0, y: 0, width: e.svgWidth, height: e.svgHeight }), e.dom.elLegendWrap = document.createElement("div"), e.dom.elLegendWrap.classList.add("apexcharts-legend"), e.dom.elLegendWrap.setAttribute("xmlns", "http://www.w3.org/1999/xhtml"), e.dom.elLegendForeign.appendChild(e.dom.elLegendWrap), e.dom.Paper.node.appendChild(e.dom.elLegendForeign), e.dom.elGraphical = e.dom.Paper.group().attr({ class: "apexcharts-inner apexcharts-graphical" }), e.dom.elDefs = e.dom.Paper.defs(), e.dom.Paper.add(e.dom.elGraphical), e.dom.elGraphical.add(e.dom.elDefs) } }, { key: "plotChartType", value: function (t, e) { var i = this.w, a = this.ctx, s = i.config, r = i.globals, o = { line: { series: [], i: [] }, area: { series: [], i: [] }, scatter: { series: [], i: [] }, bubble: { series: [], i: [] }, column: { series: [], i: [] }, candlestick: { series: [], i: [] }, boxPlot: { series: [], i: [] }, rangeBar: { series: [], i: [] }, rangeArea: { series: [], seriesRangeEnd: [], i: [] } }, n = s.chart.type || "line", l = null, h = 0; r.series.forEach((function (e, a) { var s = t[a].type || n; o[s] ? ("rangeArea" === s ? (o[s].series.push(r.seriesRangeStart[a]), o[s].seriesRangeEnd.push(r.seriesRangeEnd[a])) : o[s].series.push(e), o[s].i.push(a), "column" !== s && "bar" !== s || (i.globals.columnSeries = o.column)) : ["heatmap", "treemap", "pie", "donut", "polarArea", "radialBar", "radar"].includes(s) ? l = s : "bar" === s ? (o.column.series.push(e), o.column.i.push(a)) : console.warn("You have specified an unrecognized series type (".concat(s, ").")), n !== s && "scatter" !== s && h++ })), h > 0 && (l && console.warn("Chart or series type ".concat(l, " cannot appear with other chart or series types.")), o.column.series.length > 0 && s.plotOptions.bar.horizontal && (h -= o.column.series.length, o.column = { series: [], i: [] }, i.globals.columnSeries = { series: [], i: [] }, console.warn("Horizontal bars are not supported in a mixed/combo chart. Please turn off `plotOptions.bar.horizontal`"))), r.comboCharts || (r.comboCharts = h > 0); var c = new Ot(a, e), d = new Lt(a, e); a.pie = new Tt(a); var g = new Xt(a); a.rangeBar = new Et(a, e); var u = new zt(a), f = []; if (r.comboCharts) { var x, b, v = new A(a); if (o.area.series.length > 0) (x = f).push.apply(x, p(v.drawSeriesByGroup(o.area, r.areaGroups, "area", c))); if (o.column.series.length > 0) if (s.chart.stacked) { var m = new Ct(a, e); f.push(m.draw(o.column.series, o.column.i)) } else a.bar = new St(a, e), f.push(a.bar.draw(o.column.series, o.column.i)); if (o.rangeArea.series.length > 0 && f.push(c.draw(o.rangeArea.series, "rangeArea", o.rangeArea.i, o.rangeArea.seriesRangeEnd)), o.line.series.length > 0) (b = f).push.apply(b, p(v.drawSeriesByGroup(o.line, r.lineGroups, "line", c))); if (o.candlestick.series.length > 0 && f.push(d.draw(o.candlestick.series, "candlestick", o.candlestick.i)), o.boxPlot.series.length > 0 && f.push(d.draw(o.boxPlot.series, "boxPlot", o.boxPlot.i)), o.rangeBar.series.length > 0 && f.push(a.rangeBar.draw(o.rangeBar.series, o.rangeBar.i)), o.scatter.series.length > 0) { var y = new Ot(a, e, !0); f.push(y.draw(o.scatter.series, "scatter", o.scatter.i)) } if (o.bubble.series.length > 0) { var w = new Ot(a, e, !0); f.push(w.draw(o.bubble.series, "bubble", o.bubble.i)) } } else switch (s.chart.type) { case "line": f = c.draw(r.series, "line"); break; case "area": f = c.draw(r.series, "area"); break; case "bar": if (s.chart.stacked) f = new Ct(a, e).draw(r.series); else a.bar = new St(a, e), f = a.bar.draw(r.series); break; case "candlestick": f = new Lt(a, e).draw(r.series, "candlestick"); break; case "boxPlot": f = new Lt(a, e).draw(r.series, s.chart.type); break; case "rangeBar": f = a.rangeBar.draw(r.series); break; case "rangeArea": f = c.draw(r.seriesRangeStart, "rangeArea", void 0, r.seriesRangeEnd); break; case "heatmap": f = new Mt(a, e).draw(r.series); break; case "treemap": f = new Bt(a, e).draw(r.series); break; case "pie": case "donut": case "polarArea": f = a.pie.draw(r.series); break; case "radialBar": f = g.draw(r.series); break; case "radar": f = u.draw(r.series); break; default: f = c.draw(r.series) }return f } }, { key: "setSVGDimensions", value: function () { var t = this.w, e = t.globals, i = t.config; i.chart.width = i.chart.width || "100%", i.chart.height = i.chart.height || "auto", e.svgWidth = i.chart.width, e.svgHeight = i.chart.height; var a = m.getDimensions(this.el), s = i.chart.width.toString().split(/[0-9]+/g).pop(); "%" === s ? m.isNumber(a[0]) && (0 === a[0].width && (a = m.getDimensions(this.el.parentNode)), e.svgWidth = a[0] * parseInt(i.chart.width, 10) / 100) : "px" !== s && "" !== s || (e.svgWidth = parseInt(i.chart.width, 10)); var r = String(i.chart.height).toString().split(/[0-9]+/g).pop(); if ("auto" !== e.svgHeight && "" !== e.svgHeight) if ("%" === r) { var o = m.getDimensions(this.el.parentNode); e.svgHeight = o[1] * parseInt(i.chart.height, 10) / 100 } else e.svgHeight = parseInt(i.chart.height, 10); else e.svgHeight = e.axisCharts ? e.svgWidth / 1.61 : e.svgWidth / 1.2; if (e.svgWidth = Math.max(e.svgWidth, 0), e.svgHeight = Math.max(e.svgHeight, 0), k.setAttrs(e.dom.Paper.node, { width: e.svgWidth, height: e.svgHeight }), "%" !== r) { var n = i.chart.sparkline.enabled ? 0 : e.axisCharts ? i.chart.parentHeightOffset : 0; e.dom.Paper.node.parentNode.parentNode.style.minHeight = "".concat(e.svgHeight + n, "px") } e.dom.elWrap.style.width = "".concat(e.svgWidth, "px"), e.dom.elWrap.style.height = "".concat(e.svgHeight, "px") } }, { key: "shiftGraphPosition", value: function () { var t = this.w.globals, e = t.translateY, i = t.translateX; k.setAttrs(t.dom.elGraphical.node, { transform: "translate(".concat(i, ", ").concat(e, ")") }) } }, { key: "resizeNonAxisCharts", value: function () { var t = this.w, e = t.globals, i = 0, a = t.config.chart.sparkline.enabled ? 1 : 15; a += t.config.grid.padding.bottom, ["top", "bottom"].includes(t.config.legend.position) && t.config.legend.show && !t.config.legend.floating && (i = new gt(this.ctx).legendHelpers.getLegendDimensions().clwh + 7); var s = t.globals.dom.baseEl.querySelector(".apexcharts-radialbar, .apexcharts-pie"), r = 2.05 * t.globals.radialSize; if (s && !t.config.chart.sparkline.enabled && 0 !== t.config.plotOptions.radialBar.startAngle) { var o = m.getBoundingClientRect(s); r = o.bottom; var n = o.bottom - o.top; r = Math.max(2.05 * t.globals.radialSize, n) } var l = Math.ceil(r + e.translateY + i + a); e.dom.elLegendForeign && e.dom.elLegendForeign.setAttribute("height", l), t.config.chart.height && String(t.config.chart.height).includes("%") || (e.dom.elWrap.style.height = "".concat(l, "px"), k.setAttrs(e.dom.Paper.node, { height: l }), e.dom.Paper.node.parentNode.parentNode.style.minHeight = "".concat(l, "px")) } }, { key: "coreCalculations", value: function () { new J(this.ctx).init() } }, { key: "resetGlobals", value: function () { var t = this, e = function () { return t.w.config.series.map((function () { return [] })) }, i = new H, a = this.w.globals; i.initGlobalVars(a), a.seriesXvalues = e(), a.seriesYvalues = e() } }, { key: "isMultipleY", value: function () { return !!(Array.isArray(this.w.config.yaxis) && this.w.config.yaxis.length > 1) && (this.w.globals.isMultipleYAxis = !0, !0) } }, { key: "xySettings", value: function () { var t = this.w, e = null; if (t.globals.axisCharts) { if ("back" === t.config.xaxis.crosshairs.position && new it(this.ctx).drawXCrosshairs(), "back" === t.config.yaxis[0].crosshairs.position && new it(this.ctx).drawYCrosshairs(), "datetime" === t.config.xaxis.type && void 0 === t.config.xaxis.labels.formatter) { this.ctx.timeScale = new jt(this.ctx); var i = []; isFinite(t.globals.minX) && isFinite(t.globals.maxX) && !t.globals.isBarHorizontal ? i = this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minX, t.globals.maxX) : t.globals.isBarHorizontal && (i = this.ctx.timeScale.calculateTimeScaleTicks(t.globals.minY, t.globals.maxY)), this.ctx.timeScale.recalcDimensionsBasedOnFormat(i) } e = new A(this.ctx).getCalculatedRatios() } return e } }, { key: "updateSourceChart", value: function (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) } }, { key: "setupBrushHandler", value: function () { var t = this, e = this.w; if (e.config.chart.brush.enabled && "function" != typeof e.config.chart.events.selection) { var i = Array.isArray(e.config.chart.brush.targets) ? e.config.chart.brush.targets : [e.config.chart.brush.target]; i.forEach((function (e) { var i = ApexCharts.getChartByID(e); i.w.globals.brushSource = t.ctx, "function" != typeof i.w.config.chart.events.zoomed && (i.w.config.chart.events.zoomed = function () { return t.updateSourceChart(i) }), "function" != typeof i.w.config.chart.events.scrolled && (i.w.config.chart.events.scrolled = function () { return t.updateSourceChart(i) }) })), e.config.chart.events.selection = function (t, e) { i.forEach((function (t) { ApexCharts.getChartByID(t).ctx.updateHelpers._updateOptions({ xaxis: { min: e.xaxis.min, max: e.xaxis.max } }, !1, !1, !1, !1) })) } } } }]), t }(), Ut = function () { function t(e) { i(this, t), this.ctx = e, this.w = e.w } return s(t, [{ key: "_updateOptions", value: function (t) { var e = this, i = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], a = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], s = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], r = arguments.length > 4 && void 0 !== arguments[4] && arguments[4]; return new Promise((function (o) { var n = [e.ctx]; s && (n = e.ctx.getSyncedCharts()), e.ctx.w.globals.isExecCalled && (n = [e.ctx], e.ctx.w.globals.isExecCalled = !1), n.forEach((function (s, l) { var h = s.w; if (h.globals.shouldAnimate = a, i || (h.globals.resized = !0, h.globals.dataChanged = !0, a && s.series.getPreviousPaths()), t && "object" === b(t) && (s.config = new D(t), t = A.extendArrayProps(s.config, t, h), s.w.globals.chartID !== e.ctx.w.globals.chartID && delete t.series, h.config = m.extend(h.config, t), r && (h.globals.lastXAxis = t.xaxis ? m.clone(t.xaxis) : [], h.globals.lastYAxis = t.yaxis ? m.clone(t.yaxis) : [], h.globals.initialConfig = m.extend({}, h.config), h.globals.initialSeries = m.clone(h.config.series), t.series))) { for (var c = 0; c < h.globals.collapsedSeriesIndices.length; c++) { var d = h.config.series[h.globals.collapsedSeriesIndices[c]]; h.globals.collapsedSeries[c].data = h.globals.axisCharts ? d.data.slice() : d } for (var g = 0; g < h.globals.ancillaryCollapsedSeriesIndices.length; g++) { var u = h.config.series[h.globals.ancillaryCollapsedSeriesIndices[g]]; h.globals.ancillaryCollapsedSeries[g].data = h.globals.axisCharts ? u.data.slice() : u } s.series.emptyCollapsedSeries(h.config.series) } return s.update(t).then((function () { l === n.length - 1 && o(s) })) })) })) } }, { key: "_updateSeries", value: function (t, e) { var i = this, a = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return new Promise((function (s) { var r, o = i.w; return o.globals.shouldAnimate = e, o.globals.dataChanged = !0, e && i.ctx.series.getPreviousPaths(), o.globals.axisCharts ? (0 === (r = t.map((function (t, e) { return i._extendSeries(t, e) }))).length && (r = [{ data: [] }]), o.config.series = r) : o.config.series = t.slice(), a && (o.globals.initialConfig.series = m.clone(o.config.series), o.globals.initialSeries = m.clone(o.config.series)), i.ctx.update().then((function () { s(i.ctx) })) })) } }, { key: "_extendSeries", value: function (t, e) { var i = this.w, a = i.config.series[e]; return g(g({}, i.config.series[e]), {}, { name: t.name ? t.name : null == a ? void 0 : a.name, color: t.color ? t.color : null == a ? void 0 : a.color, type: t.type ? t.type : null == a ? void 0 : a.type, group: t.group ? t.group : null == a ? void 0 : a.group, hidden: void 0 !== t.hidden ? t.hidden : null == a ? void 0 : a.hidden, data: t.data ? t.data : null == a ? void 0 : a.data, zIndex: void 0 !== t.zIndex ? t.zIndex : e }) } }, { key: "toggleDataPointSelection", value: function (t, e) { var i = this.w, a = null, s = ".apexcharts-series[data\\:realIndex='".concat(t, "']"); return i.globals.axisCharts ? a = i.globals.dom.Paper.select("".concat(s, " path[j='").concat(e, "'], ").concat(s, " circle[j='").concat(e, "'], ").concat(s, " rect[j='").concat(e, "']")).members[0] : void 0 === e && (a = i.globals.dom.Paper.select("".concat(s, " path[j='").concat(t, "']")).members[0], "pie" !== i.config.chart.type && "polarArea" !== i.config.chart.type && "donut" !== i.config.chart.type || this.ctx.pie.pieClicked(t)), a ? (new k(this.ctx).pathMouseDown(a, null), a.node ? a.node : null) : (console.warn("toggleDataPointSelection: Element not found"), null) } }, { key: "forceXAxisUpdate", value: function (t) { var e = this.w; if (["min", "max"].forEach((function (i) { void 0 !== t.xaxis[i] && (e.config.xaxis[i] = t.xaxis[i], e.globals.lastXAxis[i] = t.xaxis[i]) })), t.xaxis.categories && t.xaxis.categories.length && (e.config.xaxis.categories = t.xaxis.categories), e.config.xaxis.convertedCatToNumeric) { var i = new F(t); t = i.convertCatToNumericXaxis(t, this.ctx) } return t } }, { key: "forceYAxisUpdate", value: function (t) { return t.chart && t.chart.stacked && "100%" === t.chart.stackType && (Array.isArray(t.yaxis) ? t.yaxis.forEach((function (e, i) { t.yaxis[i].min = 0, t.yaxis[i].max = 100 })) : (t.yaxis.min = 0, t.yaxis.max = 100)), t } }, { key: "revertDefaultAxisMinMax", value: function (t) { var e = this, i = this.w, a = i.globals.lastXAxis, s = i.globals.lastYAxis; t && t.xaxis && (a = t.xaxis), t && t.yaxis && (s = t.yaxis), i.config.xaxis.min = a.min, i.config.xaxis.max = a.max; var r = function (t) { void 0 !== s[t] && (i.config.yaxis[t].min = s[t].min, i.config.yaxis[t].max = s[t].max) }; i.config.yaxis.map((function (t, a) { i.globals.zoomed || void 0 !== s[a] ? r(a) : void 0 !== e.ctx.opts.yaxis[a] && (t.min = e.ctx.opts.yaxis[a].min, t.max = e.ctx.opts.yaxis[a].max) })) } }]), t }(); Nt = "undefined" != typeof window ? window : void 0, Wt = function (t, e) { var i = (void 0 !== this ? this : t).SVG = function (t) { if (i.supported) return t = new i.Doc(t), i.parser.draw || i.prepare(), t }; if (i.ns = "http://www.w3.org/2000/svg", i.xmlns = "http://www.w3.org/2000/xmlns/", i.xlink = "http://www.w3.org/1999/xlink", i.svgjs = "http://svgjs.dev", i.supported = !0, !i.supported) return !1; i.did = 1e3, i.eid = function (t) { return "Svgjs" + c(t) + i.did++ }, i.create = function (t) { var i = e.createElementNS(this.ns, t); return i.setAttribute("id", this.eid(t)), i }, i.extend = function () { var t, e; e = (t = [].slice.call(arguments)).pop(); for (var a = t.length - 1; a >= 0; a--)if (t[a]) for (var s in e) t[a].prototype[s] = e[s]; i.Set && i.Set.inherit && i.Set.inherit() }, i.invent = function (t) { var e = "function" == typeof t.create ? t.create : function () { this.constructor.call(this, i.create(t.create)) }; return t.inherit && (e.prototype = new t.inherit), t.extend && i.extend(e, t.extend), t.construct && i.extend(t.parent || i.Container, t.construct), e }, i.adopt = function (e) { return e ? e.instance ? e.instance : ((a = "svg" == e.nodeName ? e.parentNode instanceof t.SVGElement ? new i.Nested : new i.Doc : "linearGradient" == e.nodeName ? new i.Gradient("linear") : "radialGradient" == e.nodeName ? new i.Gradient("radial") : i[c(e.nodeName)] ? new (i[c(e.nodeName)]) : new i.Element(e)).type = e.nodeName, a.node = e, e.instance = a, a instanceof i.Doc && a.namespace().defs(), a.setData(JSON.parse(e.getAttribute("svgjs:data")) || {}), a) : null; var a }, i.prepare = function () { var t = e.getElementsByTagName("body")[0], a = (t ? new i.Doc(t) : i.adopt(e.documentElement).nested()).size(2, 0); i.parser = { body: t || e.documentElement, draw: a.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").node, poly: a.polyline().node, path: a.path().node, native: i.create("svg") } }, i.parser = { native: i.create("svg") }, e.addEventListener("DOMContentLoaded", (function () { i.parser.draw || i.prepare() }), !1), i.regex = { numberAndUnit: /^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i, hex: /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, rgb: /rgb\((\d+),(\d+),(\d+)\)/, reference: /#([a-z0-9\-_]+)/i, transforms: /\)\s*,?\s*/, whitespace: /\s/g, isHex: /^#[a-f0-9]{3,6}$/i, isRgb: /^rgb\(/, isCss: /[^:]+:[^;]+;?/, isBlank: /^(\s+)?$/, isNumber: /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, isPercent: /^-?[\d\.]+%$/, isImage: /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i, delimiter: /[\s,]+/, hyphen: /([^e])\-/gi, pathLetters: /[MLHVCSQTAZ]/gi, isPathLetter: /[MLHVCSQTAZ]/i, numbersWithDots: /((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi, dots: /\./g }, i.utils = { map: function (t, e) { for (var i = t.length, a = [], s = 0; s < i; s++)a.push(e(t[s])); return a }, filter: function (t, e) { for (var i = t.length, a = [], s = 0; s < i; s++)e(t[s]) && a.push(t[s]); return a }, filterSVGElements: function (e) { return this.filter(e, (function (e) { return e instanceof t.SVGElement })) } }, i.defaults = { attrs: { "fill-opacity": 1, "stroke-opacity": 1, "stroke-width": 0, "stroke-linejoin": "miter", "stroke-linecap": "butt", fill: "#000000", stroke: "#000000", opacity: 1, x: 0, y: 0, cx: 0, cy: 0, width: 0, height: 0, r: 0, rx: 0, ry: 0, offset: 0, "stop-opacity": 1, "stop-color": "#000000", "font-size": 16, "font-family": "Helvetica, Arial, sans-serif", "text-anchor": "start" } }, i.Color = function (t) { var e, a; this.r = 0, this.g = 0, this.b = 0, t && ("string" == typeof t ? i.regex.isRgb.test(t) ? (e = i.regex.rgb.exec(t.replace(i.regex.whitespace, "")), this.r = parseInt(e[1]), this.g = parseInt(e[2]), this.b = parseInt(e[3])) : i.regex.isHex.test(t) && (e = i.regex.hex.exec(4 == (a = t).length ? ["#", a.substring(1, 2), a.substring(1, 2), a.substring(2, 3), a.substring(2, 3), a.substring(3, 4), a.substring(3, 4)].join("") : a), this.r = parseInt(e[1], 16), this.g = parseInt(e[2], 16), this.b = parseInt(e[3], 16)) : "object" === b(t) && (this.r = t.r, this.g = t.g, this.b = t.b)) }, i.extend(i.Color, { toString: function () { return this.toHex() }, toHex: function () { return "#" + d(this.r) + d(this.g) + d(this.b) }, toRgb: function () { return "rgb(" + [this.r, this.g, this.b].join() + ")" }, brightness: function () { return this.r / 255 * .3 + this.g / 255 * .59 + this.b / 255 * .11 }, morph: function (t) { return this.destination = new i.Color(t), this }, at: function (t) { return this.destination ? (t = t < 0 ? 0 : t > 1 ? 1 : t, new i.Color({ r: ~~(this.r + (this.destination.r - this.r) * t), g: ~~(this.g + (this.destination.g - this.g) * t), b: ~~(this.b + (this.destination.b - this.b) * t) })) : this } }), i.Color.test = function (t) { return t += "", i.regex.isHex.test(t) || i.regex.isRgb.test(t) }, i.Color.isRgb = function (t) { return t && "number" == typeof t.r && "number" == typeof t.g && "number" == typeof t.b }, i.Color.isColor = function (t) { return i.Color.isRgb(t) || i.Color.test(t) }, i.Array = function (t, e) { 0 == (t = (t || []).valueOf()).length && e && (t = e.valueOf()), this.value = this.parse(t) }, i.extend(i.Array, { toString: function () { return this.value.join(" ") }, valueOf: function () { return this.value }, parse: function (t) { return t = t.valueOf(), Array.isArray(t) ? t : this.split(t) } }), i.PointArray = function (t, e) { i.Array.call(this, t, e || [[0, 0]]) }, i.PointArray.prototype = new i.Array, i.PointArray.prototype.constructor = i.PointArray; for (var a = { M: function (t, e, i) { return e.x = i.x = t[0], e.y = i.y = t[1], ["M", e.x, e.y] }, L: function (t, e) { return e.x = t[0], e.y = t[1], ["L", t[0], t[1]] }, H: function (t, e) { return e.x = t[0], ["H", t[0]] }, V: function (t, e) { return e.y = t[0], ["V", t[0]] }, C: function (t, e) { return e.x = t[4], e.y = t[5], ["C", t[0], t[1], t[2], t[3], t[4], t[5]] }, Q: function (t, e) { return e.x = t[2], e.y = t[3], ["Q", t[0], t[1], t[2], t[3]] }, S: function (t, e) { return e.x = t[2], e.y = t[3], ["S", t[0], t[1], t[2], t[3]] }, Z: function (t, e, i) { return e.x = i.x, e.y = i.y, ["Z"] } }, s = "mlhvqtcsaz".split(""), r = 0, o = s.length; r < o; ++r)a[s[r]] = function (t) { return function (e, i, s) { if ("H" == t) e[0] = e[0] + i.x; else if ("V" == t) e[0] = e[0] + i.y; else if ("A" == t) e[5] = e[5] + i.x, e[6] = e[6] + i.y; else for (var r = 0, o = e.length; r < o; ++r)e[r] = e[r] + (r % 2 ? i.y : i.x); if (a && "function" == typeof a[t]) return a[t](e, i, s) } }(s[r].toUpperCase()); i.PathArray = function (t, e) { i.Array.call(this, t, e || [["M", 0, 0]]) }, i.PathArray.prototype = new i.Array, i.PathArray.prototype.constructor = i.PathArray, i.extend(i.PathArray, { toString: function () { return function (t) { for (var e = 0, i = t.length, a = ""; e < i; e++)a += t[e][0], null != t[e][1] && (a += t[e][1], null != t[e][2] && (a += " ", a += t[e][2], null != t[e][3] && (a += " ", a += t[e][3], a += " ", a += t[e][4], null != t[e][5] && (a += " ", a += t[e][5], a += " ", a += t[e][6], null != t[e][7] && (a += " ", a += t[e][7]))))); return a + " " }(this.value) }, move: function (t, e) { var i = this.bbox(); return i.x, i.y, this }, at: function (t) { if (!this.destination) return this; for (var e = this.value, a = this.destination.value, s = [], r = new i.PathArray, o = 0, n = e.length; o < n; o++) { s[o] = [e[o][0]]; for (var l = 1, h = e[o].length; l < h; l++)s[o][l] = e[o][l] + (a[o][l] - e[o][l]) * t; "A" === s[o][0] && (s[o][4] = +(0 != s[o][4]), s[o][5] = +(0 != s[o][5])) } return r.value = s, r }, parse: function (t) { if (t instanceof i.PathArray) return t.valueOf(); var e, s = { M: 2, L: 2, H: 1, V: 1, C: 6, S: 4, Q: 4, T: 2, A: 7, Z: 0 }; t = "string" == typeof t ? t.replace(i.regex.numbersWithDots, l).replace(i.regex.pathLetters, " $& ").replace(i.regex.hyphen, "$1 -").trim().split(i.regex.delimiter) : t.reduce((function (t, e) { return [].concat.call(t, e) }), []); var r = [], o = new i.Point, n = new i.Point, h = 0, c = t.length; do { i.regex.isPathLetter.test(t[h]) ? (e = t[h], ++h) : "M" == e ? e = "L" : "m" == e && (e = "l"), r.push(a[e].call(null, t.slice(h, h += s[e.toUpperCase()]).map(parseFloat), o, n)) } while (c > h); return r }, bbox: function () { return i.parser.draw || i.prepare(), i.parser.path.setAttribute("d", this.toString()), i.parser.path.getBBox() } }), i.Number = i.invent({ create: function (t, e) { this.value = 0, this.unit = e || "", "number" == typeof t ? this.value = isNaN(t) ? 0 : isFinite(t) ? t : t < 0 ? -34e37 : 34e37 : "string" == typeof t ? (e = t.match(i.regex.numberAndUnit)) && (this.value = parseFloat(e[1]), "%" == e[5] ? this.value /= 100 : "s" == e[5] && (this.value *= 1e3), this.unit = e[5]) : t instanceof i.Number && (this.value = t.valueOf(), this.unit = t.unit) }, extend: { toString: function () { return ("%" == this.unit ? ~~(1e8 * this.value) / 1e6 : "s" == this.unit ? this.value / 1e3 : this.value) + this.unit }, toJSON: function () { return this.toString() }, valueOf: function () { return this.value }, plus: function (t) { return t = new i.Number(t), new i.Number(this + t, this.unit || t.unit) }, minus: function (t) { return t = new i.Number(t), new i.Number(this - t, this.unit || t.unit) }, times: function (t) { return t = new i.Number(t), new i.Number(this * t, this.unit || t.unit) }, divide: function (t) { return t = new i.Number(t), new i.Number(this / t, this.unit || t.unit) }, to: function (t) { var e = new i.Number(this); return "string" == typeof t && (e.unit = t), e }, morph: function (t) { return this.destination = new i.Number(t), t.relative && (this.destination.value += this.value), this }, at: function (t) { return this.destination ? new i.Number(this.destination).minus(this).times(t).plus(this) : this } } }), i.Element = i.invent({ create: function (t) { this._stroke = i.defaults.attrs.stroke, this._event = null, this.dom = {}, (this.node = t) && (this.type = t.nodeName, this.node.instance = this, this._stroke = t.getAttribute("stroke") || this._stroke) }, extend: { x: function (t) { return this.attr("x", t) }, y: function (t) { return this.attr("y", t) }, cx: function (t) { return null == t ? this.x() + this.width() / 2 : this.x(t - this.width() / 2) }, cy: function (t) { return null == t ? this.y() + this.height() / 2 : this.y(t - this.height() / 2) }, move: function (t, e) { return this.x(t).y(e) }, center: function (t, e) { return this.cx(t).cy(e) }, width: function (t) { return this.attr("width", t) }, height: function (t) { return this.attr("height", t) }, size: function (t, e) { var a = g(this, t, e); return this.width(new i.Number(a.width)).height(new i.Number(a.height)) }, clone: function (t) { this.writeDataToDom(); var e = p(this.node.cloneNode(!0)); return t ? t.add(e) : this.after(e), e }, remove: function () { return this.parent() && this.parent().removeElement(this), this }, replace: function (t) { return this.after(t).remove(), t }, addTo: function (t) { return t.put(this) }, putIn: function (t) { return t.add(this) }, id: function (t) { return this.attr("id", t) }, show: function () { return this.style("display", "") }, hide: function () { return this.style("display", "none") }, visible: function () { return "none" != this.style("display") }, toString: function () { return this.attr("id") }, classes: function () { var t = this.attr("class"); return null == t ? [] : t.trim().split(i.regex.delimiter) }, hasClass: function (t) { return -1 != this.classes().indexOf(t) }, addClass: function (t) { if (!this.hasClass(t)) { var e = this.classes(); e.push(t), this.attr("class", e.join(" ")) } return this }, removeClass: function (t) { return this.hasClass(t) && this.attr("class", this.classes().filter((function (e) { return e != t })).join(" ")), this }, toggleClass: function (t) { return this.hasClass(t) ? this.removeClass(t) : this.addClass(t) }, reference: function (t) { return i.get(this.attr(t)) }, parent: function (e) { var a = this; if (!a.node.parentNode) return null; if (a = i.adopt(a.node.parentNode), !e) return a; for (; a && a.node instanceof t.SVGElement;) { if ("string" == typeof e ? a.matches(e) : a instanceof e) return a; if (!a.node.parentNode || "#document" == a.node.parentNode.nodeName) return null; a = i.adopt(a.node.parentNode) } }, doc: function () { return this instanceof i.Doc ? this : this.parent(i.Doc) }, parents: function (t) { var e = [], i = this; do { if (!(i = i.parent(t)) || !i.node) break; e.push(i) } while (i.parent); return e }, matches: function (t) { return function (t, e) { return (t.matches || t.matchesSelector || t.msMatchesSelector || t.mozMatchesSelector || t.webkitMatchesSelector || t.oMatchesSelector).call(t, e) }(this.node, t) }, native: function () { return this.node }, svg: function (t) { var a = e.createElementNS("http://www.w3.org/2000/svg", "svg"); if (!(t && this instanceof i.Parent)) return a.appendChild(t = e.createElementNS("http://www.w3.org/2000/svg", "svg")), this.writeDataToDom(), t.appendChild(this.node.cloneNode(!0)), a.innerHTML.replace(/^