!/**
 * Highcharts JS v12.6.0 (2026-04-13)
 * @module highcharts/modules/windbarb
 * @requires highcharts
 *
 * Wind barb series module
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(t._Highcharts,t._Highcharts.dataGrouping.approximations,t._Highcharts.Series.types.column,t._Highcharts.Series,t._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/modules/windbarb",["highcharts/highcharts"],function(t){return r(t,t.dataGrouping,["approximations"],t.Series,["types"],["column"],t.Series,t.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/modules/windbarb"]=r(t._Highcharts,t._Highcharts.dataGrouping.approximations,t._Highcharts.Series.types.column,t._Highcharts.Series,t._Highcharts.SeriesRegistry):t.Highcharts=r(t.Highcharts,t.Highcharts.dataGrouping.approximations,t.Highcharts.Series.types.column,t.Highcharts.Series,t.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,function(t,r,o,e,n){return function(){"use strict";var i,a,s,p={448:function(t){t.exports=o},512:function(t){t.exports=n},820:function(t){t.exports=e},944:function(r){r.exports=t},956:function(t){t.exports=r}},l={};function c(t){var r=l[t];if(void 0!==r)return r.exports;var o=l[t]={exports:{}};return p[t](o,o.exports,c),o.exports}c.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return c.d(r,{a:r}),r},c.d=function(t,r){for(var o in r)c.o(r,o)&&!c.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},c.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)};var u={};c.d(u,{default:function(){return N}});var h=c(944),f=c.n(h),d=c(956),y=c.n(d),g=c(448),v=c.n(g),b=c(820),x=c.n(b),m=function(t,r,o){if(o||2==arguments.length)for(var e,n=0,i=r.length;n<i;n++)!e&&n in r||(e||(e=Array.prototype.slice.call(r,0,n)),e[n]=r[n]);return t.concat(e||Array.prototype.slice.call(r))};function _(t){return w(t)&&"number"==typeof t.nodeType}function w(t,r){var o;return!!t&&"object"==typeof t&&(!r||"[object Array]"!==(o=Object.prototype.toString.call(t))&&"[object Array Iterator]"!==o)}f().doc,f().win,Array.prototype.find;var O=f().composed,S=v().prototype,A=x().prototype,L=s||(s={});function j(t){return A.getPlotBox.call(this.options.onSeries&&this.chart.get(this.options.onSeries)||this,t)}function P(){S.translate.apply(this);var t,r,o,e,n,i,a,s,p,l=this,c=l.options,u=l.chart,h=l.points,f=c.onSeries,d=f&&u.get(f),y=d&&d.options.step,g=d&&d.points,v=u.inverted,b=l.xAxis,x=l.yAxis,m=h.length-1,_=c.onKey||"y",w=g&&g.length,O=0;if(d&&d.visible&&w)for(O=(d.pointXOffset||0)+(d.barW||0)/2,s=d.currentDataGrouping,i=g[w-1].x+(s?s.totalRange:0),function(t,r){var o,e,n=t.length;for(e=0;e<n;e++)t[e].safeI=e;for(t.sort(function(t,e){return 0===(o=r(t,e))?t.safeI-e.safeI:o}),e=0;e<n;e++)delete t[e].safeI}(h,function(t,r){return t.x-r.x}),_="plot"+_[0].toUpperCase()+_.substr(1);w--&&h[m]&&"break"!==function(){if(n=g[w],(o=h[m]).y=n.y,n.x<=o.x&&void 0!==n[_]){if(o.x<=i&&(o.plotY=n[_],n.x<o.x&&!y&&(a=g[w+1]))&&void 0!==a[_])if(null!=o.plotX&&d.is("spline")){for(var e,s=[n.plotX||0,n.plotY||0],l=[a.plotX||0,a.plotY||0],c=(null==(t=n.controlPoints)?void 0:t.high)||s,u=(null==(r=a.controlPoints)?void 0:r.low)||l,f=function(t,r){return Math.pow(1-t,3)*s[r]+3*(1-t)*(1-t)*t*c[r]+3*(1-t)*t*t*u[r]+t*t*t*l[r]},v=0,b=1,O=void 0,S=0;S<100;S++){var A=(v+b)/2,L=f(A,0);if(null===L)break;if(.25>Math.abs(L-o.plotX)){O=A;break}L<o.plotX?v=A:b=A}null!=O&&(o.plotY=f(O,1),o.y=x.toValue(o.plotY,!0))}else p=(o.x-n.x)/(a.x-n.x),o.plotY+=p*(a[_]-n[_]),o.y+=p*(a.y-n.y);if(m--,w++,m<0)return"break"}}(););h.forEach(function(t,r){var o;t.plotX+=O,(void 0===t.plotY||v)&&(t.plotX>=0&&t.plotX<=b.len?v?(t.plotY=b.translate(t.x,0,1,0,1),t.plotX=null!=t.y?x.translate(t.y,0,0,0,1):0):t.plotY=(b.opposite?0:l.yAxis.len)+b.offset:t.shapeArgs={}),(e=h[r-1])&&e.plotX===t.plotX&&(void 0===e.stackIndex&&(e.stackIndex=0),o=e.stackIndex+1),t.stackIndex=o}),this.onSeries=d}L.compose=function(t){var r;if(r="OnSeries",0>O.indexOf(r)&&O.push(r)){var o=t.prototype;o.getPlotBox=j,o.translate=P}return t},L.getPlotBox=j,L.translate=P;var H=s,k=c(512),X=c.n(k),G=(i=function(t,r){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])})(t,r)},function(t,r){function o(){this.constructor=t}i(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}),M=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return G(r,t),r.prototype.isValid=function(){var t;return"number"==typeof(t=this.value)&&!isNaN(t)&&t<1/0&&t>-1/0&&this.value>=0},r}(v().prototype.pointClass),I={dataGrouping:{enabled:!0,approximation:"windbarb",groupPixelWidth:30},lineWidth:2,onSeries:null,states:{hover:{lineWidthPlus:0}},tooltip:{pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.value}</b> ({point.beaufort})<br/>'},vectorLength:20,colorKey:"value",yOffset:-20,xOffset:0},Y=(a=function(t,r){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])})(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}a(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}),T=f().animObject,W=X().seriesTypes.column,C=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return Y(r,t),r.prototype.init=function(r,o){t.prototype.init.call(this,r,o)},r.prototype.pointAttribs=function(t,r){var o=this.options,e=t.color||this.color,n=this.options.lineWidth;return r&&(e=o.states[r].color||e,n=(o.states[r].lineWidth||n)+(o.states[r].lineWidthPlus||0)),{stroke:e,"stroke-width":n}},r.prototype.windArrow=function(t){var r,o=t.beaufortLevel,e=this.options.vectorLength/20,n=1.943844*t.value,i=-10;if(t.isNull)return[];if(0===o)return this.chart.renderer.symbols.circle(-10*e,-10*e,20*e,20*e);var a=[["M",0,7*e],["L",-1.5*e,7*e],["L",0,10*e],["L",1.5*e,7*e],["L",0,7*e],["L",0,-10*e]];if((r=(n-n%50)/50)>0)for(;r--;)a.push(-10===i?["L",0,i*e]:["M",0,i*e],["L",5*e,i*e+2],["L",0,i*e+4]),n-=50,i+=7;if((r=(n-n%10)/10)>0)for(;r--;)a.push(-10===i?["L",0,i*e]:["M",0,i*e],["L",7*e,i*e]),n-=10,i+=3;if((r=(n-n%5)/5)>0)for(;r--;)a.push(-10===i?["L",0,i*e]:["M",0,i*e],["L",4*e,i*e]),n-=5,i+=3;return a},r.prototype.drawPoints=function(){for(var t=this.chart,r=this.yAxis,o=t.inverted,e=this.options.vectorLength/2,n=0,i=this.points;n<i.length;n++){var a=i[n],s=a.plotX,p=a.plotY;!1===this.options.clip||t.isInsidePlot(s,0)?(a.graphic||(a.graphic=this.chart.renderer.path().add(this.markerGroup).addClass("highcharts-point highcharts-color-"+function(){for(var t=arguments,r=t.length,o=0;o<r;o++){var e=t[o];if(null!=e)return e}}(a.colorIndex,a.series.colorIndex))),a.graphic.attr({d:this.windArrow(a),translateX:s+this.options.xOffset,translateY:p+this.options.yOffset,rotation:a.direction}),this.chart.styledMode||a.graphic.attr(this.pointAttribs(a))):a.graphic&&(a.graphic=a.graphic.destroy()),a.tooltipPos=[s+this.options.xOffset+(o&&!this.onSeries?e:0),p+this.options.yOffset-(o?0:e+r.pos-t.plotTop)]}},r.prototype.animate=function(t){t?this.markerGroup.attr({opacity:.01}):this.markerGroup.animate({opacity:1},T(this.options.animation))},r.prototype.markerAttribs=function(){return{}},r.prototype.getExtremes=function(){return{}},r.prototype.shouldShowTooltip=function(r,o,e){return void 0===e&&(e={}),e.ignoreX=this.chart.inverted,e.ignoreY=!e.ignoreX,t.prototype.shouldShowTooltip.call(this,r,o,e)},r.defaultOptions=function(t){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];var e,n=m([t],r,!0),i={},a=function(t,r){return"object"!=typeof t&&(t={}),function(t,r,o){for(var e in t)Object.hasOwnProperty.call(t,e)&&r.call((0,t[e]),t[e],e,t)}(r,function(o,e){if("__proto__"!==e&&"constructor"!==e){var n;!w(o,!0)||(n=null==o?void 0:o.constructor,w(o,!0)&&!_(o)&&(null==n?void 0:n.name)&&"Object"!==n.name)||_(o)?t[e]=r[e]:t[e]=a(t[e]||{},o)}}),t};!0===t&&(i=n[1],n=Array.prototype.slice.call(n,2));var s=n.length;for(e=0;e<s;e++)i=a(i,n[e]);return i}(W.defaultOptions,I),r}(W);H.compose(C),function(t,r){var o;for(o in t||(t={}),r)t[o]=r[o]}(C.prototype,{beaufortFloor:[0,.3,1.6,3.4,5.5,8,10.8,13.9,17.2,20.8,24.5,28.5,32.7],beaufortName:["Calm","Light air","Light breeze","Gentle breeze","Moderate breeze","Fresh breeze","Strong breeze","Near gale","Gale","Strong gale","Storm","Violent storm","Hurricane"],invertible:!1,parallelArrays:["x","value","direction"],pointArrayMap:["value","direction"],pointClass:M,trackerGroups:["markerGroup"],translate:function(){var t=this.beaufortFloor,r=this.beaufortName;H.translate.call(this);for(var o=0,e=this.points;o<e.length;o++){for(var n=e[o],i=0;i<t.length&&!(t[i]>n.value);i++);n.beaufortLevel=i-1,n.beaufort=r[i-1]}}}),X().registerSeriesType("windbarb",C),y().windbarb||(y().windbarb=function(t,r){for(var o=0,e=0,n=0,i=t.length;n<i;n++)o+=t[n]*Math.cos(r[n]*f().deg2rad),e+=t[n]*Math.sin(r[n]*f().deg2rad);return[t.reduce(function(t,r){return t+r},0)/t.length,Math.atan2(e,o)/f().deg2rad]});var N=f();return u.default}()});