/*
 Highcharts Gantt JS v10.3.2 (2022-11-28)

 GridAxis

 (c) 2016-2021 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(m){f(m);f.Highcharts=m;return f}):f("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(f){function m(f,p,m,h){f.hasOwnProperty(p)||(f[p]=h.apply(null,m),"function"===typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:p,module:f[p]}})))}f=f?f._modules:{};m(f,
"Core/Axis/GridAxis.js",[f["Core/Axis/Axis.js"],f["Core/Axis/AxisDefaults.js"],f["Core/Globals.js"],f["Core/Utilities.js"]],function(f,p,m,h){function r(a,b){var c={width:0,height:0};b.forEach(function(b){b=a[b];if(h.isObject(b,!0)){var d=h.isObject(b.label,!0)?b.label:{};b=d.getBBox?d.getBBox().height:0;d.textStr&&!t(d.textPxLength)&&(d.textPxLength=d.getBBox().width);var g=t(d.textPxLength)?Math.round(d.textPxLength):0;d.textStr&&(g=Math.round(d.getBBox().width));c.height=Math.max(b,c.height);c.width=
Math.max(g,c.width)}});"treegrid"===this.options.type&&this.treeGrid&&this.treeGrid.mapOfPosToGridNode&&(c.width+=this.options.labels.indentation*((this.treeGrid.mapOfPosToGridNode[-1].height||0)-1));return c}function C(){var a=this.grid;(a&&a.columns||[]).forEach(function(b){b.getOffset()})}function D(a){if(!0===(this.options.grid||{}).enabled){var b=this.axisTitle,c=this.height,d=this.horiz,e=this.left,g=this.offset,k=this.opposite,q=this.options,z=this.top,f=this.width,v=this.tickSize(),h=b&&b.getBBox().width,
l=q.title.x,m=q.title.y,n=x(q.title.margin,d?5:10);b=this.chart.renderer.fontMetrics(q.title.style.fontSize,b).f;v=(d?z+c:e)+(d?1:-1)*(k?-1:1)*(v?v[0]/2:0)+(this.side===u.bottom?b:0);a.titlePosition.x=d?e-(h||0)/2-n+l:v+(k?f:0)+g+l;a.titlePosition.y=d?v-(k?c:0)+(k?b:-b)/2+g+m:z-n+m}}function E(){var a=this.chart,b=this.options.grid;b=void 0===b?{}:b;var c=this.userOptions;if(b.enabled){var d=this.options;d.labels.align=x(d.labels.align,"center");this.categories||(d.showLastLabel=!1);this.labelRotation=
0;d.labels.rotation=0}if(b.columns){d=this.grid.columns=[];for(var e=this.grid.columnIndex=0;++e<b.columns.length;){var g=w(c,b.columns[b.columns.length-e-1],{linkedTo:0,type:"category",scrollbar:{enabled:!1}});delete g.grid.columns;g=new f(this.chart,g);g.grid.isColumn=!0;g.grid.columnIndex=e;A(a.axes,g);A(a[this.coll],g);d.push(g)}}}function F(){var a=this.grid,b=this.options;if(!0===(b.grid||{}).enabled){var c=this.min||0,d=this.max||0;this.maxLabelDimensions=this.getMaxLabelDimensions(this.ticks,
this.tickPositions);this.rightWall&&this.rightWall.destroy();if(this.grid&&this.grid.isOuterAxis()&&this.axisLine){var e=b.lineWidth;if(e){e=this.getLinePath(e);var g=e[0],k=e[1],q=((this.tickSize("tick")||[1])[0]-1)*(this.side===u.top||this.side===u.left?-1:1);"M"===g[0]&&"L"===k[0]&&(this.horiz?(g[2]+=q,k[2]+=q):(g[1]+=q,k[1]+=q));!this.horiz&&this.chart.marginRight&&(g=[g,["L",this.left,g[2]||0]],q=["L",this.chart.chartWidth-this.chart.marginRight,this.toPixels(d+this.tickmarkOffset)],k=[["M",
k[1]||0,this.toPixels(d+this.tickmarkOffset)],q],this.grid.upperBorder||0===c%1||(this.grid.upperBorder=this.grid.renderBorder(g)),this.grid.upperBorder&&(this.grid.upperBorder.attr({stroke:b.lineColor,"stroke-width":b.lineWidth}),this.grid.upperBorder.animate({d:g})),this.grid.lowerBorder||0===d%1||(this.grid.lowerBorder=this.grid.renderBorder(k)),this.grid.lowerBorder&&(this.grid.lowerBorder.attr({stroke:b.lineColor,"stroke-width":b.lineWidth}),this.grid.lowerBorder.animate({d:k})));this.grid.axisLineExtra?
(this.grid.axisLineExtra.attr({stroke:b.lineColor,"stroke-width":b.lineWidth}),this.grid.axisLineExtra.animate({d:e})):this.grid.axisLineExtra=this.grid.renderBorder(e);this.axisLine[this.showAxis?"show":"hide"]()}}(a&&a.columns||[]).forEach(function(b){return b.render()});if(!this.horiz&&this.chart.hasRendered&&(this.scrollbar||this.linkedParent&&this.linkedParent.scrollbar)){a=this.tickmarkOffset;b=this.tickPositions[this.tickPositions.length-1];e=this.tickPositions[0];for(g=k=void 0;(k=this.hiddenLabels.pop())&&
k.element;)k.show();for(;(g=this.hiddenMarks.pop())&&g.element;)g.show();(k=this.ticks[e].label)&&(c-e>a?this.hiddenLabels.push(k.hide()):k.show());(k=this.ticks[b].label)&&(b-d>a?this.hiddenLabels.push(k.hide()):k.show());(c=this.ticks[b].mark)&&b-d<a&&0<b-d&&this.ticks[b].isLast&&this.hiddenMarks.push(c.hide())}}}function G(){var a=this.tickPositions&&this.tickPositions.info,b=this.options,c=this.userOptions.labels||{};(b.grid||{}).enabled&&(this.horiz?(this.series.forEach(function(b){b.options.pointRange=
0}),a&&b.dateTimeLabelFormats&&b.labels&&!n(c.align)&&(!1===b.dateTimeLabelFormats[a.unitName].range||1<a.count)&&(b.labels.align="left",n(c.x)||(b.labels.x=3))):"treegrid"!==this.options.type&&this.grid&&this.grid.columns&&(this.minPointOffset=this.tickInterval))}function H(a){var b=this.options;a=a.userOptions;var c=b&&h.isObject(b.grid,!0)?b.grid:{};if(!0===c.enabled){var d=w(!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&&(n(a.linkedTo)&&!n(a.tickPixelInterval)&&(d.tickPixelInterval=350),n(a.tickPixelInterval)||!n(a.linkedTo)||n(a.tickPositioner)||n(a.tickInterval)||
(d.tickPositioner=function(b,a){var c=this.linkedParent&&this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info;if(c){for(var e=d.units||[],g=void 0,f=1,l="year",h=0;h<e.length;h++){var m=e[h];if(m&&m[0]===c.unitName){g=h;break}}(e=t(g)&&e[g+1])?(l=e[0]||"year",f=(f=e[1])&&f[0]||1):"year"===c.unitName&&(f=10*c.count);c=I[l];this.tickInterval=c*f;return this.chart.time.getTimeTicks({unitRange:c,count:f,unitName:l},b,a,this.options.startOfWeek)}}));w(!0,this.options,d);this.horiz&&(b.minPadding=
x(a.minPadding,0),b.maxPadding=x(a.maxPadding,0));t(b.grid.borderWidth)&&(b.tickWidth=b.lineWidth=c.borderWidth)}}function J(a){a=(a=a.userOptions)&&a.grid||{};var b=a.columns;a.enabled&&b&&w(!0,this.options,b[b.length-1])}function K(){(this.grid.columns||[]).forEach(function(a){return a.setScale()})}function L(a){var b=p.defaultLeftAxisOptions,c=this.horiz,d=this.maxLabelDimensions,e=this.options.grid;e=void 0===e?{}:e;e.enabled&&d&&(b=2*Math.abs(b.labels.x),c=c?e.cellHeight||b+d.height:b+d.width,
M(a.tickSize)?a.tickSize[0]=c:a.tickSize=[c,0])}function N(){this.axes.forEach(function(a){(a.grid&&a.grid.columns||[]).forEach(function(b){b.setAxisSize();b.setAxisTranslation()})})}function O(a){var b=this.grid;(b.columns||[]).forEach(function(b){return b.destroy(a.keepEvents)});b.columns=void 0}function P(a){a=a.userOptions||{};var b=a.grid||{};b.enabled&&n(b.borderColor)&&(a.tickColor=a.lineColor=b.borderColor);this.grid||(this.grid=new Q(this));this.hiddenLabels=[];this.hiddenMarks=[]}function R(a){var b=
this.label,c=this.axis,d=c.reversed,e=c.chart,g=c.options.grid||{},k=c.options.labels,f=k.align,h=u[c.side],l=a.tickmarkOffset,m=c.tickPositions,n=this.pos-l;m=t(m[a.index+1])?m[a.index+1]-l:(c.max||0)+l;var p=c.tickSize("tick");l=p?p[0]:0;p=p?p[1]/2:0;if(!0===g.enabled){if("top"===h){g=c.top+c.offset;var r=g-l}else"bottom"===h?(r=e.chartHeight-c.bottom+c.offset,g=r+l):(g=c.top+c.len-(c.translate(d?m:n)||0),r=c.top+c.len-(c.translate(d?n:m)||0));"right"===h?(h=e.chartWidth-c.right+c.offset,d=h+l):
"left"===h?(d=c.left+c.offset,h=d-l):(h=Math.round(c.left+(c.translate(d?m:n)||0))-p,d=Math.min(Math.round(c.left+(c.translate(d?n:m)||0))-p,c.left+c.len));this.slotWidth=d-h;a.pos.x="left"===f?h:"right"===f?d:h+(d-h)/2;a.pos.y=r+(g-r)/2;e=e.renderer.fontMetrics(k.style.fontSize,b&&b.element);b=b?b.getBBox().height:0;k.useHTML?a.pos.y+=e.b+-(b/2):(b=Math.round(b/e.h),a.pos.y+=(e.b-(e.h-e.f))/2+-((b-1)*e.h/2));a.pos.x+=c.horiz&&k.x||0}}function S(a){var b=a.axis,c=a.value;if(b.options.grid&&b.options.grid.enabled){var d=
b.tickPositions,e=(b.linkedParent||b).series[0],g=c===d[0];d=c===d[d.length-1];var k=e&&T(e.options.data,function(a){return a[b.isXAxis?"x":"y"]===c}),f=void 0;k&&e.is("gantt")&&(f=w(k),m.seriesTypes.gantt.prototype.pointClass.setGanttPointAliases(f));a.isFirst=g;a.isLast=d;a.point=f}}function U(){var a=this.options,b=this.categories,c=this.tickPositions,d=c[0],e=c[c.length-1],g=this.linkedParent&&this.linkedParent.min||this.min,f=this.linkedParent&&this.linkedParent.max||this.max,h=this.tickInterval;
!0!==(a.grid||{}).enabled||b||!this.horiz&&!this.isLinked||(d<g&&d+h>g&&!a.startOnTick&&(c[0]=g),e>f&&e-h<f&&!a.endOnTick&&(c[c.length-1]=f))}function V(a){var b=this.options.grid;return!0===(void 0===b?{}:b).enabled&&this.categories?this.tickInterval:a.apply(this,Array.prototype.slice.call(arguments,1))}var B=m.dateFormats,l=h.addEvent,n=h.defined,A=h.erase,T=h.find,M=h.isArray,t=h.isNumber,w=h.merge,x=h.pick,I=h.timeUnits,W=h.wrap,u;(function(a){a[a.top=0]="top";a[a.right=1]="right";a[a.bottom=
2]="bottom";a[a.left=3]="left"})(u||(u={}));var y=[],Q=function(){function a(b){this.axis=b}a.prototype.isOuterAxis=function(){var b=this.axis,a=b.grid.columnIndex,d=b.linkedParent&&b.linkedParent.grid.columns||b.grid.columns,e=a?b.linkedParent:b,g=-1,f=0;(b.chart[b.coll]||[]).forEach(function(a,c){a.side!==b.side||a.options.isInternal||(f=c,a===e&&(g=c))});return f===g&&(t(a)?d.length===a:!0)};a.prototype.renderBorder=function(a){var b=this.axis,d=b.chart.renderer,e=b.options;a=d.path(a).addClass("highcharts-axis-line").add(b.axisBorder);
d.styledMode||a.attr({stroke:e.lineColor,"stroke-width":e.lineWidth,zIndex:7});return a};return a}();B.E=function(a){return this.dateFormat("%a",a,!0).charAt(0)};B.W=function(a){var b=this,c=new this.Date(a);["Hours","Milliseconds","Minutes","Seconds"].forEach(function(a){b.set(a,c,0)});var d=(this.get("Day",c)+6)%7;a=new this.Date(c.valueOf());this.set("Date",a,this.get("Date",c)-d+3);d=new this.Date(this.get("FullYear",a),0,1);4!==this.get("Day",d)&&(this.set("Month",c,0),this.set("Date",c,1+(11-
this.get("Day",d))%7));return(1+Math.floor((a.valueOf()-d.valueOf())/6048E5)).toString()};"";return{compose:function(a,b,c){-1===y.indexOf(a)&&(y.push(a),a.keepProps.push("grid"),a.prototype.getMaxLabelDimensions=r,W(a.prototype,"unsquish",V),l(a,"init",P),l(a,"afterGetOffset",C),l(a,"afterGetTitlePosition",D),l(a,"afterInit",E),l(a,"afterRender",F),l(a,"afterSetAxisTranslation",G),l(a,"afterSetOptions",H),l(a,"afterSetOptions",J),l(a,"afterSetScale",K),l(a,"afterTickSize",L),l(a,"trimTicks",U),l(a,
"destroy",O));-1===y.indexOf(b)&&l(b,"afterSetChartSize",N);-1===y.indexOf(c)&&(l(c,"afterGetLabelPosition",R),l(c,"labelFormat",S));return a}}});m(f,"masters/modules/grid-axis.src.js",[f["Core/Globals.js"],f["Core/Axis/GridAxis.js"]],function(f,m){m.compose(f.Axis,f.Chart,f.Tick)})});
//# sourceMappingURL=grid-axis.js.map