(()=>{function e(e,t){var o={};return $.isEmptyObject(t)||$.each(t,(function(t){"bringToFront"!=t&&"sendToBack"!=t&&e&&e[t]&&(o[t]=e[t])})),o}function t(t,o,n,r,i,l,s,a,u,d,f,g,c,p,m,y,h,S){var O=t,W=O.layerManager.getLayer("cluster",g),J=null!==f;if(J&&!W){if(W=L.markerClusterGroup.layerSupport(f),f.freezeAtZoom){var v=f.freezeAtZoom;delete f.freezeAtZoom,W.freezeAtZoom(v)}W.clusterLayerStore=new LeafletWidget.ClusterLayerStore(W)}var N=J?{clusterId:g}:{},b=J?null:r,G=h,j=S,P=e(G,j);function k(e){var t=e.target;t.setStyle(j),j.bringToFront&&t.bringToFront()}function M(e){var t=e.target;t.setStyle(P),j.sendToBack&&t.bringToBack()}var x=$.extend({},G),T={};i&&(T.style=function(e){return $.extend(x,e.style||{},e.properties.style||{})}),T.onEachFeature=function(e,t){var o=$.extend({featureId:e.id,properties:e.properties},N||{});null!=m&&("string"==typeof m?$.isEmptyObject(y)?t.bindPopup(e.properties[m]):t.bindPopup(e.properties[m],y):"function"==typeof m&&($.isEmptyObject(y)?t.bindPopup(m(e)):t.bindPopup(m(e),y))),null!=c&&("string"==typeof c?$.isEmptyObject(p)?t.bindTooltip(e.properties[c]):p.permanent?t.bindTooltip(e.properties[c],p).showLabel():t.bindTooltip(e.properties[c],p):"function"==typeof c&&($.isEmptyObject(p)?t.bindTooltip(c(e)):p.noHide?t.bindTooltip(c(e),p).showLabel():t.bindTooltip(c(e),p))),$.isEmptyObject(j)||t.on({mouseover:k,mouseout:M}),t.on("click",LeafletWidget.methods.mouseHandler(O.id,n,b,"geojson_click",o),O),t.on("mouseover",LeafletWidget.methods.mouseHandler(O.id,n,b,"geojson_mouseover",o),O),t.on("mouseout",LeafletWidget.methods.mouseHandler(O.id,n,b,"geojson_mouseout",o),O)},"circleMarker"!==l&&$.isEmptyObject(s)||(T.pointToLayer=function(e,t){var o=null;return"circleMarker"===l?o=L.circleMarker(t,u||{}):null!=a?"string"==typeof a?o=L.marker(t,$.extend({icon:d(s[e.properties[a]])},u||{})):"function"==typeof a&&(o=L.marker(t,$.extend({icon:d(s[a(e)])},u||{}))):o=L.marker(t,$.extend({icon:d(s)},u||{})),o});var z=o(T);J?(W.clusterLayerStore.add(z),O.layerManager.addLayer(W,"cluster",g,r)):O.layerManager.addLayer(z,"geojson",n,b)}LeafletWidget.utils.parseXML=function(e){return"string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e},LeafletWidget.utils.getParsedGeoJSON=function(e){var t;if(null==e||"string"==typeof e&&""===e.trim())return t;if("Topology"===(t="string"==typeof e?JSON.parse(e):e).type){var o=[];for(var n in t.objects){var r=topojson.feature(t,t.objects[n]);L.Util.isArray(r)?o=o.concat(r):"features"in r?o=o.concat(r.features):o.push(r)}t=o}return t},LeafletWidget.utils.isURL=function(e){return"string"==typeof e&&""!==e.trim()&&new RegExp("^((https|http|ftp|rtsp|mms)?://)?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}\\.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+\\.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\.[a-z]{2,6})(:[0-9]{1,4})?((/?)|(/[0-9A-Za-z_!~*'().;?:@&=+$,%#-]+)+/?)$").test(e)},LeafletWidget.methods.addGenericGeoJSONLayer=t,LeafletWidget.methods.addGeoJSONv2=function(e,o,n,r,i,l,s,a,u,d,f,g,c,p,m,y){var h=this;LeafletWidget.utils.isURL(e)?$.getJSON(e,(function(e){t(h,(function(t){return L.geoJson(LeafletWidget.utils.getParsedGeoJSON(e),t)}),o,n,!0,r,i,l,s,a,u,d,f,g,c,p,m,y)})):t(h,(function(t){return L.geoJson(LeafletWidget.utils.getParsedGeoJSON(e),t)}),o,n,!0,r,i,l,s,a,u,d,f,g,c,p,m,y)},LeafletWidget.methods.addKML=function(e,o,n,r,i,l,s,a,u,d,f,g,c,p,m,y){var h=this;if(LeafletWidget.utils.isURL(e))$.getJSON(e,(function(e){var S=toGeoJSON.kml(LeafletWidget.utils.parseXML(e));t(h,(function(e){return L.geoJson(LeafletWidget.utils.getParsedGeoJSON(S),e)}),o,n,!0,r,i,l,s,a,u,d,f,g,c,p,m,y)}));else{var S=toGeoJSON.kml(LeafletWidget.utils.parseXML(e));t(h,(function(e){return L.geoJson(LeafletWidget.utils.getParsedGeoJSON(S),e)}),o,n,!0,r,i,l,s,a,u,d,f,g,c,p,m,y)}},LeafletWidget.methods.addCSV=function(e,o,n,r,i,l,s,a,u,d,f,g,c,p,m,y,h){var S=this;LeafletWidget.utils.isURL(e)?$.getJSON(e,(function(e){csv2geojson.csv2geojson(e,h||{},(function(e,h){t(S,(function(e){return L.geoJson(LeafletWidget.utils.getParsedGeoJSON(h),e)}),o,n,!0,r,i,l,s,a,u,d,f,g,c,p,m,y)}))})):csv2geojson.csv2geojson(e,h||{},(function(e,h){t(S,(function(e){return L.geoJson(LeafletWidget.utils.getParsedGeoJSON(h),e)}),o,n,!0,r,i,l,s,a,u,d,f,g,c,p,m,y)}))},LeafletWidget.methods.addGPX=function(e,o,n,r,i,l,s,a,u,d,f,g,c,p,m,y){var h=this;if(LeafletWidget.utils.isURL(e))$.getJSON(e,(function(e){var S=toGeoJSON.gpx(LeafletWidget.utils.parseXML(e));t(h,(function(e){return L.geoJson(LeafletWidget.utils.getParsedGeoJSON(S),e)}),o,n,!0,r,i,l,s,a,u,d,f,g,c,p,m,y)}));else{var S=toGeoJSON.gpx(LeafletWidget.utils.parseXML(e));t(h,(function(e){return L.geoJson(LeafletWidget.utils.getParsedGeoJSON(S),e)}),o,n,!0,r,i,l,s,a,u,d,f,g,c,p,m,y)}},LeafletWidget.methods.addGeoJSONChoropleth=function(o,n,r,i,l,s,a,u,d,f){var g=d,c=e(u,g);$.isEmptyObject(f)||(f.highlightStyle=g,f.resetStyle=c);var p=this;LeafletWidget.utils.isURL(o)?$.getJSON(o,(function(e){t(p,(function(t){return L.choropleth(LeafletWidget.utils.getParsedGeoJSON(e),$.extend(u,t),f)}),n,r,!1,null,null,null,null,null,null,null,i,l,s,a,u,d)})):t(p,(function(e){return L.choropleth(LeafletWidget.utils.getParsedGeoJSON(o),$.extend(u,e),f)}),n,r,!1,null,null,null,null,null,null,null,i,l,s,a,u,d)},LeafletWidget.methods.addKMLChoropleth=function(o,n,r,i,l,s,a,u,d,f){var g=d,c=e(u,g);$.isEmptyObject(f)||(f.highlightStyle=g,f.resetStyle=c);var p=this;if(LeafletWidget.utils.isURL(o))$.getJSON(o,(function(e){var o=toGeoJSON.kml(LeafletWidget.utils.parseXML(e));t(p,(function(e){return L.choropleth(LeafletWidget.utils.getParsedGeoJSON(o),$.extend(u,e),f)}),n,r,!1,null,null,null,null,null,null,null,i,l,s,a,u,d)}));else{var m=toGeoJSON.kml(LeafletWidget.utils.parseXML(o));t(p,(function(e){return L.choropleth(LeafletWidget.utils.getParsedGeoJSON(m),$.extend(u,e),f)}),n,r,!1,null,null,null,null,null,null,null,i,l,s,a,u,d)}}})();