!/**
 * Highcharts JS v12.5.0 (2026-01-12)
 * @module highcharts/modules/venn
 * @requires highcharts
 *
 * (c) 2017-2026 Highsoft AS
 * Authors: Jon Arild Nygard
 *
 * 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(require("highcharts"),require("highcharts").Color,require("highcharts").SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/modules/venn",[["highcharts/highcharts"],["highcharts/highcharts","Color"],["highcharts/highcharts","SeriesRegistry"]],e):"object"==typeof exports?exports["highcharts/modules/venn"]=e(require("highcharts"),require("highcharts").Color,require("highcharts").SeriesRegistry):t.Highcharts=e(t.Highcharts,t.Highcharts.Color,t.Highcharts.SeriesRegistry)}(this,function(t,e,r){return function(){"use strict";var n,i,o,a,s,u={512:function(t){t.exports=r},620:function(t){t.exports=e},944:function(e){e.exports=t}},c={};function l(t){var e=c[t];if(void 0!==e)return e.exports;var r=c[t]={exports:{}};return u[t](r,r.exports,l),r.exports}l.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return l.d(e,{a:e}),e},l.d=function(t,e){for(var r in e)l.o(e,r)&&!l.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},l.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var f={};l.d(f,{default:function(){return tg}});var p=l(944),h=l.n(p),v=l(620),d=l.n(v);(n=a||(a={})).getCenterOfPoints=function(t){var e=t.reduce(function(t,e){return t.x+=e.x,t.y+=e.y,t},{x:0,y:0});return{x:e.x/t.length,y:e.y/t.length}},n.getDistanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},n.getAngleBetweenPoints=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)},n.pointInPolygon=function(t,e){var r,n,i=t.x,o=t.y,a=e.length,s=!1;for(r=0,n=a-1;r<a;n=r++){var u=e[r],c=u[0],l=u[1],f=e[n],p=f[0],h=f[1];l>o!=h>o&&i<(p-c)*(o-l)/(h-l)+c&&(s=!s)}return s};var g=a,y=g.getAngleBetweenPoints,x=g.getCenterOfPoints,m=g.getDistanceBetweenPoints,b=h().correctFloat;!function(t){function e(t,e){var r=Math.pow(10,e);return Math.round(t*r)/r}function r(t){if(t<=0)throw Error("radius of circle must be a positive number.");return b(Math.PI*t*t)}function n(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function i(t,r){var n=m(t,r),i=t.r,o=r.r,a=[];if(n<i+o&&n>Math.abs(i-o)){var s=i*i,u=(s-o*o+n*n)/(2*n),c=Math.sqrt(s-u*u),l=t.x,f=r.x,p=t.y,h=r.y,v=l+u*(f-l)/n,d=p+u*(h-p)/n,g=-(c/n*(h-p)),y=-(c/n*(f-l));a=[{x:e(v+g,14),y:e(d-y,14)},{x:e(v-g,14),y:e(d+y,14)}]}return a}function o(t){return t.reduce(function(t,e,r,n){var o=n.slice(r+1).reduce(function(t,n,o){var a=[r,o+r+1];return t.concat(i(e,n).map(function(t){return t.indexes=a,t}))},[]);return t.concat(o)},[])}function a(t,e){return m(t,e)<=e.r+1e-10}function s(t,e){return!e.some(function(e){return!a(t,e)})}function u(t){return o(t).filter(function(e){return s(e,t)})}t.round=e,t.getAreaOfCircle=r,t.getCircularSegmentArea=n,t.getOverlapBetweenCircles=function(t,i,o){var a=0;if(o<t+i){if(o<=Math.abs(i-t))a=r(t<i?t:i);else{var s=(t*t-i*i+o*o)/(2*o);a=n(t,t-s)+n(i,i-(o-s))}a=e(a,14)}return a},t.getCircleCircleIntersection=i,t.getCirclesIntersectionPoints=o,t.isCircle1CompletelyOverlappingCircle2=function(t,e){return m(t,e)+e.r<t.r+1e-10},t.isPointInsideCircle=a,t.isPointInsideAllCircles=s,t.isPointOutsideAllCircles=function(t,e){return!e.some(function(e){return a(t,e)})},t.getCirclesIntersectionPolygon=u,t.getAreaOfIntersectionBetweenCircles=function(t){var e,r=u(t);if(r.length>1){var n=x(r),i=(r=r.map(function(t){return t.angle=y(n,t),t}).sort(function(t,e){return e.angle-t.angle}))[r.length-1],o=r.reduce(function(e,r){var n=e.startPoint,i=x([n,r]),o=r.indexes.filter(function(t){return n.indexes.indexOf(t)>-1}).reduce(function(e,o){var a=t[o],s=y(a,r),u=y(a,n),c=u-s+(u<s?2*Math.PI:0),l=u-c/2,f=m(i,{x:a.x+a.r*Math.sin(l),y:a.y+a.r*Math.cos(l)}),p=a.r;return f>2*p&&(f=2*p),(!e||e.width>f)&&(e={r:p,largeArc:+(f>p),width:f,x:r.x,y:r.y}),e},null);if(o){var a=o.r;e.arcs.push(["A",a,a,0,o.largeArc,1,o.x,o.y]),e.startPoint=r}return e},{startPoint:i,arcs:[]}).arcs;0===o.length||1===o.length||(o.unshift(["M",i.x,i.y]),e={center:n,d:o})}return e}}(s||(s={}));var O=s,C=function(){return(C=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},A=function(t,e){var r=e.animatableAttribs,n=e.onComplete,i=e.css,o=e.renderer,a=t.series&&t.series.chart.hasRendered?void 0:t.series&&t.series.options.animation,s=t.graphic;if(e.attribs=C(C({},e.attribs),{class:t.getClassName()}),t.shouldDraw())s||(t.graphic=s="text"===e.shapeType?o.text():"image"===e.shapeType?o.image(e.imageUrl||"").attr(e.shapeArgs||{}):o[e.shapeType](e.shapeArgs||{}),s.add(e.group)),i&&s.css(i),s.attr(e.attribs).animate(r,!e.isNew&&a,n);else if(s){var u=function(){t.graphic=s=s&&s.destroy(),"function"==typeof n&&n()};Object.keys(r).length?s.animate(r,void 0,function(){return u()}):u()}},P=l(512),M=l.n(P),w=(i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),j=M().seriesTypes.scatter.prototype.pointClass,_=h().isNumber,I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return w(e,t),e.prototype.isValid=function(){return _(this.value)},e.prototype.shouldDraw=function(){return!!this.shapeArgs},e}(j),S={borderColor:"#cccccc",borderDashStyle:"solid",borderWidth:1,brighten:0,clip:!1,colorByPoint:!0,dataLabels:{enabled:!0,verticalAlign:"middle",formatter:function(){return this.point.name}},inactiveOtherPoints:!0,marker:!1,opacity:.75,showInLegend:!1,legendType:"point",states:{hover:{opacity:1,borderColor:"#333333"},select:{color:"#cccccc",borderColor:"#000000",animation:!1},inactive:{opacity:.075}},tooltip:{pointFormat:"{point.name}: {point.value}"},legendSymbol:"rectangle"},T=function(){return(T=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},E=O.getAreaOfCircle,L=O.getCircleCircleIntersection,B=O.getOverlapBetweenCircles,V=O.isPointInsideAllCircles,N=O.isPointInsideCircle,q=O.isPointOutsideAllCircles,D=g.getDistanceBetweenPoints,X=h().extend,k=h().isArray,F=h().isNumber,U=h().isObject,H=h().isString;function R(t){var e={};return t.filter(function(t){return 2===t.sets.length}).forEach(function(t){t.sets.forEach(function(r,n,i){var o;U(e[r])||(e[r]={totalOverlap:0,overlapping:{}}),e[r]={totalOverlap:(e[r].totalOverlap||0)+t.value,overlapping:T(T({},e[r].overlapping||{}),((o={})[i[1-n]]=t.value,o))}})}),t.filter(G).forEach(function(t){var r=e[t.sets[0]];X(t,r)}),t}function W(t,e,r,n,i){var o,a,s=t(e),u=t(r),c=i||100,l=n||1e-10,f=r-e,p=1;if(e>=r)throw Error("a must be smaller than b.");if(s*u>0)throw Error("f(a) and f(b) must have opposite signs.");if(0===s)o=e;else if(0===u)o=r;else for(;p++<=c&&0!==a&&f>l;)f=(r-e)/2,s*(a=t(o=e+f))>0?e=o:r=o;return o}function Y(t){for(var e=t.slice(0,-1),r=e.length,n=[],i=function(t,e){return t.sum+=e[t.i],t},o=0;o<r;o++)n[o]=e.reduce(i,{sum:0,i:o}).sum/r;return n}function z(t,e,r){var n=t+e;return r<=0?n:E(t<e?t:e)<=r?0:W(function(n){return r-B(t,e,n)},0,n)}function G(t){return k(t.sets)&&1===t.sets.length}function J(t){var e={};return U(t)&&F(t.value)&&t.value>-1&&k(t.sets)&&t.sets.length>0&&!t.sets.some(function(t){var r=!1;return!e[t]&&H(t)?e[t]=!0:r=!0,r})}function K(t,e){return e.reduce(function(e,r){var n=0;if(r.sets.length>1){var i=r.value-function(t){var e=0;if(2===t.length){var r=t[0],n=t[1];e=B(r.r,n.r,D(r,n))}return e}(r.sets.map(function(e){return t[e]}));n=Math.round(i*i*1e11)/1e11}return e+n},0)}function Q(t,e){return void 0!==e.totalOverlap&&void 0!==t.totalOverlap?e.totalOverlap-t.totalOverlap:NaN}var Z={geometry:g,geometryCircles:O,addOverlapToSets:R,getCentroid:Y,getDistanceBetweenCirclesByOverlap:z,getLabelWidth:function(t,e,r){var n=e.reduce(function(t,e){return Math.min(e.r,t)},1/0),i=r.filter(function(e){return!N(t,e)}),o=function(r,n){return W(function(o){var a={x:t.x+n*o,y:t.y};return-(r-o)+(V(a,e)&&q(a,i)?0:Number.MAX_VALUE)},0,r)};return 2*Math.min(o(n,-1),o(n,1))},getMarginFromCircles:function(t,e,r){var n=e.reduce(function(e,r){var n=r.r-D(t,r);return n<=e?n:e},Number.MAX_VALUE);return r.reduce(function(e,r){var n=D(t,r)-r.r;return n<=e?n:e},n)},isSet:G,layoutGreedyVenn:function(t){var e=[],r={};t.filter(function(t){return 1===t.sets.length}).forEach(function(t){r[t.sets[0]]=t.circle={x:Number.MAX_VALUE,y:Number.MAX_VALUE,r:Math.sqrt(t.value/Math.PI)}});var n=function(t,r){var n=t.circle;n&&(n.x=r.x,n.y=r.y),e.push(t)};R(t);var i=t.filter(G).sort(Q);n(i.shift(),{x:0,y:0});for(var o=t.filter(function(t){return 2===t.sets.length}),a=0;a<i.length;a++)!function(t){var i=t.circle;if(i){var a=i.r,s=t.overlapping;n(t,e.reduce(function(t,n,u){var c=n.circle;if(!c||!s)return t;for(var l=s[n.sets[0]],f=z(a,c.r,l),p=[{x:c.x+f,y:c.y},{x:c.x-f,y:c.y},{x:c.x,y:c.y+f},{x:c.x,y:c.y-f}],h=0,v=e.slice(u+1);h<v.length;h++){var d=v[h],g=d.circle,y=s[d.sets[0]];if(g){var x=z(a,g.r,y);p=p.concat(L({x:c.x,y:c.y,r:f},{x:g.x,y:g.y,r:x}))}}for(var m=0,b=p;m<b.length;m++){var O=b[m];i.x=O.x,i.y=O.y;var C=K(r,o);C<t.loss&&(t.loss=C,t.coordinates=O)}return t},{loss:Number.MAX_VALUE,coordinates:void 0}).coordinates)}}(i[a]);return r},loss:K,nelderMead:function(t,e){for(var r=function(t,e){return t.fx-e.fx},n=function(t,e,r,n){return e.map(function(e,i){return t*e+r*n[i]})},i=function(e,r){return r.fx=t(r),e[e.length-1]=r,e},o=function(e){var r=e[0];return e.map(function(e){var i=n(.5,r,.5,e);return i.fx=t(i),i})},a=function(e,r,i,o){var a=n(i,e,o,r);return a.fx=t(a),a},s=function(e){var r=e.length,n=Array(r+1);n[0]=e,n[0].fx=t(e);for(var i=0;i<r;++i){var o=e.slice();o[i]=o[i]?1.05*o[i]:.001,o.fx=t(o),n[i+1]=o}return n}(e),u=0;u<100;u++){s.sort(r);var c=s[s.length-1],l=Y(s),f=a(l,c,2,-1);if(f.fx<s[0].fx){var p=a(l,c,3,-2);s=i(s,p.fx<f.fx?p:f)}else if(f.fx>=s[s.length-2].fx){var h=void 0;s=f.fx>c.fx?(h=a(l,c,.5,.5)).fx<c.fx?i(s,h):o(s):(h=a(l,c,1.5,-.5)).fx<f.fx?i(s,h):o(s)}else s=i(s,f)}return s[0]},processVennData:function(t,e){var r=k(t)?t:[],n=r.reduce(function(t,e){var r;return e.sets&&J(r=e)&&G(r)&&r.value>0&&-1===t.indexOf(e.sets[0])&&t.push(e.sets[0]),t},[]).sort(),i=r.reduce(function(t,r){return r.sets&&J(r)&&!r.sets.some(function(t){return -1===n.indexOf(t)})&&(t[r.sets.sort().join(e)]={sets:r.sets,value:r.value||0}),t},{});return n.reduce(function(t,r,n,i){return i.slice(n+1).forEach(function(n){t.push(r+e+n)}),t},[]).forEach(function(t){if(!i[t]){var r={sets:t.split(e),value:0};i[t]=r}}),Object.keys(i).map(function(t){return i[t]})},sortByTotalOverlap:Q},$=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(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 r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),tt=h().animObject,te=d().parse,tr=O.getAreaOfIntersectionBetweenCircles,tn=O.getCirclesIntersectionPolygon,ti=O.isCircle1CompletelyOverlappingCircle2,to=O.isPointInsideAllCircles,ta=O.isPointOutsideAllCircles,ts=g.getCenterOfPoints,tu=M().seriesTypes.scatter,tc=h().addEvent,tl=h().extend,tf=h().isArray,tp=h().isNumber,th=h().isObject,tv=h().merge,td=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $(e,t),e.getLabelPosition=function(t,e){var r=t.reduce(function(r,n){var i=n.r/2;return[{x:n.x,y:n.y},{x:n.x+i,y:n.y},{x:n.x-i,y:n.y},{x:n.x,y:n.y+i},{x:n.x,y:n.y-i}].reduce(function(r,n){var i=Z.getMarginFromCircles(n,t,e);return r.margin<i&&(r.point=n,r.margin=i),r},r)},{point:void 0,margin:-Number.MAX_VALUE}).point,n=Z.nelderMead(function(r){return-Z.getMarginFromCircles({x:r[0],y:r[1]},t,e)},[r.x,r.y]);return to(r={x:n[0],y:n[1]},t)&&ta(r,e)||(r=t.length>1?ts(tn(t)):{x:t[0].x,y:t[0].y}),r},e.getLabelValues=function(t,r){var n=t.sets,i=r.reduce(function(t,e){var r=n.indexOf(e.sets[0])>-1;return e.circle&&t[r?"internal":"external"].push(e.circle),t},{internal:[],external:[]});i.external=i.external.filter(function(t){return i.internal.some(function(e){return!ti(t,e)})});var o=e.getLabelPosition(i.internal,i.external),a=Z.getLabelWidth(o,i.internal,i.external);return{position:o,width:a}},e.layout=function(t){var r={},n={};if(t.length>0)for(var i=Z.layoutGreedyVenn(t),o=t.filter(Z.isSet),a=0;a<t.length;a++){var s=t[a],u=s.sets,c=u.join(),l=Z.isSet(s)?i[c]:tr(u.map(function(t){return i[t]}));l&&(r[c]=l,n[c]=e.getLabelValues(s,o))}return{mapOfIdToShape:r,mapOfIdToLabelValues:n}},e.getScale=function(t,e,r){var n=r.bottom-r.top,i=r.right-r.left,o=(r.right+r.left)/2,a=(r.top+r.bottom)/2,s=Math.min(i>0?1/i*t:1,n>0?1/n*e:1);return{scale:s,centerX:t/2-o*s,centerY:e/2-a*s}},e.updateFieldBoundaries=function(t,e){var r=e.x-e.r,n=e.x+e.r,i=e.y+e.r,o=e.y-e.r;return(!tp(t.left)||t.left>r)&&(t.left=r),(!tp(t.right)||t.right<n)&&(t.right=n),(!tp(t.top)||t.top>o)&&(t.top=o),(!tp(t.bottom)||t.bottom<i)&&(t.bottom=i),t},e.prototype.animate=function(t){if(!t)for(var e=tt(this.options.animation),r=function(t){var r=t.shapeArgs;if(t.graphic&&r){var n={},i={};r.d?n.opacity=.001:(n.r=0,i.r=r.r),t.graphic.attr(n).animate(i,e),r.d&&setTimeout(function(){var e;null==(e=null==t?void 0:t.graphic)||e.animate({opacity:1})},e.duration)}},n=0,i=this.points;n<i.length;n++)r(i[n])},e.prototype.drawPoints=function(){for(var t=this.chart,e=this.group,r=this.points||[],n=t.renderer,i=0;i<r.length;i++){var o=r[i],a={zIndex:tf(o.sets)?o.sets.length:0},s=o.shapeArgs;t.styledMode||tl(a,this.pointAttribs(o,o.state)),A(o,{isNew:!o.graphic,animatableAttribs:s,attribs:a,group:e,renderer:n,shapeType:(null==s?void 0:s.d)?"path":"circle"})}},e.prototype.init=function(){tu.prototype.init.apply(this,arguments),delete this.opacity},e.prototype.pointAttribs=function(t,e){var r=this.options||{},n=(null==t?void 0:t.options)||{},i=e&&r.states[e]||{},o=tv(r,{color:null==t?void 0:t.color},n,i);return{fill:te(o.color).brighten(o.brightness).get(),opacity:o.opacity,stroke:o.borderColor,"stroke-width":o.borderWidth,dashstyle:o.borderDashStyle}},e.prototype.translate=function(){var t,r=this.chart;this.dataTable.modified=this.dataTable,this.generatePoints();for(var n=Z.processVennData(this.options.data,e.splitter),i=e.layout(n),o=i.mapOfIdToShape,a=i.mapOfIdToLabelValues,s=Object.keys(o).filter(function(t){var e=o[t];return e&&tp(e.r)}).reduce(function(t,r){return e.updateFieldBoundaries(t,o[r])},{top:0,bottom:0,left:0,right:0}),u=e.getScale(r.plotWidth,r.plotHeight,s),c=u.scale,l=u.centerX,f=u.centerY,p=0,h=this.points;p<h.length;p++){var v=h[p],d=tf(v.sets)?v.sets:[],g=d.join(),y=o[g],x=a[g]||{},m=null==(t=v.options)?void 0:t.dataLabels,b=void 0,O=x.width,C=x.position;if(y){if(y.r)b={x:l+y.x*c,y:f+y.y*c,r:y.r*c};else if(y.d){var A=y.d;A.forEach(function(t){"M"===t[0]?(t[1]=l+t[1]*c,t[2]=f+t[2]*c):"A"===t[0]&&(t[1]=t[1]*c,t[2]=t[2]*c,t[6]=l+t[6]*c,t[7]=f+t[7]*c)}),b={d:A}}C?(C.x=l+C.x*c,C.y=f+C.y*c):C={},tp(O)&&(O=Math.round(O*c))}v.shapeArgs=b,C&&b&&(v.plotX=C.x,v.plotY=C.y),O&&b&&(v.dlOptions=tv(!0,{style:{width:O}},th(m,!0)?m:void 0,{zIndex:void 0})),v.name=v.options.name||d.join("∩")}},e.splitter="highcharts-split",e.defaultOptions=tv(tu.defaultOptions,S),e}(tu);tl(td.prototype,{axisTypes:[],directTouch:!0,isCartesian:!1,pointArrayMap:["value"],pointClass:I,utils:Z}),tc(td,"afterSetOptions",function(t){var e=t.options.states||{};if(this.is("venn"))for(var r=0,n=Object.keys(e);r<n.length;r++)e[n[r]].halo=!1}),M().registerSeriesType("venn",td);var tg=h();return f.default}()});