/* Highcharts Gantt JS v8.2.2 (2020-10-22) GridAxis (c) 2016-2019 Lars A. V. Cabrera License: www.highcharts.com/license */ (function(e){"object"===typeof module&&module.exports?(e["default"]=e,module.exports=e):"function"===typeof define&&define.amd?define("highcharts/modules/grid-axis",["highcharts"],function(n){e(n);e.Highcharts=n;return e}):e("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(e){function n(e,v,n,A){e.hasOwnProperty(v)||(e[v]=A.apply(null,n))}e=e?e._modules:{};n(e,"Core/Axis/GridAxis.js",[e["Core/Axis/Axis.js"],e["Core/Globals.js"],e["Core/Options.js"],e["Core/Axis/Tick.js"],e["Core/Utilities.js"]], function(e,n,B,A,m){var h=m.addEvent,q=m.defined,v=m.erase,D=m.find,E=m.isArray,w=m.isNumber,x=m.merge,z=m.pick,F=m.timeUnits,C=m.wrap;B=n.Chart;var G=function(b){var a=b.options;a.labels||(a.labels={});a.labels.align=z(a.labels.align,"center");b.categories||(a.showLastLabel=!1);b.labelRotation=0;a.labels.rotation=0};"";e.prototype.getMaxLabelDimensions=function(b,a){var c={width:0,height:0};a.forEach(function(a){a=b[a];if(m.isObject(a,!0)){var d=m.isObject(a.label,!0)?a.label:{};a=d.getBBox?d.getBBox().height: 0;d.textStr&&!w(d.textPxLength)&&(d.textPxLength=d.getBBox().width);var f=w(d.textPxLength)?Math.round(d.textPxLength):0;d.textStr&&(f=Math.round(d.getBBox().width));c.height=Math.max(a,c.height);c.width=Math.max(f,c.width)}});return c};n.dateFormats.W=function(b){b=new this.Date(b);var a=(this.get("Day",b)+6)%7,c=new this.Date(b.valueOf());this.set("Date",c,this.get("Date",b)-a+3);a=new this.Date(this.get("FullYear",c),0,1);4!==this.get("Day",a)&&(this.set("Month",b,0),this.set("Date",b,1+(11-this.get("Day", a))%7));return(1+Math.floor((c.valueOf()-a.valueOf())/6048E5)).toString()};n.dateFormats.E=function(b){return this.dateFormat("%a",b,!0).charAt(0)};h(B,"afterSetChartSize",function(){this.axes.forEach(function(b){(b.grid&&b.grid.columns||[]).forEach(function(a){a.setAxisSize();a.setAxisTranslation()})})});h(A,"afterGetLabelPosition",function(b){var a=this.label,c=this.axis,d=c.reversed,g=c.chart,f=c.options.grid||{},k=c.options.labels,e=k.align,l=y.Side[c.side],p=b.tickmarkOffset,u=c.tickPositions, r=this.pos-p;u=w(u[b.index+1])?u[b.index+1]-p:c.max+p;var t=c.tickSize("tick");p=t?t[0]:0;t=t?t[1]/2:0;if(!0===f.enabled){if("top"===l){f=c.top+c.offset;var h=f-p}else"bottom"===l?(h=g.chartHeight-c.bottom+c.offset,f=h+p):(f=c.top+c.len-c.translate(d?u:r),h=c.top+c.len-c.translate(d?r:u));"right"===l?(l=g.chartWidth-c.right+c.offset,d=l+p):"left"===l?(d=c.left+c.offset,l=d-p):(l=Math.round(c.left+c.translate(d?u:r))-t,d=Math.round(c.left+c.translate(d?r:u))-t);this.slotWidth=d-l;b.pos.x="left"=== e?l:"right"===e?d:l+(d-l)/2;b.pos.y=h+(f-h)/2;g=g.renderer.fontMetrics(k.style.fontSize,a.element);a=a.getBBox().height;k.useHTML?b.pos.y+=g.b+-(a/2):(a=Math.round(a/g.h),b.pos.y+=(g.b-(g.h-g.f))/2+-((a-1)*g.h/2));b.pos.x+=c.horiz&&k.x||0}});var H=function(){function b(a){this.axis=a}b.prototype.isOuterAxis=function(){var a=this.axis,c=a.grid.columnIndex,b=a.linkedParent&&a.linkedParent.grid.columns||a.grid.columns,g=c?a.linkedParent:a,f=-1,k=0;a.chart[a.coll].forEach(function(c,b){c.side!==a.side|| c.options.isInternal||(k=b,c===g&&(f=b))});return k===f&&(w(c)?b.length===c:!0)};b.prototype.renderBorder=function(a){var c=this.axis,b=c.chart.renderer,g=c.options;a=b.path(a).addClass("highcharts-axis-line").add(c.axisBorder);b.styledMode||a.attr({stroke:g.lineColor,"stroke-width":g.lineWidth,zIndex:7});return a};return b}(),y=function(){function b(){}b.compose=function(a){e.keepProps.push("grid");C(a.prototype,"unsquish",b.wrapUnsquish);h(a,"init",b.onInit);h(a,"afterGetOffset",b.onAfterGetOffset); h(a,"afterGetTitlePosition",b.onAfterGetTitlePosition);h(a,"afterInit",b.onAfterInit);h(a,"afterRender",b.onAfterRender);h(a,"afterSetAxisTranslation",b.onAfterSetAxisTranslation);h(a,"afterSetOptions",b.onAfterSetOptions);h(a,"afterSetOptions",b.onAfterSetOptions2);h(a,"afterSetScale",b.onAfterSetScale);h(a,"afterTickSize",b.onAfterTickSize);h(a,"trimTicks",b.onTrimTicks);h(a,"destroy",b.onDestroy)};b.onAfterGetOffset=function(){var a=this.grid;(a&&a.columns||[]).forEach(function(a){a.getOffset()})}; b.onAfterGetTitlePosition=function(a){if(!0===(this.options.grid||{}).enabled){var c=this.axisTitle,d=this.height,g=this.horiz,f=this.left,k=this.offset,e=this.opposite,l=this.options.title,p=void 0===l?{}:l;l=this.top;var h=this.width,r=this.tickSize(),t=c&&c.getBBox().width,m=p.x||0,n=p.y||0,q=z(p.margin,g?5:10);c=this.chart.renderer.fontMetrics(p.style&&p.style.fontSize,c).f;r=(g?l+d:f)+(g?1:-1)*(e?-1:1)*(r?r[0]/2:0)+(this.side===b.Side.bottom?c:0);a.titlePosition.x=g?f-t/2-q+m:r+(e?h:0)+k+m;a.titlePosition.y= g?r-(e?d:0)+(e?c:-c)/2+k+n:l-q+n}};b.onAfterInit=function(){var a=this.chart,c=this.options.grid;c=void 0===c?{}:c;var b=this.userOptions;c.enabled&&(G(this),C(this,"labelFormatter",function(a){var c=this.axis,b=this.value,d=c.tickPositions,g=(c.isLinked?c.linkedParent:c).series[0],f=b===d[0];d=b===d[d.length-1];var e=g&&D(g.options.data,function(a){return a[c.isXAxis?"x":"y"]===b});if(e&&g.is("gantt")){var k=x(e);n.seriesTypes.gantt.prototype.setGanttPointAliases(k)}this.isFirst=f;this.isLast=d; this.point=k;return a.call(this)}));if(c.columns)for(var g=this.grid.columns=[],f=this.grid.columnIndex=0;++fc?this.ticks[f].label.hide():this.ticks[f].label.show(),d-a>c?this.ticks[d].label.hide():this.ticks[d].label.show(),d-ae&&!a.startOnTick&&(d[0]=e),f>h&&f-l