/*
 Highcharts JS v6.0.1 (2017-10-05)

 (c) 2014 Highsoft AS
 Authors: Jon Arild Nygard / Oystein Moseng

 License: www.highcharts.com/license
*/
(function(t){"object"===typeof module&&module.exports?module.exports=t:t(Highcharts)})(function(t){var H=function(d){var t=d.each,x=d.extend,m=d.pick;return{getColor:function(r,n){var D=n.index,h=n.levelMap,k=n.parentColor,t=n.parentColorIndex,w=n.series,p=n.colors,x=n.siblings,f=w.points,q,A,B;if(r){f=f[r.i];r=h[r.levelDynamic]||{};(q=f&&("boolean"===typeof r.colorByPoint?r.colorByPoint:!!w.options.colorByPoint))&&(A=p[f.index%p.length]);p=f&&f.options.color;q=r&&r.color;if(h=k)h=(h=r&&r.colorVariation)&&
"brightness"===h.key?d.color(k).brighten(D/x*h.to).get():k;q=m(p,q,A,h,w.color);B=m(f&&f.options.colorIndex,r&&r.colorIndex,t,n.colorIndex)}return{color:q,colorIndex:B}},setTreeValues:function n(d,h){var k=h.before,y=h.idRoot,w=h.mapIdToNode[y],p=h.points[d.i],z=p&&p.options||{},f=0,q=[];x(d,{levelDynamic:d.level-(("boolean"===typeof h.levelIsConstant?h.levelIsConstant:1)?0:w.level),name:m(p&&p.name,""),visible:y===d.id||("boolean"===typeof h.visible?h.visible:!1)});"function"===typeof k&&(d=k(d,
h));t(d.children,function(k,m){var p=x({},h);x(p,{index:m,siblings:d.children.length,visible:d.visible});k=n(k,p);q.push(k);k.visible&&(f+=k.val)});d.visible=0<f||d.visible;k=m(z.value,f);x(d,{children:q,childrenTotal:f,isLeaf:d.visible&&!f,val:k});return d}}}(t);(function(d,t){var x=d.seriesType,m=d.seriesTypes,r=d.map,n=d.merge,D=d.extend,h=d.noop,k=d.each,y=t.getColor,w=d.grep,p=d.isNumber,z=d.isString,f=d.pick,q=d.Series,A=d.stableSort,B=function(a,b,c){c=c||this;d.objectEach(a,function(l,e){b.call(c,
l,e,a)})},E=d.reduce,C=function(a,b,c){c=c||this;a=b.call(c,a);!1!==a&&C(a,b,c)};x("treemap","scatter",{showInLegend:!1,marker:!1,dataLabels:{enabled:!0,defer:!1,verticalAlign:"middle",formatter:function(){return this.point.name||this.point.id},inside:!0},tooltip:{headerFormat:"",pointFormat:"\x3cb\x3e{point.name}\x3c/b\x3e: {point.value}\x3cbr/\x3e"},ignoreHiddenPoint:!0,layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,drillUpButton:{position:{align:"right",
x:-10,y:10}}},{pointArrayMap:["value"],axisTypes:m.heatmap?["xAxis","yAxis","colorAxis"]:["xAxis","yAxis"],directTouch:!0,optionalAxis:"colorAxis",getSymbol:h,parallelArrays:["x","y","value","colorValue"],colorKey:"colorValue",translateColors:m.heatmap&&m.heatmap.prototype.translateColors,colorAttribs:m.heatmap&&m.heatmap.prototype.colorAttribs,trackerGroups:["group","dataLabelsGroup"],getListOfParents:function(a,b){a=E(a||[],function(a,b,e){b=f(b.parent,"");void 0===a[b]&&(a[b]=[]);a[b].push(e);
return a},{});B(a,function(a,l,e){""!==l&&-1===d.inArray(l,b)&&(k(a,function(a){e[""].push(a)}),delete e[l])});return a},getTree:function(){var a=r(this.data,function(a){return a.id}),a=this.getListOfParents(this.data,a);this.nodeMap=[];return this.buildNode("",-1,0,a,null)},init:function(a,b){q.prototype.init.call(this,a,b);this.options.allowDrillToNode&&d.addEvent(this,"click",this.onClickDrillToNode)},buildNode:function(a,b,c,l,e){var v=this,g=[],d=v.points[b],F=0,G;k(l[a]||[],function(b){G=v.buildNode(v.points[b].id,
b,c+1,l,a);F=Math.max(G.height+1,F);g.push(G)});b={id:a,i:b,children:g,height:F,level:c,parent:e,visible:!1};v.nodeMap[b.id]=b;d&&(d.node=b);return b},setTreeValues:function(a){var b=this,c=b.options,l=0,e=[],v,g=b.points[a.i];k(a.children,function(a){a=b.setTreeValues(a);e.push(a);a.ignore||(l+=a.val)});A(e,function(a,b){return a.sortIndex-b.sortIndex});v=f(g&&g.options.value,l);g&&(g.value=v);D(a,{children:e,childrenTotal:l,ignore:!(f(g&&g.visible,!0)&&0<v),isLeaf:a.visible&&!l,levelDynamic:a.level-
(c.levelIsConstant?b.nodeMap[b.rootNode].level:0),name:f(g&&g.name,""),sortIndex:f(g&&g.sortIndex,-v),val:v});return a},calculateChildrenAreas:function(a,b){var c=this,l=c.options,e=this.levelMap[a.levelDynamic+1],v=f(c[e&&e.layoutAlgorithm]&&e.layoutAlgorithm,l.layoutAlgorithm),g=l.alternateStartingDirection,d=[];a=w(a.children,function(a){return!a.ignore});e&&e.layoutStartingDirection&&(b.direction="vertical"===e.layoutStartingDirection?0:1);d=c[v](b,a);k(a,function(a,e){e=d[e];a.values=n(e,{val:a.childrenTotal,
direction:g?1-b.direction:b.direction});a.pointValues=n(e,{x:e.x/c.axisRatio,width:e.width/c.axisRatio});a.children.length&&c.calculateChildrenAreas(a,a.values)})},setPointValues:function(){var a=this.xAxis,b=this.yAxis;k(this.points,function(c){var l=c.node,e=l.pointValues,d,g;e&&l.visible?(l=Math.round(a.translate(e.x,0,0,0,1))-0,d=Math.round(a.translate(e.x+e.width,0,0,0,1))-0,g=Math.round(b.translate(e.y,0,0,0,1))-0,e=Math.round(b.translate(e.y+e.height,0,0,0,1))-0,c.shapeType="rect",c.shapeArgs=
{x:Math.min(l,d),y:Math.min(g,e),width:Math.abs(d-l),height:Math.abs(e-g)},c.plotX=c.shapeArgs.x+c.shapeArgs.width/2,c.plotY=c.shapeArgs.y+c.shapeArgs.height/2):(delete c.plotX,delete c.plotY)})},setColorRecursive:function(a,b,c,l,e){var d=this,g=d&&d.chart,g=g&&g.options&&g.options.colors,f;if(a){f=y(a,{colors:g,index:l,levelMap:d.levelMap,parentColor:b,parentColorIndex:c,series:d,siblings:e});if(b=d.points[a.i])b.color=f.color,b.colorIndex=f.colorIndex;k(a.children||[],function(b,c){d.setColorRecursive(b,
f.color,f.colorIndex,c,a.children.length)})}},algorithmGroup:function(a,b,c,d){this.height=a;this.width=b;this.plot=d;this.startDirection=this.direction=c;this.lH=this.nH=this.lW=this.nW=this.total=0;this.elArr=[];this.lP={total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(a,b){return Math.max(a/b,b/a)}};this.addElement=function(a){this.lP.total=this.elArr[this.elArr.length-1];this.total+=a;0===this.direction?(this.lW=this.nW,this.lP.lH=this.lP.total/this.lW,this.lP.lR=this.lP.aspectRatio(this.lW,
this.lP.lH),this.nW=this.total/this.height,this.lP.nH=this.lP.total/this.nW,this.lP.nR=this.lP.aspectRatio(this.nW,this.lP.nH)):(this.lH=this.nH,this.lP.lW=this.lP.total/this.lH,this.lP.lR=this.lP.aspectRatio(this.lP.lW,this.lH),this.nH=this.total/this.width,this.lP.nW=this.lP.total/this.nH,this.lP.nR=this.lP.aspectRatio(this.lP.nW,this.nH));this.elArr.push(a)};this.reset=function(){this.lW=this.nW=0;this.elArr=[];this.total=0}},algorithmCalcPoints:function(a,b,c,d){var e,l,g,f,h=c.lW,n=c.lH,u=c.plot,
m,q=0,r=c.elArr.length-1;b?(h=c.nW,n=c.nH):m=c.elArr[c.elArr.length-1];k(c.elArr,function(a){if(b||q<r)0===c.direction?(e=u.x,l=u.y,g=h,f=a/g):(e=u.x,l=u.y,f=n,g=a/f),d.push({x:e,y:l,width:g,height:f}),0===c.direction?u.y+=f:u.x+=g;q+=1});c.reset();0===c.direction?c.width-=h:c.height-=n;u.y=u.parent.y+(u.parent.height-c.height);u.x=u.parent.x+(u.parent.width-c.width);a&&(c.direction=1-c.direction);b||c.addElement(m)},algorithmLowAspectRatio:function(a,b,c){var d=[],e=this,f,g={x:b.x,y:b.y,parent:b},
h=0,n=c.length-1,m=new this.algorithmGroup(b.height,b.width,b.direction,g);k(c,function(c){f=c.val/b.val*b.height*b.width;m.addElement(f);m.lP.nR>m.lP.lR&&e.algorithmCalcPoints(a,!1,m,d,g);h===n&&e.algorithmCalcPoints(a,!0,m,d,g);h+=1});return d},algorithmFill:function(a,b,c){var d=[],e,f=b.direction,g=b.x,h=b.y,m=b.width,n=b.height,q,r,p,t;k(c,function(c){e=c.val/b.val*b.height*b.width;q=g;r=h;0===f?(t=n,p=e/t,m-=p,g+=p):(p=m,t=e/p,n-=t,h+=t);d.push({x:q,y:r,width:p,height:t});a&&(f=1-f)});return d},
strip:function(a,b){return this.algorithmLowAspectRatio(!1,a,b)},squarified:function(a,b){return this.algorithmLowAspectRatio(!0,a,b)},sliceAndDice:function(a,b){return this.algorithmFill(!0,a,b)},stripes:function(a,b){return this.algorithmFill(!1,a,b)},translate:function(){var a=this,b=a.rootNode=f(a.rootNode,a.options.rootId,""),c,d;q.prototype.translate.call(a);a.levelMap=E(a.options.levels||[],function(a,b){a[b.level]=b;return a},{});d=a.tree=a.getTree();c=a.nodeMap[b];""===b||c&&c.children.length||
(a.drillToNode("",!1),b=a.rootNode,c=a.nodeMap[b]);C(a.nodeMap[a.rootNode],function(b){var c=!1,d=b.parent;b.visible=!0;if(d||""===d)c=a.nodeMap[d];return c});C(a.nodeMap[a.rootNode].children,function(a){var b=!1;k(a,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=n(b,{width:b.width*a.axisRatio,direction:"vertical"===a.options.layoutStartingDirection?
0:1,val:d.val});a.calculateChildrenAreas(d,b);a.colorAxis?a.translateColors():a.options.colorByPoint||a.setColorRecursive(a.tree);a.options.allowDrillToNode&&(c=c.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=w(a.points,function(a){return a.node.visible}),c,d;k(b,function(b){d=a.levelMap[b.node.levelDynamic];c={style:{}};b.node.isLeaf||(c.enabled=!1);d&&
d.dataLabels&&(c=n(c,d.dataLabels),a._hasPointLabels=!0);b.shapeArgs&&(c.style.width=b.shapeArgs.width,b.dataLabel&&b.dataLabel.css({width:b.shapeArgs.width+"px"}));b.dlOptions=n(c,b.options.dataLabels)});q.prototype.drawDataLabels.call(this)},alignDataLabel:function(a){m.column.prototype.alignDataLabel.apply(this,arguments);a.dataLabel&&a.dataLabel.attr({zIndex:(a.node.zIndex||0)+1})},drawPoints:function(){var a=this,b=w(a.points,function(a){return a.node.visible});k(b,function(b){var c="level-group-"+
b.node.levelDynamic;a[c]||(a[c]=a.chart.renderer.g(c).attr({zIndex:1E3-b.node.levelDynamic}).add(a.group));b.group=a[c]});m.column.prototype.drawPoints.call(this);this.colorAttribs&&k(this.points,function(a){a.graphic.css(this.colorAttribs(a))},this);a.options.allowDrillToNode&&k(b,function(b){b.graphic&&(b.drillId=a.options.interactByLeaf?a.drillToByLeaf(b):a.drillToByGroup(b))})},onClickDrillToNode:function(a){var b=(a=a.point)&&a.drillId;z(b)&&(a.setState(""),this.drillToNode(b))},drillToByGroup:function(a){var b=
!1;1!==a.node.level-this.nodeMap[this.rootNode].level||a.node.isLeaf||(b=a.id);return b},drillToByLeaf:function(a){var b=!1;if(a.node.parent!==this.rootNode&&a.node.isLeaf)for(a=a.node;!b;)a=this.nodeMap[a.parent],a.parent===this.rootNode&&(b=a.id);return b},drillUp:function(){var a=this.nodeMap[this.rootNode];a&&z(a.parent)&&this.drillToNode(a.parent)},drillToNode:function(a,b){var c=this.nodeMap[a];this.idPreviousRoot=this.rootNode;this.rootNode=a;""===a?this.drillUpButton=this.drillUpButton.destroy():
this.showDrillUpButton(c&&c.name||a);this.isDirty=!0;f(b,!0)&&this.chart.redraw()},showDrillUpButton:function(a){var b=this;a=a||"\x3c Back";var c=b.options.drillUpButton,d,e;c.text&&(a=c.text);this.drillUpButton?this.drillUpButton.attr({text:a}).align():(e=(d=c.theme)&&d.states,this.drillUpButton=this.chart.renderer.button(a,null,null,function(){b.drillUp()},d,e&&e.hover,e&&e.select).attr({align:c.position.align,zIndex:7}).add().align(c.position,!1,c.relativeTo||"plotBox"))},buildKDTree:h,drawLegendSymbol:d.LegendSymbolMixin.drawRectangle,
getExtremes:function(){q.prototype.getExtremes.call(this,this.colorValueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;q.prototype.getExtremes.call(this)},getExtremesFromAll:!0,bindAxes:function(){var a={endOnTick:!1,gridLineWidth:0,lineWidth:0,min:0,dataMin:0,minPadding:0,max:100,dataMax:100,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]};q.prototype.bindAxes.call(this);d.extend(this.yAxis.options,a);d.extend(this.xAxis.options,a)},utils:{recursive:C,reduce:E}},{getClassName:function(){var a=
d.Point.prototype.getClassName.call(this),b=this.series,c=b.options;this.node.level<=b.nodeMap[b.rootNode].level?a+=" highcharts-above-level":this.node.isLeaf||f(c.interactByLeaf,!c.allowDrillToNode)?this.node.isLeaf||(a+=" highcharts-internal-node"):a+=" highcharts-internal-node-interactive";return a},isValid:function(){return this.id||p(this.value)},setState:function(a){d.Point.prototype.setState.call(this,a);this.graphic&&this.graphic.attr({zIndex:"hover"===a?1:0})},setVisible:m.pie.prototype.pointClass.prototype.setVisible})})(t,
H)});
