/* Highcharts Gantt JS v8.0.0 (2019-12-10) GridAxis (c) 2016-2019 Lars A. V. Cabrera License: www.highcharts.com/license */ (function(f){"object"===typeof module&&module.exports?(f["default"]=f,module.exports=f):"function"===typeof define&&define.amd?define("highcharts/modules/grid-axis",["highcharts"],function(l){f(l);f.Highcharts=l;return f}):f("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(f){function l(f,q,e,l){f.hasOwnProperty(q)||(f[q]=l.apply(null,e))}f=f?f._modules:{};l(f,"parts-gantt/GridAxis.js",[f["parts/Globals.js"],f["parts/Utilities.js"]],function(f,q){var e=q.defined,l=q.erase,B=q.isArray, v=q.isNumber,w=q.pick,C=q.wrap,u=f.addEvent,F=f.dateFormat,p=function(a){return q.isObject(a,!0)},x=f.merge,G=f.Chart,k=f.Axis,H=f.Tick,I=function(a){var b=a.options;b.labels||(b.labels={});b.labels.align=w(b.labels.align,"center");a.categories||(b.showLastLabel=!1);a.labelRotation=0;b.labels.rotation=0},y={top:0,right:1,bottom:2,left:3,0:"top",1:"right",2:"bottom",3:"left"};k.prototype.isOuterAxis=function(){var a=this,b=a.columnIndex,c=a.linkedParent&&a.linkedParent.columns||a.columns,g=b?a.linkedParent: a,d=-1,m=0;a.chart[a.coll].forEach(function(b,c){b.side!==a.side||b.options.isInternal||(m=c,b===g&&(d=c))});return m===d&&(v(b)?c.length===b:!0)};k.prototype.getMaxLabelDimensions=function(a,b){var c={width:0,height:0};b.forEach(function(b){b=a[b];if(p(b)){var d=p(b.label)?b.label:{};b=d.getBBox?d.getBBox().height:0;d.textStr&&!v(d.textPxLength)&&(d.textPxLength=d.getBBox().width);d=v(d.textPxLength)?Math.round(d.textPxLength):0;c.height=Math.max(b,c.height);c.width=Math.max(d,c.width)}});return c}; f.dateFormats.W=function(a){a=new Date(a);a.setHours(0,0,0,0);a.setDate(a.getDate()-(a.getDay()||7));var b=new Date(a.getFullYear(),0,1);return Math.ceil(((a-b)/864E5+1)/7)};f.dateFormats.E=function(a){return F("%a",a,!0).charAt(0)};u(H,"afterGetLabelPosition",function(a){var b=this.label,c=this.axis,g=c.reversed,d=c.chart,m=c.options,f=m&&p(m.grid)?m.grid:{};m=c.options.labels;var z=m.align,h=y[c.side],n=a.tickmarkOffset,r=c.tickPositions,A=this.pos-n;r=v(r[a.index+1])?r[a.index+1]-n:c.max+n;var t= c.tickSize("tick",!0);n=B(t)?t[0]:0;t=t&&t[1]/2;if(!0===f.enabled){if("top"===h){f=c.top+c.offset;var e=f-n}else"bottom"===h?(e=d.chartHeight-c.bottom+c.offset,f=e+n):(f=c.top+c.len-c.translate(g?r:A),e=c.top+c.len-c.translate(g?A:r));"right"===h?(h=d.chartWidth-c.right+c.offset,g=h+n):"left"===h?(g=c.left+c.offset,h=g-n):(h=Math.round(c.left+c.translate(g?r:A))-t,g=Math.round(c.left+c.translate(g?A:r))-t);this.slotWidth=g-h;a.pos.x="left"===z?h:"right"===z?g:h+(g-h)/2;a.pos.y=e+(f-e)/2;d=d.renderer.fontMetrics(m.style.fontSize, b.element);b=b.getBBox().height;m.useHTML?a.pos.y+=d.b+-(b/2):(b=Math.round(b/d.h),a.pos.y+=(d.b-(d.h-d.f))/2+-((b-1)*d.h/2));a.pos.x+=c.horiz&&m.x||0}});u(k,"afterTickSize",function(a){var b=this.defaultLeftAxisOptions,c=this.horiz,g=this.options.grid;g=void 0===g?{}:g;var d=this.maxLabelDimensions;g.enabled&&(b=2*Math.abs(b.labels.x),c=c?g.cellHeight||b+d.height:b+d.width,B(a.tickSize)?a.tickSize[0]=c:a.tickSize=[c])});u(k,"afterGetTitlePosition",function(a){var b=this.options;if(!0===(b&&p(b.grid)? b.grid:{}).enabled){var c=this.axisTitle,g=c&&c.getBBox().width,d=this.horiz,f=this.left,D=this.top,z=this.width,h=this.height,n=b.title;b=this.opposite;var r=this.offset,e=this.tickSize()||[0],t=n.x||0,k=n.y||0,l=w(n.margin,d?5:10);c=this.chart.renderer.fontMetrics(n.style&&n.style.fontSize,c).f;e=(d?D+h:f)+e[0]/2*(b?-1:1)*(d?1:-1)+(this.side===y.bottom?c:0);a.titlePosition.x=d?f-g/2-l+t:e+(b?z:0)+r+t;a.titlePosition.y=d?e-(b?h:0)+(b?c:-c)/2+r+k:D-l+k}});C(k.prototype,"unsquish",function(a){var b= this.options;return!0===(b&&p(b.grid)?b.grid:{}).enabled&&this.categories?this.tickInterval:a.apply(this,Array.prototype.slice.call(arguments,1))});u(k,"afterSetOptions",function(a){var b=this.options;a=a.userOptions;var c=b&&p(b.grid)?b.grid:{};if(!0===c.enabled){var g=x(!0,{className:"highcharts-grid-axis "+(a.className||""),dateTimeLabelFormats:{hour:{list:["%H:%M","%H"]},day:{list:["%A, %e. %B","%a, %e. %b","%E"]},week:{list:["Week %W","W%W"]},month:{list:["%B","%b","%o"]}},grid:{borderWidth:1}, labels:{padding:2,style:{fontSize:"13px"}},margin:0,title:{text:null,reserveSpace:!1,rotation:0},units:[["millisecond",[1,10,100]],["second",[1,10]],["minute",[1,5,15]],["hour",[1,6]],["day",[1]],["week",[1]],["month",[1]],["year",null]]},a);"xAxis"===this.coll&&(e(a.linkedTo)&&!e(a.tickPixelInterval)&&(g.tickPixelInterval=350),e(a.tickPixelInterval)||!e(a.linkedTo)||e(a.tickPositioner)||e(a.tickInterval)||(g.tickPositioner=function(a,b){var c=this.linkedParent&&this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info; if(c){var d,h=g.units;for(d=0;de&&!a.startOnTick&&(g[0]=e),f>k&&f-h