/*
 Highcharts Gantt JS v9.1.0 (2021-05-03)

 Tree Grid

 (c) 2016-2021 Jon Arild Nygard

 License: www.highcharts.com/license
*/
(function(b){"object"===typeof module&&module.exports?(b["default"]=b,module.exports=b):"function"===typeof define&&define.amd?define("highcharts/modules/treegrid",["highcharts"],function(D){b(D);b.Highcharts=D;return b}):b("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(b){function D(b,t,v,q){b.hasOwnProperty(t)||(b[t]=q.apply(null,v))}b=b?b._modules:{};D(b,"Gantt/Tree.js",[b["Core/Utilities.js"]],function(b){var t=b.extend,v=b.isNumber,q=b.pick,p=function(b,n){var h=b.reduce(function(d,
h){var k=q(h.parent,"");"undefined"===typeof d[k]&&(d[k]=[]);d[k].push(h);return d},{});Object.keys(h).forEach(function(d,b){var k=h[d];""!==d&&-1===n.indexOf(d)&&(k.forEach(function(d){b[""].push(d)}),delete b[d])});return h},n=function(b,p,h,d,A,k){var l=0,u=0,r=k&&k.after,a=k&&k.before;p={data:d,depth:h-1,id:b,level:h,parent:p};var g,f;"function"===typeof a&&a(p,k);a=(A[b]||[]).map(function(c){var e=n(c.id,b,h+1,c,A,k),m=c.start;c=!0===c.milestone?m:c.end;g=!v(g)||m<g?m:g;f=!v(f)||c>f?c:f;l=l+
1+e.descendants;u=Math.max(e.height+1,u);return e});d&&(d.start=q(d.start,g),d.end=q(d.end,f));t(p,{children:a,descendants:l,height:u});"function"===typeof r&&r(p,k);return p};return{getListOfParents:p,getNode:n,getTree:function(b,q){var h=b.map(function(d){return d.id});b=p(b,h);return n("",null,1,null,b,q)}}});D(b,"Core/Axis/TreeGridTick.js",[b["Core/Color/Palette.js"],b["Core/Utilities.js"]],function(b,t){var v=t.addEvent,q=t.isObject,p=t.isNumber,n=t.pick,B=t.wrap,y;(function(h){function d(){this.treeGrid||
(this.treeGrid=new r(this))}function A(a,g){a=a.treeGrid;var f=!a.labelIcon,c=g.renderer,e=g.xy,m=g.options,C=m.width||0,x=m.height||0,d=e.x-C/2-(m.padding||0);e=e.y-x/2;var l=g.collapsed?90:180,h=g.show&&p(e),k=a.labelIcon;k||(a.labelIcon=k=c.path(c.symbols[m.type](m.x||0,m.y||0,C,x)).addClass("highcharts-label-icon").add(g.group));k.attr({y:h?0:-9999});c.styledMode||k.attr({cursor:"pointer",fill:n(g.color,b.neutralColor60),"stroke-width":1,stroke:m.lineColor,strokeWidth:m.lineWidth||0});k[f?"attr":
"animate"]({translateX:d,translateY:e,rotation:l})}function k(a,g,f,c,e,m,C,d,l){var x=n(this.options&&this.options.labels,m);m=this.pos;var k=this.axis,h="treegrid"===k.options.type;a=a.apply(this,[g,f,c,e,x,C,d,l]);h&&(g=x&&q(x.symbol,!0)?x.symbol:{},x=x&&p(x.indentation)?x.indentation:0,m=(m=(k=k.treeGrid.mapOfPosToGridNode)&&k[m])&&m.depth||1,a.x+=(g.width||0)+2*(g.padding||0)+(m-1)*x);return a}function l(a){var g=this,f=g.pos,c=g.axis,e=g.label,m=c.treeGrid.mapOfPosToGridNode,C=c.options,x=n(g.options&&
g.options.labels,C&&C.labels),d=x&&q(x.symbol,!0)?x.symbol:{},k=(m=m&&m[f])&&m.depth;C="treegrid"===C.type;var l=-1<c.tickPositions.indexOf(f);f=c.chart.styledMode;C&&m&&e&&e.element&&e.addClass("highcharts-treegrid-node-level-"+k);a.apply(g,Array.prototype.slice.call(arguments,1));C&&e&&e.element&&m&&m.descendants&&0<m.descendants&&(c=c.treeGrid.isCollapsed(m),A(g,{color:!f&&e.styles&&e.styles.color||"",collapsed:c,group:e.parentGroup,options:d,renderer:e.renderer,show:l,xy:e.xy}),d="highcharts-treegrid-node-"+
(c?"expanded":"collapsed"),e.addClass("highcharts-treegrid-node-"+(c?"collapsed":"expanded")).removeClass(d),f||e.css({cursor:"pointer"}),[e,g.treeGrid.labelIcon].forEach(function(c){c&&!c.attachedTreeGridEvents&&(v(c.element,"mouseover",function(){e.addClass("highcharts-treegrid-node-active");e.renderer.styledMode||e.css({textDecoration:"underline"})}),v(c.element,"mouseout",function(){var c=q(x.style)?x.style:{};e.removeClass("highcharts-treegrid-node-active");e.renderer.styledMode||e.css({textDecoration:c.textDecoration})}),
v(c.element,"click",function(){g.treeGrid.toggleCollapse()}),c.attachedTreeGridEvents=!0)}))}var u=!1;h.compose=function(a){u||(v(a,"init",d),B(a.prototype,"getLabelPosition",k),B(a.prototype,"renderLabel",l),a.prototype.collapse=function(a){this.treeGrid.collapse(a)},a.prototype.expand=function(a){this.treeGrid.expand(a)},a.prototype.toggleCollapse=function(a){this.treeGrid.toggleCollapse(a)},u=!0)};var r=function(){function a(a){this.tick=a}a.prototype.collapse=function(a){var f=this.tick,c=f.axis,
e=c.brokenAxis;e&&c.treeGrid.mapOfPosToGridNode&&(f=c.treeGrid.collapse(c.treeGrid.mapOfPosToGridNode[f.pos]),e.setBreaks(f,n(a,!0)))};a.prototype.expand=function(a){var f=this.tick,c=f.axis,e=c.brokenAxis;e&&c.treeGrid.mapOfPosToGridNode&&(f=c.treeGrid.expand(c.treeGrid.mapOfPosToGridNode[f.pos]),e.setBreaks(f,n(a,!0)))};a.prototype.toggleCollapse=function(a){var f=this.tick,c=f.axis,e=c.brokenAxis;e&&c.treeGrid.mapOfPosToGridNode&&(f=c.treeGrid.toggleCollapse(c.treeGrid.mapOfPosToGridNode[f.pos]),
e.setBreaks(f,n(a,!0)))};return a}();h.Additions=r})(y||(y={}));return y});D(b,"Mixins/TreeSeries.js",[b["Core/Color/Color.js"],b["Core/Utilities.js"]],function(b,t){var v=t.extend,q=t.isArray,p=t.isNumber,n=t.isObject,B=t.merge,y=t.pick;return{getColor:function(h,d){var n=d.index,k=d.mapOptionsToLevel,l=d.parentColor,u=d.parentColorIndex,r=d.series,a=d.colors,g=d.siblings,f=r.points,c=r.chart.options.chart,e;if(h){f=f[h.i];h=k[h.level]||{};if(k=f&&h.colorByPoint){var m=f.index%(a?a.length:c.colorCount);
var C=a&&a[m]}if(!r.chart.styledMode){a=f&&f.options.color;c=h&&h.color;if(e=l)e=(e=h&&h.colorVariation)&&"brightness"===e.key?b.parse(l).brighten(n/g*e.to).get():l;e=y(a,c,C,e,r.color)}var x=y(f&&f.options.colorIndex,h&&h.colorIndex,m,u,d.colorIndex)}return{color:e,colorIndex:x}},getLevelOptions:function(h){var d=null;if(n(h)){d={};var b=p(h.from)?h.from:1;var k=h.levels;var l={};var u=n(h.defaults)?h.defaults:{};q(k)&&(l=k.reduce(function(d,a){if(n(a)&&p(a.level)){var g=B({},a);var f="boolean"===
typeof g.levelIsConstant?g.levelIsConstant:u.levelIsConstant;delete g.levelIsConstant;delete g.level;a=a.level+(f?0:b-1);n(d[a])?v(d[a],g):d[a]=g}return d},{}));k=p(h.to)?h.to:1;for(h=0;h<=k;h++)d[h]=B({},u,n(l[h])?l[h]:{})}return d},setTreeValues:function k(d,b){var l=b.before,u=b.idRoot,r=b.mapIdToNode[u],a=b.points[d.i],g=a&&a.options||{},f=0,c=[];d.levelDynamic=d.level-(("boolean"===typeof b.levelIsConstant?b.levelIsConstant:1)?0:r.level);d.name=y(a&&a.name,"");d.visible=u===d.id||("boolean"===
typeof b.visible?b.visible:!1);"function"===typeof l&&(d=l(d,b));d.children.forEach(function(e,a){var m=v({},b);v(m,{index:a,siblings:d.children.length,visible:d.visible});e=k(e,m);c.push(e);e.visible&&(f+=e.val)});d.visible=0<f||d.visible;l=y(g.value,f);d.children=c;d.childrenTotal=f;d.isLeaf=d.visible&&!f;d.val=l;return d},updateRootId:function(d){if(n(d)){var b=n(d.options)?d.options:{};b=y(d.rootNode,b.rootId,"");n(d.userOptions)&&(d.userOptions.rootId=b);d.rootNode=b}return b}}});D(b,"Core/Axis/GridAxis.js",
[b["Core/Axis/Axis.js"],b["Core/Globals.js"],b["Core/Axis/Tick.js"],b["Core/Utilities.js"]],function(b,t,v,q){var p=q.addEvent,n=q.defined,B=q.erase,y=q.find,h=q.isArray,d=q.isNumber,A=q.merge,k=q.pick,l=q.timeUnits,u=q.wrap,r=t.Chart;"";b.prototype.getMaxLabelDimensions=function(f,c){var e={width:0,height:0};c.forEach(function(c){c=f[c];if(q.isObject(c,!0)){var a=q.isObject(c.label,!0)?c.label:{};c=a.getBBox?a.getBBox().height:0;a.textStr&&!d(a.textPxLength)&&(a.textPxLength=a.getBBox().width);var m=
d(a.textPxLength)?Math.round(a.textPxLength):0;a.textStr&&(m=Math.round(a.getBBox().width));e.height=Math.max(c,e.height);e.width=Math.max(m,e.width)}});return e};t.dateFormats.W=function(a){a=new this.Date(a);var c=(this.get("Day",a)+6)%7,e=new this.Date(a.valueOf());this.set("Date",e,this.get("Date",a)-c+3);c=new this.Date(this.get("FullYear",e),0,1);4!==this.get("Day",c)&&(this.set("Month",a,0),this.set("Date",a,1+(11-this.get("Day",c))%7));return(1+Math.floor((e.valueOf()-c.valueOf())/6048E5)).toString()};
t.dateFormats.E=function(a){return this.dateFormat("%a",a,!0).charAt(0)};p(r,"afterSetChartSize",function(){this.axes.forEach(function(a){(a.grid&&a.grid.columns||[]).forEach(function(c){c.setAxisSize();c.setAxisTranslation()})})});p(v,"afterGetLabelPosition",function(a){var c=this.label,e=this.axis,m=e.reversed,f=e.chart,b=e.options.grid||{},k=e.options.labels,l=k.align,h=g.Side[e.side],r=a.tickmarkOffset,w=e.tickPositions,z=this.pos-r;w=d(w[a.index+1])?w[a.index+1]-r:e.max+r;var E=e.tickSize("tick");
r=E?E[0]:0;E=E?E[1]/2:0;if(!0===b.enabled){if("top"===h){b=e.top+e.offset;var F=b-r}else"bottom"===h?(F=f.chartHeight-e.bottom+e.offset,b=F+r):(b=e.top+e.len-e.translate(m?w:z),F=e.top+e.len-e.translate(m?z:w));"right"===h?(h=f.chartWidth-e.right+e.offset,m=h+r):"left"===h?(m=e.left+e.offset,h=m-r):(h=Math.round(e.left+e.translate(m?w:z))-E,m=Math.round(e.left+e.translate(m?z:w))-E);this.slotWidth=m-h;a.pos.x="left"===l?h:"right"===l?m:h+(m-h)/2;a.pos.y=F+(b-F)/2;f=f.renderer.fontMetrics(k.style.fontSize,
c.element);c=c.getBBox().height;k.useHTML?a.pos.y+=f.b+-(c/2):(c=Math.round(c/f.h),a.pos.y+=(f.b-(f.h-f.f))/2+-((c-1)*f.h/2));a.pos.x+=e.horiz&&k.x||0}});p(v,"labelFormat",function(a){var c=a.axis,e=a.value;if(c.options.grid&&c.options.grid.enabled){var f=c.tickPositions,b=(c.linkedParent||c).series[0],d=e===f[0];f=e===f[f.length-1];var g=b&&y(b.options.data,function(a){return a[c.isXAxis?"x":"y"]===e}),h=void 0;g&&b.is("gantt")&&(h=A(g),t.seriesTypes.gantt.prototype.pointClass.setGanttPointAliases(h));
a.isFirst=d;a.isLast=f;a.point=h}});var a=function(){function a(c){this.axis=c}a.prototype.isOuterAxis=function(){var c=this.axis,e=c.grid.columnIndex,a=c.linkedParent&&c.linkedParent.grid.columns||c.grid.columns,f=e?c.linkedParent:c,b=-1,g=0;c.chart[c.coll].forEach(function(e,a){e.side!==c.side||e.options.isInternal||(g=a,e===f&&(b=a))});return g===b&&(d(e)?a.length===e:!0)};a.prototype.renderBorder=function(c){var e=this.axis,a=e.chart.renderer,f=e.options;c=a.path(c).addClass("highcharts-axis-line").add(e.axisBorder);
a.styledMode||c.attr({stroke:f.lineColor,"stroke-width":f.lineWidth,zIndex:7});return c};return a}(),g=function(){function f(){}f.compose=function(c){b.keepProps.push("grid");u(c.prototype,"unsquish",f.wrapUnsquish);p(c,"init",f.onInit);p(c,"afterGetOffset",f.onAfterGetOffset);p(c,"afterGetTitlePosition",f.onAfterGetTitlePosition);p(c,"afterInit",f.onAfterInit);p(c,"afterRender",f.onAfterRender);p(c,"afterSetAxisTranslation",f.onAfterSetAxisTranslation);p(c,"afterSetOptions",f.onAfterSetOptions);
p(c,"afterSetOptions",f.onAfterSetOptions2);p(c,"afterSetScale",f.onAfterSetScale);p(c,"afterTickSize",f.onAfterTickSize);p(c,"trimTicks",f.onTrimTicks);p(c,"destroy",f.onDestroy)};f.onAfterGetOffset=function(){var c=this.grid;(c&&c.columns||[]).forEach(function(c){c.getOffset()})};f.onAfterGetTitlePosition=function(c){if(!0===(this.options.grid||{}).enabled){var a=this.axisTitle,m=this.height,b=this.horiz,g=this.left,d=this.offset,h=this.opposite,l=this.options,r=this.top,w=this.width,z=this.tickSize(),
E=a&&a.getBBox().width,F=l.title.x,u=l.title.y,n=k(l.title.margin,b?5:10);a=this.chart.renderer.fontMetrics(l.title.style.fontSize,a).f;z=(b?r+m:g)+(b?1:-1)*(h?-1:1)*(z?z[0]/2:0)+(this.side===f.Side.bottom?a:0);c.titlePosition.x=b?g-(E||0)/2-n+F:z+(h?w:0)+d+F;c.titlePosition.y=b?z-(h?m:0)+(h?a:-a)/2+d+u:r-n+u}};f.onAfterInit=function(){var c=this.chart,a=this.options.grid;a=void 0===a?{}:a;var f=this.userOptions;if(a.enabled){var g=this.options;g.labels.align=k(g.labels.align,"center");this.categories||
(g.showLastLabel=!1);this.labelRotation=0;g.labels.rotation=0}if(a.columns){g=this.grid.columns=[];for(var d=this.grid.columnIndex=0;++d<a.columns.length;){var h=A(f,a.columns[a.columns.length-d-1],{linkedTo:0,type:"category",scrollbar:{enabled:!1}});delete h.grid.columns;h=new b(this.chart,h);h.grid.isColumn=!0;h.grid.columnIndex=d;B(c.axes,h);B(c[this.coll],h);g.push(h)}}};f.onAfterRender=function(){var a=this.grid,e=this.options;if(!0===(e.grid||{}).enabled){this.maxLabelDimensions=this.getMaxLabelDimensions(this.ticks,
this.tickPositions);this.rightWall&&this.rightWall.destroy();if(this.grid&&this.grid.isOuterAxis()&&this.axisLine&&(e=e.lineWidth)){e=this.getLinePath(e);var m=e[0],b=e[1],g=((this.tickSize("tick")||[1])[0]-1)*(this.side===f.Side.top||this.side===f.Side.left?-1:1);"M"===m[0]&&"L"===b[0]&&(this.horiz?(m[2]+=g,b[2]+=g):(m[1]+=g,b[1]+=g));!this.horiz&&this.chart.marginRight&&(m=[m,["L",this.left,m[2]]],g=["L",this.chart.chartWidth-this.chart.marginRight,this.toPixels(this.max+this.tickmarkOffset)],b=
[["M",b[1],this.toPixels(this.max+this.tickmarkOffset)],g],this.grid.upperBorder||0===this.min%1||(this.grid.upperBorder=this.grid.renderBorder(m)),this.grid.upperBorder&&this.grid.upperBorder.animate({d:m}),this.grid.lowerBorder||0===this.max%1||(this.grid.lowerBorder=this.grid.renderBorder(b)),this.grid.lowerBorder&&this.grid.lowerBorder.animate({d:b}));this.grid.axisLineExtra?this.grid.axisLineExtra.animate({d:e}):this.grid.axisLineExtra=this.grid.renderBorder(e);this.axisLine[this.showAxis?"show":
"hide"](!0)}(a&&a.columns||[]).forEach(function(a){a.render()});!this.horiz&&this.chart.hasRendered&&(this.scrollbar||this.linkedParent&&this.linkedParent.scrollbar)&&(a=this.max,e=this.tickmarkOffset,b=this.tickPositions[this.tickPositions.length-1],m=this.tickPositions[0],this.min-m>e?this.ticks[m].label.hide():this.ticks[m].label.show(),b-a>e?this.ticks[b].label.hide():this.ticks[b].label.show(),b-a<e&&0<b-a&&this.ticks[b].isLast?this.ticks[b].mark.hide():this.ticks[b-1]&&this.ticks[b-1].mark.show())}};
f.onAfterSetAxisTranslation=function(){var a=this.tickPositions&&this.tickPositions.info,e=this.options,f=this.userOptions.labels||{};(e.grid||{}).enabled&&(this.horiz?(this.series.forEach(function(a){a.options.pointRange=0}),a&&e.dateTimeLabelFormats&&e.labels&&!n(f.align)&&(!1===e.dateTimeLabelFormats[a.unitName].range||1<a.count)&&(e.labels.align="left",n(f.x)||(e.labels.x=3))):"treegrid"!==this.options.type&&this.grid&&this.grid.columns&&(this.minPointOffset=this.tickInterval))};f.onAfterSetOptions=
function(a){var c=this.options;a=a.userOptions;var f=c&&q.isObject(c.grid,!0)?c.grid:{};if(!0===f.enabled){var b=A(!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)&&(b.tickPixelInterval=350),n(a.tickPixelInterval)||!n(a.linkedTo)||n(a.tickPositioner)||n(a.tickInterval)||(b.tickPositioner=function(a,c){var e=this.linkedParent&&this.linkedParent.tickPositions&&this.linkedParent.tickPositions.info;if(e){var f=void 0,m=void 0,g=void 0,z,d=b.units;for(z=0;z<d.length;z++)if(d[z][0]===e.unitName){f=z;break}d[f+1]?(g=d[f+1][0],
m=(d[f+1][1]||[1])[0]):"year"===e.unitName&&(g="year",m=10*e.count);e=l[g];this.tickInterval=e*m;return this.getTimeTicks({unitRange:e,count:m,unitName:g},a,c,this.options.startOfWeek)}}));A(!0,this.options,b);this.horiz&&(c.minPadding=k(a.minPadding,0),c.maxPadding=k(a.maxPadding,0));d(c.grid.borderWidth)&&(c.tickWidth=c.lineWidth=f.borderWidth)}};f.onAfterSetOptions2=function(a){a=(a=a.userOptions)&&a.grid||{};var c=a.columns;a.enabled&&c&&A(!0,this.options,c[c.length-1])};f.onAfterSetScale=function(){(this.grid.columns||
[]).forEach(function(a){a.setScale()})};f.onAfterTickSize=function(a){var c=b.defaultLeftAxisOptions,f=this.horiz,g=this.maxLabelDimensions,d=this.options.grid;d=void 0===d?{}:d;d.enabled&&g&&(c=2*Math.abs(c.labels.x),f=f?d.cellHeight||c+g.height:c+g.width,h(a.tickSize)?a.tickSize[0]=f:a.tickSize=[f,0])};f.onDestroy=function(a){var c=this.grid;(c.columns||[]).forEach(function(c){c.destroy(a.keepEvents)});c.columns=void 0};f.onInit=function(c){c=c.userOptions||{};var e=c.grid||{};e.enabled&&n(e.borderColor)&&
(c.tickColor=c.lineColor=e.borderColor);this.grid||(this.grid=new a(this))};f.onTrimTicks=function(){var a=this.options,e=this.categories,f=this.tickPositions,b=f[0],g=f[f.length-1],d=this.linkedParent&&this.linkedParent.min||this.min,h=this.linkedParent&&this.linkedParent.max||this.max,l=this.tickInterval;!0!==(a.grid||{}).enabled||e||!this.horiz&&!this.isLinked||(b<d&&b+l>d&&!a.startOnTick&&(f[0]=d),g>h&&g-l<h&&!a.endOnTick&&(f[f.length-1]=h))};f.wrapUnsquish=function(a){var c=this.options.grid;
return!0===(void 0===c?{}:c).enabled&&this.categories?this.tickInterval:a.apply(this,Array.prototype.slice.call(arguments,1))};return f}();(function(a){a=a.Side||(a.Side={});a[a.top=0]="top";a[a.right=1]="right";a[a.bottom=2]="bottom";a[a.left=3]="left"})(g||(g={}));g.compose(b);return g});D(b,"Core/Axis/BrokenAxis.js",[b["Core/Axis/Axis.js"],b["Core/Series/Series.js"],b["Extensions/Stacking.js"],b["Core/Utilities.js"]],function(b,t,v,q){var p=q.addEvent,n=q.find,B=q.fireEvent,y=q.isArray,h=q.isNumber,
d=q.pick,A=function(){function k(b){this.hasBreaks=!1;this.axis=b}k.isInBreak=function(b,d){var h=b.repeat||Infinity,a=b.from,g=b.to-b.from;d=d>=a?(d-a)%h:h-(a-d)%h;return b.inclusive?d<=g:d<g&&0!==d};k.lin2Val=function(b){var d=this.brokenAxis;d=d&&d.breakArray;if(!d||!h(b))return b;var l;for(l=0;l<d.length;l++){var a=d[l];if(a.from>=b)break;else a.to<b?b+=a.len:k.isInBreak(a,b)&&(b+=a.len)}return b};k.val2Lin=function(b){var d=this.brokenAxis;d=d&&d.breakArray;if(!d||!h(b))return b;var l=b,a;for(a=
0;a<d.length;a++){var g=d[a];if(g.to<=b)l-=g.len;else if(g.from>=b)break;else if(k.isInBreak(g,b)){l-=b-g.from;break}}return l};k.prototype.findBreakAt=function(b,d){return n(d,function(d){return d.from<b&&b<d.to})};k.prototype.isInAnyBreak=function(b,n){var l=this.axis,a=l.options.breaks||[],g=a.length,f;if(g&&h(b)){for(;g--;)if(k.isInBreak(a[g],b)){var c=!0;f||(f=d(a[g].showPoints,!l.isXAxis))}var e=c&&n?c&&!f:c}return e};k.prototype.setBreaks=function(l,n){var r=this,a=r.axis,g=y(l)&&!!l.length;
a.isDirty=r.hasBreaks!==g;r.hasBreaks=g;a.options.breaks=a.userOptions.breaks=l;a.forceRedraw=!0;a.series.forEach(function(a){a.isDirty=!0});g||a.val2lin!==k.val2Lin||(delete a.val2lin,delete a.lin2val);g&&(a.userOptions.ordinal=!1,a.lin2val=k.lin2Val,a.val2lin=k.val2Lin,a.setExtremes=function(a,c,e,d,g){if(r.hasBreaks){for(var f,m=this.options.breaks;f=r.findBreakAt(a,m);)a=f.to;for(;f=r.findBreakAt(c,m);)c=f.from;c<a&&(c=a)}b.prototype.setExtremes.call(this,a,c,e,d,g)},a.setAxisTranslation=function(){b.prototype.setAxisTranslation.call(this);
r.unitLength=void 0;if(r.hasBreaks){var f=a.options.breaks||[],c=[],e=[],g=0,l,n=a.userMin||a.min,p=a.userMax||a.max,q=d(a.pointRangePadding,0),t;f.forEach(function(a){l=a.repeat||Infinity;h(n)&&h(p)&&(k.isInBreak(a,n)&&(n+=a.to%l-n%l),k.isInBreak(a,p)&&(p-=p%l-a.from%l))});f.forEach(function(a){w=a.from;l=a.repeat||Infinity;if(h(n)&&h(p)){for(;w-l>n;)w-=l;for(;w<n;)w+=l;for(t=w;t<p;t+=l)c.push({value:t,move:"in"}),c.push({value:t+a.to-a.from,move:"out",size:a.breakSize})}});c.sort(function(a,c){return a.value===
c.value?("in"===a.move?0:1)-("in"===c.move?0:1):a.value-c.value});var u=0;var w=n;c.forEach(function(a){u+="in"===a.move?1:-1;1===u&&"in"===a.move&&(w=a.value);0===u&&h(w)&&(e.push({from:w,to:a.value,len:a.value-w-(a.size||0)}),g+=a.value-w-(a.size||0))});r.breakArray=e;h(n)&&h(p)&&h(a.min)&&(r.unitLength=p-n-g+q,B(a,"afterBreaks"),a.staticScale?a.transA=a.staticScale:r.unitLength&&(a.transA*=(p-a.min+q)/r.unitLength),q&&(a.minPixelPadding=a.transA*(a.minPointOffset||0)),a.min=n,a.max=p)}});d(n,!0)&&
a.chart.redraw()};return k}();q=function(){function b(){}b.compose=function(b,k){b.keepProps.push("brokenAxis");var l=t.prototype;l.drawBreaks=function(a,b){var f=this,c=f.points,e,g,k,l;if(a&&a.brokenAxis&&a.brokenAxis.hasBreaks){var n=a.brokenAxis;b.forEach(function(b){e=n&&n.breakArray||[];g=a.isXAxis?a.min:d(f.options.threshold,a.min);c.forEach(function(c){l=d(c["stack"+b.toUpperCase()],c[b]);e.forEach(function(b){if(h(g)&&h(l)){k=!1;if(g<b.from&&l>b.to||g>b.from&&l<b.from)k="pointBreak";else if(g<
b.from&&l>b.from&&l<b.to||g>b.from&&l>b.to&&l<b.from)k="pointInBreak";k&&B(a,k,{point:c,brk:b})}})})})}};l.gappedPath=function(){var a=this.currentDataGrouping,b=a&&a.gapSize;a=this.options.gapSize;var f=this.points.slice(),c=f.length-1,e=this.yAxis,d;if(a&&0<c)for("value"!==this.options.gapUnit&&(a*=this.basePointRange),b&&b>a&&b>=this.basePointRange&&(a=b),d=void 0;c--;)d&&!1!==d.visible||(d=f[c+1]),b=f[c],!1!==d.visible&&!1!==b.visible&&(d.x-b.x>a&&(d=(b.x+d.x)/2,f.splice(c+1,0,{isNull:!0,x:d}),
e.stacking&&this.options.stacking&&(d=e.stacking.stacks[this.stackKey][d]=new v(e,e.options.stackLabels,!1,d,this.stack),d.total=0)),d=b);return this.getGraphPath(f)};p(b,"init",function(){this.brokenAxis||(this.brokenAxis=new A(this))});p(b,"afterInit",function(){"undefined"!==typeof this.brokenAxis&&this.brokenAxis.setBreaks(this.options.breaks,!1)});p(b,"afterSetTickPositions",function(){var a=this.brokenAxis;if(a&&a.hasBreaks){var b=this.tickPositions,d=this.tickPositions.info,c=[],e;for(e=0;e<
b.length;e++)a.isInAnyBreak(b[e])||c.push(b[e]);this.tickPositions=c;this.tickPositions.info=d}});p(b,"afterSetOptions",function(){this.brokenAxis&&this.brokenAxis.hasBreaks&&(this.options.ordinal=!1)});p(k,"afterGeneratePoints",function(){var a=this.options.connectNulls,b=this.points,d=this.xAxis,c=this.yAxis;if(this.isDirty)for(var e=b.length;e--;){var h=b[e],k=!(null===h.y&&!1===a)&&(d&&d.brokenAxis&&d.brokenAxis.isInAnyBreak(h.x,!0)||c&&c.brokenAxis&&c.brokenAxis.isInAnyBreak(h.y,!0));h.visible=
k?!1:!1!==h.options.visible}});p(k,"afterRender",function(){this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,d(this.pointArrayMap,["y"]))})};return b}();q.compose(b,t);return q});D(b,"Core/Axis/TreeGridAxis.js",[b["Core/Axis/Axis.js"],b["Core/Axis/Tick.js"],b["Gantt/Tree.js"],b["Core/Axis/TreeGridTick.js"],b["Mixins/TreeSeries.js"],b["Core/Utilities.js"]],function(b,t,v,q,p,n){var B=p.getLevelOptions,y=n.addEvent,h=n.find,d=n.fireEvent,A=n.isArray,k=n.isObject,l=n.isString,u=n.merge,r=
n.pick,a=n.wrap,g;(function(b){function c(a,b){var c=a.collapseStart||0;a=a.collapseEnd||0;a>=b&&(c-=.5);return{from:c,to:a,showPoints:!1}}function e(a,b,c){var e=[],d=[],f={},g={},z=-1,m="boolean"===typeof b?b:!1;a=v.getTree(a,{after:function(a){a=g[a.pos];var b=0,c=0;a.children.forEach(function(a){c+=(a.descendants||0)+1;b=Math.max((a.height||0)+1,b)});a.descendants=c;a.height=b;a.collapsed&&d.push(a)},before:function(a){var b=k(a.data,!0)?a.data:{},c=l(b.name)?b.name:"",d=f[a.parent];d=k(d,!0)?
g[d.pos]:null;var n=function(a){return a.name===c},p;m&&k(d,!0)&&(p=h(d.children,n))?(n=p.pos,p.nodes.push(a)):n=z++;g[n]||(g[n]=p={depth:d?d.depth+1:0,name:c,id:b.id,nodes:[a],children:[],pos:n},-1!==n&&e.push(c),k(d,!0)&&d.children.push(p));l(a.id)&&(f[a.id]=a);p&&!0===b.collapsed&&(p.collapsed=!0);a.pos=n}});g=function(a,b){var c=function(a,d,e){var f=d+(-1===d?0:b-1),g=(f-d)/2,h=d+g;a.nodes.forEach(function(a){var b=a.data;k(b,!0)&&(b.y=d+(b.seriesIndex||0),delete b.seriesIndex);a.pos=h});e[h]=
a;a.pos=h;a.tickmarkOffset=g+.5;a.collapseStart=f+.5;a.children.forEach(function(a){c(a,f+1,e);f=(a.collapseEnd||0)-.5});a.collapseEnd=f+.5;return e};return c(a["-1"],-1,{})}(g,c);return{categories:e,mapOfIdToNode:f,mapOfPosToGridNode:g,collapsedNodes:d,tree:a}}function f(a){a.target.axes.filter(function(a){return"treegrid"===a.options.type}).forEach(function(b){var c=b.options||{},d=c.labels,f=c.uniqueNames,g=0;c=c.max;if(!b.treeGrid.mapOfPosToGridNode||b.series.some(function(a){return!a.hasRendered||
a.isDirtyData||a.isDirty})){var h=b.series.reduce(function(a,b){b.visible&&((b.options.data||[]).forEach(function(c){b.options.keys&&b.options.keys.length&&(c=b.pointClass.prototype.optionsToObject.call({series:b},c),b.pointClass.setGanttPointAliases(c));k(c,!0)&&(c.seriesIndex=g,a.push(c))}),!0===f&&g++);return a},[]);if(c&&h.length<c)for(var l=h.length;l<=c;l++)h.push({name:l+"\u200b"});c=e(h,f||!1,!0===f?g:1);b.categories=c.categories;b.treeGrid.mapOfPosToGridNode=c.mapOfPosToGridNode;b.hasNames=
!0;b.treeGrid.tree=c.tree;b.series.forEach(function(a){var b=(a.options.data||[]).map(function(b){A(b)&&a.options.keys&&a.options.keys.length&&h.forEach(function(a){0<=b.indexOf(a.x)&&0<=b.indexOf(a.x2)&&(b=a)});return k(b,!0)?u(b):b});a.visible&&a.setData(b,!1)});b.treeGrid.mapOptionsToLevel=B({defaults:d,from:1,levels:d&&d.levels,to:b.treeGrid.tree&&b.treeGrid.tree.height});"beforeRender"===a.type&&(b.treeGrid.collapsedNodes=c.collapsedNodes)}})}function g(a,b){var c=this.treeGrid.mapOptionsToLevel||
{},d=this.ticks,e=d[b],f;if("treegrid"===this.options.type&&this.treeGrid.mapOfPosToGridNode){var g=this.treeGrid.mapOfPosToGridNode[b];(c=c[g.depth])&&(f={labels:c});e?(e.parameters.category=g.name,e.options=f,e.addLabel()):d[b]=new t(this,b,void 0,void 0,{category:g.name,tickmarkOffset:g.tickmarkOffset,options:f})}else a.apply(this,Array.prototype.slice.call(arguments,1))}function n(a){var b=this.options,c=a.apply(this,Array.prototype.slice.call(arguments,1));if("treegrid"===b.type&&this.treeGrid.mapOfPosToGridNode){var d=
this.treeGrid.mapOfPosToGridNode[-1].height||0;c.width+=b.labels.indentation*(d-1)}return c}function p(a,b,c){var d=this,g="treegrid"===c.type;d.treeGrid||(d.treeGrid=new H(d));g&&(y(b,"beforeRender",f),y(b,"beforeRedraw",f),y(b,"addSeries",function(a){a.options.data&&(a=e(a.options.data,c.uniqueNames||!1,1),d.treeGrid.collapsedNodes=(d.treeGrid.collapsedNodes||[]).concat(a.collapsedNodes))}),y(d,"foundExtremes",function(){d.treeGrid.collapsedNodes&&d.treeGrid.collapsedNodes.forEach(function(a){var b=
d.treeGrid.collapse(a);d.brokenAxis&&(d.brokenAxis.setBreaks(b,!1),d.treeGrid.collapsedNodes&&(d.treeGrid.collapsedNodes=d.treeGrid.collapsedNodes.filter(function(b){return a.collapseStart!==b.collapseStart||a.collapseEnd!==b.collapseEnd})))})}),y(d,"afterBreaks",function(){"yAxis"===d.coll&&!d.staticScale&&d.chart.options.chart.height&&(d.isDirty=!0)}),c=u({grid:{enabled:!0},labels:{align:"left",levels:[{level:void 0},{level:1,style:{fontWeight:"bold"}}],symbol:{type:"triangle",x:-5,y:-5,height:10,
width:10,padding:5}},uniqueNames:!1},c,{reversed:!0,grid:{columns:void 0}}));a.apply(d,[b,c]);g&&(d.hasNames=!0,d.options.showLastLabel=!0)}function D(a){var b=this.options;"treegrid"===b.type?(this.min=r(this.userMin,b.min,this.dataMin),this.max=r(this.userMax,b.max,this.dataMax),d(this,"foundExtremes"),this.setAxisTranslation(),this.tickmarkOffset=.5,this.tickInterval=1,this.tickPositions=this.treeGrid.mapOfPosToGridNode?this.treeGrid.getTickPositions():[]):a.apply(this,Array.prototype.slice.call(arguments,
1))}var G=!1;b.compose=function(b){G||(a(b.prototype,"generateTick",g),a(b.prototype,"getMaxLabelDimensions",n),a(b.prototype,"init",p),a(b.prototype,"setTickInterval",D),q.compose(t),G=!0)};var H=function(){function a(a){this.axis=a}a.prototype.setCollapsedStatus=function(a){var b=this.axis,c=b.chart;b.series.forEach(function(b){var d=b.options.data;if(a.id&&d){var e=c.get(a.id);b=d[b.data.indexOf(e)];e&&b&&(e.collapsed=a.collapsed,b.collapsed=a.collapsed)}})};a.prototype.collapse=function(a){var b=
this.axis,d=b.options.breaks||[],e=c(a,b.max);d.push(e);a.collapsed=!0;b.treeGrid.setCollapsedStatus(a);return d};a.prototype.expand=function(a){var b=this.axis,d=b.options.breaks||[],e=c(a,b.max);a.collapsed=!1;b.treeGrid.setCollapsedStatus(a);return d.reduce(function(a,b){b.to===e.to&&b.from===e.from||a.push(b);return a},[])};a.prototype.getTickPositions=function(){var a=this.axis,b=Math.floor(a.min/a.tickInterval)*a.tickInterval,c=Math.ceil(a.max/a.tickInterval)*a.tickInterval;return Object.keys(a.treeGrid.mapOfPosToGridNode||
{}).reduce(function(d,e){e=+e;!(e>=b&&e<=c)||a.brokenAxis&&a.brokenAxis.isInAnyBreak(e)||d.push(e);return d},[])};a.prototype.isCollapsed=function(a){var b=this.axis,d=b.options.breaks||[],e=c(a,b.max);return d.some(function(a){return a.from===e.from&&a.to===e.to})};a.prototype.toggleCollapse=function(a){return this.isCollapsed(a)?this.expand(a):this.collapse(a)};return a}();b.Additions=H})(g||(g={}));b.prototype.utils={getNode:v.getNode};g.compose(b);return g});D(b,"masters/modules/treegrid.src.js",
[],function(){})});
//# sourceMappingURL=treegrid.js.map