!/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * Treegraph chart series type
 * @module highcharts/modules/treegraph
 * @requires highcharts
 * @requires highcharts/modules/treemap
 *
 *  (c) 2010-2026 Highsoft AS
 *  Authors: 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,function(t,e,i,o,r,n){return function(){"use strict";var s,a,l,h,p,d,c={28:function(t){t.exports=n},260:function(t){t.exports=o},512:function(t){t.exports=e},540:function(t){t.exports=i},620:function(t){t.exports=r},944:function(e){e.exports=t}},u={};function f(t){var e=u[t];if(void 0!==e)return e.exports;var i=u[t]={exports:{}};return c[t](i,i.exports,f),i.exports}f.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return f.d(e,{a:e}),e},f.d=function(t,e){for(var i in e)f.o(e,i)&&!f.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},f.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var v={};f.d(v,{default:function(){return $}});var y=f(944),g=f.n(y);function b(t){var e=t.x1,i=t.y1,o=t.x2,r=t.y2,n=t.bendAt,s=t.width,a=t.inverted,l=void 0!==a&&a,h=t.radius;if(t.parentVisible){var p=null!=n?n:(void 0===s?0:s)/2;return function(t,e){for(var i=[],o=0;o<t.length;o++){var r=t[o][1],n=t[o][2];if("number"==typeof r&&"number"==typeof n)if(0===o)i.push(["M",r,n]);else if(o===t.length-1)i.push(["L",r,n]);else if(e){var s=t[o-1],a=t[o+1];if(s&&a){var l=s[1],h=s[2],p=a[1],d=a[2];if("number"==typeof l&&"number"==typeof p&&"number"==typeof h&&"number"==typeof d&&l!==p&&h!==d){var c=l<p?1:-1,u=h<d?1:-1;i.push(["L",r-c*Math.min(Math.abs(r-l),e),n-u*Math.min(Math.abs(n-h),e)],["C",r,n,r,n,r+c*Math.min(Math.abs(r-p),e),n+u*Math.min(Math.abs(n-d),e)])}}}else i.push(["L",r,n])}return i}([["M",e,i],["L",e+p*(l?-1:1),i],["L",e+p*(l?-1:1),r],["L",o,r]],h)}return[["M",e,i],["L",e,i],["C",e,i,e,r,e,r],["L",e,r],["C",e,i,e,r,e,r],["L",e,r]]}var m=f(512),x=f.n(m),k=f(540),P=f.n(k),L=(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)}),O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mod=0,e.shift=0,e.change=0,e.children=[],e.preX=0,e.hidden=!1,e.wasVisited=!1,e.collapsed=!1,e}return L(e,t),e.prototype.nextLeft=function(){return this.getLeftMostChild()||this.thread},e.prototype.nextRight=function(){return this.getRightMostChild()||this.thread},e.prototype.getAncestor=function(t,e){return t.ancestor.children[0]===this.children[0]?t.ancestor:e},e.prototype.getLeftMostSibling=function(){var t=this.getParent();if(t)for(var e=0,i=t.children;e<i.length;e++){var o=i[e];if(o&&o.point.visible)return o}},e.prototype.hasChildren=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].point.visible)return!0;return!1},e.prototype.getLeftSibling=function(){var t=this.getParent();if(t){for(var e=t.children,i=this.relativeXPosition-1;i>=0;i--)if(e[i]&&e[i].point.visible)return e[i]}},e.prototype.getLeftMostChild=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].point.visible)return t[e]},e.prototype.getRightMostChild=function(){for(var t=this.children,e=t.length-1;e>=0;e--)if(t[e].point.visible)return t[e]},e.prototype.getParent=function(){return this.parentNode},e.prototype.getFirstChild=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].point.visible)return t[e]},e}(x().seriesTypes.treemap.prototype.NodeClass),C=f(260),w=f.n(C),T=(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)}),M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dataLabelOnHidden=!0,e.isLink=!1,e.setState=w().prototype.setState,e}return T(e,t),e.prototype.draw=function(){t.prototype.draw.apply(this,arguments);var e=this.graphic;e&&e.animate({visibility:this.visible?"inherit":"hidden"}),this.renderCollapseButton()},e.prototype.renderCollapseButton=function(){var t=this.series,e=this.graphic&&this.graphic.parentGroup,i=t.mapOptionsToLevel[this.node.level||0]||{},o=(0,y.merge)(t.options.collapseButton,i.collapseButton,this.options.collapseButton),r=o.width,n=o.height,s=o.shape,a=o.style,l=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){var p=this.getCollapseBtnPosition(o),d=p.x,c=p.y;this.collapseButton.attr({text:this.collapsed?"+":"-",rotation:90*!!l.inverted,rotationOriginX:r/2,rotationOriginY:n/2,visibility:this.visible?"inherit":"hidden"}).animate({x:d,y:c,opacity:h})}else this.collapseButton.destroy(),delete this.collapseButton;else{if(!this.node.children.length||!o.enabled)return;var u=this.getCollapseBtnPosition(o),d=u.x,c=u.y,f=o.fillColor||this.color||"var(--highcharts-neutral-color-20)";this.collapseButton=l.renderer.label(this.collapsed?"+":"-",d,c,s).attr({height:n-4,width:r-4,padding:2,fill:f,rotation:90*!!l.inverted,rotationOriginX:r/2,rotationOriginY:n/2,stroke:o.lineColor||"var(--highcharts-background-color)","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((0,y.merge)({color:"string"==typeof f?l.renderer.getContrast(f):"var(--highcharts-neutral-color-80)"},a)).add(e),this.collapseButton.element.point=this}},e.prototype.toggleCollapse=function(t){var e=this.series;this.update({collapsed:null!=t?t:!this.collapsed},!1,void 0,!1),(0,y.fireEvent)(e,"toggleCollapse"),e.redraw()},e.prototype.destroy=function(){this.collapseButton&&(this.collapseButton.destroy(),delete this.collapseButton,this.collapseButton=void 0),this.linkToParent&&(this.linkToParent.destroy(),delete this.linkToParent),t.prototype.destroy.apply(this,arguments)},e.prototype.getCollapseBtnPosition=function(t){var e=this.series.chart.inverted,i=t.width,o=t.height,r=this.shapeArgs||{},n=r.x,s=r.y,a=r.width,l=r.height;return{x:(void 0===n?0:n)+t.x+(e?-(.3*o):(void 0===a?0:a)+-.3*i),y:(void 0===s?0:s)+(void 0===l?0:l)/2-o/2+t.y}},e}(x().seriesTypes.treemap.prototype.pointClass);(0,y.addEvent)(M,"mouseOut",function(){var t=this.collapseButton,e=this.collapseButtonOptions;t&&(null==e?void 0:e.onlyOnHover)&&!this.collapsed&&t.animate({opacity:0})}),(0,y.addEvent)(M,"mouseOver",function(){var t,e;this.collapseButton&&this.visible&&this.collapseButton.animate({opacity:1},null==(e=null==(t=this.series.options.states)?void 0:t.hover)?void 0:e.animation)}),(0,y.addEvent)(M,"click",function(){this.toggleCollapse()});var _=f(620),S=function(t){var e,i,o,r,n,s,a={};if((0,y.isObject)(t))for(r=(0,y.isNumber)(t.from)?t.from:1,s=t.levels,i={},e=(0,y.isObject)(t.defaults)?t.defaults:{},(0,y.isArray)(s)&&(i=s.reduce(function(t,i){var o,n,s;return(0,y.isObject)(i)&&(0,y.isNumber)(i.level)&&(s=(0,y.merge)({},i),n=(0,y.pick)(s.levelIsConstant,e.levelIsConstant),delete s.levelIsConstant,delete s.level,o=i.level+(n?0:r-1),(0,y.isObject)(t[o])?(0,y.merge)(!0,t[o],s):t[o]=s),t},{})),n=(0,y.isNumber)(t.to)?t.to:1,o=0;o<=n;o++)a[o]=(0,y.merge)({},e,(0,y.isObject)(i[o])?i[o]:{});return a},X=function(t,e){var i=t.chart,o=t.options,r=o.nodeDistance,n=void 0===r?0:r,s=o.nodeWidth,a=void 0===s?0:s,l=i.plotSizeX,h=void 0===l?1:l;if("auto"===a){if("string"==typeof n&&/%$/.test(n))return h/(e+parseFloat(n)/100*(e-1));var p=Number(n);return(h+p)/(e||1)-p}return(0,y.relativeLength)(a,h)},N=function(t){var e,i;return(0,y.isObject)(t)&&(i=(0,y.isObject)(t.options)?t.options:{},e=(0,y.pick)(t.rootNode,i.rootId,""),(0,y.isObject)(t.userOptions)&&(t.userOptions.rootId=e),t.rootNode=e),e},A=(l=function(t,e){return(l=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}l(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),B=function(t){function e(e,i,o,r){var n=t.call(this,e,i,o)||this;return n.dataLabelOnNull=!0,n.formatPrefix="link",n.isLink=!0,n.node={},n.formatPrefix="link",n.dataLabelOnNull=!0,r&&(n.fromNode=r.node.parentNode.point,n.visible=r.visible,n.toNode=r,n.id=n.toNode.id+"-"+n.fromNode.id),n}return A(e,t),e.prototype.update=function(t,e,i,o){var r={id:this.id,formatPrefix:this.formatPrefix};w().prototype.update.call(this,t,!this.isLink&&e,i,o),this.visible=this.toNode.visible,(0,y.extend)(this,r),(0,y.pick)(e,!0)&&this.series.chart.redraw(i)},e}(x().seriesTypes.column.prototype.pointClass),R=function(){function t(){}return t.createDummyNode=function(t,e,i){var o=new O;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},t.prototype.calculatePositions=function(t){var e=t.nodeList;this.resetValues(e);var i=t.tree;i&&(this.calculateRelativeX(i,0),this.beforeLayout(e),this.firstWalk(i),this.secondWalk(i,-i.preX),this.afterLayout(e))},t.prototype.beforeLayout=function(e){for(var i=0;i<e.length;i++)for(var o=e[i],r=0,n=o.children;r<n.length;r++){var s=n[r];if(s&&s.level-o.level>1)for(var a=s.level-o.level-1;a>0;)s=t.createDummyNode(o,s,a),a--}},t.prototype.resetValues=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.mod=0,i.ancestor=i,i.shift=0,i.thread=void 0,i.change=0,i.preX=0}},t.prototype.calculateRelativeX=function(t,e){for(var i=t.children,o=0,r=i.length;o<r;++o)this.calculateRelativeX(i[o],o);t.relativeXPosition=e},t.prototype.firstWalk=function(t){var e;if(t.hasChildren()){for(var i=t.getLeftMostChild(),o=0,r=t.children;o<r.length;o++){var n=r[o];this.firstWalk(n),i=this.apportion(n,i)}this.executeShifts(t);var s=t.getLeftMostChild(),a=t.getRightMostChild(),l=(s.preX+a.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},t.prototype.secondWalk=function(t,e){var i,o;t.yPosition=t.preX+e,t.xPosition=null!=(o=null==(i=t.point)?void 0:i.x)?o:t.level;for(var r=0,n=t.children;r<n.length;r++){var s=n[r];this.secondWalk(s,e+t.mod)}},t.prototype.executeShifts=function(t){for(var e=0,i=0,o=t.children.length-1;o>=0;o--){var r=t.children[o];r.preX+=e,r.mod+=e,i+=r.change,e+=r.shift+i}},t.prototype.apportion=function(t,e){var i=t.getLeftSibling();if(i){for(var o=t,r=t,n=i,s=o.getLeftMostSibling(),a=o.mod,l=r.mod,h=n.mod,p=s.mod;n&&n.nextRight()&&o&&o.nextLeft();){n=n.nextRight(),s=s.nextLeft(),o=o.nextLeft(),(r=r.nextRight()).ancestor=t;var d=n.preX+h-(o.preX+a)+1;d>0&&(this.moveSubtree(t.getAncestor(n,e),t,d),a+=d,l+=d),h+=n.mod,a+=o.mod,p+=s.mod,l+=r.mod}n&&n.nextRight()&&!r.nextRight()&&(r.thread=n.nextRight(),r.mod+=h-l),o&&o.nextLeft()&&!s.nextLeft()&&(s.thread=o.nextLeft(),s.mod+=a-p),e=t}return e},t.prototype.moveSubtree=function(t,e,i){var o=e.relativeXPosition-t.relativeXPosition;e.change-=i/o,e.shift+=i,e.preX+=i,e.mod+=i,t.change+=i/o},t.prototype.afterLayout=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.oldParentNode&&(i.relativeXPosition=i.parentNode.relativeXPosition,i.parent=i.oldParentNode.parent,i.parentNode=i.oldParentNode,i.oldParentNode.children.splice(i.relativeXPosition,1,i),i.oldParentNode=void 0)}},t}(),H={reversed:!1,marker:{radius:10,lineWidth:0,symbol:"circle",fillOpacity:1,states:{}},link:{color:"var(--highcharts-neutral-color-60)",cursor:"default",lineWidth:1,radius:10,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:function(){return""},pointFormat:void 0,padding:5,style:{textOverflow:"none"}},nodeDistance:30,nodeWidth:void 0},j=f(28),E=f.n(j),W=g().composed,V=g().deg2rad,z=(h=function(t,e){return(h=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}h(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),D={default:b,orthogonal:b,straight:function(t){var e=t.x1,i=t.y1,o=t.x2,r=t.y2,n=t.width,s=t.inverted;return t.parentVisible?[["M",e,i],["L",e+(void 0===n?0:n)*(void 0!==s&&s?-1:1),r],["L",o,r]]:[["M",e,i],["L",e,r],["L",e,r]]},curved:function(t){var e=t.x1,i=t.y1,o=t.x2,r=t.y2,n=t.offset,s=void 0===n?0:n,a=t.width,l=void 0===a?0:a,h=t.inverted,p=void 0!==h&&h;return t.parentVisible?[["M",e,i],["C",e+s,i,e-s+l*(p?-1:1),r,e+l*(p?-1:1),r],["L",o,r]]:[["M",e,i],["C",e,i,e,r,e,r],["L",o,r]]}},I=x().series.prototype,Y=x().seriesTypes,G=Y.treemap,F=Y.column,q=P().prototype.symbols;p=E(),(0,y.pushUnique)(W,"TextPath")&&((0,y.addEvent)(p,"afterGetBBox",function(t){var e,i=t.bBox,o=null==(e=this.element)?void 0:e.querySelector("textPath");if(o){for(var r=[],n=this.renderer.fontMetrics(this.element),s=n.b,a=n.h-s,l=RegExp('(<tspan>|<tspan(?!\\sclass="highcharts-br")[^>]*>|<\\/tspan>)',"g"),h=o.innerHTML.replace(l,"").split(/<tspan class="highcharts-br"[^>]*>/),p=h.length,d=function(t,e){var i=e.x,r=e.y,n=(o.getRotationOfChar(t)-90)*V,l=Math.cos(n),h=Math.sin(n);return[[i-a*l,r-a*h],[i+s*l,r+s*h]]},c=0,u=0;u<p;u++){for(var f=h[u].length,v=0;v<f;v+=5)try{var y=c+v+u,g=d(y,o.getStartPositionOfChar(y)),b=g[0],m=g[1];0===v?(r.push(m),r.push(b)):(0===u&&r.unshift(m),u===p-1&&r.push(b))}catch(t){break}c+=f-1;try{var y=c+u,x=o.getEndPositionOfChar(y),k=d(y,x),b=k[0],m=k[1];r.unshift(m),r.unshift(b)}catch(t){break}}r.length&&r.push(r[0].slice()),i.polygon=r}return i}),(0,y.addEvent)(p,"beforeAddingDataLabel",function(t){var e,i=t.labelOptions,o=t.point,r=i[o.formatPrefix+"TextPath"]||i.textPath;r&&!i.useHTML&&(this.setTextPath((null==(e=o.getDataLabelPath)?void 0:e.call(o,this))||o.graphic,r),o.dataLabelPath&&!r.enabled&&(o.dataLabelPath=o.dataLabelPath.destroy()))}),p.prototype.setTextPath=null!=(d=p.prototype.setTextPath)?d:function(t,e){var i=this,o=this.renderer.url,r=this.text||this,n=r.textPath,s=(0,y.merge)({enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e),a=s.attributes,l=s.enabled;if(t=t||n&&n.path,null==n||n.undo(),t&&l){var h=(0,y.addEvent)(r,"afterModifyTree",function(e){if(t&&l){var n=t.attr("id");n||t.attr("id",n=(0,y.uniqueKey)());var s={x:0,y:0};(0,y.defined)(a.dx)&&(s.dx=a.dx,delete a.dx),(0,y.defined)(a.dy)&&(s.dy=a.dy,delete a.dy),r.attr(s),i.attr({transform:""}),i.box&&(i.box=i.box.destroy());var h=e.nodes.slice(0);e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:(0,y.extend)(a,{"text-anchor":a.textAnchor,href:""+o+"#".concat(n)}),children:h}}});r.textPath={path:t,undo:h}}else r.attr({dx:0,dy:0}),delete r.textPath;return this.added&&(r.textCache="",this.renderer.buildText(r)),this});var U=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.nodeList=[],e.links=[],e}return z(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.layoutAlgorithm=new R;var e=this,i=this.chart.labelCollectors;i.some(function(t){return"collectorFunc"===t.name})||i.push(function(){var t=[];if(e.options.dataLabels&&!(0,y.splat)(e.options.dataLabels)[0].allowOverlap)for(var i=0,o=e.links||[];i<o.length;i++){var r=o[i];r.dataLabel&&t.push(r.dataLabel)}return t})},e.prototype.getLayoutModifiers=function(){var t,e=this,i=this.chart,o=this,r=i.plotSizeX,n=i.plotSizeY,s=(null==(t=o.options.link)?void 0:t.lineWidth)||0,a=(0,y.arrayMax)(this.points.map(function(t){return t.node.xPosition})),l=1/0,h=-1/0,p=1/0,d=-1/0,c=0,u=0,f=0,v=0;this.points.forEach(function(t){if(!e.options.fillSpace||t.visible){var i,g=t.node,b=o.mapOptionsToLevel[t.node.level]||{},m=(0,y.merge)(e.options.marker,b.marker,t.options.marker),x=null!=(i=m.width)?i:X(e,a),k=(0,y.relativeLength)(m.radius||0,Math.min(r,n)),P=Math.max(m.lineWidth||0,s),L=m.symbol,O="circle"!==L&&m.height?(0,y.relativeLength)(m.height,n):2*k,C="circle"!==L&&x?(0,y.relativeLength)(x,r):2*k;g.nodeSizeX=C,g.nodeSizeY=O,g.xPosition<=l&&(l=g.xPosition,u=Math.max(C+P,u)),g.xPosition>=h&&(h=g.xPosition,c=Math.max(C+P,c)),g.yPosition<=p&&(p=g.yPosition,v=Math.max(O+P,v)),g.yPosition>=d&&(d=g.yPosition,f=Math.max(O+P,f))}});var g=d===p?1:(n-(v+f)/2)/(d-p),b=d===p?n/2:-g*p+v/2,m=h===l?1:(r-(c+c)/2)/(h-l),x=h===l?r/2:-m*l+u/2;return{ax:m,bx:x,ay:g,by:b}},e.prototype.getLinks=function(){var t=this,e=this,i=[];return this.data.forEach(function(o){var r,n=e.mapOptionsToLevel[null!=(r=o.node.level)?r:0]||{};if(o.node.parent){var s=(0,y.merge)(n,o.options);if(!o.linkToParent||o.linkToParent.condemned){var a=new e.LinkClass(e,s,void 0,o);o.linkToParent=a}else o.collapsed=(0,y.pick)(o.collapsed,(t.mapOptionsToLevel[o.node.level]||{}).collapsed),o.linkToParent.visible=o.linkToParent.toNode.visible;o.linkToParent.index=i.push(o.linkToParent)-1}else o.linkToParent&&(e.links.splice(o.linkToParent.index),o.linkToParent.destroy(),delete o.linkToParent)}),i},e.prototype.buildTree=function(e,i,o,r,n){var s,a=this.points[i];return o=null!=(s=null==a?void 0:a.level)?s:o,t.prototype.buildTree.call(this,e,i,o,r,n)},e.prototype.markerAttribs=function(){return{}},e.prototype.setCollapsedStatus=function(t,e){var i=this,o=t.point;o&&(o.collapsed=(0,y.pick)(o.collapsed,(this.mapOptionsToLevel[t.level]||{}).collapsed),o.visible=e,e=!1!==e&&!o.collapsed),t.children.forEach(function(t){i.setCollapsedStatus(t,e)})},e.prototype.drawTracker=function(){F.prototype.drawTracker.apply(this,arguments),F.prototype.drawTracker.call(this,this.links)},e.prototype.translate=function(){var t,e=this,i=this.options,o=N(this);I.translate.call(this);var r=this.tree=this.getTree();t=this.nodeMap[o],""===o||t&&t.children.length||(this.setRootNode("",!1),o=this.rootNode,t=this.nodeMap[o]),this.mapOptionsToLevel=S({from:t.level+1,levels:i.levels,to:r.height,defaults:{levelIsConstant:this.options.levelIsConstant,colorByPoint:i.colorByPoint}}),this.setCollapsedStatus(r,!0),this.links=this.getLinks(),this.setTreeValues(r),this.layoutAlgorithm.calculatePositions(this),this.layoutModifier=this.getLayoutModifiers(),this.points.forEach(function(t){e.translateNode(t)}),this.points.forEach(function(t){t.linkToParent&&e.translateLink(t.linkToParent)}),i.colorByPoint||this.setColorRecursive(this.tree)},e.prototype.translateLink=function(t){var e,i,o,r,n,s,a,l,h,p=t.fromNode,d=t.toNode,c=(null==(e=this.options.link)?void 0:e.lineWidth)||0,u=(0,y.pick)(null==(i=this.options.link)?void 0:i.curveFactor,.5),f=d.x!==d.node.level||p.x!==p.node.level,v=(0,y.pick)(null==(o=t.options.link)?void 0:o.type,null==(r=this.options.link)?void 0:r.type,"default");if(p.shapeArgs&&d.shapeArgs){var g=p.shapeArgs.width||0,b=this.chart.inverted,m=(0,y.crisp)((p.shapeArgs.y||0)+(p.shapeArgs.height||0)/2,c),x=(0,y.crisp)((d.shapeArgs.y||0)+(d.shapeArgs.height||0)/2,c),k=(0,y.crisp)((p.shapeArgs.x||0)+g,c),P=(0,y.crisp)(d.shapeArgs.x||0,c);b&&(k-=Math.round(g),P+=Math.round(d.shapeArgs.width||0));var L=d.node.xPosition-p.node.xPosition,O=Math.abs(P-k)+g,C=(f?O:O/L)-g,w=(0,y.crisp)((P+k)/2,c),T=(0,y.relativeLength)(null!=(l=null!=(s=null==(n=t.options.link)?void 0:n.bendAt)?s:null==(a=this.options.link)?void 0:a.bendAt)?l:"50%",O-g);t.shapeType="path",t.plotX=w,t.plotY=x,t.shapeArgs={d:D[v]({x1:k,y1:m,x2:P,y2:x,width:C,offset:C*u*(b?-1:1),inverted:b,parentVisible:d.visible,radius:null==(h=this.options.link)?void 0:h.radius,bendAt:T})},t.dlBox={x:(k+P)/2,y:(m+x)/2,height:c,width:0},t.tooltipPos=b?[(this.chart.plotSizeY||0)-t.dlBox.y,(this.chart.plotSizeX||0)-t.dlBox.x]:[t.dlBox.x,t.dlBox.y]}},e.prototype.drawNodeLabels=function(t){for(var e,i,o,r,n,s,a=this.mapOptionsToLevel,l=0;l<t.length;l++){var h=t[l];if(s=a[h.node.level],n={style:{}},s&&s.dataLabels&&(n=(0,y.merge)(n,s.dataLabels),this.hasDataLabels=function(){return!0}),h.shapeArgs&&this.options.dataLabels){var p={},d=h.shapeArgs,c=d.width,u=void 0===c?0:c,f=d.height,v=void 0===f?0:f;this.chart.inverted&&(u=(e=[v,u])[0],v=e[1]),(null==(i=(0,y.splat)(this.options.dataLabels)[0].style)?void 0:i.width)||(p.width=""+u+"px"),(null==(o=(0,y.splat)(this.options.dataLabels)[0].style)?void 0:o.lineClamp)||(p.lineClamp=Math.floor(v/16)),(0,y.extend)(n.style,p),null==(r=h.dataLabel)||r.css(p)}h.dlOptions=(0,y.merge)(n,h.options.dataLabels)}I.drawDataLabels.call(this,t)},e.prototype.alignDataLabel=function(e,i){var o=e.visible;e.visible=!0,t.prototype.alignDataLabel.apply(this,arguments),i.animate({opacity:+(!1!==o)},void 0,function(){o||i.hide()}),e.visible=o},e.prototype.drawDataLabels=function(){this.options.dataLabels&&(this.options.dataLabels=(0,y.splat)(this.options.dataLabels),this.drawNodeLabels(this.points),I.drawDataLabels.call(this,this.links))},e.prototype.destroy=function(){if(this.links){for(var t=0,e=this.links;t<e.length;t++)e[t].destroy();this.links.length=0}return I.destroy.apply(this,arguments)},e.prototype.pointAttribs=function(t,e){var i,o=t&&this.mapOptionsToLevel[null!=(i=t.node.level)?i:0]||{},r=t&&t.options,n=o.states&&o.states[e]||{};t&&(t.options.marker=(0,y.merge)(this.options.marker,o.marker,t.options.marker));var s=(0,y.pick)(n&&n.link&&n.link.color,r&&r.link&&r.link.color,o&&o.link&&o.link.color,this.options.link&&this.options.link.color),a=(0,y.pick)(n&&n.link&&n.link.lineWidth,r&&r.link&&r.link.lineWidth,o&&o.link&&o.link.lineWidth,this.options.link&&this.options.link.lineWidth),l=I.pointAttribs.call(this,t,e);return t&&(t.isLink&&(l.stroke=s,l["stroke-width"]=a,delete l.fill),t.visible||(l.opacity=0)),l},e.prototype.drawPoints=function(){G.prototype.drawPoints.apply(this,arguments),F.prototype.drawPoints.call(this,this.links)},e.prototype.translateNode=function(t){var e=this.chart,i=t.node,o=t.plotX,r=void 0===o?0:o,n=e.plotSizeY,s=e.plotSizeX,a=this.layoutModifier,l=a.ax,h=a.bx,p=a.ay,d=a.by,c=this.isCartesian?e.inverted?s-r:r:l*i.xPosition+h,u=p*i.yPosition+d,f=this.mapOptionsToLevel[i.level]||{},v=(0,y.merge)(this.options.marker,f.marker,t.options.marker).symbol,g=i.nodeSizeY,b=i.nodeSizeX,m=this.options.reversed,x=i.x=e.inverted?s-b/2-c:c-b/2,k=i.y=m?u-g/2:n-u-g/2,P=(0,y.pick)(t.options.borderRadius,f.borderRadius,this.options.borderRadius),L=q[v||"circle"];if(void 0===L?(t.hasImage=!0,t.shapeType="image",t.imageUrl=v.match(/^url\((.*?)\)$/)[1]):t.shapeType="path",!t.visible&&t.linkToParent){var O=t.linkToParent.fromNode;if(O){var C=O.shapeArgs||{},w=C.x,T=void 0===w?0:w,M=C.y,_=void 0===M?0:M,S=C.width,X=C.height;t.shapeArgs||(t.shapeArgs={}),t.hasImage||(0,y.extend)(t.shapeArgs,{d:L(T,_,void 0===S?0:S,void 0===X?0:X,P?{r:P}:void 0)}),(0,y.extend)(t.shapeArgs,{x:T,y:_}),t.plotX=O.plotX,t.plotY=O.plotY}}else t.plotX=x,t.plotY=k,t.shapeArgs={x:x,y:k,width:b,height:g,cursor:t.node.isLeaf?"default":"pointer"},t.hasImage||(t.shapeArgs.d=L(x,k,b,g,P?{r:P}:void 0));t.tooltipPos=e.inverted?[n-k-g/2,s-x-b/2]:[x+b/2,k]},e.defaultOptions=(0,y.merge)(G.defaultOptions,H),e}(G);(0,y.extend)(U.prototype,{forceDL:!0,pointClass:M,NodeClass:O,LinkClass:B,isCartesian:!1}),x().registerSeriesType("treegraph",U);var $=g();return v.default}()});