diff --git a/CHANGELOG.md b/CHANGELOG.md index a287b449..f09f927a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.4] - 2026-07-08 + +### Added +- Filter panel close button: the `dm-filter` panel header now shows a close (×) button in the top-right that closes the panel (all variants). + +### Fixed +- Search: selecting a map result (feature/marker) now highlights the marker itself — active icon, brought to front — and opens its infowindow, instead of only moving the map. +- Hovering a selected marker no longer leaves it stuck on the hover icon; it returns to the active icon when the mouse leaves. + +### Changed +- Re-vendored `assets/vendor/draad-maps.iife.js` from `@draadnl/map-components` 0.5.8. + ## [1.4.3] - 2026-07-06 ### Fixed diff --git a/assets/vendor/draad-maps.iife.js b/assets/vendor/draad-maps.iife.js index f94ebcc5..cac48c01 100644 --- a/assets/vendor/draad-maps.iife.js +++ b/assets/vendor/draad-maps.iife.js @@ -1,7 +1,7 @@ -var DraadMaps=(function(Oe){"use strict";function La(i,e){for(var n=0;ns[a]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}function Ca(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Ta(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var n=function s(){var a=!1;try{a=this instanceof s}catch{}return a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var a=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(n,s,a.get?a:{enumerable:!0,get:function(){return i[s]}})}),n}var Re={exports:{}};var za=Re.exports,dr;function ur(){return dr||(dr=1,(function(i,e){(function(n,s){s(e)})(za,(function(n){var s="1.9.4";function a(t){var r,o,d,f;for(o=1,d=arguments.length;o"u"||!L||!L.Mixin)){t=I(t)?t:[t];for(var r=0;r0?Math.floor(t):Math.ceil(t)};D.prototype={clone:function(){return new D(this.x,this.y)},add:function(t){return this.clone()._add(q(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(q(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new D(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new D(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=vs(this.x),this.y=vs(this.y),this},distanceTo:function(t){t=q(t);var r=t.x-this.x,o=t.y-this.y;return Math.sqrt(r*r+o*o)},equals:function(t){return t=q(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=q(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+_(this.x)+", "+_(this.y)+")"}};function q(t,r,o){return t instanceof D?t:I(t)?new D(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new D(t.x,t.y):new D(t,r,o)}function nt(t,r){if(t)for(var o=r?[t,r]:t,d=0,f=o.length;d=this.min.x&&o.x<=this.max.x&&r.y>=this.min.y&&o.y<=this.max.y},intersects:function(t){t=St(t);var r=this.min,o=this.max,d=t.min,f=t.max,p=f.x>=r.x&&d.x<=o.x,y=f.y>=r.y&&d.y<=o.y;return p&&y},overlaps:function(t){t=St(t);var r=this.min,o=this.max,d=t.min,f=t.max,p=f.x>r.x&&d.xr.y&&d.y=r.lat&&f.lat<=o.lat&&d.lng>=r.lng&&f.lng<=o.lng},intersects:function(t){t=ct(t);var r=this._southWest,o=this._northEast,d=t.getSouthWest(),f=t.getNorthEast(),p=f.lat>=r.lat&&d.lat<=o.lat,y=f.lng>=r.lng&&d.lng<=o.lng;return p&&y},overlaps:function(t){t=ct(t);var r=this._southWest,o=this._northEast,d=t.getSouthWest(),f=t.getNorthEast(),p=f.lat>r.lat&&d.latr.lng&&d.lng1,Eu=(function(){var t=!1;try{var r=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",g,r),window.removeEventListener("testPassiveEventSupport",g,r)}catch{}return t})(),Pu=(function(){return!!document.createElement("canvas").getContext})(),Bn=!!(document.createElementNS&&bs("svg").createSVGRect),ku=!!Bn&&(function(){var t=document.createElement("div");return t.innerHTML="",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Au=!Bn&&(function(){try{var t=document.createElement("div");t.innerHTML='';var r=t.firstChild;return r.style.behavior="url(#default#VML)",r&&typeof r.adj=="object"}catch{return!1}})(),Lu=navigator.platform.indexOf("Mac")===0,Cu=navigator.platform.indexOf("Linux")===0;function Ft(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var G={ie:qi,ielt9:fu,edge:xs,webkit:Gn,android:Ms,android23:Ss,androidStock:mu,opera:On,chrome:Es,gecko:Ps,safari:_u,phantom:ks,opera12:As,win:gu,ie3d:Ls,webkit3d:Rn,gecko3d:Cs,any3d:vu,mobile:ai,mobileWebkit:yu,mobileWebkit3d:bu,msPointer:Ts,pointer:zs,touch:wu,touchNative:Is,mobileOpera:xu,mobileGecko:Mu,retina:Su,passiveEvents:Eu,canvas:Pu,svg:Bn,vml:Au,inlineSvg:ku,mac:Lu,linux:Cu},Ns=G.msPointer?"MSPointerDown":"pointerdown",Gs=G.msPointer?"MSPointerMove":"pointermove",Os=G.msPointer?"MSPointerUp":"pointerup",Rs=G.msPointer?"MSPointerCancel":"pointercancel",qn={touchstart:Ns,touchmove:Gs,touchend:Os,touchcancel:Rs},Bs={touchstart:Ou,touchmove:Fi,touchend:Fi,touchcancel:Fi},ke={},qs=!1;function Tu(t,r,o){return r==="touchstart"&&Gu(),Bs[r]?(o=Bs[r].bind(this,o),t.addEventListener(qn[r],o,!1),o):(console.warn("wrong event specified:",r),g)}function zu(t,r,o){if(!qn[r]){console.warn("wrong event specified:",r);return}t.removeEventListener(qn[r],o,!1)}function Iu(t){ke[t.pointerId]=t}function Nu(t){ke[t.pointerId]&&(ke[t.pointerId]=t)}function Fs(t){delete ke[t.pointerId]}function Gu(){qs||(document.addEventListener(Ns,Iu,!0),document.addEventListener(Gs,Nu,!0),document.addEventListener(Os,Fs,!0),document.addEventListener(Rs,Fs,!0),qs=!0)}function Fi(t,r){if(r.pointerType!==(r.MSPOINTER_TYPE_MOUSE||"mouse")){r.touches=[];for(var o in ke)r.touches.push(ke[o]);r.changedTouches=[r],t(r)}}function Ou(t,r){r.MSPOINTER_TYPE_TOUCH&&r.pointerType===r.MSPOINTER_TYPE_TOUCH&&mt(r),Fi(t,r)}function Ru(t){var r={},o,d;for(d in t)o=t[d],r[d]=o&&o.bind?o.bind(t):o;return t=r,r.type="dblclick",r.detail=2,r.isTrusted=!1,r._simulated=!0,r}var Bu=200;function qu(t,r){t.addEventListener("dblclick",r);var o=0,d;function f(p){if(p.detail!==1){d=p.detail;return}if(!(p.pointerType==="mouse"||p.sourceCapabilities&&!p.sourceCapabilities.firesTouchEvents)){var y=Us(p);if(!(y.some(function(M){return M instanceof HTMLLabelElement&&M.attributes.for})&&!y.some(function(M){return M instanceof HTMLInputElement||M instanceof HTMLSelectElement}))){var b=Date.now();b-o<=Bu?(d++,d===2&&r(Ru(p))):d=1,o=b}}}return t.addEventListener("click",f),{dblclick:r,simDblclick:f}}function Fu(t,r){t.removeEventListener("dblclick",r.dblclick),t.removeEventListener("click",r.simDblclick)}var Fn=ji(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),oi=ji(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Ds=oi==="webkitTransition"||oi==="OTransition"?oi+"End":"transitionend";function Zs(t){return typeof t=="string"?document.getElementById(t):t}function li(t,r){var o=t.style[r]||t.currentStyle&&t.currentStyle[r];if((!o||o==="auto")&&document.defaultView){var d=document.defaultView.getComputedStyle(t,null);o=d?d[r]:null}return o==="auto"?null:o}function V(t,r,o){var d=document.createElement(t);return d.className=r||"",o&&o.appendChild(d),d}function rt(t){var r=t.parentNode;r&&r.removeChild(t)}function Di(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Ae(t){var r=t.parentNode;r&&r.lastChild!==t&&r.appendChild(t)}function Le(t){var r=t.parentNode;r&&r.firstChild!==t&&r.insertBefore(t,r.firstChild)}function Dn(t,r){if(t.classList!==void 0)return t.classList.contains(r);var o=Zi(t);return o.length>0&&new RegExp("(^|\\s)"+r+"(\\s|$)").test(o)}function j(t,r){if(t.classList!==void 0)for(var o=x(r),d=0,f=o.length;d0?2*window.devicePixelRatio:1;function Ws(t){return G.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/ju:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function Yn(t,r){var o=r.relatedTarget;if(!o)return!0;try{for(;o&&o!==t;)o=o.parentNode}catch{return!1}return o!==t}var Hu={__proto__:null,on:Z,off:tt,stopPropagation:de,disableScrollPropagation:Qn,disableClickPropagation:ui,preventDefault:mt,stop:ue,getPropagationPath:Us,getMousePosition:$s,getWheelDelta:Ws,isExternalTarget:Yn,addListener:Z,removeListener:tt},Vs=ri.extend({run:function(t,r,o,d){this.stop(),this._el=t,this._inProgress=!0,this._duration=o||.25,this._easeOutPower=1/Math.max(d||.5,.2),this._startPos=ce(t),this._offset=r.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Q(this._animate,this),this._step()},_step:function(t){var r=+new Date-this._startTime,o=this._duration*1e3;rthis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,r){this._enforcingBounds=!0;var o=this.getCenter(),d=this._limitCenter(o,this._zoom,ct(t));return o.equals(d)||this.panTo(d,r),this._enforcingBounds=!1,this},panInside:function(t,r){r=r||{};var o=q(r.paddingTopLeft||r.padding||[0,0]),d=q(r.paddingBottomRight||r.padding||[0,0]),f=this.project(this.getCenter()),p=this.project(t),y=this.getPixelBounds(),b=St([y.min.add(o),y.max.subtract(d)]),M=b.getSize();if(!b.contains(p)){this._enforcingBounds=!0;var P=p.subtract(b.getCenter()),N=b.extend(p).getSize().subtract(M);f.x+=P.x<0?-N.x:N.x,f.y+=P.y<0?-N.y:N.y,this.panTo(this.unproject(f),r),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=a({animate:!1,pan:!0},t===!0?{animate:!0}:t);var r=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),d=r.divideBy(2).round(),f=o.divideBy(2).round(),p=d.subtract(f);return!p.x&&!p.y?this:(t.animate&&t.pan?this.panBy(p):(t.pan&&this._rawPanBy(p),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:r,newSize:o}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=a({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var r=h(this._handleGeolocationResponse,this),o=h(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(r,o,t):navigator.geolocation.getCurrentPosition(r,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var r=t.code,o=t.message||(r===1?"permission denied":r===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:r,message:"Geolocation error: "+o+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var r=t.coords.latitude,o=t.coords.longitude,d=new Y(r,o),f=d.toBounds(t.coords.accuracy*2),p=this._locateOptions;if(p.setView){var y=this.getBoundsZoom(f);this.setView(d,p.maxZoom?Math.min(y,p.maxZoom):y)}var b={latlng:d,bounds:f,timestamp:t.timestamp};for(var M in t.coords)typeof t.coords[M]=="number"&&(b[M]=t.coords[M]);this.fire("locationfound",b)}},addHandler:function(t,r){if(!r)return this;var o=this[t]=new r(this);return this._handlers.push(o),this.options[t]&&o.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),rt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ht(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)rt(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,r){var o="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),d=V("div",o,r||this._mapPane);return t&&(this._panes[t]=d),d},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),r=this.unproject(t.getBottomLeft()),o=this.unproject(t.getTopRight());return new Et(r,o)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,r,o){t=ct(t),o=q(o||[0,0]);var d=this.getZoom()||0,f=this.getMinZoom(),p=this.getMaxZoom(),y=t.getNorthWest(),b=t.getSouthEast(),M=this.getSize().subtract(o),P=St(this.project(b,d),this.project(y,d)).getSize(),N=G.any3d?this.options.zoomSnap:1,R=M.x/P.x,U=M.y/P.y,vt=r?Math.max(R,U):Math.min(R,U);return d=this.getScaleZoom(vt,d),N&&(d=Math.round(d/(N/100))*(N/100),d=r?Math.ceil(d/N)*N:Math.floor(d/N)*N),Math.max(f,Math.min(p,d))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new D(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,r){var o=this._getTopLeftPoint(t,r);return new nt(o,o.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,r){var o=this.options.crs;return r=r===void 0?this._zoom:r,o.scale(t)/o.scale(r)},getScaleZoom:function(t,r){var o=this.options.crs;r=r===void 0?this._zoom:r;var d=o.zoom(t*o.scale(r));return isNaN(d)?1/0:d},project:function(t,r){return r=r===void 0?this._zoom:r,this.options.crs.latLngToPoint($(t),r)},unproject:function(t,r){return r=r===void 0?this._zoom:r,this.options.crs.pointToLatLng(q(t),r)},layerPointToLatLng:function(t){var r=q(t).add(this.getPixelOrigin());return this.unproject(r)},latLngToLayerPoint:function(t){var r=this.project($(t))._round();return r._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng($(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(ct(t))},distance:function(t,r){return this.options.crs.distance($(t),$(r))},containerPointToLayerPoint:function(t){return q(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return q(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var r=this.containerPointToLayerPoint(q(t));return this.layerPointToLatLng(r)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint($(t)))},mouseEventToContainerPoint:function(t){return $s(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var r=this._container=Zs(t);if(r){if(r._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Z(r,"scroll",this._onScroll,this),this._containerId=u(r)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&G.any3d,j(t,"leaflet-container"+(G.touch?" leaflet-touch":"")+(G.retina?" leaflet-retina":"")+(G.ielt9?" leaflet-oldie":"")+(G.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var r=li(t,"position");r!=="absolute"&&r!=="relative"&&r!=="fixed"&&r!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),dt(this._mapPane,new D(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(j(t.markerPane,"leaflet-zoom-hide"),j(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,r,o){dt(this._mapPane,new D(0,0));var d=!this._loaded;this._loaded=!0,r=this._limitZoom(r),this.fire("viewprereset");var f=this._zoom!==r;this._moveStart(f,o)._move(t,r)._moveEnd(f),this.fire("viewreset"),d&&this.fire("load")},_moveStart:function(t,r){return t&&this.fire("zoomstart"),r||this.fire("movestart"),this},_move:function(t,r,o,d){r===void 0&&(r=this._zoom);var f=this._zoom!==r;return this._zoom=r,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),d?o&&o.pinch&&this.fire("zoom",o):((f||o&&o.pinch)&&this.fire("zoom",o),this.fire("move",o)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ht(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){dt(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[u(this._container)]=this;var r=t?tt:Z;r(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&r(window,"resize",this._onResize,this),G.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ht(this._resizeRequest),this._resizeRequest=Q(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,r){for(var o=[],d,f=r==="mouseout"||r==="mouseover",p=t.target||t.srcElement,y=!1;p;){if(d=this._targets[u(p)],d&&(r==="click"||r==="preclick")&&this._draggableMoved(d)){y=!0;break}if(d&&d.listens(r,!0)&&(f&&!Yn(p,t)||(o.push(d),f))||p===this._container)break;p=p.parentNode}return!o.length&&!y&&!f&&this.listens(r,!0)&&(o=[this]),o},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var r=t.target||t.srcElement;if(!(!this._loaded||r._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(r))){var o=t.type;o==="mousedown"&&Wn(r),this._fireDOMEvent(t,o)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,r,o){if(t.type==="click"){var d=a({},t);d.type="preclick",this._fireDOMEvent(d,d.type,o)}var f=this._findEventTargets(t,r);if(o){for(var p=[],y=0;y0?Math.round(t-r)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(r))},_limitZoom:function(t){var r=this.getMinZoom(),o=this.getMaxZoom(),d=G.any3d?this.options.zoomSnap:1;return d&&(t=Math.round(t/d)*d),Math.max(r,Math.min(o,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){lt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,r){var o=this._getCenterOffset(t)._trunc();return(r&&r.animate)!==!0&&!this.getSize().contains(o)?!1:(this.panBy(o,r),!0)},_createAnimProxy:function(){var t=this._proxy=V("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(r){var o=Fn,d=this._proxy.style[o];he(this._proxy,this.project(r.center,r.zoom),this.getZoomScale(r.zoom,1)),d===this._proxy.style[o]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){rt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),r=this.getZoom();he(this._proxy,this.project(t,r),this.getZoomScale(r,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,r,o){if(this._animatingZoom)return!0;if(o=o||{},!this._zoomAnimated||o.animate===!1||this._nothingToAnimate()||Math.abs(r-this._zoom)>this.options.zoomAnimationThreshold)return!1;var d=this.getZoomScale(r),f=this._getCenterOffset(t)._divideBy(1-1/d);return o.animate!==!0&&!this.getSize().contains(f)?!1:(Q(function(){this._moveStart(!0,o.noMoveStart||!1)._animateZoom(t,r,!0)},this),!0)},_animateZoom:function(t,r,o,d){this._mapPane&&(o&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=r,j(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:r,noUpdate:d}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(h(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&<(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Uu(t,r){return new W(t,r)}var Ot=qt.extend({options:{position:"topright"},initialize:function(t){S(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var r=this._map;return r&&r.removeControl(this),this.options.position=t,r&&r.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var r=this._container=this.onAdd(t),o=this.getPosition(),d=t._controlCorners[o];return j(r,"leaflet-control"),o.indexOf("bottom")!==-1?d.insertBefore(r,d.firstChild):d.appendChild(r),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(rt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),fi=function(t){return new Ot(t)};W.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},r="leaflet-",o=this._controlContainer=V("div",r+"control-container",this._container);function d(f,p){var y=r+f+" "+r+p;t[f+p]=V("div",y,o)}d("top","left"),d("top","right"),d("bottom","left"),d("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)rt(this._controlCorners[t]);rt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Js=Ot.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,r,o,d){return o1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=r&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var r=this._getLayer(u(t.target)),o=r.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;o&&this._map.fire(o,r)},_createRadioElement:function(t,r){var o='",d=document.createElement("div");return d.innerHTML=o,d.firstChild},_addItem:function(t){var r=document.createElement("label"),o=this._map.hasLayer(t.layer),d;t.overlay?(d=document.createElement("input"),d.type="checkbox",d.className="leaflet-control-layers-selector",d.defaultChecked=o):d=this._createRadioElement("leaflet-base-layers_"+u(this),o),this._layerControlInputs.push(d),d.layerId=u(t.layer),Z(d,"click",this._onInputClick,this);var f=document.createElement("span");f.innerHTML=" "+t.name;var p=document.createElement("span");r.appendChild(p),p.appendChild(d),p.appendChild(f);var y=t.overlay?this._overlaysList:this._baseLayersList;return y.appendChild(r),this._checkDisabledLayers(),r},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,r,o,d=[],f=[];this._handlingClick=!0;for(var p=t.length-1;p>=0;p--)r=t[p],o=this._getLayer(r.layerId).layer,r.checked?d.push(o):r.checked||f.push(o);for(p=0;p=0;f--)r=t[f],o=this._getLayer(r.layerId).layer,r.disabled=o.options.minZoom!==void 0&&do.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,Z(t,"click",mt),this.expand();var r=this;setTimeout(function(){tt(t,"click",mt),r._preventClick=!1})}}),$u=function(t,r,o){return new Js(t,r,o)},tr=Ot.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var r="leaflet-control-zoom",o=V("div",r+" leaflet-bar"),d=this.options;return this._zoomInButton=this._createButton(d.zoomInText,d.zoomInTitle,r+"-in",o,this._zoomIn),this._zoomOutButton=this._createButton(d.zoomOutText,d.zoomOutTitle,r+"-out",o,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),o},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,r,o,d,f){var p=V("a",o,d);return p.innerHTML=t,p.href="#",p.title=r,p.setAttribute("role","button"),p.setAttribute("aria-label",r),ui(p),Z(p,"click",ue),Z(p,"click",f,this),Z(p,"click",this._refocusOnMap,this),p},_updateDisabled:function(){var t=this._map,r="leaflet-disabled";lt(this._zoomInButton,r),lt(this._zoomOutButton,r),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(j(this._zoomOutButton,r),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(j(this._zoomInButton,r),this._zoomInButton.setAttribute("aria-disabled","true"))}});W.mergeOptions({zoomControl:!0}),W.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new tr,this.addControl(this.zoomControl))});var Wu=function(t){return new tr(t)},Ks=Ot.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var r="leaflet-control-scale",o=V("div",r),d=this.options;return this._addScales(d,r+"-line",o),t.on(d.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),o},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,r,o){t.metric&&(this._mScale=V("div",r,o)),t.imperial&&(this._iScale=V("div",r,o))},_update:function(){var t=this._map,r=t.getSize().y/2,o=t.distance(t.containerPointToLatLng([0,r]),t.containerPointToLatLng([this.options.maxWidth,r]));this._updateScales(o)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var r=this._getRoundNum(t),o=r<1e3?r+" m":r/1e3+" km";this._updateScale(this._mScale,o,r/t)},_updateImperial:function(t){var r=t*3.2808399,o,d,f;r>5280?(o=r/5280,d=this._getRoundNum(o),this._updateScale(this._iScale,d+" mi",d/o)):(f=this._getRoundNum(r),this._updateScale(this._iScale,f+" ft",f/r))},_updateScale:function(t,r,o){t.style.width=Math.round(this.options.maxWidth*o)+"px",t.innerHTML=r},_getRoundNum:function(t){var r=Math.pow(10,(Math.floor(t)+"").length-1),o=t/r;return o=o>=10?10:o>=5?5:o>=3?3:o>=2?2:1,r*o}}),Vu=function(t){return new Ks(t)},Ju='',er=Ot.extend({options:{position:"bottomright",prefix:''+(G.inlineSvg?Ju+" ":"")+"Leaflet"},initialize:function(t){S(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=V("div","leaflet-control-attribution"),ui(this._container);for(var r in t._layers)t._layers[r].getAttribution&&this.addAttribution(t._layers[r].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var r in this._attributions)this._attributions[r]&&t.push(r);var o=[];this.options.prefix&&o.push(this.options.prefix),t.length&&o.push(t.join(", ")),this._container.innerHTML=o.join(' ')}}});W.mergeOptions({attributionControl:!0}),W.addInitHook(function(){this.options.attributionControl&&new er().addTo(this)});var Ku=function(t){return new er(t)};Ot.Layers=Js,Ot.Zoom=tr,Ot.Scale=Ks,Ot.Attribution=er,fi.layers=$u,fi.zoom=Wu,fi.scale=Vu,fi.attribution=Ku;var Zt=qt.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Zt.addTo=function(t,r){return t.addHandler(r,this),this};var Xu={Events:kt},Xs=G.touch?"touchstart mousedown":"mousedown",re=ri.extend({options:{clickTolerance:3},initialize:function(t,r,o,d){S(this,d),this._element=t,this._dragStartTarget=r||t,this._preventOutline=o},enable:function(){this._enabled||(Z(this._dragStartTarget,Xs,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(re._dragging===this&&this.finishDrag(!0),tt(this._dragStartTarget,Xs,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!Dn(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){re._dragging===this&&this.finishDrag();return}if(!(re._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(re._dragging=this,this._preventOutline&&Wn(this._element),Hn(),hi(),!this._moving)){this.fire("down");var r=t.touches?t.touches[0]:t,o=js(this._element);this._startPoint=new D(r.clientX,r.clientY),this._startPos=ce(this._element),this._parentScale=Vn(o);var d=t.type==="mousedown";Z(document,d?"mousemove":"touchmove",this._onMove,this),Z(document,d?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var r=t.touches&&t.touches.length===1?t.touches[0]:t,o=new D(r.clientX,r.clientY)._subtract(this._startPoint);!o.x&&!o.y||Math.abs(o.x)+Math.abs(o.y)p&&(y=b,p=M);p>o&&(r[y]=1,nr(t,r,o,d,y),nr(t,r,o,y,f))}function ef(t,r){for(var o=[t[0]],d=1,f=0,p=t.length;dr&&(o.push(t[d]),f=d);return fr.max.x&&(o|=2),t.yr.max.y&&(o|=8),o}function nf(t,r){var o=r.x-t.x,d=r.y-t.y;return o*o+d*d}function pi(t,r,o,d){var f=r.x,p=r.y,y=o.x-f,b=o.y-p,M=y*y+b*b,P;return M>0&&(P=((t.x-f)*y+(t.y-p)*b)/M,P>1?(f=o.x,p=o.y):P>0&&(f+=y*P,p+=b*P)),y=t.x-f,b=t.y-p,d?y*y+b*b:new D(f,p)}function zt(t){return!I(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function ra(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),zt(t)}function sa(t,r){var o,d,f,p,y,b,M,P;if(!t||t.length===0)throw new Error("latlngs not passed");zt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var N=$([0,0]),R=ct(t),U=R.getNorthWest().distanceTo(R.getSouthWest())*R.getNorthEast().distanceTo(R.getNorthWest());U<1700&&(N=ir(t));var vt=t.length,ft=[];for(o=0;od){M=(p-d)/f,P=[b.x-M*(b.x-y.x),b.y-M*(b.y-y.y)];break}var Pt=r.unproject(q(P));return $([Pt.lat+N.lat,Pt.lng+N.lng])}var rf={__proto__:null,simplify:ta,pointToSegmentDistance:ea,closestPointOnSegment:Yu,clipSegment:na,_getEdgeIntersection:$i,_getBitCode:fe,_sqClosestPointOnSegment:pi,isFlat:zt,_flat:ra,polylineCenter:sa},rr={project:function(t){return new D(t.lng,t.lat)},unproject:function(t){return new Y(t.y,t.x)},bounds:new nt([-180,-90],[180,90])},sr={R:6378137,R_MINOR:6356752314245179e-9,bounds:new nt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var r=Math.PI/180,o=this.R,d=t.lat*r,f=this.R_MINOR/o,p=Math.sqrt(1-f*f),y=p*Math.sin(d),b=Math.tan(Math.PI/4-d/2)/Math.pow((1-y)/(1+y),p/2);return d=-o*Math.log(Math.max(b,1e-10)),new D(t.lng*r*o,d)},unproject:function(t){for(var r=180/Math.PI,o=this.R,d=this.R_MINOR/o,f=Math.sqrt(1-d*d),p=Math.exp(-t.y/o),y=Math.PI/2-2*Math.atan(p),b=0,M=.1,P;b<15&&Math.abs(M)>1e-7;b++)P=f*Math.sin(y),P=Math.pow((1-P)/(1+P),f/2),M=Math.PI/2-2*Math.atan(p*P)-y,y+=M;return new Y(y*r,t.x*r/o)}},sf={__proto__:null,LonLat:rr,Mercator:sr,SphericalMercator:Tn},af=a({},ne,{code:"EPSG:3395",projection:sr,transformation:(function(){var t=.5/(Math.PI*sr.R);return si(t,.5,-t,.5)})()}),aa=a({},ne,{code:"EPSG:4326",projection:rr,transformation:si(1/180,1,-1/180,.5)}),of=a({},$t,{projection:rr,transformation:si(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,r){var o=r.lng-t.lng,d=r.lat-t.lat;return Math.sqrt(o*o+d*d)},infinite:!0});$t.Earth=ne,$t.EPSG3395=af,$t.EPSG3857=In,$t.EPSG900913=uu,$t.EPSG4326=aa,$t.Simple=of;var Rt=ri.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[u(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[u(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var r=t.target;if(r.hasLayer(this)){if(this._map=r,this._zoomAnimated=r._zoomAnimated,this.getEvents){var o=this.getEvents();r.on(o,this),this.once("remove",function(){r.off(o,this)},this)}this.onAdd(r),this.fire("add"),r.fire("layeradd",{layer:this})}}});W.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var r=u(t);return this._layers[r]?this:(this._layers[r]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var r=u(t);return this._layers[r]?(this._loaded&&t.onRemove(this),delete this._layers[r],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return u(t)in this._layers},eachLayer:function(t,r){for(var o in this._layers)t.call(r,this._layers[o]);return this},_addLayers:function(t){t=t?I(t)?t:[t]:[];for(var r=0,o=t.length;rthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&r[0]instanceof Y&&r[0].equals(r[o-1])&&r.pop(),r},_setLatLngs:function(t){Vt.prototype._setLatLngs.call(this,t),zt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return zt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,r=this.options.weight,o=new D(r,r);if(t=new nt(t.min.subtract(o),t.max.add(o)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var d=0,f=this._rings.length,p;dt.y!=f.y>t.y&&t.x<(f.x-d.x)*(t.y-d.y)/(f.y-d.y)+d.x&&(r=!r);return r||Vt.prototype._containsPoint.call(this,t,!0)}});function mf(t,r){return new ze(t,r)}var Jt=Wt.extend({initialize:function(t,r){S(this,r),this._layers={},t&&this.addData(t)},addData:function(t){var r=I(t)?t:t.features,o,d,f;if(r){for(o=0,d=r.length;o0&&f.push(f[0].slice()),f}function Ie(t,r){return t.feature?a({},t.feature,{geometry:r}):Qi(r)}function Qi(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var hr={toGeoJSON:function(t){return Ie(this,{type:"Point",coordinates:lr(this.getLatLng(),t)})}};Wi.include(hr),ar.include(hr),Vi.include(hr),Vt.include({toGeoJSON:function(t){var r=!zt(this._latlngs),o=Xi(this._latlngs,r?1:0,!1,t);return Ie(this,{type:(r?"Multi":"")+"LineString",coordinates:o})}}),ze.include({toGeoJSON:function(t){var r=!zt(this._latlngs),o=r&&!zt(this._latlngs[0]),d=Xi(this._latlngs,o?2:r?1:0,!0,t);return r||(d=[d]),Ie(this,{type:(o?"Multi":"")+"Polygon",coordinates:d})}}),Ce.include({toMultiPoint:function(t){var r=[];return this.eachLayer(function(o){r.push(o.toGeoJSON(t).geometry.coordinates)}),Ie(this,{type:"MultiPoint",coordinates:r})},toGeoJSON:function(t){var r=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(r==="MultiPoint")return this.toMultiPoint(t);var o=r==="GeometryCollection",d=[];return this.eachLayer(function(f){if(f.toGeoJSON){var p=f.toGeoJSON(t);if(o)d.push(p.geometry);else{var y=Qi(p);y.type==="FeatureCollection"?d.push.apply(d,y.features):d.push(y)}}}),o?Ie(this,{geometries:d,type:"GeometryCollection"}):{type:"FeatureCollection",features:d}}});function ha(t,r){return new Jt(t,r)}var _f=ha,Yi=Rt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,r,o){this._url=t,this._bounds=ct(r),S(this,o)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(j(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){rt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&Ae(this._image),this},bringToBack:function(){return this._map&&Le(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=ct(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",r=this._image=t?this._url:V("img");if(j(r,"leaflet-image-layer"),this._zoomAnimated&&j(r,"leaflet-zoom-animated"),this.options.className&&j(r,this.options.className),r.onselectstart=g,r.onmousemove=g,r.onload=h(this.fire,this,"load"),r.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(r.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=r.src;return}r.src=this._url,r.alt=this.options.alt},_animateZoom:function(t){var r=this._map.getZoomScale(t.zoom),o=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;he(this._image,o,r)},_reset:function(){var t=this._image,r=new nt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),o=r.getSize();dt(t,r.min),t.style.width=o.x+"px",t.style.height=o.y+"px"},_updateOpacity:function(){Tt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),gf=function(t,r,o){return new Yi(t,r,o)},ca=Yi.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",r=this._image=t?this._url:V("video");if(j(r,"leaflet-image-layer"),this._zoomAnimated&&j(r,"leaflet-zoom-animated"),this.options.className&&j(r,this.options.className),r.onselectstart=g,r.onmousemove=g,r.onloadeddata=h(this.fire,this,"load"),t){for(var o=r.getElementsByTagName("source"),d=[],f=0;f0?d:[r.src];return}I(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(r.style,"objectFit")&&(r.style.objectFit="fill"),r.autoplay=!!this.options.autoplay,r.loop=!!this.options.loop,r.muted=!!this.options.muted,r.playsInline=!!this.options.playsInline;for(var p=0;pf?(r.height=f+"px",j(t,p)):lt(t,p),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var r=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),o=this._getAnchor();dt(this._container,r.add(o))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,r=parseInt(li(this._container,"marginBottom"),10)||0,o=this._container.offsetHeight+r,d=this._containerWidth,f=new D(this._containerLeft,-o-this._containerBottom);f._add(ce(this._container));var p=t.layerPointToContainerPoint(f),y=q(this.options.autoPanPadding),b=q(this.options.autoPanPaddingTopLeft||y),M=q(this.options.autoPanPaddingBottomRight||y),P=t.getSize(),N=0,R=0;p.x+d+M.x>P.x&&(N=p.x+d-P.x+M.x),p.x-N-b.x<0&&(N=p.x-b.x),p.y+o+M.y>P.y&&(R=p.y+o-P.y+M.y),p.y-R-b.y<0&&(R=p.y-b.y),(N||R)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([N,R]))}},_getAnchor:function(){return q(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),bf=function(t,r){return new tn(t,r)};W.mergeOptions({closePopupOnClick:!0}),W.include({openPopup:function(t,r,o){return this._initOverlay(tn,t,r,o).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),Rt.include({bindPopup:function(t,r){return this._popup=this._initOverlay(tn,this._popup,t,r),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Wt||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){ue(t);var r=t.layer||t.target;if(this._popup._source===r&&!(r instanceof se)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=r,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var en=jt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){jt.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){jt.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=jt.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",r=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=V("div",r),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+u(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var r,o,d=this._map,f=this._container,p=d.latLngToContainerPoint(d.getCenter()),y=d.layerPointToContainerPoint(t),b=this.options.direction,M=f.offsetWidth,P=f.offsetHeight,N=q(this.options.offset),R=this._getAnchor();b==="top"?(r=M/2,o=P):b==="bottom"?(r=M/2,o=0):b==="center"?(r=M/2,o=P/2):b==="right"?(r=0,o=P/2):b==="left"?(r=M,o=P/2):y.xthis.options.maxZoom||od?this._retainParent(f,p,y,d):!1)},_retainChildren:function(t,r,o,d){for(var f=2*t;f<2*t+2;f++)for(var p=2*r;p<2*r+2;p++){var y=new D(f,p);y.z=o+1;var b=this._tileCoordsToKey(y),M=this._tiles[b];if(M&&M.active){M.retain=!0;continue}else M&&M.loaded&&(M.retain=!0);o+1this.options.maxZoom||this.options.minZoom!==void 0&&f1){this._setView(t,o);return}for(var R=f.min.y;R<=f.max.y;R++)for(var U=f.min.x;U<=f.max.x;U++){var vt=new D(U,R);if(vt.z=this._tileZoom,!!this._isValidTile(vt)){var ft=this._tiles[this._tileCoordsToKey(vt)];ft?ft.current=!0:y.push(vt)}}if(y.sort(function(Pt,Ge){return Pt.distanceTo(p)-Ge.distanceTo(p)}),y.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var It=document.createDocumentFragment();for(U=0;Uo.max.x)||!r.wrapLat&&(t.yo.max.y))return!1}if(!this.options.bounds)return!0;var d=this._tileCoordsToBounds(t);return ct(this.options.bounds).overlaps(d)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var r=this._map,o=this.getTileSize(),d=t.scaleBy(o),f=d.add(o),p=r.unproject(d,t.z),y=r.unproject(f,t.z);return[p,y]},_tileCoordsToBounds:function(t){var r=this._tileCoordsToNwSe(t),o=new Et(r[0],r[1]);return this.options.noWrap||(o=this._map.wrapLatLngBounds(o)),o},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var r=t.split(":"),o=new D(+r[0],+r[1]);return o.z=+r[2],o},_removeTile:function(t){var r=this._tiles[t];r&&(rt(r.el),delete this._tiles[t],this.fire("tileunload",{tile:r.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){j(t,"leaflet-tile");var r=this.getTileSize();t.style.width=r.x+"px",t.style.height=r.y+"px",t.onselectstart=g,t.onmousemove=g,G.ielt9&&this.options.opacity<1&&Tt(t,this.options.opacity)},_addTile:function(t,r){var o=this._getTilePos(t),d=this._tileCoordsToKey(t),f=this.createTile(this._wrapCoords(t),h(this._tileReady,this,t));this._initTile(f),this.createTile.length<2&&Q(h(this._tileReady,this,t,null,f)),dt(f,o),this._tiles[d]={el:f,coords:t,current:!0},r.appendChild(f),this.fire("tileloadstart",{tile:f,coords:t})},_tileReady:function(t,r,o){r&&this.fire("tileerror",{error:r,tile:o,coords:t});var d=this._tileCoordsToKey(t);o=this._tiles[d],o&&(o.loaded=+new Date,this._map._fadeAnimated?(Tt(o.el,0),ht(this._fadeFrame),this._fadeFrame=Q(this._updateOpacity,this)):(o.active=!0,this._pruneTiles()),r||(j(o.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:o.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),G.ielt9||!this._map._fadeAnimated?Q(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var r=new D(this._wrapX?v(t.x,this._wrapX):t.x,this._wrapY?v(t.y,this._wrapY):t.y);return r.z=t.z,r},_pxBoundsToTileRange:function(t){var r=this.getTileSize();return new nt(t.min.unscaleBy(r).floor(),t.max.unscaleBy(r).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Mf(t){return new _i(t)}var Ne=_i.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,r){this._url=t,r=S(this,r),r.detectRetina&&G.retina&&r.maxZoom>0?(r.tileSize=Math.floor(r.tileSize/2),r.zoomReverse?(r.zoomOffset--,r.minZoom=Math.min(r.maxZoom,r.minZoom+1)):(r.zoomOffset++,r.maxZoom=Math.max(r.minZoom,r.maxZoom-1)),r.minZoom=Math.max(0,r.minZoom)):r.zoomReverse?r.minZoom=Math.min(r.maxZoom,r.minZoom):r.maxZoom=Math.max(r.minZoom,r.maxZoom),typeof r.subdomains=="string"&&(r.subdomains=r.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,r){return this._url===t&&r===void 0&&(r=!0),this._url=t,r||this.redraw(),this},createTile:function(t,r){var o=document.createElement("img");return Z(o,"load",h(this._tileOnLoad,this,r,o)),Z(o,"error",h(this._tileOnError,this,r,o)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(o.referrerPolicy=this.options.referrerPolicy),o.alt="",o.src=this.getTileUrl(t),o},getTileUrl:function(t){var r={r:G.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-t.y;this.options.tms&&(r.y=o),r["-y"]=o}return k(this._url,a(r,this.options))},_tileOnLoad:function(t,r){G.ielt9?setTimeout(h(t,this,null,r),0):t(null,r)},_tileOnError:function(t,r,o){var d=this.options.errorTileUrl;d&&r.getAttribute("src")!==d&&(r.src=d),t(o,r)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,r=this.options.maxZoom,o=this.options.zoomReverse,d=this.options.zoomOffset;return o&&(t=r-t),t+d},_getSubdomain:function(t){var r=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[r]},_abortLoading:function(){var t,r;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(r=this._tiles[t].el,r.onload=g,r.onerror=g,!r.complete)){r.src=H;var o=this._tiles[t].coords;rt(r),delete this._tiles[t],this.fire("tileabort",{tile:r,coords:o})}},_removeTile:function(t){var r=this._tiles[t];if(r)return r.el.setAttribute("src",H),_i.prototype._removeTile.call(this,t)},_tileReady:function(t,r,o){if(!(!this._map||o&&o.getAttribute("src")===H))return _i.prototype._tileReady.call(this,t,r,o)}});function fa(t,r){return new Ne(t,r)}var pa=Ne.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,r){this._url=t;var o=a({},this.defaultWmsParams);for(var d in r)d in this.options||(o[d]=r[d]);r=S(this,r);var f=r.detectRetina&&G.retina?2:1,p=this.getTileSize();o.width=p.x*f,o.height=p.y*f,this.wmsParams=o},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var r=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[r]=this._crs.code,Ne.prototype.onAdd.call(this,t)},getTileUrl:function(t){var r=this._tileCoordsToNwSe(t),o=this._crs,d=St(o.project(r[0]),o.project(r[1])),f=d.min,p=d.max,y=(this._wmsVersion>=1.3&&this._crs===aa?[f.y,f.x,p.y,p.x]:[f.x,f.y,p.x,p.y]).join(","),b=Ne.prototype.getTileUrl.call(this,t);return b+E(this.wmsParams,b,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+y},setParams:function(t,r){return a(this.wmsParams,t),r||this.redraw(),this}});function Sf(t,r){return new pa(t,r)}Ne.WMS=pa,fa.wms=Sf;var Kt=Rt.extend({options:{padding:.1},initialize:function(t){S(this,t),u(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),j(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,r){var o=this._map.getZoomScale(r,this._zoom),d=this._map.getSize().multiplyBy(.5+this.options.padding),f=this._map.project(this._center,r),p=d.multiplyBy(-o).add(f).subtract(this._map._getNewPixelOrigin(t,r));G.any3d?he(this._container,p,o):dt(this._container,p)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,r=this._map.getSize(),o=this._map.containerPointToLayerPoint(r.multiplyBy(-t)).round();this._bounds=new nt(o,o.add(r.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ma=Kt.extend({options:{tolerance:0},getEvents:function(){var t=Kt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Kt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Z(t,"mousemove",this._onMouseMove,this),Z(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Z(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){ht(this._redrawRequest),delete this._ctx,rt(this._container),tt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var r in this._layers)t=this._layers[r],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Kt.prototype._update.call(this);var t=this._bounds,r=this._container,o=t.getSize(),d=G.retina?2:1;dt(r,t.min),r.width=d*o.x,r.height=d*o.y,r.style.width=o.x+"px",r.style.height=o.y+"px",G.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Kt.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[u(t)]=t;var r=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=r),this._drawLast=r,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var r=t._order,o=r.next,d=r.prev;o?o.prev=d:this._drawLast=d,d?d.next=o:this._drawFirst=o,delete t._order,delete this._layers[u(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var r=t.options.dashArray.split(/[, ]+/),o=[],d,f;for(f=0;f')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Ef={_initContainer:function(){this._container=V("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Kt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var r=t._container=gi("shape");j(r,"leaflet-vml-shape "+(this.options.className||"")),r.coordsize="1 1",t._path=gi("path"),r.appendChild(t._path),this._updateStyle(t),this._layers[u(t)]=t},_addPath:function(t){var r=t._container;this._container.appendChild(r),t.options.interactive&&t.addInteractiveTarget(r)},_removePath:function(t){var r=t._container;rt(r),t.removeInteractiveTarget(r),delete this._layers[u(t)]},_updateStyle:function(t){var r=t._stroke,o=t._fill,d=t.options,f=t._container;f.stroked=!!d.stroke,f.filled=!!d.fill,d.stroke?(r||(r=t._stroke=gi("stroke")),f.appendChild(r),r.weight=d.weight+"px",r.color=d.color,r.opacity=d.opacity,d.dashArray?r.dashStyle=I(d.dashArray)?d.dashArray.join(" "):d.dashArray.replace(/( *, *)/g," "):r.dashStyle="",r.endcap=d.lineCap.replace("butt","flat"),r.joinstyle=d.lineJoin):r&&(f.removeChild(r),t._stroke=null),d.fill?(o||(o=t._fill=gi("fill")),f.appendChild(o),o.color=d.fillColor||d.color,o.opacity=d.fillOpacity):o&&(f.removeChild(o),t._fill=null)},_updateCircle:function(t){var r=t._point.round(),o=Math.round(t._radius),d=Math.round(t._radiusY||o);this._setPath(t,t._empty()?"M0 0":"AL "+r.x+","+r.y+" "+o+","+d+" 0,"+65535*360)},_setPath:function(t,r){t._path.v=r},_bringToFront:function(t){Ae(t._container)},_bringToBack:function(t){Le(t._container)}},nn=G.vml?gi:bs,vi=Kt.extend({_initContainer:function(){this._container=nn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=nn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){rt(this._container),tt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Kt.prototype._update.call(this);var t=this._bounds,r=t.getSize(),o=this._container;(!this._svgSize||!this._svgSize.equals(r))&&(this._svgSize=r,o.setAttribute("width",r.x),o.setAttribute("height",r.y)),dt(o,t.min),o.setAttribute("viewBox",[t.min.x,t.min.y,r.x,r.y].join(" ")),this.fire("update")}},_initPath:function(t){var r=t._path=nn("path");t.options.className&&j(r,t.options.className),t.options.interactive&&j(r,"leaflet-interactive"),this._updateStyle(t),this._layers[u(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){rt(t._path),t.removeInteractiveTarget(t._path),delete this._layers[u(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var r=t._path,o=t.options;r&&(o.stroke?(r.setAttribute("stroke",o.color),r.setAttribute("stroke-opacity",o.opacity),r.setAttribute("stroke-width",o.weight),r.setAttribute("stroke-linecap",o.lineCap),r.setAttribute("stroke-linejoin",o.lineJoin),o.dashArray?r.setAttribute("stroke-dasharray",o.dashArray):r.removeAttribute("stroke-dasharray"),o.dashOffset?r.setAttribute("stroke-dashoffset",o.dashOffset):r.removeAttribute("stroke-dashoffset")):r.setAttribute("stroke","none"),o.fill?(r.setAttribute("fill",o.fillColor||o.color),r.setAttribute("fill-opacity",o.fillOpacity),r.setAttribute("fill-rule",o.fillRule||"evenodd")):r.setAttribute("fill","none"))},_updatePoly:function(t,r){this._setPath(t,ws(t._parts,r))},_updateCircle:function(t){var r=t._point,o=Math.max(Math.round(t._radius),1),d=Math.max(Math.round(t._radiusY),1)||o,f="a"+o+","+d+" 0 1,0 ",p=t._empty()?"M0 0":"M"+(r.x-o)+","+r.y+f+o*2+",0 "+f+-o*2+",0 ";this._setPath(t,p)},_setPath:function(t,r){t._path.setAttribute("d",r)},_bringToFront:function(t){Ae(t._path)},_bringToBack:function(t){Le(t._path)}});G.vml&&vi.include(Ef);function ga(t){return G.svg||G.vml?new vi(t):null}W.include({getRenderer:function(t){var r=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return r||(r=this._renderer=this._createRenderer()),this.hasLayer(r)||this.addLayer(r),r},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var r=this._paneRenderers[t];return r===void 0&&(r=this._createRenderer({pane:t}),this._paneRenderers[t]=r),r},_createRenderer:function(t){return this.options.preferCanvas&&_a(t)||ga(t)}});var va=ze.extend({initialize:function(t,r){ze.prototype.initialize.call(this,this._boundsToLatLngs(t),r)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=ct(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Pf(t,r){return new va(t,r)}vi.create=nn,vi.pointsToPath=ws,Jt.geometryToLayer=Ji,Jt.coordsToLatLng=or,Jt.coordsToLatLngs=Ki,Jt.latLngToCoords=lr,Jt.latLngsToCoords=Xi,Jt.getFeature=Ie,Jt.asFeature=Qi,W.mergeOptions({boxZoom:!0});var ya=Zt.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Z(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){tt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){rt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),hi(),Hn(),this._startPoint=this._map.mouseEventToContainerPoint(t),Z(document,{contextmenu:ue,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=V("div","leaflet-zoom-box",this._container),j(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var r=new nt(this._point,this._startPoint),o=r.getSize();dt(this._box,r.min),this._box.style.width=o.x+"px",this._box.style.height=o.y+"px"},_finish:function(){this._moved&&(rt(this._box),lt(this._container,"leaflet-crosshair")),ci(),Un(),tt(document,{contextmenu:ue,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var r=new Et(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(r).fire("boxzoomend",{boxZoomBounds:r})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});W.addInitHook("addHandler","boxZoom",ya),W.mergeOptions({doubleClickZoom:!0});var ba=Zt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var r=this._map,o=r.getZoom(),d=r.options.zoomDelta,f=t.originalEvent.shiftKey?o-d:o+d;r.options.doubleClickZoom==="center"?r.setZoom(f):r.setZoomAround(t.containerPoint,f)}});W.addInitHook("addHandler","doubleClickZoom",ba),W.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var wa=Zt.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new re(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}j(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){lt(this._map._container,"leaflet-grab"),lt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var r=ct(this._map.options.maxBounds);this._offsetLimit=St(this._map.latLngToContainerPoint(r.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(r.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var r=this._lastTime=+new Date,o=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(o),this._times.push(r),this._prunePositions(r)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),r=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=r.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,r){return t-(t-r)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),r=this._offsetLimit;t.xr.max.x&&(t.x=this._viscousLimit(t.x,r.max.x)),t.y>r.max.y&&(t.y=this._viscousLimit(t.y,r.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,r=Math.round(t/2),o=this._initialWorldOffset,d=this._draggable._newPos.x,f=(d-r+o)%t+r-o,p=(d+r+o)%t-r-o,y=Math.abs(f+o)0?p:-p))-r;this._delta=0,this._startTime=null,y&&(t.options.scrollWheelZoom==="center"?t.setZoom(r+y):t.setZoomAround(this._lastMousePos,r+y))}});W.addInitHook("addHandler","scrollWheelZoom",Ma);var kf=600;W.mergeOptions({tapHold:G.touchNative&&G.safari&&G.mobile,tapTolerance:15});var Sa=Zt.extend({addHooks:function(){Z(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){tt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var r=t.touches[0];this._startPos=this._newPos=new D(r.clientX,r.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(Z(document,"touchend",mt),Z(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",r))},this),kf),Z(document,"touchend touchcancel contextmenu",this._cancel,this),Z(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){tt(document,"touchend",mt),tt(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),tt(document,"touchend touchcancel contextmenu",this._cancel,this),tt(document,"touchmove",this._onMove,this)},_onMove:function(t){var r=t.touches[0];this._newPos=new D(r.clientX,r.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,r){var o=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY});o._simulated=!0,r.target.dispatchEvent(o)}});W.addInitHook("addHandler","tapHold",Sa),W.mergeOptions({touchZoom:G.touch,bounceAtZoomLimits:!0});var Ea=Zt.extend({addHooks:function(){j(this._map._container,"leaflet-touch-zoom"),Z(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){lt(this._map._container,"leaflet-touch-zoom"),tt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var r=this._map;if(!(!t.touches||t.touches.length!==2||r._animatingZoom||this._zooming)){var o=r.mouseEventToContainerPoint(t.touches[0]),d=r.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=r.getSize()._divideBy(2),this._startLatLng=r.containerPointToLatLng(this._centerPoint),r.options.touchZoom!=="center"&&(this._pinchStartLatLng=r.containerPointToLatLng(o.add(d)._divideBy(2))),this._startDist=o.distanceTo(d),this._startZoom=r.getZoom(),this._moved=!1,this._zooming=!0,r._stop(),Z(document,"touchmove",this._onTouchMove,this),Z(document,"touchend touchcancel",this._onTouchEnd,this),mt(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var r=this._map,o=r.mouseEventToContainerPoint(t.touches[0]),d=r.mouseEventToContainerPoint(t.touches[1]),f=o.distanceTo(d)/this._startDist;if(this._zoom=r.getScaleZoom(f,this._startZoom),!r.options.bounceAtZoomLimits&&(this._zoomr.getMaxZoom()&&f>1)&&(this._zoom=r._limitZoom(this._zoom)),r.options.touchZoom==="center"){if(this._center=this._startLatLng,f===1)return}else{var p=o._add(d)._divideBy(2)._subtract(this._centerPoint);if(f===1&&p.x===0&&p.y===0)return;this._center=r.unproject(r.project(this._pinchStartLatLng,this._zoom).subtract(p),this._zoom)}this._moved||(r._moveStart(!0,!1),this._moved=!0),ht(this._animRequest);var y=h(r._move,r,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Q(y,this,!0),mt(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ht(this._animRequest),tt(document,"touchmove",this._onTouchMove,this),tt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});W.addInitHook("addHandler","touchZoom",Ea),W.BoxZoom=ya,W.DoubleClickZoom=ba,W.Drag=wa,W.Keyboard=xa,W.ScrollWheelZoom=Ma,W.TapHold=Sa,W.TouchZoom=Ea,n.Bounds=nt,n.Browser=G,n.CRS=$t,n.Canvas=ma,n.Circle=ar,n.CircleMarker=Vi,n.Class=qt,n.Control=Ot,n.DivIcon=ua,n.DivOverlay=jt,n.DomEvent=Hu,n.DomUtil=Zu,n.Draggable=re,n.Evented=ri,n.FeatureGroup=Wt,n.GeoJSON=Jt,n.GridLayer=_i,n.Handler=Zt,n.Icon=Te,n.ImageOverlay=Yi,n.LatLng=Y,n.LatLngBounds=Et,n.Layer=Rt,n.LayerGroup=Ce,n.LineUtil=rf,n.Map=W,n.Marker=Wi,n.Mixin=Xu,n.Path=se,n.Point=D,n.PolyUtil=Qu,n.Polygon=ze,n.Polyline=Vt,n.Popup=tn,n.PosAnimation=Vs,n.Projection=sf,n.Rectangle=va,n.Renderer=Kt,n.SVG=vi,n.SVGOverlay=da,n.TileLayer=Ne,n.Tooltip=en,n.Transformation=zn,n.Util=ie,n.VideoOverlay=ca,n.bind=h,n.bounds=St,n.canvas=_a,n.circle=ff,n.circleMarker=uf,n.control=fi,n.divIcon=xf,n.extend=a,n.featureGroup=hf,n.geoJSON=ha,n.geoJson=_f,n.gridLayer=Mf,n.icon=cf,n.imageOverlay=gf,n.latLng=$,n.latLngBounds=ct,n.layerGroup=lf,n.map=Uu,n.marker=df,n.point=q,n.polygon=mf,n.polyline=pf,n.popup=bf,n.rectangle=Pf,n.setOptions=S,n.stamp=u,n.svg=ga,n.svgOverlay=yf,n.tileLayer=fa,n.tooltip=wf,n.transformation=si,n.version=s,n.videoOverlay=vf;var Af=window.L;n.noConflict=function(){return window.L=Af,this},window.L=n}))})(Re,Re.exports)),Re.exports}var fr=ur();const O=Ca(fr),Ia=La({__proto__:null,default:O},[fr]);function Na(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)i("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),i("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");i("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),i("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var ae=1,oe=2,pe=3,Ga=4,sn=5,pr=6378137,Oa=6356752314e-3,mr=.0066943799901413165,Be=484813681109536e-20,A=Math.PI/2,Ra=.16666666666666666,Ba=.04722222222222222,qa=.022156084656084655,T=1e-10,st=.017453292519943295,yt=57.29577951308232,K=Math.PI/4,qe=Math.PI*2,at=3.14159265359,bt={};bt.greenwich=0,bt.lisbon=-9.131906111111,bt.paris=2.337229166667,bt.bogota=-74.080916666667,bt.madrid=-3.687938888889,bt.rome=12.452333333333,bt.bern=7.439583333333,bt.jakarta=106.807719444444,bt.ferro=-17.666666666667,bt.brussels=4.367975,bt.stockholm=18.058277777778,bt.athens=23.7163375,bt.oslo=10.722916666667;const Fa={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var _r=/[\s_\-\/\(\)]/g;function Xt(i,e){if(i[e])return i[e];for(var n=Object.keys(i),s=e.toLowerCase().replace(_r,""),a=-1,l,h;++aArray.isArray(s)&&s[0]==="ID");return n&&n.length>=3?{authority:n[1],code:parseInt(n[2],10)}:null}static convertUnit(e,n="unit"){if(!e||e.length<3)return{type:n,name:"unknown",conversion_factor:null};const s=e[1],a=parseFloat(e[2])||null,l=e.find(c=>Array.isArray(c)&&c[0]==="ID"),h=l?{authority:l[1],code:parseInt(l[2],10)}:null;return{type:n,name:s,conversion_factor:a,id:h}}static convertAxis(e){const n=e[1]||"Unknown";let s;const a=n.match(/^\((.)\)$/);if(a){const m=a[1].toUpperCase();if(m==="E")s="east";else if(m==="N")s="north";else if(m==="U")s="up";else throw new Error(`Unknown axis abbreviation: ${m}`)}else s=e[2]?e[2].toLowerCase():"unknown";const l=e.find(m=>Array.isArray(m)&&m[0]==="ORDER"),h=l?parseInt(l[1],10):null,c=e.find(m=>Array.isArray(m)&&(m[0]==="LENGTHUNIT"||m[0]==="ANGLEUNIT"||m[0]==="SCALEUNIT")),u=this.convertUnit(c);return{name:n,direction:s,unit:u,order:h}}static extractAxes(e){return e.filter(n=>Array.isArray(n)&&n[0]==="AXIS").map(n=>this.convertAxis(n)).sort((n,s)=>(n.order||0)-(s.order||0))}static convert(e,n={}){switch(e[0]){case"PROJCRS":n.type="ProjectedCRS",n.name=e[1],n.base_crs=e.find(_=>Array.isArray(_)&&_[0]==="BASEGEOGCRS")?this.convert(e.find(_=>Array.isArray(_)&&_[0]==="BASEGEOGCRS")):null,n.conversion=e.find(_=>Array.isArray(_)&&_[0]==="CONVERSION")?this.convert(e.find(_=>Array.isArray(_)&&_[0]==="CONVERSION")):null;const s=e.find(_=>Array.isArray(_)&&_[0]==="CS");s&&(n.coordinate_system={type:s[1],axis:this.extractAxes(e)});const a=e.find(_=>Array.isArray(_)&&_[0]==="LENGTHUNIT");if(a){const _=this.convertUnit(a);n.coordinate_system.unit=_}n.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":n.type="GeographicCRS",n.name=e[1];const l=e.find(_=>Array.isArray(_)&&(_[0]==="DATUM"||_[0]==="ENSEMBLE"));if(l){const _=this.convert(l);l[0]==="ENSEMBLE"?n.datum_ensemble=_:n.datum=_;const w=e.find(x=>Array.isArray(x)&&x[0]==="PRIMEM");w&&w[1]!=="Greenwich"&&(_.prime_meridian={name:w[1],longitude:parseFloat(w[2])})}n.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},n.id=this.getId(e);break;case"DATUM":n.type="GeodeticReferenceFrame",n.name=e[1],n.ellipsoid=e.find(_=>Array.isArray(_)&&_[0]==="ELLIPSOID")?this.convert(e.find(_=>Array.isArray(_)&&_[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":n.type="DatumEnsemble",n.name=e[1],n.members=e.filter(_=>Array.isArray(_)&&_[0]==="MEMBER").map(_=>({type:"DatumEnsembleMember",name:_[1],id:this.getId(_)}));const h=e.find(_=>Array.isArray(_)&&_[0]==="ENSEMBLEACCURACY");h&&(n.accuracy=parseFloat(h[1]));const c=e.find(_=>Array.isArray(_)&&_[0]==="ELLIPSOID");c&&(n.ellipsoid=this.convert(c)),n.id=this.getId(e);break;case"ELLIPSOID":n.type="Ellipsoid",n.name=e[1],n.semi_major_axis=parseFloat(e[2]),n.inverse_flattening=parseFloat(e[3]),e.find(_=>Array.isArray(_)&&_[0]==="LENGTHUNIT")&&this.convert(e.find(_=>Array.isArray(_)&&_[0]==="LENGTHUNIT"),n);break;case"CONVERSION":n.type="Conversion",n.name=e[1],n.method=e.find(_=>Array.isArray(_)&&_[0]==="METHOD")?this.convert(e.find(_=>Array.isArray(_)&&_[0]==="METHOD")):null,n.parameters=e.filter(_=>Array.isArray(_)&&_[0]==="PARAMETER").map(_=>this.convert(_));break;case"METHOD":n.type="Method",n.name=e[1],n.id=this.getId(e);break;case"PARAMETER":n.type="Parameter",n.name=e[1],n.value=parseFloat(e[2]),n.unit=this.convertUnit(e.find(_=>Array.isArray(_)&&(_[0]==="LENGTHUNIT"||_[0]==="ANGLEUNIT"||_[0]==="SCALEUNIT"))),n.id=this.getId(e);break;case"BOUNDCRS":n.type="BoundCRS";const u=e.find(_=>Array.isArray(_)&&_[0]==="SOURCECRS");if(u){const _=u.find(w=>Array.isArray(w));n.source_crs=_?this.convert(_):null}const m=e.find(_=>Array.isArray(_)&&_[0]==="TARGETCRS");if(m){const _=m.find(w=>Array.isArray(w));n.target_crs=_?this.convert(_):null}const v=e.find(_=>Array.isArray(_)&&_[0]==="ABRIDGEDTRANSFORMATION");v?n.transformation=this.convert(v):n.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(n.type="Transformation",n.name=e[1],n.method=e.find(_=>Array.isArray(_)&&_[0]==="METHOD")?this.convert(e.find(_=>Array.isArray(_)&&_[0]==="METHOD")):null,n.parameters=e.filter(_=>Array.isArray(_)&&(_[0]==="PARAMETER"||_[0]==="PARAMETERFILE")).map(_=>{if(_[0]==="PARAMETER")return this.convert(_);if(_[0]==="PARAMETERFILE")return{name:_[1],value:_[2],id:{authority:"EPSG",code:8656}}}),n.parameters.length===7){const _=n.parameters[6];_.name==="Scale difference"&&(_.value=Math.round((_.value-1)*1e12)/1e6)}n.id=this.getId(e);break;case"AXIS":n.coordinate_system||(n.coordinate_system={type:"unspecified",axis:[]}),n.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const g=this.convertUnit(e,"LinearUnit");n.coordinate_system&&n.coordinate_system.axis&&n.coordinate_system.axis.forEach(_=>{_.unit||(_.unit=g)}),g.conversion_factor&&g.conversion_factor!==1&&n.semi_major_axis&&(n.semi_major_axis={value:n.semi_major_axis,unit:g});break;default:n.keyword=e[0];break}return n}}class Da extends gr{static convert(e,n={}){return super.convert(e,n),n.coordinate_system&&n.coordinate_system.subtype==="Cartesian"&&delete n.coordinate_system,n.usage&&delete n.usage,n}}class Za extends gr{static convert(e,n={}){super.convert(e,n);const s=e.find(l=>Array.isArray(l)&&l[0]==="CS");s&&(n.coordinate_system={subtype:s[1],axis:this.extractAxes(e)});const a=e.find(l=>Array.isArray(l)&&l[0]==="USAGE");if(a){const l=a.find(u=>Array.isArray(u)&&u[0]==="SCOPE"),h=a.find(u=>Array.isArray(u)&&u[0]==="AREA"),c=a.find(u=>Array.isArray(u)&&u[0]==="BBOX");n.usage={},l&&(n.usage.scope=l[1]),h&&(n.usage.area=h[1]),c&&(n.usage.bbox=c.slice(1))}return n}}function ja(i){return i.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(i.find(e=>Array.isArray(e)&&e[0]==="CS")||i[0]==="BOUNDCRS"||i[0]==="PROJCRS"||i[0]==="GEOGCRS","2015")}function Ha(i){return(ja(i)==="2019"?Za:Da).convert(i)}function Ua(i){const e=i.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var Fe=1,vr=2,yr=3,yi=4,br=5,on=-1,$a=/\s/,Wa=/[A-Za-z]/,Va=/[A-Za-z84_]/,bi=/[,\]]/,wr=/[\d\.E\-\+]/;function Ht(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Fe}Ht.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==yi)for(;$a.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case Fe:return this.neutral(i);case vr:return this.keyword(i);case yi:return this.quoted(i);case br:return this.afterquote(i);case yr:return this.number(i);case on:return}},Ht.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=yi;return}if(bi.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},Ht.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Fe;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Fe,this.currentObject=this.stack.pop(),this.currentObject||(this.state=on);return}},Ht.prototype.number=function(i){if(wr.test(i)){this.word+=i;return}if(bi.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},Ht.prototype.quoted=function(i){if(i==='"'){this.state=br;return}this.word+=i},Ht.prototype.keyword=function(i){if(Va.test(i)){this.word+=i;return}if(i==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=Fe;return}if(bi.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},Ht.prototype.neutral=function(i){if(Wa.test(i)){this.word=i,this.state=vr;return}if(i==='"'){this.word="",this.state=yi;return}if(wr.test(i)){this.word=i,this.state=yr;return}if(bi.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},Ht.prototype.output=function(){for(;this.place0?90:-90),i.lat_ts=i.lat1,delete i.lat1):!i.lat_ts&&i.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(i.lat_ts=i.lat0,i.lat0=Nt(i.lat0>0?90:-90),delete i.lat1)}function Mr(i){let e={units:null,to_meter:void 0};return typeof i=="string"?(e.units=i.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):i&&i.name&&(e.units=i.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=i.conversion_factor),e}function Sr(i){return typeof i=="object"?i.value*i.unit.conversion_factor:i}function Er(i,e){i.ellipsoid.radius?(e.a=i.ellipsoid.radius,e.rf=0):(e.a=Sr(i.ellipsoid.semi_major_axis),i.ellipsoid.inverse_flattening!==void 0?e.rf=i.ellipsoid.inverse_flattening:i.ellipsoid.semi_major_axis!==void 0&&i.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-Sr(i.ellipsoid.semi_minor_axis))))}function wi(i,e={}){return!i||typeof i!="object"?i:i.type==="BoundCRS"?(wi(i.source_crs,e),i.transformation&&(i.transformation.method&&i.transformation.method.name==="NTv2"?e.nadgrids=i.transformation.parameters[0].value:e.datum_params=i.transformation.parameters.map(n=>n.value)),e):(Object.keys(i).forEach(n=>{const s=i[n];if(s!==null)switch(n){case"name":if(e.srsCode)break;e.name=s,e.srsCode=s;break;case"type":s==="GeographicCRS"?e.projName="longlat":s==="ProjectedCRS"&&i.conversion&&i.conversion.method&&(e.projName=i.conversion.method.name);break;case"datum":case"datum_ensemble":s.ellipsoid&&(e.ellps=s.ellipsoid.name,Er(s,e)),s.prime_meridian&&(e.from_greenwich=s.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=s.name,Er(s,e);break;case"prime_meridian":e.long0=(s.longitude||0)*Math.PI/180;break;case"coordinate_system":if(s.axis){if(e.axis=s.axis.map(a=>{const l=a.direction;if(l==="east")return"e";if(l==="north")return"n";if(l==="west")return"w";if(l==="south")return"s";throw new Error(`Unknown axis direction: ${l}`)}).join("")+"u",s.unit){const{units:a,to_meter:l}=Mr(s.unit);e.units=a,e.to_meter=l}else if(s.axis[0]&&s.axis[0].unit){const{units:a,to_meter:l}=Mr(s.axis[0].unit);e.units=a,e.to_meter=l}}break;case"id":s.authority&&s.code&&(e.title=s.authority+":"+s.code);break;case"conversion":s.method&&s.method.name&&(e.projName=s.method.name),s.parameters&&s.parameters.forEach(a=>{const l=a.name.toLowerCase().replace(/\s+/g,"_"),h=a.value;a.unit&&a.unit.conversion_factor?e[l]=h*a.unit.conversion_factor:a.unit==="degree"?e[l]=h*Math.PI/180:e[l]=h});break;case"unit":s.name&&(e.units=s.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),s.conversion_factor&&(e.to_meter=s.conversion_factor);break;case"base_crs":wi(s,e),e.datumCode=s.id?s.id.authority+"_"+s.id.code:s.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),xr(e),e)}var Xa=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Qa(i,e){var n=e[0],s=e[1];!(n in i)&&s in i&&(i[n]=i[s],e.length===3&&(i[n]=e[2](i[n])))}function Pr(i){for(var e=Object.keys(i),n=0,s=e.length;n-1}}function so(i){var e=Xt(i,"extension");if(e)return Xt(e,"proj4")}function ao(i){return i[0]==="+"}function oo(i){if(to(i)){if(eo(i))return pt[i];if(io(i)){var e=xi(i);if(ro(e))return pt["EPSG:3857"];var n=so(e);return n?an(n):e}if(ao(i))return an(i)}else return"projName"in i?i:xi(i)}function kr(i,e){i=i||{};var n,s;if(!e)return i;for(s in e)n=e[s],n!==void 0&&(i[s]=n);return i}function Bt(i,e,n){var s=i*e;return n/Math.sqrt(1-s*s)}function De(i){return i<0?-1:1}function z(i,e){return e||Math.abs(i)<=at?i:i-De(i)*qe}function Gt(i,e,n){var s=i*n,a=.5*i;return s=Math.pow((1-s)/(1+s),a),Math.tan(.5*(A-e))/s}function Ze(i,e){for(var n=.5*i,s,a,l=A-2*Math.atan(e),h=0;h<=15;h++)if(s=i*Math.sin(l),a=A-2*Math.atan(e*Math.pow((1-s)/(1+s),n))-l,l+=a,Math.abs(a)<=1e-10)return l;return-9999}function lo(){var i=this.b/this.a;this.es=1-i*i,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Bt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function ho(i){var e=i.x,n=i.y;if(n*yt>90&&n*yt<-90&&e*yt>180&&e*yt<-180)return null;var s,a;if(Math.abs(Math.abs(n)-A)<=T)return null;if(this.sphere)s=this.x0+this.a*this.k0*z(e-this.long0,this.over),a=this.y0+this.a*this.k0*Math.log(Math.tan(K+.5*n));else{var l=Math.sin(n),h=Gt(this.e,n,l);s=this.x0+this.a*this.k0*z(e-this.long0,this.over),a=this.y0-this.a*this.k0*Math.log(h)}return i.x=s,i.y=a,i}function co(i){var e=i.x-this.x0,n=i.y-this.y0,s,a;if(this.sphere)a=A-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var l=Math.exp(-n/(this.a*this.k0));if(a=Ze(this.e,l),a===-9999)return null}return s=z(this.long0+e/(this.a*this.k0),this.over),i.x=s,i.y=a,i}var uo=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const fo={init:lo,forward:ho,inverse:co,names:uo};function po(){}function Ar(i){return i}var Lr=["longlat","identity"],mo=[fo,{init:po,forward:Ar,inverse:Ar,names:Lr}],le={},_e=[];function Cr(i,e){var n=_e.length;return i.names?(_e[n]=i,i.names.forEach(function(s){le[s.toLowerCase()]=n}),this):(console.log(e),!0)}function Tr(i){return i.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function _o(i){if(!i)return!1;var e=i.toLowerCase();if(typeof le[e]<"u"&&_e[le[e]]||(e=Tr(e),e in le&&_e[le[e]]))return _e[le[e]]}function go(){mo.forEach(Cr)}const vo={start:go,add:Cr,get:_o};var zr={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const yo=zr.WGS84;function bo(i,e,n,s){var a=i*i,l=e*e,h=(a-l)/a,c=0;s?(i*=1-h*(Ra+h*(Ba+h*qa)),a=i*i,h=0):c=Math.sqrt(h);var u=(a-l)/l;return{es:h,e:c,ep2:u}}function wo(i,e,n,s,a){if(!i){var l=Xt(zr,s);l||(l=yo),i=l.a,e=l.b,n=l.rf}return n&&!e&&(e=(1-1/n)*i),(n===0||Math.abs(i-e)3&&(c.datum_params[3]!==0||c.datum_params[4]!==0||c.datum_params[5]!==0||c.datum_params[6]!==0)&&(c.datum_type=oe,c.datum_params[3]*=Be,c.datum_params[4]*=Be,c.datum_params[5]*=Be,c.datum_params[6]=c.datum_params[6]/1e6+1)),h&&(c.datum_type=pe,c.grids=h),c.a=n,c.b=s,c.es=a,c.ep2=l,c}var cn={};function So(i,e,n){return e instanceof ArrayBuffer?Eo(i,e,n):{ready:Po(i,e)}}function Eo(i,e,n){var s=!0;n!==void 0&&n.includeErrorFields===!1&&(s=!1);var a=new DataView(e),l=Lo(a),h=Co(a,l),c=To(a,h,l,s),u={header:h,subgrids:c};return cn[i]=u,u}async function Po(i,e){for(var n=[],s=await e.getImageCount(),a=s-1;a>=0;a--){var l=await e.getImage(a),h=await l.readRasters(),c=h,u=[l.getWidth(),l.getHeight()],m=l.getBoundingBox().map(Ir),v=[l.fileDirectory.ModelPixelScale[0],l.fileDirectory.ModelPixelScale[1]].map(Ir),g=m[0]+(u[0]-1)*v[0],_=m[3]-(u[1]-1)*v[1],w=c[0],x=c[1],S=[];for(let k=u[1]-1;k>=0;k--)for(let I=u[0]-1;I>=0;I--){var E=k*u[0]+I;S.push([-Qt(x[E]),Qt(w[E])])}n.push({del:v,lim:u,ll:[-g,_],cvs:S})}var C={header:{nSubgrids:s},subgrids:n};return cn[i]=C,C}function ko(i){if(i===void 0)return null;var e=i.split(",");return e.map(Ao)}function Ao(i){if(i.length===0)return null;var e=i[0]==="@";return e&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:i,mandatory:!e,grid:cn[i]||null,isNull:!1}}function Ir(i){return i*Math.PI/180}function Qt(i){return i/3600*Math.PI/180}function Lo(i){var e=i.getInt32(8,!1);return e===11?!1:(e=i.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function Co(i,e){return{nFields:i.getInt32(8,e),nSubgridFields:i.getInt32(24,e),nSubgrids:i.getInt32(40,e),shiftType:dn(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,e),fromSemiMinorAxis:i.getFloat64(136,e),toSemiMajorAxis:i.getFloat64(152,e),toSemiMinorAxis:i.getFloat64(168,e)}}function dn(i,e,n){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(e,n)))}function To(i,e,n,s){for(var a=176,l=[],h=0;h5e-11?!1:i.datum_type===ae?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]:i.datum_type===oe?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]&&i.datum_params[3]===e.datum_params[3]&&i.datum_params[4]===e.datum_params[4]&&i.datum_params[5]===e.datum_params[5]&&i.datum_params[6]===e.datum_params[6]:!0}function Nr(i,e,n){var s=i.x,a=i.y,l=i.z?i.z:0,h,c,u,m;if(a<-A&&a>-1.001*A)a=-A;else if(a>A&&a<1.001*A)a=A;else{if(a<-A)return{x:-1/0,y:-1/0,z:i.z};if(a>A)return{x:1/0,y:1/0,z:i.z}}return s>Math.PI&&(s-=2*Math.PI),c=Math.sin(a),m=Math.cos(a),u=c*c,h=n/Math.sqrt(1-e*u),{x:(h+l)*m*Math.cos(s),y:(h+l)*m*Math.sin(s),z:(h*(1-e)+l)*c}}function Gr(i,e,n,s){var a=1e-12,l=a*a,h=30,c,u,m,v,g,_,w,x,S,E,C,k,I,B=i.x,H=i.y,F=i.z?i.z:0,J,ot,et;if(c=Math.sqrt(B*B+H*H),u=Math.sqrt(B*B+H*H+F*F),c/nl&&Is.y||w>s.x||Ec&&Math.abs(u.y)>c);if(h<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=z(l.x+n.ll[0]),s.y=l.y+n.ll[1]}else isNaN(l.x)||(s.x=i.x+l.x,s.y=i.y+l.y);return s}function Rr(i,e){var n={x:i.x/e.del[0],y:i.y/e.del[1]},s={x:Math.floor(n.x),y:Math.floor(n.y)},a={x:n.x-1*s.x,y:n.y-1*s.y},l={x:Number.NaN,y:Number.NaN},h;if(s.x<0||s.x>=e.lim[0]||s.y<0||s.y>=e.lim[1])return l;h=s.y*e.lim[0]+s.x;var c={x:e.cvs[h][0],y:e.cvs[h][1]};h++;var u={x:e.cvs[h][0],y:e.cvs[h][1]};h+=e.lim[0];var m={x:e.cvs[h][0],y:e.cvs[h][1]};h--;var v={x:e.cvs[h][0],y:e.cvs[h][1]},g=a.x*a.y,_=a.x*(1-a.y),w=(1-a.x)*(1-a.y),x=(1-a.x)*a.y;return l.x=w*c.x+_*u.x+x*v.x+g*m.x,l.y=w*c.y+_*u.y+x*v.y+g*m.y,l}function Br(i,e,n){var s=n.x,a=n.y,l=n.z||0,h,c,u,m={};for(u=0;u<3;u++)if(!(e&&u===2&&n.z===void 0))switch(u===0?(h=s,"ew".indexOf(i.axis[u])!==-1?c="x":c="y"):u===1?(h=a,"ns".indexOf(i.axis[u])!==-1?c="y":c="x"):(h=l,c="z"),i.axis[u]){case"e":m[c]=h;break;case"w":m[c]=-h;break;case"n":m[c]=h;break;case"s":m[c]=-h;break;case"u":n[c]!==void 0&&(m.z=h);break;case"d":n[c]!==void 0&&(m.z=-h);break;default:return null}return m}function qr(i){var e={x:i[0],y:i[1]};return i.length>2&&(e.z=i[2]),i.length>3&&(e.m=i[3]),e}function Fo(i){Fr(i.x),Fr(i.y)}function Fr(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function Do(i,e){return(i.datum.datum_type===ae||i.datum.datum_type===oe||i.datum.datum_type===pe)&&e.datumCode!=="WGS84"||(e.datum.datum_type===ae||e.datum.datum_type===oe||e.datum.datum_type===pe)&&i.datumCode!=="WGS84"}function Ei(i,e,n,s){var a;Array.isArray(n)?n=qr(n):n={x:n.x,y:n.y,z:n.z,m:n.m};var l=n.z!==void 0;if(Fo(n),i.datum&&e.datum&&Do(i,e)&&(a=new At("WGS84"),n=Ei(i,a,n,s),i=a),s&&i.axis!=="enu"&&(n=Br(i,!1,n)),i.projName==="longlat")n={x:n.x*st,y:n.y*st,z:n.z||0};else if(i.to_meter&&(n={x:n.x*i.to_meter,y:n.y*i.to_meter,z:n.z||0}),n=i.inverse(n),!n)return;if(i.from_greenwich&&(n.x+=i.from_greenwich),n=Bo(i.datum,e.datum,n),!!n)return n=n,e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),e.projName==="longlat"?n={x:n.x*yt,y:n.y*yt,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),s&&e.axis!=="enu"?Br(e,!0,n):(n&&!l&&delete n.z,n)}var Dr=At("WGS84");function un(i,e,n,s){var a,l,h;return Array.isArray(n)?(a=Ei(i,e,n,s)||{x:NaN,y:NaN},n.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof a.z=="number"?[a.x,a.y,a.z].concat(n.slice(3)):[a.x,a.y,n[2]].concat(n.slice(3)):[a.x,a.y].concat(n.slice(2)):[a.x,a.y]):(l=Ei(i,e,n,s),h=Object.keys(n),h.length===2||h.forEach(function(c){if(typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(c==="x"||c==="y"||c==="z")return}else if(c==="x"||c==="y")return;l[c]=n[c]}),l)}function Pi(i){return i instanceof At?i:typeof i=="object"&&"oProj"in i?i.oProj:At(i)}function Zo(i,e,n){var s,a,l=!1,h;return typeof e>"u"?(a=Pi(i),s=Dr,l=!0):(typeof e.x<"u"||Array.isArray(e))&&(n=e,a=Pi(i),s=Dr,l=!0),s||(s=Pi(i)),a||(a=Pi(e)),n?un(s,a,n):(h={forward:function(c,u){return un(s,a,c,u)},inverse:function(c,u){return un(a,s,c,u)}},l&&(h.oProj=a),h)}var Zr=6,jr="AJSAJS",Hr="AFAFAF",ge=65,wt=73,Lt=79,je=86,He=90;const jo={forward:Ur,inverse:Ho,toPoint:$r};function Ur(i,e){return e=e||5,Wo(Uo({lat:i[1],lon:i[0]}),e)}function Ho(i){var e=pn(Jr(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function $r(i){var e=pn(Jr(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function fn(i){return i*(Math.PI/180)}function Wr(i){return 180*(i/Math.PI)}function Uo(i){var e=i.lat,n=i.lon,s=6378137,a=.00669438,l=.9996,h,c,u,m,v,g,_,w=fn(e),x=fn(n),S,E;E=Math.floor((n+180)/6)+1,n===180&&(E=60),e>=56&&e<64&&n>=3&&n<12&&(E=32),e>=72&&e<84&&(n>=0&&n<9?E=31:n>=9&&n<21?E=33:n>=21&&n<33?E=35:n>=33&&n<42&&(E=37)),h=(E-1)*6-180+3,S=fn(h),c=a/(1-a),u=s/Math.sqrt(1-a*Math.sin(w)*Math.sin(w)),m=Math.tan(w)*Math.tan(w),v=c*Math.cos(w)*Math.cos(w),g=Math.cos(w)*(x-S),_=s*((1-a/4-3*a*a/64-5*a*a*a/256)*w-(3*a/8+3*a*a/32+45*a*a*a/1024)*Math.sin(2*w)+(15*a*a/256+45*a*a*a/1024)*Math.sin(4*w)-35*a*a*a/3072*Math.sin(6*w));var C=l*u*(g+(1-m+v)*g*g*g/6+(5-18*m+m*m+72*v-58*c)*g*g*g*g*g/120)+5e5,k=l*(_+u*Math.tan(w)*(g*g/2+(5-m+9*v+4*v*v)*g*g*g*g/24+(61-58*m+m*m+600*v-330*c)*g*g*g*g*g*g/720));return e<0&&(k+=1e7),{northing:Math.round(k),easting:Math.round(C),zoneNumber:E,zoneLetter:$o(e)}}function pn(i){var e=i.northing,n=i.easting,s=i.zoneLetter,a=i.zoneNumber;if(a<0||a>60)return null;var l=.9996,h=6378137,c=.00669438,u,m=(1-Math.sqrt(1-c))/(1+Math.sqrt(1-c)),v,g,_,w,x,S,E,C,k,I=n-5e5,B=e;s<"N"&&(B-=1e7),E=(a-1)*6-180+3,u=c/(1-c),S=B/l,C=S/(h*(1-c/4-3*c*c/64-5*c*c*c/256)),k=C+(3*m/2-27*m*m*m/32)*Math.sin(2*C)+(21*m*m/16-55*m*m*m*m/32)*Math.sin(4*C)+151*m*m*m/96*Math.sin(6*C),v=h/Math.sqrt(1-c*Math.sin(k)*Math.sin(k)),g=Math.tan(k)*Math.tan(k),_=u*Math.cos(k)*Math.cos(k),w=h*(1-c)/Math.pow(1-c*Math.sin(k)*Math.sin(k),1.5),x=I/(v*l);var H=k-v*Math.tan(k)/w*(x*x/2-(5+3*g+10*_-4*_*_-9*u)*x*x*x*x/24+(61+90*g+298*_+45*g*g-252*u-3*_*_)*x*x*x*x*x*x/720);H=Wr(H);var F=(x-(1+2*g+_)*x*x*x/6+(5-2*_+28*g-3*_*_+8*u+24*g*g)*x*x*x*x*x/120)/Math.cos(k);F=E+Wr(F);var J;if(i.accuracy){var ot=pn({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});J={top:ot.lat,right:ot.lon,bottom:H,left:F}}else J={lat:H,lon:F};return J}function $o(i){var e="Z";return 84>=i&&i>=72?e="X":72>i&&i>=64?e="W":64>i&&i>=56?e="V":56>i&&i>=48?e="U":48>i&&i>=40?e="T":40>i&&i>=32?e="S":32>i&&i>=24?e="R":24>i&&i>=16?e="Q":16>i&&i>=8?e="P":8>i&&i>=0?e="N":0>i&&i>=-8?e="M":-8>i&&i>=-16?e="L":-16>i&&i>=-24?e="K":-24>i&&i>=-32?e="J":-32>i&&i>=-40?e="H":-40>i&&i>=-48?e="G":-48>i&&i>=-56?e="F":-56>i&&i>=-64?e="E":-64>i&&i>=-72?e="D":-72>i&&i>=-80&&(e="C"),e}function Wo(i,e){var n="00000"+i.easting,s="00000"+i.northing;return i.zoneNumber+i.zoneLetter+Vo(i.easting,i.northing,i.zoneNumber)+n.substr(n.length-5,e)+s.substr(s.length-5,e)}function Vo(i,e,n){var s=Vr(n),a=Math.floor(i/1e5),l=Math.floor(e/1e5)%20;return Jo(a,l,s)}function Vr(i){var e=i%Zr;return e===0&&(e=Zr),e}function Jo(i,e,n){var s=n-1,a=jr.charCodeAt(s),l=Hr.charCodeAt(s),h=a+i-1,c=l+e,u=!1;h>He&&(h=h-He+ge-1,u=!0),(h===wt||awt||(h>wt||aLt||(h>Lt||aHe&&(h=h-He+ge-1),c>je?(c=c-je+ge-1,u=!0):u=!1,(c===wt||lwt||(c>wt||lLt||(c>Lt||lje&&(c=c-je+ge-1);var m=String.fromCharCode(h)+String.fromCharCode(c);return m}function Jr(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var e=i.length,n=null,s="",a,l=0;!/[A-Z]/.test(a=i.charAt(l));){if(l>=2)throw"MGRSPoint bad conversion from: "+i;s+=a,l++}var h=parseInt(s,10);if(l===0||l+3>e)throw"MGRSPoint bad conversion from: "+i;var c=i.charAt(l++);if(c<="A"||c==="B"||c==="Y"||c>="Z"||c==="I"||c==="O")throw"MGRSPoint zone letter "+c+" not handled: "+i;n=i.substring(l,l+=2);for(var u=Vr(h),m=Ko(n.charAt(0),u),v=Xo(n.charAt(1),u);vs[a]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}function Ca(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Ta(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var n=function s(){var a=!1;try{a=this instanceof s}catch{}return a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var a=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(n,s,a.get?a:{enumerable:!0,get:function(){return i[s]}})}),n}var Re={exports:{}};var za=Re.exports,dr;function ur(){return dr||(dr=1,(function(i,e){(function(n,s){s(e)})(za,(function(n){var s="1.9.4";function a(t){var r,o,d,f;for(o=1,d=arguments.length;o"u"||!L||!L.Mixin)){t=I(t)?t:[t];for(var r=0;r0?Math.floor(t):Math.ceil(t)};D.prototype={clone:function(){return new D(this.x,this.y)},add:function(t){return this.clone()._add(F(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(F(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new D(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new D(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=vs(this.x),this.y=vs(this.y),this},distanceTo:function(t){t=F(t);var r=t.x-this.x,o=t.y-this.y;return Math.sqrt(r*r+o*o)},equals:function(t){return t=F(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=F(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+_(this.x)+", "+_(this.y)+")"}};function F(t,r,o){return t instanceof D?t:I(t)?new D(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new D(t.x,t.y):new D(t,r,o)}function nt(t,r){if(t)for(var o=r?[t,r]:t,d=0,f=o.length;d=this.min.x&&o.x<=this.max.x&&r.y>=this.min.y&&o.y<=this.max.y},intersects:function(t){t=Et(t);var r=this.min,o=this.max,d=t.min,f=t.max,p=f.x>=r.x&&d.x<=o.x,y=f.y>=r.y&&d.y<=o.y;return p&&y},overlaps:function(t){t=Et(t);var r=this.min,o=this.max,d=t.min,f=t.max,p=f.x>r.x&&d.xr.y&&d.y=r.lat&&f.lat<=o.lat&&d.lng>=r.lng&&f.lng<=o.lng},intersects:function(t){t=ct(t);var r=this._southWest,o=this._northEast,d=t.getSouthWest(),f=t.getNorthEast(),p=f.lat>=r.lat&&d.lat<=o.lat,y=f.lng>=r.lng&&d.lng<=o.lng;return p&&y},overlaps:function(t){t=ct(t);var r=this._southWest,o=this._northEast,d=t.getSouthWest(),f=t.getNorthEast(),p=f.lat>r.lat&&d.latr.lng&&d.lng1,Eu=(function(){var t=!1;try{var r=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",g,r),window.removeEventListener("testPassiveEventSupport",g,r)}catch{}return t})(),Pu=(function(){return!!document.createElement("canvas").getContext})(),Bn=!!(document.createElementNS&&bs("svg").createSVGRect),ku=!!Bn&&(function(){var t=document.createElement("div");return t.innerHTML="",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Au=!Bn&&(function(){try{var t=document.createElement("div");t.innerHTML='';var r=t.firstChild;return r.style.behavior="url(#default#VML)",r&&typeof r.adj=="object"}catch{return!1}})(),Lu=navigator.platform.indexOf("Mac")===0,Cu=navigator.platform.indexOf("Linux")===0;function qt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var O={ie:Fi,ielt9:fu,edge:xs,webkit:On,android:Ms,android23:Ss,androidStock:mu,opera:Gn,chrome:Es,gecko:Ps,safari:_u,phantom:ks,opera12:As,win:gu,ie3d:Ls,webkit3d:Rn,gecko3d:Cs,any3d:vu,mobile:ai,mobileWebkit:yu,mobileWebkit3d:bu,msPointer:Ts,pointer:zs,touch:wu,touchNative:Is,mobileOpera:xu,mobileGecko:Mu,retina:Su,passiveEvents:Eu,canvas:Pu,svg:Bn,vml:Au,inlineSvg:ku,mac:Lu,linux:Cu},Ns=O.msPointer?"MSPointerDown":"pointerdown",Os=O.msPointer?"MSPointerMove":"pointermove",Gs=O.msPointer?"MSPointerUp":"pointerup",Rs=O.msPointer?"MSPointerCancel":"pointercancel",Fn={touchstart:Ns,touchmove:Os,touchend:Gs,touchcancel:Rs},Bs={touchstart:Gu,touchmove:qi,touchend:qi,touchcancel:qi},ke={},Fs=!1;function Tu(t,r,o){return r==="touchstart"&&Ou(),Bs[r]?(o=Bs[r].bind(this,o),t.addEventListener(Fn[r],o,!1),o):(console.warn("wrong event specified:",r),g)}function zu(t,r,o){if(!Fn[r]){console.warn("wrong event specified:",r);return}t.removeEventListener(Fn[r],o,!1)}function Iu(t){ke[t.pointerId]=t}function Nu(t){ke[t.pointerId]&&(ke[t.pointerId]=t)}function qs(t){delete ke[t.pointerId]}function Ou(){Fs||(document.addEventListener(Ns,Iu,!0),document.addEventListener(Os,Nu,!0),document.addEventListener(Gs,qs,!0),document.addEventListener(Rs,qs,!0),Fs=!0)}function qi(t,r){if(r.pointerType!==(r.MSPOINTER_TYPE_MOUSE||"mouse")){r.touches=[];for(var o in ke)r.touches.push(ke[o]);r.changedTouches=[r],t(r)}}function Gu(t,r){r.MSPOINTER_TYPE_TOUCH&&r.pointerType===r.MSPOINTER_TYPE_TOUCH&&_t(r),qi(t,r)}function Ru(t){var r={},o,d;for(d in t)o=t[d],r[d]=o&&o.bind?o.bind(t):o;return t=r,r.type="dblclick",r.detail=2,r.isTrusted=!1,r._simulated=!0,r}var Bu=200;function Fu(t,r){t.addEventListener("dblclick",r);var o=0,d;function f(p){if(p.detail!==1){d=p.detail;return}if(!(p.pointerType==="mouse"||p.sourceCapabilities&&!p.sourceCapabilities.firesTouchEvents)){var y=Us(p);if(!(y.some(function(M){return M instanceof HTMLLabelElement&&M.attributes.for})&&!y.some(function(M){return M instanceof HTMLInputElement||M instanceof HTMLSelectElement}))){var b=Date.now();b-o<=Bu?(d++,d===2&&r(Ru(p))):d=1,o=b}}}return t.addEventListener("click",f),{dblclick:r,simDblclick:f}}function qu(t,r){t.removeEventListener("dblclick",r.dblclick),t.removeEventListener("click",r.simDblclick)}var qn=ji(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),oi=ji(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Ds=oi==="webkitTransition"||oi==="OTransition"?oi+"End":"transitionend";function Zs(t){return typeof t=="string"?document.getElementById(t):t}function li(t,r){var o=t.style[r]||t.currentStyle&&t.currentStyle[r];if((!o||o==="auto")&&document.defaultView){var d=document.defaultView.getComputedStyle(t,null);o=d?d[r]:null}return o==="auto"?null:o}function V(t,r,o){var d=document.createElement(t);return d.className=r||"",o&&o.appendChild(d),d}function rt(t){var r=t.parentNode;r&&r.removeChild(t)}function Di(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Ae(t){var r=t.parentNode;r&&r.lastChild!==t&&r.appendChild(t)}function Le(t){var r=t.parentNode;r&&r.firstChild!==t&&r.insertBefore(t,r.firstChild)}function Dn(t,r){if(t.classList!==void 0)return t.classList.contains(r);var o=Zi(t);return o.length>0&&new RegExp("(^|\\s)"+r+"(\\s|$)").test(o)}function j(t,r){if(t.classList!==void 0)for(var o=x(r),d=0,f=o.length;d0?2*window.devicePixelRatio:1;function Ws(t){return O.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/ju:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function Yn(t,r){var o=r.relatedTarget;if(!o)return!0;try{for(;o&&o!==t;)o=o.parentNode}catch{return!1}return o!==t}var Hu={__proto__:null,on:Z,off:tt,stopPropagation:de,disableScrollPropagation:Qn,disableClickPropagation:ui,preventDefault:_t,stop:ue,getPropagationPath:Us,getMousePosition:$s,getWheelDelta:Ws,isExternalTarget:Yn,addListener:Z,removeListener:tt},Vs=ri.extend({run:function(t,r,o,d){this.stop(),this._el=t,this._inProgress=!0,this._duration=o||.25,this._easeOutPower=1/Math.max(d||.5,.2),this._startPos=ce(t),this._offset=r.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Q(this._animate,this),this._step()},_step:function(t){var r=+new Date-this._startTime,o=this._duration*1e3;rthis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,r){this._enforcingBounds=!0;var o=this.getCenter(),d=this._limitCenter(o,this._zoom,ct(t));return o.equals(d)||this.panTo(d,r),this._enforcingBounds=!1,this},panInside:function(t,r){r=r||{};var o=F(r.paddingTopLeft||r.padding||[0,0]),d=F(r.paddingBottomRight||r.padding||[0,0]),f=this.project(this.getCenter()),p=this.project(t),y=this.getPixelBounds(),b=Et([y.min.add(o),y.max.subtract(d)]),M=b.getSize();if(!b.contains(p)){this._enforcingBounds=!0;var P=p.subtract(b.getCenter()),N=b.extend(p).getSize().subtract(M);f.x+=P.x<0?-N.x:N.x,f.y+=P.y<0?-N.y:N.y,this.panTo(this.unproject(f),r),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=a({animate:!1,pan:!0},t===!0?{animate:!0}:t);var r=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),d=r.divideBy(2).round(),f=o.divideBy(2).round(),p=d.subtract(f);return!p.x&&!p.y?this:(t.animate&&t.pan?this.panBy(p):(t.pan&&this._rawPanBy(p),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:r,newSize:o}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=a({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var r=h(this._handleGeolocationResponse,this),o=h(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(r,o,t):navigator.geolocation.getCurrentPosition(r,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var r=t.code,o=t.message||(r===1?"permission denied":r===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:r,message:"Geolocation error: "+o+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var r=t.coords.latitude,o=t.coords.longitude,d=new Y(r,o),f=d.toBounds(t.coords.accuracy*2),p=this._locateOptions;if(p.setView){var y=this.getBoundsZoom(f);this.setView(d,p.maxZoom?Math.min(y,p.maxZoom):y)}var b={latlng:d,bounds:f,timestamp:t.timestamp};for(var M in t.coords)typeof t.coords[M]=="number"&&(b[M]=t.coords[M]);this.fire("locationfound",b)}},addHandler:function(t,r){if(!r)return this;var o=this[t]=new r(this);return this._handlers.push(o),this.options[t]&&o.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),rt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ht(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)rt(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,r){var o="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),d=V("div",o,r||this._mapPane);return t&&(this._panes[t]=d),d},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),r=this.unproject(t.getBottomLeft()),o=this.unproject(t.getTopRight());return new Pt(r,o)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,r,o){t=ct(t),o=F(o||[0,0]);var d=this.getZoom()||0,f=this.getMinZoom(),p=this.getMaxZoom(),y=t.getNorthWest(),b=t.getSouthEast(),M=this.getSize().subtract(o),P=Et(this.project(b,d),this.project(y,d)).getSize(),N=O.any3d?this.options.zoomSnap:1,R=M.x/P.x,U=M.y/P.y,yt=r?Math.max(R,U):Math.min(R,U);return d=this.getScaleZoom(yt,d),N&&(d=Math.round(d/(N/100))*(N/100),d=r?Math.ceil(d/N)*N:Math.floor(d/N)*N),Math.max(f,Math.min(p,d))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new D(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,r){var o=this._getTopLeftPoint(t,r);return new nt(o,o.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,r){var o=this.options.crs;return r=r===void 0?this._zoom:r,o.scale(t)/o.scale(r)},getScaleZoom:function(t,r){var o=this.options.crs;r=r===void 0?this._zoom:r;var d=o.zoom(t*o.scale(r));return isNaN(d)?1/0:d},project:function(t,r){return r=r===void 0?this._zoom:r,this.options.crs.latLngToPoint($(t),r)},unproject:function(t,r){return r=r===void 0?this._zoom:r,this.options.crs.pointToLatLng(F(t),r)},layerPointToLatLng:function(t){var r=F(t).add(this.getPixelOrigin());return this.unproject(r)},latLngToLayerPoint:function(t){var r=this.project($(t))._round();return r._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng($(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(ct(t))},distance:function(t,r){return this.options.crs.distance($(t),$(r))},containerPointToLayerPoint:function(t){return F(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return F(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var r=this.containerPointToLayerPoint(F(t));return this.layerPointToLatLng(r)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint($(t)))},mouseEventToContainerPoint:function(t){return $s(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var r=this._container=Zs(t);if(r){if(r._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Z(r,"scroll",this._onScroll,this),this._containerId=u(r)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&O.any3d,j(t,"leaflet-container"+(O.touch?" leaflet-touch":"")+(O.retina?" leaflet-retina":"")+(O.ielt9?" leaflet-oldie":"")+(O.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var r=li(t,"position");r!=="absolute"&&r!=="relative"&&r!=="fixed"&&r!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),dt(this._mapPane,new D(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(j(t.markerPane,"leaflet-zoom-hide"),j(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,r,o){dt(this._mapPane,new D(0,0));var d=!this._loaded;this._loaded=!0,r=this._limitZoom(r),this.fire("viewprereset");var f=this._zoom!==r;this._moveStart(f,o)._move(t,r)._moveEnd(f),this.fire("viewreset"),d&&this.fire("load")},_moveStart:function(t,r){return t&&this.fire("zoomstart"),r||this.fire("movestart"),this},_move:function(t,r,o,d){r===void 0&&(r=this._zoom);var f=this._zoom!==r;return this._zoom=r,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),d?o&&o.pinch&&this.fire("zoom",o):((f||o&&o.pinch)&&this.fire("zoom",o),this.fire("move",o)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ht(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){dt(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[u(this._container)]=this;var r=t?tt:Z;r(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&r(window,"resize",this._onResize,this),O.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ht(this._resizeRequest),this._resizeRequest=Q(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,r){for(var o=[],d,f=r==="mouseout"||r==="mouseover",p=t.target||t.srcElement,y=!1;p;){if(d=this._targets[u(p)],d&&(r==="click"||r==="preclick")&&this._draggableMoved(d)){y=!0;break}if(d&&d.listens(r,!0)&&(f&&!Yn(p,t)||(o.push(d),f))||p===this._container)break;p=p.parentNode}return!o.length&&!y&&!f&&this.listens(r,!0)&&(o=[this]),o},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var r=t.target||t.srcElement;if(!(!this._loaded||r._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(r))){var o=t.type;o==="mousedown"&&Wn(r),this._fireDOMEvent(t,o)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,r,o){if(t.type==="click"){var d=a({},t);d.type="preclick",this._fireDOMEvent(d,d.type,o)}var f=this._findEventTargets(t,r);if(o){for(var p=[],y=0;y0?Math.round(t-r)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(r))},_limitZoom:function(t){var r=this.getMinZoom(),o=this.getMaxZoom(),d=O.any3d?this.options.zoomSnap:1;return d&&(t=Math.round(t/d)*d),Math.max(r,Math.min(o,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){lt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,r){var o=this._getCenterOffset(t)._trunc();return(r&&r.animate)!==!0&&!this.getSize().contains(o)?!1:(this.panBy(o,r),!0)},_createAnimProxy:function(){var t=this._proxy=V("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(r){var o=qn,d=this._proxy.style[o];he(this._proxy,this.project(r.center,r.zoom),this.getZoomScale(r.zoom,1)),d===this._proxy.style[o]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){rt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),r=this.getZoom();he(this._proxy,this.project(t,r),this.getZoomScale(r,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,r,o){if(this._animatingZoom)return!0;if(o=o||{},!this._zoomAnimated||o.animate===!1||this._nothingToAnimate()||Math.abs(r-this._zoom)>this.options.zoomAnimationThreshold)return!1;var d=this.getZoomScale(r),f=this._getCenterOffset(t)._divideBy(1-1/d);return o.animate!==!0&&!this.getSize().contains(f)?!1:(Q(function(){this._moveStart(!0,o.noMoveStart||!1)._animateZoom(t,r,!0)},this),!0)},_animateZoom:function(t,r,o,d){this._mapPane&&(o&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=r,j(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:r,noUpdate:d}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(h(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&<(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Uu(t,r){return new W(t,r)}var Gt=Ft.extend({options:{position:"topright"},initialize:function(t){S(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var r=this._map;return r&&r.removeControl(this),this.options.position=t,r&&r.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var r=this._container=this.onAdd(t),o=this.getPosition(),d=t._controlCorners[o];return j(r,"leaflet-control"),o.indexOf("bottom")!==-1?d.insertBefore(r,d.firstChild):d.appendChild(r),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(rt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),fi=function(t){return new Gt(t)};W.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},r="leaflet-",o=this._controlContainer=V("div",r+"control-container",this._container);function d(f,p){var y=r+f+" "+r+p;t[f+p]=V("div",y,o)}d("top","left"),d("top","right"),d("bottom","left"),d("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)rt(this._controlCorners[t]);rt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Js=Gt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,r,o,d){return o1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=r&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var r=this._getLayer(u(t.target)),o=r.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;o&&this._map.fire(o,r)},_createRadioElement:function(t,r){var o='",d=document.createElement("div");return d.innerHTML=o,d.firstChild},_addItem:function(t){var r=document.createElement("label"),o=this._map.hasLayer(t.layer),d;t.overlay?(d=document.createElement("input"),d.type="checkbox",d.className="leaflet-control-layers-selector",d.defaultChecked=o):d=this._createRadioElement("leaflet-base-layers_"+u(this),o),this._layerControlInputs.push(d),d.layerId=u(t.layer),Z(d,"click",this._onInputClick,this);var f=document.createElement("span");f.innerHTML=" "+t.name;var p=document.createElement("span");r.appendChild(p),p.appendChild(d),p.appendChild(f);var y=t.overlay?this._overlaysList:this._baseLayersList;return y.appendChild(r),this._checkDisabledLayers(),r},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,r,o,d=[],f=[];this._handlingClick=!0;for(var p=t.length-1;p>=0;p--)r=t[p],o=this._getLayer(r.layerId).layer,r.checked?d.push(o):r.checked||f.push(o);for(p=0;p=0;f--)r=t[f],o=this._getLayer(r.layerId).layer,r.disabled=o.options.minZoom!==void 0&&do.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,Z(t,"click",_t),this.expand();var r=this;setTimeout(function(){tt(t,"click",_t),r._preventClick=!1})}}),$u=function(t,r,o){return new Js(t,r,o)},tr=Gt.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var r="leaflet-control-zoom",o=V("div",r+" leaflet-bar"),d=this.options;return this._zoomInButton=this._createButton(d.zoomInText,d.zoomInTitle,r+"-in",o,this._zoomIn),this._zoomOutButton=this._createButton(d.zoomOutText,d.zoomOutTitle,r+"-out",o,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),o},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,r,o,d,f){var p=V("a",o,d);return p.innerHTML=t,p.href="#",p.title=r,p.setAttribute("role","button"),p.setAttribute("aria-label",r),ui(p),Z(p,"click",ue),Z(p,"click",f,this),Z(p,"click",this._refocusOnMap,this),p},_updateDisabled:function(){var t=this._map,r="leaflet-disabled";lt(this._zoomInButton,r),lt(this._zoomOutButton,r),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(j(this._zoomOutButton,r),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(j(this._zoomInButton,r),this._zoomInButton.setAttribute("aria-disabled","true"))}});W.mergeOptions({zoomControl:!0}),W.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new tr,this.addControl(this.zoomControl))});var Wu=function(t){return new tr(t)},Ks=Gt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var r="leaflet-control-scale",o=V("div",r),d=this.options;return this._addScales(d,r+"-line",o),t.on(d.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),o},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,r,o){t.metric&&(this._mScale=V("div",r,o)),t.imperial&&(this._iScale=V("div",r,o))},_update:function(){var t=this._map,r=t.getSize().y/2,o=t.distance(t.containerPointToLatLng([0,r]),t.containerPointToLatLng([this.options.maxWidth,r]));this._updateScales(o)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var r=this._getRoundNum(t),o=r<1e3?r+" m":r/1e3+" km";this._updateScale(this._mScale,o,r/t)},_updateImperial:function(t){var r=t*3.2808399,o,d,f;r>5280?(o=r/5280,d=this._getRoundNum(o),this._updateScale(this._iScale,d+" mi",d/o)):(f=this._getRoundNum(r),this._updateScale(this._iScale,f+" ft",f/r))},_updateScale:function(t,r,o){t.style.width=Math.round(this.options.maxWidth*o)+"px",t.innerHTML=r},_getRoundNum:function(t){var r=Math.pow(10,(Math.floor(t)+"").length-1),o=t/r;return o=o>=10?10:o>=5?5:o>=3?3:o>=2?2:1,r*o}}),Vu=function(t){return new Ks(t)},Ju='',er=Gt.extend({options:{position:"bottomright",prefix:''+(O.inlineSvg?Ju+" ":"")+"Leaflet"},initialize:function(t){S(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=V("div","leaflet-control-attribution"),ui(this._container);for(var r in t._layers)t._layers[r].getAttribution&&this.addAttribution(t._layers[r].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var r in this._attributions)this._attributions[r]&&t.push(r);var o=[];this.options.prefix&&o.push(this.options.prefix),t.length&&o.push(t.join(", ")),this._container.innerHTML=o.join(' ')}}});W.mergeOptions({attributionControl:!0}),W.addInitHook(function(){this.options.attributionControl&&new er().addTo(this)});var Ku=function(t){return new er(t)};Gt.Layers=Js,Gt.Zoom=tr,Gt.Scale=Ks,Gt.Attribution=er,fi.layers=$u,fi.zoom=Wu,fi.scale=Vu,fi.attribution=Ku;var Zt=Ft.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Zt.addTo=function(t,r){return t.addHandler(r,this),this};var Xu={Events:At},Xs=O.touch?"touchstart mousedown":"mousedown",re=ri.extend({options:{clickTolerance:3},initialize:function(t,r,o,d){S(this,d),this._element=t,this._dragStartTarget=r||t,this._preventOutline=o},enable:function(){this._enabled||(Z(this._dragStartTarget,Xs,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(re._dragging===this&&this.finishDrag(!0),tt(this._dragStartTarget,Xs,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!Dn(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){re._dragging===this&&this.finishDrag();return}if(!(re._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(re._dragging=this,this._preventOutline&&Wn(this._element),Hn(),hi(),!this._moving)){this.fire("down");var r=t.touches?t.touches[0]:t,o=js(this._element);this._startPoint=new D(r.clientX,r.clientY),this._startPos=ce(this._element),this._parentScale=Vn(o);var d=t.type==="mousedown";Z(document,d?"mousemove":"touchmove",this._onMove,this),Z(document,d?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var r=t.touches&&t.touches.length===1?t.touches[0]:t,o=new D(r.clientX,r.clientY)._subtract(this._startPoint);!o.x&&!o.y||Math.abs(o.x)+Math.abs(o.y)p&&(y=b,p=M);p>o&&(r[y]=1,nr(t,r,o,d,y),nr(t,r,o,y,f))}function ef(t,r){for(var o=[t[0]],d=1,f=0,p=t.length;dr&&(o.push(t[d]),f=d);return fr.max.x&&(o|=2),t.yr.max.y&&(o|=8),o}function nf(t,r){var o=r.x-t.x,d=r.y-t.y;return o*o+d*d}function pi(t,r,o,d){var f=r.x,p=r.y,y=o.x-f,b=o.y-p,M=y*y+b*b,P;return M>0&&(P=((t.x-f)*y+(t.y-p)*b)/M,P>1?(f=o.x,p=o.y):P>0&&(f+=y*P,p+=b*P)),y=t.x-f,b=t.y-p,d?y*y+b*b:new D(f,p)}function zt(t){return!I(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function ra(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),zt(t)}function sa(t,r){var o,d,f,p,y,b,M,P;if(!t||t.length===0)throw new Error("latlngs not passed");zt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var N=$([0,0]),R=ct(t),U=R.getNorthWest().distanceTo(R.getSouthWest())*R.getNorthEast().distanceTo(R.getNorthWest());U<1700&&(N=ir(t));var yt=t.length,ft=[];for(o=0;od){M=(p-d)/f,P=[b.x-M*(b.x-y.x),b.y-M*(b.y-y.y)];break}var kt=r.unproject(F(P));return $([kt.lat+N.lat,kt.lng+N.lng])}var rf={__proto__:null,simplify:ta,pointToSegmentDistance:ea,closestPointOnSegment:Yu,clipSegment:na,_getEdgeIntersection:$i,_getBitCode:fe,_sqClosestPointOnSegment:pi,isFlat:zt,_flat:ra,polylineCenter:sa},rr={project:function(t){return new D(t.lng,t.lat)},unproject:function(t){return new Y(t.y,t.x)},bounds:new nt([-180,-90],[180,90])},sr={R:6378137,R_MINOR:6356752314245179e-9,bounds:new nt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var r=Math.PI/180,o=this.R,d=t.lat*r,f=this.R_MINOR/o,p=Math.sqrt(1-f*f),y=p*Math.sin(d),b=Math.tan(Math.PI/4-d/2)/Math.pow((1-y)/(1+y),p/2);return d=-o*Math.log(Math.max(b,1e-10)),new D(t.lng*r*o,d)},unproject:function(t){for(var r=180/Math.PI,o=this.R,d=this.R_MINOR/o,f=Math.sqrt(1-d*d),p=Math.exp(-t.y/o),y=Math.PI/2-2*Math.atan(p),b=0,M=.1,P;b<15&&Math.abs(M)>1e-7;b++)P=f*Math.sin(y),P=Math.pow((1-P)/(1+P),f/2),M=Math.PI/2-2*Math.atan(p*P)-y,y+=M;return new Y(y*r,t.x*r/o)}},sf={__proto__:null,LonLat:rr,Mercator:sr,SphericalMercator:Tn},af=a({},ne,{code:"EPSG:3395",projection:sr,transformation:(function(){var t=.5/(Math.PI*sr.R);return si(t,.5,-t,.5)})()}),aa=a({},ne,{code:"EPSG:4326",projection:rr,transformation:si(1/180,1,-1/180,.5)}),of=a({},$t,{projection:rr,transformation:si(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,r){var o=r.lng-t.lng,d=r.lat-t.lat;return Math.sqrt(o*o+d*d)},infinite:!0});$t.Earth=ne,$t.EPSG3395=af,$t.EPSG3857=In,$t.EPSG900913=uu,$t.EPSG4326=aa,$t.Simple=of;var Rt=ri.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[u(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[u(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var r=t.target;if(r.hasLayer(this)){if(this._map=r,this._zoomAnimated=r._zoomAnimated,this.getEvents){var o=this.getEvents();r.on(o,this),this.once("remove",function(){r.off(o,this)},this)}this.onAdd(r),this.fire("add"),r.fire("layeradd",{layer:this})}}});W.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var r=u(t);return this._layers[r]?this:(this._layers[r]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var r=u(t);return this._layers[r]?(this._loaded&&t.onRemove(this),delete this._layers[r],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return u(t)in this._layers},eachLayer:function(t,r){for(var o in this._layers)t.call(r,this._layers[o]);return this},_addLayers:function(t){t=t?I(t)?t:[t]:[];for(var r=0,o=t.length;rthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&r[0]instanceof Y&&r[0].equals(r[o-1])&&r.pop(),r},_setLatLngs:function(t){Vt.prototype._setLatLngs.call(this,t),zt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return zt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,r=this.options.weight,o=new D(r,r);if(t=new nt(t.min.subtract(o),t.max.add(o)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var d=0,f=this._rings.length,p;dt.y!=f.y>t.y&&t.x<(f.x-d.x)*(t.y-d.y)/(f.y-d.y)+d.x&&(r=!r);return r||Vt.prototype._containsPoint.call(this,t,!0)}});function mf(t,r){return new ze(t,r)}var Jt=Wt.extend({initialize:function(t,r){S(this,r),this._layers={},t&&this.addData(t)},addData:function(t){var r=I(t)?t:t.features,o,d,f;if(r){for(o=0,d=r.length;o0&&f.push(f[0].slice()),f}function Ie(t,r){return t.feature?a({},t.feature,{geometry:r}):Qi(r)}function Qi(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var hr={toGeoJSON:function(t){return Ie(this,{type:"Point",coordinates:lr(this.getLatLng(),t)})}};Wi.include(hr),ar.include(hr),Vi.include(hr),Vt.include({toGeoJSON:function(t){var r=!zt(this._latlngs),o=Xi(this._latlngs,r?1:0,!1,t);return Ie(this,{type:(r?"Multi":"")+"LineString",coordinates:o})}}),ze.include({toGeoJSON:function(t){var r=!zt(this._latlngs),o=r&&!zt(this._latlngs[0]),d=Xi(this._latlngs,o?2:r?1:0,!0,t);return r||(d=[d]),Ie(this,{type:(o?"Multi":"")+"Polygon",coordinates:d})}}),Ce.include({toMultiPoint:function(t){var r=[];return this.eachLayer(function(o){r.push(o.toGeoJSON(t).geometry.coordinates)}),Ie(this,{type:"MultiPoint",coordinates:r})},toGeoJSON:function(t){var r=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(r==="MultiPoint")return this.toMultiPoint(t);var o=r==="GeometryCollection",d=[];return this.eachLayer(function(f){if(f.toGeoJSON){var p=f.toGeoJSON(t);if(o)d.push(p.geometry);else{var y=Qi(p);y.type==="FeatureCollection"?d.push.apply(d,y.features):d.push(y)}}}),o?Ie(this,{geometries:d,type:"GeometryCollection"}):{type:"FeatureCollection",features:d}}});function ha(t,r){return new Jt(t,r)}var _f=ha,Yi=Rt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,r,o){this._url=t,this._bounds=ct(r),S(this,o)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(j(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){rt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&Ae(this._image),this},bringToBack:function(){return this._map&&Le(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=ct(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",r=this._image=t?this._url:V("img");if(j(r,"leaflet-image-layer"),this._zoomAnimated&&j(r,"leaflet-zoom-animated"),this.options.className&&j(r,this.options.className),r.onselectstart=g,r.onmousemove=g,r.onload=h(this.fire,this,"load"),r.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(r.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=r.src;return}r.src=this._url,r.alt=this.options.alt},_animateZoom:function(t){var r=this._map.getZoomScale(t.zoom),o=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;he(this._image,o,r)},_reset:function(){var t=this._image,r=new nt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),o=r.getSize();dt(t,r.min),t.style.width=o.x+"px",t.style.height=o.y+"px"},_updateOpacity:function(){Tt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),gf=function(t,r,o){return new Yi(t,r,o)},ca=Yi.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",r=this._image=t?this._url:V("video");if(j(r,"leaflet-image-layer"),this._zoomAnimated&&j(r,"leaflet-zoom-animated"),this.options.className&&j(r,this.options.className),r.onselectstart=g,r.onmousemove=g,r.onloadeddata=h(this.fire,this,"load"),t){for(var o=r.getElementsByTagName("source"),d=[],f=0;f0?d:[r.src];return}I(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(r.style,"objectFit")&&(r.style.objectFit="fill"),r.autoplay=!!this.options.autoplay,r.loop=!!this.options.loop,r.muted=!!this.options.muted,r.playsInline=!!this.options.playsInline;for(var p=0;pf?(r.height=f+"px",j(t,p)):lt(t,p),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var r=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),o=this._getAnchor();dt(this._container,r.add(o))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,r=parseInt(li(this._container,"marginBottom"),10)||0,o=this._container.offsetHeight+r,d=this._containerWidth,f=new D(this._containerLeft,-o-this._containerBottom);f._add(ce(this._container));var p=t.layerPointToContainerPoint(f),y=F(this.options.autoPanPadding),b=F(this.options.autoPanPaddingTopLeft||y),M=F(this.options.autoPanPaddingBottomRight||y),P=t.getSize(),N=0,R=0;p.x+d+M.x>P.x&&(N=p.x+d-P.x+M.x),p.x-N-b.x<0&&(N=p.x-b.x),p.y+o+M.y>P.y&&(R=p.y+o-P.y+M.y),p.y-R-b.y<0&&(R=p.y-b.y),(N||R)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([N,R]))}},_getAnchor:function(){return F(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),bf=function(t,r){return new tn(t,r)};W.mergeOptions({closePopupOnClick:!0}),W.include({openPopup:function(t,r,o){return this._initOverlay(tn,t,r,o).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),Rt.include({bindPopup:function(t,r){return this._popup=this._initOverlay(tn,this._popup,t,r),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Wt||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){ue(t);var r=t.layer||t.target;if(this._popup._source===r&&!(r instanceof se)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=r,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var en=jt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){jt.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){jt.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=jt.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",r=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=V("div",r),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+u(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var r,o,d=this._map,f=this._container,p=d.latLngToContainerPoint(d.getCenter()),y=d.layerPointToContainerPoint(t),b=this.options.direction,M=f.offsetWidth,P=f.offsetHeight,N=F(this.options.offset),R=this._getAnchor();b==="top"?(r=M/2,o=P):b==="bottom"?(r=M/2,o=0):b==="center"?(r=M/2,o=P/2):b==="right"?(r=0,o=P/2):b==="left"?(r=M,o=P/2):y.xthis.options.maxZoom||od?this._retainParent(f,p,y,d):!1)},_retainChildren:function(t,r,o,d){for(var f=2*t;f<2*t+2;f++)for(var p=2*r;p<2*r+2;p++){var y=new D(f,p);y.z=o+1;var b=this._tileCoordsToKey(y),M=this._tiles[b];if(M&&M.active){M.retain=!0;continue}else M&&M.loaded&&(M.retain=!0);o+1this.options.maxZoom||this.options.minZoom!==void 0&&f1){this._setView(t,o);return}for(var R=f.min.y;R<=f.max.y;R++)for(var U=f.min.x;U<=f.max.x;U++){var yt=new D(U,R);if(yt.z=this._tileZoom,!!this._isValidTile(yt)){var ft=this._tiles[this._tileCoordsToKey(yt)];ft?ft.current=!0:y.push(yt)}}if(y.sort(function(kt,Oe){return kt.distanceTo(p)-Oe.distanceTo(p)}),y.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var It=document.createDocumentFragment();for(U=0;Uo.max.x)||!r.wrapLat&&(t.yo.max.y))return!1}if(!this.options.bounds)return!0;var d=this._tileCoordsToBounds(t);return ct(this.options.bounds).overlaps(d)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var r=this._map,o=this.getTileSize(),d=t.scaleBy(o),f=d.add(o),p=r.unproject(d,t.z),y=r.unproject(f,t.z);return[p,y]},_tileCoordsToBounds:function(t){var r=this._tileCoordsToNwSe(t),o=new Pt(r[0],r[1]);return this.options.noWrap||(o=this._map.wrapLatLngBounds(o)),o},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var r=t.split(":"),o=new D(+r[0],+r[1]);return o.z=+r[2],o},_removeTile:function(t){var r=this._tiles[t];r&&(rt(r.el),delete this._tiles[t],this.fire("tileunload",{tile:r.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){j(t,"leaflet-tile");var r=this.getTileSize();t.style.width=r.x+"px",t.style.height=r.y+"px",t.onselectstart=g,t.onmousemove=g,O.ielt9&&this.options.opacity<1&&Tt(t,this.options.opacity)},_addTile:function(t,r){var o=this._getTilePos(t),d=this._tileCoordsToKey(t),f=this.createTile(this._wrapCoords(t),h(this._tileReady,this,t));this._initTile(f),this.createTile.length<2&&Q(h(this._tileReady,this,t,null,f)),dt(f,o),this._tiles[d]={el:f,coords:t,current:!0},r.appendChild(f),this.fire("tileloadstart",{tile:f,coords:t})},_tileReady:function(t,r,o){r&&this.fire("tileerror",{error:r,tile:o,coords:t});var d=this._tileCoordsToKey(t);o=this._tiles[d],o&&(o.loaded=+new Date,this._map._fadeAnimated?(Tt(o.el,0),ht(this._fadeFrame),this._fadeFrame=Q(this._updateOpacity,this)):(o.active=!0,this._pruneTiles()),r||(j(o.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:o.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),O.ielt9||!this._map._fadeAnimated?Q(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var r=new D(this._wrapX?v(t.x,this._wrapX):t.x,this._wrapY?v(t.y,this._wrapY):t.y);return r.z=t.z,r},_pxBoundsToTileRange:function(t){var r=this.getTileSize();return new nt(t.min.unscaleBy(r).floor(),t.max.unscaleBy(r).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Mf(t){return new _i(t)}var Ne=_i.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,r){this._url=t,r=S(this,r),r.detectRetina&&O.retina&&r.maxZoom>0?(r.tileSize=Math.floor(r.tileSize/2),r.zoomReverse?(r.zoomOffset--,r.minZoom=Math.min(r.maxZoom,r.minZoom+1)):(r.zoomOffset++,r.maxZoom=Math.max(r.minZoom,r.maxZoom-1)),r.minZoom=Math.max(0,r.minZoom)):r.zoomReverse?r.minZoom=Math.min(r.maxZoom,r.minZoom):r.maxZoom=Math.max(r.minZoom,r.maxZoom),typeof r.subdomains=="string"&&(r.subdomains=r.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,r){return this._url===t&&r===void 0&&(r=!0),this._url=t,r||this.redraw(),this},createTile:function(t,r){var o=document.createElement("img");return Z(o,"load",h(this._tileOnLoad,this,r,o)),Z(o,"error",h(this._tileOnError,this,r,o)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(o.referrerPolicy=this.options.referrerPolicy),o.alt="",o.src=this.getTileUrl(t),o},getTileUrl:function(t){var r={r:O.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-t.y;this.options.tms&&(r.y=o),r["-y"]=o}return k(this._url,a(r,this.options))},_tileOnLoad:function(t,r){O.ielt9?setTimeout(h(t,this,null,r),0):t(null,r)},_tileOnError:function(t,r,o){var d=this.options.errorTileUrl;d&&r.getAttribute("src")!==d&&(r.src=d),t(o,r)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,r=this.options.maxZoom,o=this.options.zoomReverse,d=this.options.zoomOffset;return o&&(t=r-t),t+d},_getSubdomain:function(t){var r=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[r]},_abortLoading:function(){var t,r;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(r=this._tiles[t].el,r.onload=g,r.onerror=g,!r.complete)){r.src=H;var o=this._tiles[t].coords;rt(r),delete this._tiles[t],this.fire("tileabort",{tile:r,coords:o})}},_removeTile:function(t){var r=this._tiles[t];if(r)return r.el.setAttribute("src",H),_i.prototype._removeTile.call(this,t)},_tileReady:function(t,r,o){if(!(!this._map||o&&o.getAttribute("src")===H))return _i.prototype._tileReady.call(this,t,r,o)}});function fa(t,r){return new Ne(t,r)}var pa=Ne.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,r){this._url=t;var o=a({},this.defaultWmsParams);for(var d in r)d in this.options||(o[d]=r[d]);r=S(this,r);var f=r.detectRetina&&O.retina?2:1,p=this.getTileSize();o.width=p.x*f,o.height=p.y*f,this.wmsParams=o},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var r=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[r]=this._crs.code,Ne.prototype.onAdd.call(this,t)},getTileUrl:function(t){var r=this._tileCoordsToNwSe(t),o=this._crs,d=Et(o.project(r[0]),o.project(r[1])),f=d.min,p=d.max,y=(this._wmsVersion>=1.3&&this._crs===aa?[f.y,f.x,p.y,p.x]:[f.x,f.y,p.x,p.y]).join(","),b=Ne.prototype.getTileUrl.call(this,t);return b+E(this.wmsParams,b,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+y},setParams:function(t,r){return a(this.wmsParams,t),r||this.redraw(),this}});function Sf(t,r){return new pa(t,r)}Ne.WMS=pa,fa.wms=Sf;var Kt=Rt.extend({options:{padding:.1},initialize:function(t){S(this,t),u(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),j(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,r){var o=this._map.getZoomScale(r,this._zoom),d=this._map.getSize().multiplyBy(.5+this.options.padding),f=this._map.project(this._center,r),p=d.multiplyBy(-o).add(f).subtract(this._map._getNewPixelOrigin(t,r));O.any3d?he(this._container,p,o):dt(this._container,p)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,r=this._map.getSize(),o=this._map.containerPointToLayerPoint(r.multiplyBy(-t)).round();this._bounds=new nt(o,o.add(r.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ma=Kt.extend({options:{tolerance:0},getEvents:function(){var t=Kt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Kt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Z(t,"mousemove",this._onMouseMove,this),Z(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Z(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){ht(this._redrawRequest),delete this._ctx,rt(this._container),tt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var r in this._layers)t=this._layers[r],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Kt.prototype._update.call(this);var t=this._bounds,r=this._container,o=t.getSize(),d=O.retina?2:1;dt(r,t.min),r.width=d*o.x,r.height=d*o.y,r.style.width=o.x+"px",r.style.height=o.y+"px",O.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Kt.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[u(t)]=t;var r=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=r),this._drawLast=r,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var r=t._order,o=r.next,d=r.prev;o?o.prev=d:this._drawLast=d,d?d.next=o:this._drawFirst=o,delete t._order,delete this._layers[u(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var r=t.options.dashArray.split(/[, ]+/),o=[],d,f;for(f=0;f')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Ef={_initContainer:function(){this._container=V("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Kt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var r=t._container=gi("shape");j(r,"leaflet-vml-shape "+(this.options.className||"")),r.coordsize="1 1",t._path=gi("path"),r.appendChild(t._path),this._updateStyle(t),this._layers[u(t)]=t},_addPath:function(t){var r=t._container;this._container.appendChild(r),t.options.interactive&&t.addInteractiveTarget(r)},_removePath:function(t){var r=t._container;rt(r),t.removeInteractiveTarget(r),delete this._layers[u(t)]},_updateStyle:function(t){var r=t._stroke,o=t._fill,d=t.options,f=t._container;f.stroked=!!d.stroke,f.filled=!!d.fill,d.stroke?(r||(r=t._stroke=gi("stroke")),f.appendChild(r),r.weight=d.weight+"px",r.color=d.color,r.opacity=d.opacity,d.dashArray?r.dashStyle=I(d.dashArray)?d.dashArray.join(" "):d.dashArray.replace(/( *, *)/g," "):r.dashStyle="",r.endcap=d.lineCap.replace("butt","flat"),r.joinstyle=d.lineJoin):r&&(f.removeChild(r),t._stroke=null),d.fill?(o||(o=t._fill=gi("fill")),f.appendChild(o),o.color=d.fillColor||d.color,o.opacity=d.fillOpacity):o&&(f.removeChild(o),t._fill=null)},_updateCircle:function(t){var r=t._point.round(),o=Math.round(t._radius),d=Math.round(t._radiusY||o);this._setPath(t,t._empty()?"M0 0":"AL "+r.x+","+r.y+" "+o+","+d+" 0,"+65535*360)},_setPath:function(t,r){t._path.v=r},_bringToFront:function(t){Ae(t._container)},_bringToBack:function(t){Le(t._container)}},nn=O.vml?gi:bs,vi=Kt.extend({_initContainer:function(){this._container=nn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=nn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){rt(this._container),tt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Kt.prototype._update.call(this);var t=this._bounds,r=t.getSize(),o=this._container;(!this._svgSize||!this._svgSize.equals(r))&&(this._svgSize=r,o.setAttribute("width",r.x),o.setAttribute("height",r.y)),dt(o,t.min),o.setAttribute("viewBox",[t.min.x,t.min.y,r.x,r.y].join(" ")),this.fire("update")}},_initPath:function(t){var r=t._path=nn("path");t.options.className&&j(r,t.options.className),t.options.interactive&&j(r,"leaflet-interactive"),this._updateStyle(t),this._layers[u(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){rt(t._path),t.removeInteractiveTarget(t._path),delete this._layers[u(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var r=t._path,o=t.options;r&&(o.stroke?(r.setAttribute("stroke",o.color),r.setAttribute("stroke-opacity",o.opacity),r.setAttribute("stroke-width",o.weight),r.setAttribute("stroke-linecap",o.lineCap),r.setAttribute("stroke-linejoin",o.lineJoin),o.dashArray?r.setAttribute("stroke-dasharray",o.dashArray):r.removeAttribute("stroke-dasharray"),o.dashOffset?r.setAttribute("stroke-dashoffset",o.dashOffset):r.removeAttribute("stroke-dashoffset")):r.setAttribute("stroke","none"),o.fill?(r.setAttribute("fill",o.fillColor||o.color),r.setAttribute("fill-opacity",o.fillOpacity),r.setAttribute("fill-rule",o.fillRule||"evenodd")):r.setAttribute("fill","none"))},_updatePoly:function(t,r){this._setPath(t,ws(t._parts,r))},_updateCircle:function(t){var r=t._point,o=Math.max(Math.round(t._radius),1),d=Math.max(Math.round(t._radiusY),1)||o,f="a"+o+","+d+" 0 1,0 ",p=t._empty()?"M0 0":"M"+(r.x-o)+","+r.y+f+o*2+",0 "+f+-o*2+",0 ";this._setPath(t,p)},_setPath:function(t,r){t._path.setAttribute("d",r)},_bringToFront:function(t){Ae(t._path)},_bringToBack:function(t){Le(t._path)}});O.vml&&vi.include(Ef);function ga(t){return O.svg||O.vml?new vi(t):null}W.include({getRenderer:function(t){var r=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return r||(r=this._renderer=this._createRenderer()),this.hasLayer(r)||this.addLayer(r),r},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var r=this._paneRenderers[t];return r===void 0&&(r=this._createRenderer({pane:t}),this._paneRenderers[t]=r),r},_createRenderer:function(t){return this.options.preferCanvas&&_a(t)||ga(t)}});var va=ze.extend({initialize:function(t,r){ze.prototype.initialize.call(this,this._boundsToLatLngs(t),r)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=ct(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Pf(t,r){return new va(t,r)}vi.create=nn,vi.pointsToPath=ws,Jt.geometryToLayer=Ji,Jt.coordsToLatLng=or,Jt.coordsToLatLngs=Ki,Jt.latLngToCoords=lr,Jt.latLngsToCoords=Xi,Jt.getFeature=Ie,Jt.asFeature=Qi,W.mergeOptions({boxZoom:!0});var ya=Zt.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Z(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){tt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){rt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),hi(),Hn(),this._startPoint=this._map.mouseEventToContainerPoint(t),Z(document,{contextmenu:ue,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=V("div","leaflet-zoom-box",this._container),j(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var r=new nt(this._point,this._startPoint),o=r.getSize();dt(this._box,r.min),this._box.style.width=o.x+"px",this._box.style.height=o.y+"px"},_finish:function(){this._moved&&(rt(this._box),lt(this._container,"leaflet-crosshair")),ci(),Un(),tt(document,{contextmenu:ue,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var r=new Pt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(r).fire("boxzoomend",{boxZoomBounds:r})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});W.addInitHook("addHandler","boxZoom",ya),W.mergeOptions({doubleClickZoom:!0});var ba=Zt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var r=this._map,o=r.getZoom(),d=r.options.zoomDelta,f=t.originalEvent.shiftKey?o-d:o+d;r.options.doubleClickZoom==="center"?r.setZoom(f):r.setZoomAround(t.containerPoint,f)}});W.addInitHook("addHandler","doubleClickZoom",ba),W.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var wa=Zt.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new re(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}j(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){lt(this._map._container,"leaflet-grab"),lt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var r=ct(this._map.options.maxBounds);this._offsetLimit=Et(this._map.latLngToContainerPoint(r.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(r.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var r=this._lastTime=+new Date,o=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(o),this._times.push(r),this._prunePositions(r)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),r=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=r.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,r){return t-(t-r)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),r=this._offsetLimit;t.xr.max.x&&(t.x=this._viscousLimit(t.x,r.max.x)),t.y>r.max.y&&(t.y=this._viscousLimit(t.y,r.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,r=Math.round(t/2),o=this._initialWorldOffset,d=this._draggable._newPos.x,f=(d-r+o)%t+r-o,p=(d+r+o)%t-r-o,y=Math.abs(f+o)0?p:-p))-r;this._delta=0,this._startTime=null,y&&(t.options.scrollWheelZoom==="center"?t.setZoom(r+y):t.setZoomAround(this._lastMousePos,r+y))}});W.addInitHook("addHandler","scrollWheelZoom",Ma);var kf=600;W.mergeOptions({tapHold:O.touchNative&&O.safari&&O.mobile,tapTolerance:15});var Sa=Zt.extend({addHooks:function(){Z(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){tt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var r=t.touches[0];this._startPos=this._newPos=new D(r.clientX,r.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(Z(document,"touchend",_t),Z(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",r))},this),kf),Z(document,"touchend touchcancel contextmenu",this._cancel,this),Z(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){tt(document,"touchend",_t),tt(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),tt(document,"touchend touchcancel contextmenu",this._cancel,this),tt(document,"touchmove",this._onMove,this)},_onMove:function(t){var r=t.touches[0];this._newPos=new D(r.clientX,r.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,r){var o=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY});o._simulated=!0,r.target.dispatchEvent(o)}});W.addInitHook("addHandler","tapHold",Sa),W.mergeOptions({touchZoom:O.touch,bounceAtZoomLimits:!0});var Ea=Zt.extend({addHooks:function(){j(this._map._container,"leaflet-touch-zoom"),Z(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){lt(this._map._container,"leaflet-touch-zoom"),tt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var r=this._map;if(!(!t.touches||t.touches.length!==2||r._animatingZoom||this._zooming)){var o=r.mouseEventToContainerPoint(t.touches[0]),d=r.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=r.getSize()._divideBy(2),this._startLatLng=r.containerPointToLatLng(this._centerPoint),r.options.touchZoom!=="center"&&(this._pinchStartLatLng=r.containerPointToLatLng(o.add(d)._divideBy(2))),this._startDist=o.distanceTo(d),this._startZoom=r.getZoom(),this._moved=!1,this._zooming=!0,r._stop(),Z(document,"touchmove",this._onTouchMove,this),Z(document,"touchend touchcancel",this._onTouchEnd,this),_t(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var r=this._map,o=r.mouseEventToContainerPoint(t.touches[0]),d=r.mouseEventToContainerPoint(t.touches[1]),f=o.distanceTo(d)/this._startDist;if(this._zoom=r.getScaleZoom(f,this._startZoom),!r.options.bounceAtZoomLimits&&(this._zoomr.getMaxZoom()&&f>1)&&(this._zoom=r._limitZoom(this._zoom)),r.options.touchZoom==="center"){if(this._center=this._startLatLng,f===1)return}else{var p=o._add(d)._divideBy(2)._subtract(this._centerPoint);if(f===1&&p.x===0&&p.y===0)return;this._center=r.unproject(r.project(this._pinchStartLatLng,this._zoom).subtract(p),this._zoom)}this._moved||(r._moveStart(!0,!1),this._moved=!0),ht(this._animRequest);var y=h(r._move,r,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Q(y,this,!0),_t(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ht(this._animRequest),tt(document,"touchmove",this._onTouchMove,this),tt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});W.addInitHook("addHandler","touchZoom",Ea),W.BoxZoom=ya,W.DoubleClickZoom=ba,W.Drag=wa,W.Keyboard=xa,W.ScrollWheelZoom=Ma,W.TapHold=Sa,W.TouchZoom=Ea,n.Bounds=nt,n.Browser=O,n.CRS=$t,n.Canvas=ma,n.Circle=ar,n.CircleMarker=Vi,n.Class=Ft,n.Control=Gt,n.DivIcon=ua,n.DivOverlay=jt,n.DomEvent=Hu,n.DomUtil=Zu,n.Draggable=re,n.Evented=ri,n.FeatureGroup=Wt,n.GeoJSON=Jt,n.GridLayer=_i,n.Handler=Zt,n.Icon=Te,n.ImageOverlay=Yi,n.LatLng=Y,n.LatLngBounds=Pt,n.Layer=Rt,n.LayerGroup=Ce,n.LineUtil=rf,n.Map=W,n.Marker=Wi,n.Mixin=Xu,n.Path=se,n.Point=D,n.PolyUtil=Qu,n.Polygon=ze,n.Polyline=Vt,n.Popup=tn,n.PosAnimation=Vs,n.Projection=sf,n.Rectangle=va,n.Renderer=Kt,n.SVG=vi,n.SVGOverlay=da,n.TileLayer=Ne,n.Tooltip=en,n.Transformation=zn,n.Util=ie,n.VideoOverlay=ca,n.bind=h,n.bounds=Et,n.canvas=_a,n.circle=ff,n.circleMarker=uf,n.control=fi,n.divIcon=xf,n.extend=a,n.featureGroup=hf,n.geoJSON=ha,n.geoJson=_f,n.gridLayer=Mf,n.icon=cf,n.imageOverlay=gf,n.latLng=$,n.latLngBounds=ct,n.layerGroup=lf,n.map=Uu,n.marker=df,n.point=F,n.polygon=mf,n.polyline=pf,n.popup=bf,n.rectangle=Pf,n.setOptions=S,n.stamp=u,n.svg=ga,n.svgOverlay=yf,n.tileLayer=fa,n.tooltip=wf,n.transformation=si,n.version=s,n.videoOverlay=vf;var Af=window.L;n.noConflict=function(){return window.L=Af,this},window.L=n}))})(Re,Re.exports)),Re.exports}var fr=ur();const G=Ca(fr),Ia=La({__proto__:null,default:G},[fr]);function Na(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)i("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),i("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");i("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),i("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var ae=1,oe=2,pe=3,Oa=4,sn=5,pr=6378137,Ga=6356752314e-3,mr=.0066943799901413165,Be=484813681109536e-20,A=Math.PI/2,Ra=.16666666666666666,Ba=.04722222222222222,Fa=.022156084656084655,T=1e-10,st=.017453292519943295,bt=57.29577951308232,K=Math.PI/4,Fe=Math.PI*2,at=3.14159265359,wt={};wt.greenwich=0,wt.lisbon=-9.131906111111,wt.paris=2.337229166667,wt.bogota=-74.080916666667,wt.madrid=-3.687938888889,wt.rome=12.452333333333,wt.bern=7.439583333333,wt.jakarta=106.807719444444,wt.ferro=-17.666666666667,wt.brussels=4.367975,wt.stockholm=18.058277777778,wt.athens=23.7163375,wt.oslo=10.722916666667;const qa={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var _r=/[\s_\-\/\(\)]/g;function Xt(i,e){if(i[e])return i[e];for(var n=Object.keys(i),s=e.toLowerCase().replace(_r,""),a=-1,l,h;++aArray.isArray(s)&&s[0]==="ID");return n&&n.length>=3?{authority:n[1],code:parseInt(n[2],10)}:null}static convertUnit(e,n="unit"){if(!e||e.length<3)return{type:n,name:"unknown",conversion_factor:null};const s=e[1],a=parseFloat(e[2])||null,l=e.find(c=>Array.isArray(c)&&c[0]==="ID"),h=l?{authority:l[1],code:parseInt(l[2],10)}:null;return{type:n,name:s,conversion_factor:a,id:h}}static convertAxis(e){const n=e[1]||"Unknown";let s;const a=n.match(/^\((.)\)$/);if(a){const m=a[1].toUpperCase();if(m==="E")s="east";else if(m==="N")s="north";else if(m==="U")s="up";else throw new Error(`Unknown axis abbreviation: ${m}`)}else s=e[2]?e[2].toLowerCase():"unknown";const l=e.find(m=>Array.isArray(m)&&m[0]==="ORDER"),h=l?parseInt(l[1],10):null,c=e.find(m=>Array.isArray(m)&&(m[0]==="LENGTHUNIT"||m[0]==="ANGLEUNIT"||m[0]==="SCALEUNIT")),u=this.convertUnit(c);return{name:n,direction:s,unit:u,order:h}}static extractAxes(e){return e.filter(n=>Array.isArray(n)&&n[0]==="AXIS").map(n=>this.convertAxis(n)).sort((n,s)=>(n.order||0)-(s.order||0))}static convert(e,n={}){switch(e[0]){case"PROJCRS":n.type="ProjectedCRS",n.name=e[1],n.base_crs=e.find(_=>Array.isArray(_)&&_[0]==="BASEGEOGCRS")?this.convert(e.find(_=>Array.isArray(_)&&_[0]==="BASEGEOGCRS")):null,n.conversion=e.find(_=>Array.isArray(_)&&_[0]==="CONVERSION")?this.convert(e.find(_=>Array.isArray(_)&&_[0]==="CONVERSION")):null;const s=e.find(_=>Array.isArray(_)&&_[0]==="CS");s&&(n.coordinate_system={type:s[1],axis:this.extractAxes(e)});const a=e.find(_=>Array.isArray(_)&&_[0]==="LENGTHUNIT");if(a){const _=this.convertUnit(a);n.coordinate_system.unit=_}n.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":n.type="GeographicCRS",n.name=e[1];const l=e.find(_=>Array.isArray(_)&&(_[0]==="DATUM"||_[0]==="ENSEMBLE"));if(l){const _=this.convert(l);l[0]==="ENSEMBLE"?n.datum_ensemble=_:n.datum=_;const w=e.find(x=>Array.isArray(x)&&x[0]==="PRIMEM");w&&w[1]!=="Greenwich"&&(_.prime_meridian={name:w[1],longitude:parseFloat(w[2])})}n.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},n.id=this.getId(e);break;case"DATUM":n.type="GeodeticReferenceFrame",n.name=e[1],n.ellipsoid=e.find(_=>Array.isArray(_)&&_[0]==="ELLIPSOID")?this.convert(e.find(_=>Array.isArray(_)&&_[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":n.type="DatumEnsemble",n.name=e[1],n.members=e.filter(_=>Array.isArray(_)&&_[0]==="MEMBER").map(_=>({type:"DatumEnsembleMember",name:_[1],id:this.getId(_)}));const h=e.find(_=>Array.isArray(_)&&_[0]==="ENSEMBLEACCURACY");h&&(n.accuracy=parseFloat(h[1]));const c=e.find(_=>Array.isArray(_)&&_[0]==="ELLIPSOID");c&&(n.ellipsoid=this.convert(c)),n.id=this.getId(e);break;case"ELLIPSOID":n.type="Ellipsoid",n.name=e[1],n.semi_major_axis=parseFloat(e[2]),n.inverse_flattening=parseFloat(e[3]),e.find(_=>Array.isArray(_)&&_[0]==="LENGTHUNIT")&&this.convert(e.find(_=>Array.isArray(_)&&_[0]==="LENGTHUNIT"),n);break;case"CONVERSION":n.type="Conversion",n.name=e[1],n.method=e.find(_=>Array.isArray(_)&&_[0]==="METHOD")?this.convert(e.find(_=>Array.isArray(_)&&_[0]==="METHOD")):null,n.parameters=e.filter(_=>Array.isArray(_)&&_[0]==="PARAMETER").map(_=>this.convert(_));break;case"METHOD":n.type="Method",n.name=e[1],n.id=this.getId(e);break;case"PARAMETER":n.type="Parameter",n.name=e[1],n.value=parseFloat(e[2]),n.unit=this.convertUnit(e.find(_=>Array.isArray(_)&&(_[0]==="LENGTHUNIT"||_[0]==="ANGLEUNIT"||_[0]==="SCALEUNIT"))),n.id=this.getId(e);break;case"BOUNDCRS":n.type="BoundCRS";const u=e.find(_=>Array.isArray(_)&&_[0]==="SOURCECRS");if(u){const _=u.find(w=>Array.isArray(w));n.source_crs=_?this.convert(_):null}const m=e.find(_=>Array.isArray(_)&&_[0]==="TARGETCRS");if(m){const _=m.find(w=>Array.isArray(w));n.target_crs=_?this.convert(_):null}const v=e.find(_=>Array.isArray(_)&&_[0]==="ABRIDGEDTRANSFORMATION");v?n.transformation=this.convert(v):n.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(n.type="Transformation",n.name=e[1],n.method=e.find(_=>Array.isArray(_)&&_[0]==="METHOD")?this.convert(e.find(_=>Array.isArray(_)&&_[0]==="METHOD")):null,n.parameters=e.filter(_=>Array.isArray(_)&&(_[0]==="PARAMETER"||_[0]==="PARAMETERFILE")).map(_=>{if(_[0]==="PARAMETER")return this.convert(_);if(_[0]==="PARAMETERFILE")return{name:_[1],value:_[2],id:{authority:"EPSG",code:8656}}}),n.parameters.length===7){const _=n.parameters[6];_.name==="Scale difference"&&(_.value=Math.round((_.value-1)*1e12)/1e6)}n.id=this.getId(e);break;case"AXIS":n.coordinate_system||(n.coordinate_system={type:"unspecified",axis:[]}),n.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const g=this.convertUnit(e,"LinearUnit");n.coordinate_system&&n.coordinate_system.axis&&n.coordinate_system.axis.forEach(_=>{_.unit||(_.unit=g)}),g.conversion_factor&&g.conversion_factor!==1&&n.semi_major_axis&&(n.semi_major_axis={value:n.semi_major_axis,unit:g});break;default:n.keyword=e[0];break}return n}}class Da extends gr{static convert(e,n={}){return super.convert(e,n),n.coordinate_system&&n.coordinate_system.subtype==="Cartesian"&&delete n.coordinate_system,n.usage&&delete n.usage,n}}class Za extends gr{static convert(e,n={}){super.convert(e,n);const s=e.find(l=>Array.isArray(l)&&l[0]==="CS");s&&(n.coordinate_system={subtype:s[1],axis:this.extractAxes(e)});const a=e.find(l=>Array.isArray(l)&&l[0]==="USAGE");if(a){const l=a.find(u=>Array.isArray(u)&&u[0]==="SCOPE"),h=a.find(u=>Array.isArray(u)&&u[0]==="AREA"),c=a.find(u=>Array.isArray(u)&&u[0]==="BBOX");n.usage={},l&&(n.usage.scope=l[1]),h&&(n.usage.area=h[1]),c&&(n.usage.bbox=c.slice(1))}return n}}function ja(i){return i.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(i.find(e=>Array.isArray(e)&&e[0]==="CS")||i[0]==="BOUNDCRS"||i[0]==="PROJCRS"||i[0]==="GEOGCRS","2015")}function Ha(i){return(ja(i)==="2019"?Za:Da).convert(i)}function Ua(i){const e=i.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var qe=1,vr=2,yr=3,yi=4,br=5,on=-1,$a=/\s/,Wa=/[A-Za-z]/,Va=/[A-Za-z84_]/,bi=/[,\]]/,wr=/[\d\.E\-\+]/;function Ht(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=qe}Ht.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==yi)for(;$a.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case qe:return this.neutral(i);case vr:return this.keyword(i);case yi:return this.quoted(i);case br:return this.afterquote(i);case yr:return this.number(i);case on:return}},Ht.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=yi;return}if(bi.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},Ht.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=qe;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=qe,this.currentObject=this.stack.pop(),this.currentObject||(this.state=on);return}},Ht.prototype.number=function(i){if(wr.test(i)){this.word+=i;return}if(bi.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},Ht.prototype.quoted=function(i){if(i==='"'){this.state=br;return}this.word+=i},Ht.prototype.keyword=function(i){if(Va.test(i)){this.word+=i;return}if(i==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=qe;return}if(bi.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},Ht.prototype.neutral=function(i){if(Wa.test(i)){this.word=i,this.state=vr;return}if(i==='"'){this.word="",this.state=yi;return}if(wr.test(i)){this.word=i,this.state=yr;return}if(bi.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},Ht.prototype.output=function(){for(;this.place0?90:-90),i.lat_ts=i.lat1,delete i.lat1):!i.lat_ts&&i.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(i.lat_ts=i.lat0,i.lat0=Nt(i.lat0>0?90:-90),delete i.lat1)}function Mr(i){let e={units:null,to_meter:void 0};return typeof i=="string"?(e.units=i.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):i&&i.name&&(e.units=i.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=i.conversion_factor),e}function Sr(i){return typeof i=="object"?i.value*i.unit.conversion_factor:i}function Er(i,e){i.ellipsoid.radius?(e.a=i.ellipsoid.radius,e.rf=0):(e.a=Sr(i.ellipsoid.semi_major_axis),i.ellipsoid.inverse_flattening!==void 0?e.rf=i.ellipsoid.inverse_flattening:i.ellipsoid.semi_major_axis!==void 0&&i.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-Sr(i.ellipsoid.semi_minor_axis))))}function wi(i,e={}){return!i||typeof i!="object"?i:i.type==="BoundCRS"?(wi(i.source_crs,e),i.transformation&&(i.transformation.method&&i.transformation.method.name==="NTv2"?e.nadgrids=i.transformation.parameters[0].value:e.datum_params=i.transformation.parameters.map(n=>n.value)),e):(Object.keys(i).forEach(n=>{const s=i[n];if(s!==null)switch(n){case"name":if(e.srsCode)break;e.name=s,e.srsCode=s;break;case"type":s==="GeographicCRS"?e.projName="longlat":s==="ProjectedCRS"&&i.conversion&&i.conversion.method&&(e.projName=i.conversion.method.name);break;case"datum":case"datum_ensemble":s.ellipsoid&&(e.ellps=s.ellipsoid.name,Er(s,e)),s.prime_meridian&&(e.from_greenwich=s.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=s.name,Er(s,e);break;case"prime_meridian":e.long0=(s.longitude||0)*Math.PI/180;break;case"coordinate_system":if(s.axis){if(e.axis=s.axis.map(a=>{const l=a.direction;if(l==="east")return"e";if(l==="north")return"n";if(l==="west")return"w";if(l==="south")return"s";throw new Error(`Unknown axis direction: ${l}`)}).join("")+"u",s.unit){const{units:a,to_meter:l}=Mr(s.unit);e.units=a,e.to_meter=l}else if(s.axis[0]&&s.axis[0].unit){const{units:a,to_meter:l}=Mr(s.axis[0].unit);e.units=a,e.to_meter=l}}break;case"id":s.authority&&s.code&&(e.title=s.authority+":"+s.code);break;case"conversion":s.method&&s.method.name&&(e.projName=s.method.name),s.parameters&&s.parameters.forEach(a=>{const l=a.name.toLowerCase().replace(/\s+/g,"_"),h=a.value;a.unit&&a.unit.conversion_factor?e[l]=h*a.unit.conversion_factor:a.unit==="degree"?e[l]=h*Math.PI/180:e[l]=h});break;case"unit":s.name&&(e.units=s.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),s.conversion_factor&&(e.to_meter=s.conversion_factor);break;case"base_crs":wi(s,e),e.datumCode=s.id?s.id.authority+"_"+s.id.code:s.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),xr(e),e)}var Xa=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Qa(i,e){var n=e[0],s=e[1];!(n in i)&&s in i&&(i[n]=i[s],e.length===3&&(i[n]=e[2](i[n])))}function Pr(i){for(var e=Object.keys(i),n=0,s=e.length;n-1}}function so(i){var e=Xt(i,"extension");if(e)return Xt(e,"proj4")}function ao(i){return i[0]==="+"}function oo(i){if(to(i)){if(eo(i))return pt[i];if(io(i)){var e=xi(i);if(ro(e))return pt["EPSG:3857"];var n=so(e);return n?an(n):e}if(ao(i))return an(i)}else return"projName"in i?i:xi(i)}function kr(i,e){i=i||{};var n,s;if(!e)return i;for(s in e)n=e[s],n!==void 0&&(i[s]=n);return i}function Bt(i,e,n){var s=i*e;return n/Math.sqrt(1-s*s)}function De(i){return i<0?-1:1}function z(i,e){return e||Math.abs(i)<=at?i:i-De(i)*Fe}function Ot(i,e,n){var s=i*n,a=.5*i;return s=Math.pow((1-s)/(1+s),a),Math.tan(.5*(A-e))/s}function Ze(i,e){for(var n=.5*i,s,a,l=A-2*Math.atan(e),h=0;h<=15;h++)if(s=i*Math.sin(l),a=A-2*Math.atan(e*Math.pow((1-s)/(1+s),n))-l,l+=a,Math.abs(a)<=1e-10)return l;return-9999}function lo(){var i=this.b/this.a;this.es=1-i*i,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Bt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function ho(i){var e=i.x,n=i.y;if(n*bt>90&&n*bt<-90&&e*bt>180&&e*bt<-180)return null;var s,a;if(Math.abs(Math.abs(n)-A)<=T)return null;if(this.sphere)s=this.x0+this.a*this.k0*z(e-this.long0,this.over),a=this.y0+this.a*this.k0*Math.log(Math.tan(K+.5*n));else{var l=Math.sin(n),h=Ot(this.e,n,l);s=this.x0+this.a*this.k0*z(e-this.long0,this.over),a=this.y0-this.a*this.k0*Math.log(h)}return i.x=s,i.y=a,i}function co(i){var e=i.x-this.x0,n=i.y-this.y0,s,a;if(this.sphere)a=A-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var l=Math.exp(-n/(this.a*this.k0));if(a=Ze(this.e,l),a===-9999)return null}return s=z(this.long0+e/(this.a*this.k0),this.over),i.x=s,i.y=a,i}var uo=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const fo={init:lo,forward:ho,inverse:co,names:uo};function po(){}function Ar(i){return i}var Lr=["longlat","identity"],mo=[fo,{init:po,forward:Ar,inverse:Ar,names:Lr}],le={},_e=[];function Cr(i,e){var n=_e.length;return i.names?(_e[n]=i,i.names.forEach(function(s){le[s.toLowerCase()]=n}),this):(console.log(e),!0)}function Tr(i){return i.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function _o(i){if(!i)return!1;var e=i.toLowerCase();if(typeof le[e]<"u"&&_e[le[e]]||(e=Tr(e),e in le&&_e[le[e]]))return _e[le[e]]}function go(){mo.forEach(Cr)}const vo={start:go,add:Cr,get:_o};var zr={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const yo=zr.WGS84;function bo(i,e,n,s){var a=i*i,l=e*e,h=(a-l)/a,c=0;s?(i*=1-h*(Ra+h*(Ba+h*Fa)),a=i*i,h=0):c=Math.sqrt(h);var u=(a-l)/l;return{es:h,e:c,ep2:u}}function wo(i,e,n,s,a){if(!i){var l=Xt(zr,s);l||(l=yo),i=l.a,e=l.b,n=l.rf}return n&&!e&&(e=(1-1/n)*i),(n===0||Math.abs(i-e)3&&(c.datum_params[3]!==0||c.datum_params[4]!==0||c.datum_params[5]!==0||c.datum_params[6]!==0)&&(c.datum_type=oe,c.datum_params[3]*=Be,c.datum_params[4]*=Be,c.datum_params[5]*=Be,c.datum_params[6]=c.datum_params[6]/1e6+1)),h&&(c.datum_type=pe,c.grids=h),c.a=n,c.b=s,c.es=a,c.ep2=l,c}var cn={};function So(i,e,n){return e instanceof ArrayBuffer?Eo(i,e,n):{ready:Po(i,e)}}function Eo(i,e,n){var s=!0;n!==void 0&&n.includeErrorFields===!1&&(s=!1);var a=new DataView(e),l=Lo(a),h=Co(a,l),c=To(a,h,l,s),u={header:h,subgrids:c};return cn[i]=u,u}async function Po(i,e){for(var n=[],s=await e.getImageCount(),a=s-1;a>=0;a--){var l=await e.getImage(a),h=await l.readRasters(),c=h,u=[l.getWidth(),l.getHeight()],m=l.getBoundingBox().map(Ir),v=[l.fileDirectory.ModelPixelScale[0],l.fileDirectory.ModelPixelScale[1]].map(Ir),g=m[0]+(u[0]-1)*v[0],_=m[3]-(u[1]-1)*v[1],w=c[0],x=c[1],S=[];for(let k=u[1]-1;k>=0;k--)for(let I=u[0]-1;I>=0;I--){var E=k*u[0]+I;S.push([-Qt(x[E]),Qt(w[E])])}n.push({del:v,lim:u,ll:[-g,_],cvs:S})}var C={header:{nSubgrids:s},subgrids:n};return cn[i]=C,C}function ko(i){if(i===void 0)return null;var e=i.split(",");return e.map(Ao)}function Ao(i){if(i.length===0)return null;var e=i[0]==="@";return e&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:i,mandatory:!e,grid:cn[i]||null,isNull:!1}}function Ir(i){return i*Math.PI/180}function Qt(i){return i/3600*Math.PI/180}function Lo(i){var e=i.getInt32(8,!1);return e===11?!1:(e=i.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function Co(i,e){return{nFields:i.getInt32(8,e),nSubgridFields:i.getInt32(24,e),nSubgrids:i.getInt32(40,e),shiftType:dn(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,e),fromSemiMinorAxis:i.getFloat64(136,e),toSemiMajorAxis:i.getFloat64(152,e),toSemiMinorAxis:i.getFloat64(168,e)}}function dn(i,e,n){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(e,n)))}function To(i,e,n,s){for(var a=176,l=[],h=0;h5e-11?!1:i.datum_type===ae?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]:i.datum_type===oe?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]&&i.datum_params[3]===e.datum_params[3]&&i.datum_params[4]===e.datum_params[4]&&i.datum_params[5]===e.datum_params[5]&&i.datum_params[6]===e.datum_params[6]:!0}function Nr(i,e,n){var s=i.x,a=i.y,l=i.z?i.z:0,h,c,u,m;if(a<-A&&a>-1.001*A)a=-A;else if(a>A&&a<1.001*A)a=A;else{if(a<-A)return{x:-1/0,y:-1/0,z:i.z};if(a>A)return{x:1/0,y:1/0,z:i.z}}return s>Math.PI&&(s-=2*Math.PI),c=Math.sin(a),m=Math.cos(a),u=c*c,h=n/Math.sqrt(1-e*u),{x:(h+l)*m*Math.cos(s),y:(h+l)*m*Math.sin(s),z:(h*(1-e)+l)*c}}function Or(i,e,n,s){var a=1e-12,l=a*a,h=30,c,u,m,v,g,_,w,x,S,E,C,k,I,B=i.x,H=i.y,q=i.z?i.z:0,J,ot,et;if(c=Math.sqrt(B*B+H*H),u=Math.sqrt(B*B+H*H+q*q),c/nl&&Is.y||w>s.x||Ec&&Math.abs(u.y)>c);if(h<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=z(l.x+n.ll[0]),s.y=l.y+n.ll[1]}else isNaN(l.x)||(s.x=i.x+l.x,s.y=i.y+l.y);return s}function Rr(i,e){var n={x:i.x/e.del[0],y:i.y/e.del[1]},s={x:Math.floor(n.x),y:Math.floor(n.y)},a={x:n.x-1*s.x,y:n.y-1*s.y},l={x:Number.NaN,y:Number.NaN},h;if(s.x<0||s.x>=e.lim[0]||s.y<0||s.y>=e.lim[1])return l;h=s.y*e.lim[0]+s.x;var c={x:e.cvs[h][0],y:e.cvs[h][1]};h++;var u={x:e.cvs[h][0],y:e.cvs[h][1]};h+=e.lim[0];var m={x:e.cvs[h][0],y:e.cvs[h][1]};h--;var v={x:e.cvs[h][0],y:e.cvs[h][1]},g=a.x*a.y,_=a.x*(1-a.y),w=(1-a.x)*(1-a.y),x=(1-a.x)*a.y;return l.x=w*c.x+_*u.x+x*v.x+g*m.x,l.y=w*c.y+_*u.y+x*v.y+g*m.y,l}function Br(i,e,n){var s=n.x,a=n.y,l=n.z||0,h,c,u,m={};for(u=0;u<3;u++)if(!(e&&u===2&&n.z===void 0))switch(u===0?(h=s,"ew".indexOf(i.axis[u])!==-1?c="x":c="y"):u===1?(h=a,"ns".indexOf(i.axis[u])!==-1?c="y":c="x"):(h=l,c="z"),i.axis[u]){case"e":m[c]=h;break;case"w":m[c]=-h;break;case"n":m[c]=h;break;case"s":m[c]=-h;break;case"u":n[c]!==void 0&&(m.z=h);break;case"d":n[c]!==void 0&&(m.z=-h);break;default:return null}return m}function Fr(i){var e={x:i[0],y:i[1]};return i.length>2&&(e.z=i[2]),i.length>3&&(e.m=i[3]),e}function qo(i){qr(i.x),qr(i.y)}function qr(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function Do(i,e){return(i.datum.datum_type===ae||i.datum.datum_type===oe||i.datum.datum_type===pe)&&e.datumCode!=="WGS84"||(e.datum.datum_type===ae||e.datum.datum_type===oe||e.datum.datum_type===pe)&&i.datumCode!=="WGS84"}function Ei(i,e,n,s){var a;Array.isArray(n)?n=Fr(n):n={x:n.x,y:n.y,z:n.z,m:n.m};var l=n.z!==void 0;if(qo(n),i.datum&&e.datum&&Do(i,e)&&(a=new Lt("WGS84"),n=Ei(i,a,n,s),i=a),s&&i.axis!=="enu"&&(n=Br(i,!1,n)),i.projName==="longlat")n={x:n.x*st,y:n.y*st,z:n.z||0};else if(i.to_meter&&(n={x:n.x*i.to_meter,y:n.y*i.to_meter,z:n.z||0}),n=i.inverse(n),!n)return;if(i.from_greenwich&&(n.x+=i.from_greenwich),n=Bo(i.datum,e.datum,n),!!n)return n=n,e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),e.projName==="longlat"?n={x:n.x*bt,y:n.y*bt,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),s&&e.axis!=="enu"?Br(e,!0,n):(n&&!l&&delete n.z,n)}var Dr=Lt("WGS84");function un(i,e,n,s){var a,l,h;return Array.isArray(n)?(a=Ei(i,e,n,s)||{x:NaN,y:NaN},n.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof a.z=="number"?[a.x,a.y,a.z].concat(n.slice(3)):[a.x,a.y,n[2]].concat(n.slice(3)):[a.x,a.y].concat(n.slice(2)):[a.x,a.y]):(l=Ei(i,e,n,s),h=Object.keys(n),h.length===2||h.forEach(function(c){if(typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(c==="x"||c==="y"||c==="z")return}else if(c==="x"||c==="y")return;l[c]=n[c]}),l)}function Pi(i){return i instanceof Lt?i:typeof i=="object"&&"oProj"in i?i.oProj:Lt(i)}function Zo(i,e,n){var s,a,l=!1,h;return typeof e>"u"?(a=Pi(i),s=Dr,l=!0):(typeof e.x<"u"||Array.isArray(e))&&(n=e,a=Pi(i),s=Dr,l=!0),s||(s=Pi(i)),a||(a=Pi(e)),n?un(s,a,n):(h={forward:function(c,u){return un(s,a,c,u)},inverse:function(c,u){return un(a,s,c,u)}},l&&(h.oProj=a),h)}var Zr=6,jr="AJSAJS",Hr="AFAFAF",ge=65,xt=73,Ct=79,je=86,He=90;const jo={forward:Ur,inverse:Ho,toPoint:$r};function Ur(i,e){return e=e||5,Wo(Uo({lat:i[1],lon:i[0]}),e)}function Ho(i){var e=pn(Jr(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function $r(i){var e=pn(Jr(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function fn(i){return i*(Math.PI/180)}function Wr(i){return 180*(i/Math.PI)}function Uo(i){var e=i.lat,n=i.lon,s=6378137,a=.00669438,l=.9996,h,c,u,m,v,g,_,w=fn(e),x=fn(n),S,E;E=Math.floor((n+180)/6)+1,n===180&&(E=60),e>=56&&e<64&&n>=3&&n<12&&(E=32),e>=72&&e<84&&(n>=0&&n<9?E=31:n>=9&&n<21?E=33:n>=21&&n<33?E=35:n>=33&&n<42&&(E=37)),h=(E-1)*6-180+3,S=fn(h),c=a/(1-a),u=s/Math.sqrt(1-a*Math.sin(w)*Math.sin(w)),m=Math.tan(w)*Math.tan(w),v=c*Math.cos(w)*Math.cos(w),g=Math.cos(w)*(x-S),_=s*((1-a/4-3*a*a/64-5*a*a*a/256)*w-(3*a/8+3*a*a/32+45*a*a*a/1024)*Math.sin(2*w)+(15*a*a/256+45*a*a*a/1024)*Math.sin(4*w)-35*a*a*a/3072*Math.sin(6*w));var C=l*u*(g+(1-m+v)*g*g*g/6+(5-18*m+m*m+72*v-58*c)*g*g*g*g*g/120)+5e5,k=l*(_+u*Math.tan(w)*(g*g/2+(5-m+9*v+4*v*v)*g*g*g*g/24+(61-58*m+m*m+600*v-330*c)*g*g*g*g*g*g/720));return e<0&&(k+=1e7),{northing:Math.round(k),easting:Math.round(C),zoneNumber:E,zoneLetter:$o(e)}}function pn(i){var e=i.northing,n=i.easting,s=i.zoneLetter,a=i.zoneNumber;if(a<0||a>60)return null;var l=.9996,h=6378137,c=.00669438,u,m=(1-Math.sqrt(1-c))/(1+Math.sqrt(1-c)),v,g,_,w,x,S,E,C,k,I=n-5e5,B=e;s<"N"&&(B-=1e7),E=(a-1)*6-180+3,u=c/(1-c),S=B/l,C=S/(h*(1-c/4-3*c*c/64-5*c*c*c/256)),k=C+(3*m/2-27*m*m*m/32)*Math.sin(2*C)+(21*m*m/16-55*m*m*m*m/32)*Math.sin(4*C)+151*m*m*m/96*Math.sin(6*C),v=h/Math.sqrt(1-c*Math.sin(k)*Math.sin(k)),g=Math.tan(k)*Math.tan(k),_=u*Math.cos(k)*Math.cos(k),w=h*(1-c)/Math.pow(1-c*Math.sin(k)*Math.sin(k),1.5),x=I/(v*l);var H=k-v*Math.tan(k)/w*(x*x/2-(5+3*g+10*_-4*_*_-9*u)*x*x*x*x/24+(61+90*g+298*_+45*g*g-252*u-3*_*_)*x*x*x*x*x*x/720);H=Wr(H);var q=(x-(1+2*g+_)*x*x*x/6+(5-2*_+28*g-3*_*_+8*u+24*g*g)*x*x*x*x*x/120)/Math.cos(k);q=E+Wr(q);var J;if(i.accuracy){var ot=pn({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});J={top:ot.lat,right:ot.lon,bottom:H,left:q}}else J={lat:H,lon:q};return J}function $o(i){var e="Z";return 84>=i&&i>=72?e="X":72>i&&i>=64?e="W":64>i&&i>=56?e="V":56>i&&i>=48?e="U":48>i&&i>=40?e="T":40>i&&i>=32?e="S":32>i&&i>=24?e="R":24>i&&i>=16?e="Q":16>i&&i>=8?e="P":8>i&&i>=0?e="N":0>i&&i>=-8?e="M":-8>i&&i>=-16?e="L":-16>i&&i>=-24?e="K":-24>i&&i>=-32?e="J":-32>i&&i>=-40?e="H":-40>i&&i>=-48?e="G":-48>i&&i>=-56?e="F":-56>i&&i>=-64?e="E":-64>i&&i>=-72?e="D":-72>i&&i>=-80&&(e="C"),e}function Wo(i,e){var n="00000"+i.easting,s="00000"+i.northing;return i.zoneNumber+i.zoneLetter+Vo(i.easting,i.northing,i.zoneNumber)+n.substr(n.length-5,e)+s.substr(s.length-5,e)}function Vo(i,e,n){var s=Vr(n),a=Math.floor(i/1e5),l=Math.floor(e/1e5)%20;return Jo(a,l,s)}function Vr(i){var e=i%Zr;return e===0&&(e=Zr),e}function Jo(i,e,n){var s=n-1,a=jr.charCodeAt(s),l=Hr.charCodeAt(s),h=a+i-1,c=l+e,u=!1;h>He&&(h=h-He+ge-1,u=!0),(h===xt||axt||(h>xt||aCt||(h>Ct||aHe&&(h=h-He+ge-1),c>je?(c=c-je+ge-1,u=!0):u=!1,(c===xt||lxt||(c>xt||lCt||(c>Ct||lje&&(c=c-je+ge-1);var m=String.fromCharCode(h)+String.fromCharCode(c);return m}function Jr(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var e=i.length,n=null,s="",a,l=0;!/[A-Z]/.test(a=i.charAt(l));){if(l>=2)throw"MGRSPoint bad conversion from: "+i;s+=a,l++}var h=parseInt(s,10);if(l===0||l+3>e)throw"MGRSPoint bad conversion from: "+i;var c=i.charAt(l++);if(c<="A"||c==="B"||c==="Y"||c>="Z"||c==="I"||c==="O")throw"MGRSPoint zone letter "+c+" not handled: "+i;n=i.substring(l,l+=2);for(var u=Vr(h),m=Ko(n.charAt(0),u),v=Xo(n.charAt(1),u);v0&&(S=1e5/Math.pow(10,_),E=i.substring(l,l+_),w=parseFloat(E)*S,C=i.substring(l+_),x=parseFloat(C)*S),k=w+m,I=x+v,{easting:k,northing:I,zoneLetter:c,zoneNumber:h,accuracy:S}}function Ko(i,e){for(var n=jr.charCodeAt(e-1),s=1e5,a=!1;n!==i.charCodeAt(0);){if(n++,n===wt&&n++,n===Lt&&n++,n>He){if(a)throw"Bad character: "+i;n=ge,a=!0}s+=1e5}return s}function Xo(i,e){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var n=Hr.charCodeAt(e-1),s=0,a=!1;n!==i.charCodeAt(0);){if(n++,n===wt&&n++,n===Lt&&n++,n>je){if(a)throw"Bad character: "+i;n=ge,a=!0}s+=1e5}return s}function Qo(i){var e;switch(i){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+i}function ve(i,e,n){if(!(this instanceof ve))return new ve(i,e,n);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof e>"u"){var s=i.split(",");this.x=parseFloat(s[0]),this.y=parseFloat(s[1]),this.z=parseFloat(s[2])||0}else this.x=i,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}ve.fromMGRS=function(i){return new ve($r(i))},ve.prototype.toMGRS=function(i){return Ur([this.x,this.y],i)};var Yo=1,tl=.25,Kr=.046875,Xr=.01953125,Qr=.01068115234375,el=.75,il=.46875,nl=.013020833333333334,rl=.007120768229166667,sl=.3645833333333333,al=.005696614583333333,ol=.3076171875;function mn(i){var e=[];e[0]=Yo-i*(tl+i*(Kr+i*(Xr+i*Qr))),e[1]=i*(el-i*(Kr+i*(Xr+i*Qr)));var n=i*i;return e[2]=n*(il-i*(nl+i*rl)),n*=i,e[3]=n*(sl-i*al),e[4]=n*i*ol,e}function ye(i,e,n,s){return n*=e,e*=e,s[0]*i-n*(s[1]+e*(s[2]+e*(s[3]+e*s[4])))}var ll=20;function _n(i,e,n){for(var s=1/(1-e),a=i,l=ll;l;--l){var h=Math.sin(a),c=1-e*h*h;if(c=(ye(a,h,Math.cos(a),n)-i)*(c*Math.sqrt(c))*s,a-=c,Math.abs(c)T?Math.tan(n):0,S=Math.pow(x,2),E=Math.pow(S,2);a=1-this.es*Math.pow(c,2),v=v/Math.sqrt(a);var C=ye(n,c,u,this.en);l=this.a*(this.k0*v*(1+g/6*(1-S+_+g/20*(5-18*S+E+14*_-58*S*_+g/42*(61+179*E-E*S-479*S)))))+this.x0,h=this.a*(this.k0*(C-this.ml0+c*s*v/2*(1+g/12*(5-S+9*_+4*w+g/30*(61+E-58*S+270*_-330*S*_+g/56*(1385+543*E-E*S-3111*S))))))+this.y0}else{var m=u*Math.sin(s);if(Math.abs(Math.abs(m)-1)=1){if(m-1>T)return 93;h=0}else h=Math.acos(h);n<0&&(h=-h),h=this.a*this.k0*(h-this.lat0)+this.y0}return i.x=l,i.y=h,i}function dl(i){var e,n,s,a,l=(i.x-this.x0)*(1/this.a),h=(i.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+h/this.k0,n=_n(e,this.es,this.en),Math.abs(n)T?Math.tan(n):0,x=this.ep2*Math.pow(_,2),S=Math.pow(x,2),E=Math.pow(w,2),C=Math.pow(E,2);e=1-this.es*Math.pow(g,2);var k=l*Math.sqrt(e)/this.k0,I=Math.pow(k,2);e=e*w,s=n-e*I/(1-this.es)*.5*(1-I/12*(5+3*E-9*x*E+x-4*S-I/30*(61+90*E-252*x*E+45*C+46*x-I/56*(1385+3633*E+4095*C+1574*C*E)))),a=z(this.long0+k*(1-I/6*(1+2*E+x-I/20*(5+28*E+24*C+8*x*E+6*x-I/42*(61+662*E+1320*C+720*C*E))))/_,this.over)}else s=A*De(h),a=0;else{var c=Math.exp(l/this.k0),u=.5*(c-1/c),m=this.lat0+h/this.k0,v=Math.cos(m);e=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(u,2))),s=Math.asin(e),h<0&&(s=-s),u===0&&v===0?a=0:a=z(Math.atan2(u,v)+this.long0,this.over)}return i.x=a,i.y=s,i}var ul=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const ki={init:hl,forward:cl,inverse:dl,names:ul};function Yr(i){var e=Math.exp(i);return e=(e-1/e)/2,e}function xt(i,e){i=Math.abs(i),e=Math.abs(e);var n=Math.max(i,e),s=Math.min(i,e)/(n||1);return n*Math.sqrt(1+Math.pow(s,2))}function fl(i){var e=1+i,n=e-1;return n===0?i:i*Math.log(e)/n}function pl(i){var e=Math.abs(i);return e=fl(e*(1+e/(xt(1,e)+1))),i<0?-e:e}function gn(i,e){for(var n=2*Math.cos(2*e),s=i.length-1,a=i[s],l=0,h;--s>=0;)h=-l+n*a+i[s],l=a,a=h;return e+h*Math.sin(2*e)}function ml(i,e){for(var n=2*Math.cos(e),s=i.length-1,a=i[s],l=0,h;--s>=0;)h=-l+n*a+i[s],l=a,a=h;return Math.sin(e)*h}function _l(i){var e=Math.exp(i);return e=(e+1/e)/2,e}function ts(i,e,n){for(var s=Math.sin(e),a=Math.cos(e),l=Yr(n),h=_l(n),c=2*a*h,u=-2*s*l,m=i.length-1,v=i[m],g=0,_=0,w=0,x,S;--m>=0;)x=_,S=g,_=v,g=w,v=-x+c*_-u*g+i[m],w=-S+u*_+c*g;return c=s*h,u=a*l,[c*v-u*w,c*w+u*v]}function gl(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ki.init.apply(this),this.forward=ki.forward,this.inverse=ki.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var i=this.es/(1+Math.sqrt(1-this.es)),e=i/(2-i),n=e;this.cgb[0]=e*(2+e*(-.6666666666666666+e*(-2+e*(2.577777777777778+e*(.5777777777777777+e*-4.228148148148148))))),this.cbg[0]=e*(-2+e*(.6666666666666666+e*(1.3333333333333333+e*(-1.8222222222222222+e*(.7111111111111111+e*.9824338624338624))))),n=n*e,this.cgb[1]=n*(2.3333333333333335+e*(-1.6+e*(-5.044444444444444+e*(8.584126984126984+e*2.458201058201058)))),this.cbg[1]=n*(1.6666666666666667+e*(-1.0666666666666667+e*(-1.4444444444444444+e*(2.86984126984127+e*-1.6105820105820106)))),n=n*e,this.cgb[2]=n*(3.7333333333333334+e*(-3.8857142857142857+e*(-12.019047619047619+e*26.03668430335097))),this.cbg[2]=n*(-1.7333333333333334+e*(1.619047619047619+e*(1.6+e*-4.474779541446208))),n=n*e,this.cgb[3]=n*(6.792063492063492+e*(-9.485714285714286+e*-28.188500881834216)),this.cbg[3]=n*(1.9634920634920634+e*(-2.4+e*-1.7518165784832451)),n=n*e,this.cgb[4]=n*(13.250793650793652+e*-23.22238255571589),this.cbg[4]=n*(-2.3301587301587303+e*3.5144460477793813),n=n*e,this.cgb[5]=n*27.011268237934903,this.cbg[5]=n*2.8496841430174764,n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(.25+n*(.015625+n/256))),this.utg[0]=e*(-.5+e*(.6666666666666666+e*(-.3854166666666667+e*(.002777777777777778+e*(.158203125+e*-.15905919312169312))))),this.gtu[0]=e*(.5+e*(-.6666666666666666+e*(.3125+e*(.22777777777777777+e*(-.4409722222222222+e*.20875661375661375))))),this.utg[1]=n*(-.020833333333333332+e*(-.06666666666666667+e*(.3034722222222222+e*(-.4380952380952381+e*.2890188388723545)))),this.gtu[1]=n*(.2708333333333333+e*(-.6+e*(.38680555555555557+e*(.44603174603174606+e*-1.0248393063822752)))),n=n*e,this.utg[2]=n*(-.035416666666666666+e*(.04404761904761905+e*(.046651785714285715+e*-.06138668430335097))),this.gtu[2]=n*(.25416666666666665+e*(-.7357142857142858+e*(.5603050595238095+e*.9237378747795415))),n=n*e,this.utg[3]=n*(-.02726314484126984+e*(.021825396825396824+e*.11439745921516754)),this.gtu[3]=n*(.30729786706349205+e*(-1.0654761904761905+e*.9096203979276896)),n=n*e,this.utg[4]=n*(-.02841641865079365+e*.027268468414301746),this.gtu[4]=n*(.4306671626984127+e*-1.713007555715889),n=n*e,this.utg[5]=n*-.03233083094085698,this.gtu[5]=n*.6650675310896665;var s=gn(this.cbg,this.lat0);this.Zb=-this.Qn*(s+ml(this.gtu,2*s))}function vl(i){var e=z(i.x-this.long0,this.over),n=i.y;n=gn(this.cbg,n);var s=Math.sin(n),a=Math.cos(n),l=Math.sin(e),h=Math.cos(e);n=Math.atan2(s,h*a),e=Math.atan2(l*a,xt(s,a*h)),e=pl(Math.tan(e));var c=ts(this.gtu,2*n,2*e);n=n+c[0],e=e+c[1];var u,m;return Math.abs(e)<=2.623395162778?(u=this.a*(this.Qn*e)+this.x0,m=this.a*(this.Qn*n+this.Zb)+this.y0):(u=1/0,m=1/0),i.x=u,i.y=m,i}function yl(i){var e=(i.x-this.x0)*(1/this.a),n=(i.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,e=e/this.Qn;var s,a;if(Math.abs(e)<=2.623395162778){var l=ts(this.utg,2*n,2*e);n=n+l[0],e=e+l[1],e=Math.atan(Yr(e));var h=Math.sin(n),c=Math.cos(n),u=Math.sin(e),m=Math.cos(e);n=Math.atan2(h*m,xt(u,m*c)),e=Math.atan2(u,m*c),s=z(e+this.long0,this.over),a=gn(this.cgb,n)}else s=1/0,a=1/0;return i.x=s,i.y=a,i}var bl=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Ai={init:gl,forward:vl,inverse:yl,names:bl};function wl(i,e){if(i===void 0){if(i=Math.floor((z(e)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var xl="etmerc";function Ml(){var i=wl(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*st,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ai.init.apply(this),this.forward=Ai.forward,this.inverse=Ai.inverse}var Sl=["Universal Transverse Mercator System","utm"];const El={init:Ml,names:Sl,dependsOn:xl};function vn(i,e){return Math.pow((1-i)/(1+i),e)}var Pl=20;function kl(){var i=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+K)/(Math.pow(Math.tan(.5*this.lat0+K),this.C)*vn(this.e*i,this.ratexp))}function Al(i){var e=i.x,n=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+K),this.C)*vn(this.e*Math.sin(n),this.ratexp))-A,i.x=this.C*e,i}function Ll(i){for(var e=1e-14,n=i.x/this.C,s=i.y,a=Math.pow(Math.tan(.5*s+K)/this.K,1/this.C),l=Pl;l>0&&(s=2*Math.atan(a*vn(this.e*Math.sin(i.y),-.5*this.e))-A,!(Math.abs(s-i.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=T&&Math.abs(Math.cos(this.lat_ts))>T&&(this.k0=.5*this.cons*Bt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Gt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Bt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(bn(this.lat0,this.sinlat0,this.e))-A,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Ol(i){var e=i.x,n=i.y,s=Math.sin(n),a=Math.cos(n),l,h,c,u,m,v,g=z(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=T&&Math.abs(n+this.lat0)<=T?(i.x=NaN,i.y=NaN,i):this.sphere?(l=2*this.k0/(1+this.sinlat0*s+this.coslat0*a*Math.cos(g)),i.x=this.a*l*a*Math.sin(g)+this.x0,i.y=this.a*l*(this.coslat0*s-this.sinlat0*a*Math.cos(g))+this.y0,i):(h=2*Math.atan(bn(n,s,this.e))-A,u=Math.cos(h),c=Math.sin(h),Math.abs(this.coslat0)<=T?(m=Gt(this.e,n*this.con,this.con*s),v=2*this.a*this.k0*m/this.cons,i.x=this.x0+v*Math.sin(e-this.long0),i.y=this.y0-this.con*v*Math.cos(e-this.long0),i):(Math.abs(this.sinlat0)0?e=z(this.long0+Math.atan2(i.x,-1*i.y),this.over):e=z(this.long0+Math.atan2(i.x,i.y),this.over):e=z(this.long0+Math.atan2(i.x*Math.sin(c),h*this.coslat0*Math.cos(c)-i.y*this.sinlat0*Math.sin(c)),this.over),i.x=e,i.y=n,i)}else if(Math.abs(this.coslat0)<=T){if(h<=T)return n=this.lat0,e=this.long0,i.x=e,i.y=n,i;i.x*=this.con,i.y*=this.con,s=h*this.cons/(2*this.a*this.k0),n=this.con*Ze(this.e,s),e=this.con*z(this.con*this.long0+Math.atan2(i.x,-1*i.y),this.over)}else a=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,h<=T?l=this.X0:(l=Math.asin(Math.cos(a)*this.sinX0+i.y*Math.sin(a)*this.cosX0/h),e=z(this.long0+Math.atan2(i.x*Math.sin(a),h*this.cosX0*Math.cos(a)-i.y*this.sinX0*Math.sin(a)),this.over)),n=-1*Ze(this.e,Math.tan(.5*(A+l)));return i.x=e,i.y=n,i}var Bl=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const ql={init:Gl,forward:Ol,inverse:Rl,names:Bl,ssfn_:bn};function Fl(){var i=this.lat0;this.lambda0=this.long0;var e=Math.sin(i),n=this.a,s=this.rf,a=1/s,l=2*a-Math.pow(a,2),h=this.e=Math.sqrt(l);this.R=this.k0*n*Math.sqrt(1-l)/(1-l*Math.pow(e,2)),this.alpha=Math.sqrt(1+l/(1-l)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(e/this.alpha);var c=Math.log(Math.tan(Math.PI/4+this.b0/2)),u=Math.log(Math.tan(Math.PI/4+i/2)),m=Math.log((1+h*e)/(1-h*e));this.K=c-this.alpha*u+this.alpha*h/2*m}function Dl(i){var e=Math.log(Math.tan(Math.PI/4-i.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),s=-this.alpha*(e+n)+this.K,a=2*(Math.atan(Math.exp(s))-Math.PI/4),l=this.alpha*(i.x-this.lambda0),h=Math.atan(Math.sin(l)/(Math.sin(this.b0)*Math.tan(a)+Math.cos(this.b0)*Math.cos(l))),c=Math.asin(Math.cos(this.b0)*Math.sin(a)-Math.sin(this.b0)*Math.cos(a)*Math.cos(l));return i.y=this.R/2*Math.log((1+Math.sin(c))/(1-Math.sin(c)))+this.y0,i.x=this.R*h+this.x0,i}function Zl(i){for(var e=i.x-this.x0,n=i.y-this.y0,s=e/this.R,a=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),l=Math.asin(Math.cos(this.b0)*Math.sin(a)+Math.sin(this.b0)*Math.cos(a)*Math.cos(s)),h=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(a))),c=this.lambda0+h/this.alpha,u=0,m=l,v=-1e3,g=0;Math.abs(m-v)>1e-7;){if(++g>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+l/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(m))/2)),v=m,m=2*Math.atan(Math.exp(u))-Math.PI/2}return i.x=c,i.y=m,i}var jl=["somerc"];const Hl={init:Fl,forward:Dl,inverse:Zl,names:jl};var be=1e-7;function Ul(i){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],n=typeof i.projName=="object"?Object.keys(i.projName)[0]:i.projName;return"no_uoff"in i||"no_off"in i||e.indexOf(n)!==-1||e.indexOf(Tr(n))!==-1}function $l(){var i,e,n,s,a,l,h,c,u,m,v=0,g,_=0,w=0,x=0,S=0,E=0,C=0;this.no_off=Ul(this),this.no_rot="no_rot"in this;var k=!1;"alpha"in this&&(k=!0);var I=!1;if("rectified_grid_angle"in this&&(I=!0),k&&(C=this.alpha),I&&(v=this.rectified_grid_angle),k||I)_=this.longc;else if(w=this.long1,S=this.lat1,x=this.long2,E=this.lat2,Math.abs(S-E)<=be||(i=Math.abs(S))<=be||Math.abs(i-A)<=be||Math.abs(Math.abs(this.lat0)-A)<=be||Math.abs(Math.abs(E)-A)<=be)throw new Error;var B=1-this.es;e=Math.sqrt(B),Math.abs(this.lat0)>T?(c=Math.sin(this.lat0),n=Math.cos(this.lat0),i=1-this.es*c*c,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/B),this.A=this.B*this.k0*e/i,s=this.B*e/(n*Math.sqrt(i)),a=s*s-1,a<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=s,this.E*=Math.pow(Gt(this.e,this.lat0,c),this.B)):(this.B=1/e,this.A=this.k0,this.E=s=a=1),k||I?(k?(g=Math.asin(Math.sin(C)/s),I||(v=C)):(g=v,C=Math.asin(s*Math.sin(g))),this.lam0=_-Math.asin(.5*(a-1/a)*Math.tan(g))/this.B):(l=Math.pow(Gt(this.e,S,Math.sin(S)),this.B),h=Math.pow(Gt(this.e,E,Math.sin(E)),this.B),a=this.E/l,u=(h-l)/(h+l),m=this.E*this.E,m=(m-h*l)/(m+h*l),i=w-x,i<-Math.PI?x-=qe:i>Math.PI&&(x+=qe),this.lam0=z(.5*(w+x)-Math.atan(m*Math.tan(.5*this.B*(w-x))/u)/this.B,this.over),g=Math.atan(2*Math.sin(this.B*z(w-this.lam0,this.over))/(a-1/a)),v=C=Math.asin(s*Math.sin(g))),this.singam=Math.sin(g),this.cosgam=Math.cos(g),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(s*s-1)/Math.cos(C))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*g,this.v_pole_n=this.ArB*Math.log(Math.tan(K-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(K+a))}function Wl(i){var e={},n,s,a,l,h,c,u,m;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-A)>T){if(h=this.E/Math.pow(Gt(this.e,i.y,Math.sin(i.y)),this.B),c=1/h,n=.5*(h-c),s=.5*(h+c),l=Math.sin(this.B*i.x),a=(n*this.singam-l*this.cosgam)/s,Math.abs(Math.abs(a)-1)0?this.v_pole_n:this.v_pole_s,u=this.ArB*i.y;return this.no_rot?(e.x=u,e.y=m):(u-=this.u_0,e.x=m*this.cosrot+u*this.sinrot,e.y=u*this.cosrot-m*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Vl(i){var e,n,s,a,l,h,c,u={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(n=i.y,e=i.x):(n=i.x*this.cosrot-i.y*this.sinrot,e=i.y*this.cosrot+i.x*this.sinrot+this.u_0),s=Math.exp(-this.BrA*n),a=.5*(s-1/s),l=.5*(s+1/s),h=Math.sin(this.BrA*e),c=(h*this.cosgam+a*this.singam)/l,Math.abs(Math.abs(c)-1)T?this.ns=Math.log(s/c)/Math.log(a/u):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=s/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(m,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Ql(i){var e=i.x,n=i.y;Math.abs(2*Math.abs(n)-Math.PI)<=T&&(n=De(n)*(A-2*T));var s=Math.abs(Math.abs(n)-A),a,l;if(s>T)a=Gt(this.e,n,Math.sin(n)),l=this.a*this.f0*Math.pow(a,this.ns);else{if(s=n*this.ns,s<=0)return null;l=0}var h=this.ns*z(e-this.long0,this.over);return i.x=this.k0*(l*Math.sin(h))+this.x0,i.y=this.k0*(this.rh-l*Math.cos(h))+this.y0,i}function Yl(i){var e,n,s,a,l,h=(i.x-this.x0)/this.k0,c=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(h*h+c*c),n=1):(e=-Math.sqrt(h*h+c*c),n=-1);var u=0;if(e!==0&&(u=Math.atan2(n*h,n*c)),e!==0||this.ns>0){if(n=1/this.ns,s=Math.pow(e/(this.a*this.f0),n),a=Ze(this.e,s),a===-9999)return null}else a=-A;return l=z(u/this.ns+this.long0,this.over),i.x=l,i.y=a,i}var th=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const eh={init:Xl,forward:Ql,inverse:Yl,names:th};function ih(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function nh(i){var e,n,s,a,l,h,c,u=i.x,m=i.y,v=z(u-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(m))/(1-this.e*Math.sin(m)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(m/2+this.s45),this.alfa)/e)-this.s45),s=-v*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(s)),l=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(a)),h=this.n*l,c=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),i.y=c*Math.cos(h)/1,i.x=c*Math.sin(h)/1,this.czech||(i.y*=-1,i.x*=-1),i}function rh(i){var e,n,s,a,l,h,c,u,m=i.x;i.x=i.y,i.y=m,this.czech||(i.y*=-1,i.x*=-1),h=Math.sqrt(i.x*i.x+i.y*i.y),l=Math.atan2(i.y,i.x),a=l/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),n=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(e)),i.x=this.long0-n/this.alfa,c=e,u=0;var v=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.e/2))-this.s45),Math.abs(c-i.y)<1e-10&&(u=1),c=i.y,v+=1;while(u===0&&v<15);return v>=15?null:i}var sh=["Krovak","krovak"];const ah={init:ih,forward:nh,inverse:rh,names:sh};function gt(i,e,n,s,a){return i*a-e*Math.sin(2*a)+n*Math.sin(4*a)-s*Math.sin(6*a)}function Ue(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function $e(i){return .375*i*(1+.25*i*(1+.46875*i))}function We(i){return .05859375*i*i*(1+.75*i)}function Ve(i){return i*i*i*.011393229166666666}function wn(i,e,n){var s=e*n;return i/Math.sqrt(1-s*s)}function Yt(i){return Math.abs(i)1e-7?(n=i*e,(1-i*i)*(e/(1-n*n)-.5/i*Math.log((1-n)/(1+n)))):2*e}var xn=1,Mn=2,Sn=3,Ci=4;function uh(){var i=Math.abs(this.lat0);if(Math.abs(i-A)0){var e;switch(this.qp=te(this.e,1),this.mmf=.5/(1-this.es),this.apa=wh(this.es),this.mode){case Mn:this.dd=1;break;case xn:this.dd=1;break;case Sn:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case Ci:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=te(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===Ci&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function fh(i){var e,n,s,a,l,h,c,u,m,v,g=i.x,_=i.y;if(g=z(g-this.long0,this.over),this.sphere){if(l=Math.sin(_),v=Math.cos(_),s=Math.cos(g),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+v*s:1+this.sinph0*l+this.cosph0*v*s,n<=T)return null;n=Math.sqrt(2/n),e=n*v*Math.sin(g),n*=this.mode===this.EQUIT?l:this.cosph0*l-this.sinph0*v*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(_+this.lat0)=0?(e=(m=Math.sqrt(h))*a,n=s*(this.mode===this.S_POLE?m:-m)):e=n=0;break}}return i.x=this.a*e+this.x0,i.y=this.a*n+this.y0,i}function ph(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,n=i.y/this.a,s,a,l,h,c,u,m;if(this.sphere){var v=0,g,_=0;if(g=Math.sqrt(e*e+n*n),a=g*.5,a>1)return null;switch(a=2*Math.asin(a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(_=Math.sin(a),v=Math.cos(a)),this.mode){case this.EQUIT:a=Math.abs(g)<=T?0:Math.asin(n*_/g),e*=_,n=v*g;break;case this.OBLIQ:a=Math.abs(g)<=T?this.lat0:Math.asin(v*this.sinph0+n*_*this.cosph0/g),e*=_*this.cosph0,n=(v-Math.sin(a)*this.sinph0)*g;break;case this.N_POLE:n=-n,a=A-a;break;case this.S_POLE:a-=A;break}s=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,n)}else{if(m=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,n*=this.dd,u=Math.sqrt(e*e+n*n),u1&&(i=i>1?1:-1),Math.asin(i)}function Eh(){Math.abs(this.lat1+this.lat2)T?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Ph(i){var e=i.x,n=i.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var s=te(this.e3,this.sin_phi),a=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,l=this.ns0*z(e-this.long0,this.over),h=a*Math.sin(l)+this.x0,c=this.rh-a*Math.cos(l)+this.y0;return i.x=h,i.y=c,i}function kh(i){var e,n,s,a,l,h;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),s=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),s=-1),a=0,e!==0&&(a=Math.atan2(s*i.x,s*i.y)),s=e*this.ns0/this.a,this.sphere?h=Math.asin((this.c-s*s)/(2*this.ns0)):(n=(this.c-s*s)/this.ns0,h=this.phi1z(this.e3,n)),l=z(a/this.ns0+this.long0,this.over),i.x=l,i.y=h,i}function Ah(i,e){var n,s,a,l,h,c=ee(.5*e);if(i0||Math.abs(h)<=T?(c=this.x0+this.a*l*n*Math.sin(s)/h,u=this.y0+this.a*l*(this.cos_p14*e-this.sin_p14*n*a)/h):(c=this.x0+this.infinity_dist*n*Math.sin(s),u=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*a)),i.x=c,i.y=u,i}function Ih(i){var e,n,s,a,l,h;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(e=Math.sqrt(i.x*i.x+i.y*i.y))?(a=Math.atan2(e,this.rc),n=Math.sin(a),s=Math.cos(a),h=ee(s*this.sin_p14+i.y*n*this.cos_p14/e),l=Math.atan2(i.x*n,e*this.cos_p14*s-i.y*this.sin_p14*n),l=z(this.long0+l,this.over)):(h=this.phic0,l=0),i.x=l,i.y=h,i}var Nh=["gnom"];const Gh={init:Th,forward:zh,inverse:Ih,names:Nh};function Oh(i,e){var n=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*A:A;for(var s=Math.asin(.5*e),a,l,h,c,u=0;u<30;u++)if(l=Math.sin(s),h=Math.cos(s),c=i*l,a=Math.pow(1-c*c,2)/(2*h)*(e/(1-i*i)-l/(1-c*c)+.5/i*Math.log((1-c)/(1+c))),s+=a,Math.abs(a)<=1e-10)return s;return NaN}function Rh(){this.sphere||(this.k0=Bt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Bh(i){var e=i.x,n=i.y,s,a,l=z(e-this.long0,this.over);if(this.sphere)s=this.x0+this.a*l*Math.cos(this.lat_ts),a=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var h=te(this.e,Math.sin(n));s=this.x0+this.a*this.k0*l,a=this.y0+this.a*h*.5/this.k0}return i.x=s,i.y=a,i}function qh(i){i.x-=this.x0,i.y-=this.y0;var e,n;return this.sphere?(e=z(this.long0+i.x/this.a/Math.cos(this.lat_ts),this.over),n=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(n=Oh(this.e,2*i.y*this.k0/this.a),e=z(this.long0+i.x/(this.a*this.k0),this.over)),i.x=e,i.y=n,i}var Fh=["cea"];const Dh={init:Rh,forward:Bh,inverse:qh,names:Fh};function Zh(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function jh(i){var e=i.x,n=i.y,s=z(e-this.long0,this.over),a=Yt(n-this.lat0);return i.x=this.x0+this.a*s*this.rc,i.y=this.y0+this.a*a,i}function Hh(i){var e=i.x,n=i.y;return i.x=z(this.long0+(e-this.x0)/(this.a*this.rc),this.over),i.y=Yt(this.lat0+(n-this.y0)/this.a),i}var Uh=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const $h={init:Zh,forward:jh,inverse:Hh,names:Uh};var es=20;function Wh(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ue(this.es),this.e1=$e(this.es),this.e2=We(this.es),this.e3=Ve(this.es),this.ml0=this.a*gt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Vh(i){var e=i.x,n=i.y,s,a,l,h=z(e-this.long0,this.over);if(l=h*Math.sin(n),this.sphere)Math.abs(n)<=T?(s=this.a*h,a=-1*this.a*this.lat0):(s=this.a*Math.sin(l)/Math.tan(n),a=this.a*(Yt(n-this.lat0)+(1-Math.cos(l))/Math.tan(n)));else if(Math.abs(n)<=T)s=this.a*h,a=-1*this.ml0;else{var c=wn(this.a,this.e,Math.sin(n))/Math.tan(n);s=c*Math.sin(l),a=this.a*gt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+c*(1-Math.cos(l))}return i.x=s+this.x0,i.y=a+this.y0,i}function Jh(i){var e,n,s,a,l,h,c,u,m;if(s=i.x-this.x0,a=i.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=T)e=z(s/this.a+this.long0,this.over),n=0;else{h=this.lat0+a/this.a,c=s*s/this.a/this.a+h*h,u=h;var v;for(l=es;l;--l)if(v=Math.tan(u),m=-1*(h*(u*v+1)-u-.5*(u*u+c)*v)/((u-h)/v-1),u+=m,Math.abs(m)<=T){n=u;break}e=z(this.long0+Math.asin(s*Math.tan(u)/this.a)/Math.sin(n),this.over)}else if(Math.abs(a+this.ml0)<=T)n=0,e=z(this.long0+s/this.a,this.over);else{h=(this.ml0+a)/this.a,c=s*s/this.a/this.a+h*h,u=h;var g,_,w,x,S;for(l=es;l;--l)if(S=this.e*Math.sin(u),g=Math.sqrt(1-S*S)*Math.tan(u),_=this.a*gt(this.e0,this.e1,this.e2,this.e3,u),w=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),x=_/this.a,m=(h*(g*x+1)-x-.5*g*(x*x+c))/(this.es*Math.sin(2*u)*(x*x+c-2*h*x)/(4*g)+(h-x)*(g*w-2/Math.sin(2*u))-w),u-=m,Math.abs(m)<=T){n=u;break}g=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=z(this.long0+Math.asin(s*g/this.a)/Math.sin(n),this.over)}return i.x=e,i.y=n,i}var Kh=["Polyconic","American_Polyconic","poly"];const Xh={init:Wh,forward:Vh,inverse:Jh,names:Kh};function Qh(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Yh(i){var e,n=i.x,s=i.y,a=s-this.lat0,l=n-this.long0,h=a/Be*1e-5,c=l,u=1,m=0;for(e=1;e<=10;e++)u=u*h,m=m+this.A[e]*u;var v=m,g=c,_=1,w=0,x,S,E=0,C=0;for(e=1;e<=6;e++)x=_*v-w*g,S=w*v+_*g,_=x,w=S,E=E+this.B_re[e]*_-this.B_im[e]*w,C=C+this.B_im[e]*_+this.B_re[e]*w;return i.x=C*this.a+this.x0,i.y=E*this.a+this.y0,i}function tc(i){var e,n=i.x,s=i.y,a=n-this.x0,l=s-this.y0,h=l/this.a,c=a/this.a,u=1,m=0,v,g,_=0,w=0;for(e=1;e<=6;e++)v=u*h-m*c,g=m*h+u*c,u=v,m=g,_=_+this.C_re[e]*u-this.C_im[e]*m,w=w+this.C_im[e]*u+this.C_re[e]*m;for(var x=0;x.999999999999&&(n=.999999999999),e=Math.asin(n);var s=z(this.long0+i.x/(.900316316158*this.a*Math.cos(e)),this.over);s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var a=Math.asin(n);return i.x=s,i.y=a,i}var gc=["Mollweide","moll"];const vc={init:pc,forward:mc,inverse:_c,names:gc};function yc(){Math.abs(this.lat1+this.lat2)=0?(n=Math.sqrt(i.x*i.x+i.y*i.y),e=1):(n=-Math.sqrt(i.x*i.x+i.y*i.y),e=-1);var l=0;if(n!==0&&(l=Math.atan2(e*i.x,e*i.y)),this.sphere)return a=z(this.long0+l/this.ns,this.over),s=Yt(this.g-n/this.a),i.x=a,i.y=s,i;var h=this.g-n/this.a;return s=Li(h,this.e0,this.e1,this.e2,this.e3),a=z(this.long0+l/this.ns,this.over),i.x=a,i.y=s,i}var xc=["Equidistant_Conic","eqdc"];const Mc={init:yc,forward:bc,inverse:wc,names:xc};function Sc(){this.R=this.a}function Ec(i){var e=i.x,n=i.y,s=z(e-this.long0,this.over),a,l;Math.abs(n)<=T&&(a=this.x0+this.R*s,l=this.y0);var h=ee(2*Math.abs(n/Math.PI));(Math.abs(s)<=T||Math.abs(Math.abs(n)-A)<=T)&&(a=this.x0,n>=0?l=this.y0+Math.PI*this.R*Math.tan(.5*h):l=this.y0+Math.PI*this.R*-Math.tan(.5*h));var c=.5*Math.abs(Math.PI/s-s/Math.PI),u=c*c,m=Math.sin(h),v=Math.cos(h),g=v/(m+v-1),_=g*g,w=g*(2/m-1),x=w*w,S=Math.PI*this.R*(c*(g-x)+Math.sqrt(u*(g-x)*(g-x)-(x+u)*(_-x)))/(x+u);s<0&&(S=-S),a=this.x0+S;var E=u+g;return S=Math.PI*this.R*(w*E-c*Math.sqrt((x+u)*(u+1)-E*E))/(x+u),n>=0?l=this.y0+S:l=this.y0-S,i.x=a,i.y=l,i}function Pc(i){var e,n,s,a,l,h,c,u,m,v,g,_,w;return i.x-=this.x0,i.y-=this.y0,g=Math.PI*this.R,s=i.x/g,a=i.y/g,l=s*s+a*a,h=-Math.abs(a)*(1+l),c=h-2*a*a+s*s,u=-2*h+1+2*a*a+l*l,w=a*a/u+(2*c*c*c/u/u/u-9*h*c/u/u)/27,m=(h-c*c/3/u)/u,v=2*Math.sqrt(-m/3),g=3*w/m/v,Math.abs(g)>1&&(g>=0?g=1:g=-1),_=Math.acos(g)/3,i.y>=0?n=(-v*Math.cos(_+Math.PI/3)-c/3/u)*Math.PI:n=-(-v*Math.cos(_+Math.PI/3)-c/3/u)*Math.PI,Math.abs(s)1e-12&&--S>0);return S===0?{azi1:NaN,s12:NaN}:(et=F*(a*a-a*(1-l)*(a*(1-l)))/(a*(1-l)*(a*(1-l))),Mt=1+et/16384*(4096+et*(-768+et*(320-175*et))),Q=et/1024*(256+et*(-128+et*(74-47*et))),ht=Q*k*(J+Q/4*(I*(-1+2*J*J)-Q/6*J*(-3+4*k*k)*(-3+4*J*J))),ie=a*(1-l)*Mt*(B-ht),{azi1:Math.atan2(_*E,v*g-m*_*C),s12:ie})}function Cc(i,e,n,s,a,l){const h=Math.atan((1-l)*Math.tan(i)),c=Math.sin(h),u=Math.cos(h),m=Math.sin(n),v=Math.cos(n),g=Math.atan2(c,u*v),_=u*m,w=1-_*_,x=w*(a*a-a*(1-l)*(a*(1-l)))/(a*(1-l)*(a*(1-l))),S=1+x/16384*(4096+x*(-768+x*(320-175*x))),E=x/1024*(256+x*(-128+x*(74-47*x)));let C=s/(a*(1-l)*S),k,I=100,B,H,F,J;do B=Math.cos(2*g+C),H=Math.sin(C),F=Math.cos(C),J=E*H*(B+E/4*(F*(-1+2*B*B)-E/6*B*(-3+4*H*H)*(-3+4*B*B))),k=C,C=s/(a*(1-l)*S)+J;while(Math.abs(C-k)>1e-12&&--I>0);if(I===0)return{lat2:NaN,lon2:NaN};const ot=c*H-u*F*v,et=Math.atan2(c*F+u*H*v,(1-l)*Math.sqrt(_*_+ot*ot)),Mt=Math.atan2(H*m,u*F-c*H*v),Q=l/16*w*(4+l*(4-3*w)),ht=Mt-(1-Q)*l*_*(C+Q*H*(B+Q*F*(-1+2*B*B))),ie=e+ht;return{lat2:et,lon2:ie}}function Tc(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function zc(i){var e=i.x,n=i.y,s=Math.sin(i.y),a=Math.cos(i.y),l=z(e-this.long0,this.over),h,c,u,m,v,g,_,w,x,S,E;return this.sphere?Math.abs(this.sin_p12-1)<=T?(i.x=this.x0+this.a*(A-n)*Math.sin(l),i.y=this.y0-this.a*(A-n)*Math.cos(l),i):Math.abs(this.sin_p12+1)<=T?(i.x=this.x0+this.a*(A+n)*Math.sin(l),i.y=this.y0+this.a*(A+n)*Math.cos(l),i):(x=this.sin_p12*s+this.cos_p12*a*Math.cos(l),_=Math.acos(x),w=_?_/Math.sin(_):1,i.x=this.x0+this.a*w*a*Math.sin(l),i.y=this.y0+this.a*w*(this.cos_p12*s-this.sin_p12*a*Math.cos(l)),i):(h=Ue(this.es),c=$e(this.es),u=We(this.es),m=Ve(this.es),Math.abs(this.sin_p12-1)<=T?(v=this.a*gt(h,c,u,m,A),g=this.a*gt(h,c,u,m,n),i.x=this.x0+(v-g)*Math.sin(l),i.y=this.y0-(v-g)*Math.cos(l),i):Math.abs(this.sin_p12+1)<=T?(v=this.a*gt(h,c,u,m,A),g=this.a*gt(h,c,u,m,n),i.x=this.x0+(v+g)*Math.sin(l),i.y=this.y0+(v+g)*Math.cos(l),i):Math.abs(e)2*A*this.a?void 0:(n=e/this.a,s=Math.sin(n),a=Math.cos(n),l=this.long0,Math.abs(e)<=T?h=this.lat0:(h=ee(a*this.sin_p12+i.y*s*this.cos_p12/e),c=Math.abs(this.lat0)-A,Math.abs(c)<=T?this.lat0>=0?l=z(this.long0+Math.atan2(i.x,-i.y),this.over):l=z(this.long0-Math.atan2(-i.x,i.y),this.over):l=z(this.long0+Math.atan2(i.x*s,e*this.cos_p12*a-i.y*this.sin_p12*s),this.over)),i.x=l,i.y=h,i)):(u=Ue(this.es),m=$e(this.es),v=We(this.es),g=Ve(this.es),Math.abs(this.sin_p12-1)<=T?(_=this.a*gt(u,m,v,g,A),e=Math.sqrt(i.x*i.x+i.y*i.y),w=_-e,h=Li(w/this.a,u,m,v,g),l=z(this.long0+Math.atan2(i.x,-1*i.y),this.over),i.x=l,i.y=h,i):Math.abs(this.sin_p12+1)<=T?(_=this.a*gt(u,m,v,g,A),e=Math.sqrt(i.x*i.x+i.y*i.y),w=e-_,h=Li(w/this.a,u,m,v,g),l=z(this.long0+Math.atan2(i.x,i.y),this.over),i.x=l,i.y=h,i):(x=Math.atan2(i.x,i.y),S=Math.sqrt(i.x*i.x+i.y*i.y),E=Cc(this.lat0,this.long0,x,S,this.a,this.f),i.x=E.lon2,i.y=E.lat2,i))}var Nc=["Azimuthal_Equidistant","aeqd"];const Gc={init:Tc,forward:zc,inverse:Ic,names:Nc};function Oc(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Rc(i){var e,n,s,a,l,h,c,u,m=i.x,v=i.y;return s=z(m-this.long0,this.over),e=Math.sin(v),n=Math.cos(v),a=Math.cos(s),h=this.sin_p14*e+this.cos_p14*n*a,l=1,(h>0||Math.abs(h)<=T)&&(c=this.a*l*n*Math.sin(s),u=this.y0+this.a*l*(this.cos_p14*e-this.sin_p14*n*a)),i.x=c,i.y=u,i}function Bc(i){var e,n,s,a,l,h,c;return i.x-=this.x0,i.y-=this.y0,e=Math.sqrt(i.x*i.x+i.y*i.y),n=ee(e/this.a),s=Math.sin(n),a=Math.cos(n),h=this.long0,Math.abs(e)<=T?(c=this.lat0,i.x=h,i.y=c,i):(c=ee(a*this.sin_p14+i.y*s*this.cos_p14/e),l=Math.abs(this.lat0)-A,Math.abs(l)<=T?(this.lat0>=0?h=z(this.long0+Math.atan2(i.x,-i.y),this.over):h=z(this.long0-Math.atan2(-i.x,i.y),this.over),i.x=h,i.y=c,i):(h=z(this.long0+Math.atan2(i.x*s,e*this.cos_p14*a-i.y*this.sin_p14*s),this.over),i.x=h,i.y=c,i))}var qc=["ortho"];const Fc={init:Oc,forward:Rc,inverse:Bc,names:qc};var it={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},X={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Dc(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=A-K/2?this.face=it.TOP:this.lat0<=-(A-K/2)?this.face=it.BOTTOM:Math.abs(this.long0)<=K?this.face=it.FRONT:Math.abs(this.long0)<=A+K?this.face=this.long0>0?it.RIGHT:it.LEFT:this.face=it.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Zc(i){var e={x:0,y:0},n,s,a,l,h,c,u={value:0};if(i.x-=this.long0,this.es!==0?n=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):n=i.y,s=i.x,this.face===it.TOP)l=A-n,s>=K&&s<=A+K?(u.value=X.AREA_0,a=s-A):s>A+K||s<=-(A+K)?(u.value=X.AREA_1,a=s>0?s-at:s+at):s>-(A+K)&&s<=-K?(u.value=X.AREA_2,a=s+A):(u.value=X.AREA_3,a=s);else if(this.face===it.BOTTOM)l=A+n,s>=K&&s<=A+K?(u.value=X.AREA_0,a=-s+A):s=-K?(u.value=X.AREA_1,a=-s):s<-K&&s>=-(A+K)?(u.value=X.AREA_2,a=-s-A):(u.value=X.AREA_3,a=s>0?-s+at:-s-at);else{var m,v,g,_,w,x,S;this.face===it.RIGHT?s=we(s,+A):this.face===it.BACK?s=we(s,+at):this.face===it.LEFT&&(s=we(s,-A)),_=Math.sin(n),w=Math.cos(n),x=Math.sin(s),S=Math.cos(s),m=w*S,v=w*x,g=_,this.face===it.FRONT?(l=Math.acos(m),a=Ti(l,g,v,u)):this.face===it.RIGHT?(l=Math.acos(v),a=Ti(l,g,-m,u)):this.face===it.BACK?(l=Math.acos(-m),a=Ti(l,g,-v,u)):this.face===it.LEFT?(l=Math.acos(-v),a=Ti(l,g,m,u)):(l=a=0,u.value=X.AREA_0)}return c=Math.atan(12/at*(a+Math.acos(Math.sin(a)*Math.cos(K))-A)),h=Math.sqrt((1-Math.cos(l))/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(a))))),u.value===X.AREA_1?c+=A:u.value===X.AREA_2?c+=at:u.value===X.AREA_3&&(c+=1.5*at),e.x=h*Math.cos(c),e.y=h*Math.sin(c),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,i.x=e.x,i.y=e.y,i}function jc(i){var e={lam:0,phi:0},n,s,a,l,h,c,u,m,v,g={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,s=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),n=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?g.value=X.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(g.value=X.AREA_1,n-=A):i.x<0&&-i.x>=Math.abs(i.y)?(g.value=X.AREA_2,n=n<0?n+at:n-at):(g.value=X.AREA_3,n+=A),v=at/12*Math.tan(n),h=Math.sin(v)/(Math.cos(v)-1/Math.sqrt(2)),c=Math.atan(h),a=Math.cos(n),l=Math.tan(s),u=1-a*a*l*l*(1-Math.cos(Math.atan(1/Math.cos(c)))),u<-1?u=-1:u>1&&(u=1),this.face===it.TOP)m=Math.acos(u),e.phi=A-m,g.value===X.AREA_0?e.lam=c+A:g.value===X.AREA_1?e.lam=c<0?c+at:c-at:g.value===X.AREA_2?e.lam=c-A:e.lam=c;else if(this.face===it.BOTTOM)m=Math.acos(u),e.phi=m-A,g.value===X.AREA_0?e.lam=-c+A:g.value===X.AREA_1?e.lam=-c:g.value===X.AREA_2?e.lam=-c-A:e.lam=c<0?-c-at:-c+at;else{var _,w,x;_=u,v=_*_,v>=1?x=0:x=Math.sqrt(1-v)*Math.sin(c),v+=x*x,v>=1?w=0:w=Math.sqrt(1-v),g.value===X.AREA_1?(v=w,w=-x,x=v):g.value===X.AREA_2?(w=-w,x=-x):g.value===X.AREA_3&&(v=w,w=x,x=-v),this.face===it.RIGHT?(v=_,_=-w,w=v):this.face===it.BACK?(_=-_,w=-w):this.face===it.LEFT&&(v=_,_=w,w=-v),e.phi=Math.acos(-x)-A,e.lam=Math.atan2(w,_),this.face===it.RIGHT?e.lam=we(e.lam,-A):this.face===it.BACK?e.lam=we(e.lam,-at):this.face===it.LEFT&&(e.lam=we(e.lam,+A))}if(this.es!==0){var S,E,C;S=e.phi<0?1:0,E=Math.tan(e.phi),C=this.b/Math.sqrt(E*E+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-C*C)/(this.one_minus_f*C)),S&&(e.phi=-e.phi)}return e.lam+=this.long0,i.x=e.lam,i.y=e.phi,i}function Ti(i,e,n,s){var a;return iK&&a<=A+K?(s.value=X.AREA_1,a-=A):a>A+K||a<=-(A+K)?(s.value=X.AREA_2,a=a>=0?a-at:a+at):(s.value=X.AREA_3,a+=A)),a}function we(i,e){var n=i+e;return n<-at?n+=qe:n>+at&&(n-=qe),n}var Hc=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const Uc={init:Dc,forward:Zc,inverse:jc,names:Hc};var En=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Je=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],is=.8487,ns=1.3523,rs=yt/5,$c=1/rs,xe=18,zi=function(i,e){return i[0]+e*(i[1]+e*(i[2]+e*i[3]))},Wc=function(i,e){return i[1]+e*(2*i[2]+e*3*i[3])};function Vc(i,e,n,s){for(var a=e;s;--s){var l=i(a);if(a-=l,Math.abs(l)=xe&&(s=xe-1),n=yt*(n-$c*s);var a={x:zi(En[s],n)*e,y:zi(Je[s],n)};return i.y<0&&(a.y=-a.y),a.x=a.x*this.a*is+this.x0,a.y=a.y*this.a*ns+this.y0,a}function Xc(i){var e={x:(i.x-this.x0)/(this.a*is),y:Math.abs(i.y-this.y0)/(this.a*ns)};if(e.y>=1)e.x/=En[xe][0],e.y=i.y<0?-A:A;else{var n=Math.floor(e.y*xe);for(n<0?n=0:n>=xe&&(n=xe-1);;)if(Je[n][0]>e.y)--n;else if(Je[n+1][0]<=e.y)++n;else break;var s=Je[n],a=5*(e.y-s[0])/(Je[n+1][0]-s[0]);a=Vc(function(l){return(zi(s,l)-e.y)/Wc(s,l)},a,T,100),e.x/=zi(En[n],a),e.y=(5*n+a)*st,i.y<0&&(e.y=-e.y)}return e.x=z(e.x+this.long0,this.over),e}var Qc=["Robinson","robin"];const Yc={init:Jc,forward:Kc,inverse:Xc,names:Qc};function td(){this.name="geocent"}function ed(i){var e=Nr(i,this.es,this.a);return e}function id(i){var e=Gr(i,this.es,this.a,this.b);return e}var nd=["Geocentric","geocentric","geocent","Geocent"];const rd={init:td,forward:ed,inverse:id,names:nd};var _t={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Ke={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function sd(){if(Object.keys(Ke).forEach((function(n){if(typeof this[n]>"u")this[n]=Ke[n].def;else{if(Ke[n].num&&isNaN(this[n]))throw new Error("Invalid parameter value, must be numeric "+n+" = "+this[n]);Ke[n].num&&(this[n]=parseFloat(this[n]))}Ke[n].degrees&&(this[n]=this[n]*st)}).bind(this)),Math.abs(Math.abs(this.lat0)-A)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var i=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(i),this.sw=Math.sin(i)}function ad(i){i.x-=this.long0;var e=Math.sin(i.y),n=Math.cos(i.y),s=Math.cos(i.x),a,l;switch(this.mode){case _t.OBLIQ:l=this.sinph0*e+this.cosph0*n*s;break;case _t.EQUIT:l=n*s;break;case _t.S_POLE:l=-e;break;case _t.N_POLE:l=e;break}switch(l=this.pn1/(this.p-l),a=l*n*Math.sin(i.x),this.mode){case _t.OBLIQ:l*=this.cosph0*e-this.sinph0*n*s;break;case _t.EQUIT:l*=e;break;case _t.N_POLE:l*=-(n*s);break;case _t.S_POLE:l*=n*s;break}var h,c;return h=l*this.cg+a*this.sg,c=1/(h*this.sw*this.h1+this.cw),a=(a*this.cg-l*this.sg)*this.cw*c,l=h*c,i.x=a*this.a,i.y=l*this.a,i}function od(i){i.x/=this.a,i.y/=this.a;var e={x:i.x,y:i.y},n,s,a;a=1/(this.pn1-i.y*this.sw),n=this.pn1*i.x*a,s=this.pn1*i.y*this.cw*a,i.x=n*this.cg+s*this.sg,i.y=s*this.cg-n*this.sg;var l=xt(i.x,i.y);if(Math.abs(l)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var i=1-this.es,e=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function dd(i){var e=i.x,n=i.y,s,a,l,h;if(e=e-this.long0,this.shape==="ellipse"){n=Math.atan(this.radius_p2*Math.tan(n));var c=this.radius_p/xt(this.radius_p*Math.cos(n),Math.sin(n));if(a=c*Math.cos(e)*Math.cos(n),l=c*Math.sin(e)*Math.cos(n),h=c*Math.sin(n),(this.radius_g-a)*a-l*l-h*h*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;s=this.radius_g-a,this.flip_axis?(i.x=this.radius_g_1*Math.atan(l/xt(h,s)),i.y=this.radius_g_1*Math.atan(h/s)):(i.x=this.radius_g_1*Math.atan(l/s),i.y=this.radius_g_1*Math.atan(h/xt(l,s)))}else this.shape==="sphere"&&(s=Math.cos(n),a=Math.cos(e)*s,l=Math.sin(e)*s,h=Math.sin(n),s=this.radius_g-a,this.flip_axis?(i.x=this.radius_g_1*Math.atan(l/xt(h,s)),i.y=this.radius_g_1*Math.atan(h/s)):(i.x=this.radius_g_1*Math.atan(l/s),i.y=this.radius_g_1*Math.atan(h/xt(l,s))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function ud(i){var e=-1,n=0,s=0,a,l,h,c;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(s=Math.tan(i.y/this.radius_g_1),n=Math.tan(i.x/this.radius_g_1)*xt(1,s)):(n=Math.tan(i.x/this.radius_g_1),s=Math.tan(i.y/this.radius_g_1)*xt(1,n));var u=s/this.radius_p;if(a=n*n+u*u+e*e,l=2*this.radius_g*e,h=l*l-4*a*this.C,h<0)return i.x=Number.NaN,i.y=Number.NaN,i;c=(-l-Math.sqrt(h))/(2*a),e=this.radius_g+c*e,n*=c,s*=c,i.x=Math.atan2(n,e),i.y=Math.atan(s*Math.cos(i.x)/e),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(s=Math.tan(i.y/this.radius_g_1),n=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+s*s)):(n=Math.tan(i.x/this.radius_g_1),s=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+n*n)),a=n*n+s*s+e*e,l=2*this.radius_g*e,h=l*l-4*a*this.C,h<0)return i.x=Number.NaN,i.y=Number.NaN,i;c=(-l-Math.sqrt(h))/(2*a),e=this.radius_g+c*e,n*=c,s*=c,i.x=Math.atan2(n,e),i.y=Math.atan(s*Math.cos(i.x)/e)}return i.x=i.x+this.long0,i}var fd=["Geostationary Satellite View","Geostationary_Satellite","geos"];const pd={init:cd,forward:dd,inverse:ud,names:fd};var Xe=1.340264,Qe=-.081106,Ye=893e-6,ti=.003796,Ii=Math.sqrt(3)/2;function md(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function _d(i){var e=z(i.x-this.long0,this.over),n=i.y,s=Math.asin(Ii*Math.sin(n)),a=s*s,l=a*a*a;return i.x=e*Math.cos(s)/(Ii*(Xe+3*Qe*a+l*(7*Ye+9*ti*a))),i.y=s*(Xe+Qe*a+l*(Ye+ti*a)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function gd(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var e=1e-9,n=12,s=i.y,a,l,h,c,u,m;for(m=0;m=A?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Sd,this.forward=Md)}function wd(i){var e=z(i.x-(this.long0||0),this.over),n=i.y,s,a,l;return s=this.am1+this.m1-ye(n,a=Math.sin(n),l=Math.cos(n),this.en),a=l*e/(s*Math.sqrt(1-this.es*a*a)),i.x=s*Math.sin(a),i.y=this.am1-s*Math.cos(a),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function xd(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,n,s,a;if(n=xt(i.x,i.y=this.am1-i.y),a=_n(this.am1+this.m1-n,this.es,this.en),(e=Math.abs(a))ei?(i.x=a*Math.sin(s=e*Math.cos(n)/a),i.y=this.cphi1-a*Math.cos(s)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function Sd(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,n,s=xt(i.x,i.y=this.cphi1-i.y);if(n=this.cphi1+this.phi1-s,Math.abs(n)>A)throw new Error;return Math.abs(Math.abs(n)-A)<=ei?e=0:e=s*Math.atan2(i.x,i.y)/Math.cos(n),i.x=z(e+(this.long0||0),this.over),i.y=Yt(n),i}var Ed=["bonne","Bonne (Werner lat_1=90)"];const Pd={init:bd,names:Ed},ss={OBLIQUE:{forward:Td,inverse:Id},TRANSVERSE:{forward:zd,inverse:Nd}},Ni={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function kd(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Lr.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const i=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=At(i);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let n;const s=Object.keys(Ni),a=c=>{if(typeof this[c]>"u")return;const u=parseFloat(this[c])*st;if(isNaN(u))throw new Error("Invalid value for "+c+": "+this[c]);return u};for(let c=0;ctypeof this[_]<"u")){n=m;for(let _=0;_"u")throw new Error("Missing parameter: "+w+".");this[x]=S}break}}if(!n)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:l,phip:h}=Cd(this,n);this.lamp=l,Math.abs(h)>T?(this.cphip=Math.cos(h),this.sphip=Math.sin(h),this.projectionType=ss.OBLIQUE):this.projectionType=ss.TRANSVERSE}function Ad(i){return this.projectionType.forward(this,i)}function Ld(i){return this.projectionType.inverse(this,i)}function Cd(i,e){let n,s;if(e===Ni.ROTATE){let a=i.oLongC,l=i.oLatC,h=i.oAlpha;if(Math.abs(Math.abs(l)-A)<=T)throw new Error("Invalid value for o_lat_c: "+i.o_lat_c+" should be < 90°");s=a+Math.atan2(-1*Math.cos(h),-1*Math.sin(h)*Math.sin(l)),n=Math.asin(Math.cos(l)*Math.sin(h))}else if(e===Ni.NEW_POLE)s=i.oLongP,n=i.oLatP;else{let a=i.oLong1,l=i.oLat1,h=i.oLong2,c=i.oLat2,u=Math.abs(l);if(Math.abs(l)>A-T)throw new Error("Invalid value for o_lat_1: "+i.o_lat_1+" should be < 90°");if(Math.abs(c)>A-T)throw new Error("Invalid value for o_lat_2: "+i.o_lat_2+" should be < 90°");if(Math.abs(l-c)3&&(s=l[l.length-3]+":"+l[l.length-1]),n.defs[s]===void 0)throw"No projection definition for code "+s}return n(s)}}),e.Proj.CRS=e.Class.extend({includes:e.CRS,options:{transformation:new e.Transformation(1,0,-1,0)},initialize:function(s,a,l){var h,c,u,m;if(e.Proj._isProj4Obj(s)?(c=s,h=c.srsCode,m=a||{},this.projection=new e.Proj.Projection(c,m.bounds)):(h=s,u=a,m=l||{},this.projection=new e.Proj.Projection(h,u,m.bounds)),e.Util.setOptions(this,m),this.code=h,this.transformation=this.options.transformation,this.options.origin&&(this.transformation=new e.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales)this._scales=this.options.scales;else if(this.options.resolutions){this._scales=[];for(var v=this.options.resolutions.length-1;v>=0;v--)this.options.resolutions[v]&&(this._scales[v]=1/this.options.resolutions[v])}this.infinite=!this.options.bounds},scale:function(s){var a=Math.floor(s),l,h,c,u;return s===a?this._scales[s]:(l=this._scales[a],h=this._scales[a+1],c=h-l,u=s-a,l+c*u)},zoom:function(s){var a=this._closestElement(this._scales,s),l=this._scales.indexOf(a),h,c,u;return s===a?l:a===void 0?-1/0:(c=l+1,h=this._scales[c],h===void 0?1/0:(u=h-a,(s-a)/u+l))},distance:e.CRS.Earth.distance,R:e.CRS.Earth.R,_closestElement:function(s,a){for(var l,h=s.length;h--;)s[h]<=a&&(l===void 0||l180||Math.abs(s)>90}function Dd(i){const e=i.features||[i];for(const n of e){const s=n.geometry?.coordinates;if(!s)continue;let a=s;for(;Array.isArray(a[0]);)a=a[0];return a}return null}function ls(i){const e=i.crs?.properties?.name;if(!e)return null;const n=e.match(/EPSG::?(\d+)$/i);return n?`EPSG:${n[1]}`:e.match(/^EPSG:\d+$/i)?e.toUpperCase():null}function Oi(i,e){const[n,s]=i;return Gi(e,"EPSG:4326",[n,s])}function Zd(){return new O.Proj.CRS("EPSG:28992",os,{resolutions:[3440.64,1720.32,860.16,430.08,215.04,107.52,53.76,26.88,13.44,6.72,3.36,1.68,.84,.42,.21],bounds:O.bounds([-285401.92,22598.08],[595401.9199999999,903401.9199999999]),origin:[-285401.92,22598.08]})}const hs={search:` +northing meters`+i;var _=g/2,w=0,x=0,S,E,C,k,I;return _>0&&(S=1e5/Math.pow(10,_),E=i.substring(l,l+_),w=parseFloat(E)*S,C=i.substring(l+_),x=parseFloat(C)*S),k=w+m,I=x+v,{easting:k,northing:I,zoneLetter:c,zoneNumber:h,accuracy:S}}function Ko(i,e){for(var n=jr.charCodeAt(e-1),s=1e5,a=!1;n!==i.charCodeAt(0);){if(n++,n===xt&&n++,n===Ct&&n++,n>He){if(a)throw"Bad character: "+i;n=ge,a=!0}s+=1e5}return s}function Xo(i,e){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var n=Hr.charCodeAt(e-1),s=0,a=!1;n!==i.charCodeAt(0);){if(n++,n===xt&&n++,n===Ct&&n++,n>je){if(a)throw"Bad character: "+i;n=ge,a=!0}s+=1e5}return s}function Qo(i){var e;switch(i){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+i}function ve(i,e,n){if(!(this instanceof ve))return new ve(i,e,n);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof e>"u"){var s=i.split(",");this.x=parseFloat(s[0]),this.y=parseFloat(s[1]),this.z=parseFloat(s[2])||0}else this.x=i,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}ve.fromMGRS=function(i){return new ve($r(i))},ve.prototype.toMGRS=function(i){return Ur([this.x,this.y],i)};var Yo=1,tl=.25,Kr=.046875,Xr=.01953125,Qr=.01068115234375,el=.75,il=.46875,nl=.013020833333333334,rl=.007120768229166667,sl=.3645833333333333,al=.005696614583333333,ol=.3076171875;function mn(i){var e=[];e[0]=Yo-i*(tl+i*(Kr+i*(Xr+i*Qr))),e[1]=i*(el-i*(Kr+i*(Xr+i*Qr)));var n=i*i;return e[2]=n*(il-i*(nl+i*rl)),n*=i,e[3]=n*(sl-i*al),e[4]=n*i*ol,e}function ye(i,e,n,s){return n*=e,e*=e,s[0]*i-n*(s[1]+e*(s[2]+e*(s[3]+e*s[4])))}var ll=20;function _n(i,e,n){for(var s=1/(1-e),a=i,l=ll;l;--l){var h=Math.sin(a),c=1-e*h*h;if(c=(ye(a,h,Math.cos(a),n)-i)*(c*Math.sqrt(c))*s,a-=c,Math.abs(c)T?Math.tan(n):0,S=Math.pow(x,2),E=Math.pow(S,2);a=1-this.es*Math.pow(c,2),v=v/Math.sqrt(a);var C=ye(n,c,u,this.en);l=this.a*(this.k0*v*(1+g/6*(1-S+_+g/20*(5-18*S+E+14*_-58*S*_+g/42*(61+179*E-E*S-479*S)))))+this.x0,h=this.a*(this.k0*(C-this.ml0+c*s*v/2*(1+g/12*(5-S+9*_+4*w+g/30*(61+E-58*S+270*_-330*S*_+g/56*(1385+543*E-E*S-3111*S))))))+this.y0}else{var m=u*Math.sin(s);if(Math.abs(Math.abs(m)-1)=1){if(m-1>T)return 93;h=0}else h=Math.acos(h);n<0&&(h=-h),h=this.a*this.k0*(h-this.lat0)+this.y0}return i.x=l,i.y=h,i}function dl(i){var e,n,s,a,l=(i.x-this.x0)*(1/this.a),h=(i.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+h/this.k0,n=_n(e,this.es,this.en),Math.abs(n)T?Math.tan(n):0,x=this.ep2*Math.pow(_,2),S=Math.pow(x,2),E=Math.pow(w,2),C=Math.pow(E,2);e=1-this.es*Math.pow(g,2);var k=l*Math.sqrt(e)/this.k0,I=Math.pow(k,2);e=e*w,s=n-e*I/(1-this.es)*.5*(1-I/12*(5+3*E-9*x*E+x-4*S-I/30*(61+90*E-252*x*E+45*C+46*x-I/56*(1385+3633*E+4095*C+1574*C*E)))),a=z(this.long0+k*(1-I/6*(1+2*E+x-I/20*(5+28*E+24*C+8*x*E+6*x-I/42*(61+662*E+1320*C+720*C*E))))/_,this.over)}else s=A*De(h),a=0;else{var c=Math.exp(l/this.k0),u=.5*(c-1/c),m=this.lat0+h/this.k0,v=Math.cos(m);e=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(u,2))),s=Math.asin(e),h<0&&(s=-s),u===0&&v===0?a=0:a=z(Math.atan2(u,v)+this.long0,this.over)}return i.x=a,i.y=s,i}var ul=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const ki={init:hl,forward:cl,inverse:dl,names:ul};function Yr(i){var e=Math.exp(i);return e=(e-1/e)/2,e}function Mt(i,e){i=Math.abs(i),e=Math.abs(e);var n=Math.max(i,e),s=Math.min(i,e)/(n||1);return n*Math.sqrt(1+Math.pow(s,2))}function fl(i){var e=1+i,n=e-1;return n===0?i:i*Math.log(e)/n}function pl(i){var e=Math.abs(i);return e=fl(e*(1+e/(Mt(1,e)+1))),i<0?-e:e}function gn(i,e){for(var n=2*Math.cos(2*e),s=i.length-1,a=i[s],l=0,h;--s>=0;)h=-l+n*a+i[s],l=a,a=h;return e+h*Math.sin(2*e)}function ml(i,e){for(var n=2*Math.cos(e),s=i.length-1,a=i[s],l=0,h;--s>=0;)h=-l+n*a+i[s],l=a,a=h;return Math.sin(e)*h}function _l(i){var e=Math.exp(i);return e=(e+1/e)/2,e}function ts(i,e,n){for(var s=Math.sin(e),a=Math.cos(e),l=Yr(n),h=_l(n),c=2*a*h,u=-2*s*l,m=i.length-1,v=i[m],g=0,_=0,w=0,x,S;--m>=0;)x=_,S=g,_=v,g=w,v=-x+c*_-u*g+i[m],w=-S+u*_+c*g;return c=s*h,u=a*l,[c*v-u*w,c*w+u*v]}function gl(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ki.init.apply(this),this.forward=ki.forward,this.inverse=ki.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var i=this.es/(1+Math.sqrt(1-this.es)),e=i/(2-i),n=e;this.cgb[0]=e*(2+e*(-.6666666666666666+e*(-2+e*(2.577777777777778+e*(.5777777777777777+e*-4.228148148148148))))),this.cbg[0]=e*(-2+e*(.6666666666666666+e*(1.3333333333333333+e*(-1.8222222222222222+e*(.7111111111111111+e*.9824338624338624))))),n=n*e,this.cgb[1]=n*(2.3333333333333335+e*(-1.6+e*(-5.044444444444444+e*(8.584126984126984+e*2.458201058201058)))),this.cbg[1]=n*(1.6666666666666667+e*(-1.0666666666666667+e*(-1.4444444444444444+e*(2.86984126984127+e*-1.6105820105820106)))),n=n*e,this.cgb[2]=n*(3.7333333333333334+e*(-3.8857142857142857+e*(-12.019047619047619+e*26.03668430335097))),this.cbg[2]=n*(-1.7333333333333334+e*(1.619047619047619+e*(1.6+e*-4.474779541446208))),n=n*e,this.cgb[3]=n*(6.792063492063492+e*(-9.485714285714286+e*-28.188500881834216)),this.cbg[3]=n*(1.9634920634920634+e*(-2.4+e*-1.7518165784832451)),n=n*e,this.cgb[4]=n*(13.250793650793652+e*-23.22238255571589),this.cbg[4]=n*(-2.3301587301587303+e*3.5144460477793813),n=n*e,this.cgb[5]=n*27.011268237934903,this.cbg[5]=n*2.8496841430174764,n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(.25+n*(.015625+n/256))),this.utg[0]=e*(-.5+e*(.6666666666666666+e*(-.3854166666666667+e*(.002777777777777778+e*(.158203125+e*-.15905919312169312))))),this.gtu[0]=e*(.5+e*(-.6666666666666666+e*(.3125+e*(.22777777777777777+e*(-.4409722222222222+e*.20875661375661375))))),this.utg[1]=n*(-.020833333333333332+e*(-.06666666666666667+e*(.3034722222222222+e*(-.4380952380952381+e*.2890188388723545)))),this.gtu[1]=n*(.2708333333333333+e*(-.6+e*(.38680555555555557+e*(.44603174603174606+e*-1.0248393063822752)))),n=n*e,this.utg[2]=n*(-.035416666666666666+e*(.04404761904761905+e*(.046651785714285715+e*-.06138668430335097))),this.gtu[2]=n*(.25416666666666665+e*(-.7357142857142858+e*(.5603050595238095+e*.9237378747795415))),n=n*e,this.utg[3]=n*(-.02726314484126984+e*(.021825396825396824+e*.11439745921516754)),this.gtu[3]=n*(.30729786706349205+e*(-1.0654761904761905+e*.9096203979276896)),n=n*e,this.utg[4]=n*(-.02841641865079365+e*.027268468414301746),this.gtu[4]=n*(.4306671626984127+e*-1.713007555715889),n=n*e,this.utg[5]=n*-.03233083094085698,this.gtu[5]=n*.6650675310896665;var s=gn(this.cbg,this.lat0);this.Zb=-this.Qn*(s+ml(this.gtu,2*s))}function vl(i){var e=z(i.x-this.long0,this.over),n=i.y;n=gn(this.cbg,n);var s=Math.sin(n),a=Math.cos(n),l=Math.sin(e),h=Math.cos(e);n=Math.atan2(s,h*a),e=Math.atan2(l*a,Mt(s,a*h)),e=pl(Math.tan(e));var c=ts(this.gtu,2*n,2*e);n=n+c[0],e=e+c[1];var u,m;return Math.abs(e)<=2.623395162778?(u=this.a*(this.Qn*e)+this.x0,m=this.a*(this.Qn*n+this.Zb)+this.y0):(u=1/0,m=1/0),i.x=u,i.y=m,i}function yl(i){var e=(i.x-this.x0)*(1/this.a),n=(i.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,e=e/this.Qn;var s,a;if(Math.abs(e)<=2.623395162778){var l=ts(this.utg,2*n,2*e);n=n+l[0],e=e+l[1],e=Math.atan(Yr(e));var h=Math.sin(n),c=Math.cos(n),u=Math.sin(e),m=Math.cos(e);n=Math.atan2(h*m,Mt(u,m*c)),e=Math.atan2(u,m*c),s=z(e+this.long0,this.over),a=gn(this.cgb,n)}else s=1/0,a=1/0;return i.x=s,i.y=a,i}var bl=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Ai={init:gl,forward:vl,inverse:yl,names:bl};function wl(i,e){if(i===void 0){if(i=Math.floor((z(e)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var xl="etmerc";function Ml(){var i=wl(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*st,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ai.init.apply(this),this.forward=Ai.forward,this.inverse=Ai.inverse}var Sl=["Universal Transverse Mercator System","utm"];const El={init:Ml,names:Sl,dependsOn:xl};function vn(i,e){return Math.pow((1-i)/(1+i),e)}var Pl=20;function kl(){var i=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+K)/(Math.pow(Math.tan(.5*this.lat0+K),this.C)*vn(this.e*i,this.ratexp))}function Al(i){var e=i.x,n=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+K),this.C)*vn(this.e*Math.sin(n),this.ratexp))-A,i.x=this.C*e,i}function Ll(i){for(var e=1e-14,n=i.x/this.C,s=i.y,a=Math.pow(Math.tan(.5*s+K)/this.K,1/this.C),l=Pl;l>0&&(s=2*Math.atan(a*vn(this.e*Math.sin(i.y),-.5*this.e))-A,!(Math.abs(s-i.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=T&&Math.abs(Math.cos(this.lat_ts))>T&&(this.k0=.5*this.cons*Bt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ot(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Bt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(bn(this.lat0,this.sinlat0,this.e))-A,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Gl(i){var e=i.x,n=i.y,s=Math.sin(n),a=Math.cos(n),l,h,c,u,m,v,g=z(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=T&&Math.abs(n+this.lat0)<=T?(i.x=NaN,i.y=NaN,i):this.sphere?(l=2*this.k0/(1+this.sinlat0*s+this.coslat0*a*Math.cos(g)),i.x=this.a*l*a*Math.sin(g)+this.x0,i.y=this.a*l*(this.coslat0*s-this.sinlat0*a*Math.cos(g))+this.y0,i):(h=2*Math.atan(bn(n,s,this.e))-A,u=Math.cos(h),c=Math.sin(h),Math.abs(this.coslat0)<=T?(m=Ot(this.e,n*this.con,this.con*s),v=2*this.a*this.k0*m/this.cons,i.x=this.x0+v*Math.sin(e-this.long0),i.y=this.y0-this.con*v*Math.cos(e-this.long0),i):(Math.abs(this.sinlat0)0?e=z(this.long0+Math.atan2(i.x,-1*i.y),this.over):e=z(this.long0+Math.atan2(i.x,i.y),this.over):e=z(this.long0+Math.atan2(i.x*Math.sin(c),h*this.coslat0*Math.cos(c)-i.y*this.sinlat0*Math.sin(c)),this.over),i.x=e,i.y=n,i)}else if(Math.abs(this.coslat0)<=T){if(h<=T)return n=this.lat0,e=this.long0,i.x=e,i.y=n,i;i.x*=this.con,i.y*=this.con,s=h*this.cons/(2*this.a*this.k0),n=this.con*Ze(this.e,s),e=this.con*z(this.con*this.long0+Math.atan2(i.x,-1*i.y),this.over)}else a=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,h<=T?l=this.X0:(l=Math.asin(Math.cos(a)*this.sinX0+i.y*Math.sin(a)*this.cosX0/h),e=z(this.long0+Math.atan2(i.x*Math.sin(a),h*this.cosX0*Math.cos(a)-i.y*this.sinX0*Math.sin(a)),this.over)),n=-1*Ze(this.e,Math.tan(.5*(A+l)));return i.x=e,i.y=n,i}var Bl=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const Fl={init:Ol,forward:Gl,inverse:Rl,names:Bl,ssfn_:bn};function ql(){var i=this.lat0;this.lambda0=this.long0;var e=Math.sin(i),n=this.a,s=this.rf,a=1/s,l=2*a-Math.pow(a,2),h=this.e=Math.sqrt(l);this.R=this.k0*n*Math.sqrt(1-l)/(1-l*Math.pow(e,2)),this.alpha=Math.sqrt(1+l/(1-l)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(e/this.alpha);var c=Math.log(Math.tan(Math.PI/4+this.b0/2)),u=Math.log(Math.tan(Math.PI/4+i/2)),m=Math.log((1+h*e)/(1-h*e));this.K=c-this.alpha*u+this.alpha*h/2*m}function Dl(i){var e=Math.log(Math.tan(Math.PI/4-i.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),s=-this.alpha*(e+n)+this.K,a=2*(Math.atan(Math.exp(s))-Math.PI/4),l=this.alpha*(i.x-this.lambda0),h=Math.atan(Math.sin(l)/(Math.sin(this.b0)*Math.tan(a)+Math.cos(this.b0)*Math.cos(l))),c=Math.asin(Math.cos(this.b0)*Math.sin(a)-Math.sin(this.b0)*Math.cos(a)*Math.cos(l));return i.y=this.R/2*Math.log((1+Math.sin(c))/(1-Math.sin(c)))+this.y0,i.x=this.R*h+this.x0,i}function Zl(i){for(var e=i.x-this.x0,n=i.y-this.y0,s=e/this.R,a=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),l=Math.asin(Math.cos(this.b0)*Math.sin(a)+Math.sin(this.b0)*Math.cos(a)*Math.cos(s)),h=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(a))),c=this.lambda0+h/this.alpha,u=0,m=l,v=-1e3,g=0;Math.abs(m-v)>1e-7;){if(++g>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+l/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(m))/2)),v=m,m=2*Math.atan(Math.exp(u))-Math.PI/2}return i.x=c,i.y=m,i}var jl=["somerc"];const Hl={init:ql,forward:Dl,inverse:Zl,names:jl};var be=1e-7;function Ul(i){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],n=typeof i.projName=="object"?Object.keys(i.projName)[0]:i.projName;return"no_uoff"in i||"no_off"in i||e.indexOf(n)!==-1||e.indexOf(Tr(n))!==-1}function $l(){var i,e,n,s,a,l,h,c,u,m,v=0,g,_=0,w=0,x=0,S=0,E=0,C=0;this.no_off=Ul(this),this.no_rot="no_rot"in this;var k=!1;"alpha"in this&&(k=!0);var I=!1;if("rectified_grid_angle"in this&&(I=!0),k&&(C=this.alpha),I&&(v=this.rectified_grid_angle),k||I)_=this.longc;else if(w=this.long1,S=this.lat1,x=this.long2,E=this.lat2,Math.abs(S-E)<=be||(i=Math.abs(S))<=be||Math.abs(i-A)<=be||Math.abs(Math.abs(this.lat0)-A)<=be||Math.abs(Math.abs(E)-A)<=be)throw new Error;var B=1-this.es;e=Math.sqrt(B),Math.abs(this.lat0)>T?(c=Math.sin(this.lat0),n=Math.cos(this.lat0),i=1-this.es*c*c,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/B),this.A=this.B*this.k0*e/i,s=this.B*e/(n*Math.sqrt(i)),a=s*s-1,a<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=s,this.E*=Math.pow(Ot(this.e,this.lat0,c),this.B)):(this.B=1/e,this.A=this.k0,this.E=s=a=1),k||I?(k?(g=Math.asin(Math.sin(C)/s),I||(v=C)):(g=v,C=Math.asin(s*Math.sin(g))),this.lam0=_-Math.asin(.5*(a-1/a)*Math.tan(g))/this.B):(l=Math.pow(Ot(this.e,S,Math.sin(S)),this.B),h=Math.pow(Ot(this.e,E,Math.sin(E)),this.B),a=this.E/l,u=(h-l)/(h+l),m=this.E*this.E,m=(m-h*l)/(m+h*l),i=w-x,i<-Math.PI?x-=Fe:i>Math.PI&&(x+=Fe),this.lam0=z(.5*(w+x)-Math.atan(m*Math.tan(.5*this.B*(w-x))/u)/this.B,this.over),g=Math.atan(2*Math.sin(this.B*z(w-this.lam0,this.over))/(a-1/a)),v=C=Math.asin(s*Math.sin(g))),this.singam=Math.sin(g),this.cosgam=Math.cos(g),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(s*s-1)/Math.cos(C))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*g,this.v_pole_n=this.ArB*Math.log(Math.tan(K-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(K+a))}function Wl(i){var e={},n,s,a,l,h,c,u,m;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-A)>T){if(h=this.E/Math.pow(Ot(this.e,i.y,Math.sin(i.y)),this.B),c=1/h,n=.5*(h-c),s=.5*(h+c),l=Math.sin(this.B*i.x),a=(n*this.singam-l*this.cosgam)/s,Math.abs(Math.abs(a)-1)0?this.v_pole_n:this.v_pole_s,u=this.ArB*i.y;return this.no_rot?(e.x=u,e.y=m):(u-=this.u_0,e.x=m*this.cosrot+u*this.sinrot,e.y=u*this.cosrot-m*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Vl(i){var e,n,s,a,l,h,c,u={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(n=i.y,e=i.x):(n=i.x*this.cosrot-i.y*this.sinrot,e=i.y*this.cosrot+i.x*this.sinrot+this.u_0),s=Math.exp(-this.BrA*n),a=.5*(s-1/s),l=.5*(s+1/s),h=Math.sin(this.BrA*e),c=(h*this.cosgam+a*this.singam)/l,Math.abs(Math.abs(c)-1)T?this.ns=Math.log(s/c)/Math.log(a/u):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=s/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(m,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Ql(i){var e=i.x,n=i.y;Math.abs(2*Math.abs(n)-Math.PI)<=T&&(n=De(n)*(A-2*T));var s=Math.abs(Math.abs(n)-A),a,l;if(s>T)a=Ot(this.e,n,Math.sin(n)),l=this.a*this.f0*Math.pow(a,this.ns);else{if(s=n*this.ns,s<=0)return null;l=0}var h=this.ns*z(e-this.long0,this.over);return i.x=this.k0*(l*Math.sin(h))+this.x0,i.y=this.k0*(this.rh-l*Math.cos(h))+this.y0,i}function Yl(i){var e,n,s,a,l,h=(i.x-this.x0)/this.k0,c=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(h*h+c*c),n=1):(e=-Math.sqrt(h*h+c*c),n=-1);var u=0;if(e!==0&&(u=Math.atan2(n*h,n*c)),e!==0||this.ns>0){if(n=1/this.ns,s=Math.pow(e/(this.a*this.f0),n),a=Ze(this.e,s),a===-9999)return null}else a=-A;return l=z(u/this.ns+this.long0,this.over),i.x=l,i.y=a,i}var th=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const eh={init:Xl,forward:Ql,inverse:Yl,names:th};function ih(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function nh(i){var e,n,s,a,l,h,c,u=i.x,m=i.y,v=z(u-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(m))/(1-this.e*Math.sin(m)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(m/2+this.s45),this.alfa)/e)-this.s45),s=-v*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(s)),l=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(a)),h=this.n*l,c=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),i.y=c*Math.cos(h)/1,i.x=c*Math.sin(h)/1,this.czech||(i.y*=-1,i.x*=-1),i}function rh(i){var e,n,s,a,l,h,c,u,m=i.x;i.x=i.y,i.y=m,this.czech||(i.y*=-1,i.x*=-1),h=Math.sqrt(i.x*i.x+i.y*i.y),l=Math.atan2(i.y,i.x),a=l/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),n=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(e)),i.x=this.long0-n/this.alfa,c=e,u=0;var v=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.e/2))-this.s45),Math.abs(c-i.y)<1e-10&&(u=1),c=i.y,v+=1;while(u===0&&v<15);return v>=15?null:i}var sh=["Krovak","krovak"];const ah={init:ih,forward:nh,inverse:rh,names:sh};function vt(i,e,n,s,a){return i*a-e*Math.sin(2*a)+n*Math.sin(4*a)-s*Math.sin(6*a)}function Ue(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function $e(i){return .375*i*(1+.25*i*(1+.46875*i))}function We(i){return .05859375*i*i*(1+.75*i)}function Ve(i){return i*i*i*.011393229166666666}function wn(i,e,n){var s=e*n;return i/Math.sqrt(1-s*s)}function Yt(i){return Math.abs(i)1e-7?(n=i*e,(1-i*i)*(e/(1-n*n)-.5/i*Math.log((1-n)/(1+n)))):2*e}var xn=1,Mn=2,Sn=3,Ci=4;function uh(){var i=Math.abs(this.lat0);if(Math.abs(i-A)0){var e;switch(this.qp=te(this.e,1),this.mmf=.5/(1-this.es),this.apa=wh(this.es),this.mode){case Mn:this.dd=1;break;case xn:this.dd=1;break;case Sn:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case Ci:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=te(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===Ci&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function fh(i){var e,n,s,a,l,h,c,u,m,v,g=i.x,_=i.y;if(g=z(g-this.long0,this.over),this.sphere){if(l=Math.sin(_),v=Math.cos(_),s=Math.cos(g),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+v*s:1+this.sinph0*l+this.cosph0*v*s,n<=T)return null;n=Math.sqrt(2/n),e=n*v*Math.sin(g),n*=this.mode===this.EQUIT?l:this.cosph0*l-this.sinph0*v*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(_+this.lat0)=0?(e=(m=Math.sqrt(h))*a,n=s*(this.mode===this.S_POLE?m:-m)):e=n=0;break}}return i.x=this.a*e+this.x0,i.y=this.a*n+this.y0,i}function ph(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,n=i.y/this.a,s,a,l,h,c,u,m;if(this.sphere){var v=0,g,_=0;if(g=Math.sqrt(e*e+n*n),a=g*.5,a>1)return null;switch(a=2*Math.asin(a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(_=Math.sin(a),v=Math.cos(a)),this.mode){case this.EQUIT:a=Math.abs(g)<=T?0:Math.asin(n*_/g),e*=_,n=v*g;break;case this.OBLIQ:a=Math.abs(g)<=T?this.lat0:Math.asin(v*this.sinph0+n*_*this.cosph0/g),e*=_*this.cosph0,n=(v-Math.sin(a)*this.sinph0)*g;break;case this.N_POLE:n=-n,a=A-a;break;case this.S_POLE:a-=A;break}s=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,n)}else{if(m=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,n*=this.dd,u=Math.sqrt(e*e+n*n),u1&&(i=i>1?1:-1),Math.asin(i)}function Eh(){Math.abs(this.lat1+this.lat2)T?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Ph(i){var e=i.x,n=i.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var s=te(this.e3,this.sin_phi),a=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,l=this.ns0*z(e-this.long0,this.over),h=a*Math.sin(l)+this.x0,c=this.rh-a*Math.cos(l)+this.y0;return i.x=h,i.y=c,i}function kh(i){var e,n,s,a,l,h;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),s=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),s=-1),a=0,e!==0&&(a=Math.atan2(s*i.x,s*i.y)),s=e*this.ns0/this.a,this.sphere?h=Math.asin((this.c-s*s)/(2*this.ns0)):(n=(this.c-s*s)/this.ns0,h=this.phi1z(this.e3,n)),l=z(a/this.ns0+this.long0,this.over),i.x=l,i.y=h,i}function Ah(i,e){var n,s,a,l,h,c=ee(.5*e);if(i0||Math.abs(h)<=T?(c=this.x0+this.a*l*n*Math.sin(s)/h,u=this.y0+this.a*l*(this.cos_p14*e-this.sin_p14*n*a)/h):(c=this.x0+this.infinity_dist*n*Math.sin(s),u=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*a)),i.x=c,i.y=u,i}function Ih(i){var e,n,s,a,l,h;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(e=Math.sqrt(i.x*i.x+i.y*i.y))?(a=Math.atan2(e,this.rc),n=Math.sin(a),s=Math.cos(a),h=ee(s*this.sin_p14+i.y*n*this.cos_p14/e),l=Math.atan2(i.x*n,e*this.cos_p14*s-i.y*this.sin_p14*n),l=z(this.long0+l,this.over)):(h=this.phic0,l=0),i.x=l,i.y=h,i}var Nh=["gnom"];const Oh={init:Th,forward:zh,inverse:Ih,names:Nh};function Gh(i,e){var n=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*A:A;for(var s=Math.asin(.5*e),a,l,h,c,u=0;u<30;u++)if(l=Math.sin(s),h=Math.cos(s),c=i*l,a=Math.pow(1-c*c,2)/(2*h)*(e/(1-i*i)-l/(1-c*c)+.5/i*Math.log((1-c)/(1+c))),s+=a,Math.abs(a)<=1e-10)return s;return NaN}function Rh(){this.sphere||(this.k0=Bt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Bh(i){var e=i.x,n=i.y,s,a,l=z(e-this.long0,this.over);if(this.sphere)s=this.x0+this.a*l*Math.cos(this.lat_ts),a=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var h=te(this.e,Math.sin(n));s=this.x0+this.a*this.k0*l,a=this.y0+this.a*h*.5/this.k0}return i.x=s,i.y=a,i}function Fh(i){i.x-=this.x0,i.y-=this.y0;var e,n;return this.sphere?(e=z(this.long0+i.x/this.a/Math.cos(this.lat_ts),this.over),n=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(n=Gh(this.e,2*i.y*this.k0/this.a),e=z(this.long0+i.x/(this.a*this.k0),this.over)),i.x=e,i.y=n,i}var qh=["cea"];const Dh={init:Rh,forward:Bh,inverse:Fh,names:qh};function Zh(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function jh(i){var e=i.x,n=i.y,s=z(e-this.long0,this.over),a=Yt(n-this.lat0);return i.x=this.x0+this.a*s*this.rc,i.y=this.y0+this.a*a,i}function Hh(i){var e=i.x,n=i.y;return i.x=z(this.long0+(e-this.x0)/(this.a*this.rc),this.over),i.y=Yt(this.lat0+(n-this.y0)/this.a),i}var Uh=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const $h={init:Zh,forward:jh,inverse:Hh,names:Uh};var es=20;function Wh(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ue(this.es),this.e1=$e(this.es),this.e2=We(this.es),this.e3=Ve(this.es),this.ml0=this.a*vt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Vh(i){var e=i.x,n=i.y,s,a,l,h=z(e-this.long0,this.over);if(l=h*Math.sin(n),this.sphere)Math.abs(n)<=T?(s=this.a*h,a=-1*this.a*this.lat0):(s=this.a*Math.sin(l)/Math.tan(n),a=this.a*(Yt(n-this.lat0)+(1-Math.cos(l))/Math.tan(n)));else if(Math.abs(n)<=T)s=this.a*h,a=-1*this.ml0;else{var c=wn(this.a,this.e,Math.sin(n))/Math.tan(n);s=c*Math.sin(l),a=this.a*vt(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+c*(1-Math.cos(l))}return i.x=s+this.x0,i.y=a+this.y0,i}function Jh(i){var e,n,s,a,l,h,c,u,m;if(s=i.x-this.x0,a=i.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=T)e=z(s/this.a+this.long0,this.over),n=0;else{h=this.lat0+a/this.a,c=s*s/this.a/this.a+h*h,u=h;var v;for(l=es;l;--l)if(v=Math.tan(u),m=-1*(h*(u*v+1)-u-.5*(u*u+c)*v)/((u-h)/v-1),u+=m,Math.abs(m)<=T){n=u;break}e=z(this.long0+Math.asin(s*Math.tan(u)/this.a)/Math.sin(n),this.over)}else if(Math.abs(a+this.ml0)<=T)n=0,e=z(this.long0+s/this.a,this.over);else{h=(this.ml0+a)/this.a,c=s*s/this.a/this.a+h*h,u=h;var g,_,w,x,S;for(l=es;l;--l)if(S=this.e*Math.sin(u),g=Math.sqrt(1-S*S)*Math.tan(u),_=this.a*vt(this.e0,this.e1,this.e2,this.e3,u),w=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),x=_/this.a,m=(h*(g*x+1)-x-.5*g*(x*x+c))/(this.es*Math.sin(2*u)*(x*x+c-2*h*x)/(4*g)+(h-x)*(g*w-2/Math.sin(2*u))-w),u-=m,Math.abs(m)<=T){n=u;break}g=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=z(this.long0+Math.asin(s*g/this.a)/Math.sin(n),this.over)}return i.x=e,i.y=n,i}var Kh=["Polyconic","American_Polyconic","poly"];const Xh={init:Wh,forward:Vh,inverse:Jh,names:Kh};function Qh(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Yh(i){var e,n=i.x,s=i.y,a=s-this.lat0,l=n-this.long0,h=a/Be*1e-5,c=l,u=1,m=0;for(e=1;e<=10;e++)u=u*h,m=m+this.A[e]*u;var v=m,g=c,_=1,w=0,x,S,E=0,C=0;for(e=1;e<=6;e++)x=_*v-w*g,S=w*v+_*g,_=x,w=S,E=E+this.B_re[e]*_-this.B_im[e]*w,C=C+this.B_im[e]*_+this.B_re[e]*w;return i.x=C*this.a+this.x0,i.y=E*this.a+this.y0,i}function tc(i){var e,n=i.x,s=i.y,a=n-this.x0,l=s-this.y0,h=l/this.a,c=a/this.a,u=1,m=0,v,g,_=0,w=0;for(e=1;e<=6;e++)v=u*h-m*c,g=m*h+u*c,u=v,m=g,_=_+this.C_re[e]*u-this.C_im[e]*m,w=w+this.C_im[e]*u+this.C_re[e]*m;for(var x=0;x.999999999999&&(n=.999999999999),e=Math.asin(n);var s=z(this.long0+i.x/(.900316316158*this.a*Math.cos(e)),this.over);s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var a=Math.asin(n);return i.x=s,i.y=a,i}var gc=["Mollweide","moll"];const vc={init:pc,forward:mc,inverse:_c,names:gc};function yc(){Math.abs(this.lat1+this.lat2)=0?(n=Math.sqrt(i.x*i.x+i.y*i.y),e=1):(n=-Math.sqrt(i.x*i.x+i.y*i.y),e=-1);var l=0;if(n!==0&&(l=Math.atan2(e*i.x,e*i.y)),this.sphere)return a=z(this.long0+l/this.ns,this.over),s=Yt(this.g-n/this.a),i.x=a,i.y=s,i;var h=this.g-n/this.a;return s=Li(h,this.e0,this.e1,this.e2,this.e3),a=z(this.long0+l/this.ns,this.over),i.x=a,i.y=s,i}var xc=["Equidistant_Conic","eqdc"];const Mc={init:yc,forward:bc,inverse:wc,names:xc};function Sc(){this.R=this.a}function Ec(i){var e=i.x,n=i.y,s=z(e-this.long0,this.over),a,l;Math.abs(n)<=T&&(a=this.x0+this.R*s,l=this.y0);var h=ee(2*Math.abs(n/Math.PI));(Math.abs(s)<=T||Math.abs(Math.abs(n)-A)<=T)&&(a=this.x0,n>=0?l=this.y0+Math.PI*this.R*Math.tan(.5*h):l=this.y0+Math.PI*this.R*-Math.tan(.5*h));var c=.5*Math.abs(Math.PI/s-s/Math.PI),u=c*c,m=Math.sin(h),v=Math.cos(h),g=v/(m+v-1),_=g*g,w=g*(2/m-1),x=w*w,S=Math.PI*this.R*(c*(g-x)+Math.sqrt(u*(g-x)*(g-x)-(x+u)*(_-x)))/(x+u);s<0&&(S=-S),a=this.x0+S;var E=u+g;return S=Math.PI*this.R*(w*E-c*Math.sqrt((x+u)*(u+1)-E*E))/(x+u),n>=0?l=this.y0+S:l=this.y0-S,i.x=a,i.y=l,i}function Pc(i){var e,n,s,a,l,h,c,u,m,v,g,_,w;return i.x-=this.x0,i.y-=this.y0,g=Math.PI*this.R,s=i.x/g,a=i.y/g,l=s*s+a*a,h=-Math.abs(a)*(1+l),c=h-2*a*a+s*s,u=-2*h+1+2*a*a+l*l,w=a*a/u+(2*c*c*c/u/u/u-9*h*c/u/u)/27,m=(h-c*c/3/u)/u,v=2*Math.sqrt(-m/3),g=3*w/m/v,Math.abs(g)>1&&(g>=0?g=1:g=-1),_=Math.acos(g)/3,i.y>=0?n=(-v*Math.cos(_+Math.PI/3)-c/3/u)*Math.PI:n=-(-v*Math.cos(_+Math.PI/3)-c/3/u)*Math.PI,Math.abs(s)1e-12&&--S>0);return S===0?{azi1:NaN,s12:NaN}:(et=q*(a*a-a*(1-l)*(a*(1-l)))/(a*(1-l)*(a*(1-l))),St=1+et/16384*(4096+et*(-768+et*(320-175*et))),Q=et/1024*(256+et*(-128+et*(74-47*et))),ht=Q*k*(J+Q/4*(I*(-1+2*J*J)-Q/6*J*(-3+4*k*k)*(-3+4*J*J))),ie=a*(1-l)*St*(B-ht),{azi1:Math.atan2(_*E,v*g-m*_*C),s12:ie})}function Cc(i,e,n,s,a,l){const h=Math.atan((1-l)*Math.tan(i)),c=Math.sin(h),u=Math.cos(h),m=Math.sin(n),v=Math.cos(n),g=Math.atan2(c,u*v),_=u*m,w=1-_*_,x=w*(a*a-a*(1-l)*(a*(1-l)))/(a*(1-l)*(a*(1-l))),S=1+x/16384*(4096+x*(-768+x*(320-175*x))),E=x/1024*(256+x*(-128+x*(74-47*x)));let C=s/(a*(1-l)*S),k,I=100,B,H,q,J;do B=Math.cos(2*g+C),H=Math.sin(C),q=Math.cos(C),J=E*H*(B+E/4*(q*(-1+2*B*B)-E/6*B*(-3+4*H*H)*(-3+4*B*B))),k=C,C=s/(a*(1-l)*S)+J;while(Math.abs(C-k)>1e-12&&--I>0);if(I===0)return{lat2:NaN,lon2:NaN};const ot=c*H-u*q*v,et=Math.atan2(c*q+u*H*v,(1-l)*Math.sqrt(_*_+ot*ot)),St=Math.atan2(H*m,u*q-c*H*v),Q=l/16*w*(4+l*(4-3*w)),ht=St-(1-Q)*l*_*(C+Q*H*(B+Q*q*(-1+2*B*B))),ie=e+ht;return{lat2:et,lon2:ie}}function Tc(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function zc(i){var e=i.x,n=i.y,s=Math.sin(i.y),a=Math.cos(i.y),l=z(e-this.long0,this.over),h,c,u,m,v,g,_,w,x,S,E;return this.sphere?Math.abs(this.sin_p12-1)<=T?(i.x=this.x0+this.a*(A-n)*Math.sin(l),i.y=this.y0-this.a*(A-n)*Math.cos(l),i):Math.abs(this.sin_p12+1)<=T?(i.x=this.x0+this.a*(A+n)*Math.sin(l),i.y=this.y0+this.a*(A+n)*Math.cos(l),i):(x=this.sin_p12*s+this.cos_p12*a*Math.cos(l),_=Math.acos(x),w=_?_/Math.sin(_):1,i.x=this.x0+this.a*w*a*Math.sin(l),i.y=this.y0+this.a*w*(this.cos_p12*s-this.sin_p12*a*Math.cos(l)),i):(h=Ue(this.es),c=$e(this.es),u=We(this.es),m=Ve(this.es),Math.abs(this.sin_p12-1)<=T?(v=this.a*vt(h,c,u,m,A),g=this.a*vt(h,c,u,m,n),i.x=this.x0+(v-g)*Math.sin(l),i.y=this.y0-(v-g)*Math.cos(l),i):Math.abs(this.sin_p12+1)<=T?(v=this.a*vt(h,c,u,m,A),g=this.a*vt(h,c,u,m,n),i.x=this.x0+(v+g)*Math.sin(l),i.y=this.y0+(v+g)*Math.cos(l),i):Math.abs(e)2*A*this.a?void 0:(n=e/this.a,s=Math.sin(n),a=Math.cos(n),l=this.long0,Math.abs(e)<=T?h=this.lat0:(h=ee(a*this.sin_p12+i.y*s*this.cos_p12/e),c=Math.abs(this.lat0)-A,Math.abs(c)<=T?this.lat0>=0?l=z(this.long0+Math.atan2(i.x,-i.y),this.over):l=z(this.long0-Math.atan2(-i.x,i.y),this.over):l=z(this.long0+Math.atan2(i.x*s,e*this.cos_p12*a-i.y*this.sin_p12*s),this.over)),i.x=l,i.y=h,i)):(u=Ue(this.es),m=$e(this.es),v=We(this.es),g=Ve(this.es),Math.abs(this.sin_p12-1)<=T?(_=this.a*vt(u,m,v,g,A),e=Math.sqrt(i.x*i.x+i.y*i.y),w=_-e,h=Li(w/this.a,u,m,v,g),l=z(this.long0+Math.atan2(i.x,-1*i.y),this.over),i.x=l,i.y=h,i):Math.abs(this.sin_p12+1)<=T?(_=this.a*vt(u,m,v,g,A),e=Math.sqrt(i.x*i.x+i.y*i.y),w=e-_,h=Li(w/this.a,u,m,v,g),l=z(this.long0+Math.atan2(i.x,i.y),this.over),i.x=l,i.y=h,i):(x=Math.atan2(i.x,i.y),S=Math.sqrt(i.x*i.x+i.y*i.y),E=Cc(this.lat0,this.long0,x,S,this.a,this.f),i.x=E.lon2,i.y=E.lat2,i))}var Nc=["Azimuthal_Equidistant","aeqd"];const Oc={init:Tc,forward:zc,inverse:Ic,names:Nc};function Gc(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Rc(i){var e,n,s,a,l,h,c,u,m=i.x,v=i.y;return s=z(m-this.long0,this.over),e=Math.sin(v),n=Math.cos(v),a=Math.cos(s),h=this.sin_p14*e+this.cos_p14*n*a,l=1,(h>0||Math.abs(h)<=T)&&(c=this.a*l*n*Math.sin(s),u=this.y0+this.a*l*(this.cos_p14*e-this.sin_p14*n*a)),i.x=c,i.y=u,i}function Bc(i){var e,n,s,a,l,h,c;return i.x-=this.x0,i.y-=this.y0,e=Math.sqrt(i.x*i.x+i.y*i.y),n=ee(e/this.a),s=Math.sin(n),a=Math.cos(n),h=this.long0,Math.abs(e)<=T?(c=this.lat0,i.x=h,i.y=c,i):(c=ee(a*this.sin_p14+i.y*s*this.cos_p14/e),l=Math.abs(this.lat0)-A,Math.abs(l)<=T?(this.lat0>=0?h=z(this.long0+Math.atan2(i.x,-i.y),this.over):h=z(this.long0-Math.atan2(-i.x,i.y),this.over),i.x=h,i.y=c,i):(h=z(this.long0+Math.atan2(i.x*s,e*this.cos_p14*a-i.y*this.sin_p14*s),this.over),i.x=h,i.y=c,i))}var Fc=["ortho"];const qc={init:Gc,forward:Rc,inverse:Bc,names:Fc};var it={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},X={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Dc(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=A-K/2?this.face=it.TOP:this.lat0<=-(A-K/2)?this.face=it.BOTTOM:Math.abs(this.long0)<=K?this.face=it.FRONT:Math.abs(this.long0)<=A+K?this.face=this.long0>0?it.RIGHT:it.LEFT:this.face=it.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Zc(i){var e={x:0,y:0},n,s,a,l,h,c,u={value:0};if(i.x-=this.long0,this.es!==0?n=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):n=i.y,s=i.x,this.face===it.TOP)l=A-n,s>=K&&s<=A+K?(u.value=X.AREA_0,a=s-A):s>A+K||s<=-(A+K)?(u.value=X.AREA_1,a=s>0?s-at:s+at):s>-(A+K)&&s<=-K?(u.value=X.AREA_2,a=s+A):(u.value=X.AREA_3,a=s);else if(this.face===it.BOTTOM)l=A+n,s>=K&&s<=A+K?(u.value=X.AREA_0,a=-s+A):s=-K?(u.value=X.AREA_1,a=-s):s<-K&&s>=-(A+K)?(u.value=X.AREA_2,a=-s-A):(u.value=X.AREA_3,a=s>0?-s+at:-s-at);else{var m,v,g,_,w,x,S;this.face===it.RIGHT?s=we(s,+A):this.face===it.BACK?s=we(s,+at):this.face===it.LEFT&&(s=we(s,-A)),_=Math.sin(n),w=Math.cos(n),x=Math.sin(s),S=Math.cos(s),m=w*S,v=w*x,g=_,this.face===it.FRONT?(l=Math.acos(m),a=Ti(l,g,v,u)):this.face===it.RIGHT?(l=Math.acos(v),a=Ti(l,g,-m,u)):this.face===it.BACK?(l=Math.acos(-m),a=Ti(l,g,-v,u)):this.face===it.LEFT?(l=Math.acos(-v),a=Ti(l,g,m,u)):(l=a=0,u.value=X.AREA_0)}return c=Math.atan(12/at*(a+Math.acos(Math.sin(a)*Math.cos(K))-A)),h=Math.sqrt((1-Math.cos(l))/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(a))))),u.value===X.AREA_1?c+=A:u.value===X.AREA_2?c+=at:u.value===X.AREA_3&&(c+=1.5*at),e.x=h*Math.cos(c),e.y=h*Math.sin(c),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,i.x=e.x,i.y=e.y,i}function jc(i){var e={lam:0,phi:0},n,s,a,l,h,c,u,m,v,g={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,s=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),n=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?g.value=X.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(g.value=X.AREA_1,n-=A):i.x<0&&-i.x>=Math.abs(i.y)?(g.value=X.AREA_2,n=n<0?n+at:n-at):(g.value=X.AREA_3,n+=A),v=at/12*Math.tan(n),h=Math.sin(v)/(Math.cos(v)-1/Math.sqrt(2)),c=Math.atan(h),a=Math.cos(n),l=Math.tan(s),u=1-a*a*l*l*(1-Math.cos(Math.atan(1/Math.cos(c)))),u<-1?u=-1:u>1&&(u=1),this.face===it.TOP)m=Math.acos(u),e.phi=A-m,g.value===X.AREA_0?e.lam=c+A:g.value===X.AREA_1?e.lam=c<0?c+at:c-at:g.value===X.AREA_2?e.lam=c-A:e.lam=c;else if(this.face===it.BOTTOM)m=Math.acos(u),e.phi=m-A,g.value===X.AREA_0?e.lam=-c+A:g.value===X.AREA_1?e.lam=-c:g.value===X.AREA_2?e.lam=-c-A:e.lam=c<0?-c-at:-c+at;else{var _,w,x;_=u,v=_*_,v>=1?x=0:x=Math.sqrt(1-v)*Math.sin(c),v+=x*x,v>=1?w=0:w=Math.sqrt(1-v),g.value===X.AREA_1?(v=w,w=-x,x=v):g.value===X.AREA_2?(w=-w,x=-x):g.value===X.AREA_3&&(v=w,w=x,x=-v),this.face===it.RIGHT?(v=_,_=-w,w=v):this.face===it.BACK?(_=-_,w=-w):this.face===it.LEFT&&(v=_,_=w,w=-v),e.phi=Math.acos(-x)-A,e.lam=Math.atan2(w,_),this.face===it.RIGHT?e.lam=we(e.lam,-A):this.face===it.BACK?e.lam=we(e.lam,-at):this.face===it.LEFT&&(e.lam=we(e.lam,+A))}if(this.es!==0){var S,E,C;S=e.phi<0?1:0,E=Math.tan(e.phi),C=this.b/Math.sqrt(E*E+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-C*C)/(this.one_minus_f*C)),S&&(e.phi=-e.phi)}return e.lam+=this.long0,i.x=e.lam,i.y=e.phi,i}function Ti(i,e,n,s){var a;return iK&&a<=A+K?(s.value=X.AREA_1,a-=A):a>A+K||a<=-(A+K)?(s.value=X.AREA_2,a=a>=0?a-at:a+at):(s.value=X.AREA_3,a+=A)),a}function we(i,e){var n=i+e;return n<-at?n+=Fe:n>+at&&(n-=Fe),n}var Hc=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const Uc={init:Dc,forward:Zc,inverse:jc,names:Hc};var En=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Je=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],is=.8487,ns=1.3523,rs=bt/5,$c=1/rs,xe=18,zi=function(i,e){return i[0]+e*(i[1]+e*(i[2]+e*i[3]))},Wc=function(i,e){return i[1]+e*(2*i[2]+e*3*i[3])};function Vc(i,e,n,s){for(var a=e;s;--s){var l=i(a);if(a-=l,Math.abs(l)=xe&&(s=xe-1),n=bt*(n-$c*s);var a={x:zi(En[s],n)*e,y:zi(Je[s],n)};return i.y<0&&(a.y=-a.y),a.x=a.x*this.a*is+this.x0,a.y=a.y*this.a*ns+this.y0,a}function Xc(i){var e={x:(i.x-this.x0)/(this.a*is),y:Math.abs(i.y-this.y0)/(this.a*ns)};if(e.y>=1)e.x/=En[xe][0],e.y=i.y<0?-A:A;else{var n=Math.floor(e.y*xe);for(n<0?n=0:n>=xe&&(n=xe-1);;)if(Je[n][0]>e.y)--n;else if(Je[n+1][0]<=e.y)++n;else break;var s=Je[n],a=5*(e.y-s[0])/(Je[n+1][0]-s[0]);a=Vc(function(l){return(zi(s,l)-e.y)/Wc(s,l)},a,T,100),e.x/=zi(En[n],a),e.y=(5*n+a)*st,i.y<0&&(e.y=-e.y)}return e.x=z(e.x+this.long0,this.over),e}var Qc=["Robinson","robin"];const Yc={init:Jc,forward:Kc,inverse:Xc,names:Qc};function td(){this.name="geocent"}function ed(i){var e=Nr(i,this.es,this.a);return e}function id(i){var e=Or(i,this.es,this.a,this.b);return e}var nd=["Geocentric","geocentric","geocent","Geocent"];const rd={init:td,forward:ed,inverse:id,names:nd};var gt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Ke={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function sd(){if(Object.keys(Ke).forEach((function(n){if(typeof this[n]>"u")this[n]=Ke[n].def;else{if(Ke[n].num&&isNaN(this[n]))throw new Error("Invalid parameter value, must be numeric "+n+" = "+this[n]);Ke[n].num&&(this[n]=parseFloat(this[n]))}Ke[n].degrees&&(this[n]=this[n]*st)}).bind(this)),Math.abs(Math.abs(this.lat0)-A)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var i=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(i),this.sw=Math.sin(i)}function ad(i){i.x-=this.long0;var e=Math.sin(i.y),n=Math.cos(i.y),s=Math.cos(i.x),a,l;switch(this.mode){case gt.OBLIQ:l=this.sinph0*e+this.cosph0*n*s;break;case gt.EQUIT:l=n*s;break;case gt.S_POLE:l=-e;break;case gt.N_POLE:l=e;break}switch(l=this.pn1/(this.p-l),a=l*n*Math.sin(i.x),this.mode){case gt.OBLIQ:l*=this.cosph0*e-this.sinph0*n*s;break;case gt.EQUIT:l*=e;break;case gt.N_POLE:l*=-(n*s);break;case gt.S_POLE:l*=n*s;break}var h,c;return h=l*this.cg+a*this.sg,c=1/(h*this.sw*this.h1+this.cw),a=(a*this.cg-l*this.sg)*this.cw*c,l=h*c,i.x=a*this.a,i.y=l*this.a,i}function od(i){i.x/=this.a,i.y/=this.a;var e={x:i.x,y:i.y},n,s,a;a=1/(this.pn1-i.y*this.sw),n=this.pn1*i.x*a,s=this.pn1*i.y*this.cw*a,i.x=n*this.cg+s*this.sg,i.y=s*this.cg-n*this.sg;var l=Mt(i.x,i.y);if(Math.abs(l)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var i=1-this.es,e=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function dd(i){var e=i.x,n=i.y,s,a,l,h;if(e=e-this.long0,this.shape==="ellipse"){n=Math.atan(this.radius_p2*Math.tan(n));var c=this.radius_p/Mt(this.radius_p*Math.cos(n),Math.sin(n));if(a=c*Math.cos(e)*Math.cos(n),l=c*Math.sin(e)*Math.cos(n),h=c*Math.sin(n),(this.radius_g-a)*a-l*l-h*h*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;s=this.radius_g-a,this.flip_axis?(i.x=this.radius_g_1*Math.atan(l/Mt(h,s)),i.y=this.radius_g_1*Math.atan(h/s)):(i.x=this.radius_g_1*Math.atan(l/s),i.y=this.radius_g_1*Math.atan(h/Mt(l,s)))}else this.shape==="sphere"&&(s=Math.cos(n),a=Math.cos(e)*s,l=Math.sin(e)*s,h=Math.sin(n),s=this.radius_g-a,this.flip_axis?(i.x=this.radius_g_1*Math.atan(l/Mt(h,s)),i.y=this.radius_g_1*Math.atan(h/s)):(i.x=this.radius_g_1*Math.atan(l/s),i.y=this.radius_g_1*Math.atan(h/Mt(l,s))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function ud(i){var e=-1,n=0,s=0,a,l,h,c;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(s=Math.tan(i.y/this.radius_g_1),n=Math.tan(i.x/this.radius_g_1)*Mt(1,s)):(n=Math.tan(i.x/this.radius_g_1),s=Math.tan(i.y/this.radius_g_1)*Mt(1,n));var u=s/this.radius_p;if(a=n*n+u*u+e*e,l=2*this.radius_g*e,h=l*l-4*a*this.C,h<0)return i.x=Number.NaN,i.y=Number.NaN,i;c=(-l-Math.sqrt(h))/(2*a),e=this.radius_g+c*e,n*=c,s*=c,i.x=Math.atan2(n,e),i.y=Math.atan(s*Math.cos(i.x)/e),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(s=Math.tan(i.y/this.radius_g_1),n=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+s*s)):(n=Math.tan(i.x/this.radius_g_1),s=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+n*n)),a=n*n+s*s+e*e,l=2*this.radius_g*e,h=l*l-4*a*this.C,h<0)return i.x=Number.NaN,i.y=Number.NaN,i;c=(-l-Math.sqrt(h))/(2*a),e=this.radius_g+c*e,n*=c,s*=c,i.x=Math.atan2(n,e),i.y=Math.atan(s*Math.cos(i.x)/e)}return i.x=i.x+this.long0,i}var fd=["Geostationary Satellite View","Geostationary_Satellite","geos"];const pd={init:cd,forward:dd,inverse:ud,names:fd};var Xe=1.340264,Qe=-.081106,Ye=893e-6,ti=.003796,Ii=Math.sqrt(3)/2;function md(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function _d(i){var e=z(i.x-this.long0,this.over),n=i.y,s=Math.asin(Ii*Math.sin(n)),a=s*s,l=a*a*a;return i.x=e*Math.cos(s)/(Ii*(Xe+3*Qe*a+l*(7*Ye+9*ti*a))),i.y=s*(Xe+Qe*a+l*(Ye+ti*a)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function gd(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var e=1e-9,n=12,s=i.y,a,l,h,c,u,m;for(m=0;m=A?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Sd,this.forward=Md)}function wd(i){var e=z(i.x-(this.long0||0),this.over),n=i.y,s,a,l;return s=this.am1+this.m1-ye(n,a=Math.sin(n),l=Math.cos(n),this.en),a=l*e/(s*Math.sqrt(1-this.es*a*a)),i.x=s*Math.sin(a),i.y=this.am1-s*Math.cos(a),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function xd(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,n,s,a;if(n=Mt(i.x,i.y=this.am1-i.y),a=_n(this.am1+this.m1-n,this.es,this.en),(e=Math.abs(a))ei?(i.x=a*Math.sin(s=e*Math.cos(n)/a),i.y=this.cphi1-a*Math.cos(s)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function Sd(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,n,s=Mt(i.x,i.y=this.cphi1-i.y);if(n=this.cphi1+this.phi1-s,Math.abs(n)>A)throw new Error;return Math.abs(Math.abs(n)-A)<=ei?e=0:e=s*Math.atan2(i.x,i.y)/Math.cos(n),i.x=z(e+(this.long0||0),this.over),i.y=Yt(n),i}var Ed=["bonne","Bonne (Werner lat_1=90)"];const Pd={init:bd,names:Ed},ss={OBLIQUE:{forward:Td,inverse:Id},TRANSVERSE:{forward:zd,inverse:Nd}},Ni={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function kd(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Lr.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const i=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=Lt(i);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let n;const s=Object.keys(Ni),a=c=>{if(typeof this[c]>"u")return;const u=parseFloat(this[c])*st;if(isNaN(u))throw new Error("Invalid value for "+c+": "+this[c]);return u};for(let c=0;ctypeof this[_]<"u")){n=m;for(let _=0;_"u")throw new Error("Missing parameter: "+w+".");this[x]=S}break}}if(!n)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:l,phip:h}=Cd(this,n);this.lamp=l,Math.abs(h)>T?(this.cphip=Math.cos(h),this.sphip=Math.sin(h),this.projectionType=ss.OBLIQUE):this.projectionType=ss.TRANSVERSE}function Ad(i){return this.projectionType.forward(this,i)}function Ld(i){return this.projectionType.inverse(this,i)}function Cd(i,e){let n,s;if(e===Ni.ROTATE){let a=i.oLongC,l=i.oLatC,h=i.oAlpha;if(Math.abs(Math.abs(l)-A)<=T)throw new Error("Invalid value for o_lat_c: "+i.o_lat_c+" should be < 90°");s=a+Math.atan2(-1*Math.cos(h),-1*Math.sin(h)*Math.sin(l)),n=Math.asin(Math.cos(l)*Math.sin(h))}else if(e===Ni.NEW_POLE)s=i.oLongP,n=i.oLatP;else{let a=i.oLong1,l=i.oLat1,h=i.oLong2,c=i.oLat2,u=Math.abs(l);if(Math.abs(l)>A-T)throw new Error("Invalid value for o_lat_1: "+i.o_lat_1+" should be < 90°");if(Math.abs(c)>A-T)throw new Error("Invalid value for o_lat_2: "+i.o_lat_2+" should be < 90°");if(Math.abs(l-c)3&&(s=l[l.length-3]+":"+l[l.length-1]),n.defs[s]===void 0)throw"No projection definition for code "+s}return n(s)}}),e.Proj.CRS=e.Class.extend({includes:e.CRS,options:{transformation:new e.Transformation(1,0,-1,0)},initialize:function(s,a,l){var h,c,u,m;if(e.Proj._isProj4Obj(s)?(c=s,h=c.srsCode,m=a||{},this.projection=new e.Proj.Projection(c,m.bounds)):(h=s,u=a,m=l||{},this.projection=new e.Proj.Projection(h,u,m.bounds)),e.Util.setOptions(this,m),this.code=h,this.transformation=this.options.transformation,this.options.origin&&(this.transformation=new e.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales)this._scales=this.options.scales;else if(this.options.resolutions){this._scales=[];for(var v=this.options.resolutions.length-1;v>=0;v--)this.options.resolutions[v]&&(this._scales[v]=1/this.options.resolutions[v])}this.infinite=!this.options.bounds},scale:function(s){var a=Math.floor(s),l,h,c,u;return s===a?this._scales[s]:(l=this._scales[a],h=this._scales[a+1],c=h-l,u=s-a,l+c*u)},zoom:function(s){var a=this._closestElement(this._scales,s),l=this._scales.indexOf(a),h,c,u;return s===a?l:a===void 0?-1/0:(c=l+1,h=this._scales[c],h===void 0?1/0:(u=h-a,(s-a)/u+l))},distance:e.CRS.Earth.distance,R:e.CRS.Earth.R,_closestElement:function(s,a){for(var l,h=s.length;h--;)s[h]<=a&&(l===void 0||l180||Math.abs(s)>90}function Dd(i){const e=i.features||[i];for(const n of e){const s=n.geometry?.coordinates;if(!s)continue;let a=s;for(;Array.isArray(a[0]);)a=a[0];return a}return null}function ls(i){const e=i.crs?.properties?.name;if(!e)return null;const n=e.match(/EPSG::?(\d+)$/i);return n?`EPSG:${n[1]}`:e.match(/^EPSG:\d+$/i)?e.toUpperCase():null}function Gi(i,e){const[n,s]=i;return Oi(e,"EPSG:4326",[n,s])}function Zd(){return new G.Proj.CRS("EPSG:28992",os,{resolutions:[3440.64,1720.32,860.16,430.08,215.04,107.52,53.76,26.88,13.44,6.72,3.36,1.68,.84,.42,.21],bounds:G.bounds([-285401.92,22598.08],[595401.9199999999,903401.9199999999]),origin:[-285401.92,22598.08]})}const hs={search:` `,close:` @@ -862,6 +862,8 @@ svg.leaflet-image-layer.leaflet-interactive path {\r .map__canvas { inline-size: 100%; block-size: 100%; + /* ponytail: own stacking context so Leaflet's pane/control z-indexes stay inside the canvas */ + isolation: isolate; } .map__list { @@ -1180,7 +1182,7 @@ svg.leaflet-image-layer.leaflet-interactive path {\r - `,this.#e=this.#a()}#a(){const e=new CSSStyleSheet;e.replaceSync($d);const n=new CSSStyleSheet;n.replaceSync(Wd);const s=new CSSStyleSheet;s.replaceSync(Vd);const a=new CSSStyleSheet;a.replaceSync(ms),this.#t.adoptedStyleSheets=[e,n,s,a]}get zoomPosition(){const e={"top-left":"topleft","top-right":"topright","bottom-left":"bottomleft","bottom-right":"bottomright"},n=this.getAttribute("zoom-position");return e[n]??"bottomleft"}get center(){const e=this.getAttribute("center");if(!e)return[52.0705,4.3007];const[n,s]=e.split(",").map(Number);return[n,s]}get zoom(){const e=this.getAttribute("zoom");return e!==null?Number(e):12}get maxBounds(){const e=this.getAttribute("max-bounds");if(e==="false"||e==="")return null;if(!e)return[[50.6,3],[53.8,7.3]];const[n,s,a,l]=e.split(",").map(Number);return[[n,s],[a,l]]}get tileUrl(){return this.getAttribute("tile-url")??"https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/standaard/EPSG:3857/{z}/{x}/{y}.png"}get tileAttribution(){return this.getAttribute("tile-attribution")??'Kaartgegevens: Kadaster'}get minZoom(){const e=this.getAttribute("min-zoom");return e!==null?Number(e):1}get maxZoom(){const e=this.getAttribute("max-zoom");return e!==null?Number(e):19}async connectedCallback(){this.#n||(await this.#e,Ut(this.#t),this.initialize())}initialize(){this.#n=!0,this.RDnew=Zd();const e=O.map(this.#t.querySelector(".map__canvas"),{center:this.center,worldCopyJump:!0,zoom:this.zoom,zoomControl:!1});this.maxBounds&&e.setMaxBounds(this.maxBounds),this.map=e,O.control.zoom({position:this.zoomPosition}).addTo(this.map);const n=this.#t.querySelector(".leaflet-control-zoom-in"),s=this.#t.querySelector(".leaflet-control-zoom-out");n&&(n.innerHTML=''),s&&(s.innerHTML=''),O.tileLayer(this.tileUrl,{maxZoom:this.maxZoom,minZoom:this.minZoom,attribution:this.tileAttribution}).addTo(this.map),this.#i=new ResizeObserver(()=>{this.map&&this.map.invalidateSize()}),this.#i.observe(this.#t.querySelector(".map__canvas")),this.addEventListener("dm-list:open",()=>this.#o()),this.addEventListener("dm-list:close",()=>this.#r()),this.addEventListener("dm-infowindow:open",a=>this.#s(a.target)),this.dispatchEvent(new CustomEvent("dm-map:ready",{bubbles:!0,composed:!0,detail:{map:this.map}}))}#s(e){const n=e?.shadowRoot?.querySelector(".infowindow"),s=e?.shadowRoot?.querySelector(".infowindow__body"),a=this.#t.querySelector(".map__position--top-right");if(!n||!s||!a)return;const l=this.getBoundingClientRect(),h=parseFloat(getComputedStyle(a).insetInlineEnd)||10,c=this.#t.querySelector(".leaflet-control-zoom");let u=h;if(c){const g=c.getBoundingClientRect(),_=a.getBoundingClientRect(),w=_.leftg.left,x=g.top>l.top+l.height/2;w&&x&&(u=l.bottom-g.top+h)}this.style.setProperty("--draad-map-components-infowindow-offset-bottom",`${Math.ceil(u)}px`);const v=n.offsetHeight+(s.scrollHeight-s.clientHeight)-a.clientHeight;if(v>0){const g=Math.ceil(l.height+v),_=parseFloat(this.style.getPropertyValue("--draad-map-components-map-content-min-height"))||0;g>_&&this.style.setProperty("--draad-map-components-map-content-min-height",`${g}px`)}}#o(){this.querySelectorAll("dm-infowindow").forEach(a=>{a.isOpen&&a.close()});const e=this.#t.querySelector(".map__canvas"),n=this.#t.querySelector(".map__list"),s=this.#t.querySelectorAll(".map__position");this.setAttribute("list-open",""),e.hidden=!0,n.hidden=!1,s.forEach(a=>a.hidden=!0)}#r(){const e=this.#t.querySelector(".map__canvas"),n=this.#t.querySelector(".map__list"),s=this.#t.querySelectorAll(".map__position");this.removeAttribute("list-open"),e.hidden=!1,n.hidden=!0,s.forEach(a=>a.hidden=!1),this.map&&this.map.invalidateSize()}disconnectedCallback(){this.#i&&(this.#i.disconnect(),this.#i=null),this.map&&(this.map.remove(),this.map=null)}}customElements.define("dm-map",Jd);function Ee(i,e){i.hasAttribute("hidden")&&e&&e.remove()}function ii(i,e,n,s){e&&n&&(e.addTo(n),i.removeAttribute("hidden"),i.dispatchEvent(new CustomEvent(`${s}:show`,{bubbles:!0,detail:{layer:e}})))}function ni(i,e,n){e&&(e.remove(),i.setAttribute("hidden",""),i.dispatchEvent(new CustomEvent(`${n}:hide`,{bubbles:!0,detail:{layer:e}})))}class Ri extends HTMLElement{#t=null;#n=null;#e={};#i=!1;#a=!1;marker=null;static get observedAttributes(){return["center","target","icon","icon-hover","icon-active","label","hidden","properties"]}get center(){const e=this.getAttribute("center");if(!e)return null;const[n,s]=e.split(",").map(Number);return[n,s]}set center(e){Array.isArray(e)?this.setAttribute("center",e.join(",")):this.setAttribute("center",e)}get target(){return this.getAttribute("target")}set target(e){this.setAttribute("target",e)}get active(){return this.#a}set active(e){this.#a=!!e,this.#h()}get label(){return this.getAttribute("label")}set label(e){this.setAttribute("label",e)}get properties(){return JSON.parse(this.getAttribute("properties")||"null")}set properties(e){this.setAttribute("properties",JSON.stringify(e))}show(){const e=this.#n||this.#t;this.removeAttribute("hidden"),ii(this,this.marker,e,"dm-marker"),this.dispatchEvent(new CustomEvent("dm-marker:show",{bubbles:!0,composed:!0,detail:{marker:this.marker}}))}hide(){this.setAttribute("hidden",""),ni(this,this.marker,"dm-marker"),this.dispatchEvent(new CustomEvent("dm-marker:hide",{bubbles:!0,composed:!0,detail:{marker:this.marker}}))}toggle(){this.hidden?this.show():this.hide()}connectedCallback(){const e=this.closest("dm-layer"),n=this.closest("dm-map");e?e.layerGroup&&n?.map?this.#l(e.layerGroup,n.map):e.addEventListener("dm-layer:ready",s=>{this.#l(s.detail.layerGroup,s.detail.map)},{once:!0}):n&&(n.map?this.#l(null,n.map):n.addEventListener("dm-map:ready",s=>{this.#l(null,s.detail.map)},{once:!0}))}static#s="data:image/svg+xml,"+encodeURIComponent('');async#o(e){return e?new Promise(n=>{const s=new Image;s.onload=()=>{const l=30/s.naturalWidth,h=Math.round(s.naturalWidth*l),c=Math.round(s.naturalHeight*l);n(O.icon({iconUrl:e,iconSize:[h,c],iconAnchor:[Math.round(h/2),c],popupAnchor:[0,-c]}))},s.onerror=()=>{n(O.icon({iconUrl:Ri.#s,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[0,-41]}))},s.src=e}):O.icon({iconUrl:Ri.#s,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[0,-41]})}async#r(){const e=window.__DRAAD_MAPS_BASE__||"",n=this.getAttribute("icon")||(e?`${e}/markers/marker.png`:null),s=this.getAttribute("icon-hover")||(e?`${e}/markers/marker-hover.png`:null),a=this.getAttribute("icon-active")||(e?`${e}/markers/marker-active.png`:null),[l,h,c]=await Promise.all([this.#o(n),this.#o(s),this.#o(a)]);this.#e={default:l,hover:h,active:c}}async#l(e,n){this.#t=n,this.#n=e;const s=this.center;s&&(await this.#r(),this.marker=O.marker(s,{icon:this.#e.default}),e?this.marker.addTo(e):this.marker.addTo(n),Ee(this,this.marker),this.marker.on("mouseover",()=>{this.#i=!0,this.#h(),this.dispatchEvent(new CustomEvent("dm-marker:hover",{bubbles:!0,composed:!0,detail:{marker:this.marker,hovering:!0}}))}),this.marker.on("mouseout",()=>{this.#i=!1,this.#h(),this.dispatchEvent(new CustomEvent("dm-marker:hover",{bubbles:!0,composed:!0,detail:{marker:this.marker,hovering:!1}}))}),this.marker.on("click",()=>{this.active=!this.active,this.dispatchEvent(new CustomEvent("dm-marker:click",{bubbles:!0,composed:!0,detail:{marker:this.marker,targetId:this.target}}))}))}#h(){this.marker&&(this.#a?this.marker.setIcon(this.#e.active):this.#i?this.marker.setIcon(this.#e.hover):this.marker.setIcon(this.#e.default))}async attributeChangedCallback(e,n,s){if(!(n===s||!this.marker))switch(e){case"center":{const a=this.center;a&&this.marker.setLatLng(a);break}case"hidden":this.hasAttribute("hidden")?this.hide():this.show();break;case"properties":break;case"icon":case"icon-hover":case"icon-active":await this.#r(),this.#h();break}}disconnectedCallback(){this.marker&&(this.marker.off("mouseover"),this.marker.off("mouseout"),this.marker.off("click"),this.marker.remove(),this.marker=null),this.#t=null,this.#n=null}}customElements.define("dm-marker",Ri);function Pe(i,e){return!e||Object.keys(e).length===0?i:i.filter(n=>Object.entries(e).every(([s,a])=>{const l=n.properties?.[s];if(a&&typeof a=="object"&&"min"in a&&"max"in a){const h=Number(l);return isNaN(h)?!1:h>=a.min&&h<=a.max}if(Array.isArray(a)){const h=String(l??"");if(h.includes(",")){const c=h.split(",").map(u=>u.trim());return a.some(u=>c.includes(u))}return a.includes(h)}return!1}))}class Kd extends HTMLElement{#t=null;#n=null;layerGroup=null;static get observedAttributes(){return["name","label","hidden","cluster","cluster-max-zoom","cluster-radius","filter-property","filter-label","filter-properties","filter-labels"]}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e)}get label(){return this.getAttribute("label")}set label(e){this.setAttribute("label",e)}get hidden(){return this.hasAttribute("hidden")}set hidden(e){e?this.setAttribute("hidden",""):this.removeAttribute("hidden")}get filterProperty(){return this.getAttribute("filter-property")}set filterProperty(e){this.setAttribute("filter-property",e)}get filterLabel(){return this.getAttribute("filter-label")}set filterLabel(e){this.setAttribute("filter-label",e)}get filterProperties(){return this.getAttribute("filter-properties")}set filterProperties(e){this.setAttribute("filter-properties",e)}get filterLabels(){return this.getAttribute("filter-labels")}set filterLabels(e){this.setAttribute("filter-labels",e)}get cluster(){return this.hasAttribute("cluster")}set cluster(e){e?this.setAttribute("cluster",""):this.removeAttribute("cluster")}get clusterMaxZoom(){const e=parseInt(this.getAttribute("cluster-max-zoom"));return isNaN(e)||e<0||e>18?16:e}set clusterMaxZoom(e){this.setAttribute("cluster-max-zoom",String(e))}get clusterRadius(){const e=parseInt(this.getAttribute("cluster-radius"));return isNaN(e)||e<=0?80:e}set clusterRadius(e){this.setAttribute("cluster-radius",String(e))}get data(){const e=this.querySelectorAll("dm-marker[properties]");return e.length===0?null:{type:"FeatureCollection",features:Array.from(e).map(n=>({type:"Feature",properties:{label:n.label,...n.properties},geometry:null}))}}show(){ii(this,this.layerGroup,this.#t,"dm-layer")}hide(){ni(this,this.layerGroup,"dm-layer")}toggle(){this.hidden?this.show():this.hide()}connectedCallback(){const e=this.closest("dm-map");e&&(!this.id&&(this.filterProperty||this.filterProperties)&&(this.id=`dm-layer-${Math.random().toString(36).slice(2,9)}`),e.map?this.#a(e.map):e.addEventListener("dm-map:ready",n=>{this.#a(n.detail.map)},{once:!0}),this.#n=this.#e.bind(this),this.addEventListener("dm-filter:apply",this.#n))}#e(e){this.querySelectorAll("dm-geojson[filter-property], dm-geojson[filter-properties], dm-wfs[filter-property], dm-wfs[filter-properties]").forEach(a=>{a.dispatchEvent(new CustomEvent("dm-filter:apply",{bubbles:!1,detail:e.detail}))});const s=e.detail.filters;this.querySelectorAll("dm-marker").forEach(a=>{const l=a.properties;this.#i(l,s)?a.show():a.hide()})}#i(e,n){return!n||Object.keys(n).length===0?!0:e?Pe([{properties:e}],n).length>0:!1}#a(e){this.#t=e,this.cluster&&O.markerClusterGroup?this.layerGroup=O.markerClusterGroup({maxClusterRadius:this.clusterRadius,disableClusteringAtZoom:this.clusterMaxZoom+1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0}).addTo(e):this.layerGroup=O.layerGroup().addTo(e),this.dispatchEvent(new CustomEvent("dm-layer:ready",{bubbles:!0,composed:!0,detail:{layerGroup:this.layerGroup,map:this.#t}}))}attributeChangedCallback(e,n,s){n===s||!this.layerGroup||e==="hidden"&&(s!==null?this.hide():this.show())}disconnectedCallback(){this.#n&&(this.removeEventListener("dm-filter:apply",this.#n),this.#n=null),this.layerGroup&&this.#t&&(this.layerGroup.remove(),this.layerGroup=null,this.#t=null)}}customElements.define("dm-layer",Kd);function Ln(i){try{const e=new URL(i,window.location.origin);return e.protocol==="http:"||e.protocol==="https:"||e.protocol==="blob:"}catch{return!1}}const Xd=["application/json","application/geo+json","application/vnd.geo+json","text/plain","text/xml","application/xml","application/gml+xml","image/png","image/jpeg","image/svg+xml"];function Cn(i){const n=(i.headers.get("content-type")||"").split(";")[0].trim().toLowerCase();if(!Xd.includes(n))throw new Error(`Unexpected content type: ${n}`)}async function*_s(i,e={}){const{batchSize:n=100,onProgress:s=null,signal:a=null,crsTransformer:l=null}=e;try{const h=(await i.json()).features||[],c=h.length;if(a?.aborted)throw new DOMException("Aborted","AbortError");for(let u=0;u');static get observedAttributes(){return["src","crs","label","hidden","filter-property","filter-label","filter-properties","filter-labels","infowindow-properties","infowindow-labels","streaming","batch-size","icon","icon-hover","icon-active"]}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e)}get crs(){return this.getAttribute("crs")}set crs(e){this.setAttribute("crs",e)}get geoJsonLayer(){return this.#e}get data(){return this.#i}get label(){return this.getAttribute("label")}set label(e){this.setAttribute("label",e)}get hidden(){return this.hasAttribute("hidden")}set hidden(e){e?this.setAttribute("hidden",""):this.removeAttribute("hidden")}get filterProperty(){return this.getAttribute("filter-property")}set filterProperty(e){this.setAttribute("filter-property",e)}get filterLabel(){return this.getAttribute("filter-label")}set filterLabel(e){this.setAttribute("filter-label",e)}get filterProperties(){return this.getAttribute("filter-properties")}set filterProperties(e){this.setAttribute("filter-properties",e)}get filterLabels(){return this.getAttribute("filter-labels")}set filterLabels(e){this.setAttribute("filter-labels",e)}get infowindowProperties(){return this.getAttribute("infowindow-properties")}set infowindowProperties(e){this.setAttribute("infowindow-properties",e)}get infowindowLabels(){return this.getAttribute("infowindow-labels")}set infowindowLabels(e){this.setAttribute("infowindow-labels",e)}get streaming(){return this.hasAttribute("streaming")}set streaming(e){e?this.setAttribute("streaming",""):this.removeAttribute("streaming")}get batchSize(){const e=parseInt(this.getAttribute("batch-size"));return isNaN(e)||e<1||e>1e4?100:e}set batchSize(e){this.setAttribute("batch-size",String(e))}get cluster(){return this.hasAttribute("cluster")}set cluster(e){e?this.setAttribute("cluster",""):this.removeAttribute("cluster")}get clusterMaxZoom(){const e=parseInt(this.getAttribute("cluster-max-zoom"));return isNaN(e)||e<0||e>22?null:e}set clusterMaxZoom(e){this.setAttribute("cluster-max-zoom",String(e))}get clusterRadius(){const e=parseInt(this.getAttribute("cluster-radius"));return isNaN(e)||e<=0?80:e}set clusterRadius(e){this.setAttribute("cluster-radius",String(e))}get isStreaming(){return this.#o}get loadProgress(){return this.#r}setPointToLayer(e){this.#d=e}show(){const e=this.#n||this.#t;ii(this,this.#e,e,"dm-geojson")}hide(){ni(this,this.#e,"dm-geojson")}toggle(){this.hidden?this.show():this.hide()}connectedCallback(){const e=this.closest("dm-layer"),n=this.closest("dm-map");e?e.layerGroup?this.#m(e.layerGroup,n.map):e.addEventListener("dm-layer:ready",s=>{this.#m(s.detail.layerGroup,s.detail.map)},{once:!0}):n&&(n.map?this.#m(null,n.map):n.addEventListener("dm-map:ready",s=>{this.#m(null,s.detail.map)},{once:!0})),this.#a=this.#y.bind(this),this.addEventListener("dm-filter:apply",this.#a)}#y(e){this.#l=e.detail.filters,this.#C(e.detail.filters)}#A(e){return e?new Promise(n=>{const s=new Image;s.onload=()=>{const a=30/s.naturalWidth,l=Math.round(s.naturalWidth*a),h=Math.round(s.naturalHeight*a);n(O.icon({iconUrl:e,iconSize:[l,h],iconAnchor:[Math.round(l/2),h],popupAnchor:[0,-h]}))},s.onerror=()=>n(O.icon({iconUrl:Bi.#v,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[0,-41]})),s.src=e}):Promise.resolve(O.icon({iconUrl:Bi.#v,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[0,-41]}))}async#p(){const e=window.__DRAAD_MAPS_BASE__||"",n=this.getAttribute("icon")||(e?`${e}/markers/marker.png`:null),s=this.getAttribute("icon-hover")||(e?`${e}/markers/marker-hover.png`:null),a=this.getAttribute("icon-active")||(e?`${e}/markers/marker-active.png`:null),[l,h,c]=await Promise.all([this.#A(n),this.#A(s),this.#A(a)]);this.#u={default:l,hover:h,active:c}}#g(e,n){if(this.#d)return this.#d(e,n);const s=O.marker(n,{icon:this.#u.default});return s.on("mouseover",()=>s.setIcon(this.#u.hover)),s.on("mouseout",()=>{s._dmActive||s.setIcon(s._dmCustomIcon||this.#u.default)}),s}#L(){const e={maxClusterRadius:this.clusterRadius,spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0};this.clusterMaxZoom!==null&&(e.disableClusteringAtZoom=this.clusterMaxZoom+1);const n=O.markerClusterGroup(e);return n.on("clusterclick",s=>{this.dispatchEvent(new CustomEvent("dm-geojson:cluster-click",{bubbles:!0,composed:!0,detail:{cluster:s.layer,latlng:s.latlng,childCount:s.layer.getChildCount()}}))}),n}#M(e){return e?(e.features||(e.type==="Feature"?[e]:[])).some(s=>s.geometry?.type==="Point"||s.geometry?.type==="MultiPoint"):!1}async#w(){this.#o=!0,this.#r={loaded:0,total:null,percent:null,featuresRendered:0},this.#s=new AbortController;const e=this.#s;await this.#p(),this.#e=O.geoJSON(null);const n=this.#n||this.#t;this.#e.addTo(n),this.#i={type:"FeatureCollection",features:[]};try{const s=await fetch(this.src,{signal:this.#s.signal});if(!s.ok)throw new Error(`HTTP ${s.status}: ${s.statusText}`);const a=this.#E(this.crs,null);if(!a){this.dispatchEvent(new CustomEvent("dm-geojson:error",{bubbles:!0,composed:!0,detail:{error:new Error("Could not determine coordinate system. Add a crs attribute.")}}));return}let l=!0;for await(const{features:h}of _s(s,{batchSize:this.batchSize,onProgress:c=>{this.#r=c,this.dispatchEvent(new CustomEvent("dm-geojson:progress",{detail:c,bubbles:!0,composed:!0}))},signal:this.#s.signal,crsTransformer:a})){if(e!==this.#s)return;this.#i.features.push(...h);const c=this.#l?Pe(h,this.#l):h;c.length>0&&(await this.#b(c),l&&(this.dispatchEvent(new CustomEvent("dm-geojson:first-feature",{detail:{feature:c[0],layer:this.#e},bubbles:!0,composed:!0})),l=!1)),this.#r.featuresRendered=this.#i.features.length}e===this.#s&&(this.#o=!1),Ee(this,this.#e),this.dispatchEvent(new CustomEvent("dm-geojson:ready",{bubbles:!0,composed:!0,detail:{layer:this.#e,data:this.#i}}))}catch(s){if(e===this.#s&&(this.#o=!1),s.name==="AbortError")return;this.dispatchEvent(new CustomEvent("dm-geojson:error",{bubbles:!0,composed:!0,detail:{error:s}}))}}async#b(e){return new Promise(n=>{requestAnimationFrame(()=>{const s={type:"FeatureCollection",features:e},a=this.#E(this.crs,null);O.geoJSON(s,{coordsToLatLng:a,style:()=>({...this.#f}),pointToLayer:(l,h)=>this.#g(l,h),onEachFeature:(l,h)=>{h.setStyle&&(h.on("mouseover",()=>h.setStyle(this.#_)),h.on("mouseout",()=>h.setStyle(this.#f))),h.on("click",c=>{this.dispatchEvent(new CustomEvent("dm-geojson:feature-click",{bubbles:!0,composed:!0,detail:{feature:l,layer:h,latlng:c.latlng}}))}),this.#e.addLayer(h)}}),n()})})}#S(){this.#s&&(this.#s.abort(),this.#s=null,this.#o=!1)}async#m(e,n){this.#c&&await this.#c;let s;this.#c=new Promise(a=>s=a);try{this.#t=n,this.#n=e;const a=this.src;if(!a)return;if(!Ln(a))throw new Error("Invalid URL: must be http or https");if(this.streaming){await this.#w();return}const l=await fetch(a);if(!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);Cn(l);const h=await l.json();this.#i=h;const c=this.#E(this.crs,h);if(!c){this.dispatchEvent(new CustomEvent("dm-geojson:error",{bubbles:!0,composed:!0,detail:{error:new Error("Could not determine coordinate system. Add a crs attribute.")}}));return}await this.#p();const u={coordsToLatLng:c,style:()=>({...this.#f}),pointToLayer:(v,g)=>this.#g(v,g),onEachFeature:(v,g)=>{g.setStyle&&(g.on("mouseover",()=>g.setStyle(this.#_)),g.on("mouseout",()=>g.setStyle(this.#f))),g.on("click",_=>{this.dispatchEvent(new CustomEvent("dm-geojson:feature-click",{bubbles:!0,composed:!0,detail:{feature:v,layer:g,latlng:_.latlng}}))})}},m=e&&typeof e.getMaxZoom=="function"?n:e||n;if(this.cluster&&O.markerClusterGroup&&this.#M(h)){const v={type:"FeatureCollection",features:[]},g={type:"FeatureCollection",features:[]};for(const w of h.features||[])w.geometry?.type==="Point"||w.geometry?.type==="MultiPoint"?v.features.push(w):g.features.push(w);this.#h=this.#L(),this.#h.addTo(m);const _=[];O.geoJSON(v,u).eachLayer(w=>_.push(w)),this.#h.addLayers(_),g.features.length>0?(this.#e=O.geoJSON(g,u),this.#e.addTo(m)):this.#e=this.#h}else this.#e=O.geoJSON(h,u),this.#e.addTo(m);Ee(this,this.#e),this.dispatchEvent(new CustomEvent("dm-geojson:ready",{bubbles:!0,composed:!0,detail:{layer:this.#e,data:this.#i}}))}catch(a){this.dispatchEvent(new CustomEvent("dm-geojson:error",{bubbles:!0,composed:!0,detail:{error:a}}))}finally{s(),this.#c=null}}#E(e,n){const s=Me(e);return s?s==="EPSG:4326"?a=>O.latLng(a[1],a[0]):a=>{const[l,h]=Oi(a,s);return O.latLng(h,l)}:kn(n)?null:a=>O.latLng(a[1],a[0])}attributeChangedCallback(e,n,s){n===s||!this.#t||this.#z(e,s)}async#z(e,n){switch(e){case"src":case"crs":await this.#P();break;case"hidden":n!==null?this.hide():this.show();break;case"icon":case"icon-hover":case"icon-active":await this.#p(),await this.#P();break}}async#P(){this.#S(),this.#h&&this.#h!==this.#e&&this.#h.remove(),this.#h=null,this.#e&&(this.#e.remove(),this.#e=null),this.#i=null,this.#r=null,await this.#m(this.#n,this.#t)}async#C(e){if(!this.#e||!this.#i)return;if(this.#o){this.#S(),await this.#P();return}const n={coordsToLatLng:this.#E(this.crs,this.#i),style:()=>({...this.#f}),pointToLayer:(a,l)=>this.#g(a,l),onEachFeature:(a,l)=>{l.setStyle&&(l.on("mouseover",()=>l.setStyle(this.#_)),l.on("mouseout",()=>l.setStyle(this.#f))),l.on("click",h=>{this.dispatchEvent(new CustomEvent("dm-geojson:feature-click",{bubbles:!0,composed:!0,detail:{feature:a,layer:l,latlng:h.latlng}}))})}},s=!e||Object.keys(e).length===0?this.#i:{type:"FeatureCollection",features:Pe(this.#i.features,e)};if(this.#h){const a={type:"FeatureCollection",features:[]},l={type:"FeatureCollection",features:[]};for(const c of s.features||[])c.geometry?.type==="Point"||c.geometry?.type==="MultiPoint"?a.features.push(c):l.features.push(c);this.#h.clearLayers();const h=[];if(O.geoJSON(a,n).eachLayer(c=>h.push(c)),this.#h.addLayers(h),this.#e!==this.#h){this.#e.clearLayers();const c=[];O.geoJSON(l,n).eachLayer(u=>c.push(u)),c.forEach(u=>this.#e.addLayer(u))}}else{this.#e.clearLayers();const a=[];O.geoJSON(s,n).eachLayer(l=>a.push(l)),a.forEach(l=>this.#e.addLayer(l))}this.dispatchEvent(new CustomEvent("dm-geojson:updated",{bubbles:!0,composed:!0,detail:{layer:this.#e,data:s}}))}disconnectedCallback(){this.#S(),this.#a&&(this.removeEventListener("dm-filter:apply",this.#a),this.#a=null),this.#h&&this.#h!==this.#e&&this.#h.remove(),this.#h=null,this.#e&&(this.#e.remove(),this.#e=null),this.#t=null,this.#n=null,this.#i=null,this.#r=null,this.#l=null,this.#d=null}}customElements.define("dm-geojson",Bi);function gs(i,e){if(!e)return i;const n=encodeURIComponent(i);if(e.includes("{url}"))return e.replace("{url}",n);const s=e.slice(-1),a=s==="?"||s==="&"?"":e.includes("?")?"&":"?";return`${e}${a}url=${n}`}class Ct extends HTMLElement{#t=null;#n=null;#e=null;#i=null;#a=null;#s=null;#o={};#r=null;#l=!1;#h=null;#u=null;static#d={color:"#555",weight:2,dashArray:"6 4",fillColor:"#555",fillOpacity:.15,opacity:.8};static#c={dashArray:null,opacity:1};static get observedAttributes(){return["src","name","version","format","crs","max-features","proxy","label","hidden","filter-property","filter-label","filter-properties","filter-labels","infowindow-properties","infowindow-labels","streaming","batch-size","cache-ttl","bbox-filter"]}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e)}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e)}get version(){return this.getAttribute("version")||"1.1.0"}set version(e){this.setAttribute("version",e)}get format(){return this.getAttribute("format")||"application/json"}set format(e){this.setAttribute("format",e)}get crs(){return this.getAttribute("crs")}set crs(e){this.setAttribute("crs",e)}get proxy(){return this.getAttribute("proxy")}set proxy(e){this.setAttribute("proxy",e)}get wfsLayer(){return this.#e}get data(){return this.#i}get label(){return this.getAttribute("label")}set label(e){this.setAttribute("label",e)}get hidden(){return this.hasAttribute("hidden")}set hidden(e){e?this.setAttribute("hidden",""):this.removeAttribute("hidden")}get filterProperty(){return this.getAttribute("filter-property")}set filterProperty(e){this.setAttribute("filter-property",e)}get filterLabel(){return this.getAttribute("filter-label")}set filterLabel(e){this.setAttribute("filter-label",e)}get filterProperties(){return this.getAttribute("filter-properties")}set filterProperties(e){this.setAttribute("filter-properties",e)}get filterLabels(){return this.getAttribute("filter-labels")}set filterLabels(e){this.setAttribute("filter-labels",e)}get infowindowProperties(){return this.getAttribute("infowindow-properties")}set infowindowProperties(e){this.setAttribute("infowindow-properties",e)}get infowindowLabels(){return this.getAttribute("infowindow-labels")}set infowindowLabels(e){this.setAttribute("infowindow-labels",e)}get streaming(){return this.hasAttribute("streaming")}set streaming(e){e?this.setAttribute("streaming",""):this.removeAttribute("streaming")}get batchSize(){const e=parseInt(this.getAttribute("batch-size"));return isNaN(e)||e<1||e>1e4?100:e}set batchSize(e){this.setAttribute("batch-size",String(e))}get cluster(){return this.hasAttribute("cluster")}set cluster(e){e?this.setAttribute("cluster",""):this.removeAttribute("cluster")}get clusterMaxZoom(){const e=parseInt(this.getAttribute("cluster-max-zoom"));return isNaN(e)||e<0||e>22?null:e}set clusterMaxZoom(e){this.setAttribute("cluster-max-zoom",String(e))}get clusterRadius(){const e=parseInt(this.getAttribute("cluster-radius"));return isNaN(e)||e<=0?80:e}set clusterRadius(e){this.setAttribute("cluster-radius",String(e))}get cacheTtl(){const e=parseInt(this.getAttribute("cache-ttl"));return isNaN(e)?300:e}set cacheTtl(e){this.setAttribute("cache-ttl",String(e))}get bboxFilter(){return this.hasAttribute("bbox-filter")}set bboxFilter(e){e?this.setAttribute("bbox-filter",""):this.removeAttribute("bbox-filter")}get isStreaming(){return this.#l}get loadProgress(){return this.#h}show(){const e=this.#n||this.#t;ii(this,this.#e,e,"dm-wfs")}hide(){ni(this,this.#e,"dm-wfs")}toggle(){this.hidden?this.show():this.hide()}refresh(){return this.#m()}getFeatures(){return this.#i?[...this.#i.features||[]]:[]}cancelRequest(){this.#v()}connectedCallback(){const e=this.closest("dm-layer"),n=this.closest("dm-map");e?e.layerGroup?this.#b(e.layerGroup,n.map):e.addEventListener("dm-layer:ready",s=>{this.#b(s.detail.layerGroup,s.detail.map)},{once:!0}):n&&(n.map?this.#b(null,n.map):n.addEventListener("dm-map:ready",s=>{this.#b(null,s.detail.map)},{once:!0})),this.#a=this.#f.bind(this),this.addEventListener("dm-filter:apply",this.#a)}#f(e){this.#u=e.detail.filters,this.#E(e.detail.filters)}#_(){const e=new URL(this.src,window.location.origin),n=e.searchParams,s=this.version;n.set("service","WFS"),n.set("version",s),n.set("request","GetFeature");const a=s==="2.0.0"?"typeNames":"typeName";n.set(a,this.name),n.set("outputFormat",this.format);const l=this.crs;l&&n.set("srsName",Me(l));const h=this.getAttribute("max-features");if(h){const u=s==="2.0.0"?"count":"maxFeatures";n.set(u,h)}const c=e.toString();return gs(c,this.proxy)}#v(){this.#r&&(this.#r.abort(),this.#r=null)}#y(e){return e?(e.features||(e.type==="Feature"?[e]:[])).some(s=>s.geometry?.type==="Point"||s.geometry?.type==="MultiPoint"):!1}#A(){const e={maxClusterRadius:this.clusterRadius,spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0},n=this.clusterMaxZoom;n!==null&&(e.disableClusteringAtZoom=n+1);const s=O.markerClusterGroup(e);return s.on("clusterclick",a=>{this.dispatchEvent(new CustomEvent("dm-wfs:cluster-click",{bubbles:!0,composed:!0,detail:{cluster:a.layer,latlng:a.latlng,childCount:a.layer.getChildCount()}}))}),s}#p(e){return e?e==="EPSG:4326"?n=>O.latLng(n[1],n[0]):n=>{const[s,a]=Oi(n,e);return O.latLng(a,s)}:n=>O.latLng(n[1],n[0])}#g(e,n){let s=Me(e);return s||(s=ls(n)),s?s==="EPSG:4326"?a=>O.latLng(a[1],a[0]):a=>{const[l,h]=Oi(a,s);return O.latLng(h,l)}:kn(n)?null:a=>O.latLng(a[1],a[0])}#L(e){return n=>{this.dispatchEvent(new CustomEvent("dm-wfs:feature-click",{bubbles:!0,composed:!0,detail:{feature:e,layer:n.target,latlng:n.latlng}}))}}async#M(e,n){return new Promise(s=>{requestAnimationFrame(()=>{const a={type:"FeatureCollection",features:e};O.geoJSON(a,{coordsToLatLng:n,style:()=>({...Ct.#d}),onEachFeature:(l,h)=>{h.setStyle&&(h.on("mouseover",()=>h.setStyle(Ct.#c)),h.on("mouseout",()=>h.setStyle(Ct.#d))),h.on("click",c=>{this.dispatchEvent(new CustomEvent("dm-wfs:feature-click",{bubbles:!0,composed:!0,detail:{feature:l,layer:h,latlng:c.latlng}}))}),this.#e.addLayer(h)}}),s()})})}async#w(){this.#l=!0,this.#h={loaded:0,total:null,percent:null,featuresRendered:0},this.#r=new AbortController,this.#e=O.geoJSON(null);const e=this.#n||this.#t;this.#e.addTo(e),this.#i={type:"FeatureCollection",features:[]};const n=this.#_();try{if(!Ln(n))throw new Error("Invalid URL: must be http or https");const s=await fetch(n);if(!s.ok)throw new Error(`HTTP ${s.status}: ${s.statusText}`);Cn(s);let a=Me(this.crs),l=s;if(!a){const u=await s.json();a=ls(u),l=new Response(JSON.stringify(u),{headers:s.headers})}const h=this.#p(a);if(!h){this.dispatchEvent(new CustomEvent("dm-wfs:error",{bubbles:!0,composed:!0,detail:{error:new Error("Could not determine coordinate system. Add a crs attribute.")}}));return}let c=!0;for await(const u of _s(l,{batchSize:this.batchSize,onProgress:m=>{this.#h=m,this.dispatchEvent(new CustomEvent("dm-wfs:progress",{bubbles:!0,composed:!0,detail:m}))},signal:this.#r.signal,crsTransformer:h})){this.#i.features.push(...u.features);const m=this.#u?Pe(u.features,this.#u):u.features;m.length>0&&(await this.#M(m,h),c&&(this.dispatchEvent(new CustomEvent("dm-wfs:first-feature",{bubbles:!0,composed:!0,detail:{feature:m[0],layer:this.#e}})),c=!1)),this.#h&&(this.#h.featuresRendered=this.#i.features.length)}this.#l=!1,Ee(this,this.#e),this.dispatchEvent(new CustomEvent("dm-wfs:ready",{bubbles:!0,composed:!0,detail:{layer:this.#e,data:this.#i}}))}catch(s){if(this.#l=!1,s.name==="AbortError")return;this.dispatchEvent(new CustomEvent("dm-wfs:error",{bubbles:!0,composed:!0,detail:{error:s}}))}}async#b(e,n){if(this.#t=n,this.#n=e,!this.src||!this.name)return;if(this.streaming){await this.#w();return}const s=this.#_();try{if(!Ln(s))throw new Error("Invalid URL: must be http or https");const a=await fetch(s);if(!a.ok)throw new Error(`HTTP ${a.status}: ${a.statusText}`);Cn(a);const l=await a.json();this.#i=l;const h=this.#g(this.crs,l);if(!h){this.dispatchEvent(new CustomEvent("dm-wfs:error",{bubbles:!0,composed:!0,detail:{error:new Error("Could not determine coordinate system. Add a crs attribute.")}}));return}const c=(m,v)=>{v.setStyle&&(v.on("mouseover",()=>v.setStyle(Ct.#c)),v.on("mouseout",()=>v.setStyle(Ct.#d))),v.on("click",g=>{this.dispatchEvent(new CustomEvent("dm-wfs:feature-click",{bubbles:!0,composed:!0,detail:{feature:m,layer:v,latlng:g.latlng}}))})},u=e&&typeof e.getMaxZoom=="function"?n:e||n;if(this.cluster&&O.markerClusterGroup&&this.#y(l)){const m={type:"FeatureCollection",features:[]},v={type:"FeatureCollection",features:[]};for(const _ of l.features||[])_.geometry?.type==="Point"||_.geometry?.type==="MultiPoint"?m.features.push(_):v.features.push(_);this.#s=this.#A(),this.#s.addTo(u);const g=[];O.geoJSON(m,{coordsToLatLng:h,onEachFeature:c}).eachLayer(_=>g.push(_)),this.#s.addLayers(g),v.features.length>0?(this.#e=O.geoJSON(v,{coordsToLatLng:h,style:()=>({...Ct.#d}),onEachFeature:c}),this.#e.addTo(u)):this.#e=this.#s}else this.#e=O.geoJSON(l,{coordsToLatLng:h,style:()=>({...Ct.#d}),onEachFeature:c}),this.#e.addTo(u);Ee(this,this.#e),this.dispatchEvent(new CustomEvent("dm-wfs:ready",{bubbles:!0,composed:!0,detail:{layer:this.#e,data:this.#i}}))}catch(a){this.dispatchEvent(new CustomEvent("dm-wfs:error",{bubbles:!0,composed:!0,detail:{error:a}}))}}attributeChangedCallback(e,n,s){n===s||!this.#t||this.#S(e,s)}#S(e,n){switch(e){case"src":case"name":case"version":case"format":case"crs":case"max-features":case"proxy":this.#m();break;case"hidden":n!==null?this.hide():this.show();break}}async#m(){this.#v(),this.#s&&this.#s!==this.#e&&this.#s.remove(),this.#s=null,this.#e&&(this.#e.remove(),this.#e=null),this.#i=null,this.#h=null,await this.#b(this.#n,this.#t)}async#E(e){if(!this.#e||!this.#i)return;if(this.#l){this.#v(),await this.#m();return}const n=this.#g(this.crs,this.#i),s=(h,c)=>{c.setStyle&&(c.on("mouseover",()=>c.setStyle(Ct.#c)),c.on("mouseout",()=>c.setStyle(Ct.#d))),c.on("click",u=>{this.dispatchEvent(new CustomEvent("dm-wfs:feature-click",{bubbles:!0,composed:!0,detail:{feature:h,layer:c,latlng:u.latlng}}))})},a=()=>({...Ct.#d});if(!e||Object.keys(e).length===0){this.#e.clearLayers(),O.geoJSON(this.#i,{coordsToLatLng:n,style:a,onEachFeature:s}).eachLayer(h=>this.#e.addLayer(h));return}this.#e.clearLayers();const l={type:"FeatureCollection",features:Pe(this.#i.features,e)};O.geoJSON(l,{coordsToLatLng:n,style:a,onEachFeature:s}).eachLayer(h=>this.#e.addLayer(h))}disconnectedCallback(){this.#v(),this.#a&&(this.removeEventListener("dm-filter:apply",this.#a),this.#a=null),this.#s&&this.#s!==this.#e&&this.#s.remove(),this.#s=null,this.#e&&(this.#e.remove(),this.#e=null),this.#t=null,this.#n=null,this.#i=null,this.#h=null,this.#u=null}}customElements.define("dm-wfs",Ct);class Qd extends HTMLElement{#t=null;#n=null;#e=null;static get observedAttributes(){return["src","layers","version","format","transparent","styles","crs","proxy","opacity","min-zoom","max-zoom","label","hidden","time"]}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e)}get layers(){return this.getAttribute("layers")}set layers(e){this.setAttribute("layers",e)}get version(){return this.getAttribute("version")||"1.1.1"}set version(e){this.setAttribute("version",e)}get format(){return this.getAttribute("format")||"image/png"}set format(e){this.setAttribute("format",e)}get transparent(){const e=this.getAttribute("transparent");return e===null||e==="true"}set transparent(e){this.setAttribute("transparent",String(e))}get styles(){return this.getAttribute("styles")||""}set styles(e){this.setAttribute("styles",e)}get crs(){return this.getAttribute("crs")}set crs(e){this.setAttribute("crs",e)}get proxy(){return this.getAttribute("proxy")}set proxy(e){this.setAttribute("proxy",e)}get opacity(){const e=this.getAttribute("opacity");return e?parseFloat(e):1}set opacity(e){this.setAttribute("opacity",String(e))}get time(){return this.getAttribute("time")}set time(e){this.setAttribute("time",e)}get wmsLayer(){return this.#e}get label(){return this.getAttribute("label")}set label(e){this.setAttribute("label",e)}setOpacity(e){this.#e&&this.#e.setOpacity(e),this.setAttribute("opacity",String(e))}setTime(e){const n=this.time;this.setAttribute("time",e),this.refresh(),this.dispatchEvent(new CustomEvent("dm-wms:time-change",{bubbles:!0,composed:!0,detail:{time:e,previousTime:n}}))}refresh(){this.#e&&(this.#e.remove(),this.#e=null),this.#i(this.#n,this.#t)}show(){const e=this.#n||this.#t;this.removeAttribute("hidden"),ii(this,this.#e,e,"dm-wms")}hide(){this.setAttribute("hidden",""),ni(this,this.#e,"dm-wms")}toggle(){this.hidden?this.show():this.hide()}connectedCallback(){const e=this.closest("dm-layer"),n=this.closest("dm-map");e?e.layerGroup?this.#i(e.layerGroup,n.map):e.addEventListener("dm-layer:ready",s=>{this.#i(s.detail.layerGroup,s.detail.map)},{once:!0}):n&&(n.map?this.#i(null,n.map):n.addEventListener("dm-map:ready",s=>{this.#i(null,s.detail.map)},{once:!0}))}#i(e,n){if(this.#t=n,this.#n=e,!this.src){this.#o(new Error("dm-wms requires a src attribute"));return}if(!this.layers){this.#o(new Error("dm-wms requires a layers attribute"));return}try{const s=this.#a(),a=this.#s();this.#e=O.tileLayer.wms(s,a),e?this.#e.addTo(e):this.#e.addTo(n),Ee(this,this.#e),this.dispatchEvent(new CustomEvent("dm-wms:ready",{bubbles:!0,composed:!0,detail:{layer:this.#e}}))}catch(s){this.#o(s)}}#a(){let e=this.src;return e=e.replace(/\?+$/,""),gs(e,this.proxy)}#s(){const e={layers:this.layers,format:this.format,transparent:this.transparent,version:this.version,styles:this.styles,opacity:this.opacity,attribution:'© Kadaster'},n=this.crs;n&&(e.crs=Me(n));const s=this.getAttribute("min-zoom"),a=this.getAttribute("max-zoom");s&&(e.minZoom=parseInt(s,10)),a&&(e.maxZoom=parseInt(a,10));const l=this.time;return l&&(e.TIME=l),e}#o(e){this.dispatchEvent(new CustomEvent("dm-wms:error",{bubbles:!0,composed:!0,detail:{error:e}}))}attributeChangedCallback(e,n,s){if(!(n===s||!this.#e))switch(e){case"opacity":{const a=parseFloat(s);isNaN(a)||this.#e.setOpacity(a);break}case"hidden":this.hasAttribute("hidden")?this.hide():this.show();break;case"time":this.#r();break;case"src":case"layers":case"version":case"format":case"transparent":case"styles":case"crs":case"proxy":case"min-zoom":case"max-zoom":this.#r();break}}#r(){this.#e&&(this.#e.remove(),this.#e=null),this.#i(this.#n,this.#t)}disconnectedCallback(){this.#e&&(this.#e.remove(),this.#e=null),this.#t=null,this.#n=null}}customElements.define("dm-wms",Qd);const Yd=`:host { + `,this.#e=this.#a()}#a(){const e=new CSSStyleSheet;e.replaceSync($d);const n=new CSSStyleSheet;n.replaceSync(Wd);const s=new CSSStyleSheet;s.replaceSync(Vd);const a=new CSSStyleSheet;a.replaceSync(ms),this.#t.adoptedStyleSheets=[e,n,s,a]}get zoomPosition(){const e={"top-left":"topleft","top-right":"topright","bottom-left":"bottomleft","bottom-right":"bottomright"},n=this.getAttribute("zoom-position");return e[n]??"bottomleft"}get center(){const e=this.getAttribute("center");if(!e)return[52.0705,4.3007];const[n,s]=e.split(",").map(Number);return[n,s]}get zoom(){const e=this.getAttribute("zoom");return e!==null?Number(e):12}get maxBounds(){const e=this.getAttribute("max-bounds");if(e==="false"||e==="")return null;if(!e)return[[50.6,3],[53.8,7.3]];const[n,s,a,l]=e.split(",").map(Number);return[[n,s],[a,l]]}get tileUrl(){return this.getAttribute("tile-url")??"https://service.pdok.nl/brt/achtergrondkaart/wmts/v2_0/standaard/EPSG:3857/{z}/{x}/{y}.png"}get tileAttribution(){return this.getAttribute("tile-attribution")??'Kaartgegevens: Kadaster'}get minZoom(){const e=this.getAttribute("min-zoom");return e!==null?Number(e):1}get maxZoom(){const e=this.getAttribute("max-zoom");return e!==null?Number(e):19}async connectedCallback(){this.#n||(await this.#e,Ut(this.#t),this.initialize())}initialize(){this.#n=!0,this.RDnew=Zd();const e=G.map(this.#t.querySelector(".map__canvas"),{center:this.center,worldCopyJump:!0,zoom:this.zoom,zoomControl:!1});this.maxBounds&&e.setMaxBounds(this.maxBounds),this.map=e,G.control.zoom({position:this.zoomPosition}).addTo(this.map);const n=this.#t.querySelector(".leaflet-control-zoom-in"),s=this.#t.querySelector(".leaflet-control-zoom-out");n&&(n.innerHTML=''),s&&(s.innerHTML=''),G.tileLayer(this.tileUrl,{maxZoom:this.maxZoom,minZoom:this.minZoom,attribution:this.tileAttribution}).addTo(this.map),this.#i=new ResizeObserver(()=>{this.map&&this.map.invalidateSize()}),this.#i.observe(this.#t.querySelector(".map__canvas")),this.addEventListener("dm-list:open",()=>this.#r()),this.addEventListener("dm-list:close",()=>this.#s()),this.addEventListener("dm-infowindow:open",a=>this.#l(a.target)),this.dispatchEvent(new CustomEvent("dm-map:ready",{bubbles:!0,composed:!0,detail:{map:this.map}}))}#l(e){const n=e?.shadowRoot?.querySelector(".infowindow"),s=e?.shadowRoot?.querySelector(".infowindow__body"),a=this.#t.querySelector(".map__position--top-right");if(!n||!s||!a)return;const l=this.getBoundingClientRect(),h=parseFloat(getComputedStyle(a).insetInlineEnd)||10,c=this.#t.querySelector(".leaflet-control-zoom");let u=h;if(c){const g=c.getBoundingClientRect(),_=a.getBoundingClientRect(),w=_.leftg.left,x=g.top>l.top+l.height/2;w&&x&&(u=l.bottom-g.top+h)}this.style.setProperty("--draad-map-components-infowindow-offset-bottom",`${Math.ceil(u)}px`);const v=n.offsetHeight+(s.scrollHeight-s.clientHeight)-a.clientHeight;if(v>0){const g=Math.ceil(l.height+v),_=parseFloat(this.style.getPropertyValue("--draad-map-components-map-content-min-height"))||0;g>_&&this.style.setProperty("--draad-map-components-map-content-min-height",`${g}px`)}}#r(){this.querySelectorAll("dm-infowindow").forEach(a=>{a.isOpen&&a.close()});const e=this.#t.querySelector(".map__canvas"),n=this.#t.querySelector(".map__list"),s=this.#t.querySelectorAll(".map__position");this.setAttribute("list-open",""),e.hidden=!0,n.hidden=!1,s.forEach(a=>a.hidden=!0)}#s(){const e=this.#t.querySelector(".map__canvas"),n=this.#t.querySelector(".map__list"),s=this.#t.querySelectorAll(".map__position");this.removeAttribute("list-open"),e.hidden=!1,n.hidden=!0,s.forEach(a=>a.hidden=!1),this.map&&this.map.invalidateSize()}disconnectedCallback(){this.#i&&(this.#i.disconnect(),this.#i=null),this.map&&(this.map.remove(),this.map=null)}}customElements.define("dm-map",Jd);function Ee(i,e){i.hasAttribute("hidden")&&e&&e.remove()}function ii(i,e,n,s){e&&n&&(e.addTo(n),i.removeAttribute("hidden"),i.dispatchEvent(new CustomEvent(`${s}:show`,{bubbles:!0,detail:{layer:e}})))}function ni(i,e,n){e&&(e.remove(),i.setAttribute("hidden",""),i.dispatchEvent(new CustomEvent(`${n}:hide`,{bubbles:!0,detail:{layer:e}})))}class Ri extends HTMLElement{#t=null;#n=null;#e={};#i=!1;#a=!1;marker=null;static get observedAttributes(){return["center","target","icon","icon-hover","icon-active","label","hidden","properties"]}get center(){const e=this.getAttribute("center");if(!e)return null;const[n,s]=e.split(",").map(Number);return[n,s]}set center(e){Array.isArray(e)?this.setAttribute("center",e.join(",")):this.setAttribute("center",e)}get target(){return this.getAttribute("target")}set target(e){this.setAttribute("target",e)}get active(){return this.#a}set active(e){this.#a=!!e,this.#h()}get label(){return this.getAttribute("label")}set label(e){this.setAttribute("label",e)}get properties(){return JSON.parse(this.getAttribute("properties")||"null")}set properties(e){this.setAttribute("properties",JSON.stringify(e))}show(){const e=this.#n||this.#t;this.removeAttribute("hidden"),ii(this,this.marker,e,"dm-marker"),this.dispatchEvent(new CustomEvent("dm-marker:show",{bubbles:!0,composed:!0,detail:{marker:this.marker}}))}hide(){this.setAttribute("hidden",""),ni(this,this.marker,"dm-marker"),this.dispatchEvent(new CustomEvent("dm-marker:hide",{bubbles:!0,composed:!0,detail:{marker:this.marker}}))}toggle(){this.hidden?this.show():this.hide()}connectedCallback(){const e=this.closest("dm-layer"),n=this.closest("dm-map");e?e.layerGroup&&n?.map?this.#o(e.layerGroup,n.map):e.addEventListener("dm-layer:ready",s=>{this.#o(s.detail.layerGroup,s.detail.map)},{once:!0}):n&&(n.map?this.#o(null,n.map):n.addEventListener("dm-map:ready",s=>{this.#o(null,s.detail.map)},{once:!0}))}static#l="data:image/svg+xml,"+encodeURIComponent('');async#r(e){return e?new Promise(n=>{const s=new Image;s.onload=()=>{const l=30/s.naturalWidth,h=Math.round(s.naturalWidth*l),c=Math.round(s.naturalHeight*l);n(G.icon({iconUrl:e,iconSize:[h,c],iconAnchor:[Math.round(h/2),c],popupAnchor:[0,-c]}))},s.onerror=()=>{n(G.icon({iconUrl:Ri.#l,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[0,-41]}))},s.src=e}):G.icon({iconUrl:Ri.#l,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[0,-41]})}async#s(){const e=window.__DRAAD_MAPS_BASE__||"",n=this.getAttribute("icon")||(e?`${e}/markers/marker.png`:null),s=this.getAttribute("icon-hover")||(e?`${e}/markers/marker-hover.png`:null),a=this.getAttribute("icon-active")||(e?`${e}/markers/marker-active.png`:null),[l,h,c]=await Promise.all([this.#r(n),this.#r(s),this.#r(a)]);this.#e={default:l,hover:h,active:c}}async#o(e,n){this.#t=n,this.#n=e;const s=this.center;s&&(await this.#s(),this.marker=G.marker(s,{icon:this.#e.default}),e?this.marker.addTo(e):this.marker.addTo(n),Ee(this,this.marker),this.marker.on("mouseover",()=>{this.#i=!0,this.#h(),this.dispatchEvent(new CustomEvent("dm-marker:hover",{bubbles:!0,composed:!0,detail:{marker:this.marker,hovering:!0}}))}),this.marker.on("mouseout",()=>{this.#i=!1,this.#h(),this.dispatchEvent(new CustomEvent("dm-marker:hover",{bubbles:!0,composed:!0,detail:{marker:this.marker,hovering:!1}}))}),this.marker.on("click",()=>{this.active=!this.active,this.dispatchEvent(new CustomEvent("dm-marker:click",{bubbles:!0,composed:!0,detail:{marker:this.marker,targetId:this.target}}))}))}#h(){this.marker&&(this.#a?this.marker.setIcon(this.#e.active):this.#i?this.marker.setIcon(this.#e.hover):this.marker.setIcon(this.#e.default))}async attributeChangedCallback(e,n,s){if(!(n===s||!this.marker))switch(e){case"center":{const a=this.center;a&&this.marker.setLatLng(a);break}case"hidden":this.hasAttribute("hidden")?this.hide():this.show();break;case"properties":break;case"icon":case"icon-hover":case"icon-active":await this.#s(),this.#h();break}}disconnectedCallback(){this.marker&&(this.marker.off("mouseover"),this.marker.off("mouseout"),this.marker.off("click"),this.marker.remove(),this.marker=null),this.#t=null,this.#n=null}}customElements.define("dm-marker",Ri);function Pe(i,e){return!e||Object.keys(e).length===0?i:i.filter(n=>Object.entries(e).every(([s,a])=>{const l=n.properties?.[s];if(a&&typeof a=="object"&&"min"in a&&"max"in a){const h=Number(l);return isNaN(h)?!1:h>=a.min&&h<=a.max}if(Array.isArray(a)){const h=String(l??"");if(h.includes(",")){const c=h.split(",").map(u=>u.trim());return a.some(u=>c.includes(u))}return a.includes(h)}return!1}))}class Kd extends HTMLElement{#t=null;#n=null;layerGroup=null;static get observedAttributes(){return["name","label","hidden","cluster","cluster-max-zoom","cluster-radius","filter-property","filter-label","filter-properties","filter-labels"]}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e)}get label(){return this.getAttribute("label")}set label(e){this.setAttribute("label",e)}get hidden(){return this.hasAttribute("hidden")}set hidden(e){e?this.setAttribute("hidden",""):this.removeAttribute("hidden")}get filterProperty(){return this.getAttribute("filter-property")}set filterProperty(e){this.setAttribute("filter-property",e)}get filterLabel(){return this.getAttribute("filter-label")}set filterLabel(e){this.setAttribute("filter-label",e)}get filterProperties(){return this.getAttribute("filter-properties")}set filterProperties(e){this.setAttribute("filter-properties",e)}get filterLabels(){return this.getAttribute("filter-labels")}set filterLabels(e){this.setAttribute("filter-labels",e)}get cluster(){return this.hasAttribute("cluster")}set cluster(e){e?this.setAttribute("cluster",""):this.removeAttribute("cluster")}get clusterMaxZoom(){const e=parseInt(this.getAttribute("cluster-max-zoom"));return isNaN(e)||e<0||e>18?16:e}set clusterMaxZoom(e){this.setAttribute("cluster-max-zoom",String(e))}get clusterRadius(){const e=parseInt(this.getAttribute("cluster-radius"));return isNaN(e)||e<=0?80:e}set clusterRadius(e){this.setAttribute("cluster-radius",String(e))}get data(){const e=this.querySelectorAll("dm-marker[properties]");return e.length===0?null:{type:"FeatureCollection",features:Array.from(e).map(n=>({type:"Feature",properties:{label:n.label,...n.properties},geometry:null}))}}show(){ii(this,this.layerGroup,this.#t,"dm-layer")}hide(){ni(this,this.layerGroup,"dm-layer")}toggle(){this.hidden?this.show():this.hide()}connectedCallback(){const e=this.closest("dm-map");e&&(!this.id&&(this.filterProperty||this.filterProperties)&&(this.id=`dm-layer-${Math.random().toString(36).slice(2,9)}`),e.map?this.#a(e.map):e.addEventListener("dm-map:ready",n=>{this.#a(n.detail.map)},{once:!0}),this.#n=this.#e.bind(this),this.addEventListener("dm-filter:apply",this.#n))}#e(e){this.querySelectorAll("dm-geojson[filter-property], dm-geojson[filter-properties], dm-wfs[filter-property], dm-wfs[filter-properties]").forEach(a=>{a.dispatchEvent(new CustomEvent("dm-filter:apply",{bubbles:!1,detail:e.detail}))});const s=e.detail.filters;this.querySelectorAll("dm-marker").forEach(a=>{const l=a.properties;this.#i(l,s)?a.show():a.hide()})}#i(e,n){return!n||Object.keys(n).length===0?!0:e?Pe([{properties:e}],n).length>0:!1}#a(e){this.#t=e,this.cluster&&G.markerClusterGroup?this.layerGroup=G.markerClusterGroup({maxClusterRadius:this.clusterRadius,disableClusteringAtZoom:this.clusterMaxZoom+1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0}).addTo(e):this.layerGroup=G.layerGroup().addTo(e),this.dispatchEvent(new CustomEvent("dm-layer:ready",{bubbles:!0,composed:!0,detail:{layerGroup:this.layerGroup,map:this.#t}}))}attributeChangedCallback(e,n,s){n===s||!this.layerGroup||e==="hidden"&&(s!==null?this.hide():this.show())}disconnectedCallback(){this.#n&&(this.removeEventListener("dm-filter:apply",this.#n),this.#n=null),this.layerGroup&&this.#t&&(this.layerGroup.remove(),this.layerGroup=null,this.#t=null)}}customElements.define("dm-layer",Kd);function Ln(i){try{const e=new URL(i,window.location.origin);return e.protocol==="http:"||e.protocol==="https:"||e.protocol==="blob:"}catch{return!1}}const Xd=["application/json","application/geo+json","application/vnd.geo+json","text/plain","text/xml","application/xml","application/gml+xml","image/png","image/jpeg","image/svg+xml"];function Cn(i){const n=(i.headers.get("content-type")||"").split(";")[0].trim().toLowerCase();if(!Xd.includes(n))throw new Error(`Unexpected content type: ${n}`)}async function*_s(i,e={}){const{batchSize:n=100,onProgress:s=null,signal:a=null,crsTransformer:l=null}=e;try{const h=(await i.json()).features||[],c=h.length;if(a?.aborted)throw new DOMException("Aborted","AbortError");for(let u=0;u');static get observedAttributes(){return["src","crs","label","hidden","filter-property","filter-label","filter-properties","filter-labels","infowindow-properties","infowindow-labels","streaming","batch-size","icon","icon-hover","icon-active"]}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e)}get crs(){return this.getAttribute("crs")}set crs(e){this.setAttribute("crs",e)}get geoJsonLayer(){return this.#e}get data(){return this.#i}get label(){return this.getAttribute("label")}set label(e){this.setAttribute("label",e)}get hidden(){return this.hasAttribute("hidden")}set hidden(e){e?this.setAttribute("hidden",""):this.removeAttribute("hidden")}get filterProperty(){return this.getAttribute("filter-property")}set filterProperty(e){this.setAttribute("filter-property",e)}get filterLabel(){return this.getAttribute("filter-label")}set filterLabel(e){this.setAttribute("filter-label",e)}get filterProperties(){return this.getAttribute("filter-properties")}set filterProperties(e){this.setAttribute("filter-properties",e)}get filterLabels(){return this.getAttribute("filter-labels")}set filterLabels(e){this.setAttribute("filter-labels",e)}get infowindowProperties(){return this.getAttribute("infowindow-properties")}set infowindowProperties(e){this.setAttribute("infowindow-properties",e)}get infowindowLabels(){return this.getAttribute("infowindow-labels")}set infowindowLabels(e){this.setAttribute("infowindow-labels",e)}get streaming(){return this.hasAttribute("streaming")}set streaming(e){e?this.setAttribute("streaming",""):this.removeAttribute("streaming")}get batchSize(){const e=parseInt(this.getAttribute("batch-size"));return isNaN(e)||e<1||e>1e4?100:e}set batchSize(e){this.setAttribute("batch-size",String(e))}get cluster(){return this.hasAttribute("cluster")}set cluster(e){e?this.setAttribute("cluster",""):this.removeAttribute("cluster")}get clusterMaxZoom(){const e=parseInt(this.getAttribute("cluster-max-zoom"));return isNaN(e)||e<0||e>22?null:e}set clusterMaxZoom(e){this.setAttribute("cluster-max-zoom",String(e))}get clusterRadius(){const e=parseInt(this.getAttribute("cluster-radius"));return isNaN(e)||e<=0?80:e}set clusterRadius(e){this.setAttribute("cluster-radius",String(e))}get isStreaming(){return this.#r}get loadProgress(){return this.#s}setPointToLayer(e){this.#u=e}show(){const e=this.#n||this.#t;ii(this,this.#e,e,"dm-geojson")}hide(){ni(this,this.#e,"dm-geojson")}toggle(){this.hidden?this.show():this.hide()}connectedCallback(){const e=this.closest("dm-layer"),n=this.closest("dm-map");e?e.layerGroup?this.#v(e.layerGroup,n.map):e.addEventListener("dm-layer:ready",s=>{this.#v(s.detail.layerGroup,s.detail.map)},{once:!0}):n&&(n.map?this.#v(null,n.map):n.addEventListener("dm-map:ready",s=>{this.#v(null,s.detail.map)},{once:!0})),this.#a=this.#b.bind(this),this.addEventListener("dm-filter:apply",this.#a),this.addEventListener("dm-geojson:feature-click",s=>{const a=s.detail?.layer?.feature?s.detail.layer:this.#A(s.detail?.feature);this.#p(a)})}#A(e){if(!e)return null;let n=null;const s=a=>{a?.eachLayer?.(l=>{n||(l.feature===e?n=l:l.eachLayer&&s(l))})};return s(this.#e),n||s(this.#h),n}#p(e){!e||e===this.#f||(this.clearActiveFeature(),e.setIcon&&this.#d.active?(e._dmActive=!0,e.setIcon(this.#d.active),e.setZIndexOffset?.(1e3)):e.setStyle&&(e.setStyle(this.#_),e.bringToFront?.()),this.#f=e)}clearActiveFeature(){const e=this.#f;e&&(e.setIcon?(e._dmActive=!1,e.setIcon(e._dmCustomIcon||this.#d.default),e.setZIndexOffset?.(0)):e.setStyle&&e.setStyle(this.#m),this.#f=null)}#b(e){this.#o=e.detail.filters,this.#T(e.detail.filters)}#P(e){return e?new Promise(n=>{const s=new Image;s.onload=()=>{const a=30/s.naturalWidth,l=Math.round(s.naturalWidth*a),h=Math.round(s.naturalHeight*a);n(G.icon({iconUrl:e,iconSize:[l,h],iconAnchor:[Math.round(l/2),h],popupAnchor:[0,-h]}))},s.onerror=()=>n(G.icon({iconUrl:Bi.#y,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[0,-41]})),s.src=e}):Promise.resolve(G.icon({iconUrl:Bi.#y,iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[0,-41]}))}async#x(){const e=window.__DRAAD_MAPS_BASE__||"",n=this.getAttribute("icon")||(e?`${e}/markers/marker.png`:null),s=this.getAttribute("icon-hover")||(e?`${e}/markers/marker-hover.png`:null),a=this.getAttribute("icon-active")||(e?`${e}/markers/marker-active.png`:null),[l,h,c]=await Promise.all([this.#P(n),this.#P(s),this.#P(a)]);this.#d={default:l,hover:h,active:c}}#g(e,n){if(this.#u)return this.#u(e,n);const s=G.marker(n,{icon:this.#d.default});return s.on("mouseover",()=>s.setIcon(this.#d.hover)),s.on("mouseout",()=>{s.setIcon(s._dmActive?this.#d.active:s._dmCustomIcon||this.#d.default)}),s}#C(){const e={maxClusterRadius:this.clusterRadius,spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0};this.clusterMaxZoom!==null&&(e.disableClusteringAtZoom=this.clusterMaxZoom+1);const n=G.markerClusterGroup(e);return n.on("clusterclick",s=>{this.dispatchEvent(new CustomEvent("dm-geojson:cluster-click",{bubbles:!0,composed:!0,detail:{cluster:s.layer,latlng:s.latlng,childCount:s.layer.getChildCount()}}))}),n}#L(e){return e?(e.features||(e.type==="Feature"?[e]:[])).some(s=>s.geometry?.type==="Point"||s.geometry?.type==="MultiPoint"):!1}async#w(){this.#r=!0,this.#s={loaded:0,total:null,percent:null,featuresRendered:0},this.#l=new AbortController;const e=this.#l;await this.#x(),this.#e=G.geoJSON(null);const n=this.#n||this.#t;this.#e.addTo(n),this.#i={type:"FeatureCollection",features:[]};try{const s=await fetch(this.src,{signal:this.#l.signal});if(!s.ok)throw new Error(`HTTP ${s.status}: ${s.statusText}`);const a=this.#M(this.crs,null);if(!a){this.dispatchEvent(new CustomEvent("dm-geojson:error",{bubbles:!0,composed:!0,detail:{error:new Error("Could not determine coordinate system. Add a crs attribute.")}}));return}let l=!0;for await(const{features:h}of _s(s,{batchSize:this.batchSize,onProgress:c=>{this.#s=c,this.dispatchEvent(new CustomEvent("dm-geojson:progress",{detail:c,bubbles:!0,composed:!0}))},signal:this.#l.signal,crsTransformer:a})){if(e!==this.#l)return;this.#i.features.push(...h);const c=this.#o?Pe(h,this.#o):h;c.length>0&&(await this.#S(c),l&&(this.dispatchEvent(new CustomEvent("dm-geojson:first-feature",{detail:{feature:c[0],layer:this.#e},bubbles:!0,composed:!0})),l=!1)),this.#s.featuresRendered=this.#i.features.length}e===this.#l&&(this.#r=!1),Ee(this,this.#e),this.dispatchEvent(new CustomEvent("dm-geojson:ready",{bubbles:!0,composed:!0,detail:{layer:this.#e,data:this.#i}}))}catch(s){if(e===this.#l&&(this.#r=!1),s.name==="AbortError")return;this.dispatchEvent(new CustomEvent("dm-geojson:error",{bubbles:!0,composed:!0,detail:{error:s}}))}}async#S(e){return new Promise(n=>{requestAnimationFrame(()=>{const s={type:"FeatureCollection",features:e},a=this.#M(this.crs,null);G.geoJSON(s,{coordsToLatLng:a,style:()=>({...this.#m}),pointToLayer:(l,h)=>this.#g(l,h),onEachFeature:(l,h)=>{h.setStyle&&(h.on("mouseover",()=>h.setStyle(this.#_)),h.on("mouseout",()=>h.setStyle(h._dmActive?this.#_:this.#m))),h.on("click",c=>{this.dispatchEvent(new CustomEvent("dm-geojson:feature-click",{bubbles:!0,composed:!0,detail:{feature:l,layer:h,latlng:c.latlng}}))}),this.#e.addLayer(h)}}),n()})})}#k(){this.#l&&(this.#l.abort(),this.#l=null,this.#r=!1)}async#v(e,n){this.#c&&await this.#c;let s;this.#c=new Promise(a=>s=a);try{this.#t=n,this.#n=e;const a=this.src;if(!a)return;if(!Ln(a))throw new Error("Invalid URL: must be http or https");if(this.streaming){await this.#w();return}const l=await fetch(a);if(!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);Cn(l);const h=await l.json();this.#i=h;const c=this.#M(this.crs,h);if(!c){this.dispatchEvent(new CustomEvent("dm-geojson:error",{bubbles:!0,composed:!0,detail:{error:new Error("Could not determine coordinate system. Add a crs attribute.")}}));return}await this.#x();const u={coordsToLatLng:c,style:()=>({...this.#m}),pointToLayer:(v,g)=>this.#g(v,g),onEachFeature:(v,g)=>{g.setStyle&&(g.on("mouseover",()=>g.setStyle(this.#_)),g.on("mouseout",()=>g.setStyle(g._dmActive?this.#_:this.#m))),g.on("click",_=>{this.dispatchEvent(new CustomEvent("dm-geojson:feature-click",{bubbles:!0,composed:!0,detail:{feature:v,layer:g,latlng:_.latlng}}))})}},m=e&&typeof e.getMaxZoom=="function"?n:e||n;if(this.cluster&&G.markerClusterGroup&&this.#L(h)){const v={type:"FeatureCollection",features:[]},g={type:"FeatureCollection",features:[]};for(const w of h.features||[])w.geometry?.type==="Point"||w.geometry?.type==="MultiPoint"?v.features.push(w):g.features.push(w);this.#h=this.#C(),this.#h.addTo(m);const _=[];G.geoJSON(v,u).eachLayer(w=>_.push(w)),this.#h.addLayers(_),g.features.length>0?(this.#e=G.geoJSON(g,u),this.#e.addTo(m)):this.#e=this.#h}else this.#e=G.geoJSON(h,u),this.#e.addTo(m);Ee(this,this.#e),this.dispatchEvent(new CustomEvent("dm-geojson:ready",{bubbles:!0,composed:!0,detail:{layer:this.#e,data:this.#i}}))}catch(a){this.dispatchEvent(new CustomEvent("dm-geojson:error",{bubbles:!0,composed:!0,detail:{error:a}}))}finally{s(),this.#c=null}}#M(e,n){const s=Me(e);return s?s==="EPSG:4326"?a=>G.latLng(a[1],a[0]):a=>{const[l,h]=Gi(a,s);return G.latLng(h,l)}:kn(n)?null:a=>G.latLng(a[1],a[0])}attributeChangedCallback(e,n,s){n===s||!this.#t||this.#O(e,s)}async#O(e,n){switch(e){case"src":case"crs":await this.#G();break;case"hidden":n!==null?this.hide():this.show();break;case"icon":case"icon-hover":case"icon-active":await this.#x(),await this.#G();break}}async#G(){this.#k(),this.#h&&this.#h!==this.#e&&this.#h.remove(),this.#h=null,this.#e&&(this.#e.remove(),this.#e=null),this.#i=null,this.#s=null,await this.#v(this.#n,this.#t)}async#T(e){if(!this.#e||!this.#i)return;if(this.#r){this.#k(),await this.#G();return}const n={coordsToLatLng:this.#M(this.crs,this.#i),style:()=>({...this.#m}),pointToLayer:(a,l)=>this.#g(a,l),onEachFeature:(a,l)=>{l.setStyle&&(l.on("mouseover",()=>l.setStyle(this.#_)),l.on("mouseout",()=>l.setStyle(l._dmActive?this.#_:this.#m))),l.on("click",h=>{this.dispatchEvent(new CustomEvent("dm-geojson:feature-click",{bubbles:!0,composed:!0,detail:{feature:a,layer:l,latlng:h.latlng}}))})}},s=!e||Object.keys(e).length===0?this.#i:{type:"FeatureCollection",features:Pe(this.#i.features,e)};if(this.#h){const a={type:"FeatureCollection",features:[]},l={type:"FeatureCollection",features:[]};for(const c of s.features||[])c.geometry?.type==="Point"||c.geometry?.type==="MultiPoint"?a.features.push(c):l.features.push(c);this.#h.clearLayers();const h=[];if(G.geoJSON(a,n).eachLayer(c=>h.push(c)),this.#h.addLayers(h),this.#e!==this.#h){this.#e.clearLayers();const c=[];G.geoJSON(l,n).eachLayer(u=>c.push(u)),c.forEach(u=>this.#e.addLayer(u))}}else{this.#e.clearLayers();const a=[];G.geoJSON(s,n).eachLayer(l=>a.push(l)),a.forEach(l=>this.#e.addLayer(l))}this.dispatchEvent(new CustomEvent("dm-geojson:updated",{bubbles:!0,composed:!0,detail:{layer:this.#e,data:s}}))}disconnectedCallback(){this.#k(),this.#a&&(this.removeEventListener("dm-filter:apply",this.#a),this.#a=null),this.#h&&this.#h!==this.#e&&this.#h.remove(),this.#h=null,this.#e&&(this.#e.remove(),this.#e=null),this.#t=null,this.#n=null,this.#i=null,this.#s=null,this.#o=null,this.#u=null}}customElements.define("dm-geojson",Bi);function gs(i,e){if(!e)return i;const n=encodeURIComponent(i);if(e.includes("{url}"))return e.replace("{url}",n);const s=e.slice(-1),a=s==="?"||s==="&"?"":e.includes("?")?"&":"?";return`${e}${a}url=${n}`}class mt extends HTMLElement{#t=null;#n=null;#e=null;#i=null;#a=null;#l=null;#r=null;#s={};#o=null;#h=!1;#d=null;#u=null;static#c={color:"#555",weight:2,dashArray:"6 4",fillColor:"#555",fillOpacity:.15,opacity:.8};static#f={dashArray:null,opacity:1};static get observedAttributes(){return["src","name","version","format","crs","max-features","proxy","label","hidden","filter-property","filter-label","filter-properties","filter-labels","infowindow-properties","infowindow-labels","streaming","batch-size","cache-ttl","bbox-filter"]}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e)}get name(){return this.getAttribute("name")}set name(e){this.setAttribute("name",e)}get version(){return this.getAttribute("version")||"1.1.0"}set version(e){this.setAttribute("version",e)}get format(){return this.getAttribute("format")||"application/json"}set format(e){this.setAttribute("format",e)}get crs(){return this.getAttribute("crs")}set crs(e){this.setAttribute("crs",e)}get proxy(){return this.getAttribute("proxy")}set proxy(e){this.setAttribute("proxy",e)}get wfsLayer(){return this.#e}get data(){return this.#i}get label(){return this.getAttribute("label")}set label(e){this.setAttribute("label",e)}get hidden(){return this.hasAttribute("hidden")}set hidden(e){e?this.setAttribute("hidden",""):this.removeAttribute("hidden")}get filterProperty(){return this.getAttribute("filter-property")}set filterProperty(e){this.setAttribute("filter-property",e)}get filterLabel(){return this.getAttribute("filter-label")}set filterLabel(e){this.setAttribute("filter-label",e)}get filterProperties(){return this.getAttribute("filter-properties")}set filterProperties(e){this.setAttribute("filter-properties",e)}get filterLabels(){return this.getAttribute("filter-labels")}set filterLabels(e){this.setAttribute("filter-labels",e)}get infowindowProperties(){return this.getAttribute("infowindow-properties")}set infowindowProperties(e){this.setAttribute("infowindow-properties",e)}get infowindowLabels(){return this.getAttribute("infowindow-labels")}set infowindowLabels(e){this.setAttribute("infowindow-labels",e)}get streaming(){return this.hasAttribute("streaming")}set streaming(e){e?this.setAttribute("streaming",""):this.removeAttribute("streaming")}get batchSize(){const e=parseInt(this.getAttribute("batch-size"));return isNaN(e)||e<1||e>1e4?100:e}set batchSize(e){this.setAttribute("batch-size",String(e))}get cluster(){return this.hasAttribute("cluster")}set cluster(e){e?this.setAttribute("cluster",""):this.removeAttribute("cluster")}get clusterMaxZoom(){const e=parseInt(this.getAttribute("cluster-max-zoom"));return isNaN(e)||e<0||e>22?null:e}set clusterMaxZoom(e){this.setAttribute("cluster-max-zoom",String(e))}get clusterRadius(){const e=parseInt(this.getAttribute("cluster-radius"));return isNaN(e)||e<=0?80:e}set clusterRadius(e){this.setAttribute("cluster-radius",String(e))}get cacheTtl(){const e=parseInt(this.getAttribute("cache-ttl"));return isNaN(e)?300:e}set cacheTtl(e){this.setAttribute("cache-ttl",String(e))}get bboxFilter(){return this.hasAttribute("bbox-filter")}set bboxFilter(e){e?this.setAttribute("bbox-filter",""):this.removeAttribute("bbox-filter")}get isStreaming(){return this.#h}get loadProgress(){return this.#d}show(){const e=this.#n||this.#t;ii(this,this.#e,e,"dm-wfs")}hide(){ni(this,this.#e,"dm-wfs")}toggle(){this.hidden?this.show():this.hide()}refresh(){return this.#v()}getFeatures(){return this.#i?[...this.#i.features||[]]:[]}cancelRequest(){this.#p()}connectedCallback(){const e=this.closest("dm-layer"),n=this.closest("dm-map");e?e.layerGroup?this.#S(e.layerGroup,n.map):e.addEventListener("dm-layer:ready",s=>{this.#S(s.detail.layerGroup,s.detail.map)},{once:!0}):n&&(n.map?this.#S(null,n.map):n.addEventListener("dm-map:ready",s=>{this.#S(null,s.detail.map)},{once:!0})),this.#a=this.#y.bind(this),this.addEventListener("dm-filter:apply",this.#a),this.addEventListener("dm-wfs:feature-click",s=>{const a=s.detail?.layer?.feature?s.detail.layer:this.#m(s.detail?.feature);this.#_(a)})}#m(e){if(!e)return null;let n=null;const s=a=>{a?.eachLayer?.(l=>{n||(l.feature===e?n=l:l.eachLayer&&s(l))})};return s(this.#e),n||s(this.#r),n}#_(e){!e||e===this.#l||(this.clearActiveFeature(),e.setIcon&&this.#s.active?(e._dmActive=!0,e.setIcon(this.#s.active),e.setZIndexOffset?.(1e3)):e.setStyle&&(e.setStyle(mt.#f),e.bringToFront?.()),this.#l=e)}clearActiveFeature(){const e=this.#l;e&&(e.setIcon?(e._dmActive=!1,e.setIcon(e._dmCustomIcon||this.#s.default),e.setZIndexOffset?.(0)):e.setStyle&&e.setStyle(mt.#c),this.#l=null)}#y(e){this.#u=e.detail.filters,this.#M(e.detail.filters)}#A(){const e=new URL(this.src,window.location.origin),n=e.searchParams,s=this.version;n.set("service","WFS"),n.set("version",s),n.set("request","GetFeature");const a=s==="2.0.0"?"typeNames":"typeName";n.set(a,this.name),n.set("outputFormat",this.format);const l=this.crs;l&&n.set("srsName",Me(l));const h=this.getAttribute("max-features");if(h){const u=s==="2.0.0"?"count":"maxFeatures";n.set(u,h)}const c=e.toString();return gs(c,this.proxy)}#p(){this.#o&&(this.#o.abort(),this.#o=null)}#b(e){return e?(e.features||(e.type==="Feature"?[e]:[])).some(s=>s.geometry?.type==="Point"||s.geometry?.type==="MultiPoint"):!1}#P(){const e={maxClusterRadius:this.clusterRadius,spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0},n=this.clusterMaxZoom;n!==null&&(e.disableClusteringAtZoom=n+1);const s=G.markerClusterGroup(e);return s.on("clusterclick",a=>{this.dispatchEvent(new CustomEvent("dm-wfs:cluster-click",{bubbles:!0,composed:!0,detail:{cluster:a.layer,latlng:a.latlng,childCount:a.layer.getChildCount()}}))}),s}#x(e){return e?e==="EPSG:4326"?n=>G.latLng(n[1],n[0]):n=>{const[s,a]=Gi(n,e);return G.latLng(a,s)}:n=>G.latLng(n[1],n[0])}#g(e,n){let s=Me(e);return s||(s=ls(n)),s?s==="EPSG:4326"?a=>G.latLng(a[1],a[0]):a=>{const[l,h]=Gi(a,s);return G.latLng(h,l)}:kn(n)?null:a=>G.latLng(a[1],a[0])}#C(e){return n=>{this.dispatchEvent(new CustomEvent("dm-wfs:feature-click",{bubbles:!0,composed:!0,detail:{feature:e,layer:n.target,latlng:n.latlng}}))}}async#L(e,n){return new Promise(s=>{requestAnimationFrame(()=>{const a={type:"FeatureCollection",features:e};G.geoJSON(a,{coordsToLatLng:n,style:()=>({...mt.#c}),onEachFeature:(l,h)=>{h.setStyle&&(h.on("mouseover",()=>h.setStyle(mt.#f)),h.on("mouseout",()=>h.setStyle(h._dmActive?mt.#f:mt.#c))),h.on("click",c=>{this.dispatchEvent(new CustomEvent("dm-wfs:feature-click",{bubbles:!0,composed:!0,detail:{feature:l,layer:h,latlng:c.latlng}}))}),this.#e.addLayer(h)}}),s()})})}async#w(){this.#h=!0,this.#d={loaded:0,total:null,percent:null,featuresRendered:0},this.#o=new AbortController,this.#e=G.geoJSON(null);const e=this.#n||this.#t;this.#e.addTo(e),this.#i={type:"FeatureCollection",features:[]};const n=this.#A();try{if(!Ln(n))throw new Error("Invalid URL: must be http or https");const s=await fetch(n);if(!s.ok)throw new Error(`HTTP ${s.status}: ${s.statusText}`);Cn(s);let a=Me(this.crs),l=s;if(!a){const u=await s.json();a=ls(u),l=new Response(JSON.stringify(u),{headers:s.headers})}const h=this.#x(a);if(!h){this.dispatchEvent(new CustomEvent("dm-wfs:error",{bubbles:!0,composed:!0,detail:{error:new Error("Could not determine coordinate system. Add a crs attribute.")}}));return}let c=!0;for await(const u of _s(l,{batchSize:this.batchSize,onProgress:m=>{this.#d=m,this.dispatchEvent(new CustomEvent("dm-wfs:progress",{bubbles:!0,composed:!0,detail:m}))},signal:this.#o.signal,crsTransformer:h})){this.#i.features.push(...u.features);const m=this.#u?Pe(u.features,this.#u):u.features;m.length>0&&(await this.#L(m,h),c&&(this.dispatchEvent(new CustomEvent("dm-wfs:first-feature",{bubbles:!0,composed:!0,detail:{feature:m[0],layer:this.#e}})),c=!1)),this.#d&&(this.#d.featuresRendered=this.#i.features.length)}this.#h=!1,Ee(this,this.#e),this.dispatchEvent(new CustomEvent("dm-wfs:ready",{bubbles:!0,composed:!0,detail:{layer:this.#e,data:this.#i}}))}catch(s){if(this.#h=!1,s.name==="AbortError")return;this.dispatchEvent(new CustomEvent("dm-wfs:error",{bubbles:!0,composed:!0,detail:{error:s}}))}}async#S(e,n){if(this.#t=n,this.#n=e,!this.src||!this.name)return;if(this.streaming){await this.#w();return}const s=this.#A();try{if(!Ln(s))throw new Error("Invalid URL: must be http or https");const a=await fetch(s);if(!a.ok)throw new Error(`HTTP ${a.status}: ${a.statusText}`);Cn(a);const l=await a.json();this.#i=l;const h=this.#g(this.crs,l);if(!h){this.dispatchEvent(new CustomEvent("dm-wfs:error",{bubbles:!0,composed:!0,detail:{error:new Error("Could not determine coordinate system. Add a crs attribute.")}}));return}const c=(m,v)=>{v.setStyle&&(v.on("mouseover",()=>v.setStyle(mt.#f)),v.on("mouseout",()=>v.setStyle(v._dmActive?mt.#f:mt.#c))),v.on("click",g=>{this.dispatchEvent(new CustomEvent("dm-wfs:feature-click",{bubbles:!0,composed:!0,detail:{feature:m,layer:v,latlng:g.latlng}}))})},u=e&&typeof e.getMaxZoom=="function"?n:e||n;if(this.cluster&&G.markerClusterGroup&&this.#b(l)){const m={type:"FeatureCollection",features:[]},v={type:"FeatureCollection",features:[]};for(const _ of l.features||[])_.geometry?.type==="Point"||_.geometry?.type==="MultiPoint"?m.features.push(_):v.features.push(_);this.#r=this.#P(),this.#r.addTo(u);const g=[];G.geoJSON(m,{coordsToLatLng:h,onEachFeature:c}).eachLayer(_=>g.push(_)),this.#r.addLayers(g),v.features.length>0?(this.#e=G.geoJSON(v,{coordsToLatLng:h,style:()=>({...mt.#c}),onEachFeature:c}),this.#e.addTo(u)):this.#e=this.#r}else this.#e=G.geoJSON(l,{coordsToLatLng:h,style:()=>({...mt.#c}),onEachFeature:c}),this.#e.addTo(u);Ee(this,this.#e),this.dispatchEvent(new CustomEvent("dm-wfs:ready",{bubbles:!0,composed:!0,detail:{layer:this.#e,data:this.#i}}))}catch(a){this.dispatchEvent(new CustomEvent("dm-wfs:error",{bubbles:!0,composed:!0,detail:{error:a}}))}}attributeChangedCallback(e,n,s){n===s||!this.#t||this.#k(e,s)}#k(e,n){switch(e){case"src":case"name":case"version":case"format":case"crs":case"max-features":case"proxy":this.#v();break;case"hidden":n!==null?this.hide():this.show();break}}async#v(){this.#p(),this.#r&&this.#r!==this.#e&&this.#r.remove(),this.#r=null,this.#e&&(this.#e.remove(),this.#e=null),this.#i=null,this.#d=null,await this.#S(this.#n,this.#t)}async#M(e){if(!this.#e||!this.#i)return;if(this.#h){this.#p(),await this.#v();return}const n=this.#g(this.crs,this.#i),s=(h,c)=>{c.setStyle&&(c.on("mouseover",()=>c.setStyle(mt.#f)),c.on("mouseout",()=>c.setStyle(c._dmActive?mt.#f:mt.#c))),c.on("click",u=>{this.dispatchEvent(new CustomEvent("dm-wfs:feature-click",{bubbles:!0,composed:!0,detail:{feature:h,layer:c,latlng:u.latlng}}))})},a=()=>({...mt.#c});if(!e||Object.keys(e).length===0){this.#e.clearLayers(),G.geoJSON(this.#i,{coordsToLatLng:n,style:a,onEachFeature:s}).eachLayer(h=>this.#e.addLayer(h));return}this.#e.clearLayers();const l={type:"FeatureCollection",features:Pe(this.#i.features,e)};G.geoJSON(l,{coordsToLatLng:n,style:a,onEachFeature:s}).eachLayer(h=>this.#e.addLayer(h))}disconnectedCallback(){this.#p(),this.#a&&(this.removeEventListener("dm-filter:apply",this.#a),this.#a=null),this.#r&&this.#r!==this.#e&&this.#r.remove(),this.#r=null,this.#e&&(this.#e.remove(),this.#e=null),this.#t=null,this.#n=null,this.#i=null,this.#d=null,this.#u=null}}customElements.define("dm-wfs",mt);class Qd extends HTMLElement{#t=null;#n=null;#e=null;static get observedAttributes(){return["src","layers","version","format","transparent","styles","crs","proxy","opacity","min-zoom","max-zoom","label","hidden","time"]}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e)}get layers(){return this.getAttribute("layers")}set layers(e){this.setAttribute("layers",e)}get version(){return this.getAttribute("version")||"1.1.1"}set version(e){this.setAttribute("version",e)}get format(){return this.getAttribute("format")||"image/png"}set format(e){this.setAttribute("format",e)}get transparent(){const e=this.getAttribute("transparent");return e===null||e==="true"}set transparent(e){this.setAttribute("transparent",String(e))}get styles(){return this.getAttribute("styles")||""}set styles(e){this.setAttribute("styles",e)}get crs(){return this.getAttribute("crs")}set crs(e){this.setAttribute("crs",e)}get proxy(){return this.getAttribute("proxy")}set proxy(e){this.setAttribute("proxy",e)}get opacity(){const e=this.getAttribute("opacity");return e?parseFloat(e):1}set opacity(e){this.setAttribute("opacity",String(e))}get time(){return this.getAttribute("time")}set time(e){this.setAttribute("time",e)}get wmsLayer(){return this.#e}get label(){return this.getAttribute("label")}set label(e){this.setAttribute("label",e)}setOpacity(e){this.#e&&this.#e.setOpacity(e),this.setAttribute("opacity",String(e))}setTime(e){const n=this.time;this.setAttribute("time",e),this.refresh(),this.dispatchEvent(new CustomEvent("dm-wms:time-change",{bubbles:!0,composed:!0,detail:{time:e,previousTime:n}}))}refresh(){this.#e&&(this.#e.remove(),this.#e=null),this.#i(this.#n,this.#t)}show(){const e=this.#n||this.#t;this.removeAttribute("hidden"),ii(this,this.#e,e,"dm-wms")}hide(){this.setAttribute("hidden",""),ni(this,this.#e,"dm-wms")}toggle(){this.hidden?this.show():this.hide()}connectedCallback(){const e=this.closest("dm-layer"),n=this.closest("dm-map");e?e.layerGroup?this.#i(e.layerGroup,n.map):e.addEventListener("dm-layer:ready",s=>{this.#i(s.detail.layerGroup,s.detail.map)},{once:!0}):n&&(n.map?this.#i(null,n.map):n.addEventListener("dm-map:ready",s=>{this.#i(null,s.detail.map)},{once:!0}))}#i(e,n){if(this.#t=n,this.#n=e,!this.src){this.#r(new Error("dm-wms requires a src attribute"));return}if(!this.layers){this.#r(new Error("dm-wms requires a layers attribute"));return}try{const s=this.#a(),a=this.#l();this.#e=G.tileLayer.wms(s,a),e?this.#e.addTo(e):this.#e.addTo(n),Ee(this,this.#e),this.dispatchEvent(new CustomEvent("dm-wms:ready",{bubbles:!0,composed:!0,detail:{layer:this.#e}}))}catch(s){this.#r(s)}}#a(){let e=this.src;return e=e.replace(/\?+$/,""),gs(e,this.proxy)}#l(){const e={layers:this.layers,format:this.format,transparent:this.transparent,version:this.version,styles:this.styles,opacity:this.opacity,attribution:'© Kadaster'},n=this.crs;n&&(e.crs=Me(n));const s=this.getAttribute("min-zoom"),a=this.getAttribute("max-zoom");s&&(e.minZoom=parseInt(s,10)),a&&(e.maxZoom=parseInt(a,10));const l=this.time;return l&&(e.TIME=l),e}#r(e){this.dispatchEvent(new CustomEvent("dm-wms:error",{bubbles:!0,composed:!0,detail:{error:e}}))}attributeChangedCallback(e,n,s){if(!(n===s||!this.#e))switch(e){case"opacity":{const a=parseFloat(s);isNaN(a)||this.#e.setOpacity(a);break}case"hidden":this.hasAttribute("hidden")?this.hide():this.show();break;case"time":this.#s();break;case"src":case"layers":case"version":case"format":case"transparent":case"styles":case"crs":case"proxy":case"min-zoom":case"max-zoom":this.#s();break}}#s(){this.#e&&(this.#e.remove(),this.#e=null),this.#i(this.#n,this.#t)}disconnectedCallback(){this.#e&&(this.#e.remove(),this.#e=null),this.#t=null,this.#n=null}}customElements.define("dm-wms",Qd);const Yd=`:host { display: block; inline-size: var(--draad-map-components-search-width, 296px); align-self: flex-end; @@ -1468,17 +1470,17 @@ svg.leaflet-image-layer.leaflet-interactive path {\r .search__listbox::-webkit-scrollbar-thumb:hover { background: #a3a3a3; } -`;class tu extends HTMLElement{#t;#n=null;#e;#i=null;#a=null;#s=null;#o=-1;#r=[];#l=null;#h;#u;static get observedAttributes(){return["placeholder","label","search-properties","search-labels","radius","min-chars","debounce","address-filter"]}attributeChangedCallback(e,n,s){n!==s&&this.#n&&(this.#f(),Ut(this.#t),this.#_())}constructor(){super(),this.#t=this.attachShadow({mode:"open"}),this.#h=`search-input-${Math.random().toString(36).slice(2,9)}`,this.#u=`search-listbox-${Math.random().toString(36).slice(2,9)}`,this.#e=this.#d()}#d(){const e=new CSSStyleSheet;e.replaceSync(Yd),this.#t.adoptedStyleSheets=[e]}get placeholder(){return this.getAttribute("placeholder")||"Zoeken..."}set placeholder(e){this.setAttribute("placeholder",e)}get label(){return this.getAttribute("label")||"Zoek op straat, wijk of stadsdeel"}set label(e){this.setAttribute("label",e)}get searchProperties(){const e=this.getAttribute("search-properties");return e?e.split(",").map(n=>n.trim()).filter(n=>n):null}set searchProperties(e){Array.isArray(e)?this.setAttribute("search-properties",e.join(",")):this.setAttribute("search-properties",e)}get searchLabels(){const e=this.getAttribute("search-labels");return e?e.split(",").map(n=>n.trim()).filter(n=>n):null}set searchLabels(e){Array.isArray(e)?this.setAttribute("search-labels",e.join(",")):this.setAttribute("search-labels",e)}get radius(){const e=this.getAttribute("radius"),n=parseInt(e,10);return Number.isFinite(n)&&n>0?n:1e4}set radius(e){this.setAttribute("radius",String(e))}get minChars(){const e=this.getAttribute("min-chars"),n=parseInt(e,10);return Number.isFinite(n)&&n>=0?n:2}set minChars(e){this.setAttribute("min-chars",String(e))}get debounceDelay(){const e=this.getAttribute("debounce"),n=parseInt(e,10);return Number.isFinite(n)&&n>=0?n:300}set debounceDelay(e){this.setAttribute("debounce",String(e))}get addressFilter(){const e=this.getAttribute("address-filter");return e&&e.trim()?e.trim():null}set addressFilter(e){this.setAttribute("address-filter",e)}connectedCallback(){const e=this.closest("dm-map");e&&(e.map?this.#c(e):e.addEventListener("dm-map:ready",()=>{this.#c(e)},{once:!0}))}async#c(e){this.#n=e,await this.#e,this.#f(),Ut(this.#t),this.#_()}#f(){this.#t.innerHTML=` +`;class tu extends HTMLElement{#t;#n=null;#e;#i=null;#a=null;#l=null;#r=-1;#s=[];#o=null;#h=null;#d;#u;static get observedAttributes(){return["placeholder","label","search-properties","search-labels","radius","min-chars","debounce","address-filter"]}attributeChangedCallback(e,n,s){n!==s&&this.#n&&(this.#m(),Ut(this.#t),this.#_())}constructor(){super(),this.#t=this.attachShadow({mode:"open"}),this.#d=`search-input-${Math.random().toString(36).slice(2,9)}`,this.#u=`search-listbox-${Math.random().toString(36).slice(2,9)}`,this.#e=this.#c()}#c(){const e=new CSSStyleSheet;e.replaceSync(Yd),this.#t.adoptedStyleSheets=[e]}get placeholder(){return this.getAttribute("placeholder")||"Zoeken..."}set placeholder(e){this.setAttribute("placeholder",e)}get label(){return this.getAttribute("label")||"Zoek op straat, wijk of stadsdeel"}set label(e){this.setAttribute("label",e)}get searchProperties(){const e=this.getAttribute("search-properties");return e?e.split(",").map(n=>n.trim()).filter(n=>n):null}set searchProperties(e){Array.isArray(e)?this.setAttribute("search-properties",e.join(",")):this.setAttribute("search-properties",e)}get searchLabels(){const e=this.getAttribute("search-labels");return e?e.split(",").map(n=>n.trim()).filter(n=>n):null}set searchLabels(e){Array.isArray(e)?this.setAttribute("search-labels",e.join(",")):this.setAttribute("search-labels",e)}get radius(){const e=this.getAttribute("radius"),n=parseInt(e,10);return Number.isFinite(n)&&n>0?n:1e4}set radius(e){this.setAttribute("radius",String(e))}get minChars(){const e=this.getAttribute("min-chars"),n=parseInt(e,10);return Number.isFinite(n)&&n>=0?n:2}set minChars(e){this.setAttribute("min-chars",String(e))}get debounceDelay(){const e=this.getAttribute("debounce"),n=parseInt(e,10);return Number.isFinite(n)&&n>=0?n:300}set debounceDelay(e){this.setAttribute("debounce",String(e))}get addressFilter(){const e=this.getAttribute("address-filter");return e&&e.trim()?e.trim():null}set addressFilter(e){this.setAttribute("address-filter",e)}connectedCallback(){const e=this.closest("dm-map");e&&(e.map?this.#f(e):e.addEventListener("dm-map:ready",()=>{this.#f(e)},{once:!0}))}async#f(e){this.#n=e,await this.#e,this.#m(),Ut(this.#t),this.#_()}#m(){this.#t.innerHTML=` - `,this.#t.querySelector(".infowindow__close").addEventListener("click",()=>this.close())}#y(){const e=this.for;e&&(this.#e=document.getElementById(e),this.#e?this.#p():this.#A(e))}#A(e){this.#r&&this.#r.disconnect(),this.#r=new MutationObserver((n,s)=>{const a=document.getElementById(e);a&&(this.#e=a,this.#p(),s.disconnect(),this.#r=null)}),this.#r.observe(this.#n,{childList:!0,subtree:!0})}#p(){const e=this.trigger,n=this.#e.tagName.toLowerCase();n==="dm-marker"?this.#L(e):(n==="dm-geojson"||n==="dm-wfs")&&this.#M(e,n)}#g(){if(this.#e&&(this.#i&&(this.#e.removeEventListener("dm-marker:click",this.#i),this.#i=null),this.#a)){const e=this.#e.tagName.toLowerCase().replace("dm-","");this.#e.removeEventListener(`dm-${e}:feature-click`,this.#a),this.#a=null}}#L(e){e==="click"&&(this.#i=n=>this.#w(n),this.#e.addEventListener("dm-marker:click",this.#i))}#M(e,n){const a=`dm-${n.replace("dm-","")}:feature-click`;e==="click"&&(this.#a=l=>this.#b(l),this.#e.addEventListener(a,this.#a))}#w(e){if(this.#h=null,this.isOpen)this.close();else{const n=this.#m();this.#N(n),this.open()}}#b(e){const{feature:n}=e.detail;if(!this.#S(n))return;this.#h=n;const s=this.#E(n);this.#N(s),this.#q(this,n),this.open()}#S(e){const n=this.featureId;return!n||n==="*"||e.id!==void 0&&String(e.id)===n||e.properties?.id!==void 0&&String(e.properties.id)===n}#m(){const e=document.createElement("div"),n=this.querySelector("template");if(n)e.appendChild(n.content.cloneNode(!0));else for(const s of this.childNodes)s.nodeType===Node.ELEMENT_NODE&&s.hasAttribute("slot")||e.appendChild(s.cloneNode(!0));return this.#P(e),e}#E(e){const n=document.createElement("div"),s=this.querySelector("template");if(s){const a=s.content.cloneNode(!0);n.appendChild(a),this.#q(n,e),this.#j(n)}else if(this.#e&&this.#z()){const a=this.#C(e);a&&n.appendChild(a)}else for(const a of this.childNodes)a.nodeType===Node.ELEMENT_NODE&&a.hasAttribute("slot")||n.appendChild(a.cloneNode(!0));return this.#P(n),n}#z(){return this.#e?.getAttribute("infowindow-properties")}#P(e){const n=a=>{const l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("aria-hidden","true");const h=document.createElementNS("http://www.w3.org/2000/svg","use");return h.setAttribute("href",`#${a}`),l.appendChild(h),l},s=a=>{const l=a.getAttribute("href");if(!l)return!1;try{return new URL(l,window.location.href).origin!==window.location.origin}catch{return!1}};e.querySelectorAll(".address, address").forEach(a=>{a.setAttribute("part","address"),a.prepend(n("icon-map-pin"))}),e.querySelectorAll(".action, a.button, button.action").forEach(a=>{a.setAttribute("part","action"),s(a)&&a.prepend(n("icon-external-link"))})}#C(e){const n=this.#e.getAttribute("infowindow-properties"),s=this.#e.getAttribute("infowindow-labels");if(!n)return null;const a=n.split(",").map(c=>c.trim()),l=s?s.split(",").map(c=>c.trim()):a,h=document.createElement("dl");h.className="dm-infowindow-data",h.setAttribute("part","data-table");for(let c=0;c0?h:null}#q(e,n){const s=new Set(["https:","http:","mailto:","tel:"]),a=(l,h)=>{l.style.display=h?"":"none"};e.querySelectorAll("[data-field]").forEach(l=>{const h=this.#I(n,l.getAttribute("data-field")),c=h!=null?String(h):"";l.textContent=c,a(l,c!=="")}),e.querySelectorAll("[data-href]").forEach(l=>{const h=this.#I(n,l.getAttribute("data-href"));let c=!1;if(h!=null)try{const u=new URL(String(h),window.location.origin);s.has(u.protocol)?(l.setAttribute("href",String(h)),c=!0):l.removeAttribute("href")}catch{l.removeAttribute("href")}else l.removeAttribute("href");a(l,c)}),e.querySelectorAll("[data-src]").forEach(l=>{const h=this.#I(n,l.getAttribute("data-src"));let c=!1;if(h!=null)try{const u=new URL(String(h),window.location.origin);u.protocol==="https:"||u.protocol==="http:"?(l.setAttribute("src",String(h)),c=!0):l.removeAttribute("src")}catch{l.removeAttribute("src")}else l.removeAttribute("src");a(l,c)})}#j(e){e.querySelectorAll("dl.dm-infowindow-data").forEach(n=>{const s=Array.from(n.children);let a=!1;s.forEach((l,h)=>{if(l.tagName!=="DD")return;if(l.style.display==="none"||l.textContent===""){l.style.display="none";const u=s[h-1];u&&u.tagName==="DT"&&(u.style.display="none")}else a=!0}),a||(n.style.display="none")})}#I(e,n){if(!n.startsWith("properties.")&&n!=="id"&&n!=="properties")return;const s=new Set(["__proto__","constructor","prototype"]),a=n.split(".");let l=e;for(const h of a){if(l==null||s.has(h)||!Object.prototype.hasOwnProperty.call(l,h))return;l=l[h]}return l}#N(e){const n=this.#t.querySelector(".infowindow__content");for(n.innerHTML="";e.firstChild;)n.appendChild(e.firstChild);n.querySelectorAll("a").forEach(s=>s.setAttribute("part","link"))}open(){this.#t.querySelector(".infowindow").removeAttribute("hidden"),this.removeAttribute("hidden"),this.#u=!0,this.#W(),this.dispatchEvent(new CustomEvent("dm-infowindow:open",{bubbles:!0,composed:!0,detail:{target:this.#e,feature:this.#h}}))}close(){this.#t.querySelector(".infowindow").setAttribute("hidden",""),this.setAttribute("hidden",""),this.#u=!1,this.#o&&(document.removeEventListener("keydown",this.#o),this.#o=null),this.#e?.tagName.toLowerCase()==="dm-marker"&&(this.#e.active=!1),this.#l&&typeof this.#l.focus=="function"&&this.#l.focus(),this.#l=null,this.dispatchEvent(new CustomEvent("dm-infowindow:close",{bubbles:!0,composed:!0,detail:{target:this.#e}}))}toggle(){this.isOpen?this.close():this.open()}#W(){const e=this.#t.querySelector(".infowindow");this.#l=document.activeElement,e.setAttribute("tabindex","-1"),e.focus(),this.#o=n=>{n.key==="Escape"&&this.isOpen&&this.close()},document.addEventListener("keydown",this.#o)}attributeChangedCallback(e,n,s){if(!(n===s||!this.#n))switch(e){case"for":this.#g(),this.#e=null,this.#y();break;case"trigger":this.#g(),this.#e&&this.#p();break}}disconnectedCallback(){this.#g(),this.#s&&(this.#n?.removeEventListener("dm-infowindow:open",this.#s),this.#s=null),this.#o&&(document.removeEventListener("keydown",this.#o),this.#o=null),this.#r&&(this.#r.disconnect(),this.#r=null),this.#n=null,this.#e=null,this.#l=null,this.#h=null}}customElements.define("dm-infowindow",iu);const nu=`.icon { + `,this.#t.querySelector(".infowindow__close").addEventListener("click",()=>this.close())}#y(){const e=this.for;e&&(this.#e=document.getElementById(e),this.#e?this.#p():this.#A(e))}#A(e){this.#s&&this.#s.disconnect(),this.#s=new MutationObserver((n,s)=>{const a=document.getElementById(e);a&&(this.#e=a,this.#p(),s.disconnect(),this.#s=null)}),this.#s.observe(this.#n,{childList:!0,subtree:!0})}#p(){const e=this.trigger,n=this.#e.tagName.toLowerCase();n==="dm-marker"?this.#P(e):(n==="dm-geojson"||n==="dm-wfs")&&this.#x(e,n)}#b(){if(this.#e&&(this.#i&&(this.#e.removeEventListener("dm-marker:click",this.#i),this.#i=null),this.#a)){const e=this.#e.tagName.toLowerCase().replace("dm-","");this.#e.removeEventListener(`dm-${e}:feature-click`,this.#a),this.#a=null}}#P(e){e==="click"&&(this.#i=n=>this.#g(n),this.#e.addEventListener("dm-marker:click",this.#i))}#x(e,n){const a=`dm-${n.replace("dm-","")}:feature-click`;e==="click"&&(this.#a=l=>this.#C(l),this.#e.addEventListener(a,this.#a))}#g(e){if(this.#h=null,this.isOpen)this.close();else{const n=this.#w();this.#q(n),this.open()}}#C(e){const{feature:n}=e.detail;if(!this.#L(n))return;this.#h=n;const s=this.#S(n);this.#q(s),this.#O(this,n),this.open()}#L(e){const n=this.featureId;return!n||n==="*"||e.id!==void 0&&String(e.id)===n||e.properties?.id!==void 0&&String(e.properties.id)===n}#w(){const e=document.createElement("div"),n=this.querySelector("template");if(n)e.appendChild(n.content.cloneNode(!0));else for(const s of this.childNodes)s.nodeType===Node.ELEMENT_NODE&&s.hasAttribute("slot")||e.appendChild(s.cloneNode(!0));return this.#v(e),e}#S(e){const n=document.createElement("div"),s=this.querySelector("template");if(s){const a=s.content.cloneNode(!0);n.appendChild(a),this.#O(n,e),this.#G(n)}else if(this.#e&&this.#k()){const a=this.#M(e);a&&n.appendChild(a)}else for(const a of this.childNodes)a.nodeType===Node.ELEMENT_NODE&&a.hasAttribute("slot")||n.appendChild(a.cloneNode(!0));return this.#v(n),n}#k(){return this.#e?.getAttribute("infowindow-properties")}#v(e){const n=a=>{const l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("aria-hidden","true");const h=document.createElementNS("http://www.w3.org/2000/svg","use");return h.setAttribute("href",`#${a}`),l.appendChild(h),l},s=a=>{const l=a.getAttribute("href");if(!l)return!1;try{return new URL(l,window.location.href).origin!==window.location.origin}catch{return!1}};e.querySelectorAll(".address, address").forEach(a=>{a.setAttribute("part","address"),a.prepend(n("icon-map-pin"))}),e.querySelectorAll(".action, a.button, button.action").forEach(a=>{a.setAttribute("part","action"),s(a)&&a.prepend(n("icon-external-link"))})}#M(e){const n=this.#e.getAttribute("infowindow-properties"),s=this.#e.getAttribute("infowindow-labels");if(!n)return null;const a=n.split(",").map(c=>c.trim()),l=s?s.split(",").map(c=>c.trim()):a,h=document.createElement("dl");h.className="dm-infowindow-data",h.setAttribute("part","data-table");for(let c=0;c0?h:null}#O(e,n){const s=new Set(["https:","http:","mailto:","tel:"]),a=(l,h)=>{l.style.display=h?"":"none"};e.querySelectorAll("[data-field]").forEach(l=>{const h=this.#T(n,l.getAttribute("data-field")),c=h!=null?String(h):"";l.textContent=c,a(l,c!=="")}),e.querySelectorAll("[data-href]").forEach(l=>{const h=this.#T(n,l.getAttribute("data-href"));let c=!1;if(h!=null)try{const u=new URL(String(h),window.location.origin);s.has(u.protocol)?(l.setAttribute("href",String(h)),c=!0):l.removeAttribute("href")}catch{l.removeAttribute("href")}else l.removeAttribute("href");a(l,c)}),e.querySelectorAll("[data-src]").forEach(l=>{const h=this.#T(n,l.getAttribute("data-src"));let c=!1;if(h!=null)try{const u=new URL(String(h),window.location.origin);u.protocol==="https:"||u.protocol==="http:"?(l.setAttribute("src",String(h)),c=!0):l.removeAttribute("src")}catch{l.removeAttribute("src")}else l.removeAttribute("src");a(l,c)})}#G(e){e.querySelectorAll("dl.dm-infowindow-data").forEach(n=>{const s=Array.from(n.children);let a=!1;s.forEach((l,h)=>{if(l.tagName!=="DD")return;if(l.style.display==="none"||l.textContent===""){l.style.display="none";const u=s[h-1];u&&u.tagName==="DT"&&(u.style.display="none")}else a=!0}),a||(n.style.display="none")})}#T(e,n){if(!n.startsWith("properties.")&&n!=="id"&&n!=="properties")return;const s=new Set(["__proto__","constructor","prototype"]),a=n.split(".");let l=e;for(const h of a){if(l==null||s.has(h)||!Object.prototype.hasOwnProperty.call(l,h))return;l=l[h]}return l}#q(e){const n=this.#t.querySelector(".infowindow__content");for(n.innerHTML="";e.firstChild;)n.appendChild(e.firstChild);n.querySelectorAll("a").forEach(s=>s.setAttribute("part","link"))}open(){this.#t.querySelector(".infowindow").removeAttribute("hidden"),this.removeAttribute("hidden"),this.#d=!0,this.#j(),this.dispatchEvent(new CustomEvent("dm-infowindow:open",{bubbles:!0,composed:!0,detail:{target:this.#e,feature:this.#h}}))}close(){this.#t.querySelector(".infowindow").setAttribute("hidden",""),this.setAttribute("hidden",""),this.#d=!1,this.#r&&(document.removeEventListener("keydown",this.#r),this.#r=null),this.#e?.tagName.toLowerCase()==="dm-marker"&&(this.#e.active=!1),this.#o&&typeof this.#o.focus=="function"&&this.#o.focus(),this.#o=null,this.dispatchEvent(new CustomEvent("dm-infowindow:close",{bubbles:!0,composed:!0,detail:{target:this.#e}}))}toggle(){this.isOpen?this.close():this.open()}#j(){const e=this.#t.querySelector(".infowindow");this.#o=document.activeElement,e.setAttribute("tabindex","-1"),e.focus(),this.#r=n=>{n.key==="Escape"&&this.isOpen&&this.close()},document.addEventListener("keydown",this.#r)}attributeChangedCallback(e,n,s){if(!(n===s||!this.#n))switch(e){case"for":this.#b(),this.#e=null,this.#y();break;case"trigger":this.#b(),this.#e&&this.#p();break}}disconnectedCallback(){this.#b(),this.#l&&(this.#n?.removeEventListener("dm-infowindow:open",this.#l),this.#l=null),this.#r&&(document.removeEventListener("keydown",this.#r),this.#r=null),this.#s&&(this.#s.disconnect(),this.#s=null),this.#n=null,this.#e=null,this.#o=null,this.#h=null}}customElements.define("dm-infowindow",iu);const nu=`.icon { display: block; inline-size: 1em; block-size: 1em; @@ -2074,7 +2076,7 @@ svg.leaflet-image-layer.leaflet-interactive path {\r .legend__item-description p { margin: 0; -}`;class ru extends HTMLElement{#t;#n=!1;#e=[];#i=new Set;#a;constructor(){super(),this.#t=this.attachShadow({mode:"open"}),this.#a=this.#s()}#s(){const e=new CSSStyleSheet;e.replaceSync(nu),this.#t.adoptedStyleSheets=[e]}connectedCallback(){const e=this.closest("dm-map");e&&(e.map?this.#o(e):e.addEventListener("dm-map:ready",()=>{this.#o(e)},{once:!0}))}async#o(e){await this.#a,this.#e=this.#l(e),this.#u(),Ut(this.#t),this.#d()}#r(e){const n=document.createElement("div");return n.textContent=e,n.innerHTML}#l(e){const n=[];return e.querySelectorAll(":scope > dm-layer[label]").forEach(l=>{n.push({element:l,label:l.label,type:"layer",layerType:this.#h(l),description:l.getAttribute("description")})}),[":scope > dm-marker[label]",":scope > dm-geojson[label]",":scope > dm-wfs[label]",":scope > dm-wms[label]"].forEach(l=>{e.querySelectorAll(l).forEach(c=>{const u=c.tagName.toLowerCase().replace("dm-","");n.push({element:c,label:c.label,type:u,layerType:this.#h(c),description:c.getAttribute("description")})})}),n}#h(e){const n=e.tagName.toLowerCase();if(n==="dm-marker")return"point";if(n==="dm-wms")return"raster";const s=e.getAttribute("geometry-type");if(s){if(s.toLowerCase().includes("point")||s.toLowerCase().includes("marker"))return"point";if(s.toLowerCase().includes("line"))return"polygon"}return"polygon"}#u(){const e=s=>s==="point"?'':s==="raster"?'':"",n=this.#e.map((s,a)=>{const l=s.element.hidden?"":"checked",h=this.#r(s.label),c=s.description?this.#r(s.description):"",u=!!s.description,m=this.#i.has(a),v=`legend-layer-${a}`;return` +}`;class ru extends HTMLElement{#t;#n=!1;#e=[];#i=new Set;#a;constructor(){super(),this.#t=this.attachShadow({mode:"open"}),this.#a=this.#l()}#l(){const e=new CSSStyleSheet;e.replaceSync(nu),this.#t.adoptedStyleSheets=[e]}connectedCallback(){const e=this.closest("dm-map");e&&(e.map?this.#r(e):e.addEventListener("dm-map:ready",()=>{this.#r(e)},{once:!0}))}async#r(e){await this.#a,this.#e=this.#o(e),this.#d(),Ut(this.#t),this.#u()}#s(e){const n=document.createElement("div");return n.textContent=e,n.innerHTML}#o(e){const n=[];return e.querySelectorAll(":scope > dm-layer[label]").forEach(l=>{n.push({element:l,label:l.label,type:"layer",layerType:this.#h(l),description:l.getAttribute("description")})}),[":scope > dm-marker[label]",":scope > dm-geojson[label]",":scope > dm-wfs[label]",":scope > dm-wms[label]"].forEach(l=>{e.querySelectorAll(l).forEach(c=>{const u=c.tagName.toLowerCase().replace("dm-","");n.push({element:c,label:c.label,type:u,layerType:this.#h(c),description:c.getAttribute("description")})})}),n}#h(e){const n=e.tagName.toLowerCase();if(n==="dm-marker")return"point";if(n==="dm-wms")return"raster";const s=e.getAttribute("geometry-type");if(s){if(s.toLowerCase().includes("point")||s.toLowerCase().includes("marker"))return"point";if(s.toLowerCase().includes("line"))return"polygon"}return"polygon"}#d(){const e=s=>s==="point"?'':s==="raster"?'':"",n=this.#e.map((s,a)=>{const l=s.element.hidden?"":"checked",h=this.#s(s.label),c=s.description?this.#s(s.description):"",u=!!s.description,m=this.#i.has(a),v=`legend-layer-${a}`;return`
  • @@ -2120,7 +2122,7 @@ svg.leaflet-image-layer.leaflet-interactive path {\r
    - `}#d(){this.#t.querySelector(".legend__toggle").addEventListener("click",()=>this.#f()),this.#t.querySelectorAll('input[type="checkbox"]').forEach(a=>{a.addEventListener("change",l=>{const h=parseInt(l.target.dataset.index,10),c=this.#e[h];l.target.checked?c.element.show():c.element.hide()})}),this.#t.querySelectorAll(".legend__item-toggle").forEach(a=>{a.addEventListener("click",l=>{const h=parseInt(l.currentTarget.dataset.index,10);this.#c(h)})}),this.#e.forEach((a,l)=>{const h=a.type==="layer"?"dm-layer":`dm-${a.type}`;a.element.addEventListener(`${h}:show`,()=>{const c=this.#t.querySelector(`input[data-index="${l}"]`);c&&(c.checked=!0)}),a.element.addEventListener(`${h}:hide`,()=>{const c=this.#t.querySelector(`input[data-index="${l}"]`);c&&(c.checked=!1)})})}#c(e){this.#i.has(e)?this.#i.delete(e):this.#i.add(e);const n=this.#t.querySelector(`.legend__item-toggle[data-index="${e}"]`),s=this.#t.querySelector(`#desc-${e}`);if(n&&s){const a=this.#i.has(e);n.setAttribute("aria-expanded",String(a)),a?s.removeAttribute("hidden"):s.setAttribute("hidden","")}}#f(){this.#n=!this.#n;const e=this.#t.querySelector(".legend__toggle"),n=this.#t.querySelector(".legend__content");e.setAttribute("aria-expanded",String(this.#n)),this.#n?n.removeAttribute("hidden"):n.setAttribute("hidden","")}disconnectedCallback(){this.#e=[],this.#i.clear()}}customElements.define("dm-legend",ru);const su=`/* ============================================ + `}#u(){this.#t.querySelector(".legend__toggle").addEventListener("click",()=>this.#f()),this.#t.querySelectorAll('input[type="checkbox"]').forEach(a=>{a.addEventListener("change",l=>{const h=parseInt(l.target.dataset.index,10),c=this.#e[h];l.target.checked?c.element.show():c.element.hide()})}),this.#t.querySelectorAll(".legend__item-toggle").forEach(a=>{a.addEventListener("click",l=>{const h=parseInt(l.currentTarget.dataset.index,10);this.#c(h)})}),this.#e.forEach((a,l)=>{const h=a.type==="layer"?"dm-layer":`dm-${a.type}`;a.element.addEventListener(`${h}:show`,()=>{const c=this.#t.querySelector(`input[data-index="${l}"]`);c&&(c.checked=!0)}),a.element.addEventListener(`${h}:hide`,()=>{const c=this.#t.querySelector(`input[data-index="${l}"]`);c&&(c.checked=!1)})})}#c(e){this.#i.has(e)?this.#i.delete(e):this.#i.add(e);const n=this.#t.querySelector(`.legend__item-toggle[data-index="${e}"]`),s=this.#t.querySelector(`#desc-${e}`);if(n&&s){const a=this.#i.has(e);n.setAttribute("aria-expanded",String(a)),a?s.removeAttribute("hidden"):s.setAttribute("hidden","")}}#f(){this.#n=!this.#n;const e=this.#t.querySelector(".legend__toggle"),n=this.#t.querySelector(".legend__content");e.setAttribute("aria-expanded",String(this.#n)),this.#n?n.removeAttribute("hidden"):n.setAttribute("hidden","")}disconnectedCallback(){this.#e=[],this.#i.clear()}}customElements.define("dm-legend",ru);const su=`/* ============================================ dm-list panel styles (injected into dm-map via slot) Loaded as Ef in the bundle (shadow DOM stylesheet) ============================================ */ @@ -2507,11 +2509,11 @@ svg.leaflet-image-layer.leaflet-interactive path {\r font-size: 1.125rem; color: currentColor; } -`,au=new Set(["http:","https:","mailto:","tel:"]),ou=new Set(["__proto__","constructor","prototype"]);class lu extends HTMLElement{#t;#n=[];#e=new Map;#i=null;#a=null;#s=!1;#o;#r=null;#l=null;#h=new Map;#u=new Map;#d=null;#c=1;constructor(){super(),this.#t=this.attachShadow({mode:"open"}),this.#o=this.#f()}#f(){const e=new CSSStyleSheet;e.replaceSync(ms),this.#t.adoptedStyleSheets=[e],this.#l=new CSSStyleSheet,this.#l.replaceSync(su)}static get observedAttributes(){return["for","label","columns","per-page","prev-label","next-label","page-label"]}attributeChangedCallback(e){this.#s&&(e==="per-page"&&(this.#c=1),this.#w())}get for(){return this.getAttribute("for")}get label(){return this.getAttribute("label")||"Lijst bekijken"}get shortLabel(){return this.getAttribute("short-label")||"Lijst"}get columns(){const e=parseInt(this.getAttribute("columns"),10);return e>=1&&e<=4?e:3}get perPage(){const e=parseInt(this.getAttribute("per-page"),10);return e>=1&&e<=200?e:12}get prevLabel(){return this.getAttribute("prev-label")||"Vorige"}get nextLabel(){return this.getAttribute("next-label")||"Volgende"}get pageLabelTemplate(){return this.getAttribute("page-label")||"Pagina {current} van {total}"}connectedCallback(){const e=this.closest("dm-map");e&&(e.map?this.#_(e):(this.#d=()=>this.#_(e),e.addEventListener("dm-map:ready",this.#d,{once:!0})))}async#_(e){this.#r=e,await this.#o,this.#v(),Ut(this.#t),this.#y(),this.#A()}#v(){const e=document.createElement("div");e.className="list",e.setAttribute("part","toggle-wrapper");const n=document.createElement("button");n.className="list__toggle",n.type="button",n.setAttribute("part","toggle"),n.setAttribute("aria-pressed","false"),n.setAttribute("aria-label",this.label),n.innerHTML='';const s=document.createElement("span");s.className="list__text list__text--full",s.setAttribute("part","toggle-text-full"),s.textContent=this.label,n.appendChild(s);const a=document.createElement("span");a.className="list__text list__text--short",a.setAttribute("part","toggle-text-short"),a.textContent=this.shortLabel,n.appendChild(a),n.addEventListener("click",()=>this.#p()),e.appendChild(n),this.#t.appendChild(e)}#y(){const e=this.for;if(!e)return;const n=e.split(",").map(s=>s.trim()).filter(Boolean);this.#n=[],n.forEach(s=>{const a=this.#r.querySelector(`#${CSS.escape(s)}`);a&&this.#n.push(a)})}#A(){this.#n.forEach(e=>{const n=h=>{this.#e.set(e.id,h.detail.filters),this.#c=1,this.#s&&this.#w()};this.#h.set(e,n),e.addEventListener("dm-filter:apply",n);const s=e.tagName.toLowerCase(),a=s==="dm-geojson"?"dm-geojson:ready":s==="dm-wfs"?"dm-wfs:ready":"dm-layer:ready",l=()=>{this.#c=1,this.#s&&this.#w()};this.#u.set(e,{event:a,handler:l}),e.addEventListener(a,l)})}#p(){this.#s?this.#L():this.#g()}#g(){this.#s=!0;const e=this.#t.querySelector(".list__toggle");e.setAttribute("aria-pressed","true");const n=e.querySelector(".list__icon");e.querySelector(".list__text--full").textContent="Kaart bekijken",e.querySelector(".list__text--short").textContent="Kaart",n.innerHTML='',this.#i||(this.#i=document.createElement("div"),this.#i.setAttribute("slot","list"),this.#a=this.#i.attachShadow({mode:"open"}),this.#l&&(this.#a.adoptedStyleSheets=[this.#l]),this.#r.appendChild(this.#i)),this.#c=1,this.#w(),this.dispatchEvent(new CustomEvent("dm-list:open",{bubbles:!0,composed:!0,detail:{source:this}})),requestAnimationFrame(()=>{const s=this.#a?.querySelector(".list__card");s&&s.focus()})}#L(){this.#s=!1;const e=this.#t.querySelector(".list__toggle");e.setAttribute("aria-pressed","false");const n=e.querySelector(".list__icon");e.querySelector(".list__text--full").textContent=this.label,e.querySelector(".list__text--short").textContent=this.shortLabel,n.innerHTML='',e.focus(),this.dispatchEvent(new CustomEvent("dm-list:close",{bubbles:!0,composed:!0,detail:{source:this}}))}#M(){const e=[];return this.#n.forEach(n=>{const s=n.data;if(!s?.features)return;let a=s.features;const l=this.#e.get(n.id);l&&Object.keys(l).length>0&&(a=Pe(a,l)),a.forEach(h=>{e.push({feature:h,source:n})})}),e}#w(){if(!this.#a)return;const e=this.querySelector("template"),n=this.#M(),s=n.length,a=this.perPage,l=Math.max(1,Math.ceil(s/a));this.#c>l&&(this.#c=l),this.#c<1&&(this.#c=1);const h=(this.#c-1)*a,c=Math.min(h+a,s),u=n.slice(h,c);if(n.length===0){this.#a.innerHTML=` +`,au=new Set(["http:","https:","mailto:","tel:"]),ou=new Set(["__proto__","constructor","prototype"]);class lu extends HTMLElement{#t;#n=[];#e=new Map;#i=null;#a=null;#l=!1;#r;#s=null;#o=null;#h=new Map;#d=new Map;#u=null;#c=1;constructor(){super(),this.#t=this.attachShadow({mode:"open"}),this.#r=this.#f()}#f(){const e=new CSSStyleSheet;e.replaceSync(ms),this.#t.adoptedStyleSheets=[e],this.#o=new CSSStyleSheet,this.#o.replaceSync(su)}static get observedAttributes(){return["for","label","columns","per-page","prev-label","next-label","page-label"]}attributeChangedCallback(e){this.#l&&(e==="per-page"&&(this.#c=1),this.#g())}get for(){return this.getAttribute("for")}get label(){return this.getAttribute("label")||"Lijst bekijken"}get shortLabel(){return this.getAttribute("short-label")||"Lijst"}get columns(){const e=parseInt(this.getAttribute("columns"),10);return e>=1&&e<=4?e:3}get perPage(){const e=parseInt(this.getAttribute("per-page"),10);return e>=1&&e<=200?e:12}get prevLabel(){return this.getAttribute("prev-label")||"Vorige"}get nextLabel(){return this.getAttribute("next-label")||"Volgende"}get pageLabelTemplate(){return this.getAttribute("page-label")||"Pagina {current} van {total}"}connectedCallback(){const e=this.closest("dm-map");e&&(e.map?this.#m(e):(this.#u=()=>this.#m(e),e.addEventListener("dm-map:ready",this.#u,{once:!0})))}async#m(e){this.#s=e,await this.#r,this.#_(),Ut(this.#t),this.#y(),this.#A()}#_(){const e=document.createElement("div");e.className="list",e.setAttribute("part","toggle-wrapper");const n=document.createElement("button");n.className="list__toggle",n.type="button",n.setAttribute("part","toggle"),n.setAttribute("aria-pressed","false"),n.setAttribute("aria-label",this.label),n.innerHTML='';const s=document.createElement("span");s.className="list__text list__text--full",s.setAttribute("part","toggle-text-full"),s.textContent=this.label,n.appendChild(s);const a=document.createElement("span");a.className="list__text list__text--short",a.setAttribute("part","toggle-text-short"),a.textContent=this.shortLabel,n.appendChild(a),n.addEventListener("click",()=>this.#p()),e.appendChild(n),this.#t.appendChild(e)}#y(){const e=this.for;if(!e)return;const n=e.split(",").map(s=>s.trim()).filter(Boolean);this.#n=[],n.forEach(s=>{const a=this.#s.querySelector(`#${CSS.escape(s)}`);a&&this.#n.push(a)})}#A(){this.#n.forEach(e=>{const n=h=>{this.#e.set(e.id,h.detail.filters),this.#c=1,this.#l&&this.#g()};this.#h.set(e,n),e.addEventListener("dm-filter:apply",n);const s=e.tagName.toLowerCase(),a=s==="dm-geojson"?"dm-geojson:ready":s==="dm-wfs"?"dm-wfs:ready":"dm-layer:ready",l=()=>{this.#c=1,this.#l&&this.#g()};this.#d.set(e,{event:a,handler:l}),e.addEventListener(a,l)})}#p(){this.#l?this.#P():this.#b()}#b(){this.#l=!0;const e=this.#t.querySelector(".list__toggle");e.setAttribute("aria-pressed","true");const n=e.querySelector(".list__icon");e.querySelector(".list__text--full").textContent="Kaart bekijken",e.querySelector(".list__text--short").textContent="Kaart",n.innerHTML='',this.#i||(this.#i=document.createElement("div"),this.#i.setAttribute("slot","list"),this.#a=this.#i.attachShadow({mode:"open"}),this.#o&&(this.#a.adoptedStyleSheets=[this.#o]),this.#s.appendChild(this.#i)),this.#c=1,this.#g(),this.dispatchEvent(new CustomEvent("dm-list:open",{bubbles:!0,composed:!0,detail:{source:this}})),requestAnimationFrame(()=>{const s=this.#a?.querySelector(".list__card");s&&s.focus()})}#P(){this.#l=!1;const e=this.#t.querySelector(".list__toggle");e.setAttribute("aria-pressed","false");const n=e.querySelector(".list__icon");e.querySelector(".list__text--full").textContent=this.label,e.querySelector(".list__text--short").textContent=this.shortLabel,n.innerHTML='',e.focus(),this.dispatchEvent(new CustomEvent("dm-list:close",{bubbles:!0,composed:!0,detail:{source:this}}))}#x(){const e=[];return this.#n.forEach(n=>{const s=n.data;if(!s?.features)return;let a=s.features;const l=this.#e.get(n.id);l&&Object.keys(l).length>0&&(a=Pe(a,l)),a.forEach(h=>{e.push({feature:h,source:n})})}),e}#g(){if(!this.#a)return;const e=this.querySelector("template"),n=this.#x(),s=n.length,a=this.perPage,l=Math.max(1,Math.ceil(s/a));this.#c>l&&(this.#c=l),this.#c<1&&(this.#c=1);const h=(this.#c-1)*a,c=Math.min(h+a,s),u=n.slice(h,c);if(n.length===0){this.#a.innerHTML=`

    Geen resultaten gevonden.

    - `,Ut(this.#a);return}const m=document.createElement("div");m.className="list__panel",m.setAttribute("part","panel"),m.style.setProperty("--draad-map-components-list-columns",this.columns);const v=document.createElement("p");v.className="list__count",v.setAttribute("part","count"),v.setAttribute("role","status"),v.setAttribute("aria-live","polite"),v.textContent=s<=a?`${s} ${s!==1?"resultaten":"resultaat"}`:`${h+1}–${c} van ${s} resultaten`,m.appendChild(v);const g=document.createElement("div");g.className="list__grid",g.setAttribute("part","grid");const _=e?.content.querySelector("a[href], [data-href]")??null;if(u.forEach(({feature:w,source:x},S)=>{const E=h+S,C=document.createElement("article");if(C.className="list__card",C.setAttribute("part","card"),C.setAttribute("tabindex","0"),_||C.setAttribute("role","button"),e){const k=e.content.cloneNode(!0);this.#S(k,w),C.appendChild(k)}else{const k=w.properties?.name||w.properties?.naam||w.id||`Feature ${E+1}`,I=document.createElement("h3");I.textContent=String(k),C.appendChild(I)}this.#b(C),C.addEventListener("click",k=>{k.target.closest("a[href]")||(this.dispatchEvent(new CustomEvent("dm-list:item-click",{bubbles:!0,composed:!0,detail:{feature:w,index:E,source:x}})),this.#L(),this.#E(w,x))}),C.addEventListener("keydown",k=>{k.key==="Enter"&&!k.target.closest("a[href]")&&C.click()}),g.appendChild(C)}),m.appendChild(g),l>1){const w=document.createElement("nav");w.className="list__pagination",w.setAttribute("part","pagination"),w.setAttribute("aria-label","Paginering");const x=document.createElement("button");x.type="button",x.className="list__pagination-arrow",x.setAttribute("part","pagination-prev"),x.setAttribute("aria-label",this.prevLabel),x.dataset.dir="prev",this.#c===1&&(x.disabled=!0),x.innerHTML='';const S=document.createElement("div");S.className="list__pagination-pages",S.setAttribute("role","status"),S.setAttribute("aria-live","polite"),S.setAttribute("aria-label",this.pageLabelTemplate.replace("{current}",this.#c).replace("{total}",l)),this.#P(this.#c,l).forEach(C=>{if(C==="..."){const k=document.createElement("span");k.className="list__pagination-ellipsis",k.setAttribute("aria-hidden","true"),k.textContent="…",S.appendChild(k)}else{const k=document.createElement("button");k.type="button",k.className="list__pagination-page",k.dataset.page=C,k.textContent=C,C===this.#c&&(k.classList.add("list__pagination-page--active"),k.setAttribute("aria-current","page")),S.appendChild(k)}});const E=document.createElement("button");E.type="button",E.className="list__pagination-arrow",E.setAttribute("part","pagination-next"),E.setAttribute("aria-label",this.nextLabel),E.dataset.dir="next",this.#c===l&&(E.disabled=!0),E.innerHTML='',w.append(x,S,E),w.addEventListener("click",C=>{const k=C.target.closest("button[data-page]");if(k&&!k.disabled){this.#C(parseInt(k.dataset.page,10));return}const I=C.target.closest("button[data-dir]");!I||I.disabled||this.#C(I.dataset.dir==="next"?this.#c+1:this.#c-1)}),m.appendChild(w)}this.#a.innerHTML="",Ut(this.#a),this.#a.appendChild(m)}#b(e){const n=a=>{const l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("aria-hidden","true");const h=document.createElementNS("http://www.w3.org/2000/svg","use");return h.setAttribute("href",`#${a}`),l.appendChild(h),l},s=a=>{const l=a.getAttribute("href");if(!l)return!1;try{return new URL(l,window.location.href).origin!==window.location.origin}catch{return!1}};e.querySelectorAll(".address, address").forEach(a=>a.prepend(n("icon-map-pin"))),e.querySelectorAll(".action, a.button").forEach(a=>{s(a)&&a.prepend(n("icon-external-link"))})}#S(e,n){const s=(a,l)=>{a.style.display=l?"":"none"};e.querySelectorAll("[data-field]").forEach(a=>{const l=this.#m(n,a.getAttribute("data-field")),h=l!=null?String(l):"";a.textContent=h,s(a,h!=="")}),e.querySelectorAll("[data-href]").forEach(a=>{const l=a.getAttribute("data-href"),h=this.#m(n,l);if(h!=null){const c=String(h);try{const u=new URL(c,window.location.origin);au.has(u.protocol)?a.setAttribute("href",c):a.removeAttribute("href")}catch{a.removeAttribute("href")}}else a.removeAttribute("href")}),e.querySelectorAll("[data-src]").forEach(a=>{const l=a.getAttribute("data-src"),h=this.#m(n,l);let c=!1;if(h!=null){const u=String(h);try{const m=new URL(u,window.location.origin);m.protocol==="https:"||m.protocol==="http:"?(a.setAttribute("src",u),c=!0):a.removeAttribute("src")}catch{a.removeAttribute("src")}}else a.removeAttribute("src");s(a,c)}),e.querySelectorAll("[data-chips]").forEach(a=>{const l=a.getAttribute("data-chips"),h=this.#m(n,l);if(h!=null){const c=String(h).split(",").map(u=>u.trim()).filter(Boolean);a.innerHTML="",c.forEach(u=>{const m=document.createElement("span");m.className="chip",m.textContent=u,a.appendChild(m)})}}),e.querySelectorAll("dl.dm-infowindow-data").forEach(a=>{let l=!1;a.querySelectorAll("dd").forEach(h=>{const c=h.style.display==="none"||h.textContent.trim()==="",u=h.previousElementSibling;u&&u.tagName==="DT"&&s(u,!c),c||(l=!0)}),l||s(a,!1)}),e.querySelectorAll(".chips").forEach(a=>{[...a.children].some(h=>h.style.display!=="none"&&h.textContent.trim()!=="")||s(a,!1)})}#m(e,n){if(!n.startsWith("properties.")&&n!=="id"&&n!=="properties")return;const s=n.split(".");let a=e;for(const l of s){if(a==null||ou.has(l)||!Object.prototype.hasOwnProperty.call(a,l))return;a=a[l]}return a}async#E(e,n){if(!this.#r?.map)return;const s=e.geometry;if(!s)return;const a=this.#r.map,h=kn(e)?Me(n?.getAttribute("crs"))||"EPSG:28992":null,c=(u,m)=>{if(h){const[v,g]=Oi([u,m],h);return[g,v]}return[m,u]};if(s.type==="Point"){const[u,m]=s.coordinates;a.setView(c(u,m),Math.max(a.getZoom(),16))}else try{const u=(await Promise.resolve().then(()=>Ia)).default,m=h?{coordsToLatLng:g=>u.latLng(c(g[0],g[1]))}:{},v=u.geoJSON(e,m);a.fitBounds(v.getBounds(),{padding:[50,50]})}catch{const u=this.#z(s);u&&a.setView(c(u[0],u[1]),Math.max(a.getZoom(),16))}}#z(e){let n=e.coordinates;for(;Array.isArray(n)&&Array.isArray(n[0]);)n=n[0];return Array.isArray(n)&&n.length>=2?n:null}#P(e,n){return n<=5?Array.from({length:n},(s,a)=>a+1):e<=3?[1,2,3,"...",n]:e>=n-2?[1,"...",n-3,n-2,n-1,n]:[1,"...",e-1,e,e+1,"...",n]}#C(e){const n=this.perPage,s=this.#M().length,a=Math.max(1,Math.ceil(s/n));this.#c=Math.max(1,Math.min(e,a)),this.#w(),this.#i?.scrollIntoView({block:"start",behavior:"smooth"}),requestAnimationFrame(()=>{const l=this.#a?.querySelector(".list__card");l&&l.focus()})}disconnectedCallback(){this.#d&&(this.closest("dm-map")?.removeEventListener("dm-map:ready",this.#d),this.#d=null),this.#h.forEach((e,n)=>{n.removeEventListener("dm-filter:apply",e)}),this.#h.clear(),this.#u.forEach(({event:e,handler:n},s)=>{s.removeEventListener(e,n)}),this.#u.clear(),this.#i?.parentNode&&this.#i.parentNode.removeChild(this.#i),this.#i=null,this.#a=null,this.#n=[],this.#e.clear(),this.#r=null}}customElements.define("dm-list",lu);const hu=`.icon { + `,Ut(this.#a);return}const m=document.createElement("div");m.className="list__panel",m.setAttribute("part","panel"),m.style.setProperty("--draad-map-components-list-columns",this.columns);const v=document.createElement("p");v.className="list__count",v.setAttribute("part","count"),v.setAttribute("role","status"),v.setAttribute("aria-live","polite"),v.textContent=s<=a?`${s} ${s!==1?"resultaten":"resultaat"}`:`${h+1}–${c} van ${s} resultaten`,m.appendChild(v);const g=document.createElement("div");g.className="list__grid",g.setAttribute("part","grid");const _=e?.content.querySelector("a[href], [data-href]")??null;if(u.forEach(({feature:w,source:x},S)=>{const E=h+S,C=document.createElement("article");if(C.className="list__card",C.setAttribute("part","card"),C.setAttribute("tabindex","0"),_||C.setAttribute("role","button"),e){const k=e.content.cloneNode(!0);this.#L(k,w),C.appendChild(k)}else{const k=w.properties?.name||w.properties?.naam||w.id||`Feature ${E+1}`,I=document.createElement("h3");I.textContent=String(k),C.appendChild(I)}this.#C(C),C.addEventListener("click",k=>{k.target.closest("a[href]")||(this.dispatchEvent(new CustomEvent("dm-list:item-click",{bubbles:!0,composed:!0,detail:{feature:w,index:E,source:x}})),this.#P(),this.#S(w,x))}),C.addEventListener("keydown",k=>{k.key==="Enter"&&!k.target.closest("a[href]")&&C.click()}),g.appendChild(C)}),m.appendChild(g),l>1){const w=document.createElement("nav");w.className="list__pagination",w.setAttribute("part","pagination"),w.setAttribute("aria-label","Paginering");const x=document.createElement("button");x.type="button",x.className="list__pagination-arrow",x.setAttribute("part","pagination-prev"),x.setAttribute("aria-label",this.prevLabel),x.dataset.dir="prev",this.#c===1&&(x.disabled=!0),x.innerHTML='';const S=document.createElement("div");S.className="list__pagination-pages",S.setAttribute("role","status"),S.setAttribute("aria-live","polite"),S.setAttribute("aria-label",this.pageLabelTemplate.replace("{current}",this.#c).replace("{total}",l)),this.#v(this.#c,l).forEach(C=>{if(C==="..."){const k=document.createElement("span");k.className="list__pagination-ellipsis",k.setAttribute("aria-hidden","true"),k.textContent="…",S.appendChild(k)}else{const k=document.createElement("button");k.type="button",k.className="list__pagination-page",k.dataset.page=C,k.textContent=C,C===this.#c&&(k.classList.add("list__pagination-page--active"),k.setAttribute("aria-current","page")),S.appendChild(k)}});const E=document.createElement("button");E.type="button",E.className="list__pagination-arrow",E.setAttribute("part","pagination-next"),E.setAttribute("aria-label",this.nextLabel),E.dataset.dir="next",this.#c===l&&(E.disabled=!0),E.innerHTML='',w.append(x,S,E),w.addEventListener("click",C=>{const k=C.target.closest("button[data-page]");if(k&&!k.disabled){this.#M(parseInt(k.dataset.page,10));return}const I=C.target.closest("button[data-dir]");!I||I.disabled||this.#M(I.dataset.dir==="next"?this.#c+1:this.#c-1)}),m.appendChild(w)}this.#a.innerHTML="",Ut(this.#a),this.#a.appendChild(m)}#C(e){const n=a=>{const l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("aria-hidden","true");const h=document.createElementNS("http://www.w3.org/2000/svg","use");return h.setAttribute("href",`#${a}`),l.appendChild(h),l},s=a=>{const l=a.getAttribute("href");if(!l)return!1;try{return new URL(l,window.location.href).origin!==window.location.origin}catch{return!1}};e.querySelectorAll(".address, address").forEach(a=>a.prepend(n("icon-map-pin"))),e.querySelectorAll(".action, a.button").forEach(a=>{s(a)&&a.prepend(n("icon-external-link"))})}#L(e,n){const s=(a,l)=>{a.style.display=l?"":"none"};e.querySelectorAll("[data-field]").forEach(a=>{const l=this.#w(n,a.getAttribute("data-field")),h=l!=null?String(l):"";a.textContent=h,s(a,h!=="")}),e.querySelectorAll("[data-href]").forEach(a=>{const l=a.getAttribute("data-href"),h=this.#w(n,l);if(h!=null){const c=String(h);try{const u=new URL(c,window.location.origin);au.has(u.protocol)?a.setAttribute("href",c):a.removeAttribute("href")}catch{a.removeAttribute("href")}}else a.removeAttribute("href")}),e.querySelectorAll("[data-src]").forEach(a=>{const l=a.getAttribute("data-src"),h=this.#w(n,l);let c=!1;if(h!=null){const u=String(h);try{const m=new URL(u,window.location.origin);m.protocol==="https:"||m.protocol==="http:"?(a.setAttribute("src",u),c=!0):a.removeAttribute("src")}catch{a.removeAttribute("src")}}else a.removeAttribute("src");s(a,c)}),e.querySelectorAll("[data-chips]").forEach(a=>{const l=a.getAttribute("data-chips"),h=this.#w(n,l);if(h!=null){const c=String(h).split(",").map(u=>u.trim()).filter(Boolean);a.innerHTML="",c.forEach(u=>{const m=document.createElement("span");m.className="chip",m.textContent=u,a.appendChild(m)})}}),e.querySelectorAll("dl.dm-infowindow-data").forEach(a=>{let l=!1;a.querySelectorAll("dd").forEach(h=>{const c=h.style.display==="none"||h.textContent.trim()==="",u=h.previousElementSibling;u&&u.tagName==="DT"&&s(u,!c),c||(l=!0)}),l||s(a,!1)}),e.querySelectorAll(".chips").forEach(a=>{[...a.children].some(h=>h.style.display!=="none"&&h.textContent.trim()!=="")||s(a,!1)})}#w(e,n){if(!n.startsWith("properties.")&&n!=="id"&&n!=="properties")return;const s=n.split(".");let a=e;for(const l of s){if(a==null||ou.has(l)||!Object.prototype.hasOwnProperty.call(a,l))return;a=a[l]}return a}async#S(e,n){if(!this.#s?.map)return;const s=e.geometry;if(!s)return;const a=this.#s.map,h=kn(e)?Me(n?.getAttribute("crs"))||"EPSG:28992":null,c=(u,m)=>{if(h){const[v,g]=Gi([u,m],h);return[g,v]}return[m,u]};if(s.type==="Point"){const[u,m]=s.coordinates;a.setView(c(u,m),Math.max(a.getZoom(),16))}else try{const u=(await Promise.resolve().then(()=>Ia)).default,m=h?{coordsToLatLng:g=>u.latLng(c(g[0],g[1]))}:{},v=u.geoJSON(e,m);a.fitBounds(v.getBounds(),{padding:[50,50]})}catch{const u=this.#k(s);u&&a.setView(c(u[0],u[1]),Math.max(a.getZoom(),16))}}#k(e){let n=e.coordinates;for(;Array.isArray(n)&&Array.isArray(n[0]);)n=n[0];return Array.isArray(n)&&n.length>=2?n:null}#v(e,n){return n<=5?Array.from({length:n},(s,a)=>a+1):e<=3?[1,2,3,"...",n]:e>=n-2?[1,"...",n-3,n-2,n-1,n]:[1,"...",e-1,e,e+1,"...",n]}#M(e){const n=this.perPage,s=this.#x().length,a=Math.max(1,Math.ceil(s/n));this.#c=Math.max(1,Math.min(e,a)),this.#g(),this.#i?.scrollIntoView({block:"start",behavior:"smooth"}),requestAnimationFrame(()=>{const l=this.#a?.querySelector(".list__card");l&&l.focus()})}disconnectedCallback(){this.#u&&(this.closest("dm-map")?.removeEventListener("dm-map:ready",this.#u),this.#u=null),this.#h.forEach((e,n)=>{n.removeEventListener("dm-filter:apply",e)}),this.#h.clear(),this.#d.forEach(({event:e,handler:n},s)=>{s.removeEventListener(e,n)}),this.#d.clear(),this.#i?.parentNode&&this.#i.parentNode.removeChild(this.#i),this.#i=null,this.#a=null,this.#n=[],this.#e.clear(),this.#s=null}}customElements.define("dm-list",lu);const hu=`.icon { display: block; inline-size: 1em; block-size: 1em; @@ -2625,6 +2627,31 @@ svg.leaflet-image-layer.leaflet-interactive path {\r color: var(--draad-map-components-filter-header-color-title, currentColor); } +.filter__close { + display: inline-flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + padding: 4px; + margin: -4px -4px 0 8px; + border: none; + background: none; + color: inherit; + cursor: pointer; + border-radius: 4px; +} + +.filter__close svg { + inline-size: var(--draad-map-components-icon-size-lg, 20px); + block-size: var(--draad-map-components-icon-size-lg, 20px); + fill: currentColor; +} + +.filter__close:focus-visible { + outline: 2px dashed Highlight; + outline-offset: 2px; +} + .filter__subtitle { margin: 0; font-size: 0.875rem; @@ -3303,7 +3330,7 @@ svg.leaflet-image-layer.leaflet-interactive path {\r .filter__panel--dropdown .filter__content { max-block-size: none; } -`;class cu extends HTMLElement{#t;#n=null;#e=[];#i={};#a={};#s=new Map;#o=new WeakMap;#r=new Map;#l=new Map;#h;#u=!1;#d=!1;#c=null;#f=null;#_=null;#v=!1;#y=null;constructor(){super(),this.#t=this.attachShadow({mode:"open"}),this.#h=this.#A()}#A(){const e=new CSSStyleSheet;e.replaceSync(hu),this.#t.adoptedStyleSheets=[e]}get#p(){const e=this.getAttribute("variant");return e==="dropdown"||e==="sidebar"?e:"dialog"}get#g(){return(this.getAttribute("submit")||"auto")==="auto"}get#L(){return this.hasAttribute("collapsible")}connectedCallback(){const e=this.closest("dm-map");e&&(e.map?this.#M(e):e.addEventListener("dm-map:ready",()=>{this.#M(e)},{once:!0}))}async#M(e){if(this.#n=e,await this.#h,this.#w(),this.#b(),this.#j(),Ut(this.#t),this.#J(),this.#k(),this.#T(),this.hasAttribute("open")&&this.#p==="sidebar"){const s=this.#t.querySelector(".filter__panel--sidebar"),a=this.#t.querySelector(".filter__toggle");s?.classList.add("filter__panel--open"),a?.setAttribute("aria-expanded","true"),this.#d=!0}this.#tt()&&(this.#u=!0,this.#a=JSON.parse(JSON.stringify(this.#i))),this.#y=()=>this.#tt(!0),window.addEventListener("popstate",this.#y)}#w(){const e=["dm-geojson[filter-property], dm-geojson[filter-properties]","dm-wfs[filter-property], dm-wfs[filter-properties]","dm-layer[filter-property], dm-layer[filter-properties]"];this.#e=[],e.forEach(n=>{this.#n.querySelectorAll(n).forEach(s=>{const a=s.getAttribute("filter-properties"),l=s.getAttribute("filter-labels"),h=s.getAttribute("filter-property"),c=s.getAttribute("filter-label"),u=s.getAttribute("filter-types"),m=s.getAttribute("filter-collapsed");let v=[],g=[],_=[],w=[];if(a){for(v=a.split(",").map(E=>E.trim()).filter(Boolean),l&&(g=l.split(",").map(E=>E.trim()).filter(Boolean)),u&&(_=u.split(",").map(E=>E.trim()).filter(Boolean)),m&&(w=m.split(",").map(E=>E.trim()).filter(Boolean));g.length{this.#e.push({element:s,label:g[C],property:E,groupKey:S||E,type:s.tagName.toLowerCase(),id:x,filterType:_[C]||"auto",collapsed:w[C]==="true"})}),!this.#o.has(s))if(this.#o.set(s,!0),s.data)v.forEach(E=>{this.#m(s,E)});else{const E=s.tagName==="DM-GEOJSON"?"dm-geojson:ready":s.tagName==="DM-WFS"?"dm-wfs:ready":"dm-layer:ready";let C=!1;s.addEventListener(E,()=>{C||(C=!0,v.forEach(k=>{this.#m(s,k)}),this.#b(),this.#k(),this.#T())},{once:!0}),s.data&&!C&&(C=!0,v.forEach(k=>{this.#m(s,k)}))}})})}#b(){this.#l=new Map,this.#e.forEach(e=>{this.#l.has(e.groupKey)||this.#l.set(e.groupKey,{label:e.label,filterType:e.filterType,collapsed:e.collapsed,sources:[]});const n=this.#l.get(e.groupKey);n.sources.find(a=>a.element===e.element&&a.property===e.property)||n.sources.push({element:e.element,id:e.id,property:e.property})})}#S(e,n){const s=new Set;if(n.sources.forEach(({id:l,property:h})=>{const c=`${l}:${h}`,u=this.#s.get(c);u&&u.values.forEach(m=>s.add(m))}),s.size===0)return null;const a=Array.from(s).sort((l,h)=>typeof l=="number"&&typeof h=="number"?l-h:String(l).localeCompare(String(h)));return{values:a,valueType:this.#P(a)}}#m(e,n){const s=this.#E(e,n),a=this.#P(s),l=this.#e.find(c=>c.element===e&&c.property===n);if(!l)return;const h=`${l.id}:${n}`;this.#s.set(h,{values:s,valueType:a}),this.#u&&Object.keys(this.#i).length>0&&this.#B(),this.#D()&&(this.#k(),this.#T())}#E(e,n){if(!e.data?.features)return[];const s=new Set;return e.data.features.forEach(a=>{const l=a.properties?.[n];if(l!=null){const h=String(l);h.includes(",")?h.split(",").forEach(c=>{const u=c.trim();u&&s.add(u)}):s.add(l)}}),Array.from(s).sort((a,l)=>typeof a=="number"&&typeof l=="number"?a-l:String(a).localeCompare(String(l)))}#z(e,n){const s=new Map;return n.sources.forEach(({element:a,property:l})=>{a.data?.features&&a.data.features.forEach(h=>{const c=h.properties?.[l];if(c==null)return;const u=String(c);(u.includes(",")?u.split(",").map(v=>v.trim()).filter(Boolean):[u]).forEach(v=>{s.set(v,(s.get(v)||0)+1)})})}),s}#P(e){if(e.length===0)return{isNumeric:!1};if(e.length===1)return{isNumeric:!1,single:!0};if(e.every(s=>typeof s=="number"?!0:typeof s=="string"?!isNaN(Number(s))&&s.trim()!=="":!1)){const s=e.map(a=>Number(a));return{isNumeric:!0,min:Math.min(...s),max:Math.max(...s)}}return{isNumeric:!1}}#C(e,n){const s=this.#l.get(e)?.filterType;return s&&s!=="auto"?s==="range"&&!n.valueType.isNumeric?this.#q(n):s:this.#q(n)}#q({values:e,valueType:n}){return n.isNumeric&&!n.single?"range":e.length<=20?"checkbox":"dropdown"}#j(){const e=this.#p;e==="dropdown"?this.#K():e==="sidebar"?this.#V():this.#W()}#I(){return` +`;class cu extends HTMLElement{#t;#n=null;#e=[];#i={};#a={};#l=new Map;#r=new WeakMap;#s=new Map;#o=new Map;#h;#d=!1;#u=!1;#c=null;#f=null;#m=null;#_=!1;#y=null;constructor(){super(),this.#t=this.attachShadow({mode:"open"}),this.#h=this.#A()}#A(){const e=new CSSStyleSheet;e.replaceSync(hu),this.#t.adoptedStyleSheets=[e]}get#p(){const e=this.getAttribute("variant");return e==="dropdown"||e==="sidebar"?e:"dialog"}get#b(){return(this.getAttribute("submit")||"auto")==="auto"}get#P(){return this.hasAttribute("collapsible")}connectedCallback(){const e=this.closest("dm-map");e&&(e.map?this.#x(e):e.addEventListener("dm-map:ready",()=>{this.#x(e)},{once:!0}))}async#x(e){if(this.#n=e,await this.#h,this.#g(),this.#C(),this.#G(),Ut(this.#t),this.#X(),this.#N(),this.#B(),this.hasAttribute("open")&&this.#p==="sidebar"){const s=this.#t.querySelector(".filter__panel--sidebar"),a=this.#t.querySelector(".filter__toggle");s?.classList.add("filter__panel--open"),a?.setAttribute("aria-expanded","true"),this.#u=!0}this.#et()&&(this.#d=!0,this.#a=JSON.parse(JSON.stringify(this.#i))),this.#y=()=>this.#et(!0),window.addEventListener("popstate",this.#y)}#g(){const e=["dm-geojson[filter-property], dm-geojson[filter-properties]","dm-wfs[filter-property], dm-wfs[filter-properties]","dm-layer[filter-property], dm-layer[filter-properties]"];this.#e=[],e.forEach(n=>{this.#n.querySelectorAll(n).forEach(s=>{const a=s.getAttribute("filter-properties"),l=s.getAttribute("filter-labels"),h=s.getAttribute("filter-property"),c=s.getAttribute("filter-label"),u=s.getAttribute("filter-types"),m=s.getAttribute("filter-collapsed");let v=[],g=[],_=[],w=[];if(a){for(v=a.split(",").map(E=>E.trim()).filter(Boolean),l&&(g=l.split(",").map(E=>E.trim()).filter(Boolean)),u&&(_=u.split(",").map(E=>E.trim()).filter(Boolean)),m&&(w=m.split(",").map(E=>E.trim()).filter(Boolean));g.length{this.#e.push({element:s,label:g[C],property:E,groupKey:S||E,type:s.tagName.toLowerCase(),id:x,filterType:_[C]||"auto",collapsed:w[C]==="true"})}),!this.#r.has(s))if(this.#r.set(s,!0),s.data)v.forEach(E=>{this.#w(s,E)});else{const E=s.tagName==="DM-GEOJSON"?"dm-geojson:ready":s.tagName==="DM-WFS"?"dm-wfs:ready":"dm-layer:ready";let C=!1;s.addEventListener(E,()=>{C||(C=!0,v.forEach(k=>{this.#w(s,k)}),this.#C(),this.#N(),this.#B())},{once:!0}),s.data&&!C&&(C=!0,v.forEach(k=>{this.#w(s,k)}))}})})}#C(){this.#o=new Map,this.#e.forEach(e=>{this.#o.has(e.groupKey)||this.#o.set(e.groupKey,{label:e.label,filterType:e.filterType,collapsed:e.collapsed,sources:[]});const n=this.#o.get(e.groupKey);n.sources.find(a=>a.element===e.element&&a.property===e.property)||n.sources.push({element:e.element,id:e.id,property:e.property})})}#L(e,n){const s=new Set;if(n.sources.forEach(({id:l,property:h})=>{const c=`${l}:${h}`,u=this.#l.get(c);u&&u.values.forEach(m=>s.add(m))}),s.size===0)return null;const a=Array.from(s).sort((l,h)=>typeof l=="number"&&typeof h=="number"?l-h:String(l).localeCompare(String(h)));return{values:a,valueType:this.#v(a)}}#w(e,n){const s=this.#S(e,n),a=this.#v(s),l=this.#e.find(c=>c.element===e&&c.property===n);if(!l)return;const h=`${l.id}:${n}`;this.#l.set(h,{values:s,valueType:a}),this.#d&&Object.keys(this.#i).length>0&&this.#I(),this.#U()&&(this.#N(),this.#B())}#S(e,n){if(!e.data?.features)return[];const s=new Set;return e.data.features.forEach(a=>{const l=a.properties?.[n];if(l!=null){const h=String(l);h.includes(",")?h.split(",").forEach(c=>{const u=c.trim();u&&s.add(u)}):s.add(l)}}),Array.from(s).sort((a,l)=>typeof a=="number"&&typeof l=="number"?a-l:String(a).localeCompare(String(l)))}#k(e,n){const s=new Map;return n.sources.forEach(({element:a,property:l})=>{a.data?.features&&a.data.features.forEach(h=>{const c=h.properties?.[l];if(c==null)return;const u=String(c);(u.includes(",")?u.split(",").map(v=>v.trim()).filter(Boolean):[u]).forEach(v=>{s.set(v,(s.get(v)||0)+1)})})}),s}#v(e){if(e.length===0)return{isNumeric:!1};if(e.length===1)return{isNumeric:!1,single:!0};if(e.every(s=>typeof s=="number"?!0:typeof s=="string"?!isNaN(Number(s))&&s.trim()!=="":!1)){const s=e.map(a=>Number(a));return{isNumeric:!0,min:Math.min(...s),max:Math.max(...s)}}return{isNumeric:!1}}#M(e,n){const s=this.#o.get(e)?.filterType;return s&&s!=="auto"?s==="range"&&!n.valueType.isNumeric?this.#O(n):s:this.#O(n)}#O({values:e,valueType:n}){return n.isNumeric&&!n.single?"range":e.length<=20?"checkbox":"dropdown"}#G(){const e=this.#p;e==="dropdown"?this.#Y():e==="sidebar"?this.#K():this.#j()}#T(){return` - `}#N(){const e=this.#g?" filter--auto-submit":"",n=this.getAttribute("label")||"Filters";return` + `}#q(){const e=this.#b?" filter--auto-submit":"",n=this.getAttribute("label")||"Filters";return`
    -

    ${this.#G(n)}

    +

    ${this.#F(n)}

    +
    @@ -3333,47 +3363,47 @@ svg.leaflet-image-layer.leaflet-interactive path {\r
    - `}#W(){const e=this.getAttribute("label")||"Filters",n=this.#g?" filter--auto-submit":"";this.#t.innerHTML=` + `}#j(){const e=this.getAttribute("label")||"Filters",n=this.#b?" filter--auto-submit":"";this.#t.innerHTML=`
    - ${this.#I()} + ${this.#T()} - - ${this.#N()} + + ${this.#q()}
    - `}#K(){const e=this.getAttribute("label")||"Filters",n=this.#g?" filter--auto-submit":"";this.#t.innerHTML=` + `}#Y(){const e=this.getAttribute("label")||"Filters",n=this.#b?" filter--auto-submit":"";this.#t.innerHTML=`
    - ${this.#I()} + ${this.#T()} -
    - ${this.#N()} +
    + ${this.#q()}
    - `}#V(){const e=this.getAttribute("label")||"Filters",n=this.#g?" filter--auto-submit":"";this.#t.innerHTML=` + `}#K(){const e=this.getAttribute("label")||"Filters",n=this.#b?" filter--auto-submit":"";this.#t.innerHTML=`
    - ${this.#I()} + ${this.#T()} -
    - ${this.#N()} +
    + ${this.#q()}
    - `}#k(){if(!this.#v){this.#v=!0;try{const e=this.#t.querySelector(".filter__content");if(!e)return;if(this.#l.size===0){e.innerHTML='

    Geen filterbare gegevensbronnen gevonden.

    ';return}const n=[];this.#l.forEach((s,a)=>{let l=this.#S(a,s);if(l||(s.sources.forEach(({element:k,property:I})=>{k.data&&this.#m(k,I)}),l=this.#S(a,s)),!l||l.values.length===0){n.push(` -
    -

    ${this.#G(s.label)}

    + `}#N(){if(!this.#_){this.#_=!0;try{const e=this.#t.querySelector(".filter__content");if(!e)return;if(this.#o.size===0){e.innerHTML='

    Geen filterbare gegevensbronnen gevonden.

    ';return}const n=[];this.#o.forEach((s,a)=>{let l=this.#L(a,s);if(l||(s.sources.forEach(({element:k,property:I})=>{k.data&&this.#w(k,I)}),l=this.#L(a,s)),!l||l.values.length===0){n.push(` +
    +

    ${this.#F(s.label)}

    Loading data...

    - `);return}const{values:h,valueType:c}=l,u=this.#C(a,l),m=s.collapsed,v=m?"false":"true",g=m?" hidden":"";if(u==="single"||c.single){n.push(` -
    - ${this.#F(s.label,a,v,g,` -

    Value: ${this.#G(String(h[0]))}

    + `);return}const{values:h,valueType:c}=l,u=this.#M(a,l),m=s.collapsed,v=m?"false":"true",g=m?" hidden":"";if(u==="single"||c.single){n.push(` +
    + ${this.#z(s.label,a,v,g,` +

    Value: ${this.#F(String(h[0]))}

    `)}
    `);return}if(u==="range"){const k=this.#i[a]?.min??c.min,I=this.#i[a]?.max??c.max,B=` @@ -3387,8 +3417,8 @@ svg.leaflet-image-layer.leaflet-interactive path {\r min="${c.min}" max="${c.max}" value="${k}" - step="${this.#et(c.min,c.max)}" - aria-label="${this.#x(s.label)} minimum value" + step="${this.#it(c.min,c.max)}" + aria-label="${this.#E(s.label)} minimum value" >
    `;n.push(` -
    - ${this.#F(s.label,a,v,g,B)} +
    + ${this.#z(s.label,a,v,g,B)}
    - `);return}if(u==="checkbox"){const k=s.sources.reduce((F,{element:J})=>F||this.#lt(J),null),I=this.#z(a,s),B=h.map(F=>{const J=this.#rt(a,F)?"checked":"",ot=this.#x(String(F)),et=this.#G(String(F)),Mt=I.get(String(F))||0,Q=Mt>0?` (${Mt})`:"",ht=k?.[F]?this.#ht(k[F]):this.#$();return` + `);return}if(u==="checkbox"){const k=s.sources.reduce((q,{element:J})=>q||this.#lt(J),null),I=this.#k(a,s),B=h.map(q=>{const J=this.#Q(a,q)?"checked":"",ot=this.#E(String(q)),et=this.#F(String(q)),St=I.get(String(q))||0,Q=St>0?` (${St})`:"",ht=k?.[q]?this.#ht(k[q]):this.#J();return`