!/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module modules/arc-diagram
 * @requires highcharts/modules/sankey
 *
 * Arc diagram module
 *
 * (c) 2021-2026 Highsoft AS
 * Author: Piotr Madej
 *
 * 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.Series,t._Highcharts.SVGRenderer,t._Highcharts.SVGElement):"function"==typeof define&&define.amd?define("highcharts/modules/arc-diagram",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry,t.Series,t.SVGRenderer,t.SVGElement)}):"object"==typeof exports?exports["highcharts/modules/arc-diagram"]=e(t._Highcharts,t._Highcharts.SeriesRegistry,t._Highcharts.Series,t._Highcharts.SVGRenderer,t._Highcharts.SVGElement):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry,t.Highcharts.Series,t.Highcharts.SVGRenderer,t.Highcharts.SVGElement)}("u"<typeof window?this:window,function(t,e,o,n,i){return function(){"use strict";var r,s,a,h,l,p,d,c,u={28:function(t){t.exports=i},512:function(t){t.exports=e},540:function(t){t.exports=n},820:function(t){t.exports=o},944:function(e){e.exports=t}},f={};function g(t){var e=f[t];if(void 0!==e)return e.exports;var o=f[t]={exports:{}};return u[t](o,o.exports,g),o.exports}g.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return g.d(e,{a:e}),e},g.d=function(t,e){for(var o in e)g.o(e,o)&&!g.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},g.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var m={};g.d(m,{default:function(){return G}});var y=g(944),v=g.n(y),x=g(512),k=g.n(x),b=k().series,S=b.prototype,P=b.prototype.pointClass.prototype;!function(t){function e(){var t;if(!(null==(t=this.hasDataLabels)?void 0:t.call(this))&&this.nodes)for(var e=0,o=this.nodes;e<o.length;e++)o[e].destroyElements({dataLabel:1})}function o(){return this.data=[].concat(this.points||[],this.nodes),S.destroy.apply(this,arguments)}function n(){this.nodes&&(this.nodes.forEach(function(t){t.destroy()}),this.nodes.length=0),S.setData.apply(this,arguments)}function i(t){var e=arguments,o=this.isNode?this.linksTo.concat(this.linksFrom):[this.fromNode,this.toNode];"select"!==t&&o.forEach(function(t){t&&t.series&&(P.setState.apply(t,e),!t.isNode&&(t.fromNode.graphic&&P.setState.apply(t.fromNode,e),t.toNode&&t.toNode.graphic&&P.setState.apply(t.toNode,e)))}),P.setState.apply(this,e)}function r(t,e,o,n){var i=this,r=this.series.options.nodes,s=this.series.options.data,a=(null==s?void 0:s.length)||0,h=null==s?void 0:s[this.index];if(P.update.call(this,t,!this.isNode&&e,o,n),this.isNode){var l=(r||[]).reduce(function(t,e,o){return i.id===e.id?o:t},-1),p=(0,y.merge)(r&&r[l]||{},(null==s?void 0:s[this.index])||{});s&&(h?s[this.index]=h:s.length=a),r?l>=0?r[l]=p:r.push(p):this.series.options.nodes=[p],(0,y.pick)(e,!0)&&this.series.chart.redraw(o)}}t.compose=function(t,s){var a=t.prototype,h=s.prototype;return a.setNodeState=i,a.setState=i,a.update=r,h.destroy=o,h.setData=n,(0,y.addEvent)(s,"afterUpdate",e),s},t.createNode=function(t){var e,o=this.pointClass,n=function(t,e){return(0,y.find)(t,function(t){return t.id===e})},i=n(this.nodes,t);if(!i){e=this.options.nodes&&n(this.options.nodes,t);var r=new o(this,(0,y.extend)({className:"highcharts-node",isNode:!0,id:t,y:1},e));r.linksTo=[],r.linksFrom=[],r.getSum=function(){var t=0,e=0;return r.linksTo.forEach(function(e){t+=e.weight||0}),r.linksFrom.forEach(function(t){e+=t.weight||0}),Math.max(t,e)},r.offset=function(t,e){for(var o=0,n=0;n<r[e].length;n++){if(r[e][n]===t)return o;o+=r[e][n].weight}},r.hasShape=function(){var t=0;return r.linksTo.forEach(function(e){e.outgoing&&t++}),!r.linksTo.length||t!==r.linksTo.length},r.index=this.nodes.push(r)-1,i=r}return i.formatPrefix="node",i.name=i.name||i.options.id||"",i.mass=(0,y.pick)(i.options.mass,i.options.marker&&i.options.marker.radius,this.options.marker&&this.options.marker.radius,4),i},t.destroy=o,t.generatePoints=function(){var t=this,e=this.chart,o={};S.generatePoints.call(this),this.nodes||(this.nodes=[]),this.colorCounter=0,this.nodes.forEach(function(t){t.linksFrom.length=0,t.linksTo.length=0,t.level=t.options.level}),this.points.forEach(function(n){(0,y.defined)(n.from)&&(o[n.from]||(o[n.from]=t.createNode(n.from)),o[n.from].linksFrom.push(n),n.fromNode=o[n.from],e.styledMode?n.colorIndex=(0,y.pick)(n.options.colorIndex,o[n.from].colorIndex):n.color=n.options.color||o[n.from].color),(0,y.defined)(n.to)&&(o[n.to]||(o[n.to]=t.createNode(n.to)),o[n.to].linksTo.push(n),n.toNode=o[n.to]),n.name=n.name||n.id},this),this.nodeLookup=o},t.setNodeState=i,t.updateNode=r}(d||(d={}));var L=d,O=(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return O(e,t),e.prototype.isValid=function(){return!0},e}(k().seriesTypes.sankey.prototype.pointClass);(0,y.extend)(N.prototype,{setState:L.setNodeState});var T={centeredLinks:!1,equalNodes:!1,dataLabels:{linkTextPath:{attributes:{startOffset:"25%"}}},marker:{fillOpacity:1,lineWidth:0,states:{},symbol:"circle"},offset:"100%",reversed:!1};(s=c||(c={})).compose=function(t,e){return t.sankeyColumn=new a(t,e),t},s.SankeyColumnAdditions=a=function(){function t(t,e){this.points=t,this.series=e}return t.prototype.getTranslationFactor=function(t){for(var e,o,n=this.points,i=n.slice(),r=t.chart,s=t.options.minLinkWidth||0,a=0,h=(r.plotSizeY||0)-(t.options.borderWidth||0)-(n.length-1)*t.nodePadding;n.length;){for(a=h/n.sankeyColumn.sum(),e=!1,o=n.length;o--;)n[o].getSum()*a<s&&(n.splice(o,1),h=Math.max(0,h-s),e=!0);if(!e)break}n.length=0;for(var l=0;l<i.length;l++){var p=i[l];n.push(p)}return a},t.prototype.top=function(t){var e=this.series,o=e.nodePadding,n=this.points.reduce(function(n,i){return n>0&&(n+=o),n+=Math.max(i.getSum()*t,e.options.minLinkWidth||0)},0);return(0,y.getAlignFactor)(e.options.nodeAlignment||"center")*((e.chart.plotSizeY||0)-n)},t.prototype.left=function(t){var e=this.series,o=e.chart,n=e.options.equalNodes,i=o.inverted?o.plotHeight:o.plotWidth,r=e.nodePadding,s=this.points.reduce(function(o,s){return o>0&&(o+=r),o+=n?i/s.series.nodes.length-r:Math.max(s.getSum()*t,e.options.minLinkWidth||0)},0);return((o.plotSizeX||0)-Math.round(s))/2},t.prototype.sum=function(){return this.points.reduce(function(t,e){return t+e.getSum()},0)},t.prototype.offset=function(t,e){var o,n=this.points,i=this.series,r=i.nodePadding,s=0;if(i.is("organization")&&t.hangsFrom)return{absoluteTop:t.hangsFrom.nodeY};for(var a=0;a<n.length;a++){var h=n[a].getSum(),l=Math.max(h*e,i.options.minLinkWidth||0),p=t.options[i.chart.inverted?"offsetHorizontal":"offsetVertical"],d=t.options.offset||0;if(o=h?l+r:0,n[a]===t)return{relativeTop:s+((0,y.defined)(p)?(0,y.relativeLength)(p,l):(0,y.relativeLength)(d,o))};s+=o}},t}();var _=c,w=g(820),C=g.n(w),M=g(540),H=g.n(M),E=g(28),W=g.n(E),A=v().composed,j=v().deg2rad,z=(h=function(t,e){return(h=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(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 o(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),F=function(){return(F=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},R=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(o[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)0>e.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(o[n[i]]=t[n[i]]);return o};l=W(),(0,y.pushUnique)(A,"TextPath")&&((0,y.addEvent)(l,"afterGetBBox",function(t){var e,o=t.bBox,n=null==(e=this.element)?void 0:e.querySelector("textPath");if(n){for(var i=[],r=this.renderer.fontMetrics(this.element),s=r.b,a=r.h-s,h=RegExp('(<tspan>|<tspan(?!\\sclass="highcharts-br")[^>]*>|<\\/tspan>)',"g"),l=n.innerHTML.replace(h,"").split(/<tspan class="highcharts-br"[^>]*>/),p=l.length,d=function(t,e){var o=e.x,i=e.y,r=(n.getRotationOfChar(t)-90)*j,h=Math.cos(r),l=Math.sin(r);return[[o-a*h,i-a*l],[o+s*h,i+s*l]]},c=0,u=0;u<p;u++){for(var f=l[u].length,g=0;g<f;g+=5)try{var m=c+g+u,y=d(m,n.getStartPositionOfChar(m)),v=y[0],x=y[1];0===g?(i.push(x),i.push(v)):(0===u&&i.unshift(x),u===p-1&&i.push(v))}catch(t){break}c+=f-1;try{var m=c+u,k=n.getEndPositionOfChar(m),b=d(m,k),v=b[0],x=b[1];i.unshift(x),i.unshift(v)}catch(t){break}}i.length&&i.push(i[0].slice()),o.polygon=i}return o}),(0,y.addEvent)(l,"beforeAddingDataLabel",function(t){var e,o=t.labelOptions,n=t.point,i=o[n.formatPrefix+"TextPath"]||o.textPath;i&&!o.useHTML&&(this.setTextPath((null==(e=n.getDataLabelPath)?void 0:e.call(n,this))||n.graphic,i),n.dataLabelPath&&!i.enabled&&(n.dataLabelPath=n.dataLabelPath.destroy()))}),l.prototype.setTextPath=null!=(p=l.prototype.setTextPath)?p:function(t,e){var o=this,n=this.renderer.url,i=this.text||this,r=i.textPath,s=(0,y.merge)({enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e),a=s.attributes,h=s.enabled;if(t=t||r&&r.path,null==r||r.undo(),t&&h){var l=(0,y.addEvent)(i,"afterModifyTree",function(e){if(t&&h){var r=t.attr("id");r||t.attr("id",r=(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),i.attr(s),o.attr({transform:""}),o.box&&(o.box=o.box.destroy());var l=e.nodes.slice(0);e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:(0,y.extend)(a,{"text-anchor":a.textAnchor,href:""+n+"#".concat(r)}),children:l}}});i.textPath={path:t,undo:l}}else i.attr({dx:0,dy:0}),delete i.textPath;return this.added&&(i.textCache="",this.renderer.buildText(i)),this});var Y=H().prototype.symbols,X=k().seriesTypes,B=X.column,D=X.sankey,V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return z(e,t),e.prototype.createNodeColumns=function(){var t=this,e=this,o=e.chart,n=_.compose([],e);return n.sankeyColumn.maxLength=o.inverted?o.plotHeight:o.plotWidth,n.sankeyColumn.getTranslationFactor=function(e){for(var i,r,s,a=n.slice(),h=t.options.minLinkWidth||0,l=0,p=0,d=1,c=0,u=(o.plotSizeX||0)-(e.options.marker&&e.options.marker.lineWidth||0)-(n.length-1)*e.nodePadding;n.length;){for(l=u/n.sankeyColumn.sum(),i=!1,r=n.length;r--;){s=n[r].getSum()*l*d;var f=Math.min(o.plotHeight,o.plotWidth);s>f?d=Math.min(f/s,d):s<h&&(n.splice(r,1),u-=h,s=h,i=!0),c+=s*(1-d)/2,p=Math.max(p,s)}if(!i)break}return n.length=0,a.forEach(function(t){t.scale=d,n.push(t)}),n.sankeyColumn.maxRadius=p,n.sankeyColumn.scale=d,n.sankeyColumn.additionalSpace=c,l},n.sankeyColumn.offset=function(t,i){for(var r,s=t.series.options.equalNodes,a=e.nodePadding,h=Math.min(o.plotWidth,o.plotHeight,(n.sankeyColumn.maxLength||0)/e.nodes.length-a),l=n.sankeyColumn.additionalSpace||0,p=0;p<n.length;p++){var d=n[p].getSum()*(n.sankeyColumn.scale||0),c=s?h:Math.max(d*i,e.options.minLinkWidth||0);if(r=d?c+a:0,n[p]===t)return{relativeLeft:l+(0,y.relativeLength)(t.options.offset||0,r)};l+=r}},e.nodes.forEach(function(t){t.column=0,n.push(t)}),[n]},e.prototype.translateLink=function(t){var e,o,n=t.fromNode,i=t.toNode,r=this.chart,s=this.translationFactor,a=t.options,h=this.options,l=(0,y.pick)(a.linkWeight,h.linkWeight,Math.max((t.weight||0)*s*n.scale,this.options.minLinkWidth||0)),p=t.series.options.centeredLinks,d=n.nodeY,c=function(e,o){var n=(e.offset(t,o)||0)*s;return Math.min(e.nodeX+n,e.nodeX+(e.shapeArgs&&e.shapeArgs.height||0)-l)},u=p?n.nodeX+((n.shapeArgs.height||0)-l)/2:c(n,"linksFrom"),f=p?i.nodeX+((i.shapeArgs.height||0)-l)/2:c(i,"linksTo"),g=d;u>f&&(u=(e=[f,u])[0],f=e[1]),h.reversed&&(u=(o=[f,u])[0],f=o[1],g=(r.plotSizeY||0)-g),t.shapeType="path",t.linkBase=[u,u+l,f,f+l];var m=(f+l-u)/Math.abs(f+l-u)*(0,y.pick)(h.linkRadius,Math.min(Math.abs(f+l-u)/2,n.nodeY-Math.abs(l)));t.shapeArgs={d:[["M",u,g],["A",(f+l-u)/2,m,0,0,1,f+l,g],["L",f,g],["A",(f-u-l)/2,m-l,0,0,0,u+l,g],["Z"]]},t.dlBox={x:u+(f-u)/2,y:g-m,height:l,width:0},t.tooltipPos=r.inverted?[(r.plotSizeY||0)-t.dlBox.y-l/2,(r.plotSizeX||0)-t.dlBox.x]:[t.dlBox.x,t.dlBox.y+l/2],t.y=t.plotY=1,t.x=t.plotX=1,t.color||(t.color=n.color)},e.prototype.translateNode=function(t,e){var o,n,i=this.translationFactor,r=this.chart,s=r.inverted?r.plotWidth:r.plotHeight,a=this.options,h=Math.min(r.plotWidth,r.plotHeight,s/t.series.nodes.length-this.nodePadding),l=t.getSum()*(e.sankeyColumn.scale||0),p=a.equalNodes?h:Math.max(l*i,this.options.minLinkWidth||0),d=(null==(o=a.marker)?void 0:o.lineWidth)||0,c=e.sankeyColumn.offset(t,i),u=(0,y.crisp)((0,y.pick)(c&&c.absoluteLeft,(e.sankeyColumn.left(i)||0)+(c&&c.relativeLeft||0)),d),f=(0,y.merge)(a.marker,t.options.marker),g=f.symbol,m=f.radius,v=parseInt(null!=(n=a.offset)?n:"100",10)*((r.inverted?r.plotWidth:r.plotHeight)-((0,y.crisp)(this.colDistance*(t.column||0)+(f.lineWidth||0)/2,d)+(e.sankeyColumn.scale||0)*(e.sankeyColumn.maxRadius||0)/2))/100;if(t.sum=l,l){t.nodeX=u,t.nodeY=v;var x=t.options.width||a.width||p,k=t.options.height||a.height||p,b=v;a.reversed&&(b=(r.plotSizeY||0)-v,r.inverted&&(b=(r.plotSizeY||0)-v)),this.mapOptionsToLevel&&(t.dlOptions=F(F({},D.getDLOptions({level:this.mapOptionsToLevel[t.level],optionsPoint:t.options})),{zIndex:void 0}),delete t.dlOptions.zIndex),t.plotX=1,t.plotY=1,t.tooltipPos=r.inverted?[(r.plotSizeY||0)-b-k/2,(r.plotSizeX||0)-u-x/2]:[u+x/2,b+k/2],t.shapeType="path",t.shapeArgs={d:Y[g||"circle"](u,b-(m||k)/2,m||x,m||k),width:m||x,height:m||k},t.dlBox={x:u+x/2,y:b,height:0,width:0}}else t.dlOptions={enabled:!1}},e.prototype.drawDataLabels=function(){if(this.options.dataLabels){var t=this.options.dataLabels.textPath;B.prototype.drawDataLabels.call(this,this.nodes),this.options.dataLabels.textPath=this.options.dataLabels.linkTextPath,B.prototype.drawDataLabels.call(this,this.data),this.options.dataLabels.textPath=t}},e.prototype.pointAttribs=function(e,o){if(e&&e.isNode){var n=R(C().prototype.pointAttribs.apply(this,arguments),[]);return n}return t.prototype.pointAttribs.apply(this,arguments)},e.prototype.markerAttribs=function(e){return e.isNode?t.prototype.markerAttribs.apply(this,arguments):{}},e.defaultOptions=(0,y.merge)(D.defaultOptions,T),e}(D);(0,y.extend)(V.prototype,{orderNodes:!1}),V.prototype.pointClass=N,k().registerSeriesType("arcdiagram",V);var G=v();return m.default}()});