/*
 Highcharts Gantt JS v7.2.0 (2019-09-03)

 Tree Grid

 (c) 2016-2019 Jon Arild Nygard

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