(()=>{function e(e,t){var a=null;return e&&("string"==typeof t?a=e.properties[t]:"function"==typeof t&&(a=t(e))),a}function t(a,r){var i=[];if(null==a)return i;if("string"==typeof a&&(a=JSON.parse(a)),"Topology"===a.type){var o=[];for(var n in a.objects){var s=topojson.feature(a,a.objects[n]);L.Util.isArray(s)?o=o.concat(s):"features"in s?o=o.concat(s.features):o.push(s)}return t(o,r)}var u=L.Util.isArray(a)?a:a.features;return u?$.each(u,(function(a,o){var n=null,s=null;"Point"===o.geometry.type?(n=parseFloat(o.geometry.coordinates[1]),s=parseFloat(o.geometry.coordinates[0]),n&&s&&(r?i.push([n,s,e(o,r)]):i.push([n,s]))):"MultiPoint"===o.geometry.type&&(i=i.concat(t(o,r)))})):"Feature"===a.type&&$.each(a.geometry.coordinates,(function(t,o){var n,s;n=parseFloat(o[1]),s=parseFloat(o[0]),n&&s&&(r?i.push([n,s,e(a,r)]):i.push([n,s]))})),i}function a(e,a,r,i,o,n){var s=t(a,r);if(!$.isEmptyObject(s)){if(n.gradientTexture){var u=document.getElementById("lfx-webgl-heatmap-"+n.gradientTexture+"-attachment");$.isEmptyObject(u)?delete n.gradientTexture:n.gradientTexture=u.href}var l=L.webGLHeatmap(n);l.setData(s),e.layerManager.addLayer(l,"webGLHeatmap",i,o),n.gradientTexture&&(e.zoomOut(),setTimeout((function(){e.zoomIn()}),500))}}LeafletWidget.methods.addWebGLHeatmap=function(e,t,a,r){var i=this;if(!$.isEmptyObject(e)){if(r.gradientTexture){var o=document.getElementById("lfx-webgl-heatmap-"+r.gradientTexture+"-attachment");$.isEmptyObject(o)?delete r.gradientTexture:r.gradientTexture=o.href}var n=L.webGLHeatmap(r);n.setData(e),i.layerManager.addLayer(n,"webGLHeatmap",t,a),r.gradientTexture&&(i.zoomOut(),setTimeout((function(){i.zoomIn()}),500))}},LeafletWidget.methods.addWebGLGeoJSONHeatmap=function(e,t,r,i,o){var n=this;LeafletWidget.utils.isURL(e)?$.getJSON(e,(function(e){a(n,e,t,r,i,o)})):a(n,e,t,r,i,o)},LeafletWidget.methods.addWebGLKMLHeatmap=function(e,t,r,i,o){var n=this;if(LeafletWidget.utils.isURL(e))$.getJSON(e,(function(e){var s=toGeoJSON.kml(LeafletWidget.utils.parseXML(e));a(n,s,t,r,i,o)}));else{var s=toGeoJSON.kml(LeafletWidget.utils.parseXML(e));a(n,s,t,r,i,o)}},LeafletWidget.methods.addWebGLCSVHeatmap=function(e,t,r,i,o,n){var s=this;LeafletWidget.utils.isURL(e)?$.getJSON(e,(function(e){csv2geojson.csv2geojson(e,n||{},(function(e,n){a(s,n,t,r,i,o)}))})):csv2geojson.csv2geojson(e,n||{},(function(e,n){a(s,n,t,r,i,o)}))},LeafletWidget.methods.addWebGLGPXHeatmap=function(e,t,r,i,o){var n=this;if(LeafletWidget.utils.isURL(e))$.getJSON(e,(function(e){var s=toGeoJSON.gpx(LeafletWidget.utils.parseXML(e));a(n,s,t,r,i,o)}));else{var s=toGeoJSON.gpx(LeafletWidget.utils.parseXML(e));a(n,s,t,r,i,o)}},LeafletWidget.methods.removeWebGLHeatmap=function(e){this.layerManager.removeLayer("webGLHeatmap",e)},LeafletWidget.methods.clearWebGLHeatmap=function(){this.layerManager.clearLayers("webGLHeatmap")}})();