!/**
 * Highcharts JS v12.6.0 (2026-04-13)
 * Treegraph chart series type
 * @module highcharts/modules/treegraph
 * @requires highcharts
 * @requires highcharts/modules/treemap
 *
 *  (c) 2010-2026 Highsoft AS
 *  Author: Paweł Lysy Grzegorz Blachliński
 *
 * 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.SeriesRegistry,t._Highcharts.SVGRenderer,t._Highcharts.Point,t._Highcharts.Color,t._Highcharts.SVGElement):"function"==typeof define&&define.amd?define("highcharts/modules/treegraph",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry,t.SVGRenderer,t.Point,t.Color,t.SVGElement)}):"object"==typeof exports?exports["highcharts/modules/treegraph"]=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.SVGRenderer,t._Highcharts.Point,t._Highcharts.Color,t._Highcharts.SVGElement):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.SVGRenderer,t.Highcharts.Point,t.Highcharts.Color,t.Highcharts.SVGElement)}("u"<typeof window?this:window,(t,e,i,o,s,l)=>(()=>{"use strict";var r={28:t=>{t.exports=l},260:t=>{t.exports=o},512:t=>{t.exports=e},540:t=>{t.exports=i},620:t=>{t.exports=s},944:e=>{e.exports=t}},n={};function a(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,a),i.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var h={};a.d(h,{default:()=>ts});var d=a(944),p=a.n(d);function c(t){let{x1:e,y1:i,x2:o,y2:s,bendAt:l,width:r=0,inverted:n=!1,radius:a,parentVisible:h}=t;if(h){let t=l??r/2;return f([["M",e,i],["L",e+t*(n?-1:1),i],["L",e+t*(n?-1:1),s],["L",o,s]],a)}return[["M",e,i],["L",e,i],["C",e,i,e,s,e,s],["L",e,s],["C",e,i,e,s,e,s],["L",e,s]]}function f(t,e){let i=[];for(let o=0;o<t.length;o++){let s=t[o][1],l=t[o][2];if("number"==typeof s&&"number"==typeof l)if(0===o)i.push(["M",s,l]);else if(o===t.length-1)i.push(["L",s,l]);else if(e){let r=t[o-1],n=t[o+1];if(r&&n){let t=r[1],o=r[2],a=n[1],h=n[2];if("number"==typeof t&&"number"==typeof a&&"number"==typeof o&&"number"==typeof h&&t!==a&&o!==h){let r=t<a?1:-1,n=o<h?1:-1;i.push(["L",s-r*Math.min(Math.abs(s-t),e),l-n*Math.min(Math.abs(l-o),e)],["C",s,l,s,l,s+r*Math.min(Math.abs(s-a),e),l+n*Math.min(Math.abs(l-h),e)])}}}else i.push(["L",s,l])}return i}var u=a(512),g=a.n(u),v=a(540),y=a.n(v);let{seriesTypes:{treemap:{prototype:{NodeClass:b}}}}=g(),m=class extends b{constructor(){super(...arguments),this.mod=0,this.shift=0,this.change=0,this.children=[],this.preX=0,this.hidden=!1,this.wasVisited=!1,this.collapsed=!1}nextLeft(){return this.getLeftMostChild()||this.thread}nextRight(){return this.getRightMostChild()||this.thread}getAncestor(t,e){return t.ancestor.children[0]===this.children[0]?t.ancestor:e}getLeftMostSibling(){let t=this.getParent();if(t){for(let e of t.children)if(e&&e.point.visible)return e}}hasChildren(){let t=this.children;for(let e=0;e<t.length;e++)if(t[e].point.visible)return!0;return!1}getLeftSibling(){let t=this.getParent();if(t){let e=t.children;for(let t=this.relativeXPosition-1;t>=0;t--)if(e[t]&&e[t].point.visible)return e[t]}}getLeftMostChild(){let t=this.children;for(let e=0;e<t.length;e++)if(t[e].point.visible)return t[e]}getRightMostChild(){let t=this.children;for(let e=t.length-1;e>=0;e--)if(t[e].point.visible)return t[e]}getParent(){return this.parentNode}getFirstChild(){let t=this.children;for(let e=0;e<t.length;e++)if(t[e].point.visible)return t[e]}};var x=a(260),P=a.n(x);let{doc:k,win:L}=p();function C(t,e,i,o={}){let s="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(s,"hcEvents")||(s.hcEvents={});let l=s.hcEvents;p().Point&&t instanceof p().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let r=t.addEventListener;r&&r.call(t,e,i,!!p().supportsPassiveEvents&&{passive:void 0===o.passive?-1!==e.indexOf("touch"):o.passive,capture:!1}),l[e]||(l[e]=[]);let n={fn:i,order:"number"==typeof o.order?o.order:1/0};return l[e].push(n),l[e].sort((t,e)=>t.order-e.order),function(){!function(t,e,i){function o(e,i){let o=t.removeEventListener;o&&o.call(t,e,i,!1)}function s(i){let s,l;t.nodeName&&(e?(s={})[e]=!0:s=i,A(s,function(t,e){if(i[e])for(l=i[e].length;l--;)o(e,i[e][l].fn)}))}let l="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(l,"hcEvents")){let t=l.hcEvents;if(e){let l=t[e]||[];i?(t[e]=l.filter(function(t){return i!==t.fn}),o(e,i)):(s(t),t[e]=[])}else s(t),delete l.hcEvents}}(t,e,i)}}function T(t,e=0,i){let o=e%2/2,s=i?-1:1;return(Math.round(t*s-o)+o)*s}function O(t,e){let i;for(i in t||(t={}),e)t[i]=e[i];return t}function M(t){return X(t)&&"number"==typeof t.nodeType}function N(t){return"number"==typeof t&&!isNaN(t)&&t<1/0&&t>-1/0}function S(t){let e=Object.prototype.toString.call(t);return"[object Array]"===e||"[object Array Iterator]"===e}function X(t,e){return!!t&&"object"==typeof t&&(!e||!S(t))}function w(t,...e){let i,o=[t,...e],s={},l=function(t,e){return"object"!=typeof t&&(t={}),A(e,function(i,o){if("__proto__"!==o&&"constructor"!==o){let s;!X(i,!0)||(s=i?.constructor,X(i,!0)&&!M(i)&&s?.name&&"Object"!==s.name)||M(i)?t[o]=e[o]:t[o]=l(t[o]||{},i)}}),t};!0===t&&(s=o[1],o=Array.prototype.slice.call(o,2));let r=o.length;for(i=0;i<r;i++)s=l(s,o[i]);return s}function A(t,e,i){for(let o in t)Object.hasOwnProperty.call(t,o)&&e.call(i||t[o],t[o],o,t)}function B(){let t=arguments,e=t.length;for(let i=0;i<e;i++){let e=t[i];if(null!=e)return e}}function E(t,e,i){return/%$/.test(t)?e*parseFloat(t)/100+(i||0):parseFloat(t)}function R(t){return S(t)?t:[t]}Array.prototype.find;let{seriesTypes:{treemap:{prototype:{pointClass:H}}}}=g();class I extends H{constructor(){super(...arguments),this.dataLabelOnHidden=!0,this.isLink=!1,this.setState=P().prototype.setState}draw(){super.draw.apply(this,arguments);let t=this.graphic;t&&t.animate({visibility:this.visible?"inherit":"hidden"}),this.renderCollapseButton()}renderCollapseButton(){let t=this.series,e=this.graphic&&this.graphic.parentGroup,i=t.mapOptionsToLevel[this.node.level||0]||{},o=w(t.options.collapseButton,i.collapseButton,this.options.collapseButton),{width:s,height:l,shape:r,style:n}=o,a=this.series.chart,h=this.visible&&(this.collapsed||!o.onlyOnHover||"hover"===this.state)?1:0;if(this.shapeArgs)if(this.collapseButtonOptions=o,this.collapseButton)if(this.node.children.length&&o.enabled){let{x:t,y:e}=this.getCollapseBtnPosition(o);this.collapseButton.attr({text:this.collapsed?"+":"-",rotation:90*!!a.inverted,rotationOriginX:s/2,rotationOriginY:l/2,visibility:this.visible?"inherit":"hidden"}).animate({x:t,y:e,opacity:h})}else this.collapseButton.destroy(),delete this.collapseButton;else{if(!this.node.children.length||!o.enabled)return;let{x:t,y:i}=this.getCollapseBtnPosition(o),d=o.fillColor||this.color||"#cccccc";this.collapseButton=a.renderer.label(this.collapsed?"+":"-",t,i,r).attr({height:l-4,width:s-4,padding:2,fill:d,rotation:90*!!a.inverted,rotationOriginX:s/2,rotationOriginY:l/2,stroke:o.lineColor||"#ffffff","stroke-width":o.lineWidth,"text-align":"center",align:"center",zIndex:1,opacity:h,visibility:this.visible?"inherit":"hidden"}).addClass("highcharts-tracker").addClass("highcharts-collapse-button").removeClass("highcharts-no-tooltip").css(w({color:"string"==typeof d?a.renderer.getContrast(d):"#333333"},n)).add(e),this.collapseButton.element.point=this}}toggleCollapse(t){let e=this.series;this.update({collapsed:t??!this.collapsed},!1,void 0,!1),function(t,e,i,o){if(i=i||{},k?.createEvent&&(t.dispatchEvent||t.fireEvent&&t!==p())){let o=k.createEvent("Events");o.initEvent(e,!0,!0),i=O(o,i),t.dispatchEvent?t.dispatchEvent(i):t.fireEvent(e,i)}else if(t.hcEvents){i.target||O(i,{preventDefault:function(){i.defaultPrevented=!0},target:t,type:e});let o=[],s=t,l=!1;for(;s.hcEvents;)Object.hasOwnProperty.call(s,"hcEvents")&&s.hcEvents[e]&&(o.length&&(l=!0),o.unshift.apply(o,s.hcEvents[e])),s=Object.getPrototypeOf(s);l&&o.sort((t,e)=>t.order-e.order),o.forEach(e=>{!1===e.fn.call(t,i,t)&&i.preventDefault()})}}(e,"toggleCollapse"),e.redraw()}destroy(){this.collapseButton&&(this.collapseButton.destroy(),delete this.collapseButton,this.collapseButton=void 0),this.linkToParent&&(this.linkToParent.destroy(),delete this.linkToParent),super.destroy.apply(this,arguments)}getCollapseBtnPosition(t){let e=this.series.chart.inverted,i=t.width,o=t.height,{x:s=0,y:l=0,width:r=0,height:n=0}=this.shapeArgs||{};return{x:s+t.x+(e?-(.3*o):r+-.3*i),y:l+n/2-o/2+t.y}}}C(I,"mouseOut",function(){let t=this.collapseButton,e=this.collapseButtonOptions;t&&e?.onlyOnHover&&!this.collapsed&&t.animate({opacity:0})}),C(I,"mouseOver",function(){this.collapseButton&&this.visible&&this.collapseButton.animate({opacity:1},this.series.options.states?.hover?.animation)}),C(I,"click",function(){this.toggleCollapse()});var W=a(620),_=a.n(W);let j={getColor:function(t,e){let i,o,s,l,r,n,a=e.index,h=e.mapOptionsToLevel,d=e.parentColor,p=e.parentColorIndex,c=e.series,f=e.colors,u=e.siblings,g=c.points,v=c.chart.options.chart;if(t){let y;i=g[t.i],o=h[t.level]||{},i&&o.colorByPoint&&(l=i.index%(f?f.length:v.colorCount),s=f&&f[l]),c.chart.styledMode||(r=B(i&&i.options.color,o&&o.color,s,d&&((y=o&&o.colorVariation)&&"brightness"===y.key&&a&&u?_().parse(d).brighten(y.to*(a/u)).get():d),c.color)),n=B(i&&i.options.colorIndex,o&&o.colorIndex,l,p,e.colorIndex)}return{color:r,colorIndex:n}},getLevelOptions:function(t){let e,i,o,s,l,r,n={};if(X(t))for(s=N(t.from)?t.from:1,r=t.levels,i={},e=X(t.defaults)?t.defaults:{},S(r)&&(i=r.reduce((t,i)=>{let o,l,r;return X(i)&&N(i.level)&&(l=B((r=w({},i)).levelIsConstant,e.levelIsConstant),delete r.levelIsConstant,delete r.level,X(t[o=i.level+(l?0:s-1)])?w(!0,t[o],r):t[o]=r),t},{})),l=N(t.to)?t.to:1,o=0;o<=l;o++)n[o]=w({},e,X(i[o])?i[o]:{});return n},getNodeWidth:function(t,e){let{chart:i,options:o}=t,{nodeDistance:s=0,nodeWidth:l=0}=o,{plotSizeX:r=1}=i;if("auto"===l){if("string"==typeof s&&/%$/.test(s))return r/(e+parseFloat(s)/100*(e-1));let t=Number(s);return(r+t)/(e||1)-t}return E(l,r)},setTreeValues:function t(e,i){let o=i.before,s=i.idRoot,l=i.mapIdToNode[s],r=!1!==i.levelIsConstant,n=i.points[e.i],a=n&&n.options||{},h=[],d=0;e.levelDynamic=e.level-(r?0:l.level),e.name=B(n&&n.name,""),e.visible=s===e.id||!0===i.visible,"function"==typeof o&&(e=o(e,i)),e.children.forEach((o,s)=>{let l=O({},i);O(l,{index:s,siblings:e.children.length,visible:e.visible}),o=t(o,l),h.push(o),o.visible&&(d+=o.val)});let p=B(a.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 X(t)&&(i=X(t.options)?t.options:{},e=B(t.rootNode,i.rootId,""),X(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e}},{seriesTypes:{column:{prototype:{pointClass:D}}}}=g(),V=class extends D{constructor(t,e,i,o){super(t,e,i),this.dataLabelOnNull=!0,this.formatPrefix="link",this.isLink=!0,this.node={},this.formatPrefix="link",this.dataLabelOnNull=!0,o&&(this.fromNode=o.node.parentNode.point,this.visible=o.visible,this.toNode=o,this.id=this.toNode.id+"-"+this.fromNode.id)}update(t,e,i,o){let s={id:this.id,formatPrefix:this.formatPrefix};P().prototype.update.call(this,t,!this.isLink&&e,i,o),this.visible=this.toNode.visible,O(this,s),B(e,!0)&&this.series.chart.redraw(i)}};class z{static createDummyNode(t,e,i){let o=new m;return o.id=t.id+"-"+i,o.ancestor=t,o.children.push(e),o.parent=t.id,o.parentNode=t,o.point=e.point,o.level=e.level-i,o.relativeXPosition=e.relativeXPosition,o.visible=e.visible,t.children[e.relativeXPosition]=o,e.oldParentNode=t,e.relativeXPosition=0,e.parentNode=o,e.parent=o.id,o}calculatePositions(t){let e=t.nodeList;this.resetValues(e);let i=t.tree;i&&(this.calculateRelativeX(i,0),this.beforeLayout(e),this.firstWalk(i),this.secondWalk(i,-i.preX),this.afterLayout(e))}beforeLayout(t){for(let e of t)for(let t of e.children)if(t&&t.level-e.level>1){let i=t.level-e.level-1;for(;i>0;)t=z.createDummyNode(e,t,i),i--}}resetValues(t){for(let e of t)e.mod=0,e.ancestor=e,e.shift=0,e.thread=void 0,e.change=0,e.preX=0}calculateRelativeX(t,e){let i=t.children;for(let t=0,e=i.length;t<e;++t)this.calculateRelativeX(i[t],t);t.relativeXPosition=e}firstWalk(t){let e;if(t.hasChildren()){let i=t.getLeftMostChild();for(let e of t.children)this.firstWalk(e),i=this.apportion(e,i);this.executeShifts(t);let o=t.getLeftMostChild(),s=t.getRightMostChild(),l=(o.preX+s.preX)/2;(e=t.getLeftSibling())?(t.preX=e.preX+1,t.mod=t.preX-l):t.preX=l}else(e=t.getLeftSibling())?(t.preX=e.preX+1,t.mod=t.preX):t.preX=0}secondWalk(t,e){for(let i of(t.yPosition=t.preX+e,t.xPosition=t.point?.x??t.level,t.children))this.secondWalk(i,e+t.mod)}executeShifts(t){let e=0,i=0;for(let o=t.children.length-1;o>=0;o--){let s=t.children[o];s.preX+=e,s.mod+=e,i+=s.change,e+=s.shift+i}}apportion(t,e){let i=t.getLeftSibling();if(i){let o=t,s=t,l=i,r=o.getLeftMostSibling(),n=o.mod,a=s.mod,h=l.mod,d=r.mod;for(;l&&l.nextRight()&&o&&o.nextLeft();){l=l.nextRight(),r=r.nextLeft(),o=o.nextLeft(),(s=s.nextRight()).ancestor=t;let i=l.preX+h-(o.preX+n)+1;i>0&&(this.moveSubtree(t.getAncestor(l,e),t,i),n+=i,a+=i),h+=l.mod,n+=o.mod,d+=r.mod,a+=s.mod}l&&l.nextRight()&&!s.nextRight()&&(s.thread=l.nextRight(),s.mod+=h-a),o&&o.nextLeft()&&!r.nextLeft()&&(r.thread=o.nextLeft(),r.mod+=n-d),e=t}return e}moveSubtree(t,e,i){let o=e.relativeXPosition-t.relativeXPosition;e.change-=i/o,e.shift+=i,e.preX+=i,e.mod+=i,t.change+=i/o}afterLayout(t){for(let e of t)e.oldParentNode&&(e.relativeXPosition=e.parentNode.relativeXPosition,e.parent=e.oldParentNode.parent,e.parentNode=e.oldParentNode,e.oldParentNode.children.splice(e.relativeXPosition,1,e),e.oldParentNode=void 0)}}var Y=a(28),F=a.n(Y);let{deg2rad:G}=p();function $(t,e){e=w(!0,{enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e);let i=this.renderer.url,o=this.text||this,s=o.textPath,{attributes:l,enabled:r}=e;if(t=t||s&&s.path,s&&s.undo(),t&&r){let e=C(o,"afterModifyTree",e=>{if(t&&r){let s=t.attr("id");s||t.attr("id",s=(0,d.uniqueKey)());let r={x:0,y:0};null!=l.dx&&(r.dx=l.dx,delete l.dx),null!=l.dy&&(r.dy=l.dy,delete l.dy),o.attr(r),this.attr({transform:""}),this.box&&(this.box=this.box.destroy());let n=e.nodes.slice(0);e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:O(l,{"text-anchor":l.textAnchor,href:`${i}#${s}`}),children:n}}});o.textPath={path:t,undo:e}}else o.attr({dx:0,dy:0}),delete o.textPath;return this.added&&(o.textCache="",this.renderer.buildText(o)),this}function q(t){let e=t.bBox,i=this.element?.querySelector("textPath");if(i){let t=[],{b:o,h:s}=this.renderer.fontMetrics(this.element),l=s-o,r=RegExp('(<tspan>|<tspan(?!\\sclass="highcharts-br")[^>]*>|<\\/tspan>)',"g"),n=i.innerHTML.replace(r,"").split(/<tspan class="highcharts-br"[^>]*>/),a=n.length,h=(t,e)=>{let{x:s,y:r}=e,n=(i.getRotationOfChar(t)-90)*G,a=Math.cos(n),h=Math.sin(n);return[[s-l*a,r-l*h],[s+o*a,r+o*h]]};for(let e=0,o=0;o<a;o++){let s=n[o].length;for(let l=0;l<s;l+=5)try{let s=e+l+o,[r,n]=h(s,i.getStartPositionOfChar(s));0===l?(t.push(n),t.push(r)):(0===o&&t.unshift(n),o===a-1&&t.push(r))}catch{break}e+=s-1;try{let s=e+o,l=i.getEndPositionOfChar(s),[r,n]=h(s,l);t.unshift(n),t.unshift(r)}catch{break}}t.length&&t.push(t[0].slice()),e.polygon=t}return e}function K(t){let e=t.labelOptions,i=t.point,o=e[i.formatPrefix+"TextPath"]||e.textPath;o&&!e.useHTML&&(this.setTextPath(i.getDataLabelPath?.(this)||i.graphic,o),i.dataLabelPath&&!o.enabled&&(i.dataLabelPath=i.dataLabelPath.destroy()))}let{getLinkPath:U}={applyRadius:f,getLinkPath:{default:c,orthogonal:c,straight:function(t){let{x1:e,y1:i,x2:o,y2:s,width:l=0,inverted:r=!1,parentVisible:n}=t;return n?[["M",e,i],["L",e+l*(r?-1:1),s],["L",o,s]]:[["M",e,i],["L",e,s],["L",e,s]]},curved:function(t){let{x1:e,y1:i,x2:o,y2:s,offset:l=0,width:r=0,inverted:n=!1,parentVisible:a}=t;return a?[["M",e,i],["C",e+l,i,e-l+r*(n?-1:1),s,e+r*(n?-1:1),s],["L",o,s]]:[["M",e,i],["C",e,i,e,s,e,s],["L",o,s]]}}},{series:{prototype:J},seriesTypes:{treemap:Q,column:Z}}=g(),{prototype:{symbols:tt}}=y(),{getLevelOptions:te,getNodeWidth:ti}=j;({compose:function(t){C(t,"afterGetBBox",q),C(t,"beforeAddingDataLabel",K);let e=t.prototype;e.setTextPath||(e.setTextPath=$)}}).compose(F());class to extends Q{constructor(){super(...arguments),this.nodeList=[],this.links=[]}init(){super.init.apply(this,arguments),this.layoutAlgorithm=new z;let t=this,e=this.chart.labelCollectors;e.some(t=>"collectorFunc"===t.name)||e.push(function(){let e=[];if(t.options.dataLabels&&!R(t.options.dataLabels)[0].allowOverlap)for(let i of t.links||[])i.dataLabel&&e.push(i.dataLabel);return e})}getLayoutModifiers(){let t=this.chart,e=this,i=t.plotSizeX,o=t.plotSizeY,s=e.options.link?.lineWidth||0,l=function(t){let e=t.length,i=t[0];for(;e--;)t[e]>i&&(i=t[e]);return i}(this.points.map(t=>t.node.xPosition)),r=1/0,n=-1/0,a=1/0,h=-1/0,d=0,p=0,c=0,f=0;this.points.forEach(t=>{if(this.options.fillSpace&&!t.visible)return;let u=t.node,g=e.mapOptionsToLevel[t.node.level]||{},v=w(this.options.marker,g.marker,t.options.marker),y=v.width??ti(this,l),b=E(v.radius||0,Math.min(i,o)),m=Math.max(v.lineWidth||0,s),x=v.symbol,P="circle"!==x&&v.height?E(v.height,o):2*b,k="circle"!==x&&y?E(y,i):2*b;u.nodeSizeX=k,u.nodeSizeY=P,u.xPosition<=r&&(r=u.xPosition,p=Math.max(k+m,p)),u.xPosition>=n&&(n=u.xPosition,d=Math.max(k+m,d)),u.yPosition<=a&&(a=u.yPosition,f=Math.max(P+m,f)),u.yPosition>=h&&(h=u.yPosition,c=Math.max(P+m,c))});let u=h===a?1:(o-(f+c)/2)/(h-a),g=h===a?o/2:-u*a+f/2,v=n===r?1:(i-(d+d)/2)/(n-r),y=n===r?i/2:-v*r+p/2;return{ax:v,bx:y,ay:u,by:g}}getLinks(){let t=this,e=[];return this.data.forEach(i=>{let o=t.mapOptionsToLevel[i.node.level??0]||{};if(i.node.parent){let s=w(o,i.options);if(!i.linkToParent||i.linkToParent.destroyed){let e=new t.LinkClass(t,s,void 0,i);i.linkToParent=e}else i.collapsed=B(i.collapsed,(this.mapOptionsToLevel[i.node.level]||{}).collapsed),i.linkToParent.visible=i.linkToParent.toNode.visible;i.linkToParent.index=e.push(i.linkToParent)-1}else i.linkToParent&&(t.links.splice(i.linkToParent.index),i.linkToParent.destroy(),delete i.linkToParent)}),e}buildTree(t,e,i,o,s){let l=this.points[e];return i=l?.level??i,super.buildTree.call(this,t,e,i,o,s)}markerAttribs(){return{}}setCollapsedStatus(t,e){let i=t.point;i&&(i.collapsed=B(i.collapsed,(this.mapOptionsToLevel[t.level]||{}).collapsed),i.visible=e,e=!1!==e&&!i.collapsed),t.children.forEach(t=>{this.setCollapsedStatus(t,e)})}drawTracker(){Z.prototype.drawTracker.apply(this,arguments),Z.prototype.drawTracker.call(this,this.links)}translate(){let t=this.options,e=j.updateRootId(this),i;J.translate.call(this);let o=this.tree=this.getTree();i=this.nodeMap[e],""===e||i&&i.children.length||(this.setRootNode("",!1),e=this.rootNode,i=this.nodeMap[e]),this.mapOptionsToLevel=te({from:i.level+1,levels:t.levels,to:o.height,defaults:{levelIsConstant:this.options.levelIsConstant,colorByPoint:t.colorByPoint}}),this.setCollapsedStatus(o,!0),this.links=this.getLinks(),this.setTreeValues(o),this.layoutAlgorithm.calculatePositions(this),this.layoutModifier=this.getLayoutModifiers(),this.points.forEach(t=>{this.translateNode(t)}),this.points.forEach(t=>{t.linkToParent&&this.translateLink(t.linkToParent)}),t.colorByPoint||this.setColorRecursive(this.tree)}translateLink(t){let e=t.fromNode,i=t.toNode,o=this.options.link?.lineWidth||0,s=B(this.options.link?.curveFactor,.5),l=i.x!==i.node.level||e.x!==e.node.level,r=B(t.options.link?.type,this.options.link?.type,"default");if(e.shapeArgs&&i.shapeArgs){let n=e.shapeArgs.width||0,a=this.chart.inverted,h=T((e.shapeArgs.y||0)+(e.shapeArgs.height||0)/2,o),d=T((i.shapeArgs.y||0)+(i.shapeArgs.height||0)/2,o),p=T((e.shapeArgs.x||0)+n,o),c=T(i.shapeArgs.x||0,o);a&&(p-=Math.round(n),c+=Math.round(i.shapeArgs.width||0));let f=i.node.xPosition-e.node.xPosition,u=Math.abs(c-p)+n,g=(l?u:u/f)-n,v=T((c+p)/2,o),y=E(t.options.link?.bendAt??this.options.link?.bendAt??"50%",u-n);t.shapeType="path",t.plotX=v,t.plotY=d,t.shapeArgs={d:U[r]({x1:p,y1:h,x2:c,y2:d,width:g,offset:g*s*(a?-1:1),inverted:a,parentVisible:i.visible,radius:this.options.link?.radius,bendAt:y})},t.dlBox={x:(p+c)/2,y:(h+d)/2,height:o,width:0},t.tooltipPos=a?[(this.chart.plotSizeY||0)-t.dlBox.y,(this.chart.plotSizeX||0)-t.dlBox.x]:[t.dlBox.x,t.dlBox.y]}}drawNodeLabels(t){let e,i,o=this.mapOptionsToLevel;for(let s of t){if(i=o[s.node.level],e={style:{}},i&&i.dataLabels&&(e=w(e,i.dataLabels),this.hasDataLabels=()=>!0),s.shapeArgs&&this.options.dataLabels){let t={},{width:i=0,height:o=0}=s.shapeArgs;this.chart.inverted&&([i,o]=[o,i]),R(this.options.dataLabels)[0].style?.width||(t.width=`${i}px`),R(this.options.dataLabels)[0].style?.lineClamp||(t.lineClamp=Math.floor(o/16)),O(e.style,t),s.dataLabel?.css(t)}s.dlOptions=w(e,s.options.dataLabels)}J.drawDataLabels.call(this,t)}alignDataLabel(t,e){let i=t.visible;t.visible=!0,super.alignDataLabel.apply(this,arguments),e.animate({opacity:+(!1!==i)},void 0,function(){i||e.hide()}),t.visible=i}drawDataLabels(){this.options.dataLabels&&(this.options.dataLabels=R(this.options.dataLabels),this.drawNodeLabels(this.points),J.drawDataLabels.call(this,this.links))}destroy(){if(this.links){for(let t of this.links)t.destroy();this.links.length=0}return J.destroy.apply(this,arguments)}pointAttribs(t,e){let i=t&&this.mapOptionsToLevel[t.node.level??0]||{},o=t&&t.options,s=i.states&&i.states[e]||{};t&&(t.options.marker=w(this.options.marker,i.marker,t.options.marker));let l=B(s&&s.link&&s.link.color,o&&o.link&&o.link.color,i&&i.link&&i.link.color,this.options.link&&this.options.link.color),r=B(s&&s.link&&s.link.lineWidth,o&&o.link&&o.link.lineWidth,i&&i.link&&i.link.lineWidth,this.options.link&&this.options.link.lineWidth),n=J.pointAttribs.call(this,t,e);return t&&(t.isLink&&(n.stroke=l,n["stroke-width"]=r,delete n.fill),t.visible||(n.opacity=0)),n}drawPoints(){Q.prototype.drawPoints.apply(this,arguments),Z.prototype.drawPoints.call(this,this.links)}translateNode(t){let e=this.chart,{node:i,plotX:o=0}=t,s=e.plotSizeY,l=e.plotSizeX,{ax:r,bx:n,ay:a,by:h}=this.layoutModifier,d=this.isCartesian?e.inverted?l-o:o:r*i.xPosition+n,p=a*i.yPosition+h,c=this.mapOptionsToLevel[i.level]||{},f=w(this.options.marker,c.marker,t.options.marker).symbol,u=i.nodeSizeY,g=i.nodeSizeX,v=this.options.reversed,y=i.x=e.inverted?l-g/2-d:d-g/2,b=i.y=v?p-u/2:s-p-u/2,m=B(t.options.borderRadius,c.borderRadius,this.options.borderRadius),x=tt[f||"circle"];if(void 0===x?(t.hasImage=!0,t.shapeType="image",t.imageUrl=f.match(/^url\((.*?)\)$/)[1]):t.shapeType="path",!t.visible&&t.linkToParent){let e=t.linkToParent.fromNode;if(e){let{x:i=0,y:o=0,width:s=0,height:l=0}=e.shapeArgs||{};t.shapeArgs||(t.shapeArgs={}),t.hasImage||O(t.shapeArgs,{d:x(i,o,s,l,m?{r:m}:void 0)}),O(t.shapeArgs,{x:i,y:o}),t.plotX=e.plotX,t.plotY=e.plotY}}else t.plotX=y,t.plotY=b,t.shapeArgs={x:y,y:b,width:g,height:u,cursor:t.node.isLeaf?"default":"pointer"},t.hasImage||(t.shapeArgs.d=x(y,b,g,u,m?{r:m}:void 0));t.tooltipPos=e.inverted?[s-b-u/2,l-y-g/2]:[y+g/2,b]}}to.defaultOptions=w(Q.defaultOptions,{reversed:!1,marker:{radius:10,lineWidth:0,symbol:"circle",fillOpacity:1,states:{}},link:{color:"#666666",lineWidth:1,radius:10,cursor:"default",type:"curved"},collapseButton:{onlyOnHover:!0,enabled:!0,lineWidth:1,x:0,y:0,height:18,width:18,shape:"circle",style:{cursor:"pointer",fontWeight:"bold",fontSize:"1em"}},fillSpace:!1,tooltip:{linkFormat:"{point.fromNode.id} → {point.toNode.id}",pointFormat:"{point.id}"},dataLabels:{defer:!0,linkTextPath:{attributes:{startOffset:"50%"}},enabled:!0,linkFormatter:()=>"",pointFormat:void 0,padding:5,style:{textOverflow:"none"}},nodeDistance:30,nodeWidth:void 0}),O(to.prototype,{forceDL:!0,pointClass:I,NodeClass:m,LinkClass:V,isCartesian:!1}),g().registerSeriesType("treegraph",to);let ts=p();return h.default})());