highcharts
Version:
JavaScript charting framework
11 lines • 43.2 kB
JavaScript
!/**
* Highcharts JS v12.6.0 (2026-04-13)
* @module highcharts/modules/sunburst
* @requires highcharts
*
* (c) 2016-2026 Highsoft AS
* Authors: Jon Arild Nygård
*
* 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/sunburst",["highcharts/highcharts"],function(t){return e(t,t.Templating,t.Color,t.SeriesRegistry,t.SVGElement,t.Series)}):"object"==typeof exports?exports["highcharts/modules/sunburst"]=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,(t,e,i,s,r,o)=>(()=>{"use strict";var l,a,n,h,d={28:t=>{t.exports=r},512:t=>{t.exports=s},620:t=>{t.exports=i},820:t=>{t.exports=o},944:e=>{e.exports=t},984:t=>{t.exports=e}},p={};function u(t){var e=p[t];if(void 0!==e)return e.exports;var i=p[t]={exports:{}};return d[t](i,i.exports,u),i.exports}u.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return u.d(e,{a:e}),e},u.d=(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=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var c={};u.d(c,{default:()=>tq});var g=u(944),f=u.n(g);let v={mainBreadcrumb:"Main"};var b=u(984),m=u.n(b);let{doc:y,win:x}=f();function P(t,e,i,s={}){let r="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(r,"hcEvents")||(r.hcEvents={});let o=r.hcEvents;f().Point&&t instanceof f().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let l=t.addEventListener;l&&l.call(t,e,i,!!f().supportsPassiveEvents&&{passive:void 0===s.passive?-1!==e.indexOf("touch"):s.passive,capture:!1}),o[e]||(o[e]=[]);let a={fn:i,order:"number"==typeof s.order?s.order:1/0};return o[e].push(a),o[e].sort((t,e)=>t.order-e.order),function(){!function(t,e,i){function s(e,i){let s=t.removeEventListener;s&&s.call(t,e,i,!1)}function r(i){let r,o;t.nodeName&&(e?(r={})[e]=!0:r=i,E(r,function(t,e){if(i[e])for(o=i[e].length;o--;)s(e,i[e][o].fn)}))}let o="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(o,"hcEvents")){let t=o.hcEvents;if(e){let o=t[e]||[];i?(t[e]=o.filter(function(t){return i!==t.fn}),s(e,i)):(r(t),t[e]=[])}else r(t),delete o.hcEvents}}(t,e,i)}}function L(t,e){return t>1e14?t:parseFloat(t.toPrecision(e||14))}function T(t,e=0,i){let s=e%2/2,r=i?-1:1;return(Math.round(t*r-s)+s)*r}function w(t){return null!=t}function A(t,e){let i;for(i in t||(t={}),e)t[i]=e[i];return t}function O(t,e,i,s){if(i=i||{},y?.createEvent&&(t.dispatchEvent||t.fireEvent&&t!==f())){let s=y.createEvent("Events");s.initEvent(e,!0,!0),i=A(s,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});let s=[],r=t,o=!1;for(;r.hcEvents;)Object.hasOwnProperty.call(r,"hcEvents")&&r.hcEvents[e]&&(s.length&&(o=!0),s.unshift.apply(s,r.hcEvents[e])),r=Object.getPrototypeOf(r);o&&s.sort((t,e)=>t.order-e.order),s.forEach(e=>{!1===e.fn.call(t,i,t)&&i.preventDefault()})}s&&!i.defaultPrevented&&s.call(t,i)}function S(t){return M(t)&&"number"==typeof t.nodeType}function R(t){return"number"==typeof t&&!isNaN(t)&&t<1/0&&t>-1/0}function C(t){return"string"==typeof t}function I(t){let e=Object.prototype.toString.call(t);return"[object Array]"===e||"[object Array Iterator]"===e}function M(t,e){return!!t&&"object"==typeof t&&(!e||!I(t))}function B(t,...e){let i,s=[t,...e],r={},o=function(t,e){return"object"!=typeof t&&(t={}),E(e,function(i,s){if("__proto__"!==s&&"constructor"!==s){let r;!M(i,!0)||(r=i?.constructor,M(i,!0)&&!S(i)&&r?.name&&"Object"!==r.name)||S(i)?t[s]=e[s]:t[s]=o(t[s]||{},i)}}),t};!0===t&&(r=s[1],s=Array.prototype.slice.call(s,2));let l=s.length;for(i=0;i<l;i++)r=o(r,s[i]);return r}function E(t,e,i){for(let s in t)Object.hasOwnProperty.call(t,s)&&e.call(i||t[s],t[s],s,t)}function N(){let t=arguments,e=t.length;for(let i=0;i<e;i++){let e=t[i];if(null!=e)return e}}function D(t,e){return 0>t.indexOf(e)&&!!t.push(e)}function H(t,e,i){return/%$/.test(t)?e*parseFloat(t)/100+(i||0):parseFloat(t)}function G(t){return I(t)?t:[t]}Array.prototype.find;let{format:k}=m(),{composed:z}=f();function V(){if(this.breadcrumbs){let 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 U(){this.breadcrumbs&&(this.breadcrumbs.destroy(),this.breadcrumbs=void 0)}function W(){let t=this.breadcrumbs;if(t&&!t.options.floating&&t.level){let e=t.options,i=e.buttonTheme,s=(i.height||0)+2*(i.padding||0)+e.buttonSpacing,r=e.position.verticalAlign;"bottom"===r?(this.marginBottom=(this.marginBottom||0)+s,t.yOffset=s):"middle"!==r?(this.plotTop+=s,t.yOffset=-s):t.yOffset=void 0}}function F(){this.breadcrumbs&&this.breadcrumbs.redraw()}function j(t){!0===t.resetSelection&&this.breadcrumbs&&this.breadcrumbs.alignBreadcrumbsGroup()}class _{static compose(t,e){D(z,"Breadcrumbs")&&(P(t,"destroy",U),P(t,"afterShowResetZoom",V),P(t,"getMargins",W),P(t,"redraw",F),P(t,"selection",j),A(e.lang,v))}constructor(t,e){this.elementList={},this.isDirty=!0,this.level=0,this.list=[];const i=B(t.options.drilldown&&t.options.drilldown.drillUpButton,_.defaultOptions,t.options.navigation&&t.options.navigation.breadcrumbs,e);this.chart=t,this.options=i||{}}updateProperties(t){this.setList(t),this.setLevel(),this.isDirty=!0}setList(t){this.list=t}setLevel(){this.level=this.list.length&&this.list.length-1}getLevel(){return this.level}getButtonText(t){let e=this.chart,i=this.options,s=e.options.lang,r=N(i.format,i.showFullPath?"{level.name}":"← {level.name}"),o=s&&N(s.drillUpText,s.mainBreadcrumb),l=i.formatter&&i.formatter(t)||k(r,{level:t.levelOptions},e)||"";return(C(l)&&!l.length||"← "===l)&&w(o)&&(l=i.showFullPath?o:"← "+o),l}redraw(){this.isDirty&&this.render(),this.group&&this.group.align(),this.isDirty=!1}render(){let 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()}renderFullPathButtons(){this.destroySingleButton(),this.resetElementListState(),this.updateListElements(),this.destroyListElements()}renderSingleButton(){let t=this.chart,e=this.list,i=this.options.buttonSpacing;this.destroyListElements();let s=this.group?this.group.getBBox().width:i,r=e[e.length-2];!t.drillUpButton&&this.level>0?t.drillUpButton=this.renderButton(r,s,i):t.drillUpButton&&(this.level>0?this.updateSingleButton():this.destroySingleButton())}alignBreadcrumbsGroup(t){if(this.group){let e=this.options,i=e.buttonTheme,s=e.position,r="chart"===e.relativeTo||"spacingBox"===e.relativeTo?void 0:"plotBox",o=this.group.getBBox(),l=2*(i.padding||0)+e.buttonSpacing;s.width=o.width+l,s.height=o.height+l;let a=B(s);t&&(a.x+=t),this.options.rtl&&(a.x+=s.width),a.y=N(a.y,this.yOffset,0),this.group.align(a,!0,r)}}renderButton(t,e,i){let s=this,r=this.chart,o=s.options,l=B(o.buttonTheme),a=r.renderer.button(s.getButtonText(t),e,i,function(e){let i,r=o.events&&o.events.click;r&&(i=r.call(s,e,t,s)),!1!==i&&(o.showFullPath?e.newLevel=t.level:e.newLevel=s.level-1,O(s,"up",e))},l).addClass("highcharts-breadcrumbs-button").add(s.group);return r.styledMode||a.attr(o.style),a}renderSeparator(t,e){let i=this.chart,s=this.options.separator,r=i.renderer.label(s.text,t,e,void 0,void 0,void 0,!1).addClass("highcharts-breadcrumbs-separator").add(this.group);return i.styledMode||r.css(s.style),r}update(t){B(!0,this.options,t),this.destroy(),this.isDirty=!0}updateSingleButton(){let t=this.chart,e=this.list[this.level-1];t.drillUpButton&&t.drillUpButton.attr({text:this.getButtonText(e)})}destroy(){this.destroySingleButton(),this.destroyListElements(!0),this.group&&this.group.destroy(),this.group=void 0}destroyListElements(t){let e=this.elementList;E(e,(i,s)=>{(t||!e[s].updated)&&((i=e[s]).button&&i.button.destroy(),i.separator&&i.separator.destroy(),delete i.button,delete i.separator,delete e[s])}),t&&(this.elementList={})}destroySingleButton(){this.chart.drillUpButton&&(this.chart.drillUpButton.destroy(),this.chart.drillUpButton=void 0)}resetElementListState(){E(this.elementList,t=>{t.updated=!1})}updateListElements(){let t=this.elementList,e=this.options.buttonSpacing,i=this.list,s=this.options.rtl,r=s?-1:1,o=function(t,e){return r*t.getBBox().width+r*e},l=function(t,e,i){t.translate(e-t.getBBox().width,i)},a=this.group?o(this.group,e):e,n,h;for(let d=0,p=i.length;d<p;++d){let u,c,g=d===p-1;t[(h=i[d]).level]?(u=(n=t[h.level]).button,n.separator||g?n.separator&&g&&(n.separator.destroy(),delete n.separator):(a+=r*e,n.separator=this.renderSeparator(a,e),s&&l(n.separator,a,e),a+=o(n.separator,e)),t[h.level].updated=!0):(u=this.renderButton(h,a,e),s&&l(u,a,e),a+=o(u,e),g||(c=this.renderSeparator(a,e),s&&l(c,a,e),a+=o(c,e)),t[h.level]={button:u,separator:c,updated:!0}),u&&u.setState(2*!!g)}}}_.defaultOptions={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};var Y=u(620),$=u.n(Y),X=u(512),K=u.n(X),q=u(28),Z=u.n(q);let{column:{prototype:J}}=K().seriesTypes;var Q=a||(a={});function tt(t){let e=this.series,i=e.chart.renderer;this.moveToTopOnHover&&this.graphic&&(e.stateMarkerGraphic||(e.stateMarkerGraphic=new(Z())(i,"use").css({pointerEvents:"none"}).add(this.graphic.parentGroup)),t?.state==="hover"?(this.graphic.attr({id:this.id}),e.stateMarkerGraphic.attr({href:`${i.url}#${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){let e={};return w(t.color)&&(!t.state||"normal"===t.state)&&(e[this.colorProp||"fill"]=t.color),e},pointAttribs:J.pointAttribs},Q.compose=function(t){return P(t.prototype.pointClass,"afterSetState",tt),t};let te=a;var ti=u(820),ts=u.n(ti);let tr=class{constructor(t,e,i,s){this.height=t,this.width=e,this.plot=s,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)}}}addElement(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)}reset(){this.nW=0,this.lW=0,this.elArr=[],this.total=0}},to=class{constructor(){this.childrenTotal=0,this.visible=!1}init(t,e,i,s,r,o,l){return this.id=t,this.i=e,this.children=i,this.height=s,this.level=r,this.series=o,this.parent=l,this}},tl=function(t,e){let{animatableAttribs:i,onComplete:s,css:r,renderer:o}=e,l=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?o.text():"image"===e.shapeType?o.image(e.imageUrl||"").attr(e.shapeArgs||{}):o[e.shapeType](e.shapeArgs||{}),a.add(e.group)),r&&a.css(r),a.attr(e.attribs).animate(i,!e.isNew&&l,s);else if(a){let e=()=>{t.graphic=a=a&&a.destroy(),"function"==typeof s&&s()};Object.keys(i).length?a.animate(i,void 0,()=>e()):e()}},{pie:{prototype:{pointClass:ta}},scatter:{prototype:{pointClass:tn}}}=K().seriesTypes;class th extends tn{constructor(){super(...arguments),this.groupedPointsAmount=0,this.shapeType="rect"}draw(t){tl(this,t)}getClassName(){let t=this.series,e=t.options,i=super.getClassName();return this.node.level<=t.nodeMap[t.rootNode].level&&this.node.children.length?i+=" highcharts-above-level":this.node.isGroup||this.node.isLeaf||t.nodeMap[t.rootNode].isGroup||N(e.interactByLeaf,!e.allowTraversingTree)?this.node.isGroup||this.node.isLeaf||t.nodeMap[t.rootNode].isGroup||(i+=" highcharts-internal-node"):i+=" highcharts-internal-node-interactive",i}isValid(){return!!(this.id||R(this.value))}setState(t){super.setState.apply(this,arguments),this.graphic&&this.graphic.attr({zIndex:+("hover"===t)})}shouldDraw(){return R(this.plotY)&&null!==this.y}}A(th.prototype,{setVisible:ta.prototype.setVisible});let td={allowTraversingTree:!1,animationLimit:250,borderRadius:0,showInLegend:!1,marker:void 0,colorByPoint:!1,dataLabels:{enabled:!0,formatter:function(){let 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*!K().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}}};(n||(n={})).recursive=function t(e,i,s){let r=i.call(s||this,e);!1!==r&&t(r,i,s)};let tp=n,tu={getColor:function(t,e){let i,s,r,o,l,a,n=e.index,h=e.mapOptionsToLevel,d=e.parentColor,p=e.parentColorIndex,u=e.series,c=e.colors,g=e.siblings,f=u.points,v=u.chart.options.chart;if(t){let b;i=f[t.i],s=h[t.level]||{},i&&s.colorByPoint&&(o=i.index%(c?c.length:v.colorCount),r=c&&c[o]),u.chart.styledMode||(l=N(i&&i.options.color,s&&s.color,r,d&&((b=s&&s.colorVariation)&&"brightness"===b.key&&n&&g?$().parse(d).brighten(b.to*(n/g)).get():d),u.color)),a=N(i&&i.options.colorIndex,s&&s.colorIndex,o,p,e.colorIndex)}return{color:l,colorIndex:a}},getLevelOptions:function(t){let e,i,s,r,o,l,a={};if(M(t))for(r=R(t.from)?t.from:1,l=t.levels,i={},e=M(t.defaults)?t.defaults:{},I(l)&&(i=l.reduce((t,i)=>{let s,o,l;return M(i)&&R(i.level)&&(o=N((l=B({},i)).levelIsConstant,e.levelIsConstant),delete l.levelIsConstant,delete l.level,M(t[s=i.level+(o?0:r-1)])?B(!0,t[s],l):t[s]=l),t},{})),o=R(t.to)?t.to:1,s=0;s<=o;s++)a[s]=B({},e,M(i[s])?i[s]:{});return a},getNodeWidth:function(t,e){let{chart:i,options:s}=t,{nodeDistance:r=0,nodeWidth:o=0}=s,{plotSizeX:l=1}=i;if("auto"===o){if("string"==typeof r&&/%$/.test(r))return l/(e+parseFloat(r)/100*(e-1));let t=Number(r);return(l+t)/(e||1)-t}return H(o,l)},setTreeValues:function t(e,i){let s=i.before,r=i.idRoot,o=i.mapIdToNode[r],l=!1!==i.levelIsConstant,a=i.points[e.i],n=a&&a.options||{},h=[],d=0;e.levelDynamic=e.level-(l?0:o.level),e.name=N(a&&a.name,""),e.visible=r===e.id||!0===i.visible,"function"==typeof s&&(e=s(e,i)),e.children.forEach((s,r)=>{let o=A({},i);A(o,{index:r,siblings:e.children.length,visible:e.visible}),s=t(s,o),h.push(s),s.visible&&(d+=s.val)});let p=N(n.value,d);return e.visible=p>=0&&(d>0||e.visible),e.children=h,e.childrenTotal=d,e.isLeaf=e.visible&&!d,e.val=p,e},updateRootId:function(t){let e,i;return M(t)&&(i=M(t.options)?t.options:{},e=N(t.rootNode,i.rootId,""),M(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e}},{parse:tc}=$(),{composed:tg,noop:tf}=f(),{column:tv,scatter:tb}=K().seriesTypes,{getColor:tm,getLevelOptions:ty,updateRootId:tx}=tu;ts().keepProps.push("simulation","hadOutsideDataLabels");let tP=!1;function tL(){let t=this.xAxis,e=this.yAxis;if(t&&e)if(this.is("treemap")){let i={endOnTick:!1,startOnTick:!1,visible:!1};this.is("treegraph")||(i.min=0,i.max=100,i.tickPositions=[]),B(!0,t.options,i,t.userOptions),B(!0,e.options,i,e.userOptions),t.visible=t.options.visible,e.visible=e.options.visible,this.is("treegraph")&&(this.isCartesian=t.visible),tP=!0}else tP&&(e.setOptions(e.userOptions),t.setOptions(t.userOptions),tP=!1)}class tT extends tb{constructor(){super(...arguments),this.simulation=0}static compose(t){D(tg,"TreemapSeries")&&P(t,"afterBindAxes",tL)}algorithmCalcPoints(t,e,i,s){let r=i.plot,o=i.elArr.length-1,l,a,n,h,d=i.lW,p=i.lH,u,c=0;for(let t of(e?(d=i.nW,p=i.nH):u=i.elArr[o],i.elArr))(e||c<o)&&(0===i.direction?(l=r.x,a=r.y,h=t/(n=d)):(l=r.x,a=r.y,n=t/(h=p)),s.push({x:l,y:a,width:n,height:L(h)}),0===i.direction?r.y=r.y+h:r.x=r.x+n),c+=1;i.reset(),0===i.direction?i.width=i.width-d:i.height=i.height-p,r.y=r.parent.y+(r.parent.height-i.height),r.x=r.parent.x+(r.parent.width-i.width),t&&(i.direction=1-i.direction),e||i.addElement(u)}algorithmFill(t,e,i){let s=[],r,o=e.direction,l=e.x,a=e.y,n=e.width,h=e.height,d,p,u,c;for(let g of i)r=e.width*e.height*(g.val/e.val),d=l,p=a,0===o?(n-=u=r/(c=h),l+=u):(h-=c=r/(u=n),a+=c),s.push({x:d,y:p,width:u,height:c,direction:0,val:0}),t&&(o=1-o);return s}algorithmLowAspectRatio(t,e,i){let s=[],r={x:e.x,y:e.y,parent:e},o=e.direction,l=i.length-1,a=new tr(e.height,e.width,o,r),n,h=0;for(let o of i)n=e.width*e.height*(o.val/e.val),a.addElement(n),a.lP.nR>a.lP.lR&&this.algorithmCalcPoints(t,!1,a,s,r),h===l&&this.algorithmCalcPoints(t,!0,a,s,r),++h;return s}alignDataLabel(t,e,i){tv.prototype.alignDataLabel.apply(this,arguments),t.dataLabel&&t.dataLabel.attr({zIndex:(t.node.zIndex||0)+1})}applyTreeGrouping(){let t=this,e=t.parentList||{},{cluster:i}=t.options,s=i?.minimumClusterSize||5;if(i?.enabled){let r={},o=t=>{if(t?.point?.shapeArgs){let{width:e=0,height:s=0}=t.point.shapeArgs,{pixelWidth:o=0,pixelHeight:l=0}=i,a=w(l),n=l?o*l:o*o;(e<o||s<(a?l:o)||e*s<n)&&!t.isGroup&&w(t.parent)&&(r[t.parent]||(r[t.parent]=[]),r[t.parent].push(t))}t?.children.forEach(t=>{o(t)})};for(let l in o(t.tree),r)r[l]&&r[l].length>s&&r[l].forEach(s=>{let r=e[l].indexOf(s.i);if(-1!==r){e[l].splice(r,1);let o=`highcharts-grouped-treemap-points-${s.parent||"root"}`,a=t.points.find(t=>t.id===o);if(!a){let s=t.pointClass,r=t.points.length;A(a=new s(t,{className:i.className,color:i.color,id:o,index:r,isGroup:!0,value:0}),{formatPrefix:"cluster"}),t.points.push(a),e[l].push(r),e[o]=[]}let n=a.groupedPointsAmount+1,h=t.points[a.index].options.value||0,d=i.name||`+ ${n}`;t.points[a.index].groupedPointsAmount=n,t.points[a.index].options.value=h+(s.point.value||0),t.points[a.index].name=d,e[o].push(s.point.index)}});t.nodeMap={},t.nodeList=[],t.parentList=e;let l=t.buildTree("",-1,0,t.parentList);t.translate(l)}}calculateChildrenAreas(t,e){let i=this.options,s=this.mapOptionsToLevel[t.level+1],r=N(s?.layoutAlgorithm&&this[s?.layoutAlgorithm]&&s.layoutAlgorithm,i.layoutAlgorithm),o=i.alternateStartingDirection,l=t.children.filter(e=>t.isGroup||!e.ignore),a=s?.groupPadding??i.groupPadding??0,n=this.nodeMap[this.rootNode];if(!r)return;let h=[],d=n.pointValues?.width||0,p=n.pointValues?.height||0;s?.layoutStartingDirection&&(e.direction=+("vertical"!==s.layoutStartingDirection)),h=this[r](e,l);let u=-1;for(let t of l){let i=h[++u];t===n&&(d=d||i.width,p=i.height);let s=a/(this.xAxis.len/p),r=a/(this.yAxis.len/p);if(t.values=B(i,{val:t.childrenTotal,direction:o?1-e.direction:e.direction}),t.children.length&&t.point.dataLabels?.length){let e=function(t){let e=t.length,i=t[0];for(;e--;)t[e]>i&&(i=t[e]);return i}(t.point.dataLabels.map(t=>t.options?.headers&&t.height||0))/(this.yAxis.len/p);e<t.values.height/2&&(t.values.y+=e,t.values.height-=e)}if(a){let e=Math.min(s,t.values.width/4),i=Math.min(r,t.values.height/4);t.values.x+=e,t.values.width-=2*e,t.values.y+=i,t.values.height-=2*i}t.pointValues=B(i,{x:i.x/this.axisRatio,y:100-i.y-i.height,width:i.width/this.axisRatio}),t.children.length&&this.calculateChildrenAreas(t,t.values)}let c=(t,e=[],i=!0)=>(t.children.forEach(t=>{i&&t.isLeaf?e.push(t.point):i||t.isLeaf||e.push(t.point),t.children.length&&c(t,e,i)}),e);if("leaf"===i.nodeSizeBy&&t===n&&this.hasOutsideDataLabels&&!c(n,void 0,!1).some(t=>R(t.options.value))&&!R(n.point?.options.value)){let i=c(n),s=i.map(t=>t.options.value||0),r=i.map(({node:{pointValues:t}})=>t?t.width*t.height:0),o=s.reduce((t,e)=>t+e,0),l=r.reduce((t,e)=>t+e,0)/o,a=0,h=0;i.forEach((t,e)=>{var i;let o=(i=(s[e]?r[e]/s[e]:1)/l)>.8?i<1.4?i:1.4:.8,n=1-o;t.value&&(r[e]<20&&(n*=r[e]/20),n>h&&(h=n),n<a&&(a=n),t.simulatedValue=(t.simulatedValue||t.value)/o)}),(a<-.05||h>.05)&&this.simulation<10?(this.simulation++,this.setTreeValues(t),e.val=t.val,this.calculateChildrenAreas(t,e)):(i.forEach(t=>{delete t.simulatedValue}),this.setTreeValues(t),this.simulation=0)}}createList(t){let e=this.chart,i=e.breadcrumbs,s=[];if(i){let i=0;s.push({level:i,levelOptions:e.series[0]});let r=t.target.nodeMap[t.newRootId],o=[];for(;r.parent||""===r.parent;)o.push(r),r=t.target.nodeMap[r.parent];for(let t of o.reverse())s.push({level:++i,levelOptions:t});s.length<=1&&(s.length=0)}return s}drawDataLabels(){let t=this.mapOptionsToLevel,e=this.points.filter(function(t){return t.node.visible||w(t.dataLabel)}),i=G(this.options.dataLabels||{})[0]?.padding,s=e.some(t=>R(t.plotY));for(let r of e){let e={},o={style:e},l=t[r.node.level];if((!r.node.isLeaf&&!r.node.isGroup||r.node.isGroup&&r.node.level<=this.nodeMap[this.rootNode].level)&&(o.enabled=!1),l?.dataLabels&&(B(!0,o,G(l.dataLabels)[0]),this.hasDataLabels=()=>!0),r.node.isLeaf?o.inside=!0:o.headers&&(o.verticalAlign="top"),r.shapeArgs&&s){let{height:t=0,width:s=0}=r.shapeArgs;if(s>32&&t>16&&r.shouldDraw()){let l=s-2*(o.padding||i||0);e.width=`${l}px`,e.lineClamp??(e.lineClamp=Math.floor(t/16)),this.options.allowTraversingTree&&(e.visibility="inherit"),r.dataLabel?.attr({width:o.headers?l:void 0})}else e.width=`${s}px`,e.visibility="hidden"}r.dlOptions=B(o,r.options.dataLabels,{zIndex:void 0})}super.drawDataLabels(e)}drawPoints(t=this.points){let e=this.chart,i=e.renderer,s=e.styledMode,r=this.options,o=s?{}:r.shadow,l=r.borderRadius,a=e.pointCount<r.animationLimit,n=r.allowTraversingTree;for(let e of t){let t={},h={},d={},p="level-group-"+e.node.level,u=!!e.graphic,c=a&&u,g=e.shapeArgs;e.shouldDraw()&&(e.isInside=!0,l&&(h.r=l),B(!0,c?t:h,u?g:{},s?{}:this.pointAttribs(e,e.selected?"select":void 0)),this.colorAttribs&&s&&A(d,this.colorAttribs(e)),this[p]||(this[p]=i.g(p).attr({zIndex:-(e.node.level||0)}).add(this.group),this[p].survive=!0)),e.draw({animatableAttribs:t,attribs:h,css:d,group:this[p],imageUrl:e.imageUrl,renderer:i,shadow:o,shapeArgs:g,shapeType:e.shapeType}),n&&e.graphic&&(e.drillId=r.interactByLeaf?this.drillToByLeaf(e):this.drillToByGroup(e))}}drillToByGroup(t){return(!t.node.isLeaf||!!t.node.isGroup)&&t.id}drillToByLeaf(t){let{traverseToLeaf:e}=t.series.options,i=!1,s;if(t.node.parent!==this.rootNode&&t.node.isLeaf)if(e)i=t.id;else for(s=t.node;!i;)void 0!==s.parent&&(s=this.nodeMap[s.parent]),s.parent===this.rootNode&&(i=s.id);return i}drillToNode(t,e){(0,g.error)(32,!1,void 0,{"treemap.drillToNode":"use treemap.setRootNode"}),this.setRootNode(t,e)}drillUp(){let t=this.nodeMap[this.rootNode];t&&C(t.parent)&&this.setRootNode(t.parent,!0,{trigger:"traverseUpButton"})}getExtremes(){let{dataMin:t,dataMax:e}=super.getExtremes(this.colorValueData);return this.valueMin=t,this.valueMax=e,super.getExtremes()}getListOfParents(t,e){let i=I(t)?t:[],s=I(e)?e:[],r=i.reduce(function(t,e,i){let s=N(e.parent,"");return void 0===t[s]&&(t[s]=[]),t[s].push(i),t},{"":[]});for(let t of Object.keys(r)){let e=r[t];if(""!==t&&-1===s.indexOf(t)){for(let t of e)r[""].push(t);delete r[t]}}return r}getTree(){let 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||{})}buildTree(t,e,i,s,r){let o=[],l=this.points[e],a=0,n;for(let e of s[t]||[])a=Math.max((n=this.buildTree(this.points[e].id,e,i+1,s,t)).height+1,a),o.push(n),this.is("treegraph")&&(n.visible=!0);let h=new this.NodeClass().init(t,e,o,a,i,this,r);for(let t of o)t.parentNode=h;return this.nodeMap[h.id]=h,this.nodeList.push(h),l&&(l.node=h,h.point=l,w(l.options.x)||(l.x=i)),h}hasData(){return!!this.dataTable.rowCount}init(t,e){let i=this,s=B(e.drillUpButton,e.breadcrumbs),r=P(i,"setOptions",t=>{let e=t.userOptions;w(e.allowDrillToNode)&&!w(e.allowTraversingTree)&&(e.allowTraversingTree=e.allowDrillToNode,delete e.allowDrillToNode),w(e.drillUpButton)&&!w(e.traverseUpButton)&&(e.traverseUpButton=e.drillUpButton,delete e.drillUpButton);let i=G(e.dataLabels||{});e.levels?.forEach(t=>{i.push.apply(i,G(t.dataLabels||{}))}),this.hasOutsideDataLabels=i.some(t=>t.headers)});super.init(t,e),delete i.opacity,i.eventsToUnbind.push(r),i.options.allowTraversingTree&&(i.eventsToUnbind.push(P(i,"click",i.onClickDrillToNode)),i.eventsToUnbind.push(P(i,"setRootNode",function(t){let e=i.chart;e.breadcrumbs&&e.breadcrumbs.updateProperties(i.createList(t))})),i.eventsToUnbind.push(P(i,"update",function(t,e){let i=this.chart.breadcrumbs;i&&t.options.breadcrumbs&&i.update(t.options.breadcrumbs),this.hadOutsideDataLabels=this.hasOutsideDataLabels})),i.eventsToUnbind.push(P(i,"destroy",function(t){let e=this.chart;e.breadcrumbs&&!t.keepEventsForUpdate&&(e.breadcrumbs.destroy(),e.breadcrumbs=void 0)}))),t.breadcrumbs||(t.breadcrumbs=new _(t,s)),i.eventsToUnbind.push(P(t.breadcrumbs,"up",function(t){let e=this.level-t.newLevel;for(let t=0;t<e;t++)i.drillUp()}))}onClickDrillToNode(t){let e=t.point,i=e?.drillId;C(i)&&(e.setState(""),this.setRootNode(i,!0,{trigger:"click"}))}pointAttribs(t,e){let i=M(this.mapOptionsToLevel)?this.mapOptionsToLevel:{},s=t&&i[t.node.level]||{},r=this.options,o=e&&r.states&&r.states[e]||{},l=t?.getClassName()||"",a={stroke:t&&t.borderColor||s.borderColor||o.borderColor||r.borderColor,"stroke-width":N(t&&t.borderWidth,s.borderWidth,o.borderWidth,r.borderWidth),dashstyle:t?.borderDashStyle||s.borderDashStyle||o.borderDashStyle||r.borderDashStyle,fill:t?.color||this.color};return -1!==l.indexOf("highcharts-above-level")?(a.fill="none",a["stroke-width"]=0):-1!==l.indexOf("highcharts-internal-node-interactive")?(a["fill-opacity"]=o.opacity??r.opacity??1,a.cursor="pointer"):-1!==l.indexOf("highcharts-internal-node")?a.fill="none":e&&o.brightness&&(a.fill=tc(a.fill).brighten(o.brightness).get()),a}setColorRecursive(t,e,i,s,r){let o=this?.chart,l=o?.options?.colors;if(t){let o=tm(t,{colors:l,index:s,mapOptionsToLevel:this.mapOptionsToLevel,parentColor:e,parentColorIndex:i,series:this,siblings:r}),a=this.points[t.i];a&&(a.color=o.color,a.colorIndex=o.colorIndex);let n=-1;for(let e of t.children||[])this.setColorRecursive(e,o.color,o.colorIndex,++n,t.children.length)}}setPointValues(){let t=this,{points:e,xAxis:i,yAxis:s}=t,r=t.chart.styledMode,o=e=>r?0:t.pointAttribs(e)["stroke-width"]||0;for(let t of e){let{pointValues:e,visible:r}=t.node;if(e&&r){let{height:r,width:l,x:a,y:n}=e,h=o(t),d=i.toPixels(a,!0),p=i.toPixels(a+l,!0),u=s.toPixels(n,!0),c=s.toPixels(n+r,!0),g=0===d?h/2:T(i.toPixels(a,!0),h,!0),f=p===i.len?i.len-h/2:T(i.toPixels(a+l,!0),h,!0),v=u===s.len?s.len-h/2:T(s.toPixels(n,!0),h,!0),b=0===c?h/2:T(s.toPixels(n+r,!0),h,!0),m={x:Math.min(g,f),y:Math.min(v,b),width:Math.abs(f-g),height:Math.abs(b-v)};t.plotX=m.x+m.width/2,t.plotY=m.y+m.height/2,t.shapeArgs=m}else delete t.plotX,delete t.plotY}}setRootNode(t,e,i){O(this,"setRootNode",A({newRootId:t,previousRootId:this.rootNode,redraw:N(e,!0),series:this},i),function(t){let e=t.series;e.idPreviousRoot=t.previousRootId,e.rootNode=t.newRootId,e.isDirty=!0,t.redraw&&e.chart.redraw()})}setState(t){this.options.inactiveOtherPoints=!0,super.setState(t,!1),this.options.inactiveOtherPoints=!1}setTreeValues(t){let e=this.options,i=this.rootNode,s=this.nodeMap[i],r="boolean"!=typeof e.levelIsConstant||e.levelIsConstant,o=[],l=this.points[t.i],a=0;for(let e of t.children)e=this.setTreeValues(e),o.push(e),e.ignore||(a+=e.val);!function(t,e){let i,s,r=t.length;for(s=0;s<r;s++)t[s].safeI=s;for(t.sort(function(t,s){return 0===(i=e(t,s))?t.safeI-s.safeI:i}),s=0;s<r;s++)delete t[s].safeI}(o,(t,e)=>(t.sortIndex||0)-(e.sortIndex||0));let n=N(l?.simulatedValue,l?.options.value,a);return l&&(l.value=n),l?.isGroup&&e.cluster?.reductionFactor&&(n/=e.cluster.reductionFactor),t.parentNode?.point?.isGroup&&this.rootNode!==t.parent&&(t.visible=!1),A(t,{children:o,childrenTotal:a,ignore:!(N(l?.visible,!0)&&n>0),isLeaf:t.visible&&!("treegraph"===this.type?o.length>0:a),isGroup:l?.isGroup,levelDynamic:t.level-(r?0:s.level),name:N(l?.name,""),sortIndex:N(l?.sortIndex,-n),val:n}),t}sliceAndDice(t,e){return this.algorithmFill(!0,t,e)}squarified(t,e){return this.algorithmLowAspectRatio(!0,t,e)}strip(t,e){return this.algorithmLowAspectRatio(!1,t,e)}stripes(t,e){return this.algorithmFill(!1,t,e)}translate(t){let e=this,i=e.options,s=!t,r=tx(e),o,l,a,n;t||r.startsWith("highcharts-grouped-treemap-points-")||((this.points||[]).forEach(t=>{t.isGroup&&t.destroy()}),super.translate(),t=e.getTree()),e.tree=t=t||e.tree,o=e.nodeMap[r],""===r||o||(e.setRootNode("",!1),r=e.rootNode,o=e.nodeMap[r]),o.point?.isGroup||(e.mapOptionsToLevel=ty({from:o.level+1,levels:i.levels,to:t.height,defaults:{levelIsConstant:e.options.levelIsConstant,colorByPoint:i.colorByPoint}})),tp.recursive(e.nodeMap[e.rootNode],t=>{let i=t.parent,s=!1;return t.visible=!0,(i||""===i)&&(s=e.nodeMap[i]),s}),tp.recursive(e.nodeMap[e.rootNode].children,t=>{let e=!1;for(let i of t)i.visible=!0,i.children.length&&(e=(e||[]).concat(i.children));return e}),e.setTreeValues(t),e.axisRatio=e.xAxis.len/e.yAxis.len,e.nodeMap[""].pointValues=l={x:0,y:0,width:100,height:100},e.nodeMap[""].values=a=B(l,{width:l.width*e.axisRatio,direction:+("vertical"!==i.layoutStartingDirection),val:t.val}),(this.hasOutsideDataLabels||this.hadOutsideDataLabels)&&this.drawDataLabels(),e.calculateChildrenAreas(t,a),e.colorAxis||i.colorByPoint||e.setColorRecursive(e.tree),i.allowTraversingTree&&o.pointValues&&(n=o.pointValues,e.xAxis.setExtremes(n.x,n.x+n.width,!1),e.yAxis.setExtremes(n.y,n.y+n.height,!1),e.xAxis.setScale(),e.yAxis.setScale()),e.setPointValues(),s&&e.applyTreeGrouping()}}tT.defaultOptions=B(tb.defaultOptions,td),A(tT.prototype,{buildKDTree:tf,colorAttribs:te.seriesMembers.colorAttribs,colorKey:"colorValue",directTouch:!0,getExtremesFromAll:!0,getSymbol:tf,optionalAxis:"colorAxis",parallelArrays:["x","y","value","colorValue"],pointArrayMap:["value","colorValue"],pointClass:th,NodeClass:to,trackerGroups:["group","dataLabelsGroup"],utils:tp}),te.compose(tT),K().registerSeriesType("treemap",tT);let{deg2rad:tw}=f();(l=h||(h={})).getCenter=function(){let t=this.options,e=this.chart,i=2*(t.slicedOffset||0),s=e.plotWidth-2*i,r=e.plotHeight-2*i,o=t.center,l=Math.min(s,r),a=t.thickness,n,h=t.size,d=t.innerSize||0,p,u;"string"==typeof h&&(h=parseFloat(h)),"string"==typeof d&&(d=parseFloat(d));let c=[N(o?.[0],"50%"),N(o?.[1],"50%"),N(h&&h<0?void 0:t.size,"100%"),N(d&&d<0?void 0:t.innerSize||0,"0%")];for(!e.angular||this instanceof ts()||(c[3]=0),p=0;p<4;++p)u=c[p],n=p<2||2===p&&/%$/.test(u),c[p]=H(u,[s,r,l,c[2]][p])+(n?i:0);return c[3]>c[2]&&(c[3]=c[2]),R(a)&&2*a<c[2]&&a>0&&(c[3]=c[2]-2*a),O(this,"afterGetCenter",{positions:c}),c},l.getStartAndEndRadians=function(t,e){let i=R(t)?t:0,s=R(e)&&e>i&&e-i<360?e:i+360;return{start:tw*(i+-90),end:tw*(s+-90)}};let tA=h,{series:{prototype:{pointClass:tO}},seriesTypes:{treemap:{prototype:{pointClass:tS}}}}=K();class tR extends tS{getDataLabelPath(t){let e=this.series.chart.renderer,i=this.shapeExisting,s=i.r+parseInt(t.options?.distance||0,10),r=i.start,o=i.end,l=r+(o-r)/2,a=l<0&&l>-Math.PI||l>Math.PI,n;return r===-Math.PI/2&&L(o)===L(1.5*Math.PI)&&(r=-Math.PI+Math.PI/360,o=-Math.PI/360,a=!0),o-r>Math.PI&&(a=!1,n=!0,o-r>2*Math.PI-.01&&(r+=.01,o-=.01)),this.dataLabelPath&&(this.dataLabelPath=this.dataLabelPath.destroy()),this.dataLabelPath=e.arc({open:!0,longArc:+!!n}).attr({start:a?r:o,end:a?o:r,clockwise:+a,x:i.x,y:i.y,r:(s+i.innerR)/2}).add(e.defs),this.dataLabelPath}isValid(){return!0}}A(tR.prototype,{getClassName:tO.prototype.getClassName,haloPath:tO.prototype.haloPath,setState:tO.prototype.setState});let{seriesTypes:{treemap:tC}}=K();function tI(t,e){let i=[];if(R(t)&&R(e)&&t<=e)for(let s=t;s<=e;s++)i.push(s);return i}let tM={calculateLevelSizes:function(t,e){let i=M(e)?e:{},s,r=0,o,l,a,n;if(M(t)){for(let e of(s=B({},t),l=tI(R(i.from)?i.from:0,R(i.to)?i.to:0),a=Object.keys(s).filter(t=>-1===l.indexOf(+t)),o=n=R(i.diffRadius)?i.diffRadius:0,l)){let t=s[e],i=t.levelSize.unit,l=t.levelSize.value;"weight"===i?r+=l:"percentage"===i?(t.levelSize={unit:"pixels",value:l/100*o},n-=t.levelSize.value):"pixels"===i&&(n-=l)}for(let t of l){let e=s[t];if("weight"===e.levelSize.unit){let i=e.levelSize.value;s[t].levelSize={unit:"pixels",value:i/r*n}}}for(let t of a)s[t].levelSize={value:0,unit:"pixels"}}return s},getLevelFromAndTo:function({level:t,height:e}){return{from:t>0?t:1,to:t+e}},range:tI,recursive:tC.prototype.utils.recursive},{deg2rad:tB}=f();function tE(t,e){e=B(!0,{enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e);let i=this.renderer.url,s=this.text||this,r=s.textPath,{attributes:o,enabled:l}=e;if(t=t||r&&r.path,r&&r.undo(),t&&l){let e=P(s,"afterModifyTree",e=>{if(t&&l){let r=t.attr("id");r||t.attr("id",r=(0,g.uniqueKey)());let l={x:0,y:0};w(o.dx)&&(l.dx=o.dx,delete o.dx),w(o.dy)&&(l.dy=o.dy,delete o.dy),s.attr(l),this.attr({transform:""}),this.box&&(this.box=this.box.destroy());let a=e.nodes.slice(0);e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:A(o,{"text-anchor":o.textAnchor,href:`${i}#${r}`}),children:a}}});s.textPath={path:t,undo:e}}else s.attr({dx:0,dy:0}),delete s.textPath;return this.added&&(s.textCache="",this.renderer.buildText(s)),this}function tN(t){let e=t.bBox,i=this.element?.querySelector("textPath");if(i){let t=[],{b:s,h:r}=this.renderer.fontMetrics(this.element),o=r-s,l=RegExp('(<tspan>|<tspan(?!\\sclass="highcharts-br")[^>]*>|<\\/tspan>)',"g"),a=i.innerHTML.replace(l,"").split(/<tspan class="highcharts-br"[^>]*>/),n=a.length,h=(t,e)=>{let{x:r,y:l}=e,a=(i.getRotationOfChar(t)-90)*tB,n=Math.cos(a),h=Math.sin(a);return[[r-o*n,l-o*h],[r+s*n,l+s*h]]};for(let e=0,s=0;s<n;s++){let r=a[s].length;for(let o=0;o<r;o+=5)try{let r=e+o+s,[l,a]=h(r,i.getStartPositionOfChar(r));0===o?(t.push(a),t.push(l)):(0===s&&t.unshift(a),s===n-1&&t.push(l))}catch{break}e+=r-1;try{let r=e+s,o=i.getEndPositionOfChar(r),[l,a]=h(r,o);t.unshift(a),t.unshift(l)}catch{break}}t.length&&t.push(t[0].slice()),e.polygon=t}return e}function tD(t){let e=t.labelOptions,i=t.point,s=e[i.formatPrefix+"TextPath"]||e.textPath;s&&!e.useHTML&&(this.setTextPath(i.getDataLabelPath?.(this)||i.graphic,s),i.dataLabelPath&&!s.enabled&&(i.dataLabelPath=i.dataLabelPath.destroy()))}let{getCenter:tH,getStartAndEndRadians:tG}=tA,{noop:tk}=f(),{column:tz,treemap:tV}=K().seriesTypes,{getColor:tU,getLevelOptions:tW,setTreeValues:tF,updateRootId:tj}=tu;({compose:function(t){P(t,"afterGetBBox",tN),P(t,"beforeAddingDataLabel",tD);let e=t.prototype;e.setTextPath||(e.setTextPath=tE)}}).compose(Z());let t_=180/Math.PI,tY=function(t,e,i,s){return{x:t+Math.cos(i)*s,y:e+Math.sin(i)*s}};function t$(t,e){let i=e.mapIdToNode,s=t.parent,r=s?i[s]:void 0,o=e.series,l=o.chart,a=o.points[t.i],n=tU(t,{colors:o.options.colors||l&&l.options.colors,colorIndex:o.colorIndex,index:e.index,mapOptionsToLevel:e.mapOptionsToLevel,parentColor:r&&r.color,parentColorIndex:r&&r.colorIndex,series:e.series,siblings:e.siblings});return t.color=n.color,t.colorIndex=n.colorIndex,a&&(a.color=t.color,a.colorIndex=t.colorIndex,t.sliced=t.id!==e.idRoot&&a.sliced),t}class tX extends tV{alignDataLabel(t,e,i){if(!i.textPath||!i.textPath.enabled)return e.placed=!1,super.alignDataLabel.apply(this,arguments)}animate(t){let e,i=this.chart,s=[i.plotWidth/2,i.plotHeight/2],r=i.plotLeft,o=i.plotTop,l=this.group;t?(e={translateX:s[0]+r,translateY:s[1]+o,scaleX:.001,scaleY:.001,rotation:10,opacity:.01},l.attr(e)):(e={translateX:r,translateY:o,scaleX:1,scaleY:1,rotation:0,opacity:1},l.animate(e,this.options.animation))}drawPoints(){let t=this,e=t.mapOptionsToLevel,i=t.shapeRoot,s=t.group,r=t.hasRendered,o=t.rootNode,l=t.idPreviousRoot,a=t.nodeMap,n=a[l],h=n&&n.shapeArgs,d=t.points,p=t.startAndEndRadians,u=t.chart,c=u&&u.options&&u.options.chart||{},g="boolean"!=typeof c.animation||c.animation,f=t.center,v={x:f[0],y:f[1]},b=f[3]/2,m=t.chart.renderer,y=!!(g&&r&&o!==l&&t.dataLabelsGroup),x,P=!1,L=!1;for(let n of(y&&(t.dataLabelsGroup.attr({opacity:0}),x=function(){P=!0,t.dataLabelsGroup.animate({opacity:1,visibility:"inherit"})}),d)){let d,c,f=n.node,y=e[f.level],P=n.shapeExisting||{},T=f.shapeArgs||{},O=!!(f.visible&&f.shapeArgs);T.borderRadius=t.options.borderRadius,d=r&&g?function(t,e){let i=e.point,s=e.radians,r=e.innerR,o=e.idRoot,l=e.idPreviousRoot,a=e.shapeExisting,n=e.shapeRoot,h=e.shapePreviousRoot,d=e.visible,p={},u={end:t.end,start:t.start,innerR:t.innerR,r:t.r,x:t.x,y:t.y};return d?!i.graphic&&h&&((p=o===i.id?{start:s.start,end:s.end}:h.end<=t.start?{start:s.end,end:s.end}:{start:s.start,end:s.start}).innerR=p.r=r):i.graphic&&(l===i.id?u={innerR:r,r:r}:n&&(u=n.end<=a.start?{innerR:r,r:r,start:s.end,end:s.end}:{innerR:r,r:r,start:s.start,end:s.start})),{from:p,to:u}}(T,{center:v,point:n,radians:p,innerR:b,idRoot:o,idPreviousRoot:l,shapeExisting:P,shapeRoot:i,shapePreviousRoot:h,visible:O}):{to:T,from:{}},A(n,{shapeExisting:T,tooltipPos:[T.plotX,T.plotY],drillId:function(t,e,i){let s;return t.node.isLeaf||(s=e===t.id?i[e].parent:t.id),s}(n,o,a),name:""+(n.name||n.id||n.index),plotX:T.plotX,plotY:T.plotY,value:f.val,isInside:O,isNull:!O}),n.dlOptions={...function(t){let e=t.point,i=M(t.shapeArgs)?t.shapeArgs:{},{end:s=0,radius:r=0,start:o=0}=i,l=M(t.optionsPoint)?t.optionsPoint.dataLabels:{},a=B(G(M(t.level)?t.level.dataLabels:{})[0],l),n=a.style=a.style||{},{innerArcLength:h=0,outerArcLength:d=0}=e,p,u,c=a.rotationMode,g=w(n.width)?parseInt(n.width||"0",10):void 0;return R(a.rotation)||(("auto"===c||"circular"===c)&&(a.useHTML&&"circular"===c&&(c="auto"),h<1&&d>r?(p=0,e.dataLabelPath&&"circular"===c&&(a.textPath={enabled:!0}),s-o<Math.PI&&(g=.7*r)):h>1&&d>1.5*r?"circular"===c?a.textPath={enabled:!0,attributes:{dy:5}}:c="parallel":(e.dataLabel?.textPath&&"circular"===c&&(a.textPath={enabled:!1}),c="perpendicular")),"auto"!==c&&"circular"!==c&&(e.dataLabel?.textPath&&(a.textPath={enabled:!1}),p=s-(s-o)/2),"parallel"===c?g=Math.min(2.5*r,(d+h)/2):!w(g)&&r&&(g=1===e.node.level?2*r:r),"perpendicular"===c&&(d<16?g=1:i.radius&&(n.lineClamp=Math.floor(h/16)||1,g=r-(h<16?(16-h)/(d-h)*r:0))),g=Math.max((g||0)-2*(a.padding||0),1),u=(p||0)*t_%180,"parallel"===c&&(u-=90),u>90?u-=180:u<-90&&(u+=180),a.rotation=u),a.textPath&&(0===e.shapeExisting.innerR&&a.textPath.enabled?(a.rotation=0,a.textPath.enabled=!1,g=Math.max(2*e.shapeExisting.r-2*(a.padding||0),1)):e.dlOptions?.textPath&&!e.dlOptions.textPath.enabled&&"circular"===c&&(a.textPath.enabled=!0),a.textPath.enabled&&(a.rotation=0,g=Math.max((d+h)/2-2*(a.padding||0),1),n.whiteSpace="nowrap")),n.width=g+"px",a}({point:n,level:y,optionsPoint:n.options,shapeArgs:T}),zIndex:void 0},!L&&O&&(L=!0,c=x),n.draw({animatableAttribs:d.to,attribs:A(d.from,!u.styledMode&&t.pointAttribs(n,n.selected&&"select")),onComplete:c,group:s,renderer:m,shapeType:"arc",shapeArgs:T})}y&&L?(t.hasRendered=!1,t.options.dataLabels.defer=!0,tz.prototype.drawDataLabels.call(t),t.hasRendered=!0,P&&x?.()):tz.prototype.drawDataLabels.call(t),t.idPreviousRoot=o}layoutAlgorithm(t,e,i){let s=t.start,r=t.end-s,o=t.val,l=t.x,a=t.y,n=i&&M(i.levelSize)&&R(i.levelSize.value)?i.levelSize.value:0,h=t.r,d=h+n,p=i&&R(i.slicedOffset)?i.slicedOffset:0;return(e||[]).reduce((t,e)=>{let i=1/o*e.val*r,u=tY(l,a,s+i/2,p),c={x:e.sliced?u.x:l,y:e.sliced?u.y:a,innerR:h,r:d,radius:n,start:s,end:s+i};return t.push(c),s=c.end,t},[])}setRootNode(t,e,i){if(1===this.nodeMap[t].level&&1===this.nodeList.filter(t=>1===t.level).length){if(""===this.idPreviousRoot)return;t=""}super.setRootNode(t,e,i)}setShapeArgs(t,e,i){let s=i[t.level+1],r=t.children.filter(function(t){return t.visible}),o=[];o=this.layoutAlgorithm(e,r,s);let l=-1;for(let t of r){let e=o[++l],s=e.start+(e.end-e.start)/2,r=e.innerR+(e.r-e.innerR)/2,a=e.end-e.start,n=0===e.innerR&&a>6.28?{x:e.x,y:e.y}:tY(e.x,e.y,s,r),h=t.val?t.childrenTotal>t.val?t.childrenTotal:t.val:t.childrenTotal;this.points[t.i]&&(this.points[t.i].innerArcLength=a*e.innerR,this.points[t.i].outerArcLength=a*e.r),t.shapeArgs=B(e,{plotX:n.x,plotY:n.y}),t.values=B(e,{val:h}),t.children.length&&this.setShapeArgs(t,t.values,i)}}translate(){let t=this.options,e=this.center=this.getCenter(),i=this.startAndEndRadians=tG(t.startAngle,t.endAngle),s=e[3]/2,r=e[2]/2,o=tj(this),l=this.nodeMap,a,n=l&&l[o],h={};this.shapeRoot=n&&n.shapeArgs,this.generatePoints(),O(this,"afterTranslate");let d=this.tree=this.getTree(),p=C((n=(l=this.nodeMap)[o]).parent)?n.parent:"",u=l[p],{from:c,to:f}=tM.getLevelFromAndTo(n);a=tW({from:c,levels:this.options.levels,to:f,defaults:{colorByPoint:t.colorByPoint,dataLabels:t.dataLabels,levelIsConstant:t.levelIsConstant,levelSize:t.levelSize,slicedOffset:t.slicedOffset}}),a=tM.calculateLevelSizes(a,{diffRadius:r-s,from:c,to:f}),tF(d,{before:t$,idRoot:o,levelIsConstant:t.levelIsConstant,mapOptionsToLevel:a,mapIdToNode:l,points:this.points,series:this});let v=l[""].shapeArgs={end:i.end,r:s,start:i.start,val:n.val,x:e[0],y:e[1]};for(let t of(this.setShapeArgs(u,v,a),this.mapOptionsToLevel=a,this.points))h[t.id]&&(0,g.error)(31,!1,this.chart),h[t.id]=!0}}tX.defaultOptions=B(tV.defaultOptions,{center:["50%","50%"],clip:!1,colorByPoint:!1,opacity:1,dataLabels:{allowOverlap:!0,defer:!0,rotationMode:"circular",style:{textOverflow:"ellipsis"}},rootId:void 0,levelIsConstant:!0,levelSize:{value:1,unit:"weight"},slicedOffset:10}),A(tX.prototype,{axisTypes:[],drawDataLabels:tk,getCenter:tH,isCartesian:!1,onPointSupported:!0,pointAttribs:tz.prototype.pointAttribs,pointClass:tR,NodeClass:class extends to{},utils:tM}),K().registerSeriesType("sunburst",tX);let tK=f();tK.Breadcrumbs=tK.Breadcrumbs||_,tK.Breadcrumbs.compose(tK.Chart,tK.defaultOptions);let tq=f();return c.default})());