!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).ApexCharts=e()}(this,function(){"use strict";function C(t){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){for(var i=0;i>16,t=a>>8&255,a=255&a;return"#"+(16777216+65536*(Math.round((i-e)*s)+e)+256*(Math.round((i-t)*s)+t)+(Math.round((i-a)*s)+a)).toString(16).slice(1)}},{key:"shadeColor",value:function(t,e){return 7\{\}\[\]\\\/]/gi,e)}},{key:"negToZero",value:function(t){return t<0?0:t}},{key:"moveIndexInArray",value:function(t,e,i){if(i>=t.length)for(var s=i-t.length+1;s--;)t.push(void 0);return t.splice(i,0,t.splice(e,1)[0]),t}},{key:"extractNumber",value:function(t){return parseFloat(t.replace(/[^\d\.]*/g,""))}},{key:"randomString",value:function(t){for(var e="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",s=0;s"}this.w.globals.easing=t}},{key:"animateLine",value:function(t,e,i,s){t.attr(e).animate(s).attr(i)}},{key:"animateCircleRadius",value:function(t,e,i,s,a){t.attr({r:e=e||0}).animate(s,a).attr({r:i})}},{key:"animateCircle",value:function(t,e,i,s,a){t.attr({r:e.r,cx:e.cx,cy:e.cy}).animate(s,a).attr({r:i.r,cx:i.cx,cy:i.cy})}},{key:"animateRect",value:function(t,e,i,s,a){t.attr(e).animate(s).attr(i).afterAll(function(){a()})}},{key:"animatePathsGradually",value:function(t){var e=t.el,i=t.j,s=t.pathFrom,a=t.pathTo,n=t.speed,o=t.delay,r=t.strokeWidth,l=this.w,t=0;l.config.chart.animations.animateGradually.enabled&&(t=l.config.chart.animations.animateGradually.delay),l.config.chart.animations.dynamicAnimation.enabled&&l.globals.dataChanged&&(t=0),this.morphSVG(e,i,s,a,n,r,o*t)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach(function(t){t.el.classList.remove("hidden")})}},{key:"morphSVG",value:function(t,e,i,s,a,n,o){var r=this,l=this.w;i=i||t.attr("pathFrom"),s=s||t.attr("pathTo"),(!i||-1=i){for(var s=e.length-3;0s.globals.gridWidth||(null===t.x2?(l=this.graphics.drawLine(o+t.offsetX,0+t.offsetY,o+t.offsetX,s.globals.gridHeight+t.offsetY,t.borderColor,h),e.appendChild(l.node)):(a=(t.x2-a)/(n/s.globals.gridWidth),(a="category"!==s.config.xaxis.type&&!s.config.xaxis.convertedCatToNumeric||this.invertAxis||s.globals.isXNumeric?a:this.getStringX(t.x2))n.globals.gridWidth||(n={pSize:t.marker.size,pWidth:t.marker.strokeWidth,pointFillColor:t.marker.fillColor,pointStrokeColor:t.marker.strokeColor,shape:t.marker.shape,radius:t.marker.radius,class:"apexcharts-point-annotation-marker "+t.marker.cssClass},n=this.graphics.drawMarker(o+t.marker.offsetX,l+t.marker.offsetY,n),e.appendChild(n.node),n=t.label.text||"",(n=this.graphics.drawText({x:o+t.label.offsetX,y:r+t.label.offsetY,text:n,textAnchor:t.label.textAnchor,fontSize:t.label.style.fontSize,fontFamily:t.label.style.fontFamily,foreColor:t.label.style.color,cssClass:"apexcharts-point-annotation-label "+t.label.style.cssClass})).attr({rel:i}),e.appendChild(n.node),t.customSVG.SVG&&((n=this.graphics.group({class:"apexcharts-point-annotations-custom-svg "+t.customSVG.cssClass})).attr({transform:"translate(".concat(o+t.customSVG.offsetX,", ").concat(r+t.customSVG.offsetY,")")}),n.node.innerHTML=t.customSVG.SVG,e.appendChild(n.node)))}},{key:"drawPointAnnotations",value:function(){var i=this,t=this.w,s=this.graphics.group({class:"apexcharts-point-annotations"});return t.config.annotations.points.map(function(t,e){i.addPointAnnotation(t,s.node,e)}),s}},{key:"setOrientations",value:function(t){var e=1
Open: '+(t=t.w).globals.seriesCandleO[e][i]+'
High: '+t.globals.seriesCandleH[e][i]+'
Low: '+t.globals.seriesCandleL[e][i]+'
Close: '+t.globals.seriesCandleC[e][i]+"
"}},states:{active:{filter:{type:"none"}}},xaxis:{crosshairs:{width:1}}}}},{key:"rangeBar",value:function(){return{stroke:{width:0},plotOptions:{bar:{dataLabels:{position:"center"}}},dataLabels:{enabled:!1,formatter:function(t,e){e.ctx;var i=e.seriesIndex,s=e.dataPointIndex,a=e.w,e=a.globals.seriesRangeStart[i][s];return a.globals.seriesRangeEnd[i][s]-e},style:{colors:["#fff"]}},tooltip:{shared:!1,followCursor:!0,custom:function(t){var e=t.ctx,i=t.seriesIndex,s=t.dataPointIndex,a=t.w,n=a.globals.seriesRangeStart[i][s],o=a.globals.seriesRangeEnd[i][s],r="",t=a.globals.colors[i],o=void 0===a.config.tooltip.x.formatter?"datetime"===a.config.xaxis.type?(r=(e=new y(e)).formatDate(new Date(n),a.config.tooltip.x.format,!0,!0),e.formatDate(new Date(o),a.config.tooltip.x.format,!0,!0)):(r=n,o):(r=a.config.tooltip.x.formatter(n),a.config.tooltip.x.formatter(o)),s=a.globals.labels[s];return'
'+(a.config.series[i].name||"")+'
'+s+': '+r+' - '+o+"
"}},xaxis:{tooltip:{enabled:!1},crosshairs:{stroke:{width:0}}}}}},{key:"area",value:function(){return{stroke:{width:4},fill:{type:"gradient",gradient:{inverseColors:!1,shade:"light",type:"vertical",opacityFrom:.65,opacityTo:.5,stops:[0,100,100]}},markers:{size:0,hover:{sizeOffset:6}},tooltip:{followCursor:!1}}}},{key:"brush",value:function(t){return K.extend(t,{chart:{toolbar:{autoSelected:"selection",show:!1},zoom:{enabled:!1}},dataLabels:{enabled:!1},stroke:{width:1},tooltip:{enabled:!1},xaxis:{tooltip:{enabled:!1}}})}},{key:"stacked100",value:function(){var i=this,t=(this.opts.dataLabels=this.opts.dataLabels||{},this.opts.dataLabels.formatter=this.opts.dataLabels.formatter||void 0,this.opts.dataLabels.formatter);this.opts.yaxis.forEach(function(t,e){i.opts.yaxis[e].min=0,i.opts.yaxis[e].max=100}),"bar"===this.opts.chart.type&&(this.opts.dataLabels.formatter=t||function(t){return"number"==typeof t&&t?t.toFixed(0)+"%":t})}},{key:"bubble",value:function(){return{dataLabels:{style:{colors:["#fff"]}},tooltip:{shared:!1,intersect:!0},xaxis:{crosshairs:{width:0}},fill:{type:"solid",gradient:{shade:"light",inverse:!0,shadeIntensity:.55,opacityFrom:.4,opacityTo:.8}}}}},{key:"scatter",value:function(){return{dataLabels:{enabled:!1},tooltip:{shared:!1,intersect:!0},markers:{size:6,strokeWidth:2,hover:{sizeOffset:2}}}}},{key:"heatmap",value:function(){return{chart:{stacked:!1,zoom:{enabled:!1}},fill:{opacity:1},dataLabels:{style:{colors:["#fff"]}},stroke:{colors:["#fff"]},tooltip:{followCursor:!0,marker:{show:!1},x:{show:!1}},legend:{position:"top",markers:{shape:"square",size:10,offsetY:2}},grid:{padding:{right:20}}}}},{key:"pie",value:function(){return{chart:{toolbar:{show:!1}},plotOptions:{pie:{donut:{labels:{show:!1}}}},dataLabels:{formatter:function(t){return t.toFixed(1)+"%"},style:{colors:["#fff"]},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"dark",shadeIntensity:.35,inverseColors:!1,stops:[0,100,100]}},padding:{right:0,left:0},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"}}}},{key:"donut",value:function(){return{chart:{toolbar:{show:!1}},dataLabels:{formatter:function(t){return t.toFixed(1)+"%"},style:{colors:["#fff"]},dropShadow:{enabled:!0}},stroke:{colors:["#fff"]},fill:{opacity:1,gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"vertical",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},padding:{right:0,left:0},tooltip:{theme:"dark",fillSeriesColor:!0},legend:{position:"right"}}}},{key:"radar",value:function(){return this.opts.yaxis[0].labels.style.fontSize="13px",{dataLabels:{enabled:!0,style:{colors:["#a8a8a8"],fontSize:"11px"}},stroke:{width:2},markers:{size:3,strokeWidth:1,strokeOpacity:1},fill:{opacity:.2},tooltip:{shared:!(this.opts.yaxis[0].labels.offsetY=6),intersect:!0,followCursor:!0},grid:{show:!1},xaxis:{tooltip:{enabled:!1},crosshairs:{show:!1}}}}},{key:"radialBar",value:function(){return{chart:{animations:{dynamicAnimation:{enabled:!0,speed:800}},toolbar:{show:!1}},fill:{gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,type:"diagonal2",opacityFrom:1,opacityTo:1,stops:[70,98,100]}},padding:{right:0,left:0},legend:{show:!1,position:"right"},tooltip:{enabled:!1,fillSeriesColor:!0}}}}],[{key:"convertCatToNumeric",value:function(t){t.xaxis.type="numeric",t.xaxis.convertedCatToNumeric=!0,t.xaxis.labels=t.xaxis.labels||{},t.xaxis.labels.formatter=t.xaxis.labels.formatter||function(t){return t},t.chart=t.chart||{},t.chart.zoom=t.chart.zoom||window.Apex.chart&&window.Apex.chart.zoom||{};var e=t.xaxis.labels.formatter,i=t.xaxis.categories&&t.xaxis.categories.length?t.xaxis.categories:t.labels;return i&&i.length&&(t.xaxis.labels.formatter=function(t){return e(i[t-1])}),t.xaxis.categories=[],t.labels=[],t.chart.zoom.enabled=t.chart.zoom.enabled||!1,t}}]),Ot),et=(t(Nt,[{key:"getStackedSeriesTotals",value:function(){var t=this.w,e=[];if(0===t.globals.series.length)return e;for(var i=0;ia&&o.globals.seriesX[e][s](o=r.globals.dataLabelsRects[s][o]).x+o.width+2||e>o.y+o.height+2||t+ii.config.plotOptions.bar.dataLabels.maxItems&&console.warn("WARNING: DataLabels are enabled but there are too many to display. This may cause performance issue when rendering.");for(var o=0,r=0;o=t.from&&e[i][s]<=t.to&&(o=t.color)}),a.config.series[i].data[s]&&a.config.series[i].data[s].fillColor&&(o=a.config.series[i].data[s].fillColor),n.fillPath({seriesNumber:this.barOptions.distributed?r:t,color:o,value:e[i][s]})}},{key:"renderSeries",value:function(t){var e=t.realIndex,i=t.pathFill,s=t.lineFill,a=t.j,n=t.i,o=t.pathFrom,r=t.pathTo,l=t.strokeWidth,h=t.elSeries,c=t.x,d=t.y,u=t.series,g=t.barHeight,p=t.barWidth,f=t.elDataLabelsWrap,x=t.visibleSeries,b=t.type,m=this.w,y=new tt(this.ctx),s=s||(this.barOptions.distributed?m.globals.stroke.colors[a]:m.globals.stroke.colors[e]);return m.config.series[n].data[a]&&m.config.series[n].data[a].strokeColor&&(s=m.config.series[n].data[a].strokeColor),this.isNullValue&&(i="none"),t=a/m.config.chart.animations.animateGradually.delay*(m.config.chart.animations.speed/m.globals.dataPoints)/2.4,(b=y.renderPaths({i:n,j:a,realIndex:e,pathFrom:o,pathTo:r,stroke:s,strokeWidth:l,strokeLineCap:m.config.stroke.lineCap,fill:i,animationDelay:t,initialSpeed:m.config.chart.animations.speed,dataChangeSpeed:m.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(b,"-area")})).attr("clip-path","url(#gridRectMask".concat(m.globals.cuid,")")),new L(this.ctx).setSelectionFilter(b,e,a),h.add(b),null!==(x=this.calculateDataLabelsPos({x:c,y:d,i:n,j:a,series:u,realIndex:e,barHeight:g,barWidth:p,renderedPath:b,visibleSeries:x}))&&f.add(x),h.add(f),h}},{key:"initVariables",value:function(t){var e=this.w;this.series=t,this.totalItems=0,this.seriesLen=0,this.visibleI=-1,this.visibleItems=1;for(var i=0;ie.globals.minX&&e.globals.seriesX[i][s]=this.barOptions.colors.backgroundBarColors.length&&(t=0),t=this.barOptions.colors.backgroundBarColors[t],t=d.drawRect(0,i-s*this.visibleI,c.globals.gridWidth,s*this.seriesLen,0,t,this.barOptions.colors.backgroundBarOpacity),h.add(t),t.node.classList.add("apexcharts-backgroundBar")),{pathTo:f,pathFrom:n,x:e,y:r,barYPosition:i}}},{key:"drawColumnPaths",value:function(t){var e,i=t.indexes,s=t.x,a=(t.y,t.xDivision),n=(t.pathTo,t.pathFrom),o=t.barWidth,r=t.zeroH,l=t.strokeWidth,h=t.elSeries,c=this.w,d=new tt(this.ctx),u=i.i,g=i.j,p=i.realIndex,t=i.bc,i=(s=c.globals.isXNumeric?(c.globals.seriesX[u][g]-c.globals.minX)/this.xRatio-o/2:s)+o*this.visibleI,f=d.move(i,r),n=d.move(i,r);return 0=this.barOptions.colors.backgroundBarColors.length&&(t=0),t=this.barOptions.colors.backgroundBarColors[t],t=d.drawRect(i-o*this.visibleI,0,o*this.seriesLen,c.globals.gridHeight,0,t,this.barOptions.colors.backgroundBarOpacity),h.add(t),t.node.classList.add("apexcharts-backgroundBar")),{pathTo:f,pathFrom:n,x:s,y:e,barXPosition:i}}},{key:"getPathFrom",value:function(t,e){for(var i,s=this.w,a=0;ae.globals.gridHeight&&(h=e.globals.gridHeight-d)),{bcx:n,bcy:a,dataLabelsX:u,dataLabelsY:h}}},{key:"calculateBarsDataLabelsPosition",value:function(t){var e=this.w,i=t.x,s=t.i,a=t.j,n=t.bcy,o=t.barHeight,r=t.barWidth,l=t.textRects,h=t.dataLabelsX,c=t.strokeWidth,d=t.barDataLabelsConfig,u=t.offX,t=t.offY,t=n-e.globals.gridHeight/e.globals.dataPoints+o/2+l.height/2+t-3,g=this.series[s][a]<=0;switch(this.isReversed&&(i+=r),d.position){case"center":h=g?i-r/2-u:i-r/2+u;break;case"bottom":h=g?i-r-c-Math.round(l.width/2)-u:i-r+c+Math.round(l.width/2)+u;break;case"top":h=g?i-c+Math.round(l.width/2)-u:i-c-Math.round(l.width/2)+u}return e.config.chart.stacked||(h<0?h=h+l.width+c:h+l.width/2>e.globals.gridWidth&&(h=e.globals.gridWidth-l.width-c)),{bcx:i,bcy:n,dataLabelsX:h,dataLabelsY:t}}},{key:"drawCalculatedDataLabels",value:function(t){var e=t.x,i=t.y,s=t.val,a=t.i,n=t.j,o=t.textRects,r=t.barHeight,l=(t.barWidth,t.dataLabelsConfig),h=this.w,c=new at(this.ctx),d=new tt(this.ctx),u=l.formatter,g=null,t=-1t||t<0&&o.width/1.6r&&(d=""))),r=Q({},l),this.isHorizontal&&s<0&&("start"===l.textAnchor?r.textAnchor="end":"end"===l.textAnchor&&(r.textAnchor="start")),c.plotDataLabelsText({x:e,y:i,text:d,i:a,j:n,parent:g,dataLabelsConfig:r,alwaysDrawDataLabel:!0,offsetCorrection:!0})),g}},{key:"barEndingShape",value:function(t,e,i,s,a){var n=new tt(this.ctx);if(this.isHorizontal){var o=null,r=e.x;if(void 0!==i[s][a]||null!==i[s][a]){var l=i[s][a]<0,h=e.barHeight/2-e.strokeWidth;switch(l&&(h=-e.barHeight/2-e.strokeWidth),t.config.chart.stacked||"rounded"===this.barOptions.endingShape&&(r=e.x-h/2),this.barOptions.endingShape){case"flat":o=n.line(r,e.barYPosition+e.barHeight-e.strokeWidth);break;case"rounded":o=n.quadraticCurve(r+h,e.barYPosition+(e.barHeight-e.strokeWidth)/2,r,e.barYPosition+e.barHeight-e.strokeWidth)}}return{path:o,ending_p_from:"",newX:r}}var c=null,d=e.y;if(void 0!==i[s][a]||null!==i[s][a]){var a=i[s][a]<0,u=e.barWidth/2-e.strokeWidth;switch(a&&(u=-e.barWidth/2-e.strokeWidth),t.config.chart.stacked||"rounded"===this.barOptions.endingShape&&(d+=u/2),this.barOptions.endingShape){case"flat":c=n.line(e.barXPosition+e.barWidth-e.strokeWidth,d);break;case"rounded":c=n.quadraticCurve(e.barXPosition+(e.barWidth-e.strokeWidth)/2,d-u,e.barXPosition+e.barWidth-e.strokeWidth,d)}}return{path:c,ending_p_from:"",newY:d}}}]),Mt),V=(e(h,P),t(h,[{key:"draw",value:function(t,e){var i=this.w,s=(this.graphics=new tt(this.ctx),this.fill=new it(this.ctx),this.bar=new P(this.ctx,this.xyRatios),new et(this.ctx,i));t=s.getLogSeries(t),this.yRatio=s.getLogYRatios(this.yRatio),this.initVariables(t),"100%"===i.config.chart.stackType&&(t=i.globals.seriesPercent.slice()),this.series=t,this.totalItems=0,this.prevY=[],this.prevX=[],this.prevYF=[],this.prevXF=[],this.prevYVal=[],this.prevXVal=[],this.xArrj=[],this.xArrjF=[],this.xArrjVal=[],this.yArrj=[],this.yArrjF=[],this.yArrjVal=[];for(var a=0;a=c.config.plotOptions.bar.colors.backgroundBarColors.length&&(i=0),i=c.config.plotOptions.bar.colors.backgroundBarColors[i],c=this.graphics.drawRect(0,d,c.globals.gridWidth,s,0,i,c.config.plotOptions.bar.colors.backgroundBarOpacity),h.add(c),c.node.classList.add("apexcharts-backgroundBar")),{pathTo:e,pathFrom:n,x:b,y:r+=l}}},{key:"drawColumnPaths",value:function(t){for(var e,i,s,a=t.indexes,n=t.x,o=(t.y,t.xDivision),r=(t.pathTo,t.pathFrom),l=t.barWidth,h=t.zeroH,c=t.strokeWidth,d=t.elSeries,u=this.w,g=a.i,p=a.j,f=a.realIndex,t=a.bc,a=n=u.globals.isXNumeric?((u.globals.seriesX[g][p]||0)-u.globals.minX)/this.xRatio-l/2:n,x=0,b=0;b=u.config.plotOptions.bar.colors.backgroundBarColors.length&&(t=0),t=u.config.plotOptions.bar.colors.backgroundBarColors[t],t=this.graphics.drawRect(a,0,l,u.globals.gridHeight,0,t,u.config.plotOptions.bar.colors.backgroundBarOpacity),d.add(t),t.node.classList.add("apexcharts-backgroundBar")),n+=o,{pathTo:s,pathFrom:r,x:u.globals.isXNumeric?n-o:n,y:i}}},{key:"checkZeroSeries",value:function(t){for(var e=t.series,i=this.w,s=0;sb.c&&(u=!1),Math.min(b.o,b.c)),t=Math.max(b.o,b.c),e=(i=l.globals.isXNumeric?(l.globals.seriesX[c][d]-l.globals.minX)/this.xRatio-n/2:i)+n*this.visibleI;return void 0===this.series[c][d]||null===this.series[c][d]?v=o:(v=o-v/f,t=o-t/f,m=o-b.h/f,y=o-b.l/f),h.move(e,o),a=h.move(e,v),0r.globals.maxY?s.colorScale.max:r.globals.maxY),Math.abs(o)+Math.abs(n)),l=100*i/(0===r?r-1e-6:r);return 0=t.from&&i<=t.to&&(a=t.color,n=t.from,o=t.to,t=Math.abs(o)+Math.abs(n),l=100*i/(0===t?t-1e-6:t))}),{color:a,percent:l}}},{key:"calculateHeatmapDataLabels",value:function(t){var e=t.x,i=t.y,s=t.i,a=t.j,n=(t.series,t.rectHeight),o=t.rectWidth,r=this.w,l=r.config.dataLabels,h=new tt(this.ctx),c=new at(this.ctx),d=l.formatter,u=null;return l.enabled&&(u=h.group({class:"apexcharts-data-labels"}),t=l.offsetX,h=l.offsetY,t=e+o/2+t,h=i+n/2+parseInt(l.style.fontSize)/3+h,r=d(r.globals.series[s][a],{seriesIndex:s,dataPointIndex:a,w:r}),c.plotDataLabelsText({x:t,y:h,text:r,i:s,j:a,parent:u,dataLabelsConfig:l})),u}},{key:"animateHeatMap",value:function(t,e,i,s,a,n){var o=this;new z(this.ctx).animateRect(t,{x:e+s/2,y:i+a/2,width:0,height:0},{x:e,y:i,width:s,height:a},n,function(){o.w.globals.animationEnded=!0})}},{key:"animateHeatColor",value:function(t,e,i,s){t.attr({fill:e}).animate(s).attr({fill:i})}}]),Pt),U=(t(zt,[{key:"draw",value:function(t){var e=this.w,i=new tt(this.ctx),s=i.group({class:"apexcharts-pie"});if(!e.globals.noData){for(var a=0,n=0;nthis.fullAngle?e.endAngle=e.endAngle-(s+o):s+o=a.size-10&&(h[e].y<0?d-=10:0e.length?t:e},0),e.globals.yAxisScale[0].niceMax=t,e.globals.yAxisScale[0].niceMin=t)}}]),Ct),nt=(t(St,[{key:"getLabel",value:function(t,e,i,s){var a=4i.config.xaxis.labels.maxHeight&&(this.xAxisHeight=i.config.xaxis.labels.maxHeight),i.config.xaxis.labels.minHeight&&this.xAxisHeighta&&(this.yAxisWidth=a)}},{key:"setGridCoordsForAxisCharts",value:function(t){var i=this.w,e=i.globals,s=this.getyAxisLabelsCoords(),a=this.getxAxisLabelsCoords(),n=this.getyAxisTitleCoords(),o=this.getxAxisTitleCoords(),r=(i.globals.yLabelsCoords=[],i.globals.yTitleCoords=[],i.config.yaxis.map(function(t,e){i.globals.yLabelsCoords.push({width:s[e].width,index:e}),i.globals.yTitleCoords.push({width:n[e].width,index:e})}),this.conditionalChecksForAxisCoords(a,o),e.translateXAxisY=i.globals.rotateXLabels?this.xAxisHeight/8:-4,e.translateXAxisX=i.globals.rotateXLabels&&i.globals.isXNumeric&&i.config.xaxis.labels.rotate<=-45?-this.xAxisWidth/4:0,i.globals.isBarHorizontal&&(e.rotateXLabels=!1,e.translateXAxisY=parseInt(i.config.xaxis.labels.style.fontSize)/1.5*-1),e.translateXAxisY=e.translateXAxisY+i.config.xaxis.labels.offsetY,e.translateXAxisX=e.translateXAxisX+i.config.xaxis.labels.offsetX,this.yAxisWidth),l=this.xAxisHeight,h=(e.xAxisLabelsHeight=this.xAxisHeight,e.xAxisHeight=this.xAxisHeight,10);switch(i.config.grid.show&&"radar"!==i.config.chart.type||(r=0,l=35),this.isSparkline&&(t={height:0,width:0},h=r=l=0),this.additionalPaddingXLabels(a),i.config.legend.position){case"bottom":e.translateY=h,e.translateX=r,e.gridHeight=e.svgHeight-t.height-l-(this.isSparkline?0:i.globals.rotateXLabels?10:15),e.gridWidth=e.svgWidth-r;break;case"top":e.translateY=t.height+h,e.translateX=r,e.gridHeight=e.svgHeight-t.height-l-(this.isSparkline?0:i.globals.rotateXLabels?10:15),e.gridWidth=e.svgWidth-r;break;case"left":e.translateY=h,e.translateX=t.width+r,e.gridHeight=e.svgHeight-l-12,e.gridWidth=e.svgWidth-t.width-r;break;case"right":e.translateY=h,e.translateX=r,e.gridHeight=e.svgHeight-l-12,e.gridWidth=e.svgWidth-t.width-r-5;break;default:throw new Error("Legend position not supported")}this.setGridXPosForDualYAxis(n,s),new ot(this.ctx).setYAxisXPosition(s,n)}},{key:"setGridCoordsForNonAxisCharts",value:function(t){var e=this.w,i=e.globals,s=0,a=(e.config.legend.show&&!e.config.legend.floating&&(s=20),10),n=0;if("pie"===e.config.chart.type||"donut"===e.config.chart.type?(a+=e.config.plotOptions.pie.offsetY,n+=e.config.plotOptions.pie.offsetX):"radialBar"===e.config.chart.type&&(a+=e.config.plotOptions.radialBar.offsetY,n+=e.config.plotOptions.radialBar.offsetX),e.config.legend.show)switch(e.config.legend.position){case"bottom":i.gridHeight=i.svgHeight-t.height-35,i.gridWidth=i.gridHeight,i.translateY=a-20,i.translateX=n+(i.svgWidth-i.gridWidth)/2;break;case"top":i.gridHeight=i.svgHeight-t.height-35,i.gridWidth=i.gridHeight,i.translateY=t.height+a+10,i.translateX=n+(i.svgWidth-i.gridWidth)/2;break;case"left":i.gridWidth=i.svgWidth-t.width-s,i.gridHeight=i.gridWidth,i.translateY=a,i.translateX=n+t.width+s;break;case"right":i.gridWidth=i.svgWidth-t.width-s-5,i.gridHeight=i.gridWidth,i.translateY=a,i.translateX=n+10;break;default:throw new Error("Legend position not supported")}else i.gridHeight=i.svgHeight-35,i.gridWidth=i.gridHeight,i.translateY=a-10,i.translateX=n+(i.svgWidth-i.gridWidth)/2}},{key:"setGridXPosForDualYAxis",value:function(i,s){var a=this.w;a.config.yaxis.map(function(t,e){-1===a.globals.ignoreYAxisIndexes.indexOf(e)&&!a.config.yaxis[e].floating&&a.config.yaxis[e].show&&t.opposite&&(a.globals.translateX=a.globals.translateX-(s[e].width+i[e].width)-parseInt(a.config.yaxis[e].labels.style.fontSize)/1.2-12)})}},{key:"additionalPaddingXLabels",value:function(i){var s,a=this,n=this.w;("category"===n.config.xaxis.type&&n.globals.isBarHorizontal||"numeric"===n.config.xaxis.type||"datetime"===n.config.xaxis.type)&&(s=n.globals.isXNumeric,n.config.yaxis.forEach(function(t,e){(!t.show||t.floating||-1!==n.globals.collapsedSeriesIndices.indexOf(e)||s||t.opposite&&n.globals.isBarHorizontal)&&((s&&n.globals.isMultipleYAxis&&-1!==n.globals.collapsedSeriesIndices.indexOf(e)||n.globals.isBarHorizontal&&t.opposite)&&n.config.grid.padding.leftn.globals.gridWidth?n.globals.skipLastTimelinelabel=!0:n.globals.skipLastTimelinelabel=!1:"datetime"===n.config.xaxis.type?n.config.grid.padding.righte.length?t:e},0);return 1.05*(i=new tt(this.ctx).getTextRects(i,t.config.xaxis.labels.style.fontSize)).width*e.length>t.globals.gridWidth&&0!==t.config.xaxis.labels.rotate&&(t.globals.overlappingXLabels=!0),i}},{key:"getxAxisLabelsCoords",value:function(){var t,e,i,s,a,n=this.w,o=n.globals.labels.slice();return 0e.length?t:e},0),a=i=n.globals.isBarHorizontal?n.globals.yAxisScale[0].result.reduce(function(t,e){return t.length>e.length?t:e},0):i,i=new J(this.ctx).xLabelFormat(s,i,a),(t={width:(a=(s=new tt(this.ctx)).getTextRects(i,n.config.xaxis.labels.style.fontSize)).width,height:a.height}).width*o.length>n.globals.svgWidth-e-this.yAxisWidth&&0!==n.config.xaxis.labels.rotate?n.globals.isBarHorizontal||(n.globals.rotateXLabels=!0,a=s.getTextRects(i,n.config.xaxis.labels.style.fontSize,n.config.xaxis.labels.style.fontFamily,"rotate(".concat(n.config.xaxis.labels.rotate," 0 0)"),!1),t.height=a.height/1.66):n.globals.rotateXLabels=!1),{width:(t=n.config.xaxis.labels.show?t:{width:0,height:0}).width,height:t.height}}},{key:"getyAxisLabelsCoords",value:function(){var a=this,n=this.w,o=[],r=10;return n.config.yaxis.map(function(t,e){var i,s;t.show&&t.labels.show&&n.globals.yAxisScale[e].result.length?(void 0!==(s=(i=n.globals.yLabelFormatters[e])(n.globals.yAxisScale[e].niceMax,-1))&&0!==s.length||(s=n.globals.yAxisScale[e].niceMax),n.globals.isBarHorizontal&&(r=0,s=i(s=n.globals.labels.slice().reduce(function(t,e){return t.length>e.length?t:e},0),-1)),t=new tt(a.ctx).getTextRects(s,t.labels.style.fontSize),o.push({width:t.width+r,height:t.height})):o.push({width:0,height:0})}),o}},{key:"getxAxisTitleCoords",value:function(){var t=this.w,e=0,i=0;return void 0!==t.config.xaxis.title.text&&(e=(t=new tt(this.ctx).getTextRects(t.config.xaxis.title.text,t.config.xaxis.title.style.fontSize)).width,i=t.height),{width:e,height:i}}},{key:"getyAxisTitleCoords",value:function(){var i=this,t=this.w,s=[];return t.config.yaxis.map(function(t,e){t.show&&void 0!==t.title.text?(t=new tt(i.ctx).getTextRects(t.title.text,t.title.style.fontSize,t.title.style.fontFamily,"rotate(-90 0 0)",!1),s.push({width:t.width,height:t.height})):s.push({width:0,height:0})}),s}},{key:"getTitleSubtitleCoords",value:function(t){var e=this.w,i=0,s=0,a=("title"===t?e.config.title:e.config.subtitle).floating;return null===(t=e.globals.dom.baseEl.querySelector(".apexcharts-".concat(t,"-text")))||a||(i=(t=t.getBoundingClientRect()).width,s=e.globals.axisCharts?t.height+5:t.height),{width:i,height:s}}},{key:"getLegendsRect",value:function(){var t=this.w,e=t.globals.dom.baseEl.querySelector(".apexcharts-legend"),i=Object.assign({},K.getBoundingClientRect(e));return null!==e&&!t.config.legend.floating&&t.config.legend.show?this.lgRect={x:i.x,y:i.y,height:i.height,width:0===i.height?0:i.width}:this.lgRect={x:0,y:0,height:0,width:0},this.lgRect}}]),kt),g=(t(wt,[{key:"getAllSeriesEls",value:function(){return this.w.globals.dom.baseEl.querySelectorAll(".apexcharts-series")}},{key:"getSeriesByName",value:function(t){return this.w.globals.dom.baseEl.querySelector("[seriesName='".concat(K.escapeString(t),"']"))}},{key:"addCollapsedClassToSeries",value:function(i,s){var t=this.w;function e(t){for(var e=0;e=o.from&&l<=o.to&&a[r].classList.remove("legend-mouseover-inactive")}}else"mouseout"===t.type&&i()}},{key:"getActiveSeriesIndex",value:function(){var i=this.w,t=0;if(1e.globals.gridHeight&&(f=e.globals.gridHeight),c/2),x=e.globals.padHorizontal+B,b=(e.globals.isXNumeric&&0t[h][E]?"top":"bottom");null!==(X=new at(this.ctx).drawDataLabel(M,d,E+1,null,X))&&V.add(X)}l.push(u),e.globals.seriesXvalues[d]=g,e.globals.seriesYvalues[d]=u,this.pointsChart||e.globals.delayedElements.push({el:S.node,index:d});var U={i:h,realIndex:d,animationDelay:h,initialSpeed:e.config.chart.animations.speed,dataChangeSpeed:e.config.chart.animations.dynamicAnimation.speed,className:"apexcharts-".concat(s)};if("area"===s)for(var q=N.fillPath({seriesNumber:d}),I=0;Ia.globals.gridWidth||(s=(i=this.offY+a.config.xaxis.axisTicks.offsetY)+a.config.xaxis.axisTicks.height,a.config.xaxis.axisTicks.show&&(a=new tt(this.ctx).drawLine(t+a.config.xaxis.axisTicks.offsetX,i+a.config.xaxis.offsetY,n+a.config.xaxis.axisTicks.offsetX,s+a.config.xaxis.offsetY,a.config.xaxis.axisTicks.color),e.add(a),a.node.classList.add("apexcharts-xaxis-tick")))}},{key:"getXAxisTicksPositions",value:function(){var t=this.w,e=[],i=this.xaxisLabels.length,s=t.globals.padHorizontal;if(0t.globals.gridWidth&&a[0].parentNode.removeChild(a[0]);for(var g=0;gc););if(!(o&&10=e&&r.pop()}return{result:r,niceMin:r[0],niceMax:r[r.length-1]}}},{key:"linearScale",value:function(t,e){var i=2=d.xaxis.min){a=e;break}var o,r,n=p.globals.minYArr[t],l=p.globals.maxYArr[t],h=p.globals.stackedSeriesTotals;p.globals.series.forEach(function(i,t){var e=i[a];g?(e=h[a],o=r=e,h.forEach(function(t,e){u[e]<=d.xaxis.max&&u[e]>=d.xaxis.min&&(r=d.xaxis.min&&(n=a=i,p.globals.series.forEach(function(t,e){null!==i&&(a=Math.min(t[s],a),n=Math.max(t[s],n))}),rl[c][d]&&l[c][d]<0&&(o=l[c][d])):a.hasNullValues=!0}}return{minY:o,maxY:n,lowestY:e,highestY:i}}},{key:"setYRange",value:function(){var i=this.w.globals,t=this.w.config,e=(i.maxY=-Number.MAX_VALUE,i.minY=Number.MIN_VALUE,Number.MAX_VALUE);if(i.isMultipleYAxis)for(var s=0;ss.dataPoints&&0!==s.dataPoints&&(t=s.dataPoints-1)):t="dataPoints"===a.xaxis.tickAmount?s.series[s.maxValsInArrayIndex].length-1:a.xaxis.tickAmount,void 0!==a.xaxis.max&&"number"==typeof a.xaxis.max&&(s.maxX=a.xaxis.max),void 0!==a.xaxis.min&&"number"==typeof a.xaxis.min&&(s.minX=a.xaxis.min),void 0!==a.xaxis.range&&(s.minX=s.maxX-a.xaxis.range),s.minX!==Number.MAX_VALUE&&s.maxX!==-Number.MAX_VALUE?s.xAxisScale=this.scales.linearScale(s.minX,s.maxX,t):(s.xAxisScale=this.scales.linearScale(1,t,t),s.noLabelsProvided&&0i&&(e=Math.floor(u.length/i)),!1),n=!1;switch(o.tickInterval){case"half_year":e=7,"year"===t.unit&&(a=!0);break;case"months":e=1,"year"===t.unit&&(a=!0);break;case"months_fortnight":e=15,"year"!==t.unit&&"month"!==t.unit||(a=!0),30===s&&(n=!0);break;case"months_days":e=10,"month"===t.unit&&(a=!0),30===s&&(n=!0);break;case"week_days":e=8,"month"===t.unit&&(a=!0);break;case"days":e=1,"month"===t.unit&&(a=!0);break;case"hours":"day"===t.unit&&(a=!0);break;case"minutes":s%5!=0&&(n=!0)}if("minutes"===o.tickInterval||"hours"===o.tickInterval){if(!n)return!0}else if((s%e==0||a)&&!n)return!0})}},{key:"recalcDimensionsBasedOnFormat",value:function(t,e){var i=this.w,t=this.formatDates(t),t=this.removeOverlappingTS(t);e?i.globals.invertedTimelineLabels=t.slice():i.globals.timelineLabels=t.slice(),new rt(this.ctx).plotCoords()}},{key:"determineInterval",value:function(t){switch(!0){case 1825r.determineDaysOfMonths(e+1,i)&&(l="month",h=e+=c=1),e}var i=t.firstVal,s=t.currentMonth,a=t.currentYear,n=t.hoursWidthOnXAxis,o=t.numberOfDays,r=new y(this.ctx),l="day",t=(24-i.minHour)*n,h=i=i.minDate+1,c=i,d=e(c,s,a);this.timeScaleArray.push({position:t,value:h,unit:l,year:a,month:K.monthMod(d),day:c});for(var u=t,g=0;gl.determineDaysOfMonths(e+1,n)?e+1:e}var i=t.firstVal,s=t.currentDate,a=t.currentMonth,n=t.currentYear,o=t.minutesWidthOnXAxis,r=t.numberOfHours,l=new y(this.ctx),h="hour",c=60-i.minMinute,d=c*o,u=(t=i.minHour+1)+1,g=(60==c&&(d=0,u=(t=i.minHour)+1),s),p=e(g,a);this.timeScaleArray.push({position:d,value:t,unit:h,day:g,hour:u,year:n,month:K.monthMod(p)});for(var f=d,x=0;xl.determineDaysOfMonths(m+1,n)&&(m+=g=1),p=e(g,p=m));var b=n+Math.floor(p/12)+0,f=0===u&&0===x?c*o:60*o+f,m=0===u?g:u;this.timeScaleArray.push({position:f,value:m,unit:h,hour:u,day:g,year:b,month:K.monthMod(p)}),u++}}},{key:"generateMinuteScale",value:function(t){var e=t.firstVal,i=t.currentMinute,s=t.currentHour,a=t.currentDate,n=t.currentMonth,o=t.currentYear,r=t.minutesWidthOnXAxis,l=t.numberOfMinutes,i=r-(i-e.minMinute),h=(e=e.minMinute+1)+1,c=a,d=n,u=s;this.timeScaleArray.push({position:i,value:e,unit:"minute",day:c,hour:u,minute:h,year:o,month:K.monthMod(d)});for(var g=i,p=0;ps+i+10?(r=e,t):null):t}).filter(function(t){return null!==t})}}]),ft),gt=(t(pt,[{key:"setupElements",value:function(){var t=this.w.globals,e=this.w.config,i=e.chart.type;t.axisCharts=-1<["line","area","bar","rangeBar","candlestick","radar","scatter","bubble","heatmap"].indexOf(i),t.xyCharts=-1<["line","area","bar","rangeBar","candlestick","scatter","bubble"].indexOf(i),t.isBarHorizontal=("bar"===e.chart.type||"rangeBar"===e.chart.type)&&e.plotOptions.bar.horizontal,t.chartClass=".apexcharts"+t.cuid,t.dom.baseEl=this.el,t.dom.elWrap=document.createElement("div"),tt.setAttrs(t.dom.elWrap,{id:t.chartClass.substring(1),class:"apexcharts-canvas "+t.chartClass.substring(1)}),this.el.appendChild(t.dom.elWrap),t.dom.Paper=new window.SVG.Doc(t.dom.elWrap),t.dom.Paper.attr({class:"apexcharts-svg","xmlns:data":"ApexChartsNS",transform:"translate(".concat(e.chart.offsetX,", ").concat(e.chart.offsetY,")")}),t.dom.Paper.node.style.background=e.chart.background,this.setSVGDimensions(),t.dom.elGraphical=t.dom.Paper.group().attr({class:"apexcharts-inner apexcharts-graphical"}),t.dom.elDefs=t.dom.Paper.defs(),t.dom.elLegendWrap=document.createElement("div"),t.dom.elLegendWrap.classList.add("apexcharts-legend"),t.dom.elWrap.appendChild(t.dom.elLegendWrap),t.dom.Paper.add(t.dom.elGraphical),t.dom.elGraphical.add(t.dom.elDefs)}},{key:"plotChartType",value:function(i,t){var s=this.w,e=s.config,a=s.globals,n={series:[],i:[]},o={series:[],i:[]},r={series:[],i:[]},l={series:[],i:[]},h={series:[],i:[]};a.series.map(function(t,e){void 0!==i[e].type?("column"===i[e].type||"bar"===i[e].type?(s.config.plotOptions.bar.horizontal=!1,l.series.push(t),l.i.push(e)):"area"===i[e].type?(o.series.push(t),o.i.push(e)):"line"===i[e].type?(n.series.push(t),n.i.push(e)):"scatter"===i[e].type?(r.series.push(t),r.i.push(e)):"bubble"!==i[e].type&&("candlestick"===i[e].type?(h.series.push(t),h.i.push(e)):console.warn("You have specified an unrecognized chart type. Available types for this propery are line/area/column/bar/scatter/bubble")),a.comboCharts=!0):(n.series.push(t),n.i.push(e))});var c,d=new ht(this.ctx,t),u=new G(this.ctx,t),g=new U(this.ctx),p=new Z(this.ctx),f=new $(this.ctx,t),x=new q(this.ctx),b=[];if(a.comboCharts)0=s.config.grid.row.colors.length&&(h=0);var c=s.config.grid.row.colors[h],c=a.drawRect(0,n,r,o,0,c,s.config.grid.row.opacity);t.add(c),c.node.classList.add("apexcharts-gridRow"),n+=s.globals.gridHeight/i}if(void 0!==s.config.grid.column.colors&&0=s.config.grid.column.colors.length&&(f=0);var x=s.config.grid.column.colors[f];(x=a.drawRect(d,0,u,g,0,x,s.config.grid.column.opacity)).node.classList.add("apexcharts-gridColumn"),t.add(x),d+=s.globals.gridWidth/e}}},{key:"animateLine",value:function(t,e,i){var s=this.w,a=s.config.chart.animations;!a||s.globals.resized||s.globals.dataChanged||(a=a.speed,this.anim.animateLine(t,e,i,a))}}]),ke),Kt=(t(we,[{key:"checkResponsiveConfig",value:function(t){var a,n,e,o=this,r=this.w,i=r.config;0!==i.responsive.length&&((a=i.responsive.slice()).sort(function(t,e){return t.breakpoint>e.breakpoint?1:e.breakpoint>t.breakpoint?-1:0}).reverse(),n=new l({}),e=function(){var t=0o.globals.gridWidth||a>o.globals.gridHeight?(e.classList.remove("hovering-zoom"),e.classList.remove("hovering-pan")):o.globals.zoomEnabled?(e.classList.remove("hovering-pan"),e.classList.add("hovering-zoom")):o.globals.panEnabled&&(e.classList.remove("hovering-zoom"),e.classList.add("hovering-pan")),i=Math.round(s/t),n&&(i=Math.ceil(s/t),--i);for(var e=null,l=[],h=0;hs.globals.gridWidth&&(n=s.globals.gridWidth-i.xcrosshairsWidth):null!==e&&(n+=s.globals.gridWidth/t/2),(n=n<0?0:n)>s.globals.gridWidth&&(n=s.globals.gridWidth),null!==a&&(a.setAttribute("x",n),a.setAttribute("x1",n),a.setAttribute("x2",n),a.setAttribute("y2",s.globals.gridHeight),a.classList.add("active")),i.blxaxisTooltip&&(a=n,"tickWidth"!==s.config.xaxis.crosshairs.width&&"barWidth"!==s.config.xaxis.crosshairs.width||(a=n+i.xcrosshairsWidth/2),this.moveXAxisTooltip(a))}},{key:"moveYCrosshairs",value:function(t){var e=this.ttCtx;null!==e.ycrosshairs&&(tt.setAttrs(e.ycrosshairs,{y1:t,y2:t}),tt.setAttrs(e.ycrosshairsHidden,{y1:t,y2:t}))}},{key:"moveXAxisTooltip",value:function(t){var e,i=this.w,s=this.ttCtx;null!==s.xaxisTooltip&&(s.xaxisTooltip.classList.add("active"),e=s.xaxisOffY+i.config.xaxis.tooltip.offsetY+i.globals.translateY+1+i.config.xaxis.offsetY,t-=s.xaxisTooltip.getBoundingClientRect().width/2,isNaN(t)||(t+=i.globals.translateX,i=new tt(this.ctx).getTextRects(s.xaxisTooltipText.innerHTML),s.xaxisTooltipText.style.minWidth=i.width+"px",s.xaxisTooltip.style.left=t+"px",s.xaxisTooltip.style.top=e+"px"))}},{key:"moveYAxisTooltip",value:function(t){var e=this.w,i=this.ttCtx,s=(null===i.yaxisTTEls&&(i.yaxisTTEls=e.globals.dom.baseEl.querySelectorAll(".apexcharts-yaxistooltip")),parseInt(i.ycrosshairsHidden.getAttribute("y1"))),a=e.globals.translateY+s,n=i.yaxisTTEls[t].getBoundingClientRect().height,s=e.globals.translateYAxisX[t]-2;e.config.yaxis[t].opposite&&(s-=26),a-=n/2,-1===e.globals.ignoreYAxisIndexes.indexOf(t)?(i.yaxisTTEls[t].classList.add("active"),i.yaxisTTEls[t].style.top=a+"px",i.yaxisTTEls[t].style.left=s+e.config.yaxis[t].tooltip.offsetX+"px"):i.yaxisTTEls[t].classList.remove("active")}},{key:"moveTooltip",value:function(t,e){var i=2s.globals.gridWidth/2?t-o.ttWidth-i-15:t)>s.globals.gridWidth-o.ttWidth-10?s.globals.gridWidth-o.ttWidth:t)<-20&&(t=-20),s.config.tooltip.followCursor&&(i=a.getElGrid().getBoundingClientRect(),e=a.e.clientY+s.globals.translateY-i.top-o.ttHeight/2),t=(o=this.positionChecks(o,t,e)).x,e=o.y,isNaN(t)||(t+=s.globals.translateX,n.style.left=t+"px",n.style.top=e+"px")}},{key:"positionChecks",value:function(t,e,i){var s=this.w;return{x:e,y:i=(i=t.ttHeight+i>s.globals.gridHeight?s.globals.gridHeight-t.ttHeight+s.globals.translateY:i)<0?0:i}}},{key:"moveMarkers",value:function(t,e){var i=this.w,s=this.ttCtx;if(0c.globals.gridWidth/2&&(r=s-h.tooltipRect.ttWidth/2+t),h.w.config.tooltip.followCursor)&&(t=h.getElGrid().getBoundingClientRect(),l=h.e.clientY-t.top+c.globals.translateY/2-10),{x:r,y:l}}},{key:"handleMarkerTooltip",value:function(t){var e,i,s,a,n,o=t.e,r=t.opt,l=t.x,h=t.y,c=this.w,d=this.ttCtx;return o.target.classList.contains("apexcharts-marker")&&(n=parseInt(r.paths.getAttribute("cx")),e=parseInt(r.paths.getAttribute("cy")),i=parseFloat(r.paths.getAttribute("val")),a=parseInt(r.paths.getAttribute("rel")),t=parseInt(r.paths.parentNode.parentNode.parentNode.getAttribute("rel"))-1,d.intersect&&(s=K.findAncestor(r.paths,"apexcharts-series"))&&(t=parseInt(s.getAttribute("data:realIndex"))),d.tooltipLabels.drawSeriesTexts({ttItems:r.ttItems,i:t,j:a,shared:!d.showOnIntersect&&c.config.tooltip.shared}),"mouseup"===o.type&&d.markerClick(o,t,a),l=n,h=e+c.globals.translateY-1.4*d.tooltipRect.ttHeight,d.w.config.tooltip.followCursor&&(n=d.getElGrid().getBoundingClientRect(),h=d.e.clientY+c.globals.translateY-n.top),d.marker.enlargeCurrentPoint(a,r.paths,l,h=i<0?e:h)),{x:l,y:h}}},{key:"handleBarTooltip",value:function(t){var e,i=t.e,s=t.opt,a=this.w,n=this.ttCtx,o=n.getElTooltip(),r=0,l=0,h=0,c=this.getBarTooltipXY({e:i,opt:s}),d=c.i,t=c.barHeight,i=c.j;a.globals.isBarHorizontal&&n.hasBars()||!a.config.tooltip.shared?(l=c.x,h=c.y,e=Array.isArray(a.config.stroke.width)?a.config.stroke.width[d]:a.config.stroke.width,r=l):a.globals.comboCharts||a.config.tooltip.shared||(r/=2),isNaN(h)&&(h=a.globals.svgHeight-n.tooltipRect.ttHeight),l+n.tooltipRect.ttWidth>a.globals.gridWidth?l-=n.tooltipRect.ttWidth:l<0&&(l+=n.tooltipRect.ttWidth),n.w.config.tooltip.followCursor&&(c=n.getElGrid().getBoundingClientRect(),h=n.e.clientY-c.top),null===n.tooltip&&(n.tooltip=a.globals.dom.baseEl.querySelector(".apexcharts-tooltip")),a.config.tooltip.shared||(a.globals.comboChartsHasBars?n.tooltipPosition.moveXCrosshairs(r+e/2):n.tooltipPosition.moveXCrosshairs(r)),!n.fixedTooltip&&(!a.config.tooltip.shared||a.globals.isBarHorizontal&&n.hasBars())&&(o.style.left=l+a.globals.translateX+"px",s=parseInt(s.paths.parentNode.getAttribute("data:realIndex")),!(a.globals.isMultipleYAxis?a.config.yaxis[s]&&a.config.yaxis[s].reversed:a.config.yaxis[0].reversed)||a.globals.isBarHorizontal&&n.hasBars()||(h=h+t-2*(a.globals.series[d][i]<0?t:0)),n.tooltipRect.ttHeight+h>a.globals.gridHeight?(h=a.globals.gridHeight-n.tooltipRect.ttHeight+a.globals.translateY,o.style.top=h+"px"):o.style.top=h+a.globals.translateY-n.tooltipRect.ttHeight/2+"px")}},{key:"getBarTooltipXY",value:function(t){var e,i,s,a,n,o=t.e,r=t.opt,l=this.w,h=null,c=this.ttCtx,d=0,u=0,g=0,p=0,f=0,x=o.target.classList;return(x.contains("apexcharts-bar-area")||x.contains("apexcharts-candlestick-area")||x.contains("apexcharts-rangebar-area"))&&(n=(e=o.target).getBoundingClientRect(),i=r.elGrid.getBoundingClientRect(),s=n.height,f=n.height,a=n.width,t=parseInt(e.getAttribute("cx")),x=parseInt(e.getAttribute("cy")),p=parseFloat(e.getAttribute("barWidth")),n=("touchmove"===o.type?o.touches[0]:o).clientX,h=parseInt(e.getAttribute("j")),d=parseInt(e.parentNode.getAttribute("rel"))-1,l.globals.comboCharts&&(d=parseInt(e.parentNode.getAttribute("data:realIndex"))),c.tooltipLabels.drawSeriesTexts({ttItems:r.ttItems,i:d,j:h,shared:!c.showOnIntersect&&l.config.tooltip.shared}),g=l.config.tooltip.followCursor?l.globals.isBarHorizontal?(u=n-i.left+15,x-c.dataPointsDividedHeight+s/2-c.tooltipRect.ttHeight/2):(u=l.globals.isXNumeric?t-a/2:t-c.dataPointsDividedWidth+a/2,o.clientY-i.top-c.tooltipRect.ttHeight/2-15):l.globals.isBarHorizontal?((u=t)a.top+a.height)this.handleMouseOut(i);else{if(Array.isArray(this.tConfig.enabledOnSeries)&&!s.config.tooltip.shared){var r=parseInt(i.paths.getAttribute("index"));if(this.tConfig.enabledOnSeries.indexOf(r)<0)return void this.handleMouseOut(i)}var l,h,t=this.getElTooltip(),a=this.getElXCrosshairs(),r=s.globals.xyCharts||"bar"===s.config.chart.type&&!s.globals.isBarHorizontal&&this.hasBars()&&this.tConfig.shared||s.globals.comboCharts&&this.hasBars;if(s.globals.isBarHorizontal&&this.hasBars()&&(r=!1),"mousemove"===e.type||"touchmove"===e.type||"mouseup"===e.type){if(null!==a&&a.classList.add("active"),null!==this.ycrosshairs&&this.blyaxisTooltip&&this.ycrosshairs.classList.add("active"),r&&!this.showOnIntersect){var c=(r=this.tooltipUtil.getNearestValues({context:this,hoverArea:i.hoverArea,elGrid:i.elGrid,clientX:n,clientY:o,hasBars:this.hasBars})).j,n=r.capturedSeries;if(r.hoverX<0||r.hoverX>s.globals.gridWidth)return void this.handleMouseOut(i);if(null!==n){if(null===s.globals.series[n][c])return void i.tooltipEl.classList.remove("active");void 0!==s.globals.series[n][c]?this.tConfig.shared&&this.tooltipUtil.isXoverlap(c)&&this.tooltipUtil.isinitialSeriesSameLen()?this.create(e,this,n,c,i.ttItems):this.create(e,this,n,c,i.ttItems,!1):this.tooltipUtil.isXoverlap(c)&&this.create(e,this,0,c,i.ttItems)}else this.tooltipUtil.isXoverlap(c)&&this.create(e,this,0,c,i.ttItems)}else"heatmap"===s.config.chart.type?(l=(c=this.intersect.handleHeatTooltip({e:e,opt:i,x:l,y:h})).x,h=c.y,t.style.left=l+"px",t.style.top=h+"px"):(this.hasBars&&this.intersect.handleBarTooltip({e:e,opt:i}),this.hasMarkers&&this.intersect.handleMarkerTooltip({e:e,opt:i,x:l,y:h}));if(this.blyaxisTooltip)for(var d=0;d\n \n \n\n',title:this.localeValues.zoomIn,class:"apexcharts-zoom-in-icon"}),this.t.zoomout&&t.config.chart.zoom.enabled&&s.push({el:this.elZoomOut,icon:"string"==typeof this.t.zoomout?this.t.zoomout:'\n \n \n\n',title:this.localeValues.zoomOut,class:"apexcharts-zoom-out-icon"}),this.t.zoom&&t.config.chart.zoom.enabled&&s.push({el:this.elZoom,icon:"string"==typeof this.t.zoom?this.t.zoom:'\n \n \n \n',title:this.localeValues.selectionZoom,class:t.globals.isTouchDevice?"hidden":"apexcharts-zoom-icon"}),this.t.selection&&t.config.chart.selection.enabled&&s.push({el:this.elSelection,icon:"string"==typeof this.t.selection?this.t.selection:'\n \n \n',title:this.localeValues.selection,class:t.globals.isTouchDevice?"hidden":"apexcharts-selection-icon"}),this.t.pan&&t.config.chart.zoom.enabled&&s.push({el:this.elPan,icon:"string"==typeof this.t.pan?this.t.pan:'\n \n \n \n \n \n \n \n',title:this.localeValues.pan,class:t.globals.isTouchDevice?"hidden":"apexcharts-pan-icon"}),this.t.reset&&t.config.chart.zoom.enabled&&s.push({el:this.elZoomReset,icon:"string"==typeof this.t.reset?this.t.reset:'\n \n \n',title:this.localeValues.reset,class:"apexcharts-reset-zoom-icon"}),this.t.download&&s.push({el:this.elMenuIcon,icon:"string"==typeof this.t.download?this.t.download:'',title:this.localeValues.menu,class:"apexcharts-menu-icon"});for(var a=0;as.globals.gridWidth?l=s.globals.gridWidth-o:a.clientX-n.left<0&&(l=o),o>a.clientX-n.left&&(c=-(l=Math.abs(l))),r>a.clientY-n.top&&(t=-(h=Math.abs(h))),e="x"===i?{x:o,y:0,width:l,height:s.globals.gridHeight,translateX:c,translateY:0}:"y"===i?{x:0,y:r,width:s.globals.gridWidth,height:h,translateX:0,translateY:t}:{x:o,y:r,width:l,height:h,translateX:c,translateY:t},a.drawSelectionRect(e),a.selectionDragging("resizing"),e}},{key:"selectionDragging",value:function(t,e){var n=this,o=this.w,r=this.xyRatios,l=this.selectionRect,t="resizing"===t?30:0;"function"==typeof o.config.chart.events.selection&&o.globals.selectionEnabled&&(clearTimeout(this.w.globals.selectionResizeTimer),this.w.globals.selectionResizeTimer=window.setTimeout(function(){var t=n.gridRect.getBoundingClientRect(),e=l.node.getBoundingClientRect(),i=o.globals.xAxisScale.niceMin+(e.left-t.left)*r.xRatio,s=o.globals.xAxisScale.niceMin+(e.right-t.left)*r.xRatio,a=o.globals.yAxisScale[0].niceMin+(t.bottom-e.bottom)*r.yRatio[0],t=o.globals.yAxisScale[0].niceMax-(e.top-t.top)*r.yRatio[0];o.config.chart.events.selection(n.ctx,{xaxis:{min:i,max:s},yaxis:{min:a,max:t}})},t))}},{key:"selectionDrawn",value:function(t){var e=t.context,i=t.zoomtype,s=this.w,a=e,n=this.xyRatios,t=this.ctx.toolbar;a.startX>a.endX&&(c=a.startX,a.startX=a.endX,a.endX=c),a.startY>a.endY&&(o=a.startY,a.startY=a.endY,a.endY=o);var o,r,l,h,e=s.globals.xAxisScale.niceMin+a.startX*n.xRatio,c=s.globals.xAxisScale.niceMin+a.endX*n.xRatio,d=[],u=[];s.config.yaxis.forEach(function(t,e){d.push(Math.floor(s.globals.yAxisScale[e].niceMax-n.yRatio[e]*a.startY)),u.push(Math.floor(s.globals.yAxisScale[e].niceMax-n.yRatio[e]*a.endY))}),a.dragged&&(10Math.abs(s)&&0Math.abs(s)&&i<0?e="right":Math.abs(s)>Math.abs(i)&&0Math.abs(i)&&s<0&&(e="down")),a.globals.lastClientPosition={x:t.clientX,y:t.clientY},a.globals.minX),a=a.globals.maxX;t.panScrolled(e,s,a)}},{key:"panScrolled",value:function(t,e,i){var s=this.w,a=this.xyRatios,n=K.clone(s.globals.initialConfig.yaxis);"left"===t?(e=s.globals.minX+s.globals.gridWidth/15*a.xRatio,i=s.globals.maxX+s.globals.gridWidth/15*a.xRatio):"right"===t&&(e=s.globals.minX-s.globals.gridWidth/15*a.xRatio,i=s.globals.maxX-s.globals.gridWidth/15*a.xRatio),(es.globals.initialmaxX)&&(e=s.globals.minX,i=s.globals.maxX),a={min:e,max:i},s.config.chart.zoom.autoScaleYaxis&&(n=new ct(this.ctx).autoScaleY(this.ctx,n,{xaxis:a})),a={xaxis:{min:e,max:i}},s.config.chart.group||(a[n]=n),this.ctx._updateOptions(a,!1,!1),"function"==typeof s.config.chart.events.scrolled&&s.config.chart.events.scrolled(this.ctx,{xaxis:{min:e,max:i}})}}]),v),ce=(t(de,[{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,s=e.globals.svgWidth/2,a=i.offsetY,n="middle";"left"===i.align?(s=10,n="start"):"right"===i.align&&(s=e.globals.svgWidth-10,n="end"),s+=i.offsetX,a=a+parseInt(i.style.fontSize)+2,void 0!==i.text&&((i=new tt(this.ctx).drawText({x:s,y:a,text:i.text,textAnchor:n,fontSize:i.style.fontSize,fontFamily:i.style.fontFamily,foreColor:i.style.color,opacity:1})).node.setAttribute("class","apexcharts-".concat(t,"-text")),e.globals.dom.Paper.add(i))}}]),de);function de(t){s(this,de),this.ctx=t,this.w=t.w}function v(t){var e;return s(this,v),(e=a(this,i(v).call(this,t))).ctx=t,e.w=t.w,e.dragged=!1,e.graphics=new tt(e.ctx),e.eventList=["mousedown","mouseleave","mousemove","touchstart","touchmove","mouseup","touchend"],e.clientX=0,e.clientY=0,e.startX=0,e.endX=0,e.dragX=0,e.startY=0,e.endY=0,e.dragY=0,e}function ue(t){s(this,ue),this.ctx=t,this.w=t.w,this.ev=this.w.config.chart.events,this.localeValues=this.w.globals.locale.toolbar}function ge(t){s(this,ge),this.ctx=t,this.w=t.w,t=this.w,this.tConfig=t.config.tooltip,this.tooltipUtil=new ee(this),this.tooltipLabels=new ie(this),this.tooltipPosition=new se(this),this.marker=new ae(this),this.intersect=new ne(this),this.axesTooltip=new oe(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=!t.globals.isBarHorizontal&&this.tConfig.shared}function pe(t){s(this,pe),this.w=t.w,this.ttCtx=t}function fe(t){s(this,fe),this.w=t.w,this.ttCtx=t}function xe(t){s(this,xe),this.w=t.w,this.ttCtx=t,this.ctx=t.ctx,this.tooltipPosition=new se(t)}function be(t){s(this,be),this.ttCtx=t,this.ctx=t.ctx,this.w=t.w}function me(t){s(this,me),this.w=t.w,this.ctx=t.ctx,this.ttCtx=t,this.tooltipUtil=new ee(t)}function ye(t){s(this,ye),this.w=t.w,this.ttCtx=t,this.ctx=t.ctx}function ve(t){s(this,ve),this.ctx=t,this.w=t.w,this.colors=[]}function we(t){s(this,we),this.ctx=t,this.w=t.w}function ke(t){s(this,ke),this.ctx=t,this.w=t.w,t=this.w,this.anim=new z(this.ctx),this.xaxisLabels=t.globals.labels.slice(),this.animX=t.config.grid.xaxis.lines.animate&&t.config.chart.animations.enabled,this.animY=t.config.grid.yaxis.lines.animate&&t.config.chart.animations.enabled,0this.destination.length;)this.destination.push(i);for(;this.value.lengthi.x&&e>i.y&&t/,"").replace(/<\/svg>$/,"");e.innerHTML=""+t.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2>")+"";for(var i=0,s=e.firstChild.childNodes.length;i":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)}},d.morph=function(i){return function(t,e){return new d.MorphObj(t,e).at(i)}},d.Situation=d.invent({create:function(t){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new d.Number(t.duration).valueOf(),this.delay=new d.Number(t.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=t.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),d.FX=d.invent({create:function(t){this._target=t,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(t,e,i){return"object"===C(t)&&(e=t.ease,i=t.delay,t=t.duration),e=new d.Situation({duration:t||1e3,delay:i||0,ease:d.easing[e||"-"]||e}),this.queue(e),this},delay:function(t){return t=new d.Situation({duration:t,delay:0,ease:d.easing["-"]}),this.queue(t)},target:function(t){return t&&t instanceof d.Element?(this._target=t,this):this._target},timeToAbsPos:function(t){return(t-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(t){return this.situation.duration/this._speed*t+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=a.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){a.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(t){return("function"==typeof t||t instanceof d.Situation)&&this.situations.push(t),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof d.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var t,e,i,s=this.situation;if(!s.init){for(t in s.animations)for(i=this.target()[t](),Array.isArray(i)||(i=[i]),Array.isArray(s.animations[t])||(s.animations[t]=[s.animations[t]]),e=i.length;e--;)s.animations[t][e]instanceof d.Number&&(i[e]=new d.Number(i[e])),s.animations[t][e]=i[e].morph(s.animations[t][e]);for(t in s.attrs)s.attrs[t]=new d.MorphObj(this.target().attr(t),s.attrs[t]);for(t in s.styles)s.styles[t]=new d.MorphObj(this.target().style(t),s.styles[t]);s.initialTransformation=this.target().matrixify(),s.init=!0}return this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(t,e){var i=this.active;return this.active=!1,e&&this.clearQueue(),t&&this.situation&&(i||this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){var t;return this.situation&&(t=this.situation,this.stop(),this.situation=t,this.atStart()),this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return!0===this.situation.loops&&(this.situation.loops=this.situation.loop+1),"number"==typeof this.situation.loops?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(t,e){var i=this.situation.duration/this._speed;return this.absPos=t,e||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*i,this.situation.finish=this.situation.start+i,this.step(!0)},speed:function(t){return 0===t?this.pause():t?(this._speed=t,this.at(this.absPos,!0)):this._speed},loop:function(t,e){var i=this.last();return i.loops=null==t||t,i.loop=0,e&&(i.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(t){var e=this.last();return e.reversed=void 0===t?!e.reversed:t,this},progress:function(t){return t?this.situation.ease(this.pos):this.pos},after:function(i){var s=this.last();return this.target().on("finished.fx",function t(e){e.detail.situation==s&&(i.call(this,s),this.off("finished.fx",t))}),this._callStart()},during:function(e){function t(t){t.detail.situation==i&&e.call(this,t.detail.pos,d.morph(t.detail.pos),t.detail.eased,i)}var i=this.last();return this.target().off("during.fx",t).on("during.fx",t),this.after(function(){this.off("during.fx",t)}),this._callStart()},afterAll:function(e){function i(t){e.call(this),this.off("allfinished.fx",i)}return this.target().off("allfinished.fx",i).on("allfinished.fx",i),this._callStart()},duringAll:function(e){function t(t){e.call(this,t.detail.pos,d.morph(t.detail.pos),t.detail.eased,t.detail.situation)}return this.target().off("during.fx",t).on("during.fx",t),this.afterAll(function(){this.off("during.fx",t)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(t,e,i){return this.last()[i||"animations"][t]=e,this._callStart()},step:function(t){var e,i;t||(this.absPos=this.timeToAbsPos(+new Date)),!1!==this.situation.loops?(e=Math.max(this.absPos,0),t=Math.floor(e),!0===this.situation.loops||tthis.lastPos&&s<=a&&(this.situation.once[s].call(this.target(),this.pos,a),delete this.situation.once[s]);return this.active&&this.target().fire("during",{pos:this.pos,eased:a,fx:this,situation:this.situation}),this.situation&&(this.eachAt(),1==this.pos&&!this.situation.reversed||this.situation.reversed&&0==this.pos?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length)||(this.target().off(".fx"),this.active=!1),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=a),this},eachAt:function(){var t,e,i=this,s=this.target(),a=this.situation;for(t in a.animations)o=[].concat(a.animations[t]).map(function(t){return"string"!=typeof t&&t.at?t.at(a.ease(i.pos),i.pos):t}),s[t].apply(s,o);for(t in a.attrs)o=[t].concat(a.attrs[t]).map(function(t){return"string"!=typeof t&&t.at?t.at(a.ease(i.pos),i.pos):t}),s.attr.apply(s,o);for(t in a.styles)o=[t].concat(a.styles[t]).map(function(t){return"string"!=typeof t&&t.at?t.at(a.ease(i.pos),i.pos):t}),s.style.apply(s,o);if(a.transforms.length){for(o=a.initialTransformation,t=0,e=a.transforms.length;ts/a?this.height/a:this.width/s,this.x=e,this.y=i,this.width=s,this.height=a)}else t="string"==typeof t?t.match(c).map(function(t){return parseFloat(t)}):Array.isArray(t)?t:"object"===C(t)?[t.x,t.y,t.width,t.height]:4==arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(t,e,i,s){return this.destination=new d.ViewBox(t,e,i,s),this},at:function(t){return this.destination?new d.ViewBox([this.x+(this.destination.x-this.x)*t,this.y+(this.destination.y-this.y)*t,this.width+(this.destination.width-this.width)*t,this.height+(this.destination.height-this.height)*t]):this}},parent:d.Container,construct:{viewbox:function(t,e,i,s){return 0==arguments.length?new d.ViewBox(this):this.attr("viewBox",new d.ViewBox(t,e,i,s))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(e){d.Element.prototype[e]=function(t){return d.on(this.node,e,t),this}}),d.listeners=[],d.handlerMap=[],d.listenerId=0,d.on=function(t,e,i,s,a){var n=i.bind(s||t.instance||t),o=(d.handlerMap.indexOf(t)+1||d.handlerMap.push(t))-1,s=e.split(".")[0],e=e.split(".")[1]||"*";d.listeners[o]=d.listeners[o]||{},d.listeners[o][s]=d.listeners[o][s]||{},d.listeners[o][s][e]=d.listeners[o][s][e]||{},i._svgjsListenerId||(i._svgjsListenerId=++d.listenerId),d.listeners[o][s][e][i._svgjsListenerId]=n,t.addEventListener(s,n,a||!1)},d.off=function(t,e,i){var s=d.handlerMap.indexOf(t),a=e&&e.split(".")[0],n=e&&e.split(".")[1],o="";if(-1!=s)if(i)(i="function"==typeof i?i._svgjsListenerId:i)&&d.listeners[s][a]&&d.listeners[s][a][n||"*"]&&(t.removeEventListener(a,d.listeners[s][a][n||"*"][i],!1),delete d.listeners[s][a][n||"*"][i]);else if(n&&a){if(d.listeners[s][a]&&d.listeners[s][a][n]){for(i in d.listeners[s][a][n])d.off(t,[a,n].join("."),i);delete d.listeners[s][a][n]}}else if(n)for(e in d.listeners[s])for(o in d.listeners[s][e])n===o&&d.off(t,[e,n].join("."));else if(a){if(d.listeners[s][a]){for(o in d.listeners[s][a])d.off(t,[a,o].join("."));delete d.listeners[s][a]}}else{for(e in d.listeners[s])d.off(t,e);delete d.listeners[s],delete d.handlerMap[s]}},d.extend(d.Element,{on:function(t,e,i,s){return d.on(this.node,t,e,i,s),this},off:function(t,e){return d.off(this.node,t,e),this},fire:function(t,e){return t instanceof a.Event?this.node.dispatchEvent(t):this.node.dispatchEvent(t=new d.CustomEvent(t,{detail:e,cancelable:!0})),this._event=t,this},event:function(){return this._event}}),d.Defs=d.invent({create:"defs",inherit:d.Container}),d.G=d.invent({create:"g",inherit:d.Container,extend:{x:function(t){return null==t?this.transform("x"):this.transform({x:t-this.x()},!0)},y:function(t){return null==t?this.transform("y"):this.transform({y:t-this.y()},!0)},cx:function(t){return null==t?this.gbox().cx:this.x(t-this.gbox().width/2)},cy:function(t){return null==t?this.gbox().cy:this.y(t-this.gbox().height/2)},gbox:function(){var t=this.bbox(),e=this.transform();return t.x+=e.x,t.x2+=e.x,t.cx+=e.x,t.y+=e.y,t.y2+=e.y,t.cy+=e.y,t}},construct:{group:function(){return this.put(new d.G)}}}),d.Doc=d.invent({create:function(t){t&&("svg"==(t="string"==typeof t?n.getElementById(t):t).nodeName?this.constructor.call(this,t):(this.constructor.call(this,d.create("svg")),t.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:d.Container,extend:{namespace:function(){return this.attr({xmlns:d.ns,version:"1.1"}).attr("xmlns:xlink",d.xlink,d.xmlns).attr("xmlns:svgjs",d.svgjs,d.xmlns)},defs:function(){var t;return this._defs||((t=this.node.getElementsByTagName("defs")[0])?this._defs=d.adopt(t):this._defs=new d.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&"#document"!=this.node.parentNode.nodeName?this.node.parentNode:null},spof:function(){var t=this.node.getScreenCTM();return t&&this.style("left",-t.e%1+"px").style("top",-t.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,d.parser.draw&&!d.parser.draw.parentNode&&this.node.appendChild(d.parser.draw),this},clone:function(t){this.writeDataToDom();var e=this.node,i=x(e.cloneNode(!0));return t?(t.node||t).appendChild(i.node):e.parentNode.insertBefore(i.node,e.nextSibling),i}}}),d.extend(d.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var t=this.position()+1,e=this.parent();return e.removeElement(this).add(this,t),e instanceof d.Doc&&e.node.appendChild(e.defs().node),this},backward:function(){var t=this.position();return 0n.maxX-e.width&&(o=(s=n.maxX-e.width)-this.startPoints.box.x),null!=n.minY&&an.maxY-e.height&&(r=(a=n.maxY-e.height)-this.startPoints.box.y),null!=n.snapToGrid&&(s-=s%n.snapToGrid,a-=a%n.snapToGrid,o-=o%n.snapToGrid,r-=r%n.snapToGrid),this.el instanceof SVG.G?this.el.matrix(this.startPoints.transform).transform({x:o,y:r},!0):this.el.move(s,a))),i},s.prototype.end=function(t){var e=this.drag(t);this.el.fire("dragend",{event:t,p:e,m:this.m,handler:this}),SVG.off(window,"mousemove.drag"),SVG.off(window,"touchmove.drag"),SVG.off(window,"mouseup.drag"),SVG.off(window,"touchend.drag")},SVG.extend(SVG.Element,{draggable:function(t,e){"function"!=typeof t&&"object"!=typeof t||(e=t,t=!0);var i=this.remember("_draggable")||new s(this);return(t=void 0===t||t)?i.init(e||{},t):(this.off("mousedown.drag"),this.off("touchstart.drag")),this}})}.call(void 0),w.prototype.init=function(t,e){var i,s=this.el.bbox();for(i in this.options={},this.el.selectize.defaults)this.options[i]=this.el.selectize.defaults[i],void 0!==e[i]&&(this.options[i]=e[i]);this.parent=this.el.parent(),this.nested=this.nested||this.parent.group(),this.nested.matrix(new SVG.Matrix(this.el).translate(s.x,s.y)),this.options.deepSelect&&-1!==["line","polyline","polygon"].indexOf(this.el.type)?this.selectPoints(t):this.selectRect(t),this.observe(),this.cleanup()},w.prototype.selectPoints=function(t){return this.pointSelection.isSelected=t,this.pointSelection.set||(this.pointSelection.set=this.parent.set(),this.drawCircles()),this},w.prototype.getPointArray=function(){var e=this.el.bbox();return this.el.array().valueOf().map(function(t){return[t[0]-e.x,t[1]-e.y]})},w.prototype.drawCircles=function(){for(var a=this,t=this.getPointArray(),e=0,i=t.length;e