!/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/treemap
 * @requires highcharts
 *
 * (c) 2014-2026 Highsoft AS
 * Authors: Jon Arild Nygård / Øystein Moseng
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.Templating,t._Highcharts.Color,t._Highcharts.SeriesRegistry,t._Highcharts.SVGElement,t._Highcharts.Series):"function"==typeof define&&define.amd?define("highcharts/modules/treemap",["highcharts/highcharts"],function(t){return e(t,t.Templating,t.Color,t.SeriesRegistry,t.SVGElement,t.Series)}):"object"==typeof exports?exports["highcharts/modules/treemap"]=e(t._Highcharts,t._Highcharts.Templating,t._Highcharts.Color,t._Highcharts.SeriesRegistry,t._Highcharts.SVGElement,t._Highcharts.Series):t.Highcharts=e(t.Highcharts,t.Highcharts.Templating,t.Highcharts.Color,t.Highcharts.SeriesRegistry,t.Highcharts.SVGElement,t.Highcharts.Series)}("u"<typeof window?this:window,function(t,e,i,o,r,s){return function(){"use strict";var n,a,l,h,p={28:function(t){t.exports=r},512:function(t){t.exports=o},620:function(t){t.exports=i},820:function(t){t.exports=s},944:function(e){e.exports=t},984:function(t){t.exports=e}},d={};function u(t){var e=d[t];if(void 0!==e)return e.exports;var i=d[t]={exports:{}};return p[t](i,i.exports,u),i.exports}u.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(e,{a:e}),e},u.d=function(t,e){for(var i in e)u.o(e,i)&&!u.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var c={};u.d(c,{default:function(){return th}});var v=u(944),g=u.n(v),f={mainBreadcrumb:"Main"},y={buttonSpacing:5,buttonTheme:{fill:"none",height:18,padding:2,"stroke-width":0,zIndex:7,states:{select:{fill:"none"}},style:{color:"var(--highcharts-highlight-color-80)"}},floating:!1,format:void 0,relativeTo:"plotBox",rtl:!1,position:{align:"left",verticalAlign:"top",x:0,y:void 0},separator:{text:"/",style:{color:"var(--highcharts-neutral-color-60)",fontSize:"0.8em"}},showFullPath:!0,style:{},useHTML:!1,zIndex:7},m=u(984),b=u.n(m)().format,x=g().composed;function w(){if(this.breadcrumbs){var t=this.resetZoomButton&&this.resetZoomButton.getBBox(),e=this.breadcrumbs.options;t&&"right"===e.position.align&&"plotBox"===e.relativeTo&&this.breadcrumbs.alignBreadcrumbsGroup(-t.width-e.buttonSpacing)}}function T(){this.breadcrumbs&&(this.breadcrumbs.destroy(),this.breadcrumbs=void 0)}function L(){var t=this.breadcrumbs;if(t&&!t.options.floating&&t.level){var e=t.options,i=e.buttonTheme,o=(i.height||0)+2*(i.padding||0)+e.buttonSpacing,r=e.position.verticalAlign;"bottom"===r?(this.marginBottom=(this.marginBottom||0)+o,t.yOffset=o):"middle"!==r?(this.plotTop+=o,t.yOffset=-o):t.yOffset=void 0}}function A(){this.breadcrumbs&&this.breadcrumbs.redraw()}function O(t){!0===t.resetSelection&&this.breadcrumbs&&this.breadcrumbs.alignBreadcrumbsGroup()}var P=function(){function t(e,i){this.elementList={},this.isDirty=!0,this.level=0,this.list=[];var o=(0,v.merge)(e.options.drilldown&&e.options.drilldown.drillUpButton,t.defaultOptions,e.options.navigation&&e.options.navigation.breadcrumbs,i);this.chart=e,this.options=o||{}}return t.compose=function(t,e){(0,v.pushUnique)(x,"Breadcrumbs")&&((0,v.addEvent)(t,"destroy",T),(0,v.addEvent)(t,"afterShowResetZoom",w),(0,v.addEvent)(t,"getMargins",L),(0,v.addEvent)(t,"redraw",A),(0,v.addEvent)(t,"selection",O),(0,v.extend)(e.lang,f))},t.prototype.updateProperties=function(t){this.setList(t),this.setLevel(),this.isDirty=!0},t.prototype.setList=function(t){this.list=t},t.prototype.setLevel=function(){this.level=this.list.length&&this.list.length-1},t.prototype.getLevel=function(){return this.level},t.prototype.getButtonText=function(t){var e=this.chart,i=this.options,o=e.options.lang,r=(0,v.pick)(i.format,i.showFullPath?"{level.name}":"← {level.name}"),s=o&&(0,v.pick)(o.drillUpText,o.mainBreadcrumb),n=i.formatter&&i.formatter(t)||b(r,{level:t.levelOptions},e)||"";return((0,v.isString)(n)&&!n.length||"← "===n)&&(0,v.defined)(s)&&(n=i.showFullPath?s:"← "+s),n},t.prototype.redraw=function(){this.isDirty&&this.render(),this.group&&this.group.align(),this.isDirty=!1},t.prototype.render=function(){var t=this.chart,e=this.options;!this.group&&e&&(this.group=t.renderer.g("breadcrumbs-group").addClass("highcharts-no-tooltip highcharts-breadcrumbs").attr({zIndex:e.zIndex}).add()),e.showFullPath?this.renderFullPathButtons():this.renderSingleButton(),this.alignBreadcrumbsGroup()},t.prototype.renderFullPathButtons=function(){this.destroySingleButton(),this.resetElementListState(),this.updateListElements(),this.destroyListElements()},t.prototype.renderSingleButton=function(){var t=this.chart,e=this.list,i=this.options.buttonSpacing;this.destroyListElements();var o=this.group?this.group.getBBox().width:i,r=e[e.length-2];!t.drillUpButton&&this.level>0?t.drillUpButton=this.renderButton(r,o,i):t.drillUpButton&&(this.level>0?this.updateSingleButton():this.destroySingleButton())},t.prototype.alignBreadcrumbsGroup=function(t){if(this.group){var e=this.options,i=e.buttonTheme,o=e.position,r="chart"===e.relativeTo||"spacingBox"===e.relativeTo?void 0:"plotBox",s=this.group.getBBox(),n=2*(i.padding||0)+e.buttonSpacing;o.width=s.width+n,o.height=s.height+n;var a=(0,v.merge)(o);t&&(a.x+=t),this.options.rtl&&(a.x+=o.width),a.y=(0,v.pick)(a.y,this.yOffset,0),this.group.align(a,!0,r)}},t.prototype.renderButton=function(t,e,i){var o=this,r=this.chart,s=o.options,n=(0,v.merge)(s.buttonTheme),a=r.renderer.button(o.getButtonText(t),e,i,function(e){var i,r=s.events&&s.events.click;r&&(i=r.call(o,e,t,o)),!1!==i&&(s.showFullPath?e.newLevel=t.level:e.newLevel=o.level-1,(0,v.fireEvent)(o,"up",e))},n).addClass("highcharts-breadcrumbs-button").add(o.group);return r.styledMode||a.attr(s.style),a},t.prototype.renderSeparator=function(t,e){var i=this.chart,o=this.options.separator,r=i.renderer.label(o.text,t,e,void 0,void 0,void 0,!1).addClass("highcharts-breadcrumbs-separator").add(this.group);return i.styledMode||r.css(o.style),r},t.prototype.update=function(t){(0,v.merge)(!0,this.options,t),this.destroy(),this.isDirty=!0},t.prototype.updateSingleButton=function(){var t=this.chart,e=this.list[this.level-1];t.drillUpButton&&t.drillUpButton.attr({text:this.getButtonText(e)})},t.prototype.destroy=function(){this.destroySingleButton(),this.destroyListElements(!0),this.group&&this.group.destroy(),this.group=void 0},t.prototype.destroyListElements=function(t){var e=this.elementList;(0,v.objectEach)(e,function(i,o){(t||!e[o].updated)&&((i=e[o]).button&&i.button.destroy(),i.separator&&i.separator.destroy(),delete i.button,delete i.separator,delete e[o])}),t&&(this.elementList={})},t.prototype.destroySingleButton=function(){this.chart.drillUpButton&&(this.chart.drillUpButton.destroy(),this.chart.drillUpButton=void 0)},t.prototype.resetElementListState=function(){(0,v.objectEach)(this.elementList,function(t){t.updated=!1})},t.prototype.updateListElements=function(){for(var t,e,i=this.elementList,o=this.options.buttonSpacing,r=this.list,s=this.options.rtl,n=s?-1:1,a=function(t,e){return n*t.getBBox().width+n*e},l=function(t,e,i){t.translate(e-t.getBBox().width,i)},h=this.group?a(this.group,o):o,p=0,d=r.length;p<d;++p){var u=p===d-1,c=void 0,v=void 0;i[(e=r[p]).level]?(c=(t=i[e.level]).button,t.separator||u?t.separator&&u&&(t.separator.destroy(),delete t.separator):(h+=n*o,t.separator=this.renderSeparator(h,o),s&&l(t.separator,h,o),h+=a(t.separator,o)),i[e.level].updated=!0):(c=this.renderButton(e,h,o),s&&l(c,h,o),h+=a(c,o),u||(v=this.renderSeparator(h,o),s&&l(v,h,o),h+=a(v,o)),i[e.level]={button:c,separator:v,updated:!0}),c&&c.setState(2*!!u)}},t.defaultOptions=y,t}(),B=u(620),S=u.n(B),C=u(512),N=u.n(C),M=u(28),E=u.n(M),D=N().seriesTypes.column.prototype,R=l||(l={});function k(t){var e=this.series,i=e.chart.renderer;this.moveToTopOnHover&&this.graphic&&(e.stateMarkerGraphic||(e.stateMarkerGraphic=new(E())(i,"use").css({pointerEvents:"none"}).add(this.graphic.parentGroup)),(null==t?void 0:t.state)==="hover"?(this.graphic.attr({id:this.id}),e.stateMarkerGraphic.attr({href:""+i.url+"#".concat(this.id),visibility:"visible"})):e.stateMarkerGraphic.attr({href:""}))}R.pointMembers={dataLabelOnNull:!0,moveToTopOnHover:!0,isValid:function(){return null!==this.value&&this.value!==1/0&&this.value!==-1/0&&(void 0===this.value||!isNaN(this.value))}},R.seriesMembers={colorKey:"value",axisTypes:["xAxis","yAxis","colorAxis"],parallelArrays:["x","y","value"],pointArrayMap:["value"],trackerGroups:["group","markerGroup","dataLabelsGroup"],colorAttribs:function(t){var e={};return(0,v.defined)(t.color)&&(!t.state||"normal"===t.state)&&(e[this.colorProp||"fill"]=t.color),e},pointAttribs:D.pointAttribs},R.compose=function(t){var e=t.prototype.pointClass;return(0,v.addEvent)(e,"afterSetState",k),t};var H=l,I=u(820),G=u.n(I),V=function(){function t(t,e,i,o){this.height=t,this.width=e,this.plot=o,this.direction=i,this.startDirection=i,this.total=0,this.nW=0,this.lW=0,this.nH=0,this.lH=0,this.elArr=[],this.lP={total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(t,e){return Math.max(t/e,e/t)}}}return t.prototype.addElement=function(t){this.lP.total=this.elArr[this.elArr.length-1],this.total=this.total+t,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(t)},t.prototype.reset=function(){this.nW=0,this.lW=0,this.elArr=[],this.total=0},t}(),U=function(){function t(){this.childrenTotal=0,this.visible=!1}return t.prototype.init=function(t,e,i,o,r,s,n){return this.id=t,this.i=e,this.children=i,this.height=o,this.level=r,this.series=s,this.parent=n,this},t}(),_=function(){return(_=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},W=function(t,e){var i=e.animatableAttribs,o=e.onComplete,r=e.css,s=e.renderer,n=t.series&&t.series.chart.hasRendered?void 0:t.series&&t.series.options.animation,a=t.graphic;if(e.attribs=_(_({},e.attribs),{class:t.getClassName()}),t.shouldDraw())a||(t.graphic=a="text"===e.shapeType?s.text():"image"===e.shapeType?s.image(e.imageUrl||"").attr(e.shapeArgs||{}):s[e.shapeType](e.shapeArgs||{}),a.add(e.group)),r&&a.css(r),a.attr(e.attribs).animate(i,!e.isNew&&n,o);else if(a){var l=function(){t.graphic=a=a&&a.destroy(),"function"==typeof o&&o()};Object.keys(i).length?a.animate(i,void 0,function(){return l()}):l()}},j=(n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),F=N().seriesTypes,z=F.pie.prototype.pointClass,K=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.groupedPointsAmount=0,e.shapeType="rect",e}return j(e,t),e.prototype.draw=function(t){W(this,t)},e.prototype.getClassName=function(){var e=this.series,i=e.options,o=t.prototype.getClassName.call(this);return this.node.level<=e.nodeMap[e.rootNode].level&&this.node.children.length?o+=" highcharts-above-level":this.node.isGroup||this.node.isLeaf||e.nodeMap[e.rootNode].isGroup||(0,v.pick)(i.interactByLeaf,!i.allowTraversingTree)?this.node.isGroup||this.node.isLeaf||e.nodeMap[e.rootNode].isGroup||(o+=" highcharts-internal-node"):o+=" highcharts-internal-node-interactive",o},e.prototype.isValid=function(){return!!(this.id||(0,v.isNumber)(this.value))},e.prototype.setState=function(e){t.prototype.setState.apply(this,arguments),this.graphic&&this.graphic.attr({zIndex:+("hover"===e)})},e.prototype.shouldDraw=function(){return(0,v.isNumber)(this.plotY)&&null!==this.y},e}(F.scatter.prototype.pointClass);(0,v.extend)(K.prototype,{setVisible:z.prototype.setVisible});var Y={allowTraversingTree:!1,animationLimit:250,borderRadius:0,showInLegend:!1,marker:void 0,colorByPoint:!1,dataLabels:{enabled:!0,formatter:function(){var t=this&&this.point?this.point:{};return(0,v.isString)(t.name)?t.name:""},headers:!1,inside:!0,padding:2,verticalAlign:"middle",style:{textOverflow:"ellipsis"}},tooltip:{headerFormat:"",pointFormat:"<b>{point.name}</b>: {point.value}<br/>",clusterFormat:"+ {point.groupedPointsAmount} more...<br/>"},ignoreHiddenPoint:!0,layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,traverseUpButton:{position:{align:"right",x:-10,y:10}},borderColor:"var(--highcharts-neutral-color-10)",borderWidth:1,colorKey:"colorValue",opacity:.15,states:{hover:{borderColor:"var(--highcharts-neutral-color-40)",brightness:.1*!N().seriesTypes.heatmap,halo:!1,opacity:.75,shadow:!1}},legendSymbol:"rectangle",traverseToLeaf:!1,cluster:{className:void 0,color:void 0,enabled:!1,pixelWidth:void 0,pixelHeight:void 0,name:void 0,reductionFactor:void 0,minimumClusterSize:5,layoutAlgorithm:{distance:0,gridSize:0,kmeansThreshold:0},marker:{lineWidth:0,radius:0}}};(h||(h={})).recursive=function t(e,i,o){var r=i.call(o||this,e);!1!==r&&t(r,i,o)};var q=h,Z=function(t,e){var i,o,r,s,n,a,l,h=e.index,p=e.mapOptionsToLevel,d=e.parentColor,u=e.parentColorIndex,c=e.series,g=e.colors,f=e.siblings,y=c.points,m=c.chart.options.chart;return t&&(o=y[t.i],r=p[t.level]||{},o&&r.colorByPoint&&(n=o.index%(g?g.length:m.colorCount),s=g&&g[n]),c.chart.styledMode||(a=(0,v.pick)(o&&o.options.color,r&&r.color,s,d&&((i=r&&r.colorVariation)&&"brightness"===i.key&&h&&f?S().parse(d).brighten(i.to*(h/f)).get():d),c.color)),l=(0,v.pick)(o&&o.options.colorIndex,r&&r.colorIndex,n,u,e.colorIndex)),{color:a,colorIndex:l}},X=function(t){var e,i,o,r,s,n,a={};if((0,v.isObject)(t))for(r=(0,v.isNumber)(t.from)?t.from:1,n=t.levels,i={},e=(0,v.isObject)(t.defaults)?t.defaults:{},(0,v.isArray)(n)&&(i=n.reduce(function(t,i){var o,s,n;return(0,v.isObject)(i)&&(0,v.isNumber)(i.level)&&(n=(0,v.merge)({},i),s=(0,v.pick)(n.levelIsConstant,e.levelIsConstant),delete n.levelIsConstant,delete n.level,o=i.level+(s?0:r-1),(0,v.isObject)(t[o])?(0,v.merge)(!0,t[o],n):t[o]=n),t},{})),s=(0,v.isNumber)(t.to)?t.to:1,o=0;o<=s;o++)a[o]=(0,v.merge)({},e,(0,v.isObject)(i[o])?i[o]:{});return a},J=function(t){var e,i;return(0,v.isObject)(t)&&(i=(0,v.isObject)(t.options)?t.options:{},e=(0,v.pick)(t.rootNode,i.rootId,""),(0,v.isObject)(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e},Q=(a=function(t,e){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),$=S().parse,tt=g().composed,te=g().noop,ti=N().seriesTypes,to=ti.column,tr=ti.scatter;G().keepProps.push("simulation","hadOutsideDataLabels");var ts=!1;function tn(){var t=this.xAxis,e=this.yAxis;if(t&&e)if(this.is("treemap")){var i={endOnTick:!1,startOnTick:!1,visible:!1};this.is("treegraph")||(i.min=0,i.max=100,i.tickPositions=[]),(0,v.merge)(!0,t.options,i,t.userOptions),(0,v.merge)(!0,e.options,i,e.userOptions),t.visible=t.options.visible,e.visible=e.options.visible,this.is("treegraph")&&(this.isCartesian=t.visible),ts=!0}else ts&&(e.setOptions(e.userOptions),t.setOptions(t.userOptions),ts=!1)}var ta=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.simulation=0,e}return Q(e,t),e.compose=function(t){(0,v.pushUnique)(tt,"TreemapSeries")&&(0,v.addEvent)(t,"afterBindAxes",tn)},e.prototype.algorithmCalcPoints=function(t,e,i,o){var r,s,n,a,l,h=i.plot,p=i.elArr.length-1,d=i.lW,u=i.lH,c=0;e?(d=i.nW,u=i.nH):l=i.elArr[p];for(var g=0,f=i.elArr;g<f.length;g++){var y=f[g];(e||c<p)&&(0===i.direction?(r=h.x,s=h.y,a=y/(n=d)):(r=h.x,s=h.y,n=y/(a=u)),o.push({x:r,y:s,width:n,height:(0,v.correctFloat)(a)}),0===i.direction?h.y=h.y+a:h.x=h.x+n),c+=1}i.reset(),0===i.direction?i.width=i.width-d:i.height=i.height-u,h.y=h.parent.y+(h.parent.height-i.height),h.x=h.parent.x+(h.parent.width-i.width),t&&(i.direction=1-i.direction),e||i.addElement(l)},e.prototype.algorithmFill=function(t,e,i){for(var o,r,s,n,a,l=[],h=e.direction,p=e.x,d=e.y,u=e.width,c=e.height,v=0;v<i.length;v++){var g=i[v];o=e.width*e.height*(g.val/e.val),r=p,s=d,0===h?(u-=n=o/(a=c),p+=n):(c-=a=o/(n=u),d+=a),l.push({x:r,y:s,width:n,height:a,direction:0,val:0}),t&&(h=1-h)}return l},e.prototype.algorithmLowAspectRatio=function(t,e,i){for(var o,r=[],s={x:e.x,y:e.y,parent:e},n=e.direction,a=i.length-1,l=new V(e.height,e.width,n,s),h=0,p=0;p<i.length;p++){var d=i[p];o=e.width*e.height*(d.val/e.val),l.addElement(o),l.lP.nR>l.lP.lR&&this.algorithmCalcPoints(t,!1,l,r,s),h===a&&this.algorithmCalcPoints(t,!0,l,r,s),++h}return r},e.prototype.alignDataLabel=function(t,e,i){to.prototype.alignDataLabel.apply(this,arguments),t.dataLabel&&t.dataLabel.attr({zIndex:(t.node.zIndex||0)+1})},e.prototype.applyTreeGrouping=function(){var t=this,e=t.parentList||{},i=t.options.cluster,o=(null==i?void 0:i.minimumClusterSize)||5;if(null==i?void 0:i.enabled){var r={},s=function(t){var e;if(null==(e=null==t?void 0:t.point)?void 0:e.shapeArgs){var o=t.point.shapeArgs,n=o.width,a=void 0===n?0:n,l=o.height,h=void 0===l?0:l,p=i.pixelWidth,d=void 0===p?0:p,u=i.pixelHeight,c=void 0===u?0:u,g=(0,v.defined)(c),f=c?d*c:d*d;(a<d||h<(g?c:d)||a*h<f)&&!t.isGroup&&(0,v.defined)(t.parent)&&(r[t.parent]||(r[t.parent]=[]),r[t.parent].push(t))}null==t||t.children.forEach(function(t){s(t)})};s(t.tree);var n=function(s){r[s]&&r[s].length>o&&r[s].forEach(function(o){var r=e[s].indexOf(o.i);if(-1!==r){e[s].splice(r,1);var n="highcharts-grouped-treemap-points-".concat(o.parent||"root"),a=t.points.find(function(t){return t.id===n});if(!a){var l=t.pointClass,h=t.points.length;a=new l(t,{className:i.className,color:i.color,id:n,index:h,isGroup:!0,value:0}),(0,v.extend)(a,{formatPrefix:"cluster"}),t.points.push(a),e[s].push(h),e[n]=[]}var p=a.groupedPointsAmount+1,d=t.points[a.index].options.value||0,u=i.name||"+ ".concat(p);t.points[a.index].groupedPointsAmount=p,t.points[a.index].options.value=d+(o.point.value||0),t.points[a.index].name=u,e[n].push(o.point.index)}})};for(var a in r)n(a);t.nodeMap={},t.nodeList=[],t.parentList=e;var l=t.buildTree("",-1,0,t.parentList);t.translate(l)}},e.prototype.calculateChildrenAreas=function(t,e){var i,o,r,s,n,a,l=this.options,h=this.mapOptionsToLevel[t.level+1],p=(0,v.pick)((null==h?void 0:h.layoutAlgorithm)&&this[null==h?void 0:h.layoutAlgorithm]&&h.layoutAlgorithm,l.layoutAlgorithm),d=l.alternateStartingDirection,u=t.children.filter(function(e){return t.isGroup||!e.ignore}),c=null!=(o=null!=(i=null==h?void 0:h.groupPadding)?i:l.groupPadding)?o:0,g=this.nodeMap[this.rootNode];if(p){var f=[],y=(null==(r=g.pointValues)?void 0:r.width)||0,m=(null==(s=g.pointValues)?void 0:s.height)||0;(null==h?void 0:h.layoutStartingDirection)&&(e.direction=+("vertical"!==h.layoutStartingDirection)),f=this[p](e,u);for(var b=-1,x=0;x<u.length;x++){var w=u[x],T=f[++b];w===g&&(y=y||T.width,m=T.height);var L=c/(this.xAxis.len/m),A=c/(this.yAxis.len/m);if(w.values=(0,v.merge)(T,{val:w.childrenTotal,direction:d?1-e.direction:e.direction}),w.children.length&&(null==(n=w.point.dataLabels)?void 0:n.length)){var O=(0,v.arrayMax)(w.point.dataLabels.map(function(t){var e;return(null==(e=t.options)?void 0:e.headers)&&t.height||0}))/(this.yAxis.len/m);O<w.values.height/2&&(w.values.y+=O,w.values.height-=O)}if(c){var P=Math.min(L,w.values.width/4),B=Math.min(A,w.values.height/4);w.values.x+=P,w.values.width-=2*P,w.values.y+=B,w.values.height-=2*B}w.pointValues=(0,v.merge)(T,{x:T.x/this.axisRatio,y:100-T.y-T.height,width:T.width/this.axisRatio}),w.children.length&&this.calculateChildrenAreas(w,w.values)}var S=function(t,e,i){return void 0===e&&(e=[]),void 0===i&&(i=!0),t.children.forEach(function(t){i&&t.isLeaf?e.push(t.point):i||t.isLeaf||e.push(t.point),t.children.length&&S(t,e,i)}),e};if("leaf"===l.nodeSizeBy&&t===g&&this.hasOutsideDataLabels&&!S(g,void 0,!1).some(function(t){return(0,v.isNumber)(t.options.value)})&&!(0,v.isNumber)(null==(a=g.point)?void 0:a.options.value)){var C=S(g),N=C.map(function(t){return t.options.value||0}),M=C.map(function(t){var e=t.node.pointValues;return e?e.width*e.height:0}),E=N.reduce(function(t,e){return t+e},0),D=M.reduce(function(t,e){return t+e},0)/E,R=0,k=0;C.forEach(function(t,e){var i=N[e]?M[e]/N[e]:1,o=(0,v.clamp)(i/D,.8,1.4),r=1-o;t.value&&(M[e]<20&&(r*=M[e]/20),r>k&&(k=r),r<R&&(R=r),t.simulatedValue=(t.simulatedValue||t.value)/o)}),(R<-.05||k>.05)&&this.simulation<10?(this.simulation++,this.setTreeValues(t),e.val=t.val,this.calculateChildrenAreas(t,e)):(C.forEach(function(t){delete t.simulatedValue}),this.setTreeValues(t),this.simulation=0)}}},e.prototype.createList=function(t){var e=this.chart,i=e.breadcrumbs,o=[];if(i){var r=0;o.push({level:r,levelOptions:e.series[0]});for(var s=t.target.nodeMap[t.newRootId],n=[];s.parent||""===s.parent;)n.push(s),s=t.target.nodeMap[s.parent];for(var a=0,l=n.reverse();a<l.length;a++){var h=l[a];o.push({level:++r,levelOptions:h})}o.length<=1&&(o.length=0)}return o},e.prototype.drawDataLabels=function(){for(var e,i,o,r=this.mapOptionsToLevel,s=this.points.filter(function(t){return t.node.visible||(0,v.defined)(t.dataLabel)}),n=null==(e=(0,v.splat)(this.options.dataLabels||{})[0])?void 0:e.padding,a=s.some(function(t){return(0,v.isNumber)(t.plotY)}),l=0;l<s.length;l++){var h=s[l],p={},d={style:p},u=r[h.node.level];if((!h.node.isLeaf&&!h.node.isGroup||h.node.isGroup&&h.node.level<=this.nodeMap[this.rootNode].level)&&(d.enabled=!1),(null==u?void 0:u.dataLabels)&&((0,v.merge)(!0,d,(0,v.splat)(u.dataLabels)[0]),this.hasDataLabels=function(){return!0}),h.node.isLeaf?d.inside=!0:d.headers&&(d.verticalAlign="top"),h.shapeArgs&&a){var c=h.shapeArgs,g=c.height,f=void 0===g?0:g,y=c.width,m=void 0===y?0:y;if(m>32&&f>16&&h.shouldDraw()){var b=m-2*((0,v.splat)(d.padding)[0]||(0,v.splat)(n)[0]||0);p.width=""+b+"px",null!=p.lineClamp||(p.lineClamp=Math.floor(f/16)),this.options.allowTraversingTree&&(p.visibility="inherit"),null==(o=h.dataLabel)||o.attr({width:d.headers?b:void 0})}else p.width=""+m+"px",p.visibility="hidden"}h.dlOptions=(0,v.merge)(d,h.options.dataLabels,{zIndex:void 0}),delete h.dlOptions.zIndex}t.prototype.drawDataLabels.call(this,s)},e.prototype.drawPoints=function(t){void 0===t&&(t=this.points);for(var e=this.chart,i=e.renderer,o=e.styledMode,r=this.options,s=o?{}:r.shadow,n=r.borderRadius,a=e.pointCount<r.animationLimit,l=r.allowTraversingTree,h=0,p=t;h<p.length;h++){var d=p[h],u={},c={},g={},f="level-group-"+d.node.level,y=!!d.graphic,m=a&&y,b=d.shapeArgs;d.shouldDraw()&&(d.isInside=!0,n&&(c.r=n),(0,v.merge)(!0,m?u:c,y?b:{},o?{}:this.pointAttribs(d,d.selected?"select":void 0)),this.colorAttribs&&o&&(0,v.extend)(g,this.colorAttribs(d)),this[f]||(this[f]=i.g(f).attr({zIndex:-(d.node.level||0)}).add(this.group),this[f].survive=!0)),d.draw({animatableAttribs:u,attribs:c,css:g,group:this[f],imageUrl:d.imageUrl,renderer:i,shadow:s,shapeArgs:b,shapeType:d.shapeType}),l&&d.graphic&&(d.drillId=r.interactByLeaf?this.drillToByLeaf(d):this.drillToByGroup(d))}},e.prototype.drillToByGroup=function(t){return(!t.node.isLeaf||!!t.node.isGroup)&&t.id},e.prototype.drillToByLeaf=function(t){var e,i=t.series.options.traverseToLeaf,o=!1;if(t.node.parent!==this.rootNode&&t.node.isLeaf)if(i)o=t.id;else for(e=t.node;!o;)void 0!==e.parent&&(e=this.nodeMap[e.parent]),e.parent===this.rootNode&&(o=e.id);return o},e.prototype.drillToNode=function(t,e){(0,v.error)(32,!1,void 0,{"treemap.drillToNode":"use treemap.setRootNode"}),this.setRootNode(t,e)},e.prototype.drillUp=function(){var t=this.nodeMap[this.rootNode];t&&(0,v.isString)(t.parent)&&this.setRootNode(t.parent,!0,{trigger:"traverseUpButton"})},e.prototype.getExtremes=function(){var e=t.prototype.getExtremes.call(this,this.colorValueData),i=e.dataMin,o=e.dataMax;return this.valueMin=i,this.valueMax=o,t.prototype.getExtremes.call(this)},e.prototype.getListOfParents=function(t,e){for(var i=(0,v.isArray)(t)?t:[],o=(0,v.isArray)(e)?e:[],r=i.reduce(function(t,e,i){var o=(0,v.pick)(e.parent,"");return void 0===t[o]&&(t[o]=[]),t[o].push(i),t},{"":[]}),s=0,n=Object.keys(r);s<n.length;s++){var a=n[s],l=r[a];if(""!==a&&-1===o.indexOf(a)){for(var h=0;h<l.length;h++){var p=l[h];r[""].push(p)}delete r[a]}}return r},e.prototype.getTree=function(){var t=this.data.map(function(t){return t.id});return this.parentList=this.getListOfParents(this.data,t),this.nodeMap={},this.nodeList=[],this.buildTree("",-1,0,this.parentList||{})},e.prototype.buildTree=function(t,e,i,o,r){for(var s,n=[],a=this.points[e],l=0,h=0,p=o[t]||[];h<p.length;h++){var d=p[h];l=Math.max((s=this.buildTree(this.points[d].id,d,i+1,o,t)).height+1,l),n.push(s),this.is("treegraph")&&(s.visible=!0)}for(var u=new this.NodeClass().init(t,e,n,l,i,this,r),c=0;c<n.length;c++)n[c].parentNode=u;return this.nodeMap[u.id]=u,this.nodeList.push(u),a&&(a.node=u,u.point=a,(0,v.defined)(a.options.x)||(a.x=i)),u},e.prototype.hasData=function(){return!!this.dataTable.rowCount},e.prototype.init=function(e,i){var o=this,r=this,s=(0,v.merge)(i.drillUpButton,i.breadcrumbs),n=(0,v.addEvent)(r,"setOptions",function(t){var e,i=t.userOptions;(0,v.defined)(i.allowDrillToNode)&&!(0,v.defined)(i.allowTraversingTree)&&(i.allowTraversingTree=i.allowDrillToNode,delete i.allowDrillToNode),(0,v.defined)(i.drillUpButton)&&!(0,v.defined)(i.traverseUpButton)&&(i.traverseUpButton=i.drillUpButton,delete i.drillUpButton);var r=(0,v.splat)(i.dataLabels||{});null==(e=i.levels)||e.forEach(function(t){r.push.apply(r,(0,v.splat)(t.dataLabels||{}))}),o.hasOutsideDataLabels=r.some(function(t){return t.headers})});t.prototype.init.call(this,e,i),delete r.opacity,r.eventsToUnbind.push(n),r.options.allowTraversingTree&&(r.eventsToUnbind.push((0,v.addEvent)(r,"click",r.onClickDrillToNode)),r.eventsToUnbind.push((0,v.addEvent)(r,"setRootNode",function(t){var e=r.chart;e.breadcrumbs&&e.breadcrumbs.updateProperties(r.createList(t))})),r.eventsToUnbind.push((0,v.addEvent)(r,"update",function(t,e){var i=this.chart.breadcrumbs;i&&t.options.breadcrumbs&&i.update(t.options.breadcrumbs),this.hadOutsideDataLabels=this.hasOutsideDataLabels})),r.eventsToUnbind.push((0,v.addEvent)(r,"destroy",function(t){var e=this.chart;e.breadcrumbs&&!t.keepEventsForUpdate&&(e.breadcrumbs.destroy(),e.breadcrumbs=void 0)}))),e.breadcrumbs||(e.breadcrumbs=new P(e,s)),r.eventsToUnbind.push((0,v.addEvent)(e.breadcrumbs,"up",function(t){for(var e=this.level-t.newLevel,i=0;i<e;i++)r.drillUp()}))},e.prototype.onClickDrillToNode=function(t){var e=t.point,i=null==e?void 0:e.drillId;(0,v.isString)(i)&&(e.setState(""),this.setRootNode(i,!0,{trigger:"click"}))},e.prototype.pointAttribs=function(t,e){var i,o,r=(0,v.isObject)(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},s=(null==t?void 0:t.node)&&r[t.node.level]||{},n=this.options,a=e&&n.states&&n.states[e]||{},l=(null==t?void 0:t.node)&&t.getClassName()||"",h={stroke:t&&t.borderColor||s.borderColor||a.borderColor||n.borderColor,"stroke-width":(0,v.pick)(t&&t.borderWidth,s.borderWidth,a.borderWidth,n.borderWidth),dashstyle:(null==t?void 0:t.borderDashStyle)||s.borderDashStyle||a.borderDashStyle||n.borderDashStyle,fill:(null==t?void 0:t.color)||this.color};return -1!==l.indexOf("highcharts-above-level")?(h.fill="none",h["stroke-width"]=0):-1!==l.indexOf("highcharts-internal-node-interactive")?(h["fill-opacity"]=null!=(o=null!=(i=a.opacity)?i:n.opacity)?o:1,h.cursor="pointer"):-1!==l.indexOf("highcharts-internal-node")?h.fill="none":e&&a.brightness&&(h.fill=$(h.fill).brighten(a.brightness).get()),h},e.prototype.setColorRecursive=function(t,e,i,o,r){var s,n=null===this||void 0===this?void 0:this.chart,a=null==(s=null==n?void 0:n.options)?void 0:s.colors;if(t){var l=Z(t,{colors:a,index:o,mapOptionsToLevel:this.mapOptionsToLevel,parentColor:e,parentColorIndex:i,series:this,siblings:r}),h=this.points[t.i];h&&(h.color=l.color,h.colorIndex=l.colorIndex);for(var p=-1,d=0,u=t.children||[];d<u.length;d++){var c=u[d];this.setColorRecursive(c,l.color,l.colorIndex,++p,t.children.length)}}},e.prototype.setPointValues=function(){for(var t=this.points,e=this.xAxis,i=this.yAxis,o=this.chart.styledMode,r=0;r<t.length;r++){var s=t[r],n=s.node,a=n.pointValues,l=n.visible;if(a&&l){var h=a.height,p=a.width,d=a.x,u=a.y,c=o?0:this.pointAttribs(s)["stroke-width"]||0,g=e.toPixels(d,!0),f=e.toPixels(d+p,!0),y=i.toPixels(u,!0),m=i.toPixels(u+h,!0),b=0===g?c/2:(0,v.crisp)(e.toPixels(d,!0),c,!0),x=f===e.len?e.len-c/2:(0,v.crisp)(e.toPixels(d+p,!0),c,!0),w=y===i.len?i.len-c/2:(0,v.crisp)(i.toPixels(u,!0),c,!0),T=0===m?c/2:(0,v.crisp)(i.toPixels(u+h,!0),c,!0),L={x:Math.min(b,x),y:Math.min(w,T),width:Math.abs(x-b),height:Math.abs(T-w)};s.plotX=L.x+L.width/2,s.plotY=L.y+L.height/2,s.shapeArgs=L}else delete s.plotX,delete s.plotY}},e.prototype.setRootNode=function(t,e,i){var o=(0,v.extend)({newRootId:t,previousRootId:this.rootNode,redraw:(0,v.pick)(e,!0),series:this},i);(0,v.fireEvent)(this,"setRootNode",o,function(t){var e=t.series;e.idPreviousRoot=t.previousRootId,e.rootNode=t.newRootId,e.isDirty=!0,t.redraw&&e.chart.redraw()})},e.prototype.setState=function(e){this.options.inactiveOtherPoints=!0,t.prototype.setState.call(this,e,!1),this.options.inactiveOtherPoints=!1},e.prototype.setTreeValues=function(t){for(var e,i,o,r=this.options,s=this.rootNode,n=this.nodeMap[s],a="boolean"!=typeof r.levelIsConstant||r.levelIsConstant,l=[],h=this.points[t.i],p=0,d=0,u=t.children;d<u.length;d++){var c=u[d];c=this.setTreeValues(c),l.push(c),c.ignore||(p+=c.val)}(0,v.stableSort)(l,function(t,e){return(t.sortIndex||0)-(e.sortIndex||0)});var g=(0,v.pick)(null==h?void 0:h.simulatedValue,null==h?void 0:h.options.value,p);return h&&(h.value=g),(null==h?void 0:h.isGroup)&&(null==(e=r.cluster)?void 0:e.reductionFactor)&&(g/=r.cluster.reductionFactor),(null==(o=null==(i=t.parentNode)?void 0:i.point)?void 0:o.isGroup)&&this.rootNode!==t.parent&&(t.visible=!1),(0,v.extend)(t,{children:l,childrenTotal:p,ignore:!((0,v.pick)(null==h?void 0:h.visible,!0)&&g>0),isLeaf:t.visible&&!("treegraph"===this.type?l.length>0:p),isGroup:null==h?void 0:h.isGroup,levelDynamic:t.level-(a?0:n.level),name:(0,v.pick)(null==h?void 0:h.name,""),sortIndex:(0,v.pick)(null==h?void 0:h.sortIndex,-g),val:g}),t},e.prototype.sliceAndDice=function(t,e){return this.algorithmFill(!0,t,e)},e.prototype.squarified=function(t,e){return this.algorithmLowAspectRatio(!0,t,e)},e.prototype.strip=function(t,e){return this.algorithmLowAspectRatio(!1,t,e)},e.prototype.stripes=function(t,e){return this.algorithmFill(!1,t,e)},e.prototype.translate=function(e){var i,o,r,s,n,a=this,l=a.options,h=!e,p=J(a);e||p.startsWith("highcharts-grouped-treemap-points-")||((this.points||[]).forEach(function(t){t.isGroup&&t.destroy()}),t.prototype.translate.call(this),e=a.getTree()),a.tree=e=e||a.tree,o=a.nodeMap[p],""===p||o||(a.setRootNode("",!1),p=a.rootNode,o=a.nodeMap[p]),(null==(i=o.point)?void 0:i.isGroup)||(a.mapOptionsToLevel=X({from:o.level+1,levels:l.levels,to:e.height,defaults:{levelIsConstant:a.options.levelIsConstant,colorByPoint:l.colorByPoint}})),q.recursive(a.nodeMap[a.rootNode],function(t){var e=t.parent,i=!1;return t.visible=!0,(e||""===e)&&(i=a.nodeMap[e]),i}),q.recursive(a.nodeMap[a.rootNode].children,function(t){for(var e=!1,i=0;i<t.length;i++){var o=t[i];o.visible=!0,o.children.length&&(e=(e||[]).concat(o.children))}return e}),a.setTreeValues(e),a.axisRatio=a.xAxis.len/a.yAxis.len,a.nodeMap[""].pointValues=r={x:0,y:0,width:100,height:100},a.nodeMap[""].values=s=(0,v.merge)(r,{width:r.width*a.axisRatio,direction:+("vertical"!==l.layoutStartingDirection),val:e.val}),(this.hasOutsideDataLabels||this.hadOutsideDataLabels)&&this.drawDataLabels(),a.calculateChildrenAreas(e,s),a.colorAxis||l.colorByPoint||a.setColorRecursive(a.tree),l.allowTraversingTree&&o.pointValues&&(n=o.pointValues,a.xAxis.setExtremes(n.x,n.x+n.width,!1),a.yAxis.setExtremes(n.y,n.y+n.height,!1),a.xAxis.setScale(),a.yAxis.setScale()),a.setPointValues(),h&&a.applyTreeGrouping()},e.defaultOptions=(0,v.merge)(tr.defaultOptions,Y),e}(tr);(0,v.extend)(ta.prototype,{buildKDTree:te,colorAttribs:H.seriesMembers.colorAttribs,colorKey:"colorValue",directTouch:!0,getExtremesFromAll:!0,getSymbol:te,optionalAxis:"colorAxis",parallelArrays:["x","y","value","colorValue"],pointArrayMap:["value","colorValue"],pointClass:K,NodeClass:U,trackerGroups:["group","dataLabelsGroup"],utils:q}),H.compose(ta),N().registerSeriesType("treemap",ta);var tl=g();tl.Breadcrumbs=tl.Breadcrumbs||P,tl.Breadcrumbs.compose(tl.Chart,tl.defaultOptions),ta.compose(tl.Series);var th=g();return c.default}()});