import{M as rt}from"./entry.783d4ced.js";function nt(L,m){for(var i=0;i<m.length;i++){const y=m[i];if(typeof y!="string"&&!Array.isArray(y)){for(const s in y)if(s!=="default"&&!(s in L)){const l=Object.getOwnPropertyDescriptor(y,s);l&&Object.defineProperty(L,s,l.get?l:{enumerable:!0,get:()=>y[s]})}}}return Object.freeze(Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}))}var Q={exports:{}};(function(L){(function(m){L.exports?(m.default=m,L.exports=m):m(typeof Highcharts<"u"?Highcharts:void 0)})(function(m){var i=m?m._modules:{};function y(s,l,U,w){s.hasOwnProperty(l)||(s[l]=w.apply(null,U),typeof CustomEvent=="function"&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:l,module:s[l]}})))}y(i,"Series/GeoHeatmap/GeoHeatmapPoint.js",[i["Core/Utilities.js"],i["Core/Series/SeriesRegistry.js"]],function(s,l){let{map:{prototype:{pointClass:U}}}=l.seriesTypes,{isNumber:w}=s;return class extends U{constructor(){super(...arguments),this.lat=void 0,this.lon=void 0,this.options=void 0,this.series=void 0}applyOptions(O,h){let p=super.applyOptions.call(this,O,h),{lat:d,lon:b}=p.options;if(w(b)&&w(d)){let{colsize:C=1,rowsize:z=1}=this.series.options,j=b-C/2,A=d-z/2;p.geometry=p.options.geometry={type:"Polygon",coordinates:[[[j,A],[j+C,A],[j+C,A+z],[j,A+z],[j,A]]]}}return p}}}),y(i,"Series/InterpolationUtilities.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],function(s,l){let{doc:U}=s,{defined:w,pick:O}=l;return{colorFromPoint:function(h,p){let d=p.series.colorAxis;if(d){let b=d.toColor(h||0,p).split(")")[0].split("(")[1].split(",").map(C=>O(parseFloat(C),parseInt(C,10)));return b[3]=255*O(b[3],1),w(h)&&p.visible||(b[3]=0),b}return[0,0,0,0]},getContext:function(h){let{canvas:p,context:d}=h;return p&&d?(d.clearRect(0,0,p.width,p.height),d):(h.canvas=U.createElement("canvas"),h.context=h.canvas.getContext("2d",{willReadFrequently:!0})||void 0,h.context)}}}),y(i,"Series/GeoHeatmap/GeoHeatmapSeries.js",[i["Core/Animation/AnimationUtilities.js"],i["Series/GeoHeatmap/GeoHeatmapPoint.js"],i["Core/Globals.js"],i["Series/InterpolationUtilities.js"],i["Core/Series/SeriesRegistry.js"],i["Core/Utilities.js"]],function(s,l,U,w,O,h){let{animObject:p,stop:d}=s,{noop:b}=U,{colorFromPoint:C,getContext:z}=w,{seriesTypes:{map:j}}=O,{addEvent:A,extend:tt,isNumber:q,isObject:et,merge:E,pick:F}=h;function J(_){return _-360*Math.floor((_+180)/360)}class G extends j{constructor(){super(...arguments),this.options=void 0,this.data=void 0,this.points=void 0,this.canvas=void 0,this.context=void 0,this.isDirtyCanvas=!0}update(){this.options=E(this.options,arguments[0]),this.getInterpolation().enabled&&(this.isDirtyCanvas=!0,this.points.forEach(e=>{e.graphic&&(e.graphic.destroy(),delete e.graphic)})),super.update.apply(this,arguments)}translate(){(!this.getInterpolation().enabled||!this.image||this.isDirty||this.isDirtyData)&&super.translate.apply(this,arguments)}getInterpolation(){return et(this.options.interpolation)?this.options.interpolation:{blur:1,enabled:this.options.interpolation}}drawPoints(){let e=this.chart,f=e.mapView,r=this.options;if(this.getInterpolation().enabled&&f&&this.bounds){let a=this.context||z(this),{canvas:t,colorAxis:T,image:c,chart:g,points:M}=this,[R,k]=[F(r.colsize,1),F(r.rowsize,1)],D=f.projectedUnitsToPixels({x:this.bounds.x1,y:this.bounds.y2}),H=f.projectedUnitsToPixels({x:this.bounds.x2,y:this.bounds.y1});if(t&&a&&T&&D&&H){let o={x:D.x,y:D.y,width:H.x-D.x,height:H.y-D.y};if(this.isDirtyCanvas||this.isDirtyData||f.projection.options.name==="Orthographic"){this.isDirtyCanvas=!0;let x=t.width=~~(360/R)+1,n=t.height=~~(180/k)+1,S=x*n,v=new Uint8ClampedArray(4*S);this.directTouch=!1;for(let Y=0;Y<M.length;Y++){let $=M[Y],st=new Uint8ClampedArray(C($.value,$)),{lon:W,lat:B}=$.options;q(W)&&q(B)&&v.set(st,4*Math.ceil(x*(n-1-(B+90)/k)+(W+180)/R))}let P=this.getInterpolation().blur,u=P===0?1:11*P,N=~~(x*u),K=~~(n*u),I=~~o.width,X=~~o.height,V=new ImageData(v,x,n);t.width=N,t.height=K,a.putImageData(V,0,0),a.globalCompositeOperation="copy",a.drawImage(t,0,0,V.width,V.height,0,0,t.width,t.height);let it=a.getImageData(0,0,t.width,t.height),ot=this.getProjectedImageData(f,I,X,it,t,o.x,o.y),at=new ImageData(ot,I,X);a.globalCompositeOperation="copy",t.width=I,t.height=X,a.putImageData(at,0,0)}if(c)if(g.renderer.globalAnimation&&g.hasRendered){let x=Number(c.attr("x")),n=Number(c.attr("y")),S=Number(c.attr("width")),v=Number(c.attr("height")),P=(K,I)=>{c.attr({x:x+(o.x-x)*I.pos,y:n+(o.y-n)*I.pos,width:S+(o.width-S)*I.pos,height:v+(o.height-v)*I.pos})},u=E(p(g.renderer.globalAnimation)),N=u.step;u.step=function(){N&&N.apply(this,arguments),P.apply(this,arguments)},c.attr(E({animator:0},this.isDirtyCanvas?{href:t.toDataURL("image/png",1)}:void 0)).animate({animator:1},u)}else d(c),c.attr(E(o,this.isDirtyCanvas?{href:t.toDataURL("image/png",1)}:void 0));else this.image=g.renderer.image(t.toDataURL("image/png",1)).attr(o).add(this.group);this.isDirtyCanvas=!1}}else super.drawPoints.apply(this,arguments)}getProjectedImageData(e,f,r,a,t,T,c){var H;let g=new Uint8ClampedArray(f*r*4),M=F((H=e.projection.options.rotation)==null?void 0:H[0],0),R=t.width/360,k=-1*t.height/180,D=-1;for(let o=0;o<g.length;o+=4){let x=o/4%f;x===0&&D++;let n=e.pixelsToLonLat({x:T+x,y:c+D});if(n){n.lon>-180-M&&n.lon<180-M&&(n.lon=J(n.lon));let S=[n.lon,n.lat],v=S[0]*R+t.width/2,P=S[1]*k+t.height/2;if(v>=0&&v<=t.width&&P>=0&&P<=t.height){let u=Math.floor(P)*t.width*4+4*Math.round(v);g[o]=a.data[u],g[o+1]=a.data[u+1],g[o+2]=a.data[u+2],g[o+3]=a.data[u+3]}}}return g}searchPoint(e,f){let r=this.chart,a=r.mapView;if(a&&this.bounds&&this.image&&r.tooltip&&r.tooltip.options.enabled)if(r.pointer.hasDragged===!1&&(.01>=+this.image.attr("animator")||+this.image.attr("animator")>=.99)){let t=a.projectedUnitsToPixels({x:this.bounds.x1,y:this.bounds.y2}),T=a.projectedUnitsToPixels({x:this.bounds.x2,y:this.bounds.y1});if(r.pointer.normalize(e),e.lon&&e.lat&&t&&T&&e.chartX-r.plotLeft>t.x&&e.chartX-r.plotLeft<T.x&&e.chartY-r.plotTop>t.y&&e.chartY-r.plotTop<T.y)return this.searchKDTree({clientX:e.chartX,lon:J(e.lon),lat:e.lat},f,e)}else r.tooltip.destroy()}}return G.defaultOptions=E(j.defaultOptions,{nullColor:"transparent",tooltip:{pointFormat:"Lat: {point.lat}, Lon: {point.lon}, Value: {point.value}<br/>"},borderWidth:0,colsize:1,rowsize:1,stickyTracking:!0,interpolation:{enabled:!1,blur:1}}),A(G,"afterDataClassLegendClick",function(){this.isDirtyCanvas=!0,this.drawPoints()}),tt(G.prototype,{type:"geoheatmap",applyJitter:b,pointClass:l,pointArrayMap:["lon","lat","value"],kdAxisArray:["lon","lat"]}),O.registerSeriesType("geoheatmap",G),G}),y(i,"masters/modules/geoheatmap.src.js",[],function(){})})})(Q);var Z=Q.exports;const lt=rt(Z),ht=nt({__proto__:null,default:lt},[Z]);export{ht as g};
