/* Highcharts Gantt JS v9.1.1 (2021-06-03) Tree Grid (c) 2016-2021 Jon Arild Nygard License: www.highcharts.com/license */ 'use strict';(function(h){"object"===typeof module&&module.exports?(h["default"]=h,module.exports=h):"function"===typeof define&&define.amd?define("highcharts/modules/treegrid",["highcharts"],function(E){h(E);h.Highcharts=E;return h}):h("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(h){function E(h,t,B,u){h.hasOwnProperty(t)||(h[t]=u.apply(null,B))}h=h?h._modules:{};E(h,"Core/Axis/BrokenAxis.js",[h["Core/Axis/Axis.js"],h["Core/Series/Series.js"],h["Extensions/Stacking.js"],h["Core/Utilities.js"]], function(h,t,B,u){var y=u.addEvent,n=u.find,x=u.fireEvent,v=u.isArray,l=u.isNumber,a=u.pick,r;(function(r){function m(){"undefined"!==typeof this.brokenAxis&&this.brokenAxis.setBreaks(this.options.breaks,!1)}function u(){this.brokenAxis&&this.brokenAxis.hasBreaks&&(this.options.ordinal=!1)}function F(){var b=this.brokenAxis;if(b&&b.hasBreaks){for(var D=this.tickPositions,a=this.tickPositions.info,A=[],f=0;ff.to||e>f.from&&Cf.from&&Cf.from&&C>f.to&&CA&&a>=this.basePointRange&&(A=a),e=void 0;f--;)e&&!1!==e.visible||(e=b[f+1]),a=b[f],!1!==e.visible&&!1!==a.visible&&(e.x-a.x>A&&(e=(a.x+e.x)/2,b.splice(f+1,0,{isNull:!0,x:e}),d.stacking&&this.options.stacking&&(e=d.stacking.stacks[this.stackKey][e]=new B(d,d.options.stackLabels,!1,e,this.stack),e.total=0)),e=a);return this.getGraphPath(b)}r.compose= function(a,D){if(-1===a.keepProps.indexOf("brokenAxis")){a.keepProps.push("brokenAxis");var l=t.prototype;l.drawBreaks=z;l.gappedPath=d;y(a,"init",c);y(a,"afterInit",m);y(a,"afterSetTickPositions",F);y(a,"afterSetOptions",u);y(D,"afterGeneratePoints",b);y(D,"afterRender",p)}return a};var w=function(){function b(b){this.hasBreaks=!1;this.axis=b}b.isInBreak=function(b,a){var d=b.repeat||Infinity,f=b.from,e=b.to-b.from;a=a>=f?(a-f)%d:d-(f-a)%d;return b.inclusive?a<=e:a=a)break;else f.to=a)break;else if(b.isInBreak(e,a)){c-=a-e.from;break}}return c};b.prototype.findBreakAt=function(b,a){return n(a,function(a){return a.fromw;)H-=r;for(;Hg?c.hide():c.show()),(c=this.ticks[k].label)&&(k-d>g?c.hide():c.show()),(a=this.ticks[k].mark)&&(k-dc&&!a.startOnTick&&(e[0]=c),f>q&&f-pp?a:p;G=G+1+d.descendants;x=Math.max(d.height+1,x);return d});a&&(a.start=u(a.start,b),a.end=u(a.end,p));t(v,{children:c,descendants:G, height:x});"function"===typeof F&&F(v,m);return v};return{getListOfParents:y,getNode:n,getTree:function(h,u){var l=h.map(function(a){return a.id});h=y(h,l);return n("",null,1,null,h,u)}}});E(h,"Core/Axis/TreeGridTick.js",[h["Core/Color/Palette.js"],h["Core/Utilities.js"]],function(h,t){var B=t.addEvent,u=t.isObject,y=t.isNumber,n=t.pick,x=t.wrap,v;(function(l){function a(){this.treeGrid||(this.treeGrid=new F(this))}function r(a,b){a=a.treeGrid;var c=!a.labelIcon,l=b.renderer,d=b.xy,w=b.options,m= w.width||0,r=w.height||0,u=d.x-m/2-(w.padding||0);d=d.y-r/2;var A=b.collapsed?90:180,f=b.show&&y(d),e=a.labelIcon;e||(a.labelIcon=e=l.path(l.symbols[w.type](w.x||0,w.y||0,m,r)).addClass("highcharts-label-icon").add(b.group));e.attr({y:f?0:-9999});l.styledMode||e.attr({cursor:"pointer",fill:n(b.color,h.neutralColor60),"stroke-width":1,stroke:w.lineColor,strokeWidth:w.lineWidth||0});e[c?"attr":"animate"]({translateX:u,translateY:d,rotation:A})}function m(a,b,p,l,d,h,m,r,v){var c=n(this.options&&this.options.labels, h);h=this.pos;var f=this.axis,e="treegrid"===f.options.type;a=a.apply(this,[b,p,l,d,c,m,r,v]);e&&(b=c&&u(c.symbol,!0)?c.symbol:{},c=c&&y(c.indentation)?c.indentation:0,h=(h=(f=f.treeGrid.mapOfPosToGridNode)&&f[h])&&h.depth||1,a.x+=(b.width||0)+2*(b.padding||0)+(h-1)*c);return a}function v(a){var b=this,c=b.pos,l=b.axis,d=b.label,h=l.treeGrid.mapOfPosToGridNode,m=l.options,v=n(b.options&&b.options.labels,m&&m.labels),t=v&&u(v.symbol,!0)?v.symbol:{},x=(h=h&&h[c])&&h.depth;m="treegrid"===m.type;var f= -1=b&&(a-=.5);return{from:a,to:e,showPoints:!1}}function d(a,b,d){var e=[],c=[],f={},q="boolean"===typeof b?b:!1,h={},p=-1;a=B.getTree(a,{after:function(a){a=h[a.pos];var b=0,e=0;a.children.forEach(function(a){e+=(a.descendants|| 0)+1;b=Math.max((a.height||0)+1,b)});a.descendants=e;a.height=b;a.collapsed&&c.push(a)},before:function(a){var b=m(a.data,!0)?a.data:{},d=G(b.name)?b.name:"",c=f[a.parent];c=m(c,!0)?h[c.pos]:null;var g=function(a){return a.name===d},n;q&&m(c,!0)&&(n=l(c.children,g))?(g=n.pos,n.nodes.push(a)):g=p++;h[g]||(h[g]=n={depth:c?c.depth+1:0,name:d,id:b.id,nodes:[a],children:[],pos:g},-1!==g&&e.push(d),m(c,!0)&&c.children.push(n));G(a.id)&&(f[a.id]=a);n&&!0===b.collapsed&&(n.collapsed=!0);a.pos=g}});h=function(a, b){var e=function(a,d,c){var g=d+(-1===d?0:b-1),f=(g-d)/2,k=d+f;a.nodes.forEach(function(a){var b=a.data;m(b,!0)&&(b.y=d+(b.seriesIndex||0),delete b.seriesIndex);a.pos=k});c[k]=a;a.pos=k;a.tickmarkOffset=f+.5;a.collapseStart=g+.5;a.children.forEach(function(a){e(a,g+1,c);g=(a.collapseEnd||0)-.5});a.collapseEnd=g+.5;return c};return e(a["-1"],-1,{})}(h,d);return{categories:e,mapOfIdToNode:f,mapOfPosToGridNode:h,collapsedNodes:c,tree:a}}function n(a){a.target.axes.filter(function(a){return"treegrid"=== a.options.type}).forEach(function(b){var c=b.options||{},e=c.labels,f=c.uniqueNames;c=c.max;var h=0;if(!b.treeGrid.mapOfPosToGridNode||b.series.some(function(a){return!a.hasRendered||a.isDirtyData||a.isDirty})){var l=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));m(c,!0)&&(c.seriesIndex=h,a.push(c))}),!0===f&&h++);return a},[]); if(c&&l.length=b&&e<=c)||a.brokenAxis&&a.brokenAxis.isInAnyBreak(e)||d.push(e);return d},[])};a.prototype.isCollapsed=function(a){var b=this.axis,c=b.options.breaks||[],d=p(a,b.max);return c.some(function(a){return a.from===d.from&&a.to===d.to})};a.prototype.toggleCollapse=function(a){return this.isCollapsed(a)?this.expand(a):this.collapse(a)};return a}();b.Additions=f})(b||(b={}));return b});E(h,"masters/modules/treegrid.src.js", [h["Core/Globals.js"],h["Core/Axis/TreeGridAxis.js"]],function(h,t){t.compose(h.Axis,h.Chart,h.Series,h.Tick)})}); //# sourceMappingURL=treegrid.js.map