/* Highcharts JS v8.0.0 (2019-12-10) (c) 2014-2019 Highsoft AS Authors: Jon Arild Nygard / Oystein Moseng 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/treemap",["highcharts"],function(p){b(p);b.Highcharts=p;return b}):b("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(b){function p(q,d,b,l){q.hasOwnProperty(d)||(q[d]=l.apply(null,b))}b=b?b._modules:{};p(b,"mixins/tree-series.js",[b["parts/Globals.js"],b["parts/Utilities.js"]],function(b,d){var q=d.extend,l=d.isArray,y=d.isNumber,h= d.isObject,v=d.pick,p=b.merge;return{getColor:function(e,k){var d=k.index,q=k.mapOptionsToLevel,n=k.parentColor,l=k.parentColorIndex,h=k.series,r=k.colors,G=k.siblings,t=h.points,p=h.chart.options.chart,w;if(e){t=t[e.i];e=q[e.level]||{};if(q=t&&e.colorByPoint){var y=t.index%(r?r.length:p.colorCount);var z=r&&r[y]}if(!h.chart.styledMode){r=t&&t.options.color;p=e&&e.color;if(w=n)w=(w=e&&e.colorVariation)&&"brightness"===w.key?b.color(n).brighten(d/G*w.to).get():n;w=v(r,p,z,w,h.color)}var C=v(t&&t.options.colorIndex, e&&e.colorIndex,y,l,k.colorIndex)}return{color:w,colorIndex:C}},getLevelOptions:function(e){var k=null;if(h(e)){k={};var d=y(e.from)?e.from:1;var b=e.levels;var n={};var v=h(e.defaults)?e.defaults:{};l(b)&&(n=b.reduce(function(k,e){if(h(e)&&y(e.level)){var b=p({},e);var l="boolean"===typeof b.levelIsConstant?b.levelIsConstant:v.levelIsConstant;delete b.levelIsConstant;delete b.level;e=e.level+(l?0:d-1);h(k[e])?q(k[e],b):k[e]=b}return k},{}));b=y(e.to)?e.to:1;for(e=0;e<=b;e++)k[e]=p({},v,h(n[e])?n[e]: {})}return k},setTreeValues:function E(k,b){var d=b.before,l=b.idRoot,h=b.mapIdToNode[l],r=b.points[k.i],p=r&&r.options||{},t=0,y=[];q(k,{levelDynamic:k.level-(("boolean"===typeof b.levelIsConstant?b.levelIsConstant:1)?0:h.level),name:v(r&&r.name,""),visible:l===k.id||("boolean"===typeof b.visible?b.visible:!1)});"function"===typeof d&&(k=d(k,b));k.children.forEach(function(d,l){var h=q({},b);q(h,{index:l,siblings:k.children.length,visible:k.visible});d=E(d,h);y.push(d);d.visible&&(t+=d.val)});k.visible= 0{point.name}: {point.value}
"},ignoreHiddenPoint:!0,layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,drillUpButton:{position:{align:"right",x:-10,y:10}},traverseUpButton:{position:{align:"right",x:-10,y:10}},borderColor:"#e6e6e6",borderWidth:1,colorKey:"colorValue",opacity:.15,states:{hover:{borderColor:"#999999", brightness:F.heatmap?0:.1,halo:!1,opacity:.75,shadow:!1}}},{pointArrayMap:["value"],directTouch:!0,optionalAxis:"colorAxis",getSymbol:t,parallelArrays:["x","y","value","colorValue"],colorKey:"colorValue",trackerGroups:["group","dataLabelsGroup"],getListOfParents:function(a,c){a=A(a)?a:[];var f=A(c)?c:[];c=a.reduce(function(a,c,f){c=n(c.parent,"");"undefined"===typeof a[c]&&(a[c]=[]);a[c].push(f);return a},{"":[]});M(c,function(a,c,b){""!==c&&-1===f.indexOf(c)&&(a.forEach(function(a){b[""].push(a)}), delete b[c])});return c},getTree:function(){var a=this.data.map(function(a){return a.id});a=this.getListOfParents(this.data,a);this.nodeMap=[];return this.buildNode("",-1,0,a,null)},hasData:function(){return!!this.processedXData.length},init:function(a,c){var f=b.colorMapSeriesMixin;f&&(this.colorAttribs=f.colorAttribs);this.eventsToUnbind.push(I(this,"setOptions",function(a){a=a.userOptions;h(a.allowDrillToNode)&&!h(a.allowTraversingTree)&&(a.allowTraversingTree=a.allowDrillToNode,delete a.allowDrillToNode); h(a.drillUpButton)&&!h(a.traverseUpButton)&&(a.traverseUpButton=a.drillUpButton,delete a.drillUpButton)}));z.prototype.init.call(this,a,c);this.options.allowTraversingTree&&this.eventsToUnbind.push(I(this,"click",this.onClickDrillToNode))},buildNode:function(a,c,f,b,g){var x=this,m=[],u=x.points[c],d=0,H;(b[a]||[]).forEach(function(c){H=x.buildNode(x.points[c].id,c,f+1,b,a);d=Math.max(H.height+1,d);m.push(H)});c={id:a,i:c,children:m,height:d,level:f,parent:g,visible:!1};x.nodeMap[c.id]=c;u&&(u.node= c);return c},setTreeValues:function(a){var c=this,f=c.options,b=c.nodeMap[c.rootNode];f="boolean"===typeof f.levelIsConstant?f.levelIsConstant:!0;var g=0,x=[],m=c.points[a.i];a.children.forEach(function(a){a=c.setTreeValues(a);x.push(a);a.ignore||(g+=a.val)});L(x,function(a,c){return a.sortIndex-c.sortIndex});var d=n(m&&m.options.value,g);m&&(m.value=d);v(a,{children:x,childrenTotal:g,ignore:!(n(m&&m.visible,!0)&&0k.lP.lR&&g.algorithmCalcPoints(a,!1,k,f,e);h===l&&g.algorithmCalcPoints(a,!0,k,f,e);h+=1});return f},algorithmFill:function(a,c,b){var f=[],g,d=c.direction,e=c.x,k=c.y,h=c.width,l=c.height,p,n,r,q;b.forEach(function(b){g=b.val/c.val*c.height*c.width;p=e;n=k;0===d?(q=l,r=g/q,h-=r,e+=r):(r=h,q=g/r,l-=q, k+=q);f.push({x:p,y:n,width:r,height:q});a&&(d=1-d)});return f},strip:function(a,c){return this.algorithmLowAspectRatio(!1,a,c)},squarified:function(a,c){return this.algorithmLowAspectRatio(!0,a,c)},sliceAndDice:function(a,c){return this.algorithmFill(!0,a,c)},stripes:function(a,c){return this.algorithmFill(!1,a,c)},translate:function(){var a=this,c=a.options,b=N(a);z.prototype.translate.call(a);var d=a.tree=a.getTree();var g=a.nodeMap[b];a.renderTraverseUpButton(b);a.mapOptionsToLevel=K({from:g.level+ 1,levels:c.levels,to:d.height,defaults:{levelIsConstant:a.options.levelIsConstant,colorByPoint:c.colorByPoint}});""===b||g&&g.children.length||(a.setRootNode("",!1),b=a.rootNode,g=a.nodeMap[b]);B(a.nodeMap[a.rootNode],function(b){var c=!1,f=b.parent;b.visible=!0;if(f||""===f)c=a.nodeMap[f];return c});B(a.nodeMap[a.rootNode].children,function(a){var b=!1;a.forEach(function(a){a.visible=!0;a.children.length&&(b=(b||[]).concat(a.children))});return b});a.setTreeValues(d);a.axisRatio=a.xAxis.len/a.yAxis.len; a.nodeMap[""].pointValues=b={x:0,y:0,width:100,height:100};a.nodeMap[""].values=b=r(b,{width:b.width*a.axisRatio,direction:"vertical"===c.layoutStartingDirection?0:1,val:d.val});a.calculateChildrenAreas(d,b);a.colorAxis||c.colorByPoint||a.setColorRecursive(a.tree);c.allowTraversingTree&&(c=g.pointValues,a.xAxis.setExtremes(c.x,c.x+c.width,!1),a.yAxis.setExtremes(c.y,c.y+c.height,!1),a.xAxis.setScale(),a.yAxis.setScale());a.setPointValues()},drawDataLabels:function(){var a=this,b=a.mapOptionsToLevel, f,d;a.points.filter(function(a){return a.node.visible}).forEach(function(c){d=b[c.node.level];f={style:{}};c.node.isLeaf||(f.enabled=!1);d&&d.dataLabels&&(f=r(f,d.dataLabels),a._hasPointLabels=!0);c.shapeArgs&&(f.style.width=c.shapeArgs.width,c.dataLabel&&c.dataLabel.css({width:c.shapeArgs.width+"px"}));c.dlOptions=r(f,c.options.dataLabels)});z.prototype.drawDataLabels.call(this)},alignDataLabel:function(a,b,f){var c=f.style;!h(c.textOverflow)&&b.text&&b.getBBox().width>b.text.textWidth&&b.css({textOverflow:"ellipsis", width:c.width+="px"});F.column.prototype.alignDataLabel.apply(this,arguments);a.dataLabel&&a.dataLabel.attr({zIndex:(a.node.zIndex||0)+1})},pointAttribs:function(a,b){var c=k(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},d=a&&c[a.node.level]||{};c=this.options;var g=b&&c.states[b]||{},e=a&&a.getClassName()||"";a={stroke:a&&a.borderColor||d.borderColor||g.borderColor||c.borderColor,"stroke-width":n(a&&a.borderWidth,d.borderWidth,g.borderWidth,c.borderWidth),dashstyle:a&&a.borderDashStyle||d.borderDashStyle|| g.borderDashStyle||c.borderDashStyle,fill:a&&a.color||this.color};-1!==e.indexOf("highcharts-above-level")?(a.fill="none",a["stroke-width"]=0):-1!==e.indexOf("highcharts-internal-node-interactive")?(b=n(g.opacity,c.opacity),a.fill=J(a.fill).setOpacity(b).get(),a.cursor="pointer"):-1!==e.indexOf("highcharts-internal-node")?a.fill="none":b&&(a.fill=J(a.fill).brighten(g.brightness).get());return a},drawPoints:function(){var a=this,b=a.chart,d=b.renderer,e=b.styledMode,g=a.options,k=e?{}:g.shadow,h=g.borderRadius, l=b.pointCount