!/**
 * Highcharts JS v12.6.0 (2026-04-13)
 * @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,n){return function(){"use strict";var s,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=n},944:function(e){e.exports=t},984:function(t){t.exports=e}},u={};function d(t){var e=u[t];if(void 0!==e)return e.exports;var i=u[t]={exports:{}};return p[t](i,i.exports,d),i.exports}d.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return d.d(e,{a:e}),e},d.d=function(t,e){for(var i in e)d.o(e,i)&&!d.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},d.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var c={};d.d(c,{default:function(){return tB}});var v=d(944),f=d.n(v),g={mainBreadcrumb:"Main"},y={buttonSpacing:5,buttonTheme:{fill:"none",height:18,padding:2,"stroke-width":0,zIndex:7,states:{select:{fill:"none"}},style:{color:"#334eff"}},floating:!1,format:void 0,relativeTo:"plotBox",rtl:!1,position:{align:"left",verticalAlign:"top",x:0,y:void 0},separator:{text:"/",style:{color:"#666666",fontSize:"0.8em"}},showFullPath:!0,style:{},useHTML:!1,zIndex:7},b=d(984),m=d.n(b),x=function(t,e,i){if(i||2==arguments.length)for(var o,r=0,n=e.length;r<n;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},w=f().doc;function T(t,e,i,o){void 0===o&&(o={});var r="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(r,"hcEvents")||(r.hcEvents={});var n=r.hcEvents;f().Point&&t instanceof f().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);var s=t.addEventListener;s&&s.call(t,e,i,!!f().supportsPassiveEvents&&{passive:void 0===o.passive?-1!==e.indexOf("touch"):o.passive,capture:!1}),n[e]||(n[e]=[]);var a={fn:i,order:"number"==typeof o.order?o.order:1/0};return n[e].push(a),n[e].sort(function(t,e){return t.order-e.order}),function(){!function(t,e,i){function o(e,i){var o=t.removeEventListener;o&&o.call(t,e,i,!1)}function r(i){var r,n;t.nodeName&&(e?(r={})[e]=!0:r=i,D(r,function(t,e){if(i[e])for(n=i[e].length;n--;)o(e,i[e][n].fn)}))}var n="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(n,"hcEvents")){var s=n.hcEvents;if(e){var a=s[e]||[];i?(s[e]=a.filter(function(t){return i!==t.fn}),o(e,i)):(r(s),s[e]=[])}else r(s),delete n.hcEvents}}(t,e,i)}}function L(t,e,i){void 0===e&&(e=0);var o=e%2/2,r=i?-1:1;return(Math.round(t*r-o)+o)*r}function P(t){return null!=t}function A(t,e){var i;for(i in t||(t={}),e)t[i]=e[i];return t}function O(t,e,i,o){if(i=i||{},(null==w?void 0:w.createEvent)&&(t.dispatchEvent||t.fireEvent&&t!==f())){var r=w.createEvent("Events");r.initEvent(e,!0,!0),i=A(r,i),t.dispatchEvent?t.dispatchEvent(i):t.fireEvent(e,i)}else if(t.hcEvents){i.target||A(i,{preventDefault:function(){i.defaultPrevented=!0},target:t,type:e});for(var n=[],s=t,a=!1;s.hcEvents;)Object.hasOwnProperty.call(s,"hcEvents")&&s.hcEvents[e]&&(n.length&&(a=!0),n.unshift.apply(n,s.hcEvents[e])),s=Object.getPrototypeOf(s);a&&n.sort(function(t,e){return t.order-e.order}),n.forEach(function(e){!1===e.fn.call(t,i,t)&&i.preventDefault()})}o&&!i.defaultPrevented&&o.call(t,i)}function B(t){return M(t)&&"number"==typeof t.nodeType}function S(t){return"number"==typeof t&&!isNaN(t)&&t<1/0&&t>-1/0}function C(t){return"string"==typeof t}function E(t){var e=Object.prototype.toString.call(t);return"[object Array]"===e||"[object Array Iterator]"===e}function M(t,e){return!!t&&"object"==typeof t&&(!e||!E(t))}function N(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var o,r=x([t],e,!0),n={},s=function(t,e){return"object"!=typeof t&&(t={}),D(e,function(i,o){if("__proto__"!==o&&"constructor"!==o){var r;!M(i,!0)||(r=null==i?void 0:i.constructor,M(i,!0)&&!B(i)&&(null==r?void 0:r.name)&&"Object"!==r.name)||B(i)?t[o]=e[o]:t[o]=s(t[o]||{},i)}}),t};!0===t&&(n=r[1],r=Array.prototype.slice.call(r,2));var a=r.length;for(o=0;o<a;o++)n=s(n,r[o]);return n}function D(t,e,i){for(var o in t)Object.hasOwnProperty.call(t,o)&&e.call(i||t[o],t[o],o,t)}function I(){for(var t=arguments,e=t.length,i=0;i<e;i++){var o=t[i];if(null!=o)return o}}function R(t,e){return 0>t.indexOf(e)&&!!t.push(e)}function H(t){return E(t)?t:[t]}f().win,Array.prototype.find;var G=m().format,_=f().composed;function V(){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 k(){this.breadcrumbs&&(this.breadcrumbs.destroy(),this.breadcrumbs=void 0)}function U(){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 W(){this.breadcrumbs&&this.breadcrumbs.redraw()}function j(t){!0===t.resetSelection&&this.breadcrumbs&&this.breadcrumbs.alignBreadcrumbsGroup()}var F=function(){function t(e,i){this.elementList={},this.isDirty=!0,this.level=0,this.list=[];var o=N(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){R(_,"Breadcrumbs")&&(T(t,"destroy",k),T(t,"afterShowResetZoom",V),T(t,"getMargins",U),T(t,"redraw",W),T(t,"selection",j),A(e.lang,g))},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=I(i.format,i.showFullPath?"{level.name}":"← {level.name}"),n=o&&I(o.drillUpText,o.mainBreadcrumb),s=i.formatter&&i.formatter(t)||G(r,{level:t.levelOptions},e)||"";return(C(s)&&!s.length||"← "===s)&&P(n)&&(s=i.showFullPath?n:"← "+n),s},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",n=this.group.getBBox(),s=2*(i.padding||0)+e.buttonSpacing;o.width=n.width+s,o.height=n.height+s;var a=N(o);t&&(a.x+=t),this.options.rtl&&(a.x+=o.width),a.y=I(a.y,this.yOffset,0),this.group.align(a,!0,r)}},t.prototype.renderButton=function(t,e,i){var o=this,r=this.chart,n=o.options,s=N(n.buttonTheme),a=r.renderer.button(o.getButtonText(t),e,i,function(e){var i,r=n.events&&n.events.click;r&&(i=r.call(o,e,t,o)),!1!==i&&(n.showFullPath?e.newLevel=t.level:e.newLevel=o.level-1,O(o,"up",e))},s).addClass("highcharts-breadcrumbs-button").add(o.group);return r.styledMode||a.attr(n.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){N(!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;D(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(){D(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,n=this.options.rtl,s=n?-1:1,a=function(t,e){return s*t.getBBox().width+s*e},l=function(t,e,i){t.translate(e-t.getBBox().width,i)},h=this.group?a(this.group,o):o,p=0,u=r.length;p<u;++p){var d=p===u-1,c=void 0,v=void 0;i[(e=r[p]).level]?(c=(t=i[e.level]).button,t.separator||d?t.separator&&d&&(t.separator.destroy(),delete t.separator):(h+=s*o,t.separator=this.renderSeparator(h,o),n&&l(t.separator,h,o),h+=a(t.separator,o)),i[e.level].updated=!0):(c=this.renderButton(e,h,o),n&&l(c,h,o),h+=a(c,o),d||(v=this.renderSeparator(h,o),n&&l(v,h,o),h+=a(v,o)),i[e.level]={button:c,separator:v,updated:!0}),c&&c.setState(2*!!d)}},t.defaultOptions=y,t}(),z=d(620),K=d.n(z),Y=d(512),Z=d.n(Y),X=d(28),q=d.n(X),J=Z().seriesTypes.column.prototype,Q=l||(l={});function $(t){var e=this.series,i=e.chart.renderer;this.moveToTopOnHover&&this.graphic&&(e.stateMarkerGraphic||(e.stateMarkerGraphic=new(q())(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:""}))}Q.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))}},Q.seriesMembers={colorKey:"value",axisTypes:["xAxis","yAxis","colorAxis"],parallelArrays:["x","y","value"],pointArrayMap:["value"],trackerGroups:["group","markerGroup","dataLabelsGroup"],colorAttribs:function(t){var e={};return P(t.color)&&(!t.state||"normal"===t.state)&&(e[this.colorProp||"fill"]=t.color),e},pointAttribs:J.pointAttribs},Q.compose=function(t){return T(t.prototype.pointClass,"afterSetState",$),t};var tt=l,te=d(820),ti=d.n(te),to=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}(),tr=function(){function t(){this.childrenTotal=0,this.visible=!1}return t.prototype.init=function(t,e,i,o,r,n,s){return this.id=t,this.i=e,this.children=i,this.height=o,this.level=r,this.series=n,this.parent=s,this},t}(),tn=function(){return(tn=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)},ts=function(t,e){var i=e.animatableAttribs,o=e.onComplete,r=e.css,n=e.renderer,s=t.series&&t.series.chart.hasRendered?void 0:t.series&&t.series.options.animation,a=t.graphic;if(e.attribs=tn(tn({},e.attribs),{class:t.getClassName()}),t.shouldDraw())a||(t.graphic=a="text"===e.shapeType?n.text():"image"===e.shapeType?n.image(e.imageUrl||"").attr(e.shapeArgs||{}):n[e.shapeType](e.shapeArgs||{}),a.add(e.group)),r&&a.css(r),a.attr(e.attribs).animate(i,!e.isNew&&s,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()}},ta=(s=function(t,e){return(s=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}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),tl=Z().seriesTypes,th=tl.pie.prototype.pointClass,tp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.groupedPointsAmount=0,e.shapeType="rect",e}return ta(e,t),e.prototype.draw=function(t){ts(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||I(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||S(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 S(this.plotY)&&null!==this.y},e}(tl.scatter.prototype.pointClass);A(tp.prototype,{setVisible:th.prototype.setVisible});var tu={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 C(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:"#e6e6e6",borderWidth:1,colorKey:"colorValue",opacity:.15,states:{hover:{borderColor:"#999999",brightness:.1*!Z().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 td=h,tc=function(t,e){var i,o,r,n,s,a,l,h=e.index,p=e.mapOptionsToLevel,u=e.parentColor,d=e.parentColorIndex,c=e.series,v=e.colors,f=e.siblings,g=c.points,y=c.chart.options.chart;return t&&(o=g[t.i],r=p[t.level]||{},o&&r.colorByPoint&&(s=o.index%(v?v.length:y.colorCount),n=v&&v[s]),c.chart.styledMode||(a=I(o&&o.options.color,r&&r.color,n,u&&((i=r&&r.colorVariation)&&"brightness"===i.key&&h&&f?K().parse(u).brighten(i.to*(h/f)).get():u),c.color)),l=I(o&&o.options.colorIndex,r&&r.colorIndex,s,d,e.colorIndex)),{color:a,colorIndex:l}},tv=function(t){var e,i,o,r,n,s,a={};if(M(t))for(r=S(t.from)?t.from:1,s=t.levels,i={},e=M(t.defaults)?t.defaults:{},E(s)&&(i=s.reduce(function(t,i){var o,n,s;return M(i)&&S(i.level)&&(n=I((s=N({},i)).levelIsConstant,e.levelIsConstant),delete s.levelIsConstant,delete s.level,M(t[o=i.level+(n?0:r-1)])?N(!0,t[o],s):t[o]=s),t},{})),n=S(t.to)?t.to:1,o=0;o<=n;o++)a[o]=N({},e,M(i[o])?i[o]:{});return a},tf=function(t){var e,i;return M(t)&&(i=M(t.options)?t.options:{},e=I(t.rootNode,i.rootId,""),M(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e},tg=(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)}),ty=K().parse,tb=f().composed,tm=f().noop,tx=Z().seriesTypes,tw=tx.column,tT=tx.scatter;ti().keepProps.push("simulation","hadOutsideDataLabels");var tL=!1;function tP(){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=[]),N(!0,t.options,i,t.userOptions),N(!0,e.options,i,e.userOptions),t.visible=t.options.visible,e.visible=e.options.visible,this.is("treegraph")&&(this.isCartesian=t.visible),tL=!0}else tL&&(e.setOptions(e.userOptions),t.setOptions(t.userOptions),tL=!1)}var tA=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.simulation=0,e}return tg(e,t),e.compose=function(t){R(tb,"TreemapSeries")&&T(t,"afterBindAxes",tP)},e.prototype.algorithmCalcPoints=function(t,e,i,o){var r,n,s,a,l,h=i.plot,p=i.elArr.length-1,u=i.lW,d=i.lH,c=0;e?(u=i.nW,d=i.nH):l=i.elArr[p];for(var v=0,f=i.elArr;v<f.length;v++){var g,y=f[v];if(e||c<p){0===i.direction?(r=h.x,n=h.y,a=y/(s=u)):(r=h.x,n=h.y,s=y/(a=d)),o.push({x:r,y:n,width:s,height:(g=a)>1e14?g:parseFloat(g.toPrecision(14))}),0===i.direction?h.y=h.y+a:h.x=h.x+s}c+=1}i.reset(),0===i.direction?i.width=i.width-u:i.height=i.height-d,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,n,s,a,l=[],h=e.direction,p=e.x,u=e.y,d=e.width,c=e.height,v=0;v<i.length;v++){var f=i[v];o=e.width*e.height*(f.val/e.val),r=p,n=u,0===h?(d-=s=o/(a=c),p+=s):(c-=a=o/(s=d),u+=a),l.push({x:r,y:n,width:s,height:a,direction:0,val:0}),t&&(h=1-h)}return l},e.prototype.algorithmLowAspectRatio=function(t,e,i){for(var o,r=[],n={x:e.x,y:e.y,parent:e},s=e.direction,a=i.length-1,l=new to(e.height,e.width,s,n),h=0,p=0;p<i.length;p++){var u=i[p];o=e.width*e.height*(u.val/e.val),l.addElement(o),l.lP.nR>l.lP.lR&&this.algorithmCalcPoints(t,!1,l,r,n),h===a&&this.algorithmCalcPoints(t,!0,l,r,n),++h}return r},e.prototype.alignDataLabel=function(t,e,i){tw.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={},n=function(t){var e;if(null==(e=null==t?void 0:t.point)?void 0:e.shapeArgs){var o=t.point.shapeArgs,s=o.width,a=void 0===s?0:s,l=o.height,h=void 0===l?0:l,p=i.pixelWidth,u=void 0===p?0:p,d=i.pixelHeight,c=void 0===d?0:d,v=P(c),f=c?u*c:u*u;(a<u||h<(v?c:u)||a*h<f)&&!t.isGroup&&P(t.parent)&&(r[t.parent]||(r[t.parent]=[]),r[t.parent].push(t))}null==t||t.children.forEach(function(t){n(t)})};n(t.tree);var s=function(n){r[n]&&r[n].length>o&&r[n].forEach(function(o){var r=e[n].indexOf(o.i);if(-1!==r){e[n].splice(r,1);var s="highcharts-grouped-treemap-points-".concat(o.parent||"root"),a=t.points.find(function(t){return t.id===s});if(!a){var l=t.pointClass,h=t.points.length;A(a=new l(t,{className:i.className,color:i.color,id:s,index:h,isGroup:!0,value:0}),{formatPrefix:"cluster"}),t.points.push(a),e[n].push(h),e[s]=[]}var p=a.groupedPointsAmount+1,u=t.points[a.index].options.value||0,d=i.name||"+ ".concat(p);t.points[a.index].groupedPointsAmount=p,t.points[a.index].options.value=u+(o.point.value||0),t.points[a.index].name=d,e[s].push(o.point.index)}})};for(var a in r)s(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,n,s,a,l=this.options,h=this.mapOptionsToLevel[t.level+1],p=I((null==h?void 0:h.layoutAlgorithm)&&this[null==h?void 0:h.layoutAlgorithm]&&h.layoutAlgorithm,l.layoutAlgorithm),u=l.alternateStartingDirection,d=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,v=this.nodeMap[this.rootNode];if(p){var f=[],g=(null==(r=v.pointValues)?void 0:r.width)||0,y=(null==(n=v.pointValues)?void 0:n.height)||0;(null==h?void 0:h.layoutStartingDirection)&&(e.direction=+("vertical"!==h.layoutStartingDirection)),f=this[p](e,d);for(var b=-1,m=0;m<d.length;m++){var x=d[m],w=f[++b];x===v&&(g=g||w.width,y=w.height);var T=c/(this.xAxis.len/y),L=c/(this.yAxis.len/y);if(x.values=N(w,{val:x.childrenTotal,direction:u?1-e.direction:e.direction}),x.children.length&&(null==(s=x.point.dataLabels)?void 0:s.length)){var P=function(t){for(var e=t.length,i=t[0];e--;)t[e]>i&&(i=t[e]);return i}(x.point.dataLabels.map(function(t){var e;return(null==(e=t.options)?void 0:e.headers)&&t.height||0}))/(this.yAxis.len/y);P<x.values.height/2&&(x.values.y+=P,x.values.height-=P)}if(c){var A=Math.min(T,x.values.width/4),O=Math.min(L,x.values.height/4);x.values.x+=A,x.values.width-=2*A,x.values.y+=O,x.values.height-=2*O}x.pointValues=N(w,{x:w.x/this.axisRatio,y:100-w.y-w.height,width:w.width/this.axisRatio}),x.children.length&&this.calculateChildrenAreas(x,x.values)}var B=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&&B(t,e,i)}),e};if("leaf"===l.nodeSizeBy&&t===v&&this.hasOutsideDataLabels&&!B(v,void 0,!1).some(function(t){return S(t.options.value)})&&!S(null==(a=v.point)?void 0:a.options.value)){var C=B(v),E=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}),D=E.reduce(function(t,e){return t+e},0),R=M.reduce(function(t,e){return t+e},0)/D,H=0,G=0;C.forEach(function(t,e){var i,o=(i=(E[e]?M[e]/E[e]:1)/R)>.8?i<1.4?i:1.4:.8,r=1-o;t.value&&(M[e]<20&&(r*=M[e]/20),r>G&&(G=r),r<H&&(H=r),t.simulatedValue=(t.simulatedValue||t.value)/o)}),(H<-.05||G>.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 n=t.target.nodeMap[t.newRootId],s=[];n.parent||""===n.parent;)s.push(n),n=t.target.nodeMap[n.parent];for(var a=0,l=s.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,n=this.points.filter(function(t){return t.node.visible||P(t.dataLabel)}),s=null==(e=H(this.options.dataLabels||{})[0])?void 0:e.padding,a=n.some(function(t){return S(t.plotY)}),l=0;l<n.length;l++){var h=n[l],p={},u={style:p},d=r[h.node.level];if((!h.node.isLeaf&&!h.node.isGroup||h.node.isGroup&&h.node.level<=this.nodeMap[this.rootNode].level)&&(u.enabled=!1),(null==d?void 0:d.dataLabels)&&(N(!0,u,H(d.dataLabels)[0]),this.hasDataLabels=function(){return!0}),h.node.isLeaf?u.inside=!0:u.headers&&(u.verticalAlign="top"),h.shapeArgs&&a){var c=h.shapeArgs,v=c.height,f=void 0===v?0:v,g=c.width,y=void 0===g?0:g;if(y>32&&f>16&&h.shouldDraw()){var b=y-2*(u.padding||s||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:u.headers?b:void 0})}else p.width=""+y+"px",p.visibility="hidden"}h.dlOptions=N(u,h.options.dataLabels,{zIndex:void 0})}t.prototype.drawDataLabels.call(this,n)},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,n=o?{}:r.shadow,s=r.borderRadius,a=e.pointCount<r.animationLimit,l=r.allowTraversingTree,h=0,p=t;h<p.length;h++){var u=p[h],d={},c={},v={},f="level-group-"+u.node.level,g=!!u.graphic,y=a&&g,b=u.shapeArgs;u.shouldDraw()&&(u.isInside=!0,s&&(c.r=s),N(!0,y?d:c,g?b:{},o?{}:this.pointAttribs(u,u.selected?"select":void 0)),this.colorAttribs&&o&&A(v,this.colorAttribs(u)),this[f]||(this[f]=i.g(f).attr({zIndex:-(u.node.level||0)}).add(this.group),this[f].survive=!0)),u.draw({animatableAttribs:d,attribs:c,css:v,group:this[f],imageUrl:u.imageUrl,renderer:i,shadow:n,shapeArgs:b,shapeType:u.shapeType}),l&&u.graphic&&(u.drillId=r.interactByLeaf?this.drillToByLeaf(u):this.drillToByGroup(u))}},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&&C(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=E(t)?t:[],o=E(e)?e:[],r=i.reduce(function(t,e,i){var o=I(e.parent,"");return void 0===t[o]&&(t[o]=[]),t[o].push(i),t},{"":[]}),n=0,s=Object.keys(r);n<s.length;n++){var a=s[n],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 n,s=[],a=this.points[e],l=0,h=0,p=o[t]||[];h<p.length;h++){var u=p[h];l=Math.max((n=this.buildTree(this.points[u].id,u,i+1,o,t)).height+1,l),s.push(n),this.is("treegraph")&&(n.visible=!0)}for(var d=new this.NodeClass().init(t,e,s,l,i,this,r),c=0;c<s.length;c++)s[c].parentNode=d;return this.nodeMap[d.id]=d,this.nodeList.push(d),a&&(a.node=d,d.point=a,P(a.options.x)||(a.x=i)),d},e.prototype.hasData=function(){return!!this.dataTable.rowCount},e.prototype.init=function(e,i){var o=this,r=this,n=N(i.drillUpButton,i.breadcrumbs),s=T(r,"setOptions",function(t){var e,i=t.userOptions;P(i.allowDrillToNode)&&!P(i.allowTraversingTree)&&(i.allowTraversingTree=i.allowDrillToNode,delete i.allowDrillToNode),P(i.drillUpButton)&&!P(i.traverseUpButton)&&(i.traverseUpButton=i.drillUpButton,delete i.drillUpButton);var r=H(i.dataLabels||{});null==(e=i.levels)||e.forEach(function(t){r.push.apply(r,H(t.dataLabels||{}))}),o.hasOutsideDataLabels=r.some(function(t){return t.headers})});t.prototype.init.call(this,e,i),delete r.opacity,r.eventsToUnbind.push(s),r.options.allowTraversingTree&&(r.eventsToUnbind.push(T(r,"click",r.onClickDrillToNode)),r.eventsToUnbind.push(T(r,"setRootNode",function(t){var e=r.chart;e.breadcrumbs&&e.breadcrumbs.updateProperties(r.createList(t))})),r.eventsToUnbind.push(T(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(T(r,"destroy",function(t){var e=this.chart;e.breadcrumbs&&!t.keepEventsForUpdate&&(e.breadcrumbs.destroy(),e.breadcrumbs=void 0)}))),e.breadcrumbs||(e.breadcrumbs=new F(e,n)),r.eventsToUnbind.push(T(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;C(i)&&(e.setState(""),this.setRootNode(i,!0,{trigger:"click"}))},e.prototype.pointAttribs=function(t,e){var i,o,r=M(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},n=t&&r[t.node.level]||{},s=this.options,a=e&&s.states&&s.states[e]||{},l=(null==t?void 0:t.getClassName())||"",h={stroke:t&&t.borderColor||n.borderColor||a.borderColor||s.borderColor,"stroke-width":I(t&&t.borderWidth,n.borderWidth,a.borderWidth,s.borderWidth),dashstyle:(null==t?void 0:t.borderDashStyle)||n.borderDashStyle||a.borderDashStyle||s.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:s.opacity)?o:1,h.cursor="pointer"):-1!==l.indexOf("highcharts-internal-node")?h.fill="none":e&&a.brightness&&(h.fill=ty(h.fill).brighten(a.brightness).get()),h},e.prototype.setColorRecursive=function(t,e,i,o,r){var n,s=null===this||void 0===this?void 0:this.chart,a=null==(n=null==s?void 0:s.options)?void 0:n.colors;if(t){var l=tc(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,u=0,d=t.children||[];u<d.length;u++){var c=d[u];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 n=t[r],s=n.node,a=s.pointValues,l=s.visible;if(a&&l){var h=a.height,p=a.width,u=a.x,d=a.y,c=o?0:this.pointAttribs(n)["stroke-width"]||0,v=e.toPixels(u,!0),f=e.toPixels(u+p,!0),g=i.toPixels(d,!0),y=i.toPixels(d+h,!0),b=0===v?c/2:L(e.toPixels(u,!0),c,!0),m=f===e.len?e.len-c/2:L(e.toPixels(u+p,!0),c,!0),x=g===i.len?i.len-c/2:L(i.toPixels(d,!0),c,!0),w=0===y?c/2:L(i.toPixels(d+h,!0),c,!0),T={x:Math.min(b,m),y:Math.min(x,w),width:Math.abs(m-b),height:Math.abs(w-x)};n.plotX=T.x+T.width/2,n.plotY=T.y+T.height/2,n.shapeArgs=T}else delete n.plotX,delete n.plotY}},e.prototype.setRootNode=function(t,e,i){O(this,"setRootNode",A({newRootId:t,previousRootId:this.rootNode,redraw:I(e,!0),series:this},i),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,n=this.rootNode,s=this.nodeMap[n],a="boolean"!=typeof r.levelIsConstant||r.levelIsConstant,l=[],h=this.points[t.i],p=0,u=0,d=t.children;u<d.length;u++){var c=d[u];c=this.setTreeValues(c),l.push(c),c.ignore||(p+=c.val)}!function(t,e){var i,o,r=t.length;for(o=0;o<r;o++)t[o].safeI=o;for(t.sort(function(t,o){return 0===(i=e(t,o))?t.safeI-o.safeI:i}),o=0;o<r;o++)delete t[o].safeI}(l,function(t,e){return(t.sortIndex||0)-(e.sortIndex||0)});var v=I(null==h?void 0:h.simulatedValue,null==h?void 0:h.options.value,p);return h&&(h.value=v),(null==h?void 0:h.isGroup)&&(null==(e=r.cluster)?void 0:e.reductionFactor)&&(v/=r.cluster.reductionFactor),(null==(o=null==(i=t.parentNode)?void 0:i.point)?void 0:o.isGroup)&&this.rootNode!==t.parent&&(t.visible=!1),A(t,{children:l,childrenTotal:p,ignore:!(I(null==h?void 0:h.visible,!0)&&v>0),isLeaf:t.visible&&!("treegraph"===this.type?l.length>0:p),isGroup:null==h?void 0:h.isGroup,levelDynamic:t.level-(a?0:s.level),name:I(null==h?void 0:h.name,""),sortIndex:I(null==h?void 0:h.sortIndex,-v),val:v}),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,n,s,a=this,l=a.options,h=!e,p=tf(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=tv({from:o.level+1,levels:l.levels,to:e.height,defaults:{levelIsConstant:a.options.levelIsConstant,colorByPoint:l.colorByPoint}})),td.recursive(a.nodeMap[a.rootNode],function(t){var e=t.parent,i=!1;return t.visible=!0,(e||""===e)&&(i=a.nodeMap[e]),i}),td.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=n=N(r,{width:r.width*a.axisRatio,direction:+("vertical"!==l.layoutStartingDirection),val:e.val}),(this.hasOutsideDataLabels||this.hadOutsideDataLabels)&&this.drawDataLabels(),a.calculateChildrenAreas(e,n),a.colorAxis||l.colorByPoint||a.setColorRecursive(a.tree),l.allowTraversingTree&&o.pointValues&&(s=o.pointValues,a.xAxis.setExtremes(s.x,s.x+s.width,!1),a.yAxis.setExtremes(s.y,s.y+s.height,!1),a.xAxis.setScale(),a.yAxis.setScale()),a.setPointValues(),h&&a.applyTreeGrouping()},e.defaultOptions=N(tT.defaultOptions,tu),e}(tT);A(tA.prototype,{buildKDTree:tm,colorAttribs:tt.seriesMembers.colorAttribs,colorKey:"colorValue",directTouch:!0,getExtremesFromAll:!0,getSymbol:tm,optionalAxis:"colorAxis",parallelArrays:["x","y","value","colorValue"],pointArrayMap:["value","colorValue"],pointClass:tp,NodeClass:tr,trackerGroups:["group","dataLabelsGroup"],utils:td}),tt.compose(tA),Z().registerSeriesType("treemap",tA);var tO=f();tO.Breadcrumbs=tO.Breadcrumbs||F,tO.Breadcrumbs.compose(tO.Chart,tO.defaultOptions),tA.compose(tO.Series);var tB=f();return c.default}()});