@mattilsynet/design 3.1.16 → 3.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/mtds/atlas/atlas-element.d.ts +1 -1
  2. package/mtds/atlas/atlas-element.js +42 -43
  3. package/mtds/atlas/atlas-element.js.map +1 -1
  4. package/mtds/atlas/atlas-matgeo.d.ts +0 -1
  5. package/mtds/atlas/atlas-matgeo.js +20 -22
  6. package/mtds/atlas/atlas-matgeo.js.map +1 -1
  7. package/mtds/atlas/atlas.css.js +9 -9
  8. package/mtds/atlas/atlas.css.js.map +1 -1
  9. package/mtds/atlas.iife.js +13 -13
  10. package/mtds/chart/chart.js +13 -12
  11. package/mtds/chart/chart.js.map +1 -1
  12. package/mtds/details/details.js +9 -9
  13. package/mtds/details/details.js.map +1 -1
  14. package/mtds/dialog/dialog.js +8 -9
  15. package/mtds/dialog/dialog.js.map +1 -1
  16. package/mtds/field/field.js +0 -1
  17. package/mtds/index.d.ts +1 -1
  18. package/mtds/index.iife.js +16 -196
  19. package/mtds/index.js +17 -35
  20. package/mtds/index.js.map +1 -1
  21. package/mtds/logo/logo.js +15 -7
  22. package/mtds/logo/logo.js.map +1 -1
  23. package/mtds/package.json.js +1 -1
  24. package/mtds/print/print.d.ts +8 -0
  25. package/mtds/print/print.js +11 -0
  26. package/mtds/print/print.js.map +1 -0
  27. package/mtds/print/print.stories.d.ts +2 -0
  28. package/mtds/react.d.ts +1 -0
  29. package/mtds/react.js +30 -28
  30. package/mtds/react.js.map +1 -1
  31. package/mtds/styles.css +1 -1
  32. package/mtds/styles.json +45 -44
  33. package/mtds/styles.module.css.js +88 -86
  34. package/mtds/styles.module.css.js.map +1 -1
  35. package/mtds/tag/tag.js +14 -5
  36. package/mtds/tag/tag.js.map +1 -1
  37. package/mtds/toast/toast.js +0 -1
  38. package/mtds/utils.d.ts +1 -1
  39. package/mtds/utils.js +7 -7
  40. package/mtds/utils.js.map +1 -1
  41. package/package.json +21 -18
  42. package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +0 -284
  43. package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +0 -1
  44. package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js +0 -201
  45. package/mtds/external/@u-elements/u-tabs/dist/u-tabs.js.map +0 -1
  46. package/mtds/print/print.css.js +0 -185
  47. package/mtds/print/print.css.js.map +0 -1
@@ -1,4 +1,4 @@
1
- var mtdsatlas=(function(H){"use strict";var gs=Object.defineProperty;var ys=(H,tt,P)=>tt in H?gs(H,tt,{enumerable:!0,configurable:!0,writable:!0,value:P}):H[tt]=P;var fn=(H,tt,P)=>ys(H,typeof tt!="symbol"?tt+"":tt,P);var _t;let tt=0;function P(n){return"_leaflet_id"in n||(n._leaflet_id=++tt),n._leaflet_id}function bi(n,t,e){let i,s;function o(){i=!1,s&&(r.apply(e,s),s=!1)}function r(...a){i?s=a:(n.apply(e,a),setTimeout(o,t),i=!0)}return r}function St(n,t,e){const i=t[1],s=t[0],o=i-s;return n===i&&e?n:((n-s)%o+o)%o+s}function V(){return!1}function et(n,t){if(t===!1)return n;const e=10**(t===void 0?6:t);return Math.round(n*e)/e}function it(n){return n.trim().split(/\s+/)}function z(n,t){Object.hasOwn(n,"options")||(n.options=n.options?Object.create(n.options):{});for(const e in t)Object.hasOwn(t,e)&&(n.options[e]=t[e]);return n.options}const mn=/\{ *([\w_ -]+) *\}/g;function wi(n,t){return n.replace(mn,(e,i)=>{let s=t[i];if(s===void 0)throw new Error(`No value provided for variable ${e}`);return typeof s=="function"&&(s=s(t)),s})}const Ut="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";var gn={__proto__:null,emptyImageUrl:Ut,falseFn:V,formatNum:et,get lastId(){return tt},setOptions:z,splitWords:it,stamp:P,template:wi,throttle:bi,wrapNum:St};class Ot{static extend({statics:t,includes:e,...i}){const s=class extends this{};Object.setPrototypeOf(s,this);const o=this.prototype,r=s.prototype;if(t&&Object.assign(s,t),Array.isArray(e))for(const a of e)Object.assign(r,a);else e&&Object.assign(r,e);return Object.assign(r,i),r.options&&(r.options=o.options?Object.create(o.options):{},Object.assign(r.options,i.options)),r._initHooks=[],s}static include(t){const e=this.prototype.options;return Object.assign(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this}static setDefaultOptions(t){return z(this.prototype,t),this}static mergeOptions(t){return this.prototype.options??={},Object.assign(this.prototype.options,t),this}static addInitHook(t,...e){const i=typeof t=="function"?t:function(){this[t].apply(this,e)};return this.prototype._initHooks??=[],this.prototype._initHooks.push(i),this}constructor(...t){this._initHooksCalled=!1,z(this),this.initialize&&this.initialize(...t),this.callInitHooks()}initialize(){}callInitHooks(){if(this._initHooksCalled)return;const t=[];let e=this;for(;(e=Object.getPrototypeOf(e))!==null;)t.push(e);t.reverse();for(const i of t)for(const s of i._initHooks??[])s.call(this);this._initHooksCalled=!0}}class Zt extends Ot{on(t,e,i){if(typeof t=="object")for(const[s,o]of Object.entries(t))this._on(s,o,e);else for(const s of it(t))this._on(s,e,i);return this}off(t,e,i){if(!arguments.length)delete this._events;else if(typeof t=="object")for(const[s,o]of Object.entries(t))this._off(s,o,e);else{const s=arguments.length===1;for(const o of it(t))s?this._off(o):this._off(o,e,i)}return this}_on(t,e,i,s){if(typeof e!="function"){console.warn(`wrong listener type: ${typeof e}`);return}if(this._listens(t,e,i)!==!1)return;i===this&&(i=void 0);const o={fn:e,ctx:i};s&&(o.once=!0),this._events??={},this._events[t]??=[],this._events[t].push(o)}_off(t,e,i){if(!this._events)return;let s=this._events[t];if(!s)return;if(arguments.length===1){if(this._firingCount)for(const r of s)r.fn=V;delete this._events[t];return}if(typeof e!="function"){console.warn(`wrong listener type: ${typeof e}`);return}const o=this._listens(t,e,i);if(o!==!1){const r=s[o];this._firingCount&&(r.fn=V,this._events[t]=s=s.slice()),s.splice(o,1)}}fire(t,e,i){if(!this.listens(t,i))return this;const s={...e,type:t,target:this,sourceTarget:e?.sourceTarget||this};if(this._events){const o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(const r of o){const a=r.fn;r.once&&this.off(t,a,r.ctx),a.call(r.ctx||this,s)}this._firingCount--}}return i&&this._propagateEvent(s),this}listens(t,e,i,s){typeof t!="string"&&console.warn('"string" type argument expected');let o=e;if(typeof e!="function"&&(s=!!e,o=void 0,i=void 0),this._events?.[t]?.length&&this._listens(t,o,i)!==!1)return!0;if(s){for(const r of Object.values(this._eventParents??{}))if(r.listens(t,e,i,s))return!0}return!1}_listens(t,e,i){if(!this._events)return!1;const s=this._events[t]??[];if(!e)return!!s.length;i===this&&(i=void 0);const o=s.findIndex(r=>r.fn===e&&r.ctx===i);return o===-1?!1:o}once(t,e,i){if(typeof t=="object")for(const[s,o]of Object.entries(t))this._on(s,o,e,!0);else for(const s of it(t))this._on(s,e,i,!0);return this}addEventParent(t){return this._eventParents??={},this._eventParents[P(t)]=t,this}removeEventParent(t){return this._eventParents&&delete this._eventParents[P(t)],this}_propagateEvent(t){for(const e of Object.values(this._eventParents??{}))e.fire(t.type,{propagatedFrom:t.target,...t},!0)}}class f{constructor(t,e,i){if(!f.validate(t,e))throw new Error(`Invalid Point object: (${t}, ${e})`);let o,r;if(t instanceof f)return t;Array.isArray(t)?(o=t[0],r=t[1]):typeof t=="object"&&"x"in t&&"y"in t?(o=t.x,r=t.y):(o=t,r=e),this.x=i?Math.round(o):o,this.y=i?Math.round(r):r}static validate(t,e){return t instanceof f||Array.isArray(t)||t&&typeof t=="object"&&"x"in t&&"y"in t?!0:!!((t||t===0)&&(e||e===0))}clone(){const t=new f(0,0);return t.x=this.x,t.y=this.y,t}add(t){return this.clone()._add(new f(t))}_add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.clone()._subtract(new f(t))}_subtract(t){return this.x-=t.x,this.y-=t.y,this}divideBy(t){return this.clone()._divideBy(t)}_divideBy(t){return this.x/=t,this.y/=t,this}multiplyBy(t){return this.clone()._multiplyBy(t)}_multiplyBy(t){return this.x*=t,this.y*=t,this}scaleBy(t){return new f(this.x*t.x,this.y*t.y)}unscaleBy(t){return new f(this.x/t.x,this.y/t.y)}round(){return this.clone()._round()}_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}floor(){return this.clone()._floor()}_floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.clone()._ceil()}_ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}trunc(){return this.clone()._trunc()}_trunc(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}distanceTo(t){t=new f(t);const e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)}equals(t){return t=new f(t),t.x===this.x&&t.y===this.y}contains(t){return t=new f(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)}toString(){return`Point(${et(this.x)}, ${et(this.y)})`}}class L{constructor(t,e){if(!t)return;if(t instanceof L)return t;const i=e?[t,e]:t;for(const s of i)this.extend(s)}extend(t){let e,i;if(!t)return this;if(t instanceof f||typeof t[0]=="number"||"x"in t)e=i=new f(t);else if(t=new L(t),e=t.min,i=t.max,!e||!i)return this;return!this.min&&!this.max?(this.min=e.clone(),this.max=i.clone()):(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)),this}getCenter(t){return new f((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)}getBottomLeft(){return new f(this.min.x,this.max.y)}getTopRight(){return new f(this.max.x,this.min.y)}getTopLeft(){return this.min}getBottomRight(){return this.max}getSize(){return this.max.subtract(this.min)}contains(t){let e,i;return typeof t[0]=="number"||t instanceof f?t=new f(t):t=new L(t),t instanceof L?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y}intersects(t){t=new L(t);const e=this.min,i=this.max,s=t.min,o=t.max,r=o.x>=e.x&&s.x<=i.x,a=o.y>=e.y&&s.y<=i.y;return r&&a}overlaps(t){t=new L(t);const e=this.min,i=this.max,s=t.min,o=t.max,r=o.x>e.x&&s.x<i.x,a=o.y>e.y&&s.y<i.y;return r&&a}isValid(){return!!(this.min&&this.max)}pad(t){const e=this.min,i=this.max,s=Math.abs(e.x-i.x)*t,o=Math.abs(e.y-i.y)*t;return new L(new f(e.x-s,e.y-o),new f(i.x+s,i.y+o))}equals(t){return t?(t=new L(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}}class C{constructor(t,e){if(!t)return;if(t instanceof C)return t;const i=e?[t,e]:t;for(const s of i)this.extend(s)}extend(t){const e=this._southWest,i=this._northEast;let s,o;if(t instanceof m)s=t,o=t;else if(t instanceof C){if(s=t._southWest,o=t._northEast,!s||!o)return this}else return t?m.validate(t)?this.extend(new m(t)):this.extend(new C(t)):this;return!e&&!i?(this._southWest=new m(s.lat,s.lng),this._northEast=new m(o.lat,o.lng)):(e.lat=Math.min(s.lat,e.lat),e.lng=Math.min(s.lng,e.lng),i.lat=Math.max(o.lat,i.lat),i.lng=Math.max(o.lng,i.lng)),this}pad(t){const e=this._southWest,i=this._northEast,s=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new C(new m(e.lat-s,e.lng-o),new m(i.lat+s,i.lng+o))}getCenter(){return new m((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)}getSouthWest(){return this._southWest}getNorthEast(){return this._northEast}getNorthWest(){return new m(this.getNorth(),this.getWest())}getSouthEast(){return new m(this.getSouth(),this.getEast())}getWest(){return this._southWest.lng}getSouth(){return this._southWest.lat}getEast(){return this._northEast.lng}getNorth(){return this._northEast.lat}contains(t){m.validate(t)?t=new m(t):t=new C(t);const e=this._southWest,i=this._northEast;let s,o;return t instanceof C?(s=t.getSouthWest(),o=t.getNorthEast()):s=o=t,s.lat>=e.lat&&o.lat<=i.lat&&s.lng>=e.lng&&o.lng<=i.lng}intersects(t){t=new C(t);const e=this._southWest,i=this._northEast,s=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>=e.lat&&s.lat<=i.lat,a=o.lng>=e.lng&&s.lng<=i.lng;return r&&a}overlaps(t){t=new C(t);const e=this._southWest,i=this._northEast,s=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>e.lat&&s.lat<i.lat,a=o.lng>e.lng&&s.lng<i.lng;return r&&a}toBBoxString(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")}equals(t,e){return t?(t=new C(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e)):!1}isValid(){return!!(this._southWest&&this._northEast)}}class m{constructor(t,e,i){if(!m.validate(t,e,i))throw new Error(`Invalid LatLng object: (${t}, ${e})`);let o,r,a;if(t instanceof m)return t;Array.isArray(t)&&typeof t[0]!="object"?t.length===3?(o=t[0],r=t[1],a=t[2]):t.length===2&&(o=t[0],r=t[1]):typeof t=="object"&&"lat"in t?(o=t.lat,r="lng"in t?t.lng:t.lon,a=t.alt):(o=t,r=e,a=i),this.lat=+o,this.lng=+r,a!==void 0&&(this.alt=+a)}static validate(t,e,i){return t instanceof m||typeof t=="object"&&"lat"in t?!0:t&&Array.isArray(t)&&typeof t[0]!="object"?t.length===3||t.length===2:!!((t||t===0)&&(e||e===0))}equals(t,e){return t?(t=new m(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(e??1e-9)):!1}toString(t){return`LatLng(${et(this.lat,t)}, ${et(this.lng,t)})`}distanceTo(t){return dt.distance(this,new m(t))}wrap(){return dt.wrapLatLng(this)}toBounds(t){const e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new C([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])}clone(){const t=new m(0,0);return t.lat=this.lat,t.lng=this.lng,t.alt=this.alt,t}}class ot{static projection=void 0;static transformation=void 0;static latLngToPoint(t,e){const i=this.projection.project(t),s=this.scale(e);return this.transformation._transform(i,s)}static pointToLatLng(t,e){const i=this.scale(e),s=this.transformation.untransform(t,i);return this.projection.unproject(s)}static project(t){return this.projection.project(t)}static unproject(t){return this.projection.unproject(t)}static scale(t){return 256*2**t}static zoom(t){return Math.log(t/256)/Math.LN2}static getProjectedBounds(t){if(this.infinite)return null;const e=this.projection.bounds,i=this.scale(t),s=this.transformation.transform(e.min,i),o=this.transformation.transform(e.max,i);return new L(s,o)}static infinite=!1;static wrapLatLng(t){t=new m(t);const e=this.wrapLng?St(t.lng,this.wrapLng,!0):t.lng,i=this.wrapLat?St(t.lat,this.wrapLat,!0):t.lat,s=t.alt;return new m(i,e,s)}static wrapLatLngBounds(t){t=new C(t);const e=t.getCenter(),i=this.wrapLatLng(e),s=e.lat-i.lat,o=e.lng-i.lng;if(s===0&&o===0)return t;const r=t.getSouthWest(),a=t.getNorthEast(),l=new m(r.lat-s,r.lng-o),h=new m(a.lat-s,a.lng-o);return new C(l,h)}}class dt extends ot{static wrapLng=[-180,180];static R=6371e3;static distance(t,e){const i=Math.PI/180,s=t.lat*i,o=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),a=Math.sin((e.lng-t.lng)*i/2),l=r*r+Math.cos(s)*Math.cos(o)*a*a,h=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return this.R*h}}const xi=6378137,ge={R:xi,MAX_LATITUDE:85.0511287798,project(n){n=new m(n);const t=Math.PI/180,e=this.MAX_LATITUDE,i=Math.max(Math.min(e,n.lat),-e),s=Math.sin(i*t);return new f(this.R*n.lng*t,this.R*Math.log((1+s)/(1-s))/2)},unproject(n){n=new f(n);const t=180/Math.PI;return new m((2*Math.atan(Math.exp(n.y/this.R))-Math.PI/2)*t,n.x*t/this.R)},bounds:(()=>{const n=xi*Math.PI;return new L([-n,-n],[n,n])})()};class Et{constructor(t,e,i,s){if(Array.isArray(t)){this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3];return}this._a=t,this._b=e,this._c=i,this._d=s}transform(t,e){return this._transform(t.clone(),e)}_transform(t,e){return e||=1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t}untransform(t,e){return e||=1,new f((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}}class ye extends dt{static code="EPSG:3857";static projection=ge;static transformation=(()=>{const t=.5/(Math.PI*ge.R);return new Et(t,.5,-t,.5)})()}class yn extends ye{static code="EPSG:900913"}const Li=ve("chrome"),vn=!Li&&ve("safari"),bn=typeof orientation<"u"||ve("mobile"),Pi=typeof window>"u"?!1:!!window.PointerEvent,Ci=typeof window>"u"?!1:"ontouchstart"in window||!!window.TouchEvent,wn=Ci||Pi,xn=typeof window>"u"||typeof window.devicePixelRatio>"u"?!1:window.devicePixelRatio>1,Ln=typeof navigator>"u"||typeof navigator.platform>"u"?!1:navigator.platform.startsWith("Mac"),Pn=typeof navigator>"u"||typeof navigator.platform>"u"?!1:navigator.platform.startsWith("Linux");function ve(n){return typeof navigator>"u"||typeof navigator.userAgent>"u"?!1:navigator.userAgent.toLowerCase().includes(n)}var F={chrome:Li,safari:vn,mobile:bn,pointer:Pi,touch:wn,touchNative:Ci,retina:xn,mac:Ln,linux:Pn};function Cn(n){let t={bubbles:n.bubbles,cancelable:n.cancelable,composed:n.composed,detail:2,view:n.view,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,altKey:n.altKey,metaKey:n.metaKey,button:n.button,buttons:n.buttons,relatedTarget:n.relatedTarget,region:n.region},e;return n instanceof PointerEvent?(t={...t,pointerId:n.pointerId,width:n.width,height:n.height,pressure:n.pressure,tangentialPressure:n.tangentialPressure,tiltX:n.tiltX,tiltY:n.tiltY,twist:n.twist,pointerType:n.pointerType,isPrimary:n.isPrimary},e=new PointerEvent("dblclick",t)):e=new MouseEvent("dblclick",t),e}const kn=200;function Tn(n,t){n.addEventListener("dblclick",t);let e=0,i;function s(o){if(o.detail!==1){i=o.detail;return}if(o.pointerType==="mouse"||o.sourceCapabilities&&!o.sourceCapabilities.firesTouchEvents)return;const r=Ei(o);if(r.some(l=>l instanceof HTMLLabelElement&&l.attributes.for)&&!r.some(l=>l instanceof HTMLInputElement||l instanceof HTMLSelectElement))return;const a=Date.now();a-e<=kn?(i++,i===2&&o.target.dispatchEvent(Cn(o))):i=1,e=a}return n.addEventListener("click",s),{dblclick:t,simDblclick:s}}function Mn(n,t){n.removeEventListener("dblclick",t.dblclick),n.removeEventListener("click",t.simDblclick)}function ki(n){return typeof n=="string"?document.getElementById(n):n}function k(n,t,e){const i=document.createElement(n);return i.className=t??"",e?.appendChild(i),i}function At(n){const t=n.parentNode;t&&t.lastChild!==n&&t.appendChild(n)}function Bt(n){const t=n.parentNode;t&&t.firstChild!==n&&t.insertBefore(n,t.firstChild)}function mt(n,t,e){const i=t??new f(0,0);n.style.transform=`translate3d(${i.x}px,${i.y}px,0)${e?` scale(${e})`:""}`}const Ti=new WeakMap;function D(n,t){Ti.set(n,t),mt(n,t)}function gt(n){return Ti.get(n)??new f(0,0)}const qt=typeof document>"u"?{}:document.documentElement.style,be=["userSelect","WebkitUserSelect"].find(n=>n in qt);let Vt;function we(){const n=qt[be];n!=="none"&&(Vt=n,qt[be]="none")}function xe(){typeof Vt>"u"||(qt[be]=Vt,Vt=void 0)}function Le(){b(window,"dragstart",G)}function Pe(){S(window,"dragstart",G)}let Kt,Ce;function ke(n){for(;n.tabIndex===-1;)n=n.parentNode;n.style&&(Yt(),Kt=n,Ce=n.style.outlineStyle,n.style.outlineStyle="none",b(window,"keydown",Yt))}function Yt(){Kt&&(Kt.style.outlineStyle=Ce,Kt=void 0,Ce=void 0,S(window,"keydown",Yt))}function Mi(n){do n=n.parentNode;while((!n.offsetWidth||!n.offsetHeight)&&n!==document.body);return n}function Te(n){const t=n.getBoundingClientRect();return{x:t.width/n.offsetWidth||1,y:t.height/n.offsetHeight||1,boundingClientRect:t}}var zn={__proto__:null,create:k,disableImageDrag:Le,disableTextSelection:we,enableImageDrag:Pe,enableTextSelection:xe,get:ki,getPosition:gt,getScale:Te,getSizedParentNode:Mi,preventOutline:ke,restoreOutline:Yt,setPosition:D,setTransform:mt,toBack:Bt,toFront:At};let yt=new Map,Me=!1;function zi(){Me||(Me=!0,document.addEventListener("pointerdown",Si,{capture:!0}),document.addEventListener("pointermove",Oi,{capture:!0}),document.addEventListener("pointerup",Xt,{capture:!0}),document.addEventListener("pointercancel",Xt,{capture:!0}),yt=new Map)}function Sn(){document.removeEventListener("pointerdown",Si,{capture:!0}),document.removeEventListener("pointermove",Oi,{capture:!0}),document.removeEventListener("pointerup",Xt,{capture:!0}),document.removeEventListener("pointercancel",Xt,{capture:!0}),Me=!1}function Si(n){yt.set(n.pointerId,n)}function Oi(n){yt.has(n.pointerId)&&yt.set(n.pointerId,n)}function Xt(n){yt.delete(n.pointerId)}function Ct(){return[...yt.values()]}function On(){yt.clear()}var Zn={__proto__:null,cleanupPointers:On,disablePointerDetection:Sn,enablePointerDetection:zi,getPointers:Ct};function b(n,t,e,i){if(t&&typeof t=="object")for(const[s,o]of Object.entries(t))Se(n,s,o,e);else for(const s of it(t))Se(n,s,e,i);return this}const rt="_leaflet_events";function S(n,t,e,i){if(arguments.length===1)Zi(n),delete n[rt];else if(t&&typeof t=="object")for(const[s,o]of Object.entries(t))Oe(n,s,o,e);else if(t=it(t),arguments.length===2)Zi(n,s=>t.includes(s));else for(const s of t)Oe(n,s,e,i);return this}function Zi(n,t){for(const e of Object.keys(n[rt]??{})){const i=e.split(/\d/)[0];(!t||t(i))&&Oe(n,i,null,null,e)}}const ze={pointerenter:"pointerover",pointerleave:"pointerout",wheel:typeof window>"u"?!1:!("onwheel"in window)&&"mousewheel"};function Se(n,t,e,i){const s=t+P(e)+(i?`_${P(i)}`:"");if(n[rt]&&n[rt][s])return this;let o=function(a){return e.call(i||n,a||window.event)};const r=o;F.touch&&t==="dblclick"?o=Tn(n,o):"addEventListener"in n?t==="wheel"||t==="mousewheel"?n.addEventListener(ze[t]||t,o,{passive:!1}):t==="pointerenter"||t==="pointerleave"?(o=function(a){a??=window.event,Ee(n,a)&&r(a)},n.addEventListener(ze[t],o,!1)):n.addEventListener(t,r,!1):n.attachEvent(`on${t}`,o),n[rt]??={},n[rt][s]=o}function Oe(n,t,e,i,s){s??=t+P(e)+(i?`_${P(i)}`:"");const o=n[rt]&&n[rt][s];if(!o)return this;F.touch&&t==="dblclick"?Mn(n,o):"removeEventListener"in n?n.removeEventListener(ze[t]||t,o,!1):n.detachEvent(`on${t}`,o),n[rt][s]=null}function ct(n){return n.stopPropagation?n.stopPropagation():n.originalEvent?n.originalEvent._stopped=!0:n.cancelBubble=!0,this}function Ze(n){return Se(n,"wheel",ct),this}function It(n){return b(n,"pointerdown dblclick contextmenu",ct),n._leaflet_disable_click=!0,this}function G(n){return n.preventDefault?n.preventDefault():n.returnValue=!1,this}function vt(n){return G(n),ct(n),this}function Ei(n){return n.composedPath()}function Ai(n,t){if(!t)return new f(n.clientX,n.clientY);const e=Te(t),i=e.boundingClientRect;return new f((n.clientX-i.left)/e.x-t.clientLeft,(n.clientY-i.top)/e.y-t.clientTop)}function Bi(){const n=window.devicePixelRatio;return F.linux&&F.chrome?n:F.mac?n*3:n>0?2*n:1}function Ii(n){return n.deltaY&&n.deltaMode===0?-n.deltaY/Bi():n.deltaY&&n.deltaMode===1?-n.deltaY*20:n.deltaY&&n.deltaMode===2?-n.deltaY*60:(n.deltaX||n.deltaZ,0)}function Ee(n,t){let e=t.relatedTarget;if(!e)return!0;try{for(;e&&e!==n;)e=e.parentNode}catch{return!1}return e!==n}var Ae={__proto__:null,PointerEvents:Zn,disableClickPropagation:It,disableScrollPropagation:Ze,getPointerPosition:Ai,getPropagationPath:Ei,getWheelDelta:Ii,getWheelPxFactor:Bi,isExternalTarget:Ee,off:S,on:b,preventDefault:G,stop:vt,stopPropagation:ct};class Di extends Zt{run(t,e,i,s){this.stop(),this._el=t,this._inProgress=!0,this._duration=i??.25,this._easeOutPower=1/Math.max(s??.5,.2),this._startPos=gt(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()}stop(){this._inProgress&&(this._step(!0),this._complete())}_animate(){this._animId=requestAnimationFrame(this._animate.bind(this)),this._step()}_step(t){const e=+new Date-this._startTime,i=this._duration*1e3;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())}_runFrame(t,e){const i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),D(this._el,i),this.fire("step")}_complete(){cancelAnimationFrame(this._animId),this._inProgress=!1,this.fire("end")}_easeOut(t){return 1-(1-t)**this._easeOutPower}}let w=(_t=class extends Zt{initialize(t,e){e=z(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.zoom!==void 0&&(this._zoom=this._limitZoom(e.zoom)),e.center&&e.zoom!==void 0&&this.setView(new m(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=this.options.zoomAnimation,this._zoomAnimated&&this._createAnimProxy(),this._addLayers(this.options.layers)}setView(t,e,i){return e=e===void 0?this._zoom:this._limitZoom(e),t=this._limitCenter(new m(t),e,this.options.maxBounds),i??={},this._stop(),this._loaded&&!i.reset&&i!==!0&&(i.animate!==void 0&&(i.zoom={animate:i.animate,...i.zoom},i.pan={animate:i.animate,duration:i.duration,...i.pan}),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e,i.pan?.noMoveStart),this)}setZoom(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)}zoomIn(t,e){return t??=this.options.zoomDelta,this.setZoom(this._zoom+t,e)}zoomOut(t,e){return t??=this.options.zoomDelta,this.setZoom(this._zoom-t,e)}setZoomAround(t,e,i){const s=this.getZoomScale(e),o=this.getSize().divideBy(2),r=t instanceof f?t:this.latLngToContainerPoint(t),a=r.subtract(o).multiplyBy(1-1/s),l=this.containerPointToLatLng(o.add(a));return this.setView(l,e,{zoom:i})}_getBoundsCenterZoom(t,e){e??={},t=t.getBounds?t.getBounds():new C(t);const i=new f(e.paddingTopLeft||e.padding||[0,0]),s=new f(e.paddingBottomRight||e.padding||[0,0]);let o=this.getBoundsZoom(t,!1,i.add(s));if(o=typeof e.maxZoom=="number"?Math.min(e.maxZoom,o):o,o===1/0)return{center:t.getCenter(),zoom:o};const r=s.subtract(i).divideBy(2),a=this.project(t.getSouthWest(),o),l=this.project(t.getNorthEast(),o);return{center:this.unproject(a.add(l).divideBy(2).add(r),o),zoom:o}}fitBounds(t,e){if(t=new C(t),!t.isValid())throw new Error("Bounds are not valid.");const i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)}fitWorld(t){return this.fitBounds([[-90,-180],[90,180]],t)}panTo(t,e){return this.setView(t,this._zoom,{pan:e})}panBy(t,e){if(t=new f(t).round(),e??={},!t.x&&!t.y)return this.fire("moveend");if(e.animate!==!0&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Di,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){this._mapPane.classList.add("leaflet-pan-anim");const i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this}flyTo(t,e,i){if(i??={},i.animate===!1)return this.setView(t,e,i);this._stop();const s=this.project(this.getCenter()),o=this.project(t),r=this.getSize(),a=this._zoom;t=new m(t),e=e===void 0?a:this._limitZoom(e);const l=Math.max(r.x,r.y),h=l*this.getZoomScale(a,e),d=o.distanceTo(s)||1,c=1.42,u=c*c;function p(T){const N=T?-1:1,U=T?h:l,q=h*h-l*l+N*u*u*d*d,Q=2*U*u*d,ht=q/Q,me=Math.sqrt(ht*ht+1)-ht;return me<1e-9?-18:Math.log(me)}function y(T){return(Math.exp(T)-Math.exp(-T))/2}function g(T){return(Math.exp(T)+Math.exp(-T))/2}function x(T){return y(T)/g(T)}const v=p(0);function M(T){return l*(g(v)/g(v+c*T))}function B(T){return l*(g(v)*x(v+c*T)-y(v))/u}function O(T){return 1-(1-T)**1.5}const I=Date.now(),Z=(p(1)-v)/c,W=i.duration?1e3*i.duration:1e3*Z*.8,E=()=>{const T=(Date.now()-I)/W,N=O(T)*Z;T<=1?(this._flyToFrame=requestAnimationFrame(E),this._move(this.unproject(s.add(o.subtract(s).multiplyBy(B(N)/d)),a),this.getScaleZoom(l/M(N),a),{flyTo:!0})):this._move(t,e)._moveEnd(!0)};return this._moveStart(!0,i.noMoveStart),E(),this}flyToBounds(t,e){const i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)}setMaxBounds(t){return t=new C(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)}setMinZoom(t){const e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this}setMaxZoom(t){const e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this}panInsideBounds(t,e){this._enforcingBounds=!0;const i=this.getCenter(),s=this._limitCenter(i,this._zoom,new C(t));return i.equals(s)||this.panTo(s,e),this._enforcingBounds=!1,this}panInside(t,e){e??={};const i=new f(e.paddingTopLeft||e.padding||[0,0]),s=new f(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(t),a=this.getPixelBounds(),l=new L([a.min.add(i),a.max.subtract(s)]),h=l.getSize();if(!l.contains(r)){this._enforcingBounds=!0;const d=r.subtract(l.getCenter()),c=l.extend(r).getSize().subtract(h);o.x+=d.x<0?-c.x:c.x,o.y+=d.y<0?-c.y:c.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this}invalidateSize(t){if(!this._loaded)return this;t={animate:!1,pan:!0,...t===!0?{animate:!0}:t};const e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;const i=this.getSize(),s=e.divideBy(2).round(),o=i.divideBy(2).round(),r=s.subtract(o);return!r.x&&!r.y?this:(t.animate&&t.pan?this.panBy(r):(t.pan&&this._rawPanBy(r),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(this.fire.bind(this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i}))}stop(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()}locate(t){if(t=this._locateOptions={timeout:1e4,watch:!1,...t},!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;const e=this._handleGeolocationResponse.bind(this),i=this._handleGeolocationError.bind(this);return t.watch?(this._locationWatchId!==void 0&&navigator.geolocation.clearWatch(this._locationWatchId),this._locationWatchId=navigator.geolocation.watchPosition(e,i,t)):navigator.geolocation.getCurrentPosition(e,i,t),this}stopLocate(){return navigator.geolocation?.clearWatch?.(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this}_handleGeolocationError(t){if(!this._container._leaflet_id)return;const e=t.code,i=t.message||(e===1?"permission denied":e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:`Geolocation error: ${i}.`})}_handleGeolocationResponse(t){if(!this._container._leaflet_id)return;const e=t.coords.latitude,i=t.coords.longitude,s=new m(e,i),o=s.toBounds(t.coords.accuracy*2),r=this._locateOptions;if(r.setView){const l=this.getBoundsZoom(o);this.setView(s,r.maxZoom?Math.min(l,r.maxZoom):l)}const a={latlng:s,bounds:o,timestamp:t.timestamp};for(const l in t.coords)typeof t.coords[l]=="number"&&(a[l]=t.coords[l]);this.fire("locationfound",a)}addHandler(t,e){if(!e)return this;const i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this}remove(){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");delete this._container._leaflet_id,delete this._containerId,this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),this._mapPane.remove(),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(cancelAnimationFrame(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),clearTimeout(this._transitionEndTimer),clearTimeout(this._sizeTimer),this._loaded&&this.fire("unload"),this._destroyAnimProxy();for(const t of Object.values(this._layers))t.remove();for(const t of Object.values(this._panes))t.remove();return this._layers={},this._panes={},delete this._mapPane,delete this._renderer,this}createPane(t,e){const i=`leaflet-pane${t?` leaflet-${t.replace("Pane","")}-pane`:""}`,s=k("div",i,e||this._mapPane);return t&&(this._panes[t]=s),s}getCenter(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())}getZoom(){return this._zoom}getBounds(){const t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new C(e,i)}getMinZoom(){return this.options.minZoom??this._layersMinZoom??0}getMaxZoom(){return this.options.maxZoom??this._layersMaxZoom??1/0}getBoundsZoom(t,e,i){t=new C(t),i=new f(i??[0,0]);let s=this.getZoom()??0;const o=this.getMinZoom(),r=this.getMaxZoom(),a=t.getNorthWest(),l=t.getSouthEast(),h=this.getSize().subtract(i),d=new L(this.project(l,s),this.project(a,s)).getSize(),c=this.options.zoomSnap,u=h.x/d.x,p=h.y/d.y,y=e?Math.max(u,p):Math.min(u,p);return s=this.getScaleZoom(y,s),c&&(s=Math.round(s/(c/100))*(c/100),s=e?Math.ceil(s/c)*c:Math.floor(s/c)*c),Math.max(o,Math.min(r,s))}getSize(){return(!this._size||this._sizeChanged)&&(this._size=new f(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()}getPixelBounds(t,e){const i=this._getTopLeftPoint(t,e);return new L(i,i.add(this.getSize()))}getPixelOrigin(){return this._checkIfLoaded(),this._pixelOrigin}getPixelWorldBounds(t){return this.options.crs.getProjectedBounds(t??this.getZoom())}getPane(t){return typeof t=="string"?this._panes[t]:t}getPanes(){return this._panes}getContainer(){return this._container}getZoomScale(t,e){const i=this.options.crs;return e??=this._zoom,i.scale(t)/i.scale(e)}getScaleZoom(t,e){const i=this.options.crs;e??=this._zoom;const s=i.zoom(t*i.scale(e));return isNaN(s)?1/0:s}project(t,e){return e??=this._zoom,this.options.crs.latLngToPoint(new m(t),e)}unproject(t,e){return e??=this._zoom,this.options.crs.pointToLatLng(new f(t),e)}layerPointToLatLng(t){const e=new f(t).add(this.getPixelOrigin());return this.unproject(e)}latLngToLayerPoint(t){return this.project(new m(t))._round()._subtract(this.getPixelOrigin())}wrapLatLng(t){return this.options.crs.wrapLatLng(new m(t))}wrapLatLngBounds(t){return this.options.crs.wrapLatLngBounds(new C(t))}distance(t,e){return this.options.crs.distance(new m(t),new m(e))}containerPointToLayerPoint(t){return new f(t).subtract(this._getMapPanePos())}layerPointToContainerPoint(t){return new f(t).add(this._getMapPanePos())}containerPointToLatLng(t){const e=this.containerPointToLayerPoint(new f(t));return this.layerPointToLatLng(e)}latLngToContainerPoint(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(new m(t)))}pointerEventToContainerPoint(t){return Ai(t,this._container)}pointerEventToLayerPoint(t){return this.containerPointToLayerPoint(this.pointerEventToContainerPoint(t))}pointerEventToLatLng(t){return this.layerPointToLatLng(this.pointerEventToLayerPoint(t))}_initContainer(t){const e=this._container=ki(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");b(e,"scroll",this._onScroll,this),this._containerId=P(e),zi()}_initLayout(){const t=this._container;this._fadeAnimated=this.options.fadeAnimation;const e=["leaflet-container","leaflet-touch"];F.retina&&e.push("leaflet-retina"),F.safari&&e.push("leaflet-safari"),this._fadeAnimated&&e.push("leaflet-fade-anim"),t.classList.add(...e);const{position:i}=getComputedStyle(t);i!=="absolute"&&i!=="relative"&&i!=="fixed"&&i!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()}_initPanes(){const t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),D(this._mapPane,new f(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(t.markerPane.classList.add("leaflet-zoom-hide"),t.shadowPane.classList.add("leaflet-zoom-hide"))}_resetView(t,e,i){D(this._mapPane,new f(0,0));const s=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");const o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),s&&this.fire("load")}_moveStart(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this}_move(t,e,i,s){e===void 0&&(e=this._zoom);const o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),s?i?.pinch&&this.fire("zoom",i):((o||i?.pinch)&&this.fire("zoom",i),this.fire("move",i)),this}_moveEnd(t){return t&&this.fire("zoomend"),this.fire("moveend")}_stop(){return cancelAnimationFrame(this._flyToFrame),this._panAnim?.stop(),this}_rawPanBy(t){D(this._mapPane,this._getMapPanePos().subtract(t))}_getZoomSpan(){return this.getMaxZoom()-this.getMinZoom()}_panInsideMaxBounds(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)}_checkIfLoaded(){if(!this._loaded)throw new Error("Set map center and zoom first.")}_initEvents(t){this._targets={},this._targets[P(this._container)]=this,(t?S:b)(this._container,"click dblclick pointerdown pointerup pointerover pointerout pointermove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&(t?this._resizeObserver.disconnect():(this._resizeObserver||(this._resizeObserver=new ResizeObserver(this._onResize.bind(this))),this._resizeObserver.observe(this._container))),this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)}_onResize(){cancelAnimationFrame(this._resizeRequest),this._resizeRequest=requestAnimationFrame(()=>{this.invalidateSize({debounceMoveend:!0})})}_onScroll(){this._container.scrollTop=0,this._container.scrollLeft=0}_onMoveEnd(){const t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())}_findEventTargets(t,e){let i=[],s,o=t.target||t.srcElement,r=!1;const a=e==="pointerout"||e==="pointerover";for(;o;){if(s=this._targets[P(o)],s&&(e==="click"||e==="preclick")&&this._draggableMoved(s)){r=!0;break}if(s&&s.listens(e,!0)&&(a&&!Ee(o,t)||(i.push(s),a))||o===this._container)break;o=o.parentNode}return!i.length&&!r&&!a&&this.listens(e,!0)&&(i=[this]),i}_isClickDisabled(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click||!t.parentNode)return!0;t=t.parentNode}}_handleDOMEvent(t){const e=t.target??t.srcElement;if(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))return;const i=t.type;i==="pointerdown"&&ke(e),this._fireDOMEvent(t,i)}_fireDOMEvent(t,e,i){e==="click"&&this._fireDOMEvent(t,"preclick",i);let s=this._findEventTargets(t,e);if(i&&(s=i.filter(l=>l.listens(e,!0)).concat(s)),!s.length)return;e==="contextmenu"&&G(t);const o=s[0],r={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){const a=o.getLatLng&&(!o._radius||o._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(o.getLatLng()):this.pointerEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?o.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(const a of s)if(a.fire(e,r,!0),r.originalEvent._stopped||a.options.bubblingPointerEvents===!1&&_t._pointerEvents.includes(e))return}_draggableMoved(t){return t=t.dragging?.enabled()?t:this,t.dragging?.moved()||this.boxZoom?.moved()}_clearHandlers(){for(const t of this._handlers)t.disable()}whenReady(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this}_getMapPanePos(){return gt(this._mapPane)}_moved(){const t=this._getMapPanePos();return t&&!t.equals([0,0])}_getTopLeftPoint(t,e){return(t&&e!==void 0?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())}_getNewPixelOrigin(t,e){const i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()}_latLngToNewLayerPoint(t,e,i){const s=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(s)}_latLngBoundsToNewLayerBounds(t,e,i){const s=this._getNewPixelOrigin(i,e);return new L([this.project(t.getSouthWest(),e)._subtract(s),this.project(t.getNorthWest(),e)._subtract(s),this.project(t.getSouthEast(),e)._subtract(s),this.project(t.getNorthEast(),e)._subtract(s)])}_getCenterLayerPoint(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))}_getCenterOffset(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())}_limitCenter(t,e,i){if(!i)return t;const s=this.project(t,e),o=this.getSize().divideBy(2),r=new L(s.subtract(o),s.add(o)),a=this._getBoundsOffset(r,i,e);return Math.abs(a.x)<=1&&Math.abs(a.y)<=1?t:this.unproject(s.add(a),e)}_limitOffset(t,e){if(!e)return t;const i=this.getPixelBounds(),s=new L(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(s,e))}_getBoundsOffset(t,e,i){const s=new L(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=s.min.subtract(t.min),r=s.max.subtract(t.max),a=this._rebound(o.x,-r.x),l=this._rebound(o.y,-r.y);return new f(a,l)}_rebound(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))}_limitZoom(t){const e=this.getMinZoom(),i=this.getMaxZoom(),s=this.options.zoomSnap;return s&&(t=Math.round(t/s)*s),Math.max(e,Math.min(i,t))}_onPanTransitionStep(){this.fire("move")}_onPanTransitionEnd(){this._mapPane.classList.remove("leaflet-pan-anim"),this.fire("moveend")}_tryAnimatedPan(t,e){const i=this._getCenterOffset(t)._trunc();return e?.animate!==!0&&!this.getSize().contains(i)?!1:(this.panBy(i,e),!0)}_createAnimProxy(){this._proxy=k("div","leaflet-proxy leaflet-zoom-animated"),this._panes.mapPane.appendChild(this._proxy),this.on("zoomanim",this._animateProxyZoom,this),this.on("load moveend",this._animMoveEnd,this),b(this._proxy,"transitionend",this._catchTransitionEnd,this)}_animateProxyZoom(t){const e=this._proxy.style.transform;mt(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style.transform&&this._animatingZoom&&this._onZoomTransitionEnd()}_animMoveEnd(){const t=this.getCenter(),e=this.getZoom();mt(this._proxy,this.project(t,e),this.getZoomScale(e,1))}_destroyAnimProxy(){this._proxy&&(S(this._proxy,"transitionend",this._catchTransitionEnd,this),this._proxy.remove(),this.off("zoomanim",this._animateProxyZoom,this),this.off("load moveend",this._animMoveEnd,this),delete this._proxy)}_catchTransitionEnd(t){this._animatingZoom&&t.propertyName.includes("transform")&&this._onZoomTransitionEnd()}_nothingToAnimate(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length}_tryAnimatedZoom(t,e,i){if(this._animatingZoom)return!0;if(i??={},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;const s=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/s);return i.animate!==!0&&!this.getSize().contains(o)?!1:(requestAnimationFrame(()=>{this._moveStart(!0,i.noMoveStart??!1)._animateZoom(t,e,!0)}),!0)}_animateZoom(t,e,i,s){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,this._mapPane.classList.add("leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:s}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._transitionEndTimer=setTimeout(this._onZoomTransitionEnd.bind(this),250))}_onZoomTransitionEnd(){this._animatingZoom&&(this._mapPane?.classList.remove("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))}},_t.setDefaultOptions({crs:ye,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0}),fn(_t,"_pointerEvents",["click","dblclick","pointerover","pointerout","contextmenu"]),_t);const En=w,Je=class Je extends Ot{initialize(t){z(this,t)}getPosition(){return this.options.position}setPosition(t){const e=this._map;return e?.removeControl(this),this.options.position=t,e?.addControl(this),this}getContainer(){return this._container}addTo(t){this.remove(),this._map=t;const e=this._container=this.onAdd(t),i=this.getPosition(),s=t._controlCorners[i];return e.classList.add("leaflet-control"),i.includes("bottom")?s.insertBefore(e,s.firstChild):s.appendChild(e),this._map.on("unload",this.remove,this),this}remove(){return this._map?(this._container.remove(),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this}_refocusOnMap(t){this._map&&t&&!(t.screenX===0&&t.screenY===0)&&this._map.getContainer().focus()}};Je.setDefaultOptions({position:"topright"});let K=Je;w.include({addControl(n){return n.addTo(this),this},removeControl(n){return n.remove(),this},_initControlPos(){const n=this._controlCorners={},t="leaflet-",e=this._controlContainer=k("div",`${t}control-container`,this._container);function i(s,o){const r=`${t+s} ${t}${o}`;n[s+o]=k("div",r,e)}i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")},_clearControlPos(){for(const n of Object.values(this._controlCorners))n.remove();this._controlContainer.remove(),delete this._controlCorners,delete this._controlContainer}});const Qe=class Qe extends K{initialize(t,e,i){z(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(const[s,o]of Object.entries(t??{}))this._addLayer(o,s);for(const[s,o]of Object.entries(e??{}))this._addLayer(o,s,!0)}onAdd(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(const e of this._layers)e.layer.on("add remove",this._onLayerChange,this);return this.options.collapsed||t.on("resize",this._expandIfNotCollapsed,this),this._container}addTo(t){return K.prototype.addTo.call(this,t),this._expandIfNotCollapsed()}onRemove(){this._map.off("zoomend",this._checkDisabledLayers,this);for(const t of this._layers)t.layer.off("add remove",this._onLayerChange,this);this._map.off("resize",this._expandIfNotCollapsed,this)}addBaseLayer(t,e){return this._addLayer(t,e),this._map?this._update():this}addOverlay(t,e){return this._addLayer(t,e,!0),this._map?this._update():this}removeLayer(t){t.off("add remove",this._onLayerChange,this);const e=this._getLayer(P(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this}expand(){clearTimeout(this._collapseDelayTimeout),this._container.classList.add("leaflet-control-layers-expanded"),this._section.style.height=null;const t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(this._section.classList.add("leaflet-control-layers-scrollbar"),this._section.style.height=`${t}px`):this._section.classList.remove("leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this}collapse(t){if(!t||!((t.type==="pointerleave"||t.type==="pointerout")&&t.pointerType==="touch")){if(this.options.collapseDelay>0)return this._collapseDelayTimeout=setTimeout(()=>{this._container.classList.remove("leaflet-control-layers-expanded")},this.options.collapseDelay),this;this._container.classList.remove("leaflet-control-layers-expanded")}return this}_initLayout(){const t="leaflet-control-layers",e=this._container=k("div",t),i=this.options.collapsed;It(e),Ze(e);const s=this._section=k("fieldset",`${t}-list`);i&&(this._map.on("click",this.collapse,this),b(e,{pointerenter:this._expandSafely,pointerleave:this.collapse},this));const o=this._layersLink=k("a",`${t}-toggle`,e);o.href="#",o.title="Layers",o.setAttribute("role","button"),b(o,{keydown(r){r.code==="Enter"&&this._expandSafely()},click(r){G(r),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=k("div",`${t}-base`,s),this._separator=k("div",`${t}-separator`,s),this._overlaysList=k("div",`${t}-overlays`,s),e.appendChild(s)}_getLayer(t){for(const e of this._layers)if(e&&P(e.layer)===t)return e}_addLayer(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(((s,o)=>this.options.sortFunction(s.layer,o.layer,s.name,o.name))),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()}_update(){if(!this._container)return this;this._baseLayersList.replaceChildren(),this._overlaysList.replaceChildren(),this._layerControlInputs=[];let t,e,i=0;for(const s of this._layers)this._addItem(s),e||=s.overlay,t||=!s.overlay,i+=s.overlay?0:1;return this.options.hideSingleBase&&(t=t&&i>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this}_onLayerChange(t){this._handlingClick||this._update();const e=this._getLayer(P(t.target)),i=e.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;i&&this._map.fire(i,e)}_addItem(t){const e=document.createElement("label"),i=this._map.hasLayer(t.layer),s=document.createElement("input");s.type=t.overlay?"checkbox":"radio",s.className="leaflet-control-layers-selector",s.defaultChecked=i,t.overlay||(s.name=`leaflet-base-layers_${P(this)}`),this._layerControlInputs.push(s),s.layerId=P(t.layer),b(s,"click",this._onInputClick,this);const o=document.createElement("span");o.innerHTML=` ${t.name}`;const r=document.createElement("span");return e.appendChild(r),r.appendChild(s),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e}_onInputClick(t){if(this._preventClick)return;const e=this._layerControlInputs,i=[],s=[];this._handlingClick=!0;for(const o of e){const r=this._getLayer(o.layerId).layer;o.checked?i.push(r):o.checked||s.push(r)}for(const o of s)this._map.hasLayer(o)&&this._map.removeLayer(o);for(const o of i)this._map.hasLayer(o)||this._map.addLayer(o);this._handlingClick=!1,this._refocusOnMap(t)}_checkDisabledLayers(){const t=this._layerControlInputs,e=this._map.getZoom();for(const i of t){const s=this._getLayer(i.layerId).layer;i.disabled=s.options.minZoom!==void 0&&e<s.options.minZoom||s.options.maxZoom!==void 0&&e>s.options.maxZoom}}_expandIfNotCollapsed(){return this._map&&!this.options.collapsed&&this.expand(),this}_expandSafely(){const t=this._section;this._preventClick=!0,b(t,"click",G),this.expand(),setTimeout(()=>{S(t,"click",G),this._preventClick=!1})}};Qe.setDefaultOptions({collapsed:!0,collapseDelay:0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction(t,e,i,s){return i<s?-1:s<i?1:0}});let Be=Qe;const ti=class ti extends K{onAdd(t){const e="leaflet-control-zoom",i=k("div",`${e} leaflet-bar`),s=this.options;return this._zoomInButton=this._createButton(s.zoomInText,s.zoomInTitle,`${e}-in`,i,this._zoomIn),this._zoomOutButton=this._createButton(s.zoomOutText,s.zoomOutTitle,`${e}-out`,i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i}onRemove(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)}disable(){return this._disabled=!0,this._updateDisabled(),this}enable(){return this._disabled=!1,this._updateDisabled(),this}_zoomIn(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))}_zoomOut(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))}_createButton(t,e,i,s,o){const r=k("a",i,s);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),It(r),b(r,"click",vt),b(r,"click",o,this),b(r,"click",this._refocusOnMap,this),r}_updateDisabled(){const t=this._map,e="leaflet-disabled";this._zoomInButton.classList.remove(e),this._zoomOutButton.classList.remove(e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(this._zoomOutButton.classList.add(e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(this._zoomInButton.classList.add(e),this._zoomInButton.setAttribute("aria-disabled","true"))}};ti.setDefaultOptions({position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"});let Jt=ti;w.mergeOptions({zoomControl:!0}),w.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Jt,this.addControl(this.zoomControl))});const ei=class ei extends K{onAdd(t){const e="leaflet-control-scale",i=k("div",e),s=this.options;return this._addScales(s,`${e}-line`,i),t.on(s.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i}onRemove(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)}_addScales(t,e,i){t.metric&&(this._mScale=k("div",e,i)),t.imperial&&(this._iScale=k("div",e,i))}_update(){const t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)}_updateScales(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)}_updateMetric(t){const e=this._getRoundNum(t),i=e<1e3?`${e} m`:`${e/1e3} km`;this._updateScale(this._mScale,i,e/t)}_updateImperial(t){const e=t*3.2808399;let i,s,o;e>5280?(i=e/5280,s=this._getRoundNum(i),this._updateScale(this._iScale,`${s} mi`,s/i)):(o=this._getRoundNum(e),this._updateScale(this._iScale,`${o} ft`,o/e))}_updateScale(t,e,i){t.style.width=`${Math.round(this.options.maxWidth*i)}px`,t.innerHTML=e}_getRoundNum(t){const e=10**(`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}};ei.setDefaultOptions({position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1});let Ie=ei;const An='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',ii=class ii extends K{initialize(t){z(this,t),this._attributions={}}onAdd(t){t.attributionControl=this,this._container=k("div","leaflet-control-attribution"),It(this._container);for(const e of Object.values(t._layers))e.getAttribution&&this.addAttribution(e.getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container}onRemove(t){t.off("layeradd",this._addAttribution,this)}_addAttribution(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",()=>this.removeAttribution(t.layer.getAttribution())))}setPrefix(t){return this.options.prefix=t,this._update(),this}addAttribution(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this}removeAttribution(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this}_update(){if(!this._map)return;const t=Object.keys(this._attributions).filter(i=>this._attributions[i]),e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(' <span aria-hidden="true">|</span> ')}};ii.setDefaultOptions({position:"bottomright",prefix:`<a target="_blank" href="https://leafletjs.com" title="A JavaScript library for interactive maps">${An}Leaflet</a>`});let Qt=ii;w.mergeOptions({attributionControl:!0}),w.addInitHook(function(){this.options.attributionControl&&new Qt().addTo(this)}),K.Layers=Be,K.Zoom=Jt,K.Scale=Ie,K.Attribution=Qt;class nt extends Ot{initialize(t){this._map=t}enable(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)}disable(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this}enabled(){return!!this._enabled}}nt.addTo=function(n,t){return n.addHandler(t,this),this};const ft=class ft extends Zt{initialize(t,e,i,s){z(this,s),this._element=t,this._dragStartTarget=e??t,this._preventOutline=i}enable(){this._enabled||(b(this._dragStartTarget,"pointerdown",this._onDown,this),this._enabled=!0)}disable(){this._enabled&&(ft._dragging===this&&this.finishDrag(!0),S(this._dragStartTarget,"pointerdown",this._onDown,this),this._enabled=!1,this._moved=!1)}_onDown(t){if(this._moved=!1,this._element.classList.contains("leaflet-zoom-anim"))return;if(Ct().length!==1){ft._dragging===this&&this.finishDrag();return}if(ft._dragging||t.shiftKey||t.button!==0&&t.pointerType!=="touch"||(ft._dragging=this,this._preventOutline&&ke(this._element),Le(),we(),this._moving))return;this.fire("down");const e=Mi(this._element);this._startPoint=new f(t.clientX,t.clientY),this._startPos=gt(this._element),this._parentScale=Te(e),b(document,"pointermove",this._onMove,this),b(document,"pointerup pointercancel",this._onUp,this)}_onMove(t){if(Ct().length>1){this._moved=!0;return}const e=new f(t.clientX,t.clientY)._subtract(this._startPoint);!e.x&&!e.y||Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||(e.x/=this._parentScale.x,e.y/=this._parentScale.y,t.cancelable&&G(t),this._moved||(this.fire("dragstart"),this._moved=!0,document.body.classList.add("leaflet-dragging"),this._lastTarget=t.target??t.srcElement,this._lastTarget.classList.add("leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,this._lastEvent=t,this._updatePosition())}_updatePosition(){const t={originalEvent:this._lastEvent};this.fire("predrag",t),D(this._element,this._newPos),this.fire("drag",t)}_onUp(){this.finishDrag()}finishDrag(t){document.body.classList.remove("leaflet-dragging"),this._lastTarget&&(this._lastTarget.classList.remove("leaflet-drag-target"),this._lastTarget=null),S(document,"pointermove",this._onMove,this),S(document,"pointerup pointercancel",this._onUp,this),Pe(),xe();const e=this._moved&&this._moving;this._moving=!1,ft._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}};ft.setDefaultOptions({clickTolerance:3});let Dt=ft;function Ri(n,t,e){let i,s,o,r,a,l,h,d,c;const u=[1,4,2,8];for(s=0,h=n.length;s<h;s++)n[s]._code=bt(n[s],t);for(r=0;r<4;r++){for(d=u[r],i=[],s=0,h=n.length,o=h-1;s<h;o=s++)a=n[s],l=n[o],a._code&d?l._code&d||(c=te(l,a,d,t,e),c._code=bt(c,t),i.push(c)):(l._code&d&&(c=te(l,a,d,t,e),c._code=bt(c,t),i.push(c)),i.push(a));n=i}return n}function Ni(n,t){let e,i,s,o,r,a,l,h,d;if(!n||n.length===0)throw new Error("latlngs not passed");X(n)||(console.warn("latlngs are not flat! Only the first ring will be used"),n=n[0]);let c=new m([0,0]);const u=new C(n);u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(c=De(n));const y=n.length,g=[];for(e=0;e<y;e++){const v=new m(n[e]);g.push(t.project(new m([v.lat-c.lat,v.lng-c.lng])))}for(a=l=h=0,e=0,i=y-1;e<y;i=e++)s=g[e],o=g[i],r=s.y*o.x-o.y*s.x,l+=(s.x+o.x)*r,h+=(s.y+o.y)*r,a+=r*3;a===0?d=g[0]:d=[l/a,h/a];const x=t.unproject(new f(d));return new m([x.lat+c.lat,x.lng+c.lng])}function De(n){let t=0,e=0,i=0;for(const s of n){const o=new m(s);t+=o.lat,e+=o.lng,i++}return new m([t/i,e/i])}var Bn={__proto__:null,centroid:De,clipPolygon:Ri,polygonCenter:Ni};function Fi(n,t){if(!t||!n.length)return n.slice();const e=t*t;return n=Rn(n,e),n=Dn(n,e),n}function ji(n,t,e){return Math.sqrt(Rt(n,t,e,!0))}function In(n,t,e){return Rt(n,t,e)}function Dn(n,t){const e=n.length,i=new Uint8Array(e);i[0]=i[e-1]=1,Re(n,i,t,0,e-1);let s;const o=[];for(s=0;s<e;s++)i[s]&&o.push(n[s]);return o}function Re(n,t,e,i,s){let o=0,r,a,l;for(a=i+1;a<=s-1;a++)l=Rt(n[a],n[i],n[s],!0),l>o&&(r=a,o=l);o>e&&(t[r]=1,Re(n,t,e,i,r),Re(n,t,e,r,s))}function Rn(n,t){const e=[n[0]];let i=0;for(let s=1;s<n.length;s++)Nn(n[s],n[i])>t&&(e.push(n[s]),i=s);return i<n.length-1&&e.push(n[n.length-1]),e}let Hi;function Gi(n,t,e,i,s){let o=i?Hi:bt(n,e),r=bt(t,e),a,l,h;for(Hi=r;;){if(!(o|r))return[n,t];if(o&r)return!1;a=o||r,l=te(n,t,a,e,s),h=bt(l,e),a===o?(n=l,o=h):(t=l,r=h)}}function te(n,t,e,i,s){const o=t.x-n.x,r=t.y-n.y,a=i.min,l=i.max;let h,d;return e&8?(h=n.x+o*(l.y-n.y)/r,d=l.y):e&4?(h=n.x+o*(a.y-n.y)/r,d=a.y):e&2?(h=l.x,d=n.y+r*(l.x-n.x)/o):e&1&&(h=a.x,d=n.y+r*(a.x-n.x)/o),new f(h,d,s)}function bt(n,t){let e=0;return n.x<t.min.x?e|=1:n.x>t.max.x&&(e|=2),n.y<t.min.y?e|=4:n.y>t.max.y&&(e|=8),e}function Nn(n,t){const e=t.x-n.x,i=t.y-n.y;return e*e+i*i}function Rt(n,t,e,i){let s=t.x,o=t.y,r=e.x-s,a=e.y-o,l;const h=r*r+a*a;return h>0&&(l=((n.x-s)*r+(n.y-o)*a)/h,l>1?(s=e.x,o=e.y):l>0&&(s+=r*l,o+=a*l)),r=n.x-s,a=n.y-o,i?r*r+a*a:new f(s,o)}function X(n){return!Array.isArray(n[0])||typeof n[0][0]!="object"&&typeof n[0][0]<"u"}function Wi(n,t){let e,i,s,o,r,a,l,h;if(!n||n.length===0)throw new Error("latlngs not passed");X(n)||(console.warn("latlngs are not flat! Only the first ring will be used"),n=n[0]);let d=new m([0,0]);const c=new C(n);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(d=De(n));const p=n.length,y=[];for(e=0;e<p;e++){const x=new m(n[e]);y.push(t.project(new m([x.lat-d.lat,x.lng-d.lng])))}for(e=0,i=0;e<p-1;e++)i+=y[e].distanceTo(y[e+1])/2;if(i===0)h=y[0];else for(e=0,o=0;e<p-1;e++)if(r=y[e],a=y[e+1],s=r.distanceTo(a),o+=s,o>i){l=(o-i)/s,h=[a.x-l*(a.x-r.x),a.y-l*(a.y-r.y)];break}const g=t.unproject(new f(h));return new m([g.lat+d.lat,g.lng+d.lng])}var Fn={__proto__:null,_getBitCode:bt,_getEdgeIntersection:te,_sqClosestPointOnSegment:Rt,clipSegment:Gi,closestPointOnSegment:In,isFlat:X,pointToSegmentDistance:ji,polylineCenter:Wi,simplify:Fi};const Ne={project(n){return n=new m(n),new f(n.lng,n.lat)},unproject(n){return n=new f(n),new m(n.y,n.x)},bounds:new L([-180,-90],[180,90])},Fe={R:6378137,R_MINOR:6356752314245179e-9,bounds:new L([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project(n){n=new m(n);const t=Math.PI/180,e=this.R,i=this.R_MINOR/e,s=Math.sqrt(1-i*i);let o=n.lat*t;const r=s*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/((1-r)/(1+r))**(s/2);return o=-e*Math.log(Math.max(a,1e-10)),new f(n.lng*t*e,o)},unproject(n){n=new f(n);const t=180/Math.PI,e=this.R,i=this.R_MINOR/e,s=Math.sqrt(1-i*i),o=Math.exp(-n.y/e);let r=Math.PI/2-2*Math.atan(o);for(let a=0,l=.1,h;a<15&&Math.abs(l)>1e-7;a++)h=s*Math.sin(r),h=((1-h)/(1+h))**(s/2),l=Math.PI/2-2*Math.atan(o*h)-r,r+=l;return new m(r*t,n.x*t/e)}};var jn={__proto__:null,LonLat:Ne,Mercator:Fe,SphericalMercator:ge};class Hn extends dt{static code="EPSG:3395";static projection=Fe;static transformation=(()=>{const t=.5/(Math.PI*Fe.R);return new Et(t,.5,-t,.5)})()}class $i extends dt{static code="EPSG:4326";static projection=Ne;static transformation=new Et(.005555555555555556,1,-.005555555555555556,.5)}class Gn extends ot{static projection=Ne;static transformation=new Et(1,0,-1,0);static scale(t){return 2**t}static zoom(t){return Math.log(t)/Math.LN2}static distance(t,e){const i=e.lng-t.lng,s=e.lat-t.lat;return Math.sqrt(i*i+s*s)}static infinite=!0}ot.Earth=dt,ot.EPSG3395=Hn,ot.EPSG3857=ye,ot.EPSG900913=yn,ot.EPSG4326=$i,ot.Simple=Gn;const ni=class ni extends Zt{addTo(t){return t.addLayer(this),this}remove(){return this.removeFrom(this._map||this._mapToAdd)}removeFrom(t){return t?.removeLayer(this),this}getPane(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)}addInteractiveTarget(t){return this._map._targets[P(t)]=this,this}removeInteractiveTarget(t){return delete this._map._targets[P(t)],this}getAttribution(){return this.options.attribution}_layerAdd(t){const e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){const i=this.getEvents();e.on(i,this),this.once("remove",()=>e.off(i,this))}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}};ni.setDefaultOptions({pane:"overlayPane",attribution:null,bubblingPointerEvents:!0});let $=ni;w.include({addLayer(n){if(!n._layerAdd)throw new Error("The provided object is not a Layer.");const t=P(n);return this._layers[t]?this:(this._layers[t]=n,n._mapToAdd=this,n.beforeAdd&&n.beforeAdd(this),this.whenReady(n._layerAdd,n),this)},removeLayer(n){const t=P(n);return this._layers[t]?(this._loaded&&n.onRemove(this),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:n}),n.fire("remove")),n._map=n._mapToAdd=null,this):this},hasLayer(n){return P(n)in this._layers},eachLayer(n,t){for(const e of Object.values(this._layers))n.call(t,e);return this},_addLayers(n){n=n?Array.isArray(n)?n:[n]:[];for(const t of n)this.addLayer(t)},_addZoomLimit(n){(!isNaN(n.options.maxZoom)||!isNaN(n.options.minZoom))&&(this._zoomBoundLayers[P(n)]=n,this._updateZoomLevels())},_removeZoomLimit(n){const t=P(n);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels(){let n=1/0,t=-1/0;const e=this._getZoomSpan();for(const i of Object.values(this._zoomBoundLayers)){const s=i.options;n=Math.min(n,s.minZoom??1/0),t=Math.max(t,s.maxZoom??-1/0)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=n===1/0?void 0:n,e!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});class Nt extends ${initialize(t,e){z(this,e),this._layers={};for(const i of t??[])this.addLayer(i)}addLayer(t){const e=this.getLayerId(t);return this._layers[e]=t,this._map?.addLayer(t),this}removeLayer(t){const e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this}hasLayer(t){return(typeof t=="number"?t:this.getLayerId(t))in this._layers}clearLayers(){return this.eachLayer(this.removeLayer,this)}invoke(t,...e){for(const i of Object.values(this._layers))i[t]?.apply(i,e);return this}onAdd(t){this.eachLayer(t.addLayer,t)}onRemove(t){this.eachLayer(t.removeLayer,t)}eachLayer(t,e){for(const i of Object.values(this._layers))t.call(e,i);return this}getLayer(t){return this._layers[t]}getLayers(){const t=[];return this.eachLayer(t.push,t),t}setZIndex(t){return this.invoke("setZIndex",t)}getLayerId(t){return P(t)}}class ut extends Nt{addLayer(t){return this.hasLayer(t)?this:(t.addEventParent(this),Nt.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))}removeLayer(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Nt.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this}setStyle(t){return this.invoke("setStyle",t)}bringToFront(){return this.invoke("bringToFront")}bringToBack(){return this.invoke("bringToBack")}getBounds(){const t=new C;for(const e of Object.values(this._layers))t.extend(e.getBounds?e.getBounds():e.getLatLng());return t}}const si=class si extends Ot{initialize(t){z(this,t)}createIcon(t){return this._createIcon("icon",t)}createShadow(t){return this._createIcon("shadow",t)}_createIcon(t,e){const i=this._getIconUrl(t);if(!i){if(t==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}const s=this._createImg(i,e&&e.tagName==="IMG"?e:null);return this._setIconStyles(s,t),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),s}_setIconStyles(t,e){const i=this.options;let s=i[`${e}Size`];typeof s=="number"&&(s=[s,s]);const o=f.validate(s)&&new f(s),r=e==="shadow"&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0),a=f.validate(r)&&new f(r);t.className=`leaflet-marker-${e} ${i.className||""}`,a&&(t.style.marginLeft=`${-a.x}px`,t.style.marginTop=`${-a.y}px`),o&&(t.style.width=`${o.x}px`,t.style.height=`${o.y}px`)}_createImg(t,e){return e??=document.createElement("img"),e.src=t,e}_getIconUrl(t){return F.retina&&this.options[`${t}RetinaUrl`]||this.options[`${t}Url`]}};si.setDefaultOptions({popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1});let wt=si;const zt=class zt extends wt{_getIconUrl(t){zt.imagePath||(zt.imagePath=this._detectIconPath());const e=wt.prototype._getIconUrl.call(this,t);return e?(this.options.imagePath||zt.imagePath)+e:null}_stripUrl(t){const e=function(i,s,o){const r=s.exec(i);return r&&r[o]};return t=e(t,/^url\((['"])?(.+)\1\)$/,2),t&&e(t,/^(.*)marker-icon\.png$/,1)}_detectIconPath(){const t=k("div","leaflet-default-icon-path",document.body),e=this._stripUrl(getComputedStyle(t).backgroundImage);if(document.body.removeChild(t),e)return e;const i=document.querySelector('link[href$="leaflet.css"]');return i?i.href.substring(0,i.href.length-11-1):""}};zt.setDefaultOptions({iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]});let ee=zt;class Ui extends nt{initialize(t){this._marker=t}addHooks(){const t=this._marker._icon;this._draggable||(this._draggable=new Dt(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),t.classList.add("leaflet-marker-draggable")}removeHooks(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon?.classList.remove("leaflet-marker-draggable")}moved(){return this._draggable?._moved}_adjustPan(t){const e=this._marker,i=e._map,s=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=gt(e._icon),a=i.getPixelBounds(),l=i.getPixelOrigin(),h=new L(a.min._subtract(l).add(o),a.max._subtract(l).subtract(o));if(!h.contains(r)){const d=new f((Math.max(h.max.x,r.x)-h.max.x)/(a.max.x-h.max.x)-(Math.min(h.min.x,r.x)-h.min.x)/(a.min.x-h.min.x),(Math.max(h.max.y,r.y)-h.max.y)/(a.max.y-h.max.y)-(Math.min(h.min.y,r.y)-h.min.y)/(a.min.y-h.min.y)).multiplyBy(s);i.panBy(d,{animate:!1}),this._draggable._newPos._add(d),this._draggable._startPos._add(d),D(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=requestAnimationFrame(this._adjustPan.bind(this,t))}}_onDragStart(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup?.(),this._marker.fire("movestart").fire("dragstart")}_onPreDrag(t){this._marker.options.autoPan&&(cancelAnimationFrame(this._panRequest),this._panRequest=requestAnimationFrame(this._adjustPan.bind(this,t)))}_onDrag(t){const e=this._marker,i=e._shadow,s=gt(e._icon),o=e._map.layerPointToLatLng(s);i&&D(i,s),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)}_onDragEnd(t){cancelAnimationFrame(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}const oi=class oi extends ${initialize(t,e){z(this,e),this._latlng=new m(t)}onAdd(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()}onRemove(t){this.dragging?.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()}getEvents(){return{zoom:this.update,viewreset:this.update}}getLatLng(){return this._latlng}setLatLng(t){const e=this._latlng;return this._latlng=new m(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})}setZIndexOffset(t){return this.options.zIndexOffset=t,this.update()}getIcon(){return this.options.icon}setIcon(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this}getElement(){return this._icon}update(){if(this._icon&&this._map){const t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this}_initIcon(){const t=this.options,e=`leaflet-zoom-${this._zoomAnimated?"animated":"hide"}`,i=t.icon.createIcon(this._icon);let s=!1;i!==this._icon&&(this._icon&&this._removeIcon(),s=!0,t.title&&(i.title=t.title),i.tagName==="IMG"&&(i.alt=t.alt??"")),i.classList.add(e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({pointerover:this._bringToFront,pointerout:this._resetZIndex}),this.options.autoPanOnFocus&&b(i,"focus",this._panOnFocus,this);const o=t.icon.createShadow(this._shadow);let r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(o.classList.add(e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),s&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)}_removeIcon(){this.options.riseOnHover&&this.off({pointerover:this._bringToFront,pointerout:this._resetZIndex}),this.options.autoPanOnFocus&&S(this._icon,"focus",this._panOnFocus,this),this._icon.remove(),this.removeInteractiveTarget(this._icon),this._icon=null}_removeShadow(){this._shadow?.remove(),this._shadow=null}_setPos(t){this._icon&&D(this._icon,t),this._shadow&&D(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()}_updateZIndex(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)}_animateZoom(t){const e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)}_initInteraction(){if(this.options.interactive&&(this._icon.classList.add("leaflet-interactive"),this.addInteractiveTarget(this._icon),Ui)){let t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ui(this),t&&this.dragging.enable()}}setOpacity(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this}_updateOpacity(){const t=this.options.opacity;this._icon&&(this._icon.style.opacity=t),this._shadow&&(this._shadow.style.opacity=t)}_bringToFront(){this._updateZIndex(this.options.riseOffset)}_resetZIndex(){this._updateZIndex(0)}_panOnFocus(){const t=this._map;if(!t)return;const e=this.options.icon.options,i=e.iconSize?new f(e.iconSize):new f(0,0),s=e.iconAnchor?new f(e.iconAnchor):new f(0,0);t.panInside(this._latlng,{paddingTopLeft:s,paddingBottomRight:i.subtract(s)})}_getPopupAnchor(){return this.options.icon.options.popupAnchor}_getTooltipAnchor(){return this.options.icon.options.tooltipAnchor}};oi.setDefaultOptions({icon:new ee,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingPointerEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10});let Ft=oi;const ri=class ri extends ${beforeAdd(t){this._renderer=t.getRenderer(this)}onAdd(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)}onRemove(){this._renderer._removePath(this)}redraw(){return this._map&&this._renderer._updatePath(this),this}setStyle(t){return z(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.hasOwn(t,"weight")&&this._updateBounds()),this}bringToFront(){return this._renderer?._bringToFront(this),this}bringToBack(){return this._renderer?._bringToBack(this),this}getElement(){return this._path}_reset(){this._project(),this._update()}_clickTolerance(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}};ri.setDefaultOptions({stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingPointerEvents:!0});let st=ri;const ai=class ai extends st{initialize(t,e){z(this,e),this._latlng=new m(t),this._radius=this.options.radius}setLatLng(t){const e=this._latlng;return this._latlng=new m(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})}getLatLng(){return this._latlng}setRadius(t){return this.options.radius=this._radius=t,this.redraw()}getRadius(){return this._radius}setStyle(t){const e=t?.radius??this._radius;return st.prototype.setStyle.call(this,t),this.setRadius(e),this}_project(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()}_updateBounds(){const t=this._radius,e=this._radiusY??t,i=this._clickTolerance(),s=[t+i,e+i];this._pxBounds=new L(this._point.subtract(s),this._point.add(s))}_update(){this._map&&this._updatePath()}_updatePath(){this._renderer._updateCircle(this)}_empty(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)}_containsPoint(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}};ai.setDefaultOptions({fill:!0,radius:10});let jt=ai;class qi extends jt{initialize(t,e){if(z(this,e),this._latlng=new m(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius}setRadius(t){return this._mRadius=t,this.redraw()}getRadius(){return this._mRadius}getBounds(){const t=[this._radius,this._radiusY??this._radius];return new C(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))}setStyle=st.prototype.setStyle;_project(){const t=this._latlng.lng,e=this._latlng.lat,i=this._map,s=i.options.crs;if(s.distance===dt.distance){const o=Math.PI/180,r=this._mRadius/dt.R/o,a=i.project([e+r,t]),l=i.project([e-r,t]),h=a.add(l).divideBy(2),d=i.unproject(h).lat;let c=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(d*o))/(Math.cos(e*o)*Math.cos(d*o)))/o;(isNaN(c)||c===0)&&(c=r/Math.cos(Math.PI/180*e)),this._point=h.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:h.x-i.project([d,t-c]).x,this._radiusY=h.y-a.y}else{const o=s.unproject(s.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=Math.abs(this._point.x-i.latLngToLayerPoint(o).x)}this._updateBounds()}}const li=class li extends st{initialize(t,e){z(this,e),this._setLatLngs(t)}getLatLngs(){return this._latlngs}setLatLngs(t){return this._setLatLngs(t),this.redraw()}isEmpty(){return!this._latlngs.length}closestLayerPoint(t){t=new f(t);let e=1/0,i=null,s,o;const r=Rt;for(const a of this._parts)for(let l=1,h=a.length;l<h;l++){s=a[l-1],o=a[l];const d=r(t,s,o,!0);d<e&&(e=d,i=r(t,s,o))}return i&&(i.distance=Math.sqrt(e)),i}getCenter(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Wi(this._defaultShape(),this._map.options.crs)}getBounds(){return this._bounds}addLatLng(t,e){return e??=this._defaultShape(),t=new m(t),e.push(t),this._bounds.extend(t),this.redraw()}_setLatLngs(t){this._bounds=new C,this._latlngs=this._convertLatLngs(t)}_defaultShape(){return X(this._latlngs)?this._latlngs:this._latlngs[0]}_convertLatLngs(t){const e=[],i=X(t);for(let s=0,o=t.length;s<o;s++)i?(e[s]=new m(t[s]),this._bounds.extend(e[s])):e[s]=this._convertLatLngs(t[s]);return e}_project(){const t=new L;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())}_updateBounds(){const t=this._clickTolerance(),e=new f(t,t);this._rawPxBounds&&(this._pxBounds=new L([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))}_projectLatlngs(t,e,i){if(t[0]instanceof m){const o=t.map(r=>this._map.latLngToLayerPoint(r));o.forEach(r=>i.extend(r)),e.push(o)}else t.forEach(o=>this._projectLatlngs(o,e,i))}_clipPoints(){const t=this._renderer._bounds;if(this._parts=[],!this._pxBounds||!this._pxBounds.intersects(t))return;if(this.options.noClip){this._parts=this._rings;return}const e=this._parts;let i,s,o,r,a,l,h;for(i=0,o=0,r=this._rings.length;i<r;i++)for(h=this._rings[i],s=0,a=h.length;s<a-1;s++)l=Gi(h[s],h[s+1],t,s,!0),l&&(e[o]??=[],e[o].push(l[0]),(l[1]!==h[s+1]||s===a-2)&&(e[o].push(l[1]),o++))}_simplifyPoints(){const t=this._parts,e=this.options.smoothFactor;for(let i=0,s=t.length;i<s;i++)t[i]=Fi(t[i],e)}_update(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())}_updatePath(){this._renderer._updatePoly(this)}_containsPoint(t,e){let i,s,o,r,a,l;const h=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(l=this._parts[i],s=0,a=l.length,o=a-1;s<a;o=s++)if(!(!e&&s===0)&&ji(t,l[o],l[s])<=h)return!0;return!1}};li.setDefaultOptions({smoothFactor:1,noClip:!1});let at=li;const hi=class hi extends at{isEmpty(){return!this._latlngs.length||!this._latlngs[0].length}getCenter(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Ni(this._defaultShape(),this._map.options.crs)}_convertLatLngs(t){const e=at.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof m&&e[0].equals(e[i-1])&&e.pop(),e}_setLatLngs(t){at.prototype._setLatLngs.call(this,t),X(this._latlngs)&&(this._latlngs=[this._latlngs])}_defaultShape(){return X(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]}_clipPoints(){let t=this._renderer._bounds;const e=this.options.weight,i=new f(e,e);if(t=new L(t.min.subtract(i),t.max.add(i)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(const s of this._rings){const o=Ri(s,t,!0);o.length&&this._parts.push(o)}}}_updatePath(){this._renderer._updatePoly(this,!0)}_containsPoint(t){let e=!1,i,s,o,r,a,l,h,d;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(r=0,h=this._parts.length;r<h;r++)for(i=this._parts[r],a=0,d=i.length,l=d-1;a<d;l=a++)s=i[a],o=i[l],s.y>t.y!=o.y>t.y&&t.x<(o.x-s.x)*(t.y-s.y)/(o.y-s.y)+s.x&&(e=!e);return e||at.prototype._containsPoint.call(this,t,!0)}};hi.setDefaultOptions({fill:!0});let xt=hi;class pt extends ut{initialize(t,e){z(this,e),this._layers={},t&&this.addData(t)}addData(t){const e=Array.isArray(t)?t:t.features;if(e){for(const o of e)(o.geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}const i=this.options;if(i.filter&&!i.filter(t))return this;const s=ie(t,i);return s?(s.feature=oe(t),s.defaultOptions=s.options,this.resetStyle(s),i.onEachFeature&&i.onEachFeature(t,s),this.addLayer(s)):this}resetStyle(t){return t===void 0?this.eachLayer(this.resetStyle,this):(t.options=Object.create(t.defaultOptions),this._setLayerStyle(t,this.options.style),this)}setStyle(t){return this.eachLayer(e=>this._setLayerStyle(e,t))}_setLayerStyle(t,e){t.setStyle&&(typeof e=="function"&&(e=e(t.feature)),t.setStyle(e))}}function ie(n,t){const e=n.type==="Feature"?n.geometry:n,i=e?.coordinates,s=[],o=t?.pointToLayer,r=t?.coordsToLatLng??je;let a,l;if(!i&&!e)return null;switch(e.type){case"Point":return a=r(i),Vi(o,n,a,t);case"MultiPoint":for(const h of i)a=r(h),s.push(Vi(o,n,a,t));return new ut(s);case"LineString":case"MultiLineString":return l=ne(i,e.type==="LineString"?0:1,r),new at(l,t);case"Polygon":case"MultiPolygon":return l=ne(i,e.type==="Polygon"?1:2,r),new xt(l,t);case"GeometryCollection":for(const h of e.geometries){const d=ie({geometry:h,type:"Feature",properties:n.properties},t);d&&s.push(d)}return new ut(s);case"FeatureCollection":for(const h of e.features){const d=ie(h,t);d&&s.push(d)}return new ut(s);default:throw new Error("Invalid GeoJSON object.")}}function Vi(n,t,e,i){return n?n(t,e):new Ft(e,i?.markersInheritOptions&&i)}function je(n){return new m(n[1],n[0],n[2])}function ne(n,t,e){return n.map(i=>t?ne(i,t-1,e):(e||je)(i))}function He(n,t){return n=new m(n),n.alt!==void 0?[et(n.lng,t),et(n.lat,t),et(n.alt,t)]:[et(n.lng,t),et(n.lat,t)]}function se(n,t,e,i){const s=n.map(o=>t?se(o,X(o)?0:t-1,e,i):He(o,i));return!t&&e&&s.length>0&&s.push(s[0].slice()),s}function kt(n,t){return n.feature?{...n.feature,geometry:t}:oe(t)}function oe(n){return n.type==="Feature"||n.type==="FeatureCollection"?n:{type:"Feature",properties:{},geometry:n}}const Ge={toGeoJSON(n){return kt(this,{type:"Point",coordinates:He(this.getLatLng(),n)})}};Ft.include(Ge),qi.include(Ge),jt.include(Ge),at.include({toGeoJSON(n){const t=!X(this._latlngs),e=se(this._latlngs,t?1:0,!1,n);return kt(this,{type:`${t?"Multi":""}LineString`,coordinates:e})}}),xt.include({toGeoJSON(n){const t=!X(this._latlngs),e=t&&!X(this._latlngs[0]);let i=se(this._latlngs,e?2:t?1:0,!0,n);return t||(i=[i]),kt(this,{type:`${e?"Multi":""}Polygon`,coordinates:i})}}),Nt.include({toMultiPoint(n){const t=[];return this.eachLayer(e=>{t.push(e.toGeoJSON(n).geometry.coordinates)}),kt(this,{type:"MultiPoint",coordinates:t})},toGeoJSON(n){const t=this.feature?.geometry?.type;if(t==="MultiPoint")return this.toMultiPoint(n);const e=t==="GeometryCollection",i=[];return this.eachLayer(s=>{if(s.toGeoJSON){const o=s.toGeoJSON(n);if(e)i.push(o.geometry);else{const r=oe(o);r.type==="FeatureCollection"?i.push.apply(i,r.features):i.push(r)}}}),e?kt(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}});const di=class di extends ${initialize(t){z(this,t)}onAdd(){this._container||(this._initContainer(),this._container.classList.add("leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._resizeContainer(),this._onMoveEnd()}onRemove(){this._destroyContainer()}getEvents(){const t={viewreset:this._reset,zoom:this._onZoom,moveend:this._onMoveEnd,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),this.options.continuous&&(t.move=this._onMoveEnd),t}_onAnimZoom(t){this._updateTransform(t.center,t.zoom)}_onZoom(){this._updateTransform(this._map.getCenter(),this._map.getZoom())}_updateTransform(t,e){const i=this._map.getZoomScale(e,this._zoom),s=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),r=s.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));mt(this._container,r,i)}_onMoveEnd(t){const e=this.options.padding,i=this._map.getSize(),s=this._map.containerPointToLayerPoint(i.multiplyBy(-e)).round();this._bounds=new L(s,s.add(i.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom(),this._updateTransform(this._center,this._zoom),this._onSettled(t),this._resizeContainer()}_reset(){this._onSettled(),this._updateTransform(this._center,this._zoom),this._onViewReset()}_initContainer(){this._container=k("div")}_destroyContainer(){S(this._container),this._container.remove(),delete this._container}_resizeContainer(){const t=this.options.padding,e=this._map.getSize().multiplyBy(1+t*2).round();return this._container.style.width=`${e.x}px`,this._container.style.height=`${e.y}px`,e}_onZoomEnd(){}_onViewReset(){}_onSettled(){}};di.setDefaultOptions({padding:.1,continuous:!1});let re=di;const ci=class ci extends ${initialize(t,e,i){this._url=t,this._bounds=new C(e),z(this,i)}onAdd(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(this._image.classList.add("leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()}onRemove(){this._image.remove(),this.options.interactive&&this.removeInteractiveTarget(this._image)}setOpacity(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this}setStyle(t){return t.opacity&&this.setOpacity(t.opacity),this}bringToFront(){return this._map&&At(this._image),this}bringToBack(){return this._map&&Bt(this._image),this}setUrl(t){return this._url=t,this._image&&(this._image.src=t),this}setBounds(t){return this._bounds=new C(t),this._map&&this._reset(),this}getEvents(){const t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t}setZIndex(t){return this.options.zIndex=t,this._updateZIndex(),this}getBounds(){return this._bounds}getElement(){return this._image}_initImage(){const t=this._url.tagName==="IMG",e=this._image=t?this._url:k("img");if(e.classList.add("leaflet-image-layer"),this._zoomAnimated&&e.classList.add("leaflet-zoom-animated"),this.options.className&&e.classList.add(...it(this.options.className)),e.onselectstart=V,e.onpointermove=V,e.onload=this.fire.bind(this,"load"),e.onerror=this._overlayOnError.bind(this),(this.options.crossOrigin||this.options.crossOrigin==="")&&(e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),e.decoding=this.options.decoding,this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt}_animateZoom(t){const e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;mt(this._image,i,e)}_reset(){const t=this._image,e=new L(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();D(t,e.min),t.style.width=`${i.x}px`,t.style.height=`${i.y}px`}_updateOpacity(){this._image.style.opacity=this.options.opacity}_updateZIndex(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)}_overlayOnError(){this.fire("error");const t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}getCenter(){return this._bounds.getCenter()}};ci.setDefaultOptions({opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:"",decoding:"auto"});let Ht=ci;const ui=class ui extends Ht{_initImage(){const t=this._url.tagName==="VIDEO",e=this._image=t?this._url:k("video");if(e.classList.add("leaflet-image-layer"),this._zoomAnimated&&e.classList.add("leaflet-zoom-animated"),this.options.className&&e.classList.add(...it(this.options.className)),b(e,"pointerdown",i=>{e.controls&&ct(i)}),e.onloadeddata=this.fire.bind(this,"load"),t){const i=e.getElementsByTagName("source"),s=i.map(o=>o.src);this._url=i.length>0?s:[e.src];return}Array.isArray(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.hasOwn(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.controls=!!this.options.controls,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(const i of this._url){const s=k("source");s.src=i,e.appendChild(s)}}};ui.setDefaultOptions({autoplay:!0,controls:!1,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0});let We=ui;class Wn extends Ht{_initImage(){const t=this._image=this._url;t.classList.add("leaflet-image-layer"),this._zoomAnimated&&t.classList.add("leaflet-zoom-animated"),this.options.className&&t.classList.add(...it(this.options.className)),t.onselectstart=V,t.onpointermove=V}}const pi=class pi extends ${initialize(t,e){t instanceof m||Array.isArray(t)?(this._latlng=new m(t),z(this,e)):(z(this,t),this._source=e),this.options.content&&(this._content=this.options.content)}openOn(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this}close(){return this._map?.removeLayer(this),this}toggle(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this}onAdd(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&(this._container.style.opacity=0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&(this._container.style.opacity=1),this.bringToFront(),this.options.interactive&&(this._container.classList.add("leaflet-interactive"),this.addInteractiveTarget(this._container))}onRemove(t){t._fadeAnimated?(this._container.style.opacity=0,this._removeTimeout=setTimeout(()=>this._container.remove(),200)):this._container.remove(),this.options.interactive&&(this._container.classList.remove("leaflet-interactive"),this.removeInteractiveTarget(this._container))}getLatLng(){return this._latlng}setLatLng(t){return this._latlng=new m(t),this._map&&(this._updatePosition(),this._adjustPan()),this}getContent(){return this._content}setContent(t){return this._content=t,this.update(),this}getElement(){return this._container}update(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())}getEvents(){const t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t}isOpen(){return!!this._map&&this._map.hasLayer(this)}bringToFront(){return this._map&&At(this._container),this}bringToBack(){return this._map&&Bt(this._container),this}_prepareOpen(t){let e=this._source;if(!e._map)return!1;if(e instanceof ut){e=null;for(const i of Object.values(this._source._layers))if(i._map){e=i;break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else if(e.getBounds)t=e.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(t),this._map&&this.update(),!0}_updateContent(){if(!this._content)return;const t=this._contentNode,e=typeof this._content=="function"?this._content(this._source??this):this._content;if(typeof e=="string")t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}_updatePosition(){if(!this._map)return;const t=this._map.latLngToLayerPoint(this._latlng),e=this._getAnchor();let i=new f(this.options.offset);this._zoomAnimated?D(this._container,t.add(e)):i=i.add(t).add(e);const s=this._containerBottom=-i.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+i.x;this._container.style.bottom=`${s}px`,this._container.style.left=`${o}px`}_getAnchor(){return[0,0]}};pi.setDefaultOptions({interactive:!1,offset:[0,0],className:"",pane:void 0,content:""});let Y=pi;w.include({_initOverlay(n,t,e,i){let s=t;return s instanceof n||(s=new n(i).setContent(t)),e&&s.setLatLng(e),s}}),$.include({_initOverlay(n,t,e,i){let s=e;return s instanceof n?(z(s,i),s._source=this):(s=t&&!i?t:new n(i,this),s.setContent(e)),s}});const _i=class _i extends Y{openOn(t){return t=arguments.length?t:this._source._map,!t.hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Y.prototype.openOn.call(this,t)}onAdd(t){Y.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof st||this._source.on("preclick",ct))}onRemove(t){Y.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof st||this._source.off("preclick",ct))}getEvents(){const t=Y.prototype.getEvents.call(this);return(this.options.closeOnClick??this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t}_initLayout(){const t="leaflet-popup",e=this._container=k("div",`${t} ${this.options.className||""} leaflet-zoom-animated`),i=this._wrapper=k("div",`${t}-content-wrapper`,e);if(this._contentNode=k("div",`${t}-content`,i),It(e),Ze(this._contentNode),b(e,"contextmenu",ct),this._tipContainer=k("div",`${t}-tip-container`,e),this._tip=k("div",`${t}-tip`,this._tipContainer),this.options.closeButton){const s=this._closeButton=k("a",`${t}-close-button`,e);s.setAttribute("role","button"),s.setAttribute("aria-label",this.options.closeButtonLabel),s.href="#close",s.innerHTML='<span aria-hidden="true">&#215;</span>',b(s,"click",o=>{G(o),this.close()})}this.options.trackResize&&(this._resizeObserver=new ResizeObserver((s=>{this._map&&(this._containerWidth=s[0]?.contentRect?.width,this._containerHeight=s[0]?.contentRect?.height,this._updateLayout(),this._updatePosition(),this._adjustPan())})),this._resizeObserver.observe(this._contentNode))}_updateLayout(){const t=this._contentNode,e=t.style;e.maxWidth=`${this.options.maxWidth}px`,e.minWidth=`${this.options.minWidth}px`;const i=this._containerHeight??t.offsetHeight,s=this.options.maxHeight,o="leaflet-popup-scrolled";s&&i>s?(e.height=`${s}px`,t.classList.add(o)):t.classList.remove(o),this._containerWidth=this._container.offsetWidth,this._containerHeight=this._container.offsetHeight}_animateZoom(t){const e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();D(this._container,e.add(i))}_adjustPan(){if(!this.options.autoPan)return;if(this._map._panAnim?.stop(),this._autopanning){this._autopanning=!1;return}const t=this._map,e=parseInt(getComputedStyle(this._container).marginBottom,10)||0,i=this._containerHeight+e,s=this._containerWidth,o=new f(this._containerLeft,-i-this._containerBottom);o._add(gt(this._container));const r=t.layerPointToContainerPoint(o),a=new f(this.options.autoPanPadding),l=new f(this.options.autoPanPaddingTopLeft??a),h=new f(this.options.autoPanPaddingBottomRight??a),d=t.getSize();let c=0,u=0;r.x+s+h.x>d.x&&(c=r.x+s-d.x+h.x),r.x-c-l.x<0&&(c=r.x-l.x),r.y+i+h.y>d.y&&(u=r.y+i-d.y+h.y),r.y-u-l.y<0&&(u=r.y-l.y),(c||u)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([c,u]))}_getAnchor(){return new f(this._source?._getPopupAnchor?this._source._getPopupAnchor():[0,0])}};_i.setDefaultOptions({pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,closeButtonLabel:"Close popup",autoClose:!0,closeOnEscapeKey:!0,className:"",trackResize:!0});let Gt=_i;w.mergeOptions({closePopupOnClick:!0}),w.include({openPopup(n,t,e){return this._initOverlay(Gt,n,t,e).openOn(this),this},closePopup(n){return n=arguments.length?n:this._popup,n?.close(),this}}),$.include({bindPopup(n,t){return this._popup=this._initOverlay(Gt,this._popup,n,t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup(){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(n){return this._popup&&(this instanceof ut||(this._popup._source=this),this._popup._prepareOpen(n||this._latlng)&&this._popup.openOn(this._map)),this},closePopup(){return this._popup?.close(),this},togglePopup(){return this._popup?.toggle(this),this},isPopupOpen(){return this._popup?.isOpen()??!1},setPopupContent(n){return this._popup?.setContent(n),this},getPopup(){return this._popup},_openPopup(n){if(!this._popup||!this._map)return;vt(n);const t=n.propagatedFrom??n.target;if(this._popup._source===t&&!(t instanceof st)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(n.latlng);return}this._popup._source=t,this.openPopup(n.latlng)},_movePopup(n){this._popup.setLatLng(n.latlng)},_onKeyPress(n){n.originalEvent.code==="Enter"&&this._openPopup(n)}});const fi=class fi extends Y{onAdd(t){Y.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(t){Y.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))}getEvents(){const t=Y.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t}_initLayout(){const t="leaflet-tooltip",e=`${t} ${this.options.className||""} leaflet-zoom-${this._zoomAnimated?"animated":"hide"}`;this._contentNode=this._container=k("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id",`leaflet-tooltip-${P(this)}`)}_updateLayout(){}_adjustPan(){}_setPosition(t){let e,i,s=this.options.direction;const o=this._map,r=this._container,a=o.latLngToContainerPoint(o.getCenter()),l=o.layerPointToContainerPoint(t),h=r.offsetWidth,d=r.offsetHeight,c=new f(this.options.offset),u=this._getAnchor();s==="top"?(e=h/2,i=d):s==="bottom"?(e=h/2,i=0):s==="center"?(e=h/2,i=d/2):s==="right"?(e=0,i=d/2):s==="left"?(e=h,i=d/2):l.x<a.x?(s="right",e=0,i=d/2):(s="left",e=h+(c.x+u.x)*2,i=d/2),t=t.subtract(new f(e,i,!0)).add(c).add(u),r.classList.remove("leaflet-tooltip-right","leaflet-tooltip-left","leaflet-tooltip-top","leaflet-tooltip-bottom"),r.classList.add(`leaflet-tooltip-${s}`),D(r,t)}_updatePosition(){const t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)}setOpacity(t){this.options.opacity=t,this._container&&(this._container.style.opacity=t)}_animateZoom(t){const e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)}_getAnchor(){return new f(this._source?._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}};fi.setDefaultOptions({pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9});let Wt=fi;w.include({openTooltip(n,t,e){return this._initOverlay(Wt,n,t,e).openOn(this),this},closeTooltip(n){return n.close(),this}}),$.include({bindTooltip(n,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Wt,this._tooltip,n,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions(n){if(!n&&this._tooltipHandlersAdded)return;const t=n?"off":"on",e={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?e.add=this._openTooltip:(e.pointerover=this._openTooltip,e.pointerout=this.closeTooltip,e.click=this._openTooltip,this._map?this._addFocusListeners(n):e.add=()=>this._addFocusListeners(n)),this._tooltip.options.sticky&&(e.pointermove=this._moveTooltip),this[t](e),this._tooltipHandlersAdded=!n},openTooltip(n){return this._tooltip&&(this instanceof ut||(this._tooltip._source=this),this._tooltip._prepareOpen(n)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip(){if(this._tooltip)return this._tooltip.close()},toggleTooltip(){return this._tooltip?.toggle(this),this},isTooltipOpen(){return this._tooltip.isOpen()},setTooltipContent(n){return this._tooltip?.setContent(n),this},getTooltip(){return this._tooltip},_addFocusListeners(n){this.getElement?this._addFocusListenersOnLayer(this,n):this.eachLayer&&this.eachLayer(t=>this._addFocusListenersOnLayer(t,n),this)},_addFocusListenersOnLayer(n,t){const e=typeof n.getElement=="function"&&n.getElement();if(e){const i=t?"off":"on";t||(e._leaflet_focus_handler&&S(e,"focus",e._leaflet_focus_handler,this),e._leaflet_focus_handler=()=>{this._tooltip&&(this._tooltip._source=n,this.openTooltip())}),e._leaflet_focus_handler&&Ae[i](e,"focus",e._leaflet_focus_handler,this),Ae[i](e,"blur",this.closeTooltip,this),t&&delete e._leaflet_focus_handler}},_setAriaDescribedByOnLayer(n){(typeof n.getElement=="function"&&n.getElement())?.setAttribute?.("aria-describedby",this._tooltip._container.id)},_openTooltip(n){if(!(!this._tooltip||!this._map)){if(this._map.dragging?.moving()){n.type==="add"&&!this._moveEndOpensTooltip&&(this._moveEndOpensTooltip=!0,this._map.once("moveend",()=>{this._moveEndOpensTooltip=!1,this._openTooltip(n)}));return}this._tooltip._source=n.propagatedFrom??n.target,this.openTooltip(this._tooltip.options.sticky?n.latlng:void 0)}},_moveTooltip(n){let t=n.latlng,e,i;this._tooltip.options.sticky&&n.originalEvent&&(e=this._map.pointerEventToContainerPoint(n.originalEvent),i=this._map.containerPointToLayerPoint(e),t=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(t)}});const mi=class mi extends wt{createIcon(t){const e=t&&t.tagName==="DIV"?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(e.replaceChildren(),e.appendChild(i.html)):e.innerHTML=i.html!==!1?i.html:"",i.bgPos){const s=new f(i.bgPos);e.style.backgroundPosition=`${-s.x}px ${-s.y}px`}return this._setIconStyles(e,"icon"),e}createShadow(){return null}};mi.setDefaultOptions({iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"});let $e=mi;wt.Default=ee;const gi=class gi extends ${initialize(t){z(this,t)}onAdd(){this._initContainer(),this._levels={},this._tiles={},this._resetView()}beforeAdd(t){t._addZoomLimit(this)}onRemove(t){this._removeAllTiles(),this._container.remove(),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0,clearTimeout(this._pruneTimeout)}bringToFront(){return this._map&&(At(this._container),this._setAutoZIndex(Math.max)),this}bringToBack(){return this._map&&(Bt(this._container),this._setAutoZIndex(Math.min)),this}getContainer(){return this._container}setOpacity(t){return this.options.opacity=t,this._updateOpacity(),this}setZIndex(t){return this.options.zIndex=t,this._updateZIndex(),this}isLoading(){return this._loading}redraw(){if(this._map){this._removeAllTiles();const t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this}getEvents(){const t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=bi(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t}createTile(){return document.createElement("div")}getTileSize(){const t=this.options.tileSize;return t instanceof f?t:new f(t,t)}_updateZIndex(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)}_setAutoZIndex(t){const e=this.getPane().children;let i=-t(-1/0,1/0);for(const s of e){const o=s.style.zIndex;s!==this._container&&o&&(i=t(i,+o))}isFinite(i)&&(this.options.zIndex=i+t(-1,1),this._updateZIndex())}_updateOpacity(){if(!this._map)return;this._container.style.opacity=this.options.opacity;const t=+new Date;let e=!1,i=!1;for(const s of Object.values(this._tiles??{})){if(!s.current||!s.loaded)continue;const o=Math.min(1,(t-s.loaded)/200);s.el.style.opacity=o,o<1?e=!0:(s.active?i=!0:this._onOpaqueTile(s),s.active=!0)}i&&!this._noPrune&&this._pruneTiles(),e&&(cancelAnimationFrame(this._fadeFrame),this._fadeFrame=requestAnimationFrame(this._updateOpacity.bind(this)))}_onOpaqueTile(){}_initContainer(){this._container||(this._container=k("div",`leaflet-layer ${this.options.className??""}`),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))}_updateLevels(){const t=this._tileZoom,e=this.options.maxZoom;if(t===void 0)return;for(let o of Object.keys(this._levels))o=Number(o),this._levels[o].el.children.length||o===t?(this._levels[o].el.style.zIndex=e-Math.abs(t-o),this._onUpdateLevel(o)):(this._levels[o].el.remove(),this._removeTilesAtZoom(o),this._onRemoveLevel(o),delete this._levels[o]);let i=this._levels[t];const s=this._map;return i||(i=this._levels[t]={},i.el=k("div","leaflet-tile-container leaflet-zoom-animated",this._container),i.el.style.zIndex=e,i.origin=s.project(s.unproject(s.getPixelOrigin()),t).round(),i.zoom=t,this._setZoomTransform(i,s.getCenter(),s.getZoom()),V(i.el.offsetWidth),this._onCreateLevel(i)),this._level=i,i}_onUpdateLevel(){}_onRemoveLevel(){}_onCreateLevel(){}_pruneTiles(){if(!this._map)return;const t=this._map.getZoom();if(t>this.options.maxZoom||t<this.options.minZoom){this._removeAllTiles();return}for(const e of Object.values(this._tiles))e.retain=e.current;for(const e of Object.values(this._tiles))if(e.current&&!e.active){const i=e.coords;this._retainParent(i.x,i.y,i.z,i.z-5)||this._retainChildren(i.x,i.y,i.z,i.z+2)}for(const[e,i]of Object.entries(this._tiles))i.retain||this._removeTile(e)}_removeTilesAtZoom(t){for(const[e,i]of Object.entries(this._tiles))i.coords.z===t&&this._removeTile(e)}_removeAllTiles(){for(const t of Object.keys(this._tiles))this._removeTile(t)}_invalidateAll(){for(const t of Object.keys(this._levels))this._levels[t].el.remove(),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0}_retainParent(t,e,i,s){const o=Math.floor(t/2),r=Math.floor(e/2),a=i-1,l=new f(+o,+r);l.z=+a;const h=this._tileCoordsToKey(l),d=this._tiles[h];return d?.active?(d.retain=!0,!0):(d?.loaded&&(d.retain=!0),a>s?this._retainParent(o,r,a,s):!1)}_retainChildren(t,e,i,s){for(let o=2*t;o<2*t+2;o++)for(let r=2*e;r<2*e+2;r++){const a=new f(o,r);a.z=i+1;const l=this._tileCoordsToKey(a),h=this._tiles[l];if(h?.active){h.retain=!0;continue}else h?.loaded&&(h.retain=!0);i+1<s&&this._retainChildren(o,r,i+1,s)}}_resetView(t){const e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)}_animateZoom(t){this._setView(t.center,t.zoom,!0,t.noUpdate)}_clampZoom(t){const e=this.options;return e.minNativeZoom!==void 0&&t<e.minNativeZoom?e.minNativeZoom:e.maxNativeZoom!==void 0&&e.maxNativeZoom<t?e.maxNativeZoom:t}_setView(t,e,i,s){let o=Math.round(e);this.options.maxZoom!==void 0&&o>this.options.maxZoom||this.options.minZoom!==void 0&&o<this.options.minZoom?o=void 0:o=this._clampZoom(o);const r=this.options.updateWhenZooming&&o!==this._tileZoom;(!s||r)&&(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),o!==void 0&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)}_setZoomTransforms(t,e){for(const i of Object.values(this._levels))this._setZoomTransform(i,t,e)}_setZoomTransform(t,e,i){const s=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(s).subtract(this._map._getNewPixelOrigin(e,i)).round();mt(t.el,o,s)}_resetGrid(){const t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),s=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],s).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],s).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],s).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],s).y/i.y)]}_onMoveEnd(){!this._map||this._map._animatingZoom||this._update()}_getTiledPixelBounds(t){const e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),s=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(s*2);return new L(o.subtract(r),o.add(r))}_update(t){const e=this._map;if(!e)return;const i=this._clampZoom(e.getZoom());if(t===void 0&&(t=e.getCenter()),this._tileZoom===void 0)return;const s=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(s),r=o.getCenter(),a=[],l=this.options.keepBuffer,h=new L(o.getBottomLeft().subtract([l,-l]),o.getTopRight().add([l,-l]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(const d of Object.values(this._tiles)){const c=d.coords;(c.z!==this._tileZoom||!h.contains(new f(c.x,c.y)))&&(d.current=!1)}if(Math.abs(i-this._tileZoom)>1){this._setView(t,i);return}for(let d=o.min.y;d<=o.max.y;d++)for(let c=o.min.x;c<=o.max.x;c++){const u=new f(c,d);if(u.z=this._tileZoom,!this._isValidTile(u))continue;const p=this._tiles[this._tileCoordsToKey(u)];p?p.current=!0:a.push(u)}if(a.sort((d,c)=>d.distanceTo(r)-c.distanceTo(r)),a.length!==0){this._loading||(this._loading=!0,this.fire("loading"));const d=document.createDocumentFragment();for(const c of a)this._addTile(c,d);this._level.el.appendChild(d)}}_isValidTile(t){const e=this._map.options.crs;if(!e.infinite){const s=this._globalTileRange;if(!e.wrapLng&&(t.x<s.min.x||t.x>s.max.x)||!e.wrapLat&&(t.y<s.min.y||t.y>s.max.y))return!1}if(!this.options.bounds)return!0;const i=this._tileCoordsToBounds(t);return new C(this.options.bounds).overlaps(i)}_keyToBounds(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))}_tileCoordsToNwSe(t){const e=this._map,i=this.getTileSize(),s=t.scaleBy(i),o=s.add(i),r=e.unproject(s,t.z),a=e.unproject(o,t.z);return[r,a]}_tileCoordsToBounds(t){const e=this._tileCoordsToNwSe(t);let i=new C(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i}_tileCoordsToKey(t){return`${t.x}:${t.y}:${t.z}`}_keyToTileCoords(t){const e=t.split(":"),i=new f(+e[0],+e[1]);return i.z=+e[2],i}_removeTile(t){const e=this._tiles[t];e&&(e.el.remove(),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))}_initTile(t){t.classList.add("leaflet-tile");const e=this.getTileSize();t.style.width=`${e.x}px`,t.style.height=`${e.y}px`,t.onselectstart=V,t.onpointermove=V}_addTile(t,e){const i=this._getTilePos(t),s=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),this._tileReady.bind(this,t));this._initTile(o),this.createTile.length<2&&requestAnimationFrame(this._tileReady.bind(this,t,null,o)),D(o,i),this._tiles[s]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})}_tileReady(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});const s=this._tileCoordsToKey(t);i=this._tiles[s],i&&(i.loaded=+new Date,this._map._fadeAnimated?(i.el.style.opacity=0,cancelAnimationFrame(this._fadeFrame),this._fadeFrame=requestAnimationFrame(this._updateOpacity.bind(this))):(i.active=!0,this._pruneTiles()),e||(i.el.classList.add("leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),this._map._fadeAnimated?this._pruneTimeout=setTimeout(this._pruneTiles.bind(this),250):requestAnimationFrame(this._pruneTiles.bind(this))))}_getTilePos(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)}_wrapCoords(t){const e=new f(this._wrapX?St(t.x,this._wrapX):t.x,this._wrapY?St(t.y,this._wrapY):t.y);return e.z=t.z,e}_pxBoundsToTileRange(t){const e=this.getTileSize();return new L(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))}_noTilesToLoad(){return Object.values(this._tiles).every(t=>t.loaded)}};gi.setDefaultOptions({tileSize:256,opacity:1,updateWhenIdle:F.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2});let Lt=gi;const yi=class yi extends Lt{initialize(t,e){if(this._url=t,e=z(this,e),e.attribution===null&&URL.canParse(t)){const i=new URL(t).hostname;["tile.openstreetmap.org","tile.osm.org"].some(o=>i.endsWith(o))&&(e.attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors')}e.detectRetina&&F.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),typeof e.subdomains=="string"&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)}setUrl(t,e){return this._url===t&&e===void 0&&(e=!0),this._url=t,e||this.redraw(),this}createTile(t,e){const i=document.createElement("img");return b(i,"load",this._tileOnLoad.bind(this,e,i)),b(i,"error",this._tileOnError.bind(this,e,i)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(i.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i}getTileUrl(t){const e=Object.create(this.options);if(Object.assign(e,{r:F.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()}),this._map&&!this._map.options.crs.infinite){const i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return wi(this._url,e)}_tileOnLoad(t,e){t(null,e)}_tileOnError(t,e,i){const s=this.options.errorTileUrl;s&&e.getAttribute("src")!==s&&(e.src=s),t(i,e)}_onTileRemove(t){t.tile.onload=null}_getZoomForUrl(){let t=this._tileZoom;const e=this.options.maxZoom,i=this.options.zoomReverse,s=this.options.zoomOffset;return i&&(t=e-t),t+s}_getSubdomain(t){const e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]}_abortLoading(){let t,e;for(t of Object.keys(this._tiles))if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=V,e.onerror=V,!e.complete)){e.src=Ut;const i=this._tiles[t].coords;e.remove(),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}}_removeTile(t){const e=this._tiles[t];if(e)return e.el.setAttribute("src",Ut),Lt.prototype._removeTile.call(this,t)}_tileReady(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===Ut))return Lt.prototype._tileReady.call(this,t,e,i)}_clampZoom(t){return Math.round(Lt.prototype._clampZoom.call(this,t))}};yi.setDefaultOptions({minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1});let Pt=yi;const fe=class fe extends Pt{initialize(t,e){this._url=t;const i={...this.defaultWmsParams};for(const r of Object.keys(e))r in this.options||(i[r]=e[r]);e=z(this,e);const s=e.detectRetina&&F.retina?2:1,o=this.getTileSize();i.width=o.x*s,i.height=o.y*s,this.wmsParams=i}onAdd(t){this._crs=this.options.crs??t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);const e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Pt.prototype.onAdd.call(this,t)}getTileUrl(t){const e=this._tileCoordsToNwSe(t),i=this._crs,s=new L(i.project(e[0]),i.project(e[1])),o=s.min,r=s.max,a=(this._wmsVersion>=1.3&&this._crs===$i?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),l=new URL(Pt.prototype.getTileUrl.call(this,t));for(const[h,d]of Object.entries({...this.wmsParams,bbox:a}))l.searchParams.append(this.options.uppercase?h.toUpperCase():h,d);return l.toString()}setParams(t,e){return Object.assign(this.wmsParams,t),e||this.redraw(),this}};fe.prototype.defaultWmsParams={service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},fe.setDefaultOptions({crs:null,uppercase:!1});let Ue=fe;Pt.WMS=Ue;class J extends re{initialize(t){z(this,{...t,continuous:!1}),P(this),this._layers??={}}onAdd(t){super.onAdd(t),this.on("update",this._updatePaths,this)}onRemove(){super.onRemove(),this.off("update",this._updatePaths,this)}_onZoomEnd(){for(const t of Object.values(this._layers))t._project()}_updatePaths(){for(const t of Object.values(this._layers))t._update()}_onViewReset(){for(const t of Object.values(this._layers))t._reset()}_onSettled(){this._update()}_update(){}}const vi=class vi extends J{getEvents(){const t=J.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t}_onViewPreReset(){this._postponeUpdatePaths=!0}onAdd(t){J.prototype.onAdd.call(this,t),this._draw()}onRemove(){J.prototype.onRemove.call(this),clearTimeout(this._pointerHoverThrottleTimeout)}_initContainer(){const t=this._container=document.createElement("canvas");b(t,"pointermove",this._onPointerMove,this),b(t,"click dblclick pointerdown pointerup contextmenu",this._onClick,this),b(t,"pointerout",this._handlePointerOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")}_destroyContainer(){cancelAnimationFrame(this._redrawRequest),this._redrawRequest=null,delete this._ctx,J.prototype._destroyContainer.call(this)}_resizeContainer(){const t=J.prototype._resizeContainer.call(this),e=this._ctxScale=window.devicePixelRatio;this._container.width=e*t.x,this._container.height=e*t.y}_updatePaths(){if(!this._postponeUpdatePaths){this._redrawBounds=null;for(const t of Object.values(this._layers))t._update();this._redraw()}}_update(){if(this._map._animatingZoom&&this._bounds)return;const t=this._bounds,e=this._ctxScale;this._ctx.setTransform(e,0,0,e,-t.min.x*e,-t.min.y*e),this.fire("update")}_reset(){J.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())}_initPath(t){this._updateDashArray(t),this._layers[P(t)]=t;const e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst??=this._drawLast}_addPath(t){this._requestRedraw(t)}_removePath(t){const e=t._order,i=e.next,s=e.prev;i?i.prev=s:this._drawLast=s,s?s.next=i:this._drawFirst=i,delete t._order,delete this._layers[P(t)],this._requestRedraw(t)}_updatePath(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)}_updateStyle(t){this._updateDashArray(t),this._requestRedraw(t)}_updateDashArray(t){if(typeof t.options.dashArray=="string"){const e=t.options.dashArray.split(/[, ]+/);t.options._dashArray=e.map(i=>Number(i)).filter(i=>!isNaN(i))}else t.options._dashArray=t.options.dashArray}_requestRedraw(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest??=requestAnimationFrame(this._redraw.bind(this)))}_extendRedrawBounds(t){if(t._pxBounds){const e=(t.options.weight??0)+1;this._redrawBounds??=new L,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}}_redraw(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null}_clear(){const t=this._redrawBounds;if(t){const e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()}_draw(){let t;const e=this._redrawBounds;if(this._ctx.save(),e){const i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(let i=this._drawFirst;i;i=i.next)t=i.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()}_updatePoly(t,e){if(!this._drawing)return;const i=t._parts,s=this._ctx;i.length&&(s.beginPath(),i.forEach(o=>{o.forEach((r,a)=>{s[a?"lineTo":"moveTo"](r.x,r.y)}),e&&s.closePath()}),this._fillStroke(s,t))}_updateCircle(t){if(!this._drawing||t._empty())return;const e=t._point,i=this._ctx,s=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||s)/s;o!==1&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,s,0,Math.PI*2,!1),o!==1&&i.restore(),this._fillStroke(i,t)}_fillStroke(t,e){const i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor??i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&i.weight!==0&&(t.setLineDash&&(t.lineDashOffset=Number(i.dashOffset??0),t.setLineDash(i._dashArray??[])),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())}_onClick(t){const e=this._map.pointerEventToLayerPoint(t);let i,s;for(let o=this._drawFirst;o;o=o.next)i=o.layer,i.options.interactive&&i._containsPoint(e)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(i))&&(s=i);this._fireEvent(s?[s]:!1,t)}_onPointerMove(t){if(!this._map||this._map.dragging.moving()||this._map._animatingZoom)return;const e=this._map.pointerEventToLayerPoint(t);this._handlePointerHover(t,e)}_handlePointerOut(t){const e=this._hoveredLayer;e&&(this._container.classList.remove("leaflet-interactive"),this._fireEvent([e],t,"pointerout"),this._hoveredLayer=null,this._pointerHoverThrottled=!1)}_handlePointerHover(t,e){if(this._pointerHoverThrottled)return;let i,s;for(let o=this._drawFirst;o;o=o.next)i=o.layer,i.options.interactive&&i._containsPoint(e)&&(s=i);s!==this._hoveredLayer&&(this._handlePointerOut(t),s&&(this._container.classList.add("leaflet-interactive"),this._fireEvent([s],t,"pointerover"),this._hoveredLayer=s)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,t),this._pointerHoverThrottled=!0,this._pointerHoverThrottleTimeout=setTimeout((()=>{this._pointerHoverThrottled=!1}),32)}_fireEvent(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)}_bringToFront(t){const e=t._order;if(!e)return;const i=e.next,s=e.prev;if(i)i.prev=s;else return;s?s.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t)}_bringToBack(t){const e=t._order;if(!e)return;const i=e.next,s=e.prev;if(s)s.next=i;else return;i?i.prev=s:s&&(this._drawLast=s),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t)}};vi.setDefaultOptions({tolerance:0});let ae=vi;function $n(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Ki(n,t){return n.flatMap(i=>[...i.map((s,o)=>`${(o?"L":"M")+s.x} ${s.y}`),t?"z":""]).join("")||"M0 0"}const le=$n;class he extends J{_initContainer(){this._container=le("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=le("g"),this._container.appendChild(this._rootGroup)}_destroyContainer(){J.prototype._destroyContainer.call(this),delete this._rootGroup,delete this._svgSize}_resizeContainer(){const t=J.prototype._resizeContainer.call(this);(!this._svgSize||!this._svgSize.equals(t))&&(this._svgSize=t,this._container.setAttribute("width",t.x),this._container.setAttribute("height",t.y))}_update(){if(this._map._animatingZoom&&this._bounds)return;const t=this._bounds,e=t.getSize();this._container.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}_initPath(t){const e=t._path=le("path");t.options.className&&e.classList.add(...it(t.options.className)),t.options.interactive&&e.classList.add("leaflet-interactive"),this._updateStyle(t),this._layers[P(t)]=t}_addPath(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)}_removePath(t){t._path.remove(),t.removeInteractiveTarget(t._path),delete this._layers[P(t)]}_updatePath(t){t._project(),t._update()}_updateStyle(t){const e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))}_updatePoly(t,e){this._setPath(t,Ki(t._parts,e))}_updateCircle(t){const e=t._point,i=Math.max(Math.round(t._radius),1),s=Math.max(Math.round(t._radiusY),1)||i,o=`a${i},${s} 0 1,0 `,r=t._empty()?"M0 0":`M${e.x-i},${e.y}${o}${i*2},0 ${o}${-i*2},0 `;this._setPath(t,r)}_setPath(t,e){t._path.setAttribute("d",e)}_bringToFront(t){At(t._path)}_bringToBack(t){Bt(t._path)}}w.include({getRenderer(n){let t=n.options.renderer??this._getPaneRenderer(n.options.pane)??this.options.renderer??this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer(n){if(n==="overlayPane"||n===void 0)return;let t=this._paneRenderers[n];return t===void 0&&(t=this._createRenderer({pane:n}),this._paneRenderers[n]=t),t},_createRenderer(n){return this.options.preferCanvas&&new ae(n)||new he(n)}});class Un extends xt{initialize(t,e){xt.prototype.initialize.call(this,this._boundsToLatLngs(t),e)}setBounds(t){return this.setLatLngs(this._boundsToLatLngs(t))}_boundsToLatLngs(t){return t=new C(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}he.create=le,he.pointsToPath=Ki,pt.geometryToLayer=ie,pt.coordsToLatLng=je,pt.coordsToLatLngs=ne,pt.latLngToCoords=He,pt.latLngsToCoords=se,pt.getFeature=kt,pt.asFeature=oe,w.mergeOptions({boxZoom:!0});class Yi extends nt{initialize(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)}addHooks(){b(this._container,"pointerdown",this._onPointerDown,this)}removeHooks(){S(this._container,"pointerdown",this._onPointerDown,this)}moved(){return this._moved}_destroy(){this._pane.remove(),delete this._pane}_resetState(){this._resetStateTimeout=0,this._moved=!1}_clearDeferredResetState(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)}_onPointerDown(t){if(!t.shiftKey||t.button!==0)return!1;this._clearDeferredResetState(),this._resetState(),we(),Le(),this._startPoint=this._map.pointerEventToContainerPoint(t),b(document,{contextmenu:vt,pointermove:this._onPointerMove,pointerup:this._onPointerUp,keydown:this._onKeyDown},this)}_onPointerMove(t){this._moved||(this._moved=!0,this._box=k("div","leaflet-zoom-box",this._container),this._container.classList.add("leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.pointerEventToContainerPoint(t);const e=new L(this._point,this._startPoint),i=e.getSize();D(this._box,e.min),this._box.style.width=`${i.x}px`,this._box.style.height=`${i.y}px`}_finish(){this._moved&&(this._box.remove(),this._container.classList.remove("leaflet-crosshair")),xe(),Pe(),S(document,{contextmenu:vt,pointermove:this._onPointerMove,pointerup:this._onPointerUp,keydown:this._onKeyDown},this)}_onPointerUp(t){if(t.button!==0||(this._finish(),!this._moved))return;this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(this._resetState.bind(this),0);const e=new C(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}_onKeyDown(t){t.code==="Escape"&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}w.addInitHook("addHandler","boxZoom",Yi),w.mergeOptions({doubleClickZoom:!0});class Xi extends nt{addHooks(){this._map.on("dblclick",this._onDoubleClick,this)}removeHooks(){this._map.off("dblclick",this._onDoubleClick,this)}_onDoubleClick(t){const e=this._map,i=e.getZoom(),s=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-s:i+s;e.options.doubleClickZoom==="center"?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}}w.addInitHook("addHandler","doubleClickZoom",Xi),w.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});class Ji extends nt{addHooks(){if(!this._draggable){const t=this._map;this._draggable=new Dt(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))}this._map._container.classList.add("leaflet-grab","leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]}removeHooks(){this._map._container.classList.remove("leaflet-grab","leaflet-touch-drag"),this._draggable.disable()}moved(){return this._draggable?._moved}moving(){return this._draggable?._moving}_onDragStart(){const t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){const e=new C(this._map.options.maxBounds);this._offsetLimit=new L(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.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(t){if(this._map.options.inertia){const e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)}_prunePositions(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()}_onZoomEnd(){const t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x}_viscousLimit(t,e){return t-(t-e)*this._viscosity}_onPreDragLimit(){if(!this._viscosity||!this._offsetLimit)return;const t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}_onPreDragWrap(){const t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,s=this._draggable._newPos.x,o=(s-e+i)%t+e-i,r=(s+e+i)%t-e-i,a=Math.abs(o+i)<Math.abs(r+i)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=a}_onDragEnd(t){const e=this._map,i=e.options,s=!i.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),s)e.fire("moveend");else{this._prunePositions(+new Date);const o=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,a=i.easeLinearity,l=o.multiplyBy(a/r),h=l.distanceTo([0,0]),d=Math.min(i.inertiaMaxSpeed,h),c=l.multiplyBy(d/h),u=d/(i.inertiaDeceleration*a);let p=c.multiplyBy(-u/2).round();!p.x&&!p.y?e.fire("moveend"):(p=e._limitOffset(p,e.options.maxBounds),requestAnimationFrame(()=>{e.panBy(p,{duration:u,easeLinearity:a,noMoveStart:!0,animate:!0})}))}}}w.addInitHook("addHandler","dragging",Ji),w.mergeOptions({keyboard:!0,keyboardPanDelta:80});class Tt extends nt{static keyCodes={left:["ArrowLeft"],right:["ArrowRight"],down:["ArrowDown"],up:["ArrowUp"],zoomIn:["Equal","NumpadAdd","BracketRight"],zoomOut:["Minus","NumpadSubtract","Digit6","Slash"]};initialize(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)}addHooks(){const t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),t.ariaKeyShortcuts=Object.values(Tt.keyCodes).flat().join(" "),b(t,{focus:this._onFocus,blur:this._onBlur,pointerdown:this._onPointerDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)}removeHooks(){this._removeHooks(),S(this._map._container,{focus:this._onFocus,blur:this._onBlur,pointerdown:this._onPointerDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)}_onPointerDown(){if(this._focused)return;const t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,s=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(s,i)}_onFocus(){this._focused=!0,this._map.fire("focus")}_onBlur(){this._focused=!1,this._map.fire("blur")}_setPanDelta(t){const e=this._panKeys={},i=Tt.keyCodes;for(const s of i.left)e[s]=[-1*t,0];for(const s of i.right)e[s]=[t,0];for(const s of i.down)e[s]=[0,t];for(const s of i.up)e[s]=[0,-1*t]}_setZoomDelta(t){const e=this._zoomKeys={},i=Tt.keyCodes;for(const s of i.zoomIn)e[s]=t;for(const s of i.zoomOut)e[s]=-t}_addHooks(){b(document,"keydown",this._onKeyDown,this)}_removeHooks(){S(document,"keydown",this._onKeyDown,this)}_onKeyDown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;const e=t.code,i=this._map;let s;if(e in this._panKeys){if(!i._panAnim||!i._panAnim._inProgress)if(s=this._panKeys[e],t.shiftKey&&(s=new f(s).multiplyBy(3)),i.options.maxBounds&&(s=i._limitOffset(new f(s),i.options.maxBounds)),i.options.worldCopyJump){const o=i.wrapLatLng(i.unproject(i.project(i.getCenter()).add(s)));i.panTo(o)}else i.panBy(s)}else if(e in this._zoomKeys)i.setZoom(i.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[e]);else if(e==="Escape"&&i._popup&&i._popup.options.closeOnEscapeKey)i.closePopup();else return;vt(t)}}w.addInitHook("addHandler","keyboard",Tt),w.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});class Qi extends nt{addHooks(){b(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0}removeHooks(){S(this._map._container,"wheel",this._onWheelScroll,this),clearTimeout(this._timer)}_onWheelScroll(t){const e=Ii(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.pointerEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);const s=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(this._performZoom.bind(this),s),vt(t)}_performZoom(){const t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap??0;t._stop();const s=this._delta/(this._map.options.wheelPxPerZoomLevel*4),o=4*Math.log(2/(1+Math.exp(-Math.abs(s))))/Math.LN2,r=i?Math.ceil(o/i)*i:o,a=t._limitZoom(e+(this._delta>0?r:-r))-e;this._delta=0,this._startTime=null,a&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+a):t.setZoomAround(this._lastMousePos,e+a))}}w.addInitHook("addHandler","scrollWheelZoom",Qi);const qn=600;w.mergeOptions({tapHold:F.safari&&F.mobile,tapTolerance:15});class tn extends nt{addHooks(){b(this._map._container,"pointerdown",this._onDown,this)}removeHooks(){S(this._map._container,"pointerdown",this._onDown,this),clearTimeout(this._holdTimeout)}_onDown(t){clearTimeout(this._holdTimeout),!(Ct().length!==1||t.pointerType==="mouse")&&(this._startPos=this._newPos=new f(t.clientX,t.clientY),this._holdTimeout=setTimeout((()=>{this._cancel(),this._isTapValid()&&(b(document,"pointerup",G),b(document,"pointerup pointercancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",t))}),qn),b(document,"pointerup pointercancel contextmenu",this._cancel,this),b(document,"pointermove",this._onMove,this))}_cancelClickPrevent=function t(){S(document,"pointerup",G),S(document,"pointerup pointercancel",t)};_cancel(){clearTimeout(this._holdTimeout),S(document,"pointerup pointercancel contextmenu",this._cancel,this),S(document,"pointermove",this._onMove,this)}_onMove(t){this._newPos=new f(t.clientX,t.clientY)}_isTapValid(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance}_simulateEvent(t,e){const i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}}w.addInitHook("addHandler","tapHold",tn),w.mergeOptions({pinchZoom:!0,bounceAtZoomLimits:!0});class qe extends nt{addHooks(){this._map._container.classList.add("leaflet-touch-zoom"),b(this._map._container,"pointerdown",this._onPointerStart,this)}removeHooks(){this._map._container.classList.remove("leaflet-touch-zoom"),S(this._map._container,"pointerdown",this._onPointerStart,this)}_onPointerStart(t){const e=this._map,i=Ct();if(i.length!==2||e._animatingZoom||this._zooming)return;const s=e.pointerEventToContainerPoint(i[0]),o=e.pointerEventToContainerPoint(i[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),e.options.pinchZoom!=="center"&&(this._pinchStartLatLng=e.containerPointToLatLng(s.add(o)._divideBy(2))),this._startDist=s.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),b(document,"pointermove",this._onPointerMove,this),b(document,"pointerup pointercancel",this._onPointerEnd,this),G(t)}_onPointerMove(t){const e=Ct();if(e.length!==2||!this._zooming)return;const i=this._map,s=i.pointerEventToContainerPoint(e[0]),o=i.pointerEventToContainerPoint(e[1]),r=s.distanceTo(o)/this._startDist;if(this._zoom=i.getScaleZoom(r,this._startZoom),!i.options.bounceAtZoomLimits&&(this._zoom<i.getMinZoom()&&r<1||this._zoom>i.getMaxZoom()&&r>1)&&(this._zoom=i._limitZoom(this._zoom)),i.options.pinchZoom==="center"){if(this._center=this._startLatLng,r===1)return}else{const l=s._add(o)._divideBy(2)._subtract(this._centerPoint);if(r===1&&l.x===0&&l.y===0)return;this._center=i.unproject(i.project(this._pinchStartLatLng,this._zoom).subtract(l),this._zoom)}this._moved||(i._moveStart(!0,!1),this._moved=!0),cancelAnimationFrame(this._animRequest);const a=i._move.bind(i,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=requestAnimationFrame(a.bind(this)),G(t)}_onPointerEnd(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,cancelAnimationFrame(this._animRequest),S(document,"pointermove",this._onPointerMove,this),S(document,"pointerup pointercancel",this._onPointerEnd,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","pinchZoom",qe),w.addInitHook(function(){this.touchZoom=this.pinchZoom,this.options.touchZoom!==void 0&&(console.warn("Map: touchZoom option is deprecated and will be removed in future versions. Use pinchZoom instead."),this.options.pinchZoom=this.options.touchZoom,delete this.options.touchZoom),this.options.pinchZoom?this.pinchZoom.enable():this.pinchZoom.disable()}),w.BoxZoom=Yi,w.DoubleClickZoom=Xi,w.Drag=Ji,w.Keyboard=Tt,w.ScrollWheelZoom=Qi,w.TapHold=tn,w.PinchZoom=qe,w.TouchZoom=qe;var _={__proto__:null,BlanketOverlay:re,Bounds:L,Browser:F,CRS:ot,Canvas:ae,Circle:qi,CircleMarker:jt,Class:Ot,Control:K,DivIcon:$e,DivOverlay:Y,DomEvent:Ae,DomUtil:zn,Draggable:Dt,Evented:Zt,FeatureGroup:ut,GeoJSON:pt,GridLayer:Lt,Handler:nt,Icon:wt,ImageOverlay:Ht,LatLng:m,LatLngBounds:C,Layer:$,LayerGroup:Nt,LeafletMap:En,LineUtil:Fn,Map:w,Marker:Ft,Path:st,Point:f,PolyUtil:Bn,Polygon:xt,Polyline:at,Popup:Gt,PosAnimation:Di,Projection:jn,Rectangle:Un,Renderer:J,SVG:he,SVGOverlay:Wn,TileLayer:Pt,Tooltip:Wt,Transformation:Et,Util:gn,VideoOverlay:We,version:"2.0.0-alpha.1"};const Vn=de().L;de().L=_,de().L.noConflict=function(){return de().L=Vn,this};function de(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}const Kn=`/* required styles */
1
+ var mtdsatlas=(function(H){"use strict";var ys=Object.defineProperty;var vs=(H,tt,P)=>tt in H?ys(H,tt,{enumerable:!0,configurable:!0,writable:!0,value:P}):H[tt]=P;var mn=(H,tt,P)=>vs(H,typeof tt!="symbol"?tt+"":tt,P);var _t;let tt=0;function P(n){return"_leaflet_id"in n||(n._leaflet_id=++tt),n._leaflet_id}function vi(n,t,e){let i,s;function o(){i=!1,s&&(r.apply(e,s),s=!1)}function r(...a){i?s=a:(n.apply(e,a),setTimeout(o,t),i=!0)}return r}function St(n,t,e){const i=t[1],s=t[0],o=i-s;return n===i&&e?n:((n-s)%o+o)%o+s}function V(){return!1}function et(n,t){if(t===!1)return n;const e=10**(t===void 0?6:t);return Math.round(n*e)/e}function it(n){return n.trim().split(/\s+/)}function z(n,t){Object.hasOwn(n,"options")||(n.options=n.options?Object.create(n.options):{});for(const e in t)Object.hasOwn(t,e)&&(n.options[e]=t[e]);return n.options}const gn=/\{ *([\w_ -]+) *\}/g;function bi(n,t){return n.replace(gn,(e,i)=>{let s=t[i];if(s===void 0)throw new Error(`No value provided for variable ${e}`);return typeof s=="function"&&(s=s(t)),s})}const Ut="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";var yn={__proto__:null,emptyImageUrl:Ut,falseFn:V,formatNum:et,get lastId(){return tt},setOptions:z,splitWords:it,stamp:P,template:bi,throttle:vi,wrapNum:St};class Ot{static extend({statics:t,includes:e,...i}){const s=class extends this{};Object.setPrototypeOf(s,this);const o=this.prototype,r=s.prototype;if(t&&Object.assign(s,t),Array.isArray(e))for(const a of e)Object.assign(r,a);else e&&Object.assign(r,e);return Object.assign(r,i),r.options&&(r.options=o.options?Object.create(o.options):{},Object.assign(r.options,i.options)),r._initHooks=[],s}static include(t){const e=this.prototype.options;return Object.assign(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this}static setDefaultOptions(t){return z(this.prototype,t),this}static mergeOptions(t){return this.prototype.options??={},Object.assign(this.prototype.options,t),this}static addInitHook(t,...e){const i=typeof t=="function"?t:function(){this[t].apply(this,e)};return this.prototype._initHooks??=[],this.prototype._initHooks.push(i),this}constructor(...t){this._initHooksCalled=!1,z(this),this.initialize&&this.initialize(...t),this.callInitHooks()}initialize(){}callInitHooks(){if(this._initHooksCalled)return;const t=[];let e=this;for(;(e=Object.getPrototypeOf(e))!==null;)t.push(e);t.reverse();for(const i of t)for(const s of i._initHooks??[])s.call(this);this._initHooksCalled=!0}}class Zt extends Ot{on(t,e,i){if(typeof t=="object")for(const[s,o]of Object.entries(t))this._on(s,o,e);else for(const s of it(t))this._on(s,e,i);return this}off(t,e,i){if(!arguments.length)delete this._events;else if(typeof t=="object")for(const[s,o]of Object.entries(t))this._off(s,o,e);else{const s=arguments.length===1;for(const o of it(t))s?this._off(o):this._off(o,e,i)}return this}_on(t,e,i,s){if(typeof e!="function"){console.warn(`wrong listener type: ${typeof e}`);return}if(this._listens(t,e,i)!==!1)return;i===this&&(i=void 0);const o={fn:e,ctx:i};s&&(o.once=!0),this._events??={},this._events[t]??=[],this._events[t].push(o)}_off(t,e,i){if(!this._events)return;let s=this._events[t];if(!s)return;if(arguments.length===1){if(this._firingCount)for(const r of s)r.fn=V;delete this._events[t];return}if(typeof e!="function"){console.warn(`wrong listener type: ${typeof e}`);return}const o=this._listens(t,e,i);if(o!==!1){const r=s[o];this._firingCount&&(r.fn=V,this._events[t]=s=s.slice()),s.splice(o,1)}}fire(t,e,i){if(!this.listens(t,i))return this;const s={...e,type:t,target:this,sourceTarget:e?.sourceTarget||this};if(this._events){const o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(const r of o){const a=r.fn;r.once&&this.off(t,a,r.ctx),a.call(r.ctx||this,s)}this._firingCount--}}return i&&this._propagateEvent(s),this}listens(t,e,i,s){typeof t!="string"&&console.warn('"string" type argument expected');let o=e;if(typeof e!="function"&&(s=!!e,o=void 0,i=void 0),this._events?.[t]?.length&&this._listens(t,o,i)!==!1)return!0;if(s){for(const r of Object.values(this._eventParents??{}))if(r.listens(t,e,i,s))return!0}return!1}_listens(t,e,i){if(!this._events)return!1;const s=this._events[t]??[];if(!e)return!!s.length;i===this&&(i=void 0);const o=s.findIndex(r=>r.fn===e&&r.ctx===i);return o===-1?!1:o}once(t,e,i){if(typeof t=="object")for(const[s,o]of Object.entries(t))this._on(s,o,e,!0);else for(const s of it(t))this._on(s,e,i,!0);return this}addEventParent(t){return this._eventParents??={},this._eventParents[P(t)]=t,this}removeEventParent(t){return this._eventParents&&delete this._eventParents[P(t)],this}_propagateEvent(t){for(const e of Object.values(this._eventParents??{}))e.fire(t.type,{propagatedFrom:t.target,...t},!0)}}class f{constructor(t,e,i){if(!f.validate(t,e))throw new Error(`Invalid Point object: (${t}, ${e})`);let o,r;if(t instanceof f)return t;Array.isArray(t)?(o=t[0],r=t[1]):typeof t=="object"&&"x"in t&&"y"in t?(o=t.x,r=t.y):(o=t,r=e),this.x=i?Math.round(o):o,this.y=i?Math.round(r):r}static validate(t,e){return t instanceof f||Array.isArray(t)||t&&typeof t=="object"&&"x"in t&&"y"in t?!0:!!((t||t===0)&&(e||e===0))}clone(){const t=new f(0,0);return t.x=this.x,t.y=this.y,t}add(t){return this.clone()._add(new f(t))}_add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.clone()._subtract(new f(t))}_subtract(t){return this.x-=t.x,this.y-=t.y,this}divideBy(t){return this.clone()._divideBy(t)}_divideBy(t){return this.x/=t,this.y/=t,this}multiplyBy(t){return this.clone()._multiplyBy(t)}_multiplyBy(t){return this.x*=t,this.y*=t,this}scaleBy(t){return new f(this.x*t.x,this.y*t.y)}unscaleBy(t){return new f(this.x/t.x,this.y/t.y)}round(){return this.clone()._round()}_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}floor(){return this.clone()._floor()}_floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.clone()._ceil()}_ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}trunc(){return this.clone()._trunc()}_trunc(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}distanceTo(t){t=new f(t);const e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)}equals(t){return t=new f(t),t.x===this.x&&t.y===this.y}contains(t){return t=new f(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)}toString(){return`Point(${et(this.x)}, ${et(this.y)})`}}class L{constructor(t,e){if(!t)return;if(t instanceof L)return t;const i=e?[t,e]:t;for(const s of i)this.extend(s)}extend(t){let e,i;if(!t)return this;if(t instanceof f||typeof t[0]=="number"||"x"in t)e=i=new f(t);else if(t=new L(t),e=t.min,i=t.max,!e||!i)return this;return!this.min&&!this.max?(this.min=e.clone(),this.max=i.clone()):(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)),this}getCenter(t){return new f((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)}getBottomLeft(){return new f(this.min.x,this.max.y)}getTopRight(){return new f(this.max.x,this.min.y)}getTopLeft(){return this.min}getBottomRight(){return this.max}getSize(){return this.max.subtract(this.min)}contains(t){let e,i;return typeof t[0]=="number"||t instanceof f?t=new f(t):t=new L(t),t instanceof L?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y}intersects(t){t=new L(t);const e=this.min,i=this.max,s=t.min,o=t.max,r=o.x>=e.x&&s.x<=i.x,a=o.y>=e.y&&s.y<=i.y;return r&&a}overlaps(t){t=new L(t);const e=this.min,i=this.max,s=t.min,o=t.max,r=o.x>e.x&&s.x<i.x,a=o.y>e.y&&s.y<i.y;return r&&a}isValid(){return!!(this.min&&this.max)}pad(t){const e=this.min,i=this.max,s=Math.abs(e.x-i.x)*t,o=Math.abs(e.y-i.y)*t;return new L(new f(e.x-s,e.y-o),new f(i.x+s,i.y+o))}equals(t){return t?(t=new L(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}}class C{constructor(t,e){if(!t)return;if(t instanceof C)return t;const i=e?[t,e]:t;for(const s of i)this.extend(s)}extend(t){const e=this._southWest,i=this._northEast;let s,o;if(t instanceof m)s=t,o=t;else if(t instanceof C){if(s=t._southWest,o=t._northEast,!s||!o)return this}else return t?m.validate(t)?this.extend(new m(t)):this.extend(new C(t)):this;return!e&&!i?(this._southWest=new m(s.lat,s.lng),this._northEast=new m(o.lat,o.lng)):(e.lat=Math.min(s.lat,e.lat),e.lng=Math.min(s.lng,e.lng),i.lat=Math.max(o.lat,i.lat),i.lng=Math.max(o.lng,i.lng)),this}pad(t){const e=this._southWest,i=this._northEast,s=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new C(new m(e.lat-s,e.lng-o),new m(i.lat+s,i.lng+o))}getCenter(){return new m((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)}getSouthWest(){return this._southWest}getNorthEast(){return this._northEast}getNorthWest(){return new m(this.getNorth(),this.getWest())}getSouthEast(){return new m(this.getSouth(),this.getEast())}getWest(){return this._southWest.lng}getSouth(){return this._southWest.lat}getEast(){return this._northEast.lng}getNorth(){return this._northEast.lat}contains(t){m.validate(t)?t=new m(t):t=new C(t);const e=this._southWest,i=this._northEast;let s,o;return t instanceof C?(s=t.getSouthWest(),o=t.getNorthEast()):s=o=t,s.lat>=e.lat&&o.lat<=i.lat&&s.lng>=e.lng&&o.lng<=i.lng}intersects(t){t=new C(t);const e=this._southWest,i=this._northEast,s=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>=e.lat&&s.lat<=i.lat,a=o.lng>=e.lng&&s.lng<=i.lng;return r&&a}overlaps(t){t=new C(t);const e=this._southWest,i=this._northEast,s=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>e.lat&&s.lat<i.lat,a=o.lng>e.lng&&s.lng<i.lng;return r&&a}toBBoxString(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")}equals(t,e){return t?(t=new C(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e)):!1}isValid(){return!!(this._southWest&&this._northEast)}}class m{constructor(t,e,i){if(!m.validate(t,e,i))throw new Error(`Invalid LatLng object: (${t}, ${e})`);let o,r,a;if(t instanceof m)return t;Array.isArray(t)&&typeof t[0]!="object"?t.length===3?(o=t[0],r=t[1],a=t[2]):t.length===2&&(o=t[0],r=t[1]):typeof t=="object"&&"lat"in t?(o=t.lat,r="lng"in t?t.lng:t.lon,a=t.alt):(o=t,r=e,a=i),this.lat=+o,this.lng=+r,a!==void 0&&(this.alt=+a)}static validate(t,e,i){return t instanceof m||typeof t=="object"&&"lat"in t?!0:t&&Array.isArray(t)&&typeof t[0]!="object"?t.length===3||t.length===2:!!((t||t===0)&&(e||e===0))}equals(t,e){return t?(t=new m(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(e??1e-9)):!1}toString(t){return`LatLng(${et(this.lat,t)}, ${et(this.lng,t)})`}distanceTo(t){return dt.distance(this,new m(t))}wrap(){return dt.wrapLatLng(this)}toBounds(t){const e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new C([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])}clone(){const t=new m(0,0);return t.lat=this.lat,t.lng=this.lng,t.alt=this.alt,t}}class ot{static projection=void 0;static transformation=void 0;static latLngToPoint(t,e){const i=this.projection.project(t),s=this.scale(e);return this.transformation._transform(i,s)}static pointToLatLng(t,e){const i=this.scale(e),s=this.transformation.untransform(t,i);return this.projection.unproject(s)}static project(t){return this.projection.project(t)}static unproject(t){return this.projection.unproject(t)}static scale(t){return 256*2**t}static zoom(t){return Math.log(t/256)/Math.LN2}static getProjectedBounds(t){if(this.infinite)return null;const e=this.projection.bounds,i=this.scale(t),s=this.transformation.transform(e.min,i),o=this.transformation.transform(e.max,i);return new L(s,o)}static infinite=!1;static wrapLatLng(t){t=new m(t);const e=this.wrapLng?St(t.lng,this.wrapLng,!0):t.lng,i=this.wrapLat?St(t.lat,this.wrapLat,!0):t.lat,s=t.alt;return new m(i,e,s)}static wrapLatLngBounds(t){t=new C(t);const e=t.getCenter(),i=this.wrapLatLng(e),s=e.lat-i.lat,o=e.lng-i.lng;if(s===0&&o===0)return t;const r=t.getSouthWest(),a=t.getNorthEast(),l=new m(r.lat-s,r.lng-o),h=new m(a.lat-s,a.lng-o);return new C(l,h)}}class dt extends ot{static wrapLng=[-180,180];static R=6371e3;static distance(t,e){const i=Math.PI/180,s=t.lat*i,o=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),a=Math.sin((e.lng-t.lng)*i/2),l=r*r+Math.cos(s)*Math.cos(o)*a*a,h=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return this.R*h}}const wi=6378137,ge={R:wi,MAX_LATITUDE:85.0511287798,project(n){n=new m(n);const t=Math.PI/180,e=this.MAX_LATITUDE,i=Math.max(Math.min(e,n.lat),-e),s=Math.sin(i*t);return new f(this.R*n.lng*t,this.R*Math.log((1+s)/(1-s))/2)},unproject(n){n=new f(n);const t=180/Math.PI;return new m((2*Math.atan(Math.exp(n.y/this.R))-Math.PI/2)*t,n.x*t/this.R)},bounds:(()=>{const n=wi*Math.PI;return new L([-n,-n],[n,n])})()};class Et{constructor(t,e,i,s){if(Array.isArray(t)){this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3];return}this._a=t,this._b=e,this._c=i,this._d=s}transform(t,e){return this._transform(t.clone(),e)}_transform(t,e){return e||=1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t}untransform(t,e){return e||=1,new f((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}}class ye extends dt{static code="EPSG:3857";static projection=ge;static transformation=(()=>{const t=.5/(Math.PI*ge.R);return new Et(t,.5,-t,.5)})()}class vn extends ye{static code="EPSG:900913"}const xi=ve("chrome"),bn=!xi&&ve("safari"),wn=typeof orientation<"u"||ve("mobile"),Li=typeof window>"u"?!1:!!window.PointerEvent,Pi=typeof window>"u"?!1:"ontouchstart"in window||!!window.TouchEvent,xn=Pi||Li,Ln=typeof window>"u"||typeof window.devicePixelRatio>"u"?!1:window.devicePixelRatio>1,Pn=typeof navigator>"u"||typeof navigator.platform>"u"?!1:navigator.platform.startsWith("Mac"),Cn=typeof navigator>"u"||typeof navigator.platform>"u"?!1:navigator.platform.startsWith("Linux");function ve(n){return typeof navigator>"u"||typeof navigator.userAgent>"u"?!1:navigator.userAgent.toLowerCase().includes(n)}var F={chrome:xi,safari:bn,mobile:wn,pointer:Li,touch:xn,touchNative:Pi,retina:Ln,mac:Pn,linux:Cn};function kn(n){let t={bubbles:n.bubbles,cancelable:n.cancelable,composed:n.composed,detail:2,view:n.view,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,altKey:n.altKey,metaKey:n.metaKey,button:n.button,buttons:n.buttons,relatedTarget:n.relatedTarget,region:n.region},e;return n instanceof PointerEvent?(t={...t,pointerId:n.pointerId,width:n.width,height:n.height,pressure:n.pressure,tangentialPressure:n.tangentialPressure,tiltX:n.tiltX,tiltY:n.tiltY,twist:n.twist,pointerType:n.pointerType,isPrimary:n.isPrimary},e=new PointerEvent("dblclick",t)):e=new MouseEvent("dblclick",t),e}const Tn=200;function Mn(n,t){n.addEventListener("dblclick",t);let e=0,i;function s(o){if(o.detail!==1){i=o.detail;return}if(o.pointerType==="mouse"||o.sourceCapabilities&&!o.sourceCapabilities.firesTouchEvents)return;const r=Zi(o);if(r.some(l=>l instanceof HTMLLabelElement&&l.attributes.for)&&!r.some(l=>l instanceof HTMLInputElement||l instanceof HTMLSelectElement))return;const a=Date.now();a-e<=Tn?(i++,i===2&&o.target.dispatchEvent(kn(o))):i=1,e=a}return n.addEventListener("click",s),{dblclick:t,simDblclick:s}}function zn(n,t){n.removeEventListener("dblclick",t.dblclick),n.removeEventListener("click",t.simDblclick)}function Ci(n){return typeof n=="string"?document.getElementById(n):n}function k(n,t,e){const i=document.createElement(n);return i.className=t??"",e?.appendChild(i),i}function At(n){const t=n.parentNode;t&&t.lastChild!==n&&t.appendChild(n)}function Bt(n){const t=n.parentNode;t&&t.firstChild!==n&&t.insertBefore(n,t.firstChild)}function mt(n,t,e){const i=t??new f(0,0);n.style.transform=`translate3d(${i.x}px,${i.y}px,0)${e?` scale(${e})`:""}`}const ki=new WeakMap;function D(n,t){ki.set(n,t),mt(n,t)}function gt(n){return ki.get(n)??new f(0,0)}const qt=typeof document>"u"?{}:document.documentElement.style,be=["userSelect","WebkitUserSelect"].find(n=>n in qt);let Vt;function we(){const n=qt[be];n!=="none"&&(Vt=n,qt[be]="none")}function xe(){typeof Vt>"u"||(qt[be]=Vt,Vt=void 0)}function Le(){b(window,"dragstart",G)}function Pe(){S(window,"dragstart",G)}let Kt,Ce;function ke(n){for(;n.tabIndex===-1;)n=n.parentNode;n.style&&(Yt(),Kt=n,Ce=n.style.outlineStyle,n.style.outlineStyle="none",b(window,"keydown",Yt))}function Yt(){Kt&&(Kt.style.outlineStyle=Ce,Kt=void 0,Ce=void 0,S(window,"keydown",Yt))}function Ti(n){do n=n.parentNode;while((!n.offsetWidth||!n.offsetHeight)&&n!==document.body);return n}function Te(n){const t=n.getBoundingClientRect();return{x:t.width/n.offsetWidth||1,y:t.height/n.offsetHeight||1,boundingClientRect:t}}var Sn={__proto__:null,create:k,disableImageDrag:Le,disableTextSelection:we,enableImageDrag:Pe,enableTextSelection:xe,get:Ci,getPosition:gt,getScale:Te,getSizedParentNode:Ti,preventOutline:ke,restoreOutline:Yt,setPosition:D,setTransform:mt,toBack:Bt,toFront:At};let yt=new Map,Me=!1;function Mi(){Me||(Me=!0,document.addEventListener("pointerdown",zi,{capture:!0}),document.addEventListener("pointermove",Si,{capture:!0}),document.addEventListener("pointerup",Xt,{capture:!0}),document.addEventListener("pointercancel",Xt,{capture:!0}),yt=new Map)}function On(){document.removeEventListener("pointerdown",zi,{capture:!0}),document.removeEventListener("pointermove",Si,{capture:!0}),document.removeEventListener("pointerup",Xt,{capture:!0}),document.removeEventListener("pointercancel",Xt,{capture:!0}),Me=!1}function zi(n){yt.set(n.pointerId,n)}function Si(n){yt.has(n.pointerId)&&yt.set(n.pointerId,n)}function Xt(n){yt.delete(n.pointerId)}function Ct(){return[...yt.values()]}function Zn(){yt.clear()}var En={__proto__:null,cleanupPointers:Zn,disablePointerDetection:On,enablePointerDetection:Mi,getPointers:Ct};function b(n,t,e,i){if(t&&typeof t=="object")for(const[s,o]of Object.entries(t))Se(n,s,o,e);else for(const s of it(t))Se(n,s,e,i);return this}const rt="_leaflet_events";function S(n,t,e,i){if(arguments.length===1)Oi(n),delete n[rt];else if(t&&typeof t=="object")for(const[s,o]of Object.entries(t))Oe(n,s,o,e);else if(t=it(t),arguments.length===2)Oi(n,s=>t.includes(s));else for(const s of t)Oe(n,s,e,i);return this}function Oi(n,t){for(const e of Object.keys(n[rt]??{})){const i=e.split(/\d/)[0];(!t||t(i))&&Oe(n,i,null,null,e)}}const ze={pointerenter:"pointerover",pointerleave:"pointerout",wheel:typeof window>"u"?!1:!("onwheel"in window)&&"mousewheel"};function Se(n,t,e,i){const s=t+P(e)+(i?`_${P(i)}`:"");if(n[rt]&&n[rt][s])return this;let o=function(a){return e.call(i||n,a||window.event)};const r=o;F.touch&&t==="dblclick"?o=Mn(n,o):"addEventListener"in n?t==="wheel"||t==="mousewheel"?n.addEventListener(ze[t]||t,o,{passive:!1}):t==="pointerenter"||t==="pointerleave"?(o=function(a){a??=window.event,Ee(n,a)&&r(a)},n.addEventListener(ze[t],o,!1)):n.addEventListener(t,r,!1):n.attachEvent(`on${t}`,o),n[rt]??={},n[rt][s]=o}function Oe(n,t,e,i,s){s??=t+P(e)+(i?`_${P(i)}`:"");const o=n[rt]&&n[rt][s];if(!o)return this;F.touch&&t==="dblclick"?zn(n,o):"removeEventListener"in n?n.removeEventListener(ze[t]||t,o,!1):n.detachEvent(`on${t}`,o),n[rt][s]=null}function ct(n){return n.stopPropagation?n.stopPropagation():n.originalEvent?n.originalEvent._stopped=!0:n.cancelBubble=!0,this}function Ze(n){return Se(n,"wheel",ct),this}function It(n){return b(n,"pointerdown dblclick contextmenu",ct),n._leaflet_disable_click=!0,this}function G(n){return n.preventDefault?n.preventDefault():n.returnValue=!1,this}function vt(n){return G(n),ct(n),this}function Zi(n){return n.composedPath()}function Ei(n,t){if(!t)return new f(n.clientX,n.clientY);const e=Te(t),i=e.boundingClientRect;return new f((n.clientX-i.left)/e.x-t.clientLeft,(n.clientY-i.top)/e.y-t.clientTop)}function Ai(){const n=window.devicePixelRatio;return F.linux&&F.chrome?n:F.mac?n*3:n>0?2*n:1}function Bi(n){return n.deltaY&&n.deltaMode===0?-n.deltaY/Ai():n.deltaY&&n.deltaMode===1?-n.deltaY*20:n.deltaY&&n.deltaMode===2?-n.deltaY*60:(n.deltaX||n.deltaZ,0)}function Ee(n,t){let e=t.relatedTarget;if(!e)return!0;try{for(;e&&e!==n;)e=e.parentNode}catch{return!1}return e!==n}var Ae={__proto__:null,PointerEvents:En,disableClickPropagation:It,disableScrollPropagation:Ze,getPointerPosition:Ei,getPropagationPath:Zi,getWheelDelta:Bi,getWheelPxFactor:Ai,isExternalTarget:Ee,off:S,on:b,preventDefault:G,stop:vt,stopPropagation:ct};class Ii extends Zt{run(t,e,i,s){this.stop(),this._el=t,this._inProgress=!0,this._duration=i??.25,this._easeOutPower=1/Math.max(s??.5,.2),this._startPos=gt(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()}stop(){this._inProgress&&(this._step(!0),this._complete())}_animate(){this._animId=requestAnimationFrame(this._animate.bind(this)),this._step()}_step(t){const e=+new Date-this._startTime,i=this._duration*1e3;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())}_runFrame(t,e){const i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),D(this._el,i),this.fire("step")}_complete(){cancelAnimationFrame(this._animId),this._inProgress=!1,this.fire("end")}_easeOut(t){return 1-(1-t)**this._easeOutPower}}let w=(_t=class extends Zt{initialize(t,e){e=z(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.zoom!==void 0&&(this._zoom=this._limitZoom(e.zoom)),e.center&&e.zoom!==void 0&&this.setView(new m(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=this.options.zoomAnimation,this._zoomAnimated&&this._createAnimProxy(),this._addLayers(this.options.layers)}setView(t,e,i){return e=e===void 0?this._zoom:this._limitZoom(e),t=this._limitCenter(new m(t),e,this.options.maxBounds),i??={},this._stop(),this._loaded&&!i.reset&&i!==!0&&(i.animate!==void 0&&(i.zoom={animate:i.animate,...i.zoom},i.pan={animate:i.animate,duration:i.duration,...i.pan}),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e,i.pan?.noMoveStart),this)}setZoom(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)}zoomIn(t,e){return t??=this.options.zoomDelta,this.setZoom(this._zoom+t,e)}zoomOut(t,e){return t??=this.options.zoomDelta,this.setZoom(this._zoom-t,e)}setZoomAround(t,e,i){const s=this.getZoomScale(e),o=this.getSize().divideBy(2),r=t instanceof f?t:this.latLngToContainerPoint(t),a=r.subtract(o).multiplyBy(1-1/s),l=this.containerPointToLatLng(o.add(a));return this.setView(l,e,{zoom:i})}_getBoundsCenterZoom(t,e){e??={},t=t.getBounds?t.getBounds():new C(t);const i=new f(e.paddingTopLeft||e.padding||[0,0]),s=new f(e.paddingBottomRight||e.padding||[0,0]);let o=this.getBoundsZoom(t,!1,i.add(s));if(o=typeof e.maxZoom=="number"?Math.min(e.maxZoom,o):o,o===1/0)return{center:t.getCenter(),zoom:o};const r=s.subtract(i).divideBy(2),a=this.project(t.getSouthWest(),o),l=this.project(t.getNorthEast(),o);return{center:this.unproject(a.add(l).divideBy(2).add(r),o),zoom:o}}fitBounds(t,e){if(t=new C(t),!t.isValid())throw new Error("Bounds are not valid.");const i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)}fitWorld(t){return this.fitBounds([[-90,-180],[90,180]],t)}panTo(t,e){return this.setView(t,this._zoom,{pan:e})}panBy(t,e){if(t=new f(t).round(),e??={},!t.x&&!t.y)return this.fire("moveend");if(e.animate!==!0&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Ii,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){this._mapPane.classList.add("leaflet-pan-anim");const i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this}flyTo(t,e,i){if(i??={},i.animate===!1)return this.setView(t,e,i);this._stop();const s=this.project(this.getCenter()),o=this.project(t),r=this.getSize(),a=this._zoom;t=new m(t),e=e===void 0?a:this._limitZoom(e);const l=Math.max(r.x,r.y),h=l*this.getZoomScale(a,e),d=o.distanceTo(s)||1,c=1.42,u=c*c;function p(T){const N=T?-1:1,U=T?h:l,q=h*h-l*l+N*u*u*d*d,Q=2*U*u*d,ht=q/Q,me=Math.sqrt(ht*ht+1)-ht;return me<1e-9?-18:Math.log(me)}function y(T){return(Math.exp(T)-Math.exp(-T))/2}function g(T){return(Math.exp(T)+Math.exp(-T))/2}function x(T){return y(T)/g(T)}const v=p(0);function M(T){return l*(g(v)/g(v+c*T))}function B(T){return l*(g(v)*x(v+c*T)-y(v))/u}function O(T){return 1-(1-T)**1.5}const I=Date.now(),Z=(p(1)-v)/c,W=i.duration?1e3*i.duration:1e3*Z*.8,E=()=>{const T=(Date.now()-I)/W,N=O(T)*Z;T<=1?(this._flyToFrame=requestAnimationFrame(E),this._move(this.unproject(s.add(o.subtract(s).multiplyBy(B(N)/d)),a),this.getScaleZoom(l/M(N),a),{flyTo:!0})):this._move(t,e)._moveEnd(!0)};return this._moveStart(!0,i.noMoveStart),E(),this}flyToBounds(t,e){const i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)}setMaxBounds(t){return t=new C(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)}setMinZoom(t){const e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this}setMaxZoom(t){const e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this}panInsideBounds(t,e){this._enforcingBounds=!0;const i=this.getCenter(),s=this._limitCenter(i,this._zoom,new C(t));return i.equals(s)||this.panTo(s,e),this._enforcingBounds=!1,this}panInside(t,e){e??={};const i=new f(e.paddingTopLeft||e.padding||[0,0]),s=new f(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(t),a=this.getPixelBounds(),l=new L([a.min.add(i),a.max.subtract(s)]),h=l.getSize();if(!l.contains(r)){this._enforcingBounds=!0;const d=r.subtract(l.getCenter()),c=l.extend(r).getSize().subtract(h);o.x+=d.x<0?-c.x:c.x,o.y+=d.y<0?-c.y:c.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this}invalidateSize(t){if(!this._loaded)return this;t={animate:!1,pan:!0,...t===!0?{animate:!0}:t};const e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;const i=this.getSize(),s=e.divideBy(2).round(),o=i.divideBy(2).round(),r=s.subtract(o);return!r.x&&!r.y?this:(t.animate&&t.pan?this.panBy(r):(t.pan&&this._rawPanBy(r),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(this.fire.bind(this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i}))}stop(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()}locate(t){if(t=this._locateOptions={timeout:1e4,watch:!1,...t},!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;const e=this._handleGeolocationResponse.bind(this),i=this._handleGeolocationError.bind(this);return t.watch?(this._locationWatchId!==void 0&&navigator.geolocation.clearWatch(this._locationWatchId),this._locationWatchId=navigator.geolocation.watchPosition(e,i,t)):navigator.geolocation.getCurrentPosition(e,i,t),this}stopLocate(){return navigator.geolocation?.clearWatch?.(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this}_handleGeolocationError(t){if(!this._container._leaflet_id)return;const e=t.code,i=t.message||(e===1?"permission denied":e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:`Geolocation error: ${i}.`})}_handleGeolocationResponse(t){if(!this._container._leaflet_id)return;const e=t.coords.latitude,i=t.coords.longitude,s=new m(e,i),o=s.toBounds(t.coords.accuracy*2),r=this._locateOptions;if(r.setView){const l=this.getBoundsZoom(o);this.setView(s,r.maxZoom?Math.min(l,r.maxZoom):l)}const a={latlng:s,bounds:o,timestamp:t.timestamp};for(const l in t.coords)typeof t.coords[l]=="number"&&(a[l]=t.coords[l]);this.fire("locationfound",a)}addHandler(t,e){if(!e)return this;const i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this}remove(){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");delete this._container._leaflet_id,delete this._containerId,this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),this._mapPane.remove(),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(cancelAnimationFrame(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),clearTimeout(this._transitionEndTimer),clearTimeout(this._sizeTimer),this._loaded&&this.fire("unload"),this._destroyAnimProxy();for(const t of Object.values(this._layers))t.remove();for(const t of Object.values(this._panes))t.remove();return this._layers={},this._panes={},delete this._mapPane,delete this._renderer,this}createPane(t,e){const i=`leaflet-pane${t?` leaflet-${t.replace("Pane","")}-pane`:""}`,s=k("div",i,e||this._mapPane);return t&&(this._panes[t]=s),s}getCenter(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())}getZoom(){return this._zoom}getBounds(){const t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new C(e,i)}getMinZoom(){return this.options.minZoom??this._layersMinZoom??0}getMaxZoom(){return this.options.maxZoom??this._layersMaxZoom??1/0}getBoundsZoom(t,e,i){t=new C(t),i=new f(i??[0,0]);let s=this.getZoom()??0;const o=this.getMinZoom(),r=this.getMaxZoom(),a=t.getNorthWest(),l=t.getSouthEast(),h=this.getSize().subtract(i),d=new L(this.project(l,s),this.project(a,s)).getSize(),c=this.options.zoomSnap,u=h.x/d.x,p=h.y/d.y,y=e?Math.max(u,p):Math.min(u,p);return s=this.getScaleZoom(y,s),c&&(s=Math.round(s/(c/100))*(c/100),s=e?Math.ceil(s/c)*c:Math.floor(s/c)*c),Math.max(o,Math.min(r,s))}getSize(){return(!this._size||this._sizeChanged)&&(this._size=new f(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()}getPixelBounds(t,e){const i=this._getTopLeftPoint(t,e);return new L(i,i.add(this.getSize()))}getPixelOrigin(){return this._checkIfLoaded(),this._pixelOrigin}getPixelWorldBounds(t){return this.options.crs.getProjectedBounds(t??this.getZoom())}getPane(t){return typeof t=="string"?this._panes[t]:t}getPanes(){return this._panes}getContainer(){return this._container}getZoomScale(t,e){const i=this.options.crs;return e??=this._zoom,i.scale(t)/i.scale(e)}getScaleZoom(t,e){const i=this.options.crs;e??=this._zoom;const s=i.zoom(t*i.scale(e));return isNaN(s)?1/0:s}project(t,e){return e??=this._zoom,this.options.crs.latLngToPoint(new m(t),e)}unproject(t,e){return e??=this._zoom,this.options.crs.pointToLatLng(new f(t),e)}layerPointToLatLng(t){const e=new f(t).add(this.getPixelOrigin());return this.unproject(e)}latLngToLayerPoint(t){return this.project(new m(t))._round()._subtract(this.getPixelOrigin())}wrapLatLng(t){return this.options.crs.wrapLatLng(new m(t))}wrapLatLngBounds(t){return this.options.crs.wrapLatLngBounds(new C(t))}distance(t,e){return this.options.crs.distance(new m(t),new m(e))}containerPointToLayerPoint(t){return new f(t).subtract(this._getMapPanePos())}layerPointToContainerPoint(t){return new f(t).add(this._getMapPanePos())}containerPointToLatLng(t){const e=this.containerPointToLayerPoint(new f(t));return this.layerPointToLatLng(e)}latLngToContainerPoint(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(new m(t)))}pointerEventToContainerPoint(t){return Ei(t,this._container)}pointerEventToLayerPoint(t){return this.containerPointToLayerPoint(this.pointerEventToContainerPoint(t))}pointerEventToLatLng(t){return this.layerPointToLatLng(this.pointerEventToLayerPoint(t))}_initContainer(t){const e=this._container=Ci(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");b(e,"scroll",this._onScroll,this),this._containerId=P(e),Mi()}_initLayout(){const t=this._container;this._fadeAnimated=this.options.fadeAnimation;const e=["leaflet-container","leaflet-touch"];F.retina&&e.push("leaflet-retina"),F.safari&&e.push("leaflet-safari"),this._fadeAnimated&&e.push("leaflet-fade-anim"),t.classList.add(...e);const{position:i}=getComputedStyle(t);i!=="absolute"&&i!=="relative"&&i!=="fixed"&&i!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()}_initPanes(){const t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),D(this._mapPane,new f(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(t.markerPane.classList.add("leaflet-zoom-hide"),t.shadowPane.classList.add("leaflet-zoom-hide"))}_resetView(t,e,i){D(this._mapPane,new f(0,0));const s=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");const o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),s&&this.fire("load")}_moveStart(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this}_move(t,e,i,s){e===void 0&&(e=this._zoom);const o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),s?i?.pinch&&this.fire("zoom",i):((o||i?.pinch)&&this.fire("zoom",i),this.fire("move",i)),this}_moveEnd(t){return t&&this.fire("zoomend"),this.fire("moveend")}_stop(){return cancelAnimationFrame(this._flyToFrame),this._panAnim?.stop(),this}_rawPanBy(t){D(this._mapPane,this._getMapPanePos().subtract(t))}_getZoomSpan(){return this.getMaxZoom()-this.getMinZoom()}_panInsideMaxBounds(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)}_checkIfLoaded(){if(!this._loaded)throw new Error("Set map center and zoom first.")}_initEvents(t){this._targets={},this._targets[P(this._container)]=this,(t?S:b)(this._container,"click dblclick pointerdown pointerup pointerover pointerout pointermove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&(t?this._resizeObserver.disconnect():(this._resizeObserver||(this._resizeObserver=new ResizeObserver(this._onResize.bind(this))),this._resizeObserver.observe(this._container))),this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)}_onResize(){cancelAnimationFrame(this._resizeRequest),this._resizeRequest=requestAnimationFrame(()=>{this.invalidateSize({debounceMoveend:!0})})}_onScroll(){this._container.scrollTop=0,this._container.scrollLeft=0}_onMoveEnd(){const t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())}_findEventTargets(t,e){let i=[],s,o=t.target||t.srcElement,r=!1;const a=e==="pointerout"||e==="pointerover";for(;o;){if(s=this._targets[P(o)],s&&(e==="click"||e==="preclick")&&this._draggableMoved(s)){r=!0;break}if(s&&s.listens(e,!0)&&(a&&!Ee(o,t)||(i.push(s),a))||o===this._container)break;o=o.parentNode}return!i.length&&!r&&!a&&this.listens(e,!0)&&(i=[this]),i}_isClickDisabled(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click||!t.parentNode)return!0;t=t.parentNode}}_handleDOMEvent(t){const e=t.target??t.srcElement;if(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))return;const i=t.type;i==="pointerdown"&&ke(e),this._fireDOMEvent(t,i)}_fireDOMEvent(t,e,i){e==="click"&&this._fireDOMEvent(t,"preclick",i);let s=this._findEventTargets(t,e);if(i&&(s=i.filter(l=>l.listens(e,!0)).concat(s)),!s.length)return;e==="contextmenu"&&G(t);const o=s[0],r={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){const a=o.getLatLng&&(!o._radius||o._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(o.getLatLng()):this.pointerEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?o.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(const a of s)if(a.fire(e,r,!0),r.originalEvent._stopped||a.options.bubblingPointerEvents===!1&&_t._pointerEvents.includes(e))return}_draggableMoved(t){return t=t.dragging?.enabled()?t:this,t.dragging?.moved()||this.boxZoom?.moved()}_clearHandlers(){for(const t of this._handlers)t.disable()}whenReady(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this}_getMapPanePos(){return gt(this._mapPane)}_moved(){const t=this._getMapPanePos();return t&&!t.equals([0,0])}_getTopLeftPoint(t,e){return(t&&e!==void 0?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())}_getNewPixelOrigin(t,e){const i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()}_latLngToNewLayerPoint(t,e,i){const s=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(s)}_latLngBoundsToNewLayerBounds(t,e,i){const s=this._getNewPixelOrigin(i,e);return new L([this.project(t.getSouthWest(),e)._subtract(s),this.project(t.getNorthWest(),e)._subtract(s),this.project(t.getSouthEast(),e)._subtract(s),this.project(t.getNorthEast(),e)._subtract(s)])}_getCenterLayerPoint(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))}_getCenterOffset(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())}_limitCenter(t,e,i){if(!i)return t;const s=this.project(t,e),o=this.getSize().divideBy(2),r=new L(s.subtract(o),s.add(o)),a=this._getBoundsOffset(r,i,e);return Math.abs(a.x)<=1&&Math.abs(a.y)<=1?t:this.unproject(s.add(a),e)}_limitOffset(t,e){if(!e)return t;const i=this.getPixelBounds(),s=new L(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(s,e))}_getBoundsOffset(t,e,i){const s=new L(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=s.min.subtract(t.min),r=s.max.subtract(t.max),a=this._rebound(o.x,-r.x),l=this._rebound(o.y,-r.y);return new f(a,l)}_rebound(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))}_limitZoom(t){const e=this.getMinZoom(),i=this.getMaxZoom(),s=this.options.zoomSnap;return s&&(t=Math.round(t/s)*s),Math.max(e,Math.min(i,t))}_onPanTransitionStep(){this.fire("move")}_onPanTransitionEnd(){this._mapPane.classList.remove("leaflet-pan-anim"),this.fire("moveend")}_tryAnimatedPan(t,e){const i=this._getCenterOffset(t)._trunc();return e?.animate!==!0&&!this.getSize().contains(i)?!1:(this.panBy(i,e),!0)}_createAnimProxy(){this._proxy=k("div","leaflet-proxy leaflet-zoom-animated"),this._panes.mapPane.appendChild(this._proxy),this.on("zoomanim",this._animateProxyZoom,this),this.on("load moveend",this._animMoveEnd,this),b(this._proxy,"transitionend",this._catchTransitionEnd,this)}_animateProxyZoom(t){const e=this._proxy.style.transform;mt(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style.transform&&this._animatingZoom&&this._onZoomTransitionEnd()}_animMoveEnd(){const t=this.getCenter(),e=this.getZoom();mt(this._proxy,this.project(t,e),this.getZoomScale(e,1))}_destroyAnimProxy(){this._proxy&&(S(this._proxy,"transitionend",this._catchTransitionEnd,this),this._proxy.remove(),this.off("zoomanim",this._animateProxyZoom,this),this.off("load moveend",this._animMoveEnd,this),delete this._proxy)}_catchTransitionEnd(t){this._animatingZoom&&t.propertyName.includes("transform")&&this._onZoomTransitionEnd()}_nothingToAnimate(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length}_tryAnimatedZoom(t,e,i){if(this._animatingZoom)return!0;if(i??={},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;const s=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/s);return i.animate!==!0&&!this.getSize().contains(o)?!1:(requestAnimationFrame(()=>{this._moveStart(!0,i.noMoveStart??!1)._animateZoom(t,e,!0)}),!0)}_animateZoom(t,e,i,s){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,this._mapPane.classList.add("leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:s}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._transitionEndTimer=setTimeout(this._onZoomTransitionEnd.bind(this),250))}_onZoomTransitionEnd(){this._animatingZoom&&(this._mapPane?.classList.remove("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))}},_t.setDefaultOptions({crs:ye,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0}),mn(_t,"_pointerEvents",["click","dblclick","pointerover","pointerout","contextmenu"]),_t);const An=w,Xe=class Xe extends Ot{initialize(t){z(this,t)}getPosition(){return this.options.position}setPosition(t){const e=this._map;return e?.removeControl(this),this.options.position=t,e?.addControl(this),this}getContainer(){return this._container}addTo(t){this.remove(),this._map=t;const e=this._container=this.onAdd(t),i=this.getPosition(),s=t._controlCorners[i];return e.classList.add("leaflet-control"),i.includes("bottom")?s.insertBefore(e,s.firstChild):s.appendChild(e),this._map.on("unload",this.remove,this),this}remove(){return this._map?(this._container.remove(),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this}_refocusOnMap(t){this._map&&t&&!(t.screenX===0&&t.screenY===0)&&this._map.getContainer().focus()}};Xe.setDefaultOptions({position:"topright"});let K=Xe;w.include({addControl(n){return n.addTo(this),this},removeControl(n){return n.remove(),this},_initControlPos(){const n=this._controlCorners={},t="leaflet-",e=this._controlContainer=k("div",`${t}control-container`,this._container);function i(s,o){const r=`${t+s} ${t}${o}`;n[s+o]=k("div",r,e)}i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")},_clearControlPos(){for(const n of Object.values(this._controlCorners))n.remove();this._controlContainer.remove(),delete this._controlCorners,delete this._controlContainer}});const Je=class Je extends K{initialize(t,e,i){z(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(const[s,o]of Object.entries(t??{}))this._addLayer(o,s);for(const[s,o]of Object.entries(e??{}))this._addLayer(o,s,!0)}onAdd(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(const e of this._layers)e.layer.on("add remove",this._onLayerChange,this);return this.options.collapsed||t.on("resize",this._expandIfNotCollapsed,this),this._container}addTo(t){return K.prototype.addTo.call(this,t),this._expandIfNotCollapsed()}onRemove(){this._map.off("zoomend",this._checkDisabledLayers,this);for(const t of this._layers)t.layer.off("add remove",this._onLayerChange,this);this._map.off("resize",this._expandIfNotCollapsed,this)}addBaseLayer(t,e){return this._addLayer(t,e),this._map?this._update():this}addOverlay(t,e){return this._addLayer(t,e,!0),this._map?this._update():this}removeLayer(t){t.off("add remove",this._onLayerChange,this);const e=this._getLayer(P(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this}expand(){clearTimeout(this._collapseDelayTimeout),this._container.classList.add("leaflet-control-layers-expanded"),this._section.style.height=null;const t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(this._section.classList.add("leaflet-control-layers-scrollbar"),this._section.style.height=`${t}px`):this._section.classList.remove("leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this}collapse(t){if(!t||!((t.type==="pointerleave"||t.type==="pointerout")&&t.pointerType==="touch")){if(this.options.collapseDelay>0)return this._collapseDelayTimeout=setTimeout(()=>{this._container.classList.remove("leaflet-control-layers-expanded")},this.options.collapseDelay),this;this._container.classList.remove("leaflet-control-layers-expanded")}return this}_initLayout(){const t="leaflet-control-layers",e=this._container=k("div",t),i=this.options.collapsed;It(e),Ze(e);const s=this._section=k("fieldset",`${t}-list`);i&&(this._map.on("click",this.collapse,this),b(e,{pointerenter:this._expandSafely,pointerleave:this.collapse},this));const o=this._layersLink=k("a",`${t}-toggle`,e);o.href="#",o.title="Layers",o.setAttribute("role","button"),b(o,{keydown(r){r.code==="Enter"&&this._expandSafely()},click(r){G(r),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=k("div",`${t}-base`,s),this._separator=k("div",`${t}-separator`,s),this._overlaysList=k("div",`${t}-overlays`,s),e.appendChild(s)}_getLayer(t){for(const e of this._layers)if(e&&P(e.layer)===t)return e}_addLayer(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(((s,o)=>this.options.sortFunction(s.layer,o.layer,s.name,o.name))),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()}_update(){if(!this._container)return this;this._baseLayersList.replaceChildren(),this._overlaysList.replaceChildren(),this._layerControlInputs=[];let t,e,i=0;for(const s of this._layers)this._addItem(s),e||=s.overlay,t||=!s.overlay,i+=s.overlay?0:1;return this.options.hideSingleBase&&(t=t&&i>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this}_onLayerChange(t){this._handlingClick||this._update();const e=this._getLayer(P(t.target)),i=e.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;i&&this._map.fire(i,e)}_addItem(t){const e=document.createElement("label"),i=this._map.hasLayer(t.layer),s=document.createElement("input");s.type=t.overlay?"checkbox":"radio",s.className="leaflet-control-layers-selector",s.defaultChecked=i,t.overlay||(s.name=`leaflet-base-layers_${P(this)}`),this._layerControlInputs.push(s),s.layerId=P(t.layer),b(s,"click",this._onInputClick,this);const o=document.createElement("span");o.innerHTML=` ${t.name}`;const r=document.createElement("span");return e.appendChild(r),r.appendChild(s),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e}_onInputClick(t){if(this._preventClick)return;const e=this._layerControlInputs,i=[],s=[];this._handlingClick=!0;for(const o of e){const r=this._getLayer(o.layerId).layer;o.checked?i.push(r):o.checked||s.push(r)}for(const o of s)this._map.hasLayer(o)&&this._map.removeLayer(o);for(const o of i)this._map.hasLayer(o)||this._map.addLayer(o);this._handlingClick=!1,this._refocusOnMap(t)}_checkDisabledLayers(){const t=this._layerControlInputs,e=this._map.getZoom();for(const i of t){const s=this._getLayer(i.layerId).layer;i.disabled=s.options.minZoom!==void 0&&e<s.options.minZoom||s.options.maxZoom!==void 0&&e>s.options.maxZoom}}_expandIfNotCollapsed(){return this._map&&!this.options.collapsed&&this.expand(),this}_expandSafely(){const t=this._section;this._preventClick=!0,b(t,"click",G),this.expand(),setTimeout(()=>{S(t,"click",G),this._preventClick=!1})}};Je.setDefaultOptions({collapsed:!0,collapseDelay:0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction(t,e,i,s){return i<s?-1:s<i?1:0}});let Be=Je;const Qe=class Qe extends K{onAdd(t){const e="leaflet-control-zoom",i=k("div",`${e} leaflet-bar`),s=this.options;return this._zoomInButton=this._createButton(s.zoomInText,s.zoomInTitle,`${e}-in`,i,this._zoomIn),this._zoomOutButton=this._createButton(s.zoomOutText,s.zoomOutTitle,`${e}-out`,i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i}onRemove(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)}disable(){return this._disabled=!0,this._updateDisabled(),this}enable(){return this._disabled=!1,this._updateDisabled(),this}_zoomIn(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))}_zoomOut(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))}_createButton(t,e,i,s,o){const r=k("a",i,s);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),It(r),b(r,"click",vt),b(r,"click",o,this),b(r,"click",this._refocusOnMap,this),r}_updateDisabled(){const t=this._map,e="leaflet-disabled";this._zoomInButton.classList.remove(e),this._zoomOutButton.classList.remove(e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(this._zoomOutButton.classList.add(e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(this._zoomInButton.classList.add(e),this._zoomInButton.setAttribute("aria-disabled","true"))}};Qe.setDefaultOptions({position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"});let Jt=Qe;w.mergeOptions({zoomControl:!0}),w.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Jt,this.addControl(this.zoomControl))});const ti=class ti extends K{onAdd(t){const e="leaflet-control-scale",i=k("div",e),s=this.options;return this._addScales(s,`${e}-line`,i),t.on(s.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i}onRemove(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)}_addScales(t,e,i){t.metric&&(this._mScale=k("div",e,i)),t.imperial&&(this._iScale=k("div",e,i))}_update(){const t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)}_updateScales(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)}_updateMetric(t){const e=this._getRoundNum(t),i=e<1e3?`${e} m`:`${e/1e3} km`;this._updateScale(this._mScale,i,e/t)}_updateImperial(t){const e=t*3.2808399;let i,s,o;e>5280?(i=e/5280,s=this._getRoundNum(i),this._updateScale(this._iScale,`${s} mi`,s/i)):(o=this._getRoundNum(e),this._updateScale(this._iScale,`${o} ft`,o/e))}_updateScale(t,e,i){t.style.width=`${Math.round(this.options.maxWidth*i)}px`,t.innerHTML=e}_getRoundNum(t){const e=10**(`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}};ti.setDefaultOptions({position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1});let Ie=ti;const Bn='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',ei=class ei extends K{initialize(t){z(this,t),this._attributions={}}onAdd(t){t.attributionControl=this,this._container=k("div","leaflet-control-attribution"),It(this._container);for(const e of Object.values(t._layers))e.getAttribution&&this.addAttribution(e.getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container}onRemove(t){t.off("layeradd",this._addAttribution,this)}_addAttribution(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",()=>this.removeAttribution(t.layer.getAttribution())))}setPrefix(t){return this.options.prefix=t,this._update(),this}addAttribution(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this}removeAttribution(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this}_update(){if(!this._map)return;const t=Object.keys(this._attributions).filter(i=>this._attributions[i]),e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(' <span aria-hidden="true">|</span> ')}};ei.setDefaultOptions({position:"bottomright",prefix:`<a target="_blank" href="https://leafletjs.com" title="A JavaScript library for interactive maps">${Bn}Leaflet</a>`});let Qt=ei;w.mergeOptions({attributionControl:!0}),w.addInitHook(function(){this.options.attributionControl&&new Qt().addTo(this)}),K.Layers=Be,K.Zoom=Jt,K.Scale=Ie,K.Attribution=Qt;class nt extends Ot{initialize(t){this._map=t}enable(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)}disable(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this}enabled(){return!!this._enabled}}nt.addTo=function(n,t){return n.addHandler(t,this),this};const ft=class ft extends Zt{initialize(t,e,i,s){z(this,s),this._element=t,this._dragStartTarget=e??t,this._preventOutline=i}enable(){this._enabled||(b(this._dragStartTarget,"pointerdown",this._onDown,this),this._enabled=!0)}disable(){this._enabled&&(ft._dragging===this&&this.finishDrag(!0),S(this._dragStartTarget,"pointerdown",this._onDown,this),this._enabled=!1,this._moved=!1)}_onDown(t){if(this._moved=!1,this._element.classList.contains("leaflet-zoom-anim"))return;if(Ct().length!==1){ft._dragging===this&&this.finishDrag();return}if(ft._dragging||t.shiftKey||t.button!==0&&t.pointerType!=="touch"||(ft._dragging=this,this._preventOutline&&ke(this._element),Le(),we(),this._moving))return;this.fire("down");const e=Ti(this._element);this._startPoint=new f(t.clientX,t.clientY),this._startPos=gt(this._element),this._parentScale=Te(e),b(document,"pointermove",this._onMove,this),b(document,"pointerup pointercancel",this._onUp,this)}_onMove(t){if(Ct().length>1){this._moved=!0;return}const e=new f(t.clientX,t.clientY)._subtract(this._startPoint);!e.x&&!e.y||Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||(e.x/=this._parentScale.x,e.y/=this._parentScale.y,t.cancelable&&G(t),this._moved||(this.fire("dragstart"),this._moved=!0,document.body.classList.add("leaflet-dragging"),this._lastTarget=t.target??t.srcElement,this._lastTarget.classList.add("leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,this._lastEvent=t,this._updatePosition())}_updatePosition(){const t={originalEvent:this._lastEvent};this.fire("predrag",t),D(this._element,this._newPos),this.fire("drag",t)}_onUp(){this.finishDrag()}finishDrag(t){document.body.classList.remove("leaflet-dragging"),this._lastTarget&&(this._lastTarget.classList.remove("leaflet-drag-target"),this._lastTarget=null),S(document,"pointermove",this._onMove,this),S(document,"pointerup pointercancel",this._onUp,this),Pe(),xe();const e=this._moved&&this._moving;this._moving=!1,ft._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}};ft.setDefaultOptions({clickTolerance:3});let Dt=ft;function Di(n,t,e){let i,s,o,r,a,l,h,d,c;const u=[1,4,2,8];for(s=0,h=n.length;s<h;s++)n[s]._code=bt(n[s],t);for(r=0;r<4;r++){for(d=u[r],i=[],s=0,h=n.length,o=h-1;s<h;o=s++)a=n[s],l=n[o],a._code&d?l._code&d||(c=te(l,a,d,t,e),c._code=bt(c,t),i.push(c)):(l._code&d&&(c=te(l,a,d,t,e),c._code=bt(c,t),i.push(c)),i.push(a));n=i}return n}function Ri(n,t){let e,i,s,o,r,a,l,h,d;if(!n||n.length===0)throw new Error("latlngs not passed");X(n)||(console.warn("latlngs are not flat! Only the first ring will be used"),n=n[0]);let c=new m([0,0]);const u=new C(n);u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(c=De(n));const y=n.length,g=[];for(e=0;e<y;e++){const v=new m(n[e]);g.push(t.project(new m([v.lat-c.lat,v.lng-c.lng])))}for(a=l=h=0,e=0,i=y-1;e<y;i=e++)s=g[e],o=g[i],r=s.y*o.x-o.y*s.x,l+=(s.x+o.x)*r,h+=(s.y+o.y)*r,a+=r*3;a===0?d=g[0]:d=[l/a,h/a];const x=t.unproject(new f(d));return new m([x.lat+c.lat,x.lng+c.lng])}function De(n){let t=0,e=0,i=0;for(const s of n){const o=new m(s);t+=o.lat,e+=o.lng,i++}return new m([t/i,e/i])}var In={__proto__:null,centroid:De,clipPolygon:Di,polygonCenter:Ri};function Ni(n,t){if(!t||!n.length)return n.slice();const e=t*t;return n=Nn(n,e),n=Rn(n,e),n}function Fi(n,t,e){return Math.sqrt(Rt(n,t,e,!0))}function Dn(n,t,e){return Rt(n,t,e)}function Rn(n,t){const e=n.length,i=new Uint8Array(e);i[0]=i[e-1]=1,Re(n,i,t,0,e-1);let s;const o=[];for(s=0;s<e;s++)i[s]&&o.push(n[s]);return o}function Re(n,t,e,i,s){let o=0,r,a,l;for(a=i+1;a<=s-1;a++)l=Rt(n[a],n[i],n[s],!0),l>o&&(r=a,o=l);o>e&&(t[r]=1,Re(n,t,e,i,r),Re(n,t,e,r,s))}function Nn(n,t){const e=[n[0]];let i=0;for(let s=1;s<n.length;s++)Fn(n[s],n[i])>t&&(e.push(n[s]),i=s);return i<n.length-1&&e.push(n[n.length-1]),e}let ji;function Hi(n,t,e,i,s){let o=i?ji:bt(n,e),r=bt(t,e),a,l,h;for(ji=r;;){if(!(o|r))return[n,t];if(o&r)return!1;a=o||r,l=te(n,t,a,e,s),h=bt(l,e),a===o?(n=l,o=h):(t=l,r=h)}}function te(n,t,e,i,s){const o=t.x-n.x,r=t.y-n.y,a=i.min,l=i.max;let h,d;return e&8?(h=n.x+o*(l.y-n.y)/r,d=l.y):e&4?(h=n.x+o*(a.y-n.y)/r,d=a.y):e&2?(h=l.x,d=n.y+r*(l.x-n.x)/o):e&1&&(h=a.x,d=n.y+r*(a.x-n.x)/o),new f(h,d,s)}function bt(n,t){let e=0;return n.x<t.min.x?e|=1:n.x>t.max.x&&(e|=2),n.y<t.min.y?e|=4:n.y>t.max.y&&(e|=8),e}function Fn(n,t){const e=t.x-n.x,i=t.y-n.y;return e*e+i*i}function Rt(n,t,e,i){let s=t.x,o=t.y,r=e.x-s,a=e.y-o,l;const h=r*r+a*a;return h>0&&(l=((n.x-s)*r+(n.y-o)*a)/h,l>1?(s=e.x,o=e.y):l>0&&(s+=r*l,o+=a*l)),r=n.x-s,a=n.y-o,i?r*r+a*a:new f(s,o)}function X(n){return!Array.isArray(n[0])||typeof n[0][0]!="object"&&typeof n[0][0]<"u"}function Gi(n,t){let e,i,s,o,r,a,l,h;if(!n||n.length===0)throw new Error("latlngs not passed");X(n)||(console.warn("latlngs are not flat! Only the first ring will be used"),n=n[0]);let d=new m([0,0]);const c=new C(n);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(d=De(n));const p=n.length,y=[];for(e=0;e<p;e++){const x=new m(n[e]);y.push(t.project(new m([x.lat-d.lat,x.lng-d.lng])))}for(e=0,i=0;e<p-1;e++)i+=y[e].distanceTo(y[e+1])/2;if(i===0)h=y[0];else for(e=0,o=0;e<p-1;e++)if(r=y[e],a=y[e+1],s=r.distanceTo(a),o+=s,o>i){l=(o-i)/s,h=[a.x-l*(a.x-r.x),a.y-l*(a.y-r.y)];break}const g=t.unproject(new f(h));return new m([g.lat+d.lat,g.lng+d.lng])}var jn={__proto__:null,_getBitCode:bt,_getEdgeIntersection:te,_sqClosestPointOnSegment:Rt,clipSegment:Hi,closestPointOnSegment:Dn,isFlat:X,pointToSegmentDistance:Fi,polylineCenter:Gi,simplify:Ni};const Ne={project(n){return n=new m(n),new f(n.lng,n.lat)},unproject(n){return n=new f(n),new m(n.y,n.x)},bounds:new L([-180,-90],[180,90])},Fe={R:6378137,R_MINOR:6356752314245179e-9,bounds:new L([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project(n){n=new m(n);const t=Math.PI/180,e=this.R,i=this.R_MINOR/e,s=Math.sqrt(1-i*i);let o=n.lat*t;const r=s*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/((1-r)/(1+r))**(s/2);return o=-e*Math.log(Math.max(a,1e-10)),new f(n.lng*t*e,o)},unproject(n){n=new f(n);const t=180/Math.PI,e=this.R,i=this.R_MINOR/e,s=Math.sqrt(1-i*i),o=Math.exp(-n.y/e);let r=Math.PI/2-2*Math.atan(o);for(let a=0,l=.1,h;a<15&&Math.abs(l)>1e-7;a++)h=s*Math.sin(r),h=((1-h)/(1+h))**(s/2),l=Math.PI/2-2*Math.atan(o*h)-r,r+=l;return new m(r*t,n.x*t/e)}};var Hn={__proto__:null,LonLat:Ne,Mercator:Fe,SphericalMercator:ge};class Gn extends dt{static code="EPSG:3395";static projection=Fe;static transformation=(()=>{const t=.5/(Math.PI*Fe.R);return new Et(t,.5,-t,.5)})()}class Wi extends dt{static code="EPSG:4326";static projection=Ne;static transformation=new Et(.005555555555555556,1,-.005555555555555556,.5)}class Wn extends ot{static projection=Ne;static transformation=new Et(1,0,-1,0);static scale(t){return 2**t}static zoom(t){return Math.log(t)/Math.LN2}static distance(t,e){const i=e.lng-t.lng,s=e.lat-t.lat;return Math.sqrt(i*i+s*s)}static infinite=!0}ot.Earth=dt,ot.EPSG3395=Gn,ot.EPSG3857=ye,ot.EPSG900913=vn,ot.EPSG4326=Wi,ot.Simple=Wn;const ii=class ii extends Zt{addTo(t){return t.addLayer(this),this}remove(){return this.removeFrom(this._map||this._mapToAdd)}removeFrom(t){return t?.removeLayer(this),this}getPane(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)}addInteractiveTarget(t){return this._map._targets[P(t)]=this,this}removeInteractiveTarget(t){return delete this._map._targets[P(t)],this}getAttribution(){return this.options.attribution}_layerAdd(t){const e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){const i=this.getEvents();e.on(i,this),this.once("remove",()=>e.off(i,this))}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}};ii.setDefaultOptions({pane:"overlayPane",attribution:null,bubblingPointerEvents:!0});let $=ii;w.include({addLayer(n){if(!n._layerAdd)throw new Error("The provided object is not a Layer.");const t=P(n);return this._layers[t]?this:(this._layers[t]=n,n._mapToAdd=this,n.beforeAdd&&n.beforeAdd(this),this.whenReady(n._layerAdd,n),this)},removeLayer(n){const t=P(n);return this._layers[t]?(this._loaded&&n.onRemove(this),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:n}),n.fire("remove")),n._map=n._mapToAdd=null,this):this},hasLayer(n){return P(n)in this._layers},eachLayer(n,t){for(const e of Object.values(this._layers))n.call(t,e);return this},_addLayers(n){n=n?Array.isArray(n)?n:[n]:[];for(const t of n)this.addLayer(t)},_addZoomLimit(n){(!isNaN(n.options.maxZoom)||!isNaN(n.options.minZoom))&&(this._zoomBoundLayers[P(n)]=n,this._updateZoomLevels())},_removeZoomLimit(n){const t=P(n);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels(){let n=1/0,t=-1/0;const e=this._getZoomSpan();for(const i of Object.values(this._zoomBoundLayers)){const s=i.options;n=Math.min(n,s.minZoom??1/0),t=Math.max(t,s.maxZoom??-1/0)}this._layersMaxZoom=t===-1/0?void 0:t,this._layersMinZoom=n===1/0?void 0:n,e!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});class Nt extends ${initialize(t,e){z(this,e),this._layers={};for(const i of t??[])this.addLayer(i)}addLayer(t){const e=this.getLayerId(t);return this._layers[e]=t,this._map?.addLayer(t),this}removeLayer(t){const e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this}hasLayer(t){return(typeof t=="number"?t:this.getLayerId(t))in this._layers}clearLayers(){return this.eachLayer(this.removeLayer,this)}invoke(t,...e){for(const i of Object.values(this._layers))i[t]?.apply(i,e);return this}onAdd(t){this.eachLayer(t.addLayer,t)}onRemove(t){this.eachLayer(t.removeLayer,t)}eachLayer(t,e){for(const i of Object.values(this._layers))t.call(e,i);return this}getLayer(t){return this._layers[t]}getLayers(){const t=[];return this.eachLayer(t.push,t),t}setZIndex(t){return this.invoke("setZIndex",t)}getLayerId(t){return P(t)}}class ut extends Nt{addLayer(t){return this.hasLayer(t)?this:(t.addEventParent(this),Nt.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))}removeLayer(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Nt.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this}setStyle(t){return this.invoke("setStyle",t)}bringToFront(){return this.invoke("bringToFront")}bringToBack(){return this.invoke("bringToBack")}getBounds(){const t=new C;for(const e of Object.values(this._layers))t.extend(e.getBounds?e.getBounds():e.getLatLng());return t}}const ni=class ni extends Ot{initialize(t){z(this,t)}createIcon(t){return this._createIcon("icon",t)}createShadow(t){return this._createIcon("shadow",t)}_createIcon(t,e){const i=this._getIconUrl(t);if(!i){if(t==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}const s=this._createImg(i,e&&e.tagName==="IMG"?e:null);return this._setIconStyles(s,t),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),s}_setIconStyles(t,e){const i=this.options;let s=i[`${e}Size`];typeof s=="number"&&(s=[s,s]);const o=f.validate(s)&&new f(s),r=e==="shadow"&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0),a=f.validate(r)&&new f(r);t.className=`leaflet-marker-${e} ${i.className||""}`,a&&(t.style.marginLeft=`${-a.x}px`,t.style.marginTop=`${-a.y}px`),o&&(t.style.width=`${o.x}px`,t.style.height=`${o.y}px`)}_createImg(t,e){return e??=document.createElement("img"),e.src=t,e}_getIconUrl(t){return F.retina&&this.options[`${t}RetinaUrl`]||this.options[`${t}Url`]}};ni.setDefaultOptions({popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1});let wt=ni;const zt=class zt extends wt{_getIconUrl(t){zt.imagePath||(zt.imagePath=this._detectIconPath());const e=wt.prototype._getIconUrl.call(this,t);return e?(this.options.imagePath||zt.imagePath)+e:null}_stripUrl(t){const e=function(i,s,o){const r=s.exec(i);return r&&r[o]};return t=e(t,/^url\((['"])?(.+)\1\)$/,2),t&&e(t,/^(.*)marker-icon\.png$/,1)}_detectIconPath(){const t=k("div","leaflet-default-icon-path",document.body),e=this._stripUrl(getComputedStyle(t).backgroundImage);if(document.body.removeChild(t),e)return e;const i=document.querySelector('link[href$="leaflet.css"]');return i?i.href.substring(0,i.href.length-11-1):""}};zt.setDefaultOptions({iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]});let ee=zt;class $i extends nt{initialize(t){this._marker=t}addHooks(){const t=this._marker._icon;this._draggable||(this._draggable=new Dt(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),t.classList.add("leaflet-marker-draggable")}removeHooks(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon?.classList.remove("leaflet-marker-draggable")}moved(){return this._draggable?._moved}_adjustPan(t){const e=this._marker,i=e._map,s=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=gt(e._icon),a=i.getPixelBounds(),l=i.getPixelOrigin(),h=new L(a.min._subtract(l).add(o),a.max._subtract(l).subtract(o));if(!h.contains(r)){const d=new f((Math.max(h.max.x,r.x)-h.max.x)/(a.max.x-h.max.x)-(Math.min(h.min.x,r.x)-h.min.x)/(a.min.x-h.min.x),(Math.max(h.max.y,r.y)-h.max.y)/(a.max.y-h.max.y)-(Math.min(h.min.y,r.y)-h.min.y)/(a.min.y-h.min.y)).multiplyBy(s);i.panBy(d,{animate:!1}),this._draggable._newPos._add(d),this._draggable._startPos._add(d),D(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=requestAnimationFrame(this._adjustPan.bind(this,t))}}_onDragStart(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup?.(),this._marker.fire("movestart").fire("dragstart")}_onPreDrag(t){this._marker.options.autoPan&&(cancelAnimationFrame(this._panRequest),this._panRequest=requestAnimationFrame(this._adjustPan.bind(this,t)))}_onDrag(t){const e=this._marker,i=e._shadow,s=gt(e._icon),o=e._map.layerPointToLatLng(s);i&&D(i,s),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)}_onDragEnd(t){cancelAnimationFrame(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}const si=class si extends ${initialize(t,e){z(this,e),this._latlng=new m(t)}onAdd(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()}onRemove(t){this.dragging?.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()}getEvents(){return{zoom:this.update,viewreset:this.update}}getLatLng(){return this._latlng}setLatLng(t){const e=this._latlng;return this._latlng=new m(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})}setZIndexOffset(t){return this.options.zIndexOffset=t,this.update()}getIcon(){return this.options.icon}setIcon(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this}getElement(){return this._icon}update(){if(this._icon&&this._map){const t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this}_initIcon(){const t=this.options,e=`leaflet-zoom-${this._zoomAnimated?"animated":"hide"}`,i=t.icon.createIcon(this._icon);let s=!1;i!==this._icon&&(this._icon&&this._removeIcon(),s=!0,t.title&&(i.title=t.title),i.tagName==="IMG"&&(i.alt=t.alt??"")),i.classList.add(e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({pointerover:this._bringToFront,pointerout:this._resetZIndex}),this.options.autoPanOnFocus&&b(i,"focus",this._panOnFocus,this);const o=t.icon.createShadow(this._shadow);let r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(o.classList.add(e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),s&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)}_removeIcon(){this.options.riseOnHover&&this.off({pointerover:this._bringToFront,pointerout:this._resetZIndex}),this.options.autoPanOnFocus&&S(this._icon,"focus",this._panOnFocus,this),this._icon.remove(),this.removeInteractiveTarget(this._icon),this._icon=null}_removeShadow(){this._shadow?.remove(),this._shadow=null}_setPos(t){this._icon&&D(this._icon,t),this._shadow&&D(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()}_updateZIndex(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)}_animateZoom(t){const e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)}_initInteraction(){if(this.options.interactive&&(this._icon.classList.add("leaflet-interactive"),this.addInteractiveTarget(this._icon),$i)){let t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new $i(this),t&&this.dragging.enable()}}setOpacity(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this}_updateOpacity(){const t=this.options.opacity;this._icon&&(this._icon.style.opacity=t),this._shadow&&(this._shadow.style.opacity=t)}_bringToFront(){this._updateZIndex(this.options.riseOffset)}_resetZIndex(){this._updateZIndex(0)}_panOnFocus(){const t=this._map;if(!t)return;const e=this.options.icon.options,i=e.iconSize?new f(e.iconSize):new f(0,0),s=e.iconAnchor?new f(e.iconAnchor):new f(0,0);t.panInside(this._latlng,{paddingTopLeft:s,paddingBottomRight:i.subtract(s)})}_getPopupAnchor(){return this.options.icon.options.popupAnchor}_getTooltipAnchor(){return this.options.icon.options.tooltipAnchor}};si.setDefaultOptions({icon:new ee,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingPointerEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10});let Ft=si;const oi=class oi extends ${beforeAdd(t){this._renderer=t.getRenderer(this)}onAdd(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)}onRemove(){this._renderer._removePath(this)}redraw(){return this._map&&this._renderer._updatePath(this),this}setStyle(t){return z(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.hasOwn(t,"weight")&&this._updateBounds()),this}bringToFront(){return this._renderer?._bringToFront(this),this}bringToBack(){return this._renderer?._bringToBack(this),this}getElement(){return this._path}_reset(){this._project(),this._update()}_clickTolerance(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}};oi.setDefaultOptions({stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingPointerEvents:!0});let st=oi;const ri=class ri extends st{initialize(t,e){z(this,e),this._latlng=new m(t),this._radius=this.options.radius}setLatLng(t){const e=this._latlng;return this._latlng=new m(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})}getLatLng(){return this._latlng}setRadius(t){return this.options.radius=this._radius=t,this.redraw()}getRadius(){return this._radius}setStyle(t){const e=t?.radius??this._radius;return st.prototype.setStyle.call(this,t),this.setRadius(e),this}_project(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()}_updateBounds(){const t=this._radius,e=this._radiusY??t,i=this._clickTolerance(),s=[t+i,e+i];this._pxBounds=new L(this._point.subtract(s),this._point.add(s))}_update(){this._map&&this._updatePath()}_updatePath(){this._renderer._updateCircle(this)}_empty(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)}_containsPoint(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}};ri.setDefaultOptions({fill:!0,radius:10});let jt=ri;class Ui extends jt{initialize(t,e){if(z(this,e),this._latlng=new m(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius}setRadius(t){return this._mRadius=t,this.redraw()}getRadius(){return this._mRadius}getBounds(){const t=[this._radius,this._radiusY??this._radius];return new C(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))}setStyle=st.prototype.setStyle;_project(){const t=this._latlng.lng,e=this._latlng.lat,i=this._map,s=i.options.crs;if(s.distance===dt.distance){const o=Math.PI/180,r=this._mRadius/dt.R/o,a=i.project([e+r,t]),l=i.project([e-r,t]),h=a.add(l).divideBy(2),d=i.unproject(h).lat;let c=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(d*o))/(Math.cos(e*o)*Math.cos(d*o)))/o;(isNaN(c)||c===0)&&(c=r/Math.cos(Math.PI/180*e)),this._point=h.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:h.x-i.project([d,t-c]).x,this._radiusY=h.y-a.y}else{const o=s.unproject(s.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=Math.abs(this._point.x-i.latLngToLayerPoint(o).x)}this._updateBounds()}}const ai=class ai extends st{initialize(t,e){z(this,e),this._setLatLngs(t)}getLatLngs(){return this._latlngs}setLatLngs(t){return this._setLatLngs(t),this.redraw()}isEmpty(){return!this._latlngs.length}closestLayerPoint(t){t=new f(t);let e=1/0,i=null,s,o;const r=Rt;for(const a of this._parts)for(let l=1,h=a.length;l<h;l++){s=a[l-1],o=a[l];const d=r(t,s,o,!0);d<e&&(e=d,i=r(t,s,o))}return i&&(i.distance=Math.sqrt(e)),i}getCenter(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Gi(this._defaultShape(),this._map.options.crs)}getBounds(){return this._bounds}addLatLng(t,e){return e??=this._defaultShape(),t=new m(t),e.push(t),this._bounds.extend(t),this.redraw()}_setLatLngs(t){this._bounds=new C,this._latlngs=this._convertLatLngs(t)}_defaultShape(){return X(this._latlngs)?this._latlngs:this._latlngs[0]}_convertLatLngs(t){const e=[],i=X(t);for(let s=0,o=t.length;s<o;s++)i?(e[s]=new m(t[s]),this._bounds.extend(e[s])):e[s]=this._convertLatLngs(t[s]);return e}_project(){const t=new L;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())}_updateBounds(){const t=this._clickTolerance(),e=new f(t,t);this._rawPxBounds&&(this._pxBounds=new L([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))}_projectLatlngs(t,e,i){if(t[0]instanceof m){const o=t.map(r=>this._map.latLngToLayerPoint(r));o.forEach(r=>i.extend(r)),e.push(o)}else t.forEach(o=>this._projectLatlngs(o,e,i))}_clipPoints(){const t=this._renderer._bounds;if(this._parts=[],!this._pxBounds||!this._pxBounds.intersects(t))return;if(this.options.noClip){this._parts=this._rings;return}const e=this._parts;let i,s,o,r,a,l,h;for(i=0,o=0,r=this._rings.length;i<r;i++)for(h=this._rings[i],s=0,a=h.length;s<a-1;s++)l=Hi(h[s],h[s+1],t,s,!0),l&&(e[o]??=[],e[o].push(l[0]),(l[1]!==h[s+1]||s===a-2)&&(e[o].push(l[1]),o++))}_simplifyPoints(){const t=this._parts,e=this.options.smoothFactor;for(let i=0,s=t.length;i<s;i++)t[i]=Ni(t[i],e)}_update(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())}_updatePath(){this._renderer._updatePoly(this)}_containsPoint(t,e){let i,s,o,r,a,l;const h=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(l=this._parts[i],s=0,a=l.length,o=a-1;s<a;o=s++)if(!(!e&&s===0)&&Fi(t,l[o],l[s])<=h)return!0;return!1}};ai.setDefaultOptions({smoothFactor:1,noClip:!1});let at=ai;const li=class li extends at{isEmpty(){return!this._latlngs.length||!this._latlngs[0].length}getCenter(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Ri(this._defaultShape(),this._map.options.crs)}_convertLatLngs(t){const e=at.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof m&&e[0].equals(e[i-1])&&e.pop(),e}_setLatLngs(t){at.prototype._setLatLngs.call(this,t),X(this._latlngs)&&(this._latlngs=[this._latlngs])}_defaultShape(){return X(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]}_clipPoints(){let t=this._renderer._bounds;const e=this.options.weight,i=new f(e,e);if(t=new L(t.min.subtract(i),t.max.add(i)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(const s of this._rings){const o=Di(s,t,!0);o.length&&this._parts.push(o)}}}_updatePath(){this._renderer._updatePoly(this,!0)}_containsPoint(t){let e=!1,i,s,o,r,a,l,h,d;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(r=0,h=this._parts.length;r<h;r++)for(i=this._parts[r],a=0,d=i.length,l=d-1;a<d;l=a++)s=i[a],o=i[l],s.y>t.y!=o.y>t.y&&t.x<(o.x-s.x)*(t.y-s.y)/(o.y-s.y)+s.x&&(e=!e);return e||at.prototype._containsPoint.call(this,t,!0)}};li.setDefaultOptions({fill:!0});let xt=li;class pt extends ut{initialize(t,e){z(this,e),this._layers={},t&&this.addData(t)}addData(t){const e=Array.isArray(t)?t:t.features;if(e){for(const o of e)(o.geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}const i=this.options;if(i.filter&&!i.filter(t))return this;const s=ie(t,i);return s?(s.feature=oe(t),s.defaultOptions=s.options,this.resetStyle(s),i.onEachFeature&&i.onEachFeature(t,s),this.addLayer(s)):this}resetStyle(t){return t===void 0?this.eachLayer(this.resetStyle,this):(t.options=Object.create(t.defaultOptions),this._setLayerStyle(t,this.options.style),this)}setStyle(t){return this.eachLayer(e=>this._setLayerStyle(e,t))}_setLayerStyle(t,e){t.setStyle&&(typeof e=="function"&&(e=e(t.feature)),t.setStyle(e))}}function ie(n,t){const e=n.type==="Feature"?n.geometry:n,i=e?.coordinates,s=[],o=t?.pointToLayer,r=t?.coordsToLatLng??je;let a,l;if(!i&&!e)return null;switch(e.type){case"Point":return a=r(i),qi(o,n,a,t);case"MultiPoint":for(const h of i)a=r(h),s.push(qi(o,n,a,t));return new ut(s);case"LineString":case"MultiLineString":return l=ne(i,e.type==="LineString"?0:1,r),new at(l,t);case"Polygon":case"MultiPolygon":return l=ne(i,e.type==="Polygon"?1:2,r),new xt(l,t);case"GeometryCollection":for(const h of e.geometries){const d=ie({geometry:h,type:"Feature",properties:n.properties},t);d&&s.push(d)}return new ut(s);case"FeatureCollection":for(const h of e.features){const d=ie(h,t);d&&s.push(d)}return new ut(s);default:throw new Error("Invalid GeoJSON object.")}}function qi(n,t,e,i){return n?n(t,e):new Ft(e,i?.markersInheritOptions&&i)}function je(n){return new m(n[1],n[0],n[2])}function ne(n,t,e){return n.map(i=>t?ne(i,t-1,e):(e||je)(i))}function He(n,t){return n=new m(n),n.alt!==void 0?[et(n.lng,t),et(n.lat,t),et(n.alt,t)]:[et(n.lng,t),et(n.lat,t)]}function se(n,t,e,i){const s=n.map(o=>t?se(o,X(o)?0:t-1,e,i):He(o,i));return!t&&e&&s.length>0&&s.push(s[0].slice()),s}function kt(n,t){return n.feature?{...n.feature,geometry:t}:oe(t)}function oe(n){return n.type==="Feature"||n.type==="FeatureCollection"?n:{type:"Feature",properties:{},geometry:n}}const Ge={toGeoJSON(n){return kt(this,{type:"Point",coordinates:He(this.getLatLng(),n)})}};Ft.include(Ge),Ui.include(Ge),jt.include(Ge),at.include({toGeoJSON(n){const t=!X(this._latlngs),e=se(this._latlngs,t?1:0,!1,n);return kt(this,{type:`${t?"Multi":""}LineString`,coordinates:e})}}),xt.include({toGeoJSON(n){const t=!X(this._latlngs),e=t&&!X(this._latlngs[0]);let i=se(this._latlngs,e?2:t?1:0,!0,n);return t||(i=[i]),kt(this,{type:`${e?"Multi":""}Polygon`,coordinates:i})}}),Nt.include({toMultiPoint(n){const t=[];return this.eachLayer(e=>{t.push(e.toGeoJSON(n).geometry.coordinates)}),kt(this,{type:"MultiPoint",coordinates:t})},toGeoJSON(n){const t=this.feature?.geometry?.type;if(t==="MultiPoint")return this.toMultiPoint(n);const e=t==="GeometryCollection",i=[];return this.eachLayer(s=>{if(s.toGeoJSON){const o=s.toGeoJSON(n);if(e)i.push(o.geometry);else{const r=oe(o);r.type==="FeatureCollection"?i.push.apply(i,r.features):i.push(r)}}}),e?kt(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}});const hi=class hi extends ${initialize(t){z(this,t)}onAdd(){this._container||(this._initContainer(),this._container.classList.add("leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._resizeContainer(),this._onMoveEnd()}onRemove(){this._destroyContainer()}getEvents(){const t={viewreset:this._reset,zoom:this._onZoom,moveend:this._onMoveEnd,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),this.options.continuous&&(t.move=this._onMoveEnd),t}_onAnimZoom(t){this._updateTransform(t.center,t.zoom)}_onZoom(){this._updateTransform(this._map.getCenter(),this._map.getZoom())}_updateTransform(t,e){const i=this._map.getZoomScale(e,this._zoom),s=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),r=s.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));mt(this._container,r,i)}_onMoveEnd(t){const e=this.options.padding,i=this._map.getSize(),s=this._map.containerPointToLayerPoint(i.multiplyBy(-e)).round();this._bounds=new L(s,s.add(i.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom(),this._updateTransform(this._center,this._zoom),this._onSettled(t),this._resizeContainer()}_reset(){this._onSettled(),this._updateTransform(this._center,this._zoom),this._onViewReset()}_initContainer(){this._container=k("div")}_destroyContainer(){S(this._container),this._container.remove(),delete this._container}_resizeContainer(){const t=this.options.padding,e=this._map.getSize().multiplyBy(1+t*2).round();return this._container.style.width=`${e.x}px`,this._container.style.height=`${e.y}px`,e}_onZoomEnd(){}_onViewReset(){}_onSettled(){}};hi.setDefaultOptions({padding:.1,continuous:!1});let re=hi;const di=class di extends ${initialize(t,e,i){this._url=t,this._bounds=new C(e),z(this,i)}onAdd(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(this._image.classList.add("leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()}onRemove(){this._image.remove(),this.options.interactive&&this.removeInteractiveTarget(this._image)}setOpacity(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this}setStyle(t){return t.opacity&&this.setOpacity(t.opacity),this}bringToFront(){return this._map&&At(this._image),this}bringToBack(){return this._map&&Bt(this._image),this}setUrl(t){return this._url=t,this._image&&(this._image.src=t),this}setBounds(t){return this._bounds=new C(t),this._map&&this._reset(),this}getEvents(){const t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t}setZIndex(t){return this.options.zIndex=t,this._updateZIndex(),this}getBounds(){return this._bounds}getElement(){return this._image}_initImage(){const t=this._url.tagName==="IMG",e=this._image=t?this._url:k("img");if(e.classList.add("leaflet-image-layer"),this._zoomAnimated&&e.classList.add("leaflet-zoom-animated"),this.options.className&&e.classList.add(...it(this.options.className)),e.onselectstart=V,e.onpointermove=V,e.onload=this.fire.bind(this,"load"),e.onerror=this._overlayOnError.bind(this),(this.options.crossOrigin||this.options.crossOrigin==="")&&(e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),e.decoding=this.options.decoding,this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt}_animateZoom(t){const e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;mt(this._image,i,e)}_reset(){const t=this._image,e=new L(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();D(t,e.min),t.style.width=`${i.x}px`,t.style.height=`${i.y}px`}_updateOpacity(){this._image.style.opacity=this.options.opacity}_updateZIndex(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)}_overlayOnError(){this.fire("error");const t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}getCenter(){return this._bounds.getCenter()}};di.setDefaultOptions({opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:"",decoding:"auto"});let Ht=di;const ci=class ci extends Ht{_initImage(){const t=this._url.tagName==="VIDEO",e=this._image=t?this._url:k("video");if(e.classList.add("leaflet-image-layer"),this._zoomAnimated&&e.classList.add("leaflet-zoom-animated"),this.options.className&&e.classList.add(...it(this.options.className)),b(e,"pointerdown",i=>{e.controls&&ct(i)}),e.onloadeddata=this.fire.bind(this,"load"),t){const i=e.getElementsByTagName("source"),s=i.map(o=>o.src);this._url=i.length>0?s:[e.src];return}Array.isArray(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.hasOwn(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.controls=!!this.options.controls,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(const i of this._url){const s=k("source");s.src=i,e.appendChild(s)}}};ci.setDefaultOptions({autoplay:!0,controls:!1,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0});let We=ci;class $n extends Ht{_initImage(){const t=this._image=this._url;t.classList.add("leaflet-image-layer"),this._zoomAnimated&&t.classList.add("leaflet-zoom-animated"),this.options.className&&t.classList.add(...it(this.options.className)),t.onselectstart=V,t.onpointermove=V}}const ui=class ui extends ${initialize(t,e){t instanceof m||Array.isArray(t)?(this._latlng=new m(t),z(this,e)):(z(this,t),this._source=e),this.options.content&&(this._content=this.options.content)}openOn(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this}close(){return this._map?.removeLayer(this),this}toggle(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this}onAdd(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&(this._container.style.opacity=0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&(this._container.style.opacity=1),this.bringToFront(),this.options.interactive&&(this._container.classList.add("leaflet-interactive"),this.addInteractiveTarget(this._container))}onRemove(t){t._fadeAnimated?(this._container.style.opacity=0,this._removeTimeout=setTimeout(()=>this._container.remove(),200)):this._container.remove(),this.options.interactive&&(this._container.classList.remove("leaflet-interactive"),this.removeInteractiveTarget(this._container))}getLatLng(){return this._latlng}setLatLng(t){return this._latlng=new m(t),this._map&&(this._updatePosition(),this._adjustPan()),this}getContent(){return this._content}setContent(t){return this._content=t,this.update(),this}getElement(){return this._container}update(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())}getEvents(){const t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t}isOpen(){return!!this._map&&this._map.hasLayer(this)}bringToFront(){return this._map&&At(this._container),this}bringToBack(){return this._map&&Bt(this._container),this}_prepareOpen(t){let e=this._source;if(!e._map)return!1;if(e instanceof ut){e=null;for(const i of Object.values(this._source._layers))if(i._map){e=i;break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else if(e.getBounds)t=e.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(t),this._map&&this.update(),!0}_updateContent(){if(!this._content)return;const t=this._contentNode,e=typeof this._content=="function"?this._content(this._source??this):this._content;if(typeof e=="string")t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}_updatePosition(){if(!this._map)return;const t=this._map.latLngToLayerPoint(this._latlng),e=this._getAnchor();let i=new f(this.options.offset);this._zoomAnimated?D(this._container,t.add(e)):i=i.add(t).add(e);const s=this._containerBottom=-i.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+i.x;this._container.style.bottom=`${s}px`,this._container.style.left=`${o}px`}_getAnchor(){return[0,0]}};ui.setDefaultOptions({interactive:!1,offset:[0,0],className:"",pane:void 0,content:""});let Y=ui;w.include({_initOverlay(n,t,e,i){let s=t;return s instanceof n||(s=new n(i).setContent(t)),e&&s.setLatLng(e),s}}),$.include({_initOverlay(n,t,e,i){let s=e;return s instanceof n?(z(s,i),s._source=this):(s=t&&!i?t:new n(i,this),s.setContent(e)),s}});const pi=class pi extends Y{openOn(t){return t=arguments.length?t:this._source._map,!t.hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Y.prototype.openOn.call(this,t)}onAdd(t){Y.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof st||this._source.on("preclick",ct))}onRemove(t){Y.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof st||this._source.off("preclick",ct))}getEvents(){const t=Y.prototype.getEvents.call(this);return(this.options.closeOnClick??this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t}_initLayout(){const t="leaflet-popup",e=this._container=k("div",`${t} ${this.options.className||""} leaflet-zoom-animated`),i=this._wrapper=k("div",`${t}-content-wrapper`,e);if(this._contentNode=k("div",`${t}-content`,i),It(e),Ze(this._contentNode),b(e,"contextmenu",ct),this._tipContainer=k("div",`${t}-tip-container`,e),this._tip=k("div",`${t}-tip`,this._tipContainer),this.options.closeButton){const s=this._closeButton=k("a",`${t}-close-button`,e);s.setAttribute("role","button"),s.setAttribute("aria-label",this.options.closeButtonLabel),s.href="#close",s.innerHTML='<span aria-hidden="true">&#215;</span>',b(s,"click",o=>{G(o),this.close()})}this.options.trackResize&&(this._resizeObserver=new ResizeObserver((s=>{this._map&&(this._containerWidth=s[0]?.contentRect?.width,this._containerHeight=s[0]?.contentRect?.height,this._updateLayout(),this._updatePosition(),this._adjustPan())})),this._resizeObserver.observe(this._contentNode))}_updateLayout(){const t=this._contentNode,e=t.style;e.maxWidth=`${this.options.maxWidth}px`,e.minWidth=`${this.options.minWidth}px`;const i=this._containerHeight??t.offsetHeight,s=this.options.maxHeight,o="leaflet-popup-scrolled";s&&i>s?(e.height=`${s}px`,t.classList.add(o)):t.classList.remove(o),this._containerWidth=this._container.offsetWidth,this._containerHeight=this._container.offsetHeight}_animateZoom(t){const e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();D(this._container,e.add(i))}_adjustPan(){if(!this.options.autoPan)return;if(this._map._panAnim?.stop(),this._autopanning){this._autopanning=!1;return}const t=this._map,e=parseInt(getComputedStyle(this._container).marginBottom,10)||0,i=this._containerHeight+e,s=this._containerWidth,o=new f(this._containerLeft,-i-this._containerBottom);o._add(gt(this._container));const r=t.layerPointToContainerPoint(o),a=new f(this.options.autoPanPadding),l=new f(this.options.autoPanPaddingTopLeft??a),h=new f(this.options.autoPanPaddingBottomRight??a),d=t.getSize();let c=0,u=0;r.x+s+h.x>d.x&&(c=r.x+s-d.x+h.x),r.x-c-l.x<0&&(c=r.x-l.x),r.y+i+h.y>d.y&&(u=r.y+i-d.y+h.y),r.y-u-l.y<0&&(u=r.y-l.y),(c||u)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([c,u]))}_getAnchor(){return new f(this._source?._getPopupAnchor?this._source._getPopupAnchor():[0,0])}};pi.setDefaultOptions({pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,closeButtonLabel:"Close popup",autoClose:!0,closeOnEscapeKey:!0,className:"",trackResize:!0});let Gt=pi;w.mergeOptions({closePopupOnClick:!0}),w.include({openPopup(n,t,e){return this._initOverlay(Gt,n,t,e).openOn(this),this},closePopup(n){return n=arguments.length?n:this._popup,n?.close(),this}}),$.include({bindPopup(n,t){return this._popup=this._initOverlay(Gt,this._popup,n,t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup(){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(n){return this._popup&&(this instanceof ut||(this._popup._source=this),this._popup._prepareOpen(n||this._latlng)&&this._popup.openOn(this._map)),this},closePopup(){return this._popup?.close(),this},togglePopup(){return this._popup?.toggle(this),this},isPopupOpen(){return this._popup?.isOpen()??!1},setPopupContent(n){return this._popup?.setContent(n),this},getPopup(){return this._popup},_openPopup(n){if(!this._popup||!this._map)return;vt(n);const t=n.propagatedFrom??n.target;if(this._popup._source===t&&!(t instanceof st)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(n.latlng);return}this._popup._source=t,this.openPopup(n.latlng)},_movePopup(n){this._popup.setLatLng(n.latlng)},_onKeyPress(n){n.originalEvent.code==="Enter"&&this._openPopup(n)}});const _i=class _i extends Y{onAdd(t){Y.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(t){Y.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))}getEvents(){const t=Y.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t}_initLayout(){const t="leaflet-tooltip",e=`${t} ${this.options.className||""} leaflet-zoom-${this._zoomAnimated?"animated":"hide"}`;this._contentNode=this._container=k("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id",`leaflet-tooltip-${P(this)}`)}_updateLayout(){}_adjustPan(){}_setPosition(t){let e,i,s=this.options.direction;const o=this._map,r=this._container,a=o.latLngToContainerPoint(o.getCenter()),l=o.layerPointToContainerPoint(t),h=r.offsetWidth,d=r.offsetHeight,c=new f(this.options.offset),u=this._getAnchor();s==="top"?(e=h/2,i=d):s==="bottom"?(e=h/2,i=0):s==="center"?(e=h/2,i=d/2):s==="right"?(e=0,i=d/2):s==="left"?(e=h,i=d/2):l.x<a.x?(s="right",e=0,i=d/2):(s="left",e=h+(c.x+u.x)*2,i=d/2),t=t.subtract(new f(e,i,!0)).add(c).add(u),r.classList.remove("leaflet-tooltip-right","leaflet-tooltip-left","leaflet-tooltip-top","leaflet-tooltip-bottom"),r.classList.add(`leaflet-tooltip-${s}`),D(r,t)}_updatePosition(){const t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)}setOpacity(t){this.options.opacity=t,this._container&&(this._container.style.opacity=t)}_animateZoom(t){const e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)}_getAnchor(){return new f(this._source?._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}};_i.setDefaultOptions({pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9});let Wt=_i;w.include({openTooltip(n,t,e){return this._initOverlay(Wt,n,t,e).openOn(this),this},closeTooltip(n){return n.close(),this}}),$.include({bindTooltip(n,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Wt,this._tooltip,n,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions(n){if(!n&&this._tooltipHandlersAdded)return;const t=n?"off":"on",e={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?e.add=this._openTooltip:(e.pointerover=this._openTooltip,e.pointerout=this.closeTooltip,e.click=this._openTooltip,this._map?this._addFocusListeners(n):e.add=()=>this._addFocusListeners(n)),this._tooltip.options.sticky&&(e.pointermove=this._moveTooltip),this[t](e),this._tooltipHandlersAdded=!n},openTooltip(n){return this._tooltip&&(this instanceof ut||(this._tooltip._source=this),this._tooltip._prepareOpen(n)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip(){if(this._tooltip)return this._tooltip.close()},toggleTooltip(){return this._tooltip?.toggle(this),this},isTooltipOpen(){return this._tooltip.isOpen()},setTooltipContent(n){return this._tooltip?.setContent(n),this},getTooltip(){return this._tooltip},_addFocusListeners(n){this.getElement?this._addFocusListenersOnLayer(this,n):this.eachLayer&&this.eachLayer(t=>this._addFocusListenersOnLayer(t,n),this)},_addFocusListenersOnLayer(n,t){const e=typeof n.getElement=="function"&&n.getElement();if(e){const i=t?"off":"on";t||(e._leaflet_focus_handler&&S(e,"focus",e._leaflet_focus_handler,this),e._leaflet_focus_handler=()=>{this._tooltip&&(this._tooltip._source=n,this.openTooltip())}),e._leaflet_focus_handler&&Ae[i](e,"focus",e._leaflet_focus_handler,this),Ae[i](e,"blur",this.closeTooltip,this),t&&delete e._leaflet_focus_handler}},_setAriaDescribedByOnLayer(n){(typeof n.getElement=="function"&&n.getElement())?.setAttribute?.("aria-describedby",this._tooltip._container.id)},_openTooltip(n){if(!(!this._tooltip||!this._map)){if(this._map.dragging?.moving()){n.type==="add"&&!this._moveEndOpensTooltip&&(this._moveEndOpensTooltip=!0,this._map.once("moveend",()=>{this._moveEndOpensTooltip=!1,this._openTooltip(n)}));return}this._tooltip._source=n.propagatedFrom??n.target,this.openTooltip(this._tooltip.options.sticky?n.latlng:void 0)}},_moveTooltip(n){let t=n.latlng,e,i;this._tooltip.options.sticky&&n.originalEvent&&(e=this._map.pointerEventToContainerPoint(n.originalEvent),i=this._map.containerPointToLayerPoint(e),t=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(t)}});const fi=class fi extends wt{createIcon(t){const e=t&&t.tagName==="DIV"?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(e.replaceChildren(),e.appendChild(i.html)):e.innerHTML=i.html!==!1?i.html:"",i.bgPos){const s=new f(i.bgPos);e.style.backgroundPosition=`${-s.x}px ${-s.y}px`}return this._setIconStyles(e,"icon"),e}createShadow(){return null}};fi.setDefaultOptions({iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"});let $e=fi;wt.Default=ee;const mi=class mi extends ${initialize(t){z(this,t)}onAdd(){this._initContainer(),this._levels={},this._tiles={},this._resetView()}beforeAdd(t){t._addZoomLimit(this)}onRemove(t){this._removeAllTiles(),this._container.remove(),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0,clearTimeout(this._pruneTimeout)}bringToFront(){return this._map&&(At(this._container),this._setAutoZIndex(Math.max)),this}bringToBack(){return this._map&&(Bt(this._container),this._setAutoZIndex(Math.min)),this}getContainer(){return this._container}setOpacity(t){return this.options.opacity=t,this._updateOpacity(),this}setZIndex(t){return this.options.zIndex=t,this._updateZIndex(),this}isLoading(){return this._loading}redraw(){if(this._map){this._removeAllTiles();const t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this}getEvents(){const t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=vi(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t}createTile(){return document.createElement("div")}getTileSize(){const t=this.options.tileSize;return t instanceof f?t:new f(t,t)}_updateZIndex(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)}_setAutoZIndex(t){const e=this.getPane().children;let i=-t(-1/0,1/0);for(const s of e){const o=s.style.zIndex;s!==this._container&&o&&(i=t(i,+o))}isFinite(i)&&(this.options.zIndex=i+t(-1,1),this._updateZIndex())}_updateOpacity(){if(!this._map)return;this._container.style.opacity=this.options.opacity;const t=+new Date;let e=!1,i=!1;for(const s of Object.values(this._tiles??{})){if(!s.current||!s.loaded)continue;const o=Math.min(1,(t-s.loaded)/200);s.el.style.opacity=o,o<1?e=!0:(s.active?i=!0:this._onOpaqueTile(s),s.active=!0)}i&&!this._noPrune&&this._pruneTiles(),e&&(cancelAnimationFrame(this._fadeFrame),this._fadeFrame=requestAnimationFrame(this._updateOpacity.bind(this)))}_onOpaqueTile(){}_initContainer(){this._container||(this._container=k("div",`leaflet-layer ${this.options.className??""}`),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))}_updateLevels(){const t=this._tileZoom,e=this.options.maxZoom;if(t===void 0)return;for(let o of Object.keys(this._levels))o=Number(o),this._levels[o].el.children.length||o===t?(this._levels[o].el.style.zIndex=e-Math.abs(t-o),this._onUpdateLevel(o)):(this._levels[o].el.remove(),this._removeTilesAtZoom(o),this._onRemoveLevel(o),delete this._levels[o]);let i=this._levels[t];const s=this._map;return i||(i=this._levels[t]={},i.el=k("div","leaflet-tile-container leaflet-zoom-animated",this._container),i.el.style.zIndex=e,i.origin=s.project(s.unproject(s.getPixelOrigin()),t).round(),i.zoom=t,this._setZoomTransform(i,s.getCenter(),s.getZoom()),V(i.el.offsetWidth),this._onCreateLevel(i)),this._level=i,i}_onUpdateLevel(){}_onRemoveLevel(){}_onCreateLevel(){}_pruneTiles(){if(!this._map)return;const t=this._map.getZoom();if(t>this.options.maxZoom||t<this.options.minZoom){this._removeAllTiles();return}for(const e of Object.values(this._tiles))e.retain=e.current;for(const e of Object.values(this._tiles))if(e.current&&!e.active){const i=e.coords;this._retainParent(i.x,i.y,i.z,i.z-5)||this._retainChildren(i.x,i.y,i.z,i.z+2)}for(const[e,i]of Object.entries(this._tiles))i.retain||this._removeTile(e)}_removeTilesAtZoom(t){for(const[e,i]of Object.entries(this._tiles))i.coords.z===t&&this._removeTile(e)}_removeAllTiles(){for(const t of Object.keys(this._tiles))this._removeTile(t)}_invalidateAll(){for(const t of Object.keys(this._levels))this._levels[t].el.remove(),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0}_retainParent(t,e,i,s){const o=Math.floor(t/2),r=Math.floor(e/2),a=i-1,l=new f(+o,+r);l.z=+a;const h=this._tileCoordsToKey(l),d=this._tiles[h];return d?.active?(d.retain=!0,!0):(d?.loaded&&(d.retain=!0),a>s?this._retainParent(o,r,a,s):!1)}_retainChildren(t,e,i,s){for(let o=2*t;o<2*t+2;o++)for(let r=2*e;r<2*e+2;r++){const a=new f(o,r);a.z=i+1;const l=this._tileCoordsToKey(a),h=this._tiles[l];if(h?.active){h.retain=!0;continue}else h?.loaded&&(h.retain=!0);i+1<s&&this._retainChildren(o,r,i+1,s)}}_resetView(t){const e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)}_animateZoom(t){this._setView(t.center,t.zoom,!0,t.noUpdate)}_clampZoom(t){const e=this.options;return e.minNativeZoom!==void 0&&t<e.minNativeZoom?e.minNativeZoom:e.maxNativeZoom!==void 0&&e.maxNativeZoom<t?e.maxNativeZoom:t}_setView(t,e,i,s){let o=Math.round(e);this.options.maxZoom!==void 0&&o>this.options.maxZoom||this.options.minZoom!==void 0&&o<this.options.minZoom?o=void 0:o=this._clampZoom(o);const r=this.options.updateWhenZooming&&o!==this._tileZoom;(!s||r)&&(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),o!==void 0&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)}_setZoomTransforms(t,e){for(const i of Object.values(this._levels))this._setZoomTransform(i,t,e)}_setZoomTransform(t,e,i){const s=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(s).subtract(this._map._getNewPixelOrigin(e,i)).round();mt(t.el,o,s)}_resetGrid(){const t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),s=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],s).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],s).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],s).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],s).y/i.y)]}_onMoveEnd(){!this._map||this._map._animatingZoom||this._update()}_getTiledPixelBounds(t){const e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),s=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(s*2);return new L(o.subtract(r),o.add(r))}_update(t){const e=this._map;if(!e)return;const i=this._clampZoom(e.getZoom());if(t===void 0&&(t=e.getCenter()),this._tileZoom===void 0)return;const s=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(s),r=o.getCenter(),a=[],l=this.options.keepBuffer,h=new L(o.getBottomLeft().subtract([l,-l]),o.getTopRight().add([l,-l]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(const d of Object.values(this._tiles)){const c=d.coords;(c.z!==this._tileZoom||!h.contains(new f(c.x,c.y)))&&(d.current=!1)}if(Math.abs(i-this._tileZoom)>1){this._setView(t,i);return}for(let d=o.min.y;d<=o.max.y;d++)for(let c=o.min.x;c<=o.max.x;c++){const u=new f(c,d);if(u.z=this._tileZoom,!this._isValidTile(u))continue;const p=this._tiles[this._tileCoordsToKey(u)];p?p.current=!0:a.push(u)}if(a.sort((d,c)=>d.distanceTo(r)-c.distanceTo(r)),a.length!==0){this._loading||(this._loading=!0,this.fire("loading"));const d=document.createDocumentFragment();for(const c of a)this._addTile(c,d);this._level.el.appendChild(d)}}_isValidTile(t){const e=this._map.options.crs;if(!e.infinite){const s=this._globalTileRange;if(!e.wrapLng&&(t.x<s.min.x||t.x>s.max.x)||!e.wrapLat&&(t.y<s.min.y||t.y>s.max.y))return!1}if(!this.options.bounds)return!0;const i=this._tileCoordsToBounds(t);return new C(this.options.bounds).overlaps(i)}_keyToBounds(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))}_tileCoordsToNwSe(t){const e=this._map,i=this.getTileSize(),s=t.scaleBy(i),o=s.add(i),r=e.unproject(s,t.z),a=e.unproject(o,t.z);return[r,a]}_tileCoordsToBounds(t){const e=this._tileCoordsToNwSe(t);let i=new C(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i}_tileCoordsToKey(t){return`${t.x}:${t.y}:${t.z}`}_keyToTileCoords(t){const e=t.split(":"),i=new f(+e[0],+e[1]);return i.z=+e[2],i}_removeTile(t){const e=this._tiles[t];e&&(e.el.remove(),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))}_initTile(t){t.classList.add("leaflet-tile");const e=this.getTileSize();t.style.width=`${e.x}px`,t.style.height=`${e.y}px`,t.onselectstart=V,t.onpointermove=V}_addTile(t,e){const i=this._getTilePos(t),s=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),this._tileReady.bind(this,t));this._initTile(o),this.createTile.length<2&&requestAnimationFrame(this._tileReady.bind(this,t,null,o)),D(o,i),this._tiles[s]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})}_tileReady(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});const s=this._tileCoordsToKey(t);i=this._tiles[s],i&&(i.loaded=+new Date,this._map._fadeAnimated?(i.el.style.opacity=0,cancelAnimationFrame(this._fadeFrame),this._fadeFrame=requestAnimationFrame(this._updateOpacity.bind(this))):(i.active=!0,this._pruneTiles()),e||(i.el.classList.add("leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),this._map._fadeAnimated?this._pruneTimeout=setTimeout(this._pruneTiles.bind(this),250):requestAnimationFrame(this._pruneTiles.bind(this))))}_getTilePos(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)}_wrapCoords(t){const e=new f(this._wrapX?St(t.x,this._wrapX):t.x,this._wrapY?St(t.y,this._wrapY):t.y);return e.z=t.z,e}_pxBoundsToTileRange(t){const e=this.getTileSize();return new L(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))}_noTilesToLoad(){return Object.values(this._tiles).every(t=>t.loaded)}};mi.setDefaultOptions({tileSize:256,opacity:1,updateWhenIdle:F.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2});let Lt=mi;const gi=class gi extends Lt{initialize(t,e){if(this._url=t,e=z(this,e),e.attribution===null&&URL.canParse(t)){const i=new URL(t).hostname;["tile.openstreetmap.org","tile.osm.org"].some(o=>i.endsWith(o))&&(e.attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors')}e.detectRetina&&F.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),typeof e.subdomains=="string"&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)}setUrl(t,e){return this._url===t&&e===void 0&&(e=!0),this._url=t,e||this.redraw(),this}createTile(t,e){const i=document.createElement("img");return b(i,"load",this._tileOnLoad.bind(this,e,i)),b(i,"error",this._tileOnError.bind(this,e,i)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(i.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i}getTileUrl(t){const e=Object.create(this.options);if(Object.assign(e,{r:F.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()}),this._map&&!this._map.options.crs.infinite){const i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return bi(this._url,e)}_tileOnLoad(t,e){t(null,e)}_tileOnError(t,e,i){const s=this.options.errorTileUrl;s&&e.getAttribute("src")!==s&&(e.src=s),t(i,e)}_onTileRemove(t){t.tile.onload=null}_getZoomForUrl(){let t=this._tileZoom;const e=this.options.maxZoom,i=this.options.zoomReverse,s=this.options.zoomOffset;return i&&(t=e-t),t+s}_getSubdomain(t){const e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]}_abortLoading(){let t,e;for(t of Object.keys(this._tiles))if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=V,e.onerror=V,!e.complete)){e.src=Ut;const i=this._tiles[t].coords;e.remove(),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}}_removeTile(t){const e=this._tiles[t];if(e)return e.el.setAttribute("src",Ut),Lt.prototype._removeTile.call(this,t)}_tileReady(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===Ut))return Lt.prototype._tileReady.call(this,t,e,i)}_clampZoom(t){return Math.round(Lt.prototype._clampZoom.call(this,t))}};gi.setDefaultOptions({minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1});let Pt=gi;const fe=class fe extends Pt{initialize(t,e){this._url=t;const i={...this.defaultWmsParams};for(const r of Object.keys(e))r in this.options||(i[r]=e[r]);e=z(this,e);const s=e.detectRetina&&F.retina?2:1,o=this.getTileSize();i.width=o.x*s,i.height=o.y*s,this.wmsParams=i}onAdd(t){this._crs=this.options.crs??t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);const e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Pt.prototype.onAdd.call(this,t)}getTileUrl(t){const e=this._tileCoordsToNwSe(t),i=this._crs,s=new L(i.project(e[0]),i.project(e[1])),o=s.min,r=s.max,a=(this._wmsVersion>=1.3&&this._crs===Wi?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),l=new URL(Pt.prototype.getTileUrl.call(this,t));for(const[h,d]of Object.entries({...this.wmsParams,bbox:a}))l.searchParams.append(this.options.uppercase?h.toUpperCase():h,d);return l.toString()}setParams(t,e){return Object.assign(this.wmsParams,t),e||this.redraw(),this}};fe.prototype.defaultWmsParams={service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},fe.setDefaultOptions({crs:null,uppercase:!1});let Ue=fe;Pt.WMS=Ue;class J extends re{initialize(t){z(this,{...t,continuous:!1}),P(this),this._layers??={}}onAdd(t){super.onAdd(t),this.on("update",this._updatePaths,this)}onRemove(){super.onRemove(),this.off("update",this._updatePaths,this)}_onZoomEnd(){for(const t of Object.values(this._layers))t._project()}_updatePaths(){for(const t of Object.values(this._layers))t._update()}_onViewReset(){for(const t of Object.values(this._layers))t._reset()}_onSettled(){this._update()}_update(){}}const yi=class yi extends J{getEvents(){const t=J.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t}_onViewPreReset(){this._postponeUpdatePaths=!0}onAdd(t){J.prototype.onAdd.call(this,t),this._draw()}onRemove(){J.prototype.onRemove.call(this),clearTimeout(this._pointerHoverThrottleTimeout)}_initContainer(){const t=this._container=document.createElement("canvas");b(t,"pointermove",this._onPointerMove,this),b(t,"click dblclick pointerdown pointerup contextmenu",this._onClick,this),b(t,"pointerout",this._handlePointerOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")}_destroyContainer(){cancelAnimationFrame(this._redrawRequest),this._redrawRequest=null,delete this._ctx,J.prototype._destroyContainer.call(this)}_resizeContainer(){const t=J.prototype._resizeContainer.call(this),e=this._ctxScale=window.devicePixelRatio;this._container.width=e*t.x,this._container.height=e*t.y}_updatePaths(){if(!this._postponeUpdatePaths){this._redrawBounds=null;for(const t of Object.values(this._layers))t._update();this._redraw()}}_update(){if(this._map._animatingZoom&&this._bounds)return;const t=this._bounds,e=this._ctxScale;this._ctx.setTransform(e,0,0,e,-t.min.x*e,-t.min.y*e),this.fire("update")}_reset(){J.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())}_initPath(t){this._updateDashArray(t),this._layers[P(t)]=t;const e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst??=this._drawLast}_addPath(t){this._requestRedraw(t)}_removePath(t){const e=t._order,i=e.next,s=e.prev;i?i.prev=s:this._drawLast=s,s?s.next=i:this._drawFirst=i,delete t._order,delete this._layers[P(t)],this._requestRedraw(t)}_updatePath(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)}_updateStyle(t){this._updateDashArray(t),this._requestRedraw(t)}_updateDashArray(t){if(typeof t.options.dashArray=="string"){const e=t.options.dashArray.split(/[, ]+/);t.options._dashArray=e.map(i=>Number(i)).filter(i=>!isNaN(i))}else t.options._dashArray=t.options.dashArray}_requestRedraw(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest??=requestAnimationFrame(this._redraw.bind(this)))}_extendRedrawBounds(t){if(t._pxBounds){const e=(t.options.weight??0)+1;this._redrawBounds??=new L,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}}_redraw(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null}_clear(){const t=this._redrawBounds;if(t){const e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()}_draw(){let t;const e=this._redrawBounds;if(this._ctx.save(),e){const i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(let i=this._drawFirst;i;i=i.next)t=i.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()}_updatePoly(t,e){if(!this._drawing)return;const i=t._parts,s=this._ctx;i.length&&(s.beginPath(),i.forEach(o=>{o.forEach((r,a)=>{s[a?"lineTo":"moveTo"](r.x,r.y)}),e&&s.closePath()}),this._fillStroke(s,t))}_updateCircle(t){if(!this._drawing||t._empty())return;const e=t._point,i=this._ctx,s=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||s)/s;o!==1&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,s,0,Math.PI*2,!1),o!==1&&i.restore(),this._fillStroke(i,t)}_fillStroke(t,e){const i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor??i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&i.weight!==0&&(t.setLineDash&&(t.lineDashOffset=Number(i.dashOffset??0),t.setLineDash(i._dashArray??[])),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())}_onClick(t){const e=this._map.pointerEventToLayerPoint(t);let i,s;for(let o=this._drawFirst;o;o=o.next)i=o.layer,i.options.interactive&&i._containsPoint(e)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(i))&&(s=i);this._fireEvent(s?[s]:!1,t)}_onPointerMove(t){if(!this._map||this._map.dragging.moving()||this._map._animatingZoom)return;const e=this._map.pointerEventToLayerPoint(t);this._handlePointerHover(t,e)}_handlePointerOut(t){const e=this._hoveredLayer;e&&(this._container.classList.remove("leaflet-interactive"),this._fireEvent([e],t,"pointerout"),this._hoveredLayer=null,this._pointerHoverThrottled=!1)}_handlePointerHover(t,e){if(this._pointerHoverThrottled)return;let i,s;for(let o=this._drawFirst;o;o=o.next)i=o.layer,i.options.interactive&&i._containsPoint(e)&&(s=i);s!==this._hoveredLayer&&(this._handlePointerOut(t),s&&(this._container.classList.add("leaflet-interactive"),this._fireEvent([s],t,"pointerover"),this._hoveredLayer=s)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,t),this._pointerHoverThrottled=!0,this._pointerHoverThrottleTimeout=setTimeout((()=>{this._pointerHoverThrottled=!1}),32)}_fireEvent(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)}_bringToFront(t){const e=t._order;if(!e)return;const i=e.next,s=e.prev;if(i)i.prev=s;else return;s?s.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t)}_bringToBack(t){const e=t._order;if(!e)return;const i=e.next,s=e.prev;if(s)s.next=i;else return;i?i.prev=s:s&&(this._drawLast=s),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t)}};yi.setDefaultOptions({tolerance:0});let ae=yi;function Un(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function Vi(n,t){return n.flatMap(i=>[...i.map((s,o)=>`${(o?"L":"M")+s.x} ${s.y}`),t?"z":""]).join("")||"M0 0"}const le=Un;class he extends J{_initContainer(){this._container=le("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=le("g"),this._container.appendChild(this._rootGroup)}_destroyContainer(){J.prototype._destroyContainer.call(this),delete this._rootGroup,delete this._svgSize}_resizeContainer(){const t=J.prototype._resizeContainer.call(this);(!this._svgSize||!this._svgSize.equals(t))&&(this._svgSize=t,this._container.setAttribute("width",t.x),this._container.setAttribute("height",t.y))}_update(){if(this._map._animatingZoom&&this._bounds)return;const t=this._bounds,e=t.getSize();this._container.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}_initPath(t){const e=t._path=le("path");t.options.className&&e.classList.add(...it(t.options.className)),t.options.interactive&&e.classList.add("leaflet-interactive"),this._updateStyle(t),this._layers[P(t)]=t}_addPath(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)}_removePath(t){t._path.remove(),t.removeInteractiveTarget(t._path),delete this._layers[P(t)]}_updatePath(t){t._project(),t._update()}_updateStyle(t){const e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))}_updatePoly(t,e){this._setPath(t,Vi(t._parts,e))}_updateCircle(t){const e=t._point,i=Math.max(Math.round(t._radius),1),s=Math.max(Math.round(t._radiusY),1)||i,o=`a${i},${s} 0 1,0 `,r=t._empty()?"M0 0":`M${e.x-i},${e.y}${o}${i*2},0 ${o}${-i*2},0 `;this._setPath(t,r)}_setPath(t,e){t._path.setAttribute("d",e)}_bringToFront(t){At(t._path)}_bringToBack(t){Bt(t._path)}}w.include({getRenderer(n){let t=n.options.renderer??this._getPaneRenderer(n.options.pane)??this.options.renderer??this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer(n){if(n==="overlayPane"||n===void 0)return;let t=this._paneRenderers[n];return t===void 0&&(t=this._createRenderer({pane:n}),this._paneRenderers[n]=t),t},_createRenderer(n){return this.options.preferCanvas&&new ae(n)||new he(n)}});class qn extends xt{initialize(t,e){xt.prototype.initialize.call(this,this._boundsToLatLngs(t),e)}setBounds(t){return this.setLatLngs(this._boundsToLatLngs(t))}_boundsToLatLngs(t){return t=new C(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}he.create=le,he.pointsToPath=Vi,pt.geometryToLayer=ie,pt.coordsToLatLng=je,pt.coordsToLatLngs=ne,pt.latLngToCoords=He,pt.latLngsToCoords=se,pt.getFeature=kt,pt.asFeature=oe,w.mergeOptions({boxZoom:!0});class Ki extends nt{initialize(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)}addHooks(){b(this._container,"pointerdown",this._onPointerDown,this)}removeHooks(){S(this._container,"pointerdown",this._onPointerDown,this)}moved(){return this._moved}_destroy(){this._pane.remove(),delete this._pane}_resetState(){this._resetStateTimeout=0,this._moved=!1}_clearDeferredResetState(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)}_onPointerDown(t){if(!t.shiftKey||t.button!==0)return!1;this._clearDeferredResetState(),this._resetState(),we(),Le(),this._startPoint=this._map.pointerEventToContainerPoint(t),b(document,{contextmenu:vt,pointermove:this._onPointerMove,pointerup:this._onPointerUp,keydown:this._onKeyDown},this)}_onPointerMove(t){this._moved||(this._moved=!0,this._box=k("div","leaflet-zoom-box",this._container),this._container.classList.add("leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.pointerEventToContainerPoint(t);const e=new L(this._point,this._startPoint),i=e.getSize();D(this._box,e.min),this._box.style.width=`${i.x}px`,this._box.style.height=`${i.y}px`}_finish(){this._moved&&(this._box.remove(),this._container.classList.remove("leaflet-crosshair")),xe(),Pe(),S(document,{contextmenu:vt,pointermove:this._onPointerMove,pointerup:this._onPointerUp,keydown:this._onKeyDown},this)}_onPointerUp(t){if(t.button!==0||(this._finish(),!this._moved))return;this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(this._resetState.bind(this),0);const e=new C(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}_onKeyDown(t){t.code==="Escape"&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}w.addInitHook("addHandler","boxZoom",Ki),w.mergeOptions({doubleClickZoom:!0});class Yi extends nt{addHooks(){this._map.on("dblclick",this._onDoubleClick,this)}removeHooks(){this._map.off("dblclick",this._onDoubleClick,this)}_onDoubleClick(t){const e=this._map,i=e.getZoom(),s=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-s:i+s;e.options.doubleClickZoom==="center"?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}}w.addInitHook("addHandler","doubleClickZoom",Yi),w.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});class Xi extends nt{addHooks(){if(!this._draggable){const t=this._map;this._draggable=new Dt(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))}this._map._container.classList.add("leaflet-grab","leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]}removeHooks(){this._map._container.classList.remove("leaflet-grab","leaflet-touch-drag"),this._draggable.disable()}moved(){return this._draggable?._moved}moving(){return this._draggable?._moving}_onDragStart(){const t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){const e=new C(this._map.options.maxBounds);this._offsetLimit=new L(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.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(t){if(this._map.options.inertia){const e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)}_prunePositions(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()}_onZoomEnd(){const t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x}_viscousLimit(t,e){return t-(t-e)*this._viscosity}_onPreDragLimit(){if(!this._viscosity||!this._offsetLimit)return;const t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}_onPreDragWrap(){const t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,s=this._draggable._newPos.x,o=(s-e+i)%t+e-i,r=(s+e+i)%t-e-i,a=Math.abs(o+i)<Math.abs(r+i)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=a}_onDragEnd(t){const e=this._map,i=e.options,s=!i.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),s)e.fire("moveend");else{this._prunePositions(+new Date);const o=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,a=i.easeLinearity,l=o.multiplyBy(a/r),h=l.distanceTo([0,0]),d=Math.min(i.inertiaMaxSpeed,h),c=l.multiplyBy(d/h),u=d/(i.inertiaDeceleration*a);let p=c.multiplyBy(-u/2).round();!p.x&&!p.y?e.fire("moveend"):(p=e._limitOffset(p,e.options.maxBounds),requestAnimationFrame(()=>{e.panBy(p,{duration:u,easeLinearity:a,noMoveStart:!0,animate:!0})}))}}}w.addInitHook("addHandler","dragging",Xi),w.mergeOptions({keyboard:!0,keyboardPanDelta:80});class Tt extends nt{static keyCodes={left:["ArrowLeft"],right:["ArrowRight"],down:["ArrowDown"],up:["ArrowUp"],zoomIn:["Equal","NumpadAdd","BracketRight"],zoomOut:["Minus","NumpadSubtract","Digit6","Slash"]};initialize(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)}addHooks(){const t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),t.ariaKeyShortcuts=Object.values(Tt.keyCodes).flat().join(" "),b(t,{focus:this._onFocus,blur:this._onBlur,pointerdown:this._onPointerDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)}removeHooks(){this._removeHooks(),S(this._map._container,{focus:this._onFocus,blur:this._onBlur,pointerdown:this._onPointerDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)}_onPointerDown(){if(this._focused)return;const t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,s=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(s,i)}_onFocus(){this._focused=!0,this._map.fire("focus")}_onBlur(){this._focused=!1,this._map.fire("blur")}_setPanDelta(t){const e=this._panKeys={},i=Tt.keyCodes;for(const s of i.left)e[s]=[-1*t,0];for(const s of i.right)e[s]=[t,0];for(const s of i.down)e[s]=[0,t];for(const s of i.up)e[s]=[0,-1*t]}_setZoomDelta(t){const e=this._zoomKeys={},i=Tt.keyCodes;for(const s of i.zoomIn)e[s]=t;for(const s of i.zoomOut)e[s]=-t}_addHooks(){b(document,"keydown",this._onKeyDown,this)}_removeHooks(){S(document,"keydown",this._onKeyDown,this)}_onKeyDown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;const e=t.code,i=this._map;let s;if(e in this._panKeys){if(!i._panAnim||!i._panAnim._inProgress)if(s=this._panKeys[e],t.shiftKey&&(s=new f(s).multiplyBy(3)),i.options.maxBounds&&(s=i._limitOffset(new f(s),i.options.maxBounds)),i.options.worldCopyJump){const o=i.wrapLatLng(i.unproject(i.project(i.getCenter()).add(s)));i.panTo(o)}else i.panBy(s)}else if(e in this._zoomKeys)i.setZoom(i.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[e]);else if(e==="Escape"&&i._popup&&i._popup.options.closeOnEscapeKey)i.closePopup();else return;vt(t)}}w.addInitHook("addHandler","keyboard",Tt),w.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});class Ji extends nt{addHooks(){b(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0}removeHooks(){S(this._map._container,"wheel",this._onWheelScroll,this),clearTimeout(this._timer)}_onWheelScroll(t){const e=Bi(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.pointerEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);const s=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(this._performZoom.bind(this),s),vt(t)}_performZoom(){const t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap??0;t._stop();const s=this._delta/(this._map.options.wheelPxPerZoomLevel*4),o=4*Math.log(2/(1+Math.exp(-Math.abs(s))))/Math.LN2,r=i?Math.ceil(o/i)*i:o,a=t._limitZoom(e+(this._delta>0?r:-r))-e;this._delta=0,this._startTime=null,a&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+a):t.setZoomAround(this._lastMousePos,e+a))}}w.addInitHook("addHandler","scrollWheelZoom",Ji);const Vn=600;w.mergeOptions({tapHold:F.safari&&F.mobile,tapTolerance:15});class Qi extends nt{addHooks(){b(this._map._container,"pointerdown",this._onDown,this)}removeHooks(){S(this._map._container,"pointerdown",this._onDown,this),clearTimeout(this._holdTimeout)}_onDown(t){clearTimeout(this._holdTimeout),!(Ct().length!==1||t.pointerType==="mouse")&&(this._startPos=this._newPos=new f(t.clientX,t.clientY),this._holdTimeout=setTimeout((()=>{this._cancel(),this._isTapValid()&&(b(document,"pointerup",G),b(document,"pointerup pointercancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",t))}),Vn),b(document,"pointerup pointercancel contextmenu",this._cancel,this),b(document,"pointermove",this._onMove,this))}_cancelClickPrevent=function t(){S(document,"pointerup",G),S(document,"pointerup pointercancel",t)};_cancel(){clearTimeout(this._holdTimeout),S(document,"pointerup pointercancel contextmenu",this._cancel,this),S(document,"pointermove",this._onMove,this)}_onMove(t){this._newPos=new f(t.clientX,t.clientY)}_isTapValid(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance}_simulateEvent(t,e){const i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}}w.addInitHook("addHandler","tapHold",Qi),w.mergeOptions({pinchZoom:!0,bounceAtZoomLimits:!0});class qe extends nt{addHooks(){this._map._container.classList.add("leaflet-touch-zoom"),b(this._map._container,"pointerdown",this._onPointerStart,this)}removeHooks(){this._map._container.classList.remove("leaflet-touch-zoom"),S(this._map._container,"pointerdown",this._onPointerStart,this)}_onPointerStart(t){const e=this._map,i=Ct();if(i.length!==2||e._animatingZoom||this._zooming)return;const s=e.pointerEventToContainerPoint(i[0]),o=e.pointerEventToContainerPoint(i[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),e.options.pinchZoom!=="center"&&(this._pinchStartLatLng=e.containerPointToLatLng(s.add(o)._divideBy(2))),this._startDist=s.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),b(document,"pointermove",this._onPointerMove,this),b(document,"pointerup pointercancel",this._onPointerEnd,this),G(t)}_onPointerMove(t){const e=Ct();if(e.length!==2||!this._zooming)return;const i=this._map,s=i.pointerEventToContainerPoint(e[0]),o=i.pointerEventToContainerPoint(e[1]),r=s.distanceTo(o)/this._startDist;if(this._zoom=i.getScaleZoom(r,this._startZoom),!i.options.bounceAtZoomLimits&&(this._zoom<i.getMinZoom()&&r<1||this._zoom>i.getMaxZoom()&&r>1)&&(this._zoom=i._limitZoom(this._zoom)),i.options.pinchZoom==="center"){if(this._center=this._startLatLng,r===1)return}else{const l=s._add(o)._divideBy(2)._subtract(this._centerPoint);if(r===1&&l.x===0&&l.y===0)return;this._center=i.unproject(i.project(this._pinchStartLatLng,this._zoom).subtract(l),this._zoom)}this._moved||(i._moveStart(!0,!1),this._moved=!0),cancelAnimationFrame(this._animRequest);const a=i._move.bind(i,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=requestAnimationFrame(a.bind(this)),G(t)}_onPointerEnd(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,cancelAnimationFrame(this._animRequest),S(document,"pointermove",this._onPointerMove,this),S(document,"pointerup pointercancel",this._onPointerEnd,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","pinchZoom",qe),w.addInitHook(function(){this.touchZoom=this.pinchZoom,this.options.touchZoom!==void 0&&(console.warn("Map: touchZoom option is deprecated and will be removed in future versions. Use pinchZoom instead."),this.options.pinchZoom=this.options.touchZoom,delete this.options.touchZoom),this.options.pinchZoom?this.pinchZoom.enable():this.pinchZoom.disable()}),w.BoxZoom=Ki,w.DoubleClickZoom=Yi,w.Drag=Xi,w.Keyboard=Tt,w.ScrollWheelZoom=Ji,w.TapHold=Qi,w.PinchZoom=qe,w.TouchZoom=qe;var _={__proto__:null,BlanketOverlay:re,Bounds:L,Browser:F,CRS:ot,Canvas:ae,Circle:Ui,CircleMarker:jt,Class:Ot,Control:K,DivIcon:$e,DivOverlay:Y,DomEvent:Ae,DomUtil:Sn,Draggable:Dt,Evented:Zt,FeatureGroup:ut,GeoJSON:pt,GridLayer:Lt,Handler:nt,Icon:wt,ImageOverlay:Ht,LatLng:m,LatLngBounds:C,Layer:$,LayerGroup:Nt,LeafletMap:An,LineUtil:jn,Map:w,Marker:Ft,Path:st,Point:f,PolyUtil:In,Polygon:xt,Polyline:at,Popup:Gt,PosAnimation:Ii,Projection:Hn,Rectangle:qn,Renderer:J,SVG:he,SVGOverlay:$n,TileLayer:Pt,Tooltip:Wt,Transformation:Et,Util:yn,VideoOverlay:We,version:"2.0.0-alpha.1"};const Kn=de().L;de().L=_,de().L.noConflict=function(){return de().L=Kn,this};function de(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}const Yn=`/* required styles */
2
2
 
3
3
  .leaflet-pane,
4
4
  .leaflet-tile,
@@ -600,20 +600,22 @@ path.leaflet-interactive:focus:not(:focus-visible) {
600
600
  print-color-adjust: exact;
601
601
  }
602
602
  }
603
- `;_.MarkerClusterGroup=_.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(n){_.Util.setOptions(this,n),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this.options.clusterPane||(this.options.clusterPane=_.Marker.prototype.options.pane),this._featureGroup=new _.FeatureGroup,this._featureGroup.addEventParent(this),this._nonPointGroup=new _.FeatureGroup,this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=_.DomUtil.TRANSITION&&this.options.animate;Object.assign(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?_.MarkerCluster:_.MarkerClusterNonAnimated},addLayer:function(n){if(n instanceof _.LayerGroup)return this.addLayers([n]);if(!n.getLatLng)return this._nonPointGroup.addLayer(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(!this._map)return this._needsClustering.push(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(this.hasLayer(n))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(n,this._maxZoom),this.fire("layeradd",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=n,e=this._zoom;if(n.__parent)for(;t.__parent._zoom>=e;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(n,t):this._animationAddLayerNonAnimated(n,t)),this},removeLayer:function(n){return n instanceof _.LayerGroup?this.removeLayers([n]):n.getLatLng?this._map?n.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(n)),this._removeLayer(n,!0),this.fire("layerremove",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),n.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(n)&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,n)&&this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire("layerremove",{layer:n,propagatedFrom:n}),this):(this._nonPointGroup.removeLayer(n),this.fire("layerremove",{layer:n,propagatedFrom:n}),this)},addLayers:function(n,t){if(!Array.isArray(n))return this.addLayer(n);var e=this._featureGroup,i=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,r=this.options.chunkProgress,a=n.length,l=0,h=!0,d;if(this._map){const c=Date.now(),u=()=>{for(var p=Date.now();l<a&&!(s&&l%200===0&&Date.now()-p>o);l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d),t||this.fire("layeradd",{layer:d,propagatedFrom:d});continue}if(!this.hasLayer(d)&&(this._addLayer(d,this._maxZoom),t||this.fire("layeradd",{layer:d,propagatedFrom:d}),d.__parent&&d.__parent.getChildCount()===2)){const y=d.__parent.getAllChildMarkers(),g=y[0]===d?y[1]:y[0];e.removeLayer(g)}}r&&r(l,a,Date.now()-c),l===a?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(u,this.options.chunkDelay)};u()}else{const c=this._needsClustering;for(;l<a;l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d);continue}this.hasLayer(d)||c.push(d)}}return this},removeLayers:function(n){var t,e,i=n.length,s=this._featureGroup,o=this._nonPointGroup,r=!0;if(!this._map){for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}this._arraySplice(this._needsClustering,e),o.removeLayer(e),this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e,propagatedFrom:e})}return this}if(this._unspiderfy){this._unspiderfy();const a=n.slice();let l=i;for(t=0;t<l;t++){if(e=a[t],e instanceof _.LayerGroup){this._extractNonGroupLayers(e,a),l=a.length;continue}this._unspiderfyLayer(e)}}for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}if(!e.__parent){o.removeLayer(e),this.fire("layerremove",{layer:e,propagatedFrom:e});continue}this._removeLayer(e,!0,!0),this.fire("layerremove",{layer:e,propagatedFrom:e}),s.hasLayer(e)&&(s.removeLayer(e),e.clusterShow&&e.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(n){n.off(this._childMarkerEventHandlers,this),delete n.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var n=new _.LatLngBounds;this._topClusterLevel&&n.extend(this._topClusterLevel._bounds);for(let t=this._needsClustering.length-1;t>=0;t--)n.extend(this._needsClustering[t].getLatLng());return n.extend(this._nonPointGroup.getBounds()),n},eachLayer:function(n,t){var e=this._needsClustering.slice(),i=this._needsRemoving,s,o,r;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(e),o=e.length-1;o>=0;o--){for(s=!0,r=i.length-1;r>=0;r--)if(i[r].layer===e[o]){s=!1;break}s&&n.call(t,e[o])}this._nonPointGroup.eachLayer(n,t)},getLayers:function(){var n=[];return this.eachLayer(t=>{n.push(t)}),n},getLayer:function(n){var t=null;return n=parseInt(n,10),this.eachLayer(e=>{_.stamp(e)===n&&(t=e)}),t},hasLayer:function(n){if(!n)return!1;var t,e=this._needsClustering;for(t=e.length-1;t>=0;t--)if(e[t]===n)return!0;for(e=this._needsRemoving,t=e.length-1;t>=0;t--)if(e[t].layer===n)return!1;return!!(n.__parent&&n.__parent._group===this)||this._nonPointGroup.hasLayer(n)},zoomToShowLayer:function(n,t){typeof t!="function"&&(t=()=>{});var e=function(){(n._icon||n.__parent._icon)&&!this._inZoomAnimation&&(this._map.off("moveend",e,this),this.off("animationend",e,this),n._icon?t():n.__parent._icon&&(this.once("spiderfied",t,this),n.__parent.spiderfy()))};n._icon&&this._map.getBounds().contains(n.getLatLng())?t():n.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",e,this),this._map.panTo(n.getLatLng())):(this._map.on("moveend",e,this),this.on("animationend",e,this),n.__parent.zoomToBounds())},onAdd:function(n){this._map=n;var t,e,i;if(!Number.isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(n),this._nonPointGroup.addTo(n),this._gridClusters||this._generateInitialClusters(),this._maxLat=n.options.crs.projection.MAX_LATITUDE,t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],i.newlatlng=i.layer._latlng,i.layer._latlng=i.latlng;for(t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],this._removeLayer(i.layer,!0),i.layer._latlng=i.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),e=this._needsClustering,this._needsClustering=[],this.addLayers(e,!0)},onRemove:function(n){n.off("zoomend",this._zoomEnd,this),n.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:n=>{for(var t=n;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:(n,t)=>{for(let e=n.length-1;e>=0;e--)if(n[e]===t)return n.splice(e,1),!0},_removeFromGridUnclustered:function(n,t){for(var e=this._map,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());t>=s&&i[t].removeObject(n,e.project(n.getLatLng(),t));t--);},_childMarkerDragStart:n=>{n.target.__dragStart=n.target._latlng},_childMarkerMoved:function(n){if(!this._ignoreMove&&!n.target.__dragStart){const t=(n.target._popup||null)?.isOpen();this._moveChild(n.target,n.oldLatLng,n.latlng),t&&n.target.openPopup()}},_moveChild:function(n,t,e){n._latlng=t,this.removeLayer(n),n._latlng=e,this.addLayer(n)},_childMarkerDragEnd:function(n){n.target.__dragStart&&this._moveChild(n.target,n.target.__dragStart,n.target._latlng),delete n.target.__dragStart},_removeLayer:function(n,t,e){var i=this._gridClusters,s=this._gridUnclustered,o=this._featureGroup,r=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(n,this._maxZoom);var l=n.__parent,h=l._markers,d;for(this._arraySplice(h,n);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(d=l._markers[0]===n?l._markers[1]:l._markers[0],i[l._zoom].removeObject(l,r.project(l._cLatLng,l._zoom)),s[l._zoom].addObject(d,r.project(d.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(d),d.__parent=l.__parent,l._icon&&(o.removeLayer(l),e||o.addLayer(d))):l._iconNeedsUpdate=!0,l=l.__parent;delete n.__parent},_isOrIsParent:(n,t)=>{for(;t;){if(n===t)return!0;t=t.parentNode}return!1},fire:function(n,t,e){if(t&&t.propagatedFrom instanceof _.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.propagatedFrom._icon,t.originalEvent.relatedTarget))return;n=`cluster${n}`}_.FeatureGroup.prototype.fire.call(this,n,t,e)},listens:function(n,t){return _.FeatureGroup.prototype.listens.call(this,n,t)||_.FeatureGroup.prototype.listens.call(this,`cluster${n}`,t)},_defaultIconCreateFunction:n=>{const t=n.getChildCount();let e=" marker-cluster-";return t<10?e+="small":t<100?e+="medium":e+="large",new _.DivIcon({html:`<div><span>${t}</span></div>`,className:`marker-cluster ${e}`,iconSize:new _.Point(40,40)})},_bindEvents:function(){var n=this._map,t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick;(t||i)&&this.on("clusterclick",this._zoomOrSpiderfy,this),e&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),n.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(n){const t=n.propagatedFrom;let e=t;for(;e._childClusters.length===1;)e=e._childClusters[0];e._zoom===this._maxZoom&&e._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),n.originalEvent&&n.originalEvent.keyCode===13&&this._map._container.focus()},_showCoverage:function(n){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),n.propagatedFrom.getChildCount()>2&&n.propagatedFrom!==this._spiderfied&&(this._shownPolygon=new _.Polygon(n.propagatedFrom.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var n=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,e=this.options.zoomToBoundsOnClick,i=this._map;(n||e)&&this.off("clusterclick",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),i.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var n=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,n),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),n),this._currentShownBounds=n}},_generateInitialClusters:function(){var n=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),e=this.options.maxClusterRadius,i=e;typeof e!="function"&&(i=()=>e),this.options.disableClusteringAtZoom!==null&&(n=this.options.disableClusteringAtZoom-1),this._maxZoom=n,this._gridClusters={},this._gridUnclustered={};for(let s=n;s>=t;s--)this._gridClusters[s]=new _.DistanceGrid(i(s)),this._gridUnclustered[s]=new _.DistanceGrid(i(s));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(n,t){var e=this._gridClusters,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom()),o,r;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(n),n.on(this._childMarkerEventHandlers,this);t>=s;t--){o=this._map.project(n.getLatLng(),t);let a=e[t].getNearObject(o);if(a){a._addChild(n),n.__parent=a;return}if(a=i[t].getNearObject(o),a){const l=a.__parent;l&&this._removeLayer(a,!1);const h=new this._markerCluster(this,t,a,n);e[t].addObject(h,this._map.project(h._cLatLng,t)),a.__parent=h,n.__parent=h;let d=h;for(r=t-1;r>l._zoom;r--)d=new this._markerCluster(this,r,d),e[r].addObject(d,this._map.project(a.getLatLng(),r));l._addChild(d),this._removeFromGridUnclustered(a,t);return}i[t].addObject(n,o)}this._topClusterLevel._addChild(n),n.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(n=>{n instanceof _.MarkerCluster&&n._iconNeedsUpdate&&n._updateIcon()})},_enqueue:function(n){this._queue.push(n),this._queueTimeout||(this._queueTimeout=setTimeout(()=>this._processQueue(),300))},_processQueue:function(){for(let n=0;n<this._queue.length;n++)this._queue[n].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var n=Math.round(this._map._zoom);this._processQueue(),this._zoom<n&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,n)):this._zoom>n?(this._animationStart(),this._animationZoomOut(this._zoom,n)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(_.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(n){var t=this._maxLat;return t!==void 0&&(n.getNorth()>=t&&(n._northEast.lat=1/0),n.getSouth()<=-t&&(n._southWest.lat=-1/0)),n},_animationAddLayerNonAnimated:function(n,t){if(t===n)this._featureGroup.addLayer(n);else if(t._childCount===2){t._addToMap();const e=t.getAllChildMarkers();this._featureGroup.removeLayer(e[0]),this._featureGroup.removeLayer(e[1])}else t._updateIcon()},_extractNonGroupLayers:function(n,t){var e=n.getLayers(),i=0,s;for(t=t||[];i<e.length;i++){if(s=e[i],s instanceof _.LayerGroup){this._extractNonGroupLayers(s,t);continue}t.push(s)}return t},_overrideMarkerIcon:function(n){return n.options.icon=this.options.iconCreateFunction({getChildCount:()=>1,getAllChildMarkers:()=>[n]}),n.options.icon}}),_.MarkerClusterGroup.include({_mapBoundsInfinite:new _.LatLngBounds(new _.LatLng(-1/0,-1/0),new _.LatLng(1/0,1/0))}),_.MarkerClusterGroup.include({_noAnimation:{_animationStart:()=>{},_animationZoomIn:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(n,t){this._animationAddLayerNonAnimated(n,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(n,t){var e=this._getExpandedVisibleBounds(),i=this._featureGroup,s=Math.floor(this._map.getMinZoom()),o;this._ignoreMove=!0,this._topClusterLevel._recursively(e,n,s,r=>{var a=r._latlng,l=r._markers,h;for(e.contains(a)||(a=null),r._isSingleParent()&&n+1===t?(i.removeLayer(r),r._recursivelyAddChildrenToMap(null,t,e)):(r.clusterHide(),r._recursivelyAddChildrenToMap(a,t,e)),o=l.length-1;o>=0;o--)h=l[o],e.contains(h._latlng)||i.removeLayer(h)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(e,t),i.eachLayer(r=>{!(r instanceof _.MarkerCluster)&&r._icon&&r.clusterShow()}),this._topClusterLevel._recursively(e,n,t,r=>{r._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(e,n,s,r=>{i.removeLayer(r),r.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(n,t){this._animationZoomOutSingle(this._topClusterLevel,n-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n,this._getExpandedVisibleBounds())},_animationAddLayer:function(n,t){var e=this._featureGroup;e.addLayer(n),t!==n&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),n._setPos(this._map.latLngToLayerPoint(t.getLatLng())),n.clusterHide(),this._enqueue(()=>{e.removeLayer(n),n.clusterShow(),this._animationEnd()})):(this._forceLayout(),this._animationStart(),this._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(n,t,e){var i=this._getExpandedVisibleBounds(),s=Math.floor(this._map.getMinZoom());n._recursivelyAnimateChildrenInAndAddSelfToMap(i,s,t+1,e);var o=this;this._forceLayout(),n._recursivelyBecomeVisible(i,e),this._enqueue(function(){if(n._childCount===1){const r=n._markers[0];this._ignoreMove=!0,r.setLatLng(r.getLatLng()),this._ignoreMove=!1,r.clusterShow&&r.clusterShow()}else n._recursively(i,e,s,r=>{r._recursivelyRemoveChildrenFromMap(i,s,t+1)});o._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:()=>{_.Util.falseFn(document.body.offsetWidth)}}),_.MarkerCluster=_.Marker.extend({initialize:function(n,t,e,i){_.Marker.prototype.initialize.call(this,e?e._cLatLng||e.getLatLng():new _.LatLng(0,0),{icon:this,pane:n.options.clusterPane}),this._group=n,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new _.LatLngBounds,e&&this._addChild(e),i&&this._addChild(i)},getAllChildMarkers:function(n){n=n||[];for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(n);for(let t=this._markers.length-1;t>=0;t--)n.push(this._markers[t]);return n},getChildCount:function(){return this._childCount},zoomToBounds:function(n){for(var t=this._childClusters.slice(),e=this._group._map,i=e.getBoundsZoom(this._bounds),s=this._zoom+1,o=e.getZoom(),r;t.length>0&&i>s;){s++;let a=[];for(r=0;r<t.length;r++)a=a.concat(t[r]._childClusters);t=a}i>s?this._group._map.setView(this._latlng,s):i<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,n)},getBounds:function(){var n=new _.LatLngBounds;return n.extend(this._bounds),n},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(n,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(n),n instanceof _.MarkerCluster?(t||(this._childClusters.push(n),n.__parent=this),this._childCount+=n._childCount):(t||this._markers.push(n),this._childCount++),this.__parent&&this.__parent._addChild(n,!0)},_setClusterCenter:function(n){this._cLatLng||(this._cLatLng=n._cLatLng||n._latlng)},_resetBounds:function(){var n=this._bounds;n._southWest&&(n._southWest.lat=1/0,n._southWest.lng=1/0),n._northEast&&(n._northEast.lat=-1/0,n._northEast.lng=-1/0)},_recalculateBounds:function(){var n=this._markers,t=this._childClusters,e=0,i=0,s=this._childCount,o,r,a,l;if(s!==0){for(this._resetBounds(),o=0;o<n.length;o++)a=n[o]._latlng,this._bounds.extend(a),e+=a.lat,i+=a.lng;for(o=0;o<t.length;o++)r=t[o],r._boundsNeedUpdate&&r._recalculateBounds(),this._bounds.extend(r._bounds),a=r._wLatLng,l=r._childCount,e+=a.lat*l,i+=a.lng*l;this._latlng=this._wLatLng=new _.LatLng(e/s,i/s),this._boundsNeedUpdate=!1}},_addToMap:function(n){n&&(this._backupLatlng=this._latlng,this.setLatLng(n)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(n,t,e){this._recursively(n,this._group._map.getMinZoom(),e-1,i=>{var s=i._markers,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())},i=>{var s=i._childClusters,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(n,t,e,i){this._recursively(n,i,t,s=>{s._recursivelyAnimateChildrenIn(n,s._group._map.latLngToLayerPoint(s.getLatLng()).round(),e),s._isSingleParent()&&e-1===i?(s.clusterShow(),s._recursivelyRemoveChildrenFromMap(n,t,e)):s.clusterHide(),s._addToMap()})},_recursivelyBecomeVisible:function(n,t){this._recursively(n,this._group._map.getMinZoom(),t,null,e=>{e.clusterShow()})},_recursivelyAddChildrenToMap:function(n,t,e){this._recursively(e,this._group._map.getMinZoom()-1,t,i=>{if(t!==i._zoom)for(let s=i._markers.length-1;s>=0;s--){const o=i._markers[s];e.contains(o._latlng)&&(n&&(o._backupLatlng=o.getLatLng(),o.setLatLng(n),o.clusterHide&&o.clusterHide()),i._group._featureGroup.addLayer(o))}},i=>{i._addToMap(n)})},_recursivelyRestoreChildPositions:function(n){for(let t=this._markers.length-1;t>=0;t--){const e=this._markers[t];e._backupLatlng&&(e.setLatLng(e._backupLatlng),delete e._backupLatlng)}if(n-1===this._zoom)for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._restorePosition();else for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._recursivelyRestoreChildPositions(n)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(n,t,e,i){var s,o;this._recursively(n,t-1,e-1,r=>{for(o=r._markers.length-1;o>=0;o--)s=r._markers[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())},r=>{for(o=r._childClusters.length-1;o>=0;o--)s=r._childClusters[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())})},_recursively:function(n,t,e,i,s){var o=this._childClusters,r=this._zoom,a,l;if(t<=r&&(i&&i(this),s&&r===e&&s(this)),r<t||r<e)for(a=o.length-1;a>=0;a--)l=o[a],n.intersects(l._bounds)&&l._recursively(n,t,e,i,s)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),_.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var n=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,n}}),_.DistanceGrid=function(n){this._cellSize=n,this._sqCellSize=n*n,this._grid={},this._objectPoint={}},_.DistanceGrid.prototype={addObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a=_.Util.stamp(n);this._objectPoint[a]=t,r.push(n)},updateObject:function(n,t){this.removeObject(n),this.addObject(n,t)},removeObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a,l;for(delete this._objectPoint[_.Util.stamp(n)],a=0,l=r.length;a<l;a++)if(r[a]===n)return r.splice(a,1),l===1&&delete o[e],!0},eachObject:function(n,t){var e,i,s,o,r,a,l,h=this._grid;for(e in h){r=h[e];for(i in r)for(a=r[i],s=0,o=a.length;s<o;s++)l=n.call(t,a[s]),l&&(s--,o--)}},getNearObject:function(n){var t=this._getCoord(n.x),e=this._getCoord(n.y),i,s,o,r,a,l,h,d,c=this._objectPoint,u=this._sqCellSize,p=null;for(i=e-1;i<=e+1;i++)if(r=this._grid[i],r){for(s=t-1;s<=t+1;s++)if(a=r[s],a)for(o=0,l=a.length;o<l;o++)h=a[o],d=this._sqDist(c[_.Util.stamp(h)],n),d<u&&(u=d,p=h)}return p},_getCoord:function(n){return Math.floor(n/this._cellSize)},_sqDist:(n,t)=>{var e=t.x-n.x,i=t.y-n.y;return e*e+i*i}},_.QuickHull={getDistant:(n,t)=>{var e=t[1].lat-t[0].lat,i=t[0].lng-t[1].lng;return i*(n.lat-t[0].lat)+e*(n.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(n,t){var e=0,i=null,s=[],o,r,a;for(o=t.length-1;o>=0;o--){if(r=t[o],a=this.getDistant(r,n),a>0)s.push(r);else continue;a>e&&(e=a,i=r)}return{maxPoint:i,newPoints:s}},buildConvexHull:function(n,t){var e=[],i=this.findMostDistantPointFromBaseLine(n,t);return i.maxPoint?(e=e.concat(this.buildConvexHull([n[0],i.maxPoint],i.newPoints)),e=e.concat(this.buildConvexHull([i.maxPoint,n[1]],i.newPoints)),e):[n[0]]},getConvexHull:function(n){var t=!1,e=!1,i=!1,s=!1,o=null,r=null,a=null,l=null,h=null,d=null,c;for(c=n.length-1;c>=0;c--){const p=n[c];(t===!1||p.lat>t)&&(o=p,t=p.lat),(e===!1||p.lat<e)&&(r=p,e=p.lat),(i===!1||p.lng>i)&&(a=p,i=p.lng),(s===!1||p.lng<s)&&(l=p,s=p.lng)}e!==t?(d=r,h=o):(d=l,h=a);var u=[].concat(this.buildConvexHull([d,h],n),this.buildConvexHull([h,d],n));return u}},_.MarkerCluster.include({getConvexHull:function(){var n=this.getAllChildMarkers(),t=[],e,i;for(i=n.length-1;i>=0;i--)e=n[i].getLatLng(),t.push(e);return _.QuickHull.getConvexHull(t)}}),_.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var n=this.getAllChildMarkers(),t=this._group,e=t._map,i=e.latLngToLayerPoint(this._latlng),s;this._group._unspiderfy(),this._group._spiderfied=this,n.length>=this._circleSpiralSwitchover?s=this._generatePointsSpiral(n.length,i):(i.y+=10,s=this._generatePointsCircle(n.length,i)),this._animationSpiderfy(n,s)}},unspiderfy:function(n){this._group._inZoomAnimation||(this._animationUnspiderfy(n),this._group._spiderfied=null)},_generatePointsCircle:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+n),i=e/this._2PI,s=this._2PI/n,o=[],r,a;for(o.length=n,r=n-1;r>=0;r--)a=this._circleStartAngle+r*s,o[r]=new _.Point(t.x+i*Math.cos(a),t.y+i*Math.sin(a))._round();return o},_generatePointsSpiral:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier,i=e*this._spiralLengthStart,s=e*this._spiralFootSeparation,o=e*this._spiralLengthFactor*this._2PI,r=0,a=[],l;for(a.length=n,l=n-1;l>=0;l--)r+=s/i+l*5e-4,a[l]=new _.Point(t.x+i*Math.cos(r),t.y+i*Math.sin(r))._round(),i+=o/r;return a},_noanimationUnspiderfy:function(){var n=this._group,t=n._map,e=n._featureGroup,i=this.getAllChildMarkers(),s,o;for(n._ignoreMove=!0,this.setOpacity(1),o=i.length-1;o>=0;o--)s=i[o],e.removeLayer(s),s._preSpiderfyLatlng&&(s.setLatLng(s._preSpiderfyLatlng),delete s._preSpiderfyLatlng),s.setZIndexOffset&&s.setZIndexOffset(0),s._spiderLeg&&(t.removeLayer(s._spiderLeg),delete s._spiderLeg);n.fire("unspiderfied",{cluster:this,markers:i}),n._ignoreMove=!1,n._spiderfied=null}}),_.MarkerClusterNonAnimated=_.MarkerCluster.extend({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._group.options.spiderLegPolylineOptions,r,a,l,h;for(e._ignoreMove=!0,r=0;r<n.length;r++)h=i.layerPointToLatLng(t[r]),a=n[r],l=new _.Polyline([this._latlng,h],o),i.addLayer(l),a._spiderLeg=l,a._preSpiderfyLatlng=a._latlng,a.setLatLng(h),a.setZIndexOffset&&a.setZIndexOffset(1e6),s.addLayer(a);this.setOpacity(.3),e._ignoreMove=!1,e.fire("spiderfied",{cluster:this,markers:n})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),_.MarkerCluster.include({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._latlng,r=i.latLngToLayerPoint(o),a=_.Path.SVG,l=Object.assign({},this._group.options.spiderLegPolylineOptions),h=l.opacity,d,c,u,p,y,g;for(h===void 0&&(h=_.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),a?(l.opacity=0,l.className=`${l.className||""} leaflet-cluster-spider-leg`):l.opacity=h,e._ignoreMove=!0,d=0;d<n.length;d++)c=n[d],g=i.layerPointToLatLng(t[d]),u=new _.Polyline([o,g],l),i.addLayer(u),c._spiderLeg=u,a&&(p=u._path,y=p.getTotalLength()+.1,p.style.strokeDasharray=y,p.style.strokeDashoffset=y),c.setZIndexOffset&&c.setZIndexOffset(1e6),c.clusterHide&&c.clusterHide(),s.addLayer(c),c._setPos&&c._setPos(r);for(e._forceLayout(),e._animationStart(),d=n.length-1;d>=0;d--)g=i.layerPointToLatLng(t[d]),c=n[d],c._preSpiderfyLatlng=c._latlng,c.setLatLng(g),c.clusterShow&&c.clusterShow(),a&&(u=c._spiderLeg,p=u._path,p.style.strokeDashoffset=0,u.setStyle({opacity:h}));this.setOpacity(.3),e._ignoreMove=!1,setTimeout(()=>{e._animationEnd(),e.fire("spiderfied",{cluster:this,markers:n})},200)},_animationUnspiderfy:function(n){var t=this._group,e=t._map,i=t._featureGroup,s=n?e._latLngToNewLayerPoint(this._latlng,n.zoom,n.center):e.latLngToLayerPoint(this._latlng),o=this.getAllChildMarkers(),r=_.Path.SVG,a,l,h,d,c,u;for(t._ignoreMove=!0,t._animationStart(),this.setOpacity(1),l=o.length-1;l>=0;l--)a=o[l],a._preSpiderfyLatlng&&(a.closePopup(),a.setLatLng(a._preSpiderfyLatlng),delete a._preSpiderfyLatlng,u=!0,a._setPos&&(a._setPos(s),u=!1),a.clusterHide&&(a.clusterHide(),u=!1),u&&i.removeLayer(a),r&&(h=a._spiderLeg,d=h._path,c=d.getTotalLength()+.1,d.style.strokeDashoffset=c,h.setStyle({opacity:0})));t._ignoreMove=!1,setTimeout(()=>{var p=0;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&p++;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&(a.clusterShow&&a.clusterShow(),a.setZIndexOffset&&a.setZIndexOffset(0),p>1&&i.removeLayer(a),e.removeLayer(a._spiderLeg),delete a._spiderLeg);t._animationEnd(),t.fire("unspiderfied",{cluster:this,markers:o})},200)}}),_.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(...n){this._unspiderfy.apply(this,n)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),_.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(n){this._map._mapPane.classList.contains("leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(n))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(n){this._spiderfied&&this._spiderfied.unspiderfy(n)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(n){n._spiderLeg&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow(),n.setZIndexOffset&&n.setZIndexOffset(0),this._map.removeLayer(n._spiderLeg),delete n._spiderLeg)}}),_.MarkerClusterGroup.include({refreshClusters:function(n){return n?n instanceof _.MarkerClusterGroup?n=n._topClusterLevel.getAllChildMarkers():n instanceof _.LayerGroup?n=n._layers:n instanceof _.MarkerCluster?n=n.getAllChildMarkers():n instanceof _.Marker&&(n=[n]):n=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(n),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(n),this},_flagParentsIconsNeedUpdate:n=>{var t,e;for(t in n)for(e=n[t].__parent;e;)e._iconNeedsUpdate=!0,e=e.__parent},_refreshSingleMarkerModeMarkers:function(n){var t,e;for(t in n)e=n[t],this.hasLayer(e)&&e.setIcon(this._overrideMarkerIcon(e))}}),_.Marker.include({refreshIconOptions:function(n,t){var e=this.options.icon;return _.setOptions(e,n),this.setIcon(e),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}});const Ve=()=>typeof window<"u"&&typeof document<"u";function Yn(n,t){let e;return function(...i){clearTimeout(e),e=setTimeout(()=>n.apply(this,i),t)}}const A=(n,t,e)=>e===void 0?n.getAttribute(t)??null:(e===null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e),null),en=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.addEventListener(s,...i);return()=>Ke(n,...t)},Ke=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.removeEventListener(s,...i)},ce=(n,t,e)=>{const i=document.createElement(n);if(t)for(const[s,o]of Object.entries(t))A(i,s,o);return i},ue=typeof HTMLElement>"u"?class{}:HTMLElement,pe=(n,t)=>!Ve()||window.customElements.get(n)||window.customElements.define(n,t),Xn=typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets,Jn=(n,t)=>{if(!Xn)return;n.shadowRoot||n.attachShadow({mode:"open"}).append(ce("slot"));const e=new CSSStyleSheet;e.replaceSync(t),n.shadowRoot.adoptedStyleSheets=[e]},Qn=`/**
603
+ `;_.MarkerClusterGroup=_.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(n){_.Util.setOptions(this,n),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this.options.clusterPane||(this.options.clusterPane=_.Marker.prototype.options.pane),this._featureGroup=new _.FeatureGroup,this._featureGroup.addEventParent(this),this._nonPointGroup=new _.FeatureGroup,this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=_.DomUtil.TRANSITION&&this.options.animate;Object.assign(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?_.MarkerCluster:_.MarkerClusterNonAnimated},addLayer:function(n){if(n instanceof _.LayerGroup)return this.addLayers([n]);if(!n.getLatLng)return this._nonPointGroup.addLayer(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(!this._map)return this._needsClustering.push(n),this.fire("layeradd",{layer:n,propagatedFrom:n}),this;if(this.hasLayer(n))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(n,this._maxZoom),this.fire("layeradd",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=n,e=this._zoom;if(n.__parent)for(;t.__parent._zoom>=e;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(n,t):this._animationAddLayerNonAnimated(n,t)),this},removeLayer:function(n){return n instanceof _.LayerGroup?this.removeLayers([n]):n.getLatLng?this._map?n.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(n)),this._removeLayer(n,!0),this.fire("layerremove",{layer:n,propagatedFrom:n}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),n.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(n)&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,n)&&this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire("layerremove",{layer:n,propagatedFrom:n}),this):(this._nonPointGroup.removeLayer(n),this.fire("layerremove",{layer:n,propagatedFrom:n}),this)},addLayers:function(n,t){if(!Array.isArray(n))return this.addLayer(n);var e=this._featureGroup,i=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,r=this.options.chunkProgress,a=n.length,l=0,h=!0,d;if(this._map){const c=Date.now(),u=()=>{for(var p=Date.now();l<a&&!(s&&l%200===0&&Date.now()-p>o);l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d),t||this.fire("layeradd",{layer:d,propagatedFrom:d});continue}if(!this.hasLayer(d)&&(this._addLayer(d,this._maxZoom),t||this.fire("layeradd",{layer:d,propagatedFrom:d}),d.__parent&&d.__parent.getChildCount()===2)){const y=d.__parent.getAllChildMarkers(),g=y[0]===d?y[1]:y[0];e.removeLayer(g)}}r&&r(l,a,Date.now()-c),l===a?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(u,this.options.chunkDelay)};u()}else{const c=this._needsClustering;for(;l<a;l++){if(d=n[l],d instanceof _.LayerGroup){h&&(n=n.slice(),h=!1),this._extractNonGroupLayers(d,n),a=n.length;continue}if(!d.getLatLng){i.addLayer(d);continue}this.hasLayer(d)||c.push(d)}}return this},removeLayers:function(n){var t,e,i=n.length,s=this._featureGroup,o=this._nonPointGroup,r=!0;if(!this._map){for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}this._arraySplice(this._needsClustering,e),o.removeLayer(e),this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e,propagatedFrom:e})}return this}if(this._unspiderfy){this._unspiderfy();const a=n.slice();let l=i;for(t=0;t<l;t++){if(e=a[t],e instanceof _.LayerGroup){this._extractNonGroupLayers(e,a),l=a.length;continue}this._unspiderfyLayer(e)}}for(t=0;t<i;t++){if(e=n[t],e instanceof _.LayerGroup){r&&(n=n.slice(),r=!1),this._extractNonGroupLayers(e,n),i=n.length;continue}if(!e.__parent){o.removeLayer(e),this.fire("layerremove",{layer:e,propagatedFrom:e});continue}this._removeLayer(e,!0,!0),this.fire("layerremove",{layer:e,propagatedFrom:e}),s.hasLayer(e)&&(s.removeLayer(e),e.clusterShow&&e.clusterShow())}return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(n){n.off(this._childMarkerEventHandlers,this),delete n.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var n=new _.LatLngBounds;this._topClusterLevel&&n.extend(this._topClusterLevel._bounds);for(let t=this._needsClustering.length-1;t>=0;t--)n.extend(this._needsClustering[t].getLatLng());return n.extend(this._nonPointGroup.getBounds()),n},eachLayer:function(n,t){var e=this._needsClustering.slice(),i=this._needsRemoving,s,o,r;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(e),o=e.length-1;o>=0;o--){for(s=!0,r=i.length-1;r>=0;r--)if(i[r].layer===e[o]){s=!1;break}s&&n.call(t,e[o])}this._nonPointGroup.eachLayer(n,t)},getLayers:function(){var n=[];return this.eachLayer(t=>{n.push(t)}),n},getLayer:function(n){var t=null;return n=parseInt(n,10),this.eachLayer(e=>{_.stamp(e)===n&&(t=e)}),t},hasLayer:function(n){if(!n)return!1;var t,e=this._needsClustering;for(t=e.length-1;t>=0;t--)if(e[t]===n)return!0;for(e=this._needsRemoving,t=e.length-1;t>=0;t--)if(e[t].layer===n)return!1;return!!(n.__parent&&n.__parent._group===this)||this._nonPointGroup.hasLayer(n)},zoomToShowLayer:function(n,t){typeof t!="function"&&(t=()=>{});var e=function(){(n._icon||n.__parent._icon)&&!this._inZoomAnimation&&(this._map.off("moveend",e,this),this.off("animationend",e,this),n._icon?t():n.__parent._icon&&(this.once("spiderfied",t,this),n.__parent.spiderfy()))};n._icon&&this._map.getBounds().contains(n.getLatLng())?t():n.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",e,this),this._map.panTo(n.getLatLng())):(this._map.on("moveend",e,this),this.on("animationend",e,this),n.__parent.zoomToBounds())},onAdd:function(n){this._map=n;var t,e,i;if(!Number.isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(n),this._nonPointGroup.addTo(n),this._gridClusters||this._generateInitialClusters(),this._maxLat=n.options.crs.projection.MAX_LATITUDE,t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],i.newlatlng=i.layer._latlng,i.layer._latlng=i.latlng;for(t=0,e=this._needsRemoving.length;t<e;t++)i=this._needsRemoving[t],this._removeLayer(i.layer,!0),i.layer._latlng=i.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),e=this._needsClustering,this._needsClustering=[],this.addLayers(e,!0)},onRemove:function(n){n.off("zoomend",this._zoomEnd,this),n.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:n=>{for(var t=n;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:(n,t)=>{for(let e=n.length-1;e>=0;e--)if(n[e]===t)return n.splice(e,1),!0},_removeFromGridUnclustered:function(n,t){for(var e=this._map,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom());t>=s&&i[t].removeObject(n,e.project(n.getLatLng(),t));t--);},_childMarkerDragStart:n=>{n.target.__dragStart=n.target._latlng},_childMarkerMoved:function(n){if(!this._ignoreMove&&!n.target.__dragStart){const t=(n.target._popup||null)?.isOpen();this._moveChild(n.target,n.oldLatLng,n.latlng),t&&n.target.openPopup()}},_moveChild:function(n,t,e){n._latlng=t,this.removeLayer(n),n._latlng=e,this.addLayer(n)},_childMarkerDragEnd:function(n){n.target.__dragStart&&this._moveChild(n.target,n.target.__dragStart,n.target._latlng),delete n.target.__dragStart},_removeLayer:function(n,t,e){var i=this._gridClusters,s=this._gridUnclustered,o=this._featureGroup,r=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(n,this._maxZoom);var l=n.__parent,h=l._markers,d;for(this._arraySplice(h,n);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(d=l._markers[0]===n?l._markers[1]:l._markers[0],i[l._zoom].removeObject(l,r.project(l._cLatLng,l._zoom)),s[l._zoom].addObject(d,r.project(d.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(d),d.__parent=l.__parent,l._icon&&(o.removeLayer(l),e||o.addLayer(d))):l._iconNeedsUpdate=!0,l=l.__parent;delete n.__parent},_isOrIsParent:(n,t)=>{for(;t;){if(n===t)return!0;t=t.parentNode}return!1},fire:function(n,t,e){if(t&&t.propagatedFrom instanceof _.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.propagatedFrom._icon,t.originalEvent.relatedTarget))return;n=`cluster${n}`}_.FeatureGroup.prototype.fire.call(this,n,t,e)},listens:function(n,t){return _.FeatureGroup.prototype.listens.call(this,n,t)||_.FeatureGroup.prototype.listens.call(this,`cluster${n}`,t)},_defaultIconCreateFunction:n=>{const t=n.getChildCount();let e=" marker-cluster-";return t<10?e+="small":t<100?e+="medium":e+="large",new _.DivIcon({html:`<div><span>${t}</span></div>`,className:`marker-cluster ${e}`,iconSize:new _.Point(40,40)})},_bindEvents:function(){var n=this._map,t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick;(t||i)&&this.on("clusterclick",this._zoomOrSpiderfy,this),e&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),n.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(n){const t=n.propagatedFrom;let e=t;for(;e._childClusters.length===1;)e=e._childClusters[0];e._zoom===this._maxZoom&&e._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),n.originalEvent&&n.originalEvent.keyCode===13&&this._map._container.focus()},_showCoverage:function(n){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),n.propagatedFrom.getChildCount()>2&&n.propagatedFrom!==this._spiderfied&&(this._shownPolygon=new _.Polygon(n.propagatedFrom.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var n=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,e=this.options.zoomToBoundsOnClick,i=this._map;(n||e)&&this.off("clusterclick",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),i.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var n=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,n),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),n),this._currentShownBounds=n}},_generateInitialClusters:function(){var n=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),e=this.options.maxClusterRadius,i=e;typeof e!="function"&&(i=()=>e),this.options.disableClusteringAtZoom!==null&&(n=this.options.disableClusteringAtZoom-1),this._maxZoom=n,this._gridClusters={},this._gridUnclustered={};for(let s=n;s>=t;s--)this._gridClusters[s]=new _.DistanceGrid(i(s)),this._gridUnclustered[s]=new _.DistanceGrid(i(s));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(n,t){var e=this._gridClusters,i=this._gridUnclustered,s=Math.floor(this._map.getMinZoom()),o,r;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(n),n.on(this._childMarkerEventHandlers,this);t>=s;t--){o=this._map.project(n.getLatLng(),t);let a=e[t].getNearObject(o);if(a){a._addChild(n),n.__parent=a;return}if(a=i[t].getNearObject(o),a){const l=a.__parent;l&&this._removeLayer(a,!1);const h=new this._markerCluster(this,t,a,n);e[t].addObject(h,this._map.project(h._cLatLng,t)),a.__parent=h,n.__parent=h;let d=h;for(r=t-1;r>l._zoom;r--)d=new this._markerCluster(this,r,d),e[r].addObject(d,this._map.project(a.getLatLng(),r));l._addChild(d),this._removeFromGridUnclustered(a,t);return}i[t].addObject(n,o)}this._topClusterLevel._addChild(n),n.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(n=>{n instanceof _.MarkerCluster&&n._iconNeedsUpdate&&n._updateIcon()})},_enqueue:function(n){this._queue.push(n),this._queueTimeout||(this._queueTimeout=setTimeout(()=>this._processQueue(),300))},_processQueue:function(){for(let n=0;n<this._queue.length;n++)this._queue[n].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var n=Math.round(this._map._zoom);this._processQueue(),this._zoom<n&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,n)):this._zoom>n?(this._animationStart(),this._animationZoomOut(this._zoom,n)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(_.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(n){var t=this._maxLat;return t!==void 0&&(n.getNorth()>=t&&(n._northEast.lat=1/0),n.getSouth()<=-t&&(n._southWest.lat=-1/0)),n},_animationAddLayerNonAnimated:function(n,t){if(t===n)this._featureGroup.addLayer(n);else if(t._childCount===2){t._addToMap();const e=t.getAllChildMarkers();this._featureGroup.removeLayer(e[0]),this._featureGroup.removeLayer(e[1])}else t._updateIcon()},_extractNonGroupLayers:function(n,t){var e=n.getLayers(),i=0,s;for(t=t||[];i<e.length;i++){if(s=e[i],s instanceof _.LayerGroup){this._extractNonGroupLayers(s,t);continue}t.push(s)}return t},_overrideMarkerIcon:function(n){return n.options.icon=this.options.iconCreateFunction({getChildCount:()=>1,getAllChildMarkers:()=>[n]}),n.options.icon}}),_.MarkerClusterGroup.include({_mapBoundsInfinite:new _.LatLngBounds(new _.LatLng(-1/0,-1/0),new _.LatLng(1/0,1/0))}),_.MarkerClusterGroup.include({_noAnimation:{_animationStart:()=>{},_animationZoomIn:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(n,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(n,t){this._animationAddLayerNonAnimated(n,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(n,t){var e=this._getExpandedVisibleBounds(),i=this._featureGroup,s=Math.floor(this._map.getMinZoom()),o;this._ignoreMove=!0,this._topClusterLevel._recursively(e,n,s,r=>{var a=r._latlng,l=r._markers,h;for(e.contains(a)||(a=null),r._isSingleParent()&&n+1===t?(i.removeLayer(r),r._recursivelyAddChildrenToMap(null,t,e)):(r.clusterHide(),r._recursivelyAddChildrenToMap(a,t,e)),o=l.length-1;o>=0;o--)h=l[o],e.contains(h._latlng)||i.removeLayer(h)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(e,t),i.eachLayer(r=>{!(r instanceof _.MarkerCluster)&&r._icon&&r.clusterShow()}),this._topClusterLevel._recursively(e,n,t,r=>{r._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(e,n,s,r=>{i.removeLayer(r),r.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(n,t){this._animationZoomOutSingle(this._topClusterLevel,n-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),n,this._getExpandedVisibleBounds())},_animationAddLayer:function(n,t){var e=this._featureGroup;e.addLayer(n),t!==n&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),n._setPos(this._map.latLngToLayerPoint(t.getLatLng())),n.clusterHide(),this._enqueue(()=>{e.removeLayer(n),n.clusterShow(),this._animationEnd()})):(this._forceLayout(),this._animationStart(),this._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(n,t,e){var i=this._getExpandedVisibleBounds(),s=Math.floor(this._map.getMinZoom());n._recursivelyAnimateChildrenInAndAddSelfToMap(i,s,t+1,e);var o=this;this._forceLayout(),n._recursivelyBecomeVisible(i,e),this._enqueue(function(){if(n._childCount===1){const r=n._markers[0];this._ignoreMove=!0,r.setLatLng(r.getLatLng()),this._ignoreMove=!1,r.clusterShow&&r.clusterShow()}else n._recursively(i,e,s,r=>{r._recursivelyRemoveChildrenFromMap(i,s,t+1)});o._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:()=>{_.Util.falseFn(document.body.offsetWidth)}}),_.MarkerCluster=_.Marker.extend({initialize:function(n,t,e,i){_.Marker.prototype.initialize.call(this,e?e._cLatLng||e.getLatLng():new _.LatLng(0,0),{icon:this,pane:n.options.clusterPane}),this._group=n,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new _.LatLngBounds,e&&this._addChild(e),i&&this._addChild(i)},getAllChildMarkers:function(n){n=n||[];for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t].getAllChildMarkers(n);for(let t=this._markers.length-1;t>=0;t--)n.push(this._markers[t]);return n},getChildCount:function(){return this._childCount},zoomToBounds:function(n){for(var t=this._childClusters.slice(),e=this._group._map,i=e.getBoundsZoom(this._bounds),s=this._zoom+1,o=e.getZoom(),r;t.length>0&&i>s;){s++;let a=[];for(r=0;r<t.length;r++)a=a.concat(t[r]._childClusters);t=a}i>s?this._group._map.setView(this._latlng,s):i<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,n)},getBounds:function(){var n=new _.LatLngBounds;return n.extend(this._bounds),n},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(n,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(n),n instanceof _.MarkerCluster?(t||(this._childClusters.push(n),n.__parent=this),this._childCount+=n._childCount):(t||this._markers.push(n),this._childCount++),this.__parent&&this.__parent._addChild(n,!0)},_setClusterCenter:function(n){this._cLatLng||(this._cLatLng=n._cLatLng||n._latlng)},_resetBounds:function(){var n=this._bounds;n._southWest&&(n._southWest.lat=1/0,n._southWest.lng=1/0),n._northEast&&(n._northEast.lat=-1/0,n._northEast.lng=-1/0)},_recalculateBounds:function(){var n=this._markers,t=this._childClusters,e=0,i=0,s=this._childCount,o,r,a,l;if(s!==0){for(this._resetBounds(),o=0;o<n.length;o++)a=n[o]._latlng,this._bounds.extend(a),e+=a.lat,i+=a.lng;for(o=0;o<t.length;o++)r=t[o],r._boundsNeedUpdate&&r._recalculateBounds(),this._bounds.extend(r._bounds),a=r._wLatLng,l=r._childCount,e+=a.lat*l,i+=a.lng*l;this._latlng=this._wLatLng=new _.LatLng(e/s,i/s),this._boundsNeedUpdate=!1}},_addToMap:function(n){n&&(this._backupLatlng=this._latlng,this.setLatLng(n)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(n,t,e){this._recursively(n,this._group._map.getMinZoom(),e-1,i=>{var s=i._markers,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())},i=>{var s=i._childClusters,o,r;for(o=s.length-1;o>=0;o--)r=s[o],r._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(n,t,e,i){this._recursively(n,i,t,s=>{s._recursivelyAnimateChildrenIn(n,s._group._map.latLngToLayerPoint(s.getLatLng()).round(),e),s._isSingleParent()&&e-1===i?(s.clusterShow(),s._recursivelyRemoveChildrenFromMap(n,t,e)):s.clusterHide(),s._addToMap()})},_recursivelyBecomeVisible:function(n,t){this._recursively(n,this._group._map.getMinZoom(),t,null,e=>{e.clusterShow()})},_recursivelyAddChildrenToMap:function(n,t,e){this._recursively(e,this._group._map.getMinZoom()-1,t,i=>{if(t!==i._zoom)for(let s=i._markers.length-1;s>=0;s--){const o=i._markers[s];e.contains(o._latlng)&&(n&&(o._backupLatlng=o.getLatLng(),o.setLatLng(n),o.clusterHide&&o.clusterHide()),i._group._featureGroup.addLayer(o))}},i=>{i._addToMap(n)})},_recursivelyRestoreChildPositions:function(n){for(let t=this._markers.length-1;t>=0;t--){const e=this._markers[t];e._backupLatlng&&(e.setLatLng(e._backupLatlng),delete e._backupLatlng)}if(n-1===this._zoom)for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._restorePosition();else for(let t=this._childClusters.length-1;t>=0;t--)this._childClusters[t]._recursivelyRestoreChildPositions(n)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(n,t,e,i){var s,o;this._recursively(n,t-1,e-1,r=>{for(o=r._markers.length-1;o>=0;o--)s=r._markers[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())},r=>{for(o=r._childClusters.length-1;o>=0;o--)s=r._childClusters[o],(!i||!i.contains(s._latlng))&&(r._group._featureGroup.removeLayer(s),s.clusterShow&&s.clusterShow())})},_recursively:function(n,t,e,i,s){var o=this._childClusters,r=this._zoom,a,l;if(t<=r&&(i&&i(this),s&&r===e&&s(this)),r<t||r<e)for(a=o.length-1;a>=0;a--)l=o[a],n.intersects(l._bounds)&&l._recursively(n,t,e,i,s)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),_.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var n=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,n}}),_.DistanceGrid=function(n){this._cellSize=n,this._sqCellSize=n*n,this._grid={},this._objectPoint={}},_.DistanceGrid.prototype={addObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a=_.Util.stamp(n);this._objectPoint[a]=t,r.push(n)},updateObject:function(n,t){this.removeObject(n),this.addObject(n,t)},removeObject:function(n,t){var e=this._getCoord(t.x),i=this._getCoord(t.y),s=this._grid;s[i]=s[i]||{};var o=s[i];o[e]=o[e]||[];var r=o[e],a,l;for(delete this._objectPoint[_.Util.stamp(n)],a=0,l=r.length;a<l;a++)if(r[a]===n)return r.splice(a,1),l===1&&delete o[e],!0},eachObject:function(n,t){var e,i,s,o,r,a,l,h=this._grid;for(e in h){r=h[e];for(i in r)for(a=r[i],s=0,o=a.length;s<o;s++)l=n.call(t,a[s]),l&&(s--,o--)}},getNearObject:function(n){var t=this._getCoord(n.x),e=this._getCoord(n.y),i,s,o,r,a,l,h,d,c=this._objectPoint,u=this._sqCellSize,p=null;for(i=e-1;i<=e+1;i++)if(r=this._grid[i],r){for(s=t-1;s<=t+1;s++)if(a=r[s],a)for(o=0,l=a.length;o<l;o++)h=a[o],d=this._sqDist(c[_.Util.stamp(h)],n),d<u&&(u=d,p=h)}return p},_getCoord:function(n){return Math.floor(n/this._cellSize)},_sqDist:(n,t)=>{var e=t.x-n.x,i=t.y-n.y;return e*e+i*i}},_.QuickHull={getDistant:(n,t)=>{var e=t[1].lat-t[0].lat,i=t[0].lng-t[1].lng;return i*(n.lat-t[0].lat)+e*(n.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(n,t){var e=0,i=null,s=[],o,r,a;for(o=t.length-1;o>=0;o--){if(r=t[o],a=this.getDistant(r,n),a>0)s.push(r);else continue;a>e&&(e=a,i=r)}return{maxPoint:i,newPoints:s}},buildConvexHull:function(n,t){var e=[],i=this.findMostDistantPointFromBaseLine(n,t);return i.maxPoint?(e=e.concat(this.buildConvexHull([n[0],i.maxPoint],i.newPoints)),e=e.concat(this.buildConvexHull([i.maxPoint,n[1]],i.newPoints)),e):[n[0]]},getConvexHull:function(n){var t=!1,e=!1,i=!1,s=!1,o=null,r=null,a=null,l=null,h=null,d=null,c;for(c=n.length-1;c>=0;c--){const p=n[c];(t===!1||p.lat>t)&&(o=p,t=p.lat),(e===!1||p.lat<e)&&(r=p,e=p.lat),(i===!1||p.lng>i)&&(a=p,i=p.lng),(s===!1||p.lng<s)&&(l=p,s=p.lng)}e!==t?(d=r,h=o):(d=l,h=a);var u=[].concat(this.buildConvexHull([d,h],n),this.buildConvexHull([h,d],n));return u}},_.MarkerCluster.include({getConvexHull:function(){var n=this.getAllChildMarkers(),t=[],e,i;for(i=n.length-1;i>=0;i--)e=n[i].getLatLng(),t.push(e);return _.QuickHull.getConvexHull(t)}}),_.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var n=this.getAllChildMarkers(),t=this._group,e=t._map,i=e.latLngToLayerPoint(this._latlng),s;this._group._unspiderfy(),this._group._spiderfied=this,n.length>=this._circleSpiralSwitchover?s=this._generatePointsSpiral(n.length,i):(i.y+=10,s=this._generatePointsCircle(n.length,i)),this._animationSpiderfy(n,s)}},unspiderfy:function(n){this._group._inZoomAnimation||(this._animationUnspiderfy(n),this._group._spiderfied=null)},_generatePointsCircle:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+n),i=e/this._2PI,s=this._2PI/n,o=[],r,a;for(o.length=n,r=n-1;r>=0;r--)a=this._circleStartAngle+r*s,o[r]=new _.Point(t.x+i*Math.cos(a),t.y+i*Math.sin(a))._round();return o},_generatePointsSpiral:function(n,t){var e=this._group.options.spiderfyDistanceMultiplier,i=e*this._spiralLengthStart,s=e*this._spiralFootSeparation,o=e*this._spiralLengthFactor*this._2PI,r=0,a=[],l;for(a.length=n,l=n-1;l>=0;l--)r+=s/i+l*5e-4,a[l]=new _.Point(t.x+i*Math.cos(r),t.y+i*Math.sin(r))._round(),i+=o/r;return a},_noanimationUnspiderfy:function(){var n=this._group,t=n._map,e=n._featureGroup,i=this.getAllChildMarkers(),s,o;for(n._ignoreMove=!0,this.setOpacity(1),o=i.length-1;o>=0;o--)s=i[o],e.removeLayer(s),s._preSpiderfyLatlng&&(s.setLatLng(s._preSpiderfyLatlng),delete s._preSpiderfyLatlng),s.setZIndexOffset&&s.setZIndexOffset(0),s._spiderLeg&&(t.removeLayer(s._spiderLeg),delete s._spiderLeg);n.fire("unspiderfied",{cluster:this,markers:i}),n._ignoreMove=!1,n._spiderfied=null}}),_.MarkerClusterNonAnimated=_.MarkerCluster.extend({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._group.options.spiderLegPolylineOptions,r,a,l,h;for(e._ignoreMove=!0,r=0;r<n.length;r++)h=i.layerPointToLatLng(t[r]),a=n[r],l=new _.Polyline([this._latlng,h],o),i.addLayer(l),a._spiderLeg=l,a._preSpiderfyLatlng=a._latlng,a.setLatLng(h),a.setZIndexOffset&&a.setZIndexOffset(1e6),s.addLayer(a);this.setOpacity(.3),e._ignoreMove=!1,e.fire("spiderfied",{cluster:this,markers:n})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),_.MarkerCluster.include({_animationSpiderfy:function(n,t){var e=this._group,i=e._map,s=e._featureGroup,o=this._latlng,r=i.latLngToLayerPoint(o),a=_.Path.SVG,l=Object.assign({},this._group.options.spiderLegPolylineOptions),h=l.opacity,d,c,u,p,y,g;for(h===void 0&&(h=_.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),a?(l.opacity=0,l.className=`${l.className||""} leaflet-cluster-spider-leg`):l.opacity=h,e._ignoreMove=!0,d=0;d<n.length;d++)c=n[d],g=i.layerPointToLatLng(t[d]),u=new _.Polyline([o,g],l),i.addLayer(u),c._spiderLeg=u,a&&(p=u._path,y=p.getTotalLength()+.1,p.style.strokeDasharray=y,p.style.strokeDashoffset=y),c.setZIndexOffset&&c.setZIndexOffset(1e6),c.clusterHide&&c.clusterHide(),s.addLayer(c),c._setPos&&c._setPos(r);for(e._forceLayout(),e._animationStart(),d=n.length-1;d>=0;d--)g=i.layerPointToLatLng(t[d]),c=n[d],c._preSpiderfyLatlng=c._latlng,c.setLatLng(g),c.clusterShow&&c.clusterShow(),a&&(u=c._spiderLeg,p=u._path,p.style.strokeDashoffset=0,u.setStyle({opacity:h}));this.setOpacity(.3),e._ignoreMove=!1,setTimeout(()=>{e._animationEnd(),e.fire("spiderfied",{cluster:this,markers:n})},200)},_animationUnspiderfy:function(n){var t=this._group,e=t._map,i=t._featureGroup,s=n?e._latLngToNewLayerPoint(this._latlng,n.zoom,n.center):e.latLngToLayerPoint(this._latlng),o=this.getAllChildMarkers(),r=_.Path.SVG,a,l,h,d,c,u;for(t._ignoreMove=!0,t._animationStart(),this.setOpacity(1),l=o.length-1;l>=0;l--)a=o[l],a._preSpiderfyLatlng&&(a.closePopup(),a.setLatLng(a._preSpiderfyLatlng),delete a._preSpiderfyLatlng,u=!0,a._setPos&&(a._setPos(s),u=!1),a.clusterHide&&(a.clusterHide(),u=!1),u&&i.removeLayer(a),r&&(h=a._spiderLeg,d=h._path,c=d.getTotalLength()+.1,d.style.strokeDashoffset=c,h.setStyle({opacity:0})));t._ignoreMove=!1,setTimeout(()=>{var p=0;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&p++;for(l=o.length-1;l>=0;l--)a=o[l],a._spiderLeg&&(a.clusterShow&&a.clusterShow(),a.setZIndexOffset&&a.setZIndexOffset(0),p>1&&i.removeLayer(a),e.removeLayer(a._spiderLeg),delete a._spiderLeg);t._animationEnd(),t.fire("unspiderfied",{cluster:this,markers:o})},200)}}),_.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(...n){this._unspiderfy.apply(this,n)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),_.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(n){this._map._mapPane.classList.contains("leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(n))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(n){this._spiderfied&&this._spiderfied.unspiderfy(n)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(n){n._spiderLeg&&(this._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow(),n.setZIndexOffset&&n.setZIndexOffset(0),this._map.removeLayer(n._spiderLeg),delete n._spiderLeg)}}),_.MarkerClusterGroup.include({refreshClusters:function(n){return n?n instanceof _.MarkerClusterGroup?n=n._topClusterLevel.getAllChildMarkers():n instanceof _.LayerGroup?n=n._layers:n instanceof _.MarkerCluster?n=n.getAllChildMarkers():n instanceof _.Marker&&(n=[n]):n=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(n),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(n),this},_flagParentsIconsNeedUpdate:n=>{var t,e;for(t in n)for(e=n[t].__parent;e;)e._iconNeedsUpdate=!0,e=e.__parent},_refreshSingleMarkerModeMarkers:function(n){var t,e;for(t in n)e=n[t],this.hasLayer(e)&&e.setIcon(this._overrideMarkerIcon(e))}}),_.Marker.include({refreshIconOptions:function(n,t){var e=this.options.icon;return _.setOptions(e,n),this.setIcon(e),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}});const tn=()=>typeof window<"u"&&typeof document<"u";function Xn(n,t){let e;return function(...i){clearTimeout(e),e=setTimeout(()=>n.apply(this,i),t)}}const A=(n,t,e)=>e===void 0?n.getAttribute(t)??null:(e===null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e),null),en=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.addEventListener(s,...i);return()=>Ve(n,...t)},Ve=(n,...t)=>{const[e,...i]=t;for(const s of e.split(" "))n.removeEventListener(s,...i)},ce=(n,t,e)=>{const i=document.createElement(n);if(t)for(const[s,o]of Object.entries(t))A(i,s,o);return i},ue=typeof HTMLElement>"u"?class{}:HTMLElement,pe=(n,t)=>!tn()||window.customElements.get(n)||window.customElements.define(n,t),Jn=typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets,Qn=(n,t)=>{if(!Jn)return;n.shadowRoot||n.attachShadow({mode:"open"}).append(ce("slot"));const e=new CSSStyleSheet;e.replaceSync(t),n.shadowRoot.adoptedStyleSheets=[e]},ts=`/**
604
604
  * NOTE:
605
605
  * - Dark mode styles are in styles.module.css to leverage data-color-scheme attribute
606
606
  * - This file is using --mtds- not --mtds- since we're inside shadow dom
607
607
  */
608
608
 
609
+ ::slotted([data-color]), /* Ensure data-color is respected */
609
610
  :host {
610
611
  --mtdsc-atlas-border: 1px solid var(--mtds-color-border-subtle);
611
612
  --mtdsc-atlas-cluster-border: 1px solid;
612
- --mtdsc-atlas-marker-background: #116e6b;
613
+ --mtdsc-atlas-marker-background: var(--mtds-color-base-default);
614
+ --mtdsc-atlas-marker-background-outer: #fff;
613
615
  --mtdsc-atlas-cluster-background: var(--mtdsc-atlas-marker-background);
614
616
  --mtdsc-atlas-cluster-color: var(--mtdsc-atlas-marker-color);
615
617
  --mtdsc-atlas-marker-border: none;
616
- --mtdsc-atlas-marker-color: #fff;
618
+ --mtdsc-atlas-marker-color: var(--mtds-color-base-contrast-default);
617
619
  --mtdsc-atlas-marker-inset: 3px;
618
620
  --mtdsc-atlas-marker-shadow-blur: 4px;
619
621
  --mtdsc-atlas-marker-shadow-color: rgba(0 0 0 / 0.5);
@@ -621,7 +623,8 @@ path.leaflet-interactive:focus:not(:focus-visible) {
621
623
  --mtdsc-atlas-marker-size: var(--mtds-6);
622
624
  --mtdsc-atlas-tile-background: #f7fcfc;
623
625
  --mtdsc-atlas-tile-filter: grayscale(.8) contrast(0.75) brightness(1.15); /* Also in styles.module.css */
624
-
626
+ }
627
+ :host {
625
628
  border-radius: var(--mtds-border-radius-md);
626
629
  aspect-ratio: 2;
627
630
  overflow: clip;
@@ -690,7 +693,7 @@ path.leaflet-interactive:focus:not(:focus-visible) {
690
693
  ::slotted(mtds-atlas-marker)::after {
691
694
  box-shadow: var(--mtdsc-atlas-marker-shadow-offset) var(--mtdsc-atlas-marker-shadow-offset) var(--mtdsc-atlas-marker-shadow-blur) var(--mtdsc-atlas-marker-shadow-color);
692
695
  aspect-ratio: 1;
693
- background: var(--mtdsc-atlas-marker-color);
696
+ background: var(--mtdsc-atlas-marker-background-outer);
694
697
  color: var(--mtdsc-atlas-marker-background);
695
698
  border-radius: 50% 50% 0 50%;
696
699
  /* biome-ignore lint/complexity/noImportantStyles: Overwrite Tailwind */
@@ -701,10 +704,7 @@ path.leaflet-interactive:focus:not(:focus-visible) {
701
704
  inset: calc(var(--mtdsc-atlas-marker-inset) * -1);
702
705
  z-index: -1;
703
706
  }
704
- ::slotted(mtds-atlas-marker[data-color]) {
705
- --mtdsc-atlas-marker-background: var(--mtds-color-base-default); /* Ensure data-color is respected */
706
- --mtdsc-atlas-marker-color: var(--mtds-color-base-contrast-default);
707
- }
707
+
708
708
  ::slotted(mtds-atlas-marker.leaflet-drag-target) {
709
709
  cursor: grabbing;
710
710
  }
@@ -718,7 +718,7 @@ path.leaflet-interactive:focus:not(:focus-visible) {
718
718
  border-radius: 100%;
719
719
  border: var(--mtdsc-atlas-cluster-border);
720
720
  box-sizing: border-box;
721
- outline: 1px solid var(--mtdsc-atlas-cluster-background);
721
+ outline: 2px solid var(--mtdsc-atlas-cluster-background);
722
722
  color: var(--mtdsc-atlas-cluster-color);
723
723
  display: flex;
724
724
  font-size: var(--mtds-body-xs-font-size);
@@ -733,5 +733,5 @@ path.leaflet-interactive:focus:not(:focus-visible) {
733
733
  .leaflet-popup:has(slot) .leaflet-popup-content-wrapper { display: contents } /* No need for styling this element */
734
734
  .leaflet-popup:has(slot) .leaflet-popup-content { margin: 0; font: inherit }
735
735
 
736
- `;let nn=0;class sn extends ue{atlas;marker;static get observedAttributes(){return["hidden","draggable","data-latlng","popovertarget"]}connectedCallback(){queueMicrotask(()=>{const t=ce("slot",{name:`${++nn}`}),e=new _.DivIcon({html:t,iconSize:[0,0]});this.atlas=this.closest("mtds-atlas")||void 0,this.marker=new _.Marker(this.#t(),{draggable:this.draggable,keyboard:!1,icon:e}),this.marker.bindPopup(()=>`#${A(this,"popovertarget")}`),this.marker.on("dragend",this.#e),en(this,"click keydown",this),A(this,"slot",`${nn}`),A(this,"role","button"),A(this,"tabindex","0"),this.attributeChangedCallback("hidden")})}attributeChangedCallback(t){const e=this.marker,i=this.atlas?.cluster;if(t==="popovertarget"&&e?.getPopup()?.update(),t==="data-latlng"){const s=this.#t();e?.getLatLng().equals(s)||e?.setLatLng(s)}t==="draggable"&&e?.dragging?.[this.draggable?"enable":"disable"](),t==="hidden"&&e&&i&&i[this.hidden?"removeLayer":"addLayer"](e)}disconnectedCallback(){Ke(this,"click keydown",this),this.marker?.unbindPopup().off("dragend",this.#e).remove(),this.marker=this.atlas=void 0}handleEvent(t){if(t.type==="click")return this.marker?.fire("click");t.key===" "&&t.preventDefault(),(t.key===" "||t.key==="Enter")&&this.click()}get latlng(){return A(this,"data-latlng")||""}set latlng(t){A(this,"data-latlng",t)}#t(){return this.latlng?.split(",").map(parseFloat)}#e(t){const i=t.target._icon?.firstElementChild?.assignedElements?.()?.[0],{lat:s,lng:o}=t.target.getLatLng();i&&(i.latlng=`${s},${o}`),i?.dispatchEvent(new CustomEvent("dragend",{detail:t,bubbles:!0}))}}pe("mtds-atlas-marker",sn);const lt=11102230246251565e-32,R=134217729,ts=(3+8*lt)*lt;function Ye(n,t,e,i,s){let o,r,a,l,h=t[0],d=i[0],c=0,u=0;d>h==d>-h?(o=h,h=t[++c]):(o=d,d=i[++u]);let p=0;if(c<n&&u<e)for(d>h==d>-h?(r=h+o,a=o-(r-h),h=t[++c]):(r=d+o,a=o-(r-d),d=i[++u]),o=r,a!==0&&(s[p++]=a);c<n&&u<e;)d>h==d>-h?(r=o+h,l=r-o,a=o-(r-l)+(h-l),h=t[++c]):(r=o+d,l=r-o,a=o-(r-l)+(d-l),d=i[++u]),o=r,a!==0&&(s[p++]=a);for(;c<n;)r=o+h,l=r-o,a=o-(r-l)+(h-l),h=t[++c],o=r,a!==0&&(s[p++]=a);for(;u<e;)r=o+d,l=r-o,a=o-(r-l)+(d-l),d=i[++u],o=r,a!==0&&(s[p++]=a);return(o!==0||p===0)&&(s[p++]=o),p}function es(n,t){let e=t[0];for(let i=1;i<n;i++)e+=t[i];return e}function $t(n){return new Float64Array(n)}const is=(3+16*lt)*lt,ns=(2+12*lt)*lt,ss=(9+64*lt)*lt*lt,Mt=$t(4),on=$t(8),rn=$t(12),an=$t(16),j=$t(4);function os(n,t,e,i,s,o,r){let a,l,h,d,c,u,p,y,g,x,v,M,B,O,I,Z,W,E;const T=n-s,N=e-s,U=t-o,q=i-o;O=T*q,u=R*T,p=u-(u-T),y=T-p,u=R*q,g=u-(u-q),x=q-g,I=y*x-(O-p*g-y*g-p*x),Z=U*N,u=R*U,p=u-(u-U),y=U-p,u=R*N,g=u-(u-N),x=N-g,W=y*x-(Z-p*g-y*g-p*x),v=I-W,c=I-v,Mt[0]=I-(v+c)+(c-W),M=O+v,c=M-O,B=O-(M-c)+(v-c),v=B-Z,c=B-v,Mt[1]=B-(v+c)+(c-Z),E=M+v,c=E-M,Mt[2]=M-(E-c)+(v-c),Mt[3]=E;let Q=es(4,Mt),ht=ns*r;if(Q>=ht||-Q>=ht||(c=n-T,a=n-(T+c)+(c-s),c=e-N,h=e-(N+c)+(c-s),c=t-U,l=t-(U+c)+(c-o),c=i-q,d=i-(q+c)+(c-o),a===0&&l===0&&h===0&&d===0)||(ht=ss*r+ts*Math.abs(Q),Q+=T*d+q*a-(U*h+N*l),Q>=ht||-Q>=ht))return Q;O=a*q,u=R*a,p=u-(u-a),y=a-p,u=R*q,g=u-(u-q),x=q-g,I=y*x-(O-p*g-y*g-p*x),Z=l*N,u=R*l,p=u-(u-l),y=l-p,u=R*N,g=u-(u-N),x=N-g,W=y*x-(Z-p*g-y*g-p*x),v=I-W,c=I-v,j[0]=I-(v+c)+(c-W),M=O+v,c=M-O,B=O-(M-c)+(v-c),v=B-Z,c=B-v,j[1]=B-(v+c)+(c-Z),E=M+v,c=E-M,j[2]=M-(E-c)+(v-c),j[3]=E;const me=Ye(4,Mt,4,j,on);O=T*d,u=R*T,p=u-(u-T),y=T-p,u=R*d,g=u-(u-d),x=d-g,I=y*x-(O-p*g-y*g-p*x),Z=U*h,u=R*U,p=u-(u-U),y=U-p,u=R*h,g=u-(u-h),x=h-g,W=y*x-(Z-p*g-y*g-p*x),v=I-W,c=I-v,j[0]=I-(v+c)+(c-W),M=O+v,c=M-O,B=O-(M-c)+(v-c),v=B-Z,c=B-v,j[1]=B-(v+c)+(c-Z),E=M+v,c=E-M,j[2]=M-(E-c)+(v-c),j[3]=E;const _n=Ye(me,on,4,j,rn);O=a*d,u=R*a,p=u-(u-a),y=a-p,u=R*d,g=u-(u-d),x=d-g,I=y*x-(O-p*g-y*g-p*x),Z=l*h,u=R*l,p=u-(u-l),y=l-p,u=R*h,g=u-(u-h),x=h-g,W=y*x-(Z-p*g-y*g-p*x),v=I-W,c=I-v,j[0]=I-(v+c)+(c-W),M=O+v,c=M-O,B=O-(M-c)+(v-c),v=B-Z,c=B-v,j[1]=B-(v+c)+(c-Z),E=M+v,c=E-M,j[2]=M-(E-c)+(v-c),j[3]=E;const ms=Ye(_n,rn,4,j,an);return an[ms-1]}function rs(n,t,e,i,s,o){const r=(t-o)*(e-s),a=(n-s)*(i-o),l=r-a,h=Math.abs(r+a);return Math.abs(l)>=is*h?l:-os(n,t,e,i,s,o,h)}function as(n,t){var e,i,s=0,o,r,a,l,h,d,c,u=n[0],p=n[1],y=t.length;for(e=0;e<y;e++){i=0;var g=t[e],x=g.length-1;if(d=g[0],d[0]!==g[x][0]&&d[1]!==g[x][1])throw new Error("First and last coordinates in a ring must be the same");for(r=d[0]-u,a=d[1]-p,i;i<x;i++){if(c=g[i+1],l=c[0]-u,h=c[1]-p,a===0&&h===0){if(l<=0&&r>=0||r<=0&&l>=0)return 0}else if(h>=0&&a<=0||h<=0&&a>=0){if(o=rs(r,l,a,h,0,0),o===0)return 0;(o>0&&h>0&&a<=0||o<0&&h<=0&&a>0)&&s++}d=c,a=h,r=l}}return s%2!==0}function ls(n,t,e={}){const i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties={},i.geometry=n,i}function hs(n,t,e={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ln(n[0])||!ln(n[1]))throw new Error("coordinates must contain numbers");return ls({type:"Point",coordinates:n},t,e)}function ln(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function ds(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function cs(n){return n.type==="Feature"?n.geometry:n}function us(n,t,e={}){if(!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");const i=ds(n),s=cs(t),o=s.type,r=t.bbox;let a=s.coordinates;if(r&&ps(i,r)===!1)return!1;o==="Polygon"&&(a=[a]);let l=!1;for(var h=0;h<a.length;++h){const d=as(i,a[h]);if(d===0)return!e.ignoreBoundary;d&&(l=!0)}return l}function ps(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}const hn="moveend zoomend refresh";class dn extends ue{atlas;geojson;static get observedAttributes(){return["hidden","data-collection","data-color","popovertarget"]}constructor(){super(),this.refresh=Yn(this.refresh,300)}connectedCallback(){queueMicrotask(()=>{this.atlas=this.closest("mtds-atlas")||void 0,this.atlas?.map?.on(hn,this.refresh,this),this.geojson=new _.GeoJSON(null,{style:this.#t(),onEachFeature:(t,e)=>e.on("click",this.handleEvent,this)}).bindPopup(()=>`#${A(this,"popovertarget")}`),this.refresh(),this.attributeChangedCallback("hidden")})}attributeChangedCallback(t){const e=this.geojson,i=this.atlas?.map;t==="popovertarget"&&e?.getPopup()?.update(),t==="data-color"&&e?.setStyle(this.#t()),t==="data-collection"&&this.refresh(),t==="hidden"&&e&&i&&i[this.hidden?"removeLayer":"addLayer"](e)}disconnectedCallback(){this.atlas?.map?.off(hn,this.refresh,this),this.geojson?.unbindPopup().remove(),this.geojson=this.atlas=void 0}refresh(t){!this.geojson||!this.atlas?.map?.hasLayer(this.geojson)||this.getCollection().then(e=>{const i=e?.links.find(({rel:r})=>r==="items"),s=t===!0?`&nocache=${Date.now()}`:"",o=this.atlas?.map?.getBounds().toBBoxString();e?fetch(`${i?.href}?bbox=${o}${s}`).then(r=>r.json()).then(r=>this.geojson?.clearLayers().addData(r)):this.atlas?.getCollections().then(r=>{const a=`mtds-atlas-matgeo: Please set a vaild data-collection="${Object.keys(r).join(" | ")}"`;console.warn(a)})})}handleEvent(t){t.originalEvent.stopPropagation(),this.atlas?.getCollections().then(e=>{const i=[t.target],s={...t,targets:i,collections:e},o=hs([t.latlng.lng,t.latlng.lat]);this.atlas?.map?.eachLayer(r=>{if(r===t.target)return;(r.feature?.geometry&&us(o,r.feature.geometry)||r instanceof _.Marker&&r.getLatLng().equals(t.latlng))&&i.push(r)}),this.dispatchEvent(new MouseEvent("click",t.originalEvent)),this.dispatchEvent(new CustomEvent("atlasfeatureclick",{detail:s,bubbles:!0}))})}async getCollection(){return this.atlas?.getCollections().then(t=>t?.[A(this,"data-collection")||""])}#t(){return{color:`var(--mtds-color-${A(this,"data-color")||"main"}-base-default)`}}}pe("mtds-atlas-matgeo",dn);class cn extends ue{atlas;wms;static get observedAttributes(){return["hidden","data-url","popovertarget"]}connectedCallback(){queueMicrotask(()=>{this.atlas=this.closest("mtds-atlas")||void 0,this.refresh()})}attributeChangedCallback(t){t==="data-url"&&this.refresh(),t==="popovertarget"&&this.wms?.getPopup()?.update(),t==="hidden"&&this.wms&&(this.atlas?.map?.[this.hidden?"removeLayer":"addLayer"](this.wms),this.wms.bringToFront())}refresh(){const t=new URL(A(this,"data-url")||""),e=Object.fromEntries(t.searchParams.entries());this.wms?.unbindPopup().remove(),this.wms=new _.TileLayer.WMS(`${t.origin}${t.pathname}`,e),this.attributeChangedCallback("hidden")}disconnectedCallback(){this.wms?.unbindPopup().remove(),this.wms=this.atlas=void 0}}pe("mtds-atlas-wms",cn);let Xe=0;const un=18,_s="https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png",pn="https://matgeoservice-256616427209.europe-north1.run.app/ogc/features/collections",fs=[[57.5,4.73],[71.5,31.44]];Ve()&&!window._matgeoCollections&&(window._matgeoCollections=fetch(pn).then(n=>n.json()).then(n=>n.collections.map(t=>[t.id,t])).then(Object.fromEntries));class _e extends ue{cluster;map;static get observedAttributes(){return["data-view","data-scrollzoom"]}constructor(){super(),this.attachShadow({mode:"open"}).append(ce("figure")),Jn(this,`@layer leaflet{${Kn}}
737
- @layer mt.design{${Qn}`)}connectedCallback(){const t=this.shadowRoot?.lastElementChild,e=A(this,"data-cluster")??"false",i=new _.TileLayer(_s,{attribution:"&copy; Kartverket",className:"leaflet-kartverket-tiles",maxZoom:un});this.map=new _.Map(t,{attributionControl:!1,fadeAnimation:!1,layers:[i],zoomControl:!1,zoomSnap:.2}),en(this,"pointerup click",this.#e),this.map.addControl(new _.Control.Attribution({prefix:""})),this.map.addControl(new _.Control.Zoom({position:"bottomright"})),this.map.on("popupopen popupclose",this.#t,this),this.cluster=new _.MarkerClusterGroup({zoomToBoundsOnClick:!0,showCoverageOnHover:!1,disableClusteringAtZoom:e==="false"?1:Number(e)||un+1,iconCreateFunction:s=>new _.DivIcon({html:`${s.getChildCount()}`,className:"leaflet-cluster-icon",iconSize:[30,30]})}).addTo(this.map);for(const s of _e.observedAttributes)this.attributeChangedCallback(s,null,A(this,s))}attributeChangedCallback(t,e,i){t==="data-view"&&this.setView(i||""),t==="data-scrollzoom"&&this.map?.scrollWheelZoom[i==="false"?"disable":"enable"]()}setView(t,e){const i=`${t}`.split(",").map(parseFloat).filter(Number.isFinite),s=this.cluster?.getBounds();if(i.length===3)return this.map?.setView([i[0],i[1]],i[2],e);if(t!=="fit")return this.map?.fitBounds(fs,e);if(s?.isValid())return this.map?.fitBounds(s.pad(.1),e);this.cluster?.once("layeradd",()=>{setTimeout(()=>this.setView("fit"),50)})}latLngFromPoint(t,e){return this.map?.pointerEventToLatLng({clientX:t,clientY:e})}disconnectedCallback(){Ke(this,"pointerup click",this.#e),this.map?.remove(),this.map=this.cluster=void 0}async getCollections(){return window._matgeoCollections||Promise.resolve({})}#t({type:t,popup:e}){const i=t==="popupopen",s=e.getElement()?.querySelector(".leaflet-popup-content"),o=s?.querySelector(":scope > slot"),r=s?.textContent?.match(/^#(\S+)/)?.[1]||"",a=document.getElementById(o?.name||r);if(!a)return i&&r&&e.close();_.Util.setOptions(e,{maxWidth:this.offsetWidth-40}),A(a,"data-popover",i?A(a,"popover"):null),A(a,"popover",i?null:A(a,"data-popover")),A(a,"slot",i?a.id:null),i&&e.setContent(ce("slot",{name:a.id}))}#e(t){t.type==="click"?Xe&&t.stopPropagation?.():document.body.classList.contains("leaflet-dragging")&&(Xe=setTimeout(()=>{Xe=0},50))}}return pe("mtds-atlas",_e),Ve()&&(_.Marker.prototype.options.icon=new _.DivIcon({html:'<div class="leaflet-marker-generated-slot"><div class="leaflet-marker-generated-icon"></div></div>',iconSize:[0,0]})),H.L=_,H.MATGEO_URL=pn,H.MTDSAtlasElement=_e,H.MTDSAtlasMarkerElement=sn,H.MTDSAtlasMatgeoElement=dn,H.MTDSAtlasWMSElement=cn,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),H})({});
736
+ `;let nn=0;class sn extends ue{atlas;marker;static get observedAttributes(){return["hidden","draggable","data-latlng","popovertarget"]}connectedCallback(){queueMicrotask(()=>{const t=ce("slot",{name:`${++nn}`}),e=new _.DivIcon({html:t,iconSize:[0,0]});this.atlas=this.closest("mtds-atlas")||void 0,this.marker=new _.Marker(this.#e(),{draggable:this.draggable,keyboard:!1,icon:e}),this.marker.bindPopup(()=>`#${A(this,"popovertarget")}`),this.marker.on("dragend",this.#t),en(this,"click keydown",this),A(this,"slot",`${nn}`),A(this,"role","button"),A(this,"tabindex","0"),this.attributeChangedCallback("hidden")})}attributeChangedCallback(t){const e=this.marker,i=this.atlas?.cluster;if(t==="popovertarget"&&e?.getPopup()?.update(),t==="data-latlng"){const s=this.#e();e?.getLatLng().equals(s)||e?.setLatLng(s)}t==="draggable"&&e?.dragging?.[this.draggable?"enable":"disable"](),t==="hidden"&&e&&i&&i[this.hidden?"removeLayer":"addLayer"](e)}disconnectedCallback(){Ve(this,"click keydown",this),this.marker?.unbindPopup().off("dragend",this.#t).remove(),this.marker=this.atlas=void 0}handleEvent(t){if(t.type==="click")return this.marker?.fire("click");t.key===" "&&t.preventDefault(),(t.key===" "||t.key==="Enter")&&this.click()}get latlng(){return A(this,"data-latlng")||""}set latlng(t){A(this,"data-latlng",t)}#e(){return this.latlng?.split(",").map(parseFloat)}#t(t){const i=t.target._icon?.firstElementChild?.assignedElements?.()?.[0],{lat:s,lng:o}=t.target.getLatLng();i&&(i.latlng=`${s},${o}`),i?.dispatchEvent(new CustomEvent("dragend",{detail:t,bubbles:!0}))}}pe("mtds-atlas-marker",sn);const lt=11102230246251565e-32,R=134217729,es=(3+8*lt)*lt;function Ke(n,t,e,i,s){let o,r,a,l,h=t[0],d=i[0],c=0,u=0;d>h==d>-h?(o=h,h=t[++c]):(o=d,d=i[++u]);let p=0;if(c<n&&u<e)for(d>h==d>-h?(r=h+o,a=o-(r-h),h=t[++c]):(r=d+o,a=o-(r-d),d=i[++u]),o=r,a!==0&&(s[p++]=a);c<n&&u<e;)d>h==d>-h?(r=o+h,l=r-o,a=o-(r-l)+(h-l),h=t[++c]):(r=o+d,l=r-o,a=o-(r-l)+(d-l),d=i[++u]),o=r,a!==0&&(s[p++]=a);for(;c<n;)r=o+h,l=r-o,a=o-(r-l)+(h-l),h=t[++c],o=r,a!==0&&(s[p++]=a);for(;u<e;)r=o+d,l=r-o,a=o-(r-l)+(d-l),d=i[++u],o=r,a!==0&&(s[p++]=a);return(o!==0||p===0)&&(s[p++]=o),p}function is(n,t){let e=t[0];for(let i=1;i<n;i++)e+=t[i];return e}function $t(n){return new Float64Array(n)}const ns=(3+16*lt)*lt,ss=(2+12*lt)*lt,os=(9+64*lt)*lt*lt,Mt=$t(4),on=$t(8),rn=$t(12),an=$t(16),j=$t(4);function rs(n,t,e,i,s,o,r){let a,l,h,d,c,u,p,y,g,x,v,M,B,O,I,Z,W,E;const T=n-s,N=e-s,U=t-o,q=i-o;O=T*q,u=R*T,p=u-(u-T),y=T-p,u=R*q,g=u-(u-q),x=q-g,I=y*x-(O-p*g-y*g-p*x),Z=U*N,u=R*U,p=u-(u-U),y=U-p,u=R*N,g=u-(u-N),x=N-g,W=y*x-(Z-p*g-y*g-p*x),v=I-W,c=I-v,Mt[0]=I-(v+c)+(c-W),M=O+v,c=M-O,B=O-(M-c)+(v-c),v=B-Z,c=B-v,Mt[1]=B-(v+c)+(c-Z),E=M+v,c=E-M,Mt[2]=M-(E-c)+(v-c),Mt[3]=E;let Q=is(4,Mt),ht=ss*r;if(Q>=ht||-Q>=ht||(c=n-T,a=n-(T+c)+(c-s),c=e-N,h=e-(N+c)+(c-s),c=t-U,l=t-(U+c)+(c-o),c=i-q,d=i-(q+c)+(c-o),a===0&&l===0&&h===0&&d===0)||(ht=os*r+es*Math.abs(Q),Q+=T*d+q*a-(U*h+N*l),Q>=ht||-Q>=ht))return Q;O=a*q,u=R*a,p=u-(u-a),y=a-p,u=R*q,g=u-(u-q),x=q-g,I=y*x-(O-p*g-y*g-p*x),Z=l*N,u=R*l,p=u-(u-l),y=l-p,u=R*N,g=u-(u-N),x=N-g,W=y*x-(Z-p*g-y*g-p*x),v=I-W,c=I-v,j[0]=I-(v+c)+(c-W),M=O+v,c=M-O,B=O-(M-c)+(v-c),v=B-Z,c=B-v,j[1]=B-(v+c)+(c-Z),E=M+v,c=E-M,j[2]=M-(E-c)+(v-c),j[3]=E;const me=Ke(4,Mt,4,j,on);O=T*d,u=R*T,p=u-(u-T),y=T-p,u=R*d,g=u-(u-d),x=d-g,I=y*x-(O-p*g-y*g-p*x),Z=U*h,u=R*U,p=u-(u-U),y=U-p,u=R*h,g=u-(u-h),x=h-g,W=y*x-(Z-p*g-y*g-p*x),v=I-W,c=I-v,j[0]=I-(v+c)+(c-W),M=O+v,c=M-O,B=O-(M-c)+(v-c),v=B-Z,c=B-v,j[1]=B-(v+c)+(c-Z),E=M+v,c=E-M,j[2]=M-(E-c)+(v-c),j[3]=E;const fn=Ke(me,on,4,j,rn);O=a*d,u=R*a,p=u-(u-a),y=a-p,u=R*d,g=u-(u-d),x=d-g,I=y*x-(O-p*g-y*g-p*x),Z=l*h,u=R*l,p=u-(u-l),y=l-p,u=R*h,g=u-(u-h),x=h-g,W=y*x-(Z-p*g-y*g-p*x),v=I-W,c=I-v,j[0]=I-(v+c)+(c-W),M=O+v,c=M-O,B=O-(M-c)+(v-c),v=B-Z,c=B-v,j[1]=B-(v+c)+(c-Z),E=M+v,c=E-M,j[2]=M-(E-c)+(v-c),j[3]=E;const gs=Ke(fn,rn,4,j,an);return an[gs-1]}function as(n,t,e,i,s,o){const r=(t-o)*(e-s),a=(n-s)*(i-o),l=r-a,h=Math.abs(r+a);return Math.abs(l)>=ns*h?l:-rs(n,t,e,i,s,o,h)}function ls(n,t){var e,i,s=0,o,r,a,l,h,d,c,u=n[0],p=n[1],y=t.length;for(e=0;e<y;e++){i=0;var g=t[e],x=g.length-1;if(d=g[0],d[0]!==g[x][0]&&d[1]!==g[x][1])throw new Error("First and last coordinates in a ring must be the same");for(r=d[0]-u,a=d[1]-p,i;i<x;i++){if(c=g[i+1],l=c[0]-u,h=c[1]-p,a===0&&h===0){if(l<=0&&r>=0||r<=0&&l>=0)return 0}else if(h>=0&&a<=0||h<=0&&a>=0){if(o=as(r,l,a,h,0,0),o===0)return 0;(o>0&&h>0&&a<=0||o<0&&h<=0&&a>0)&&s++}d=c,a=h,r=l}}return s%2!==0}function hs(n,t,e={}){const i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties={},i.geometry=n,i}function ds(n,t,e={}){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ln(n[0])||!ln(n[1]))throw new Error("coordinates must contain numbers");return hs({type:"Point",coordinates:n},t,e)}function ln(n){return!isNaN(n)&&n!==null&&!Array.isArray(n)}function cs(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if(n.type==="Feature"&&n.geometry!==null&&n.geometry.type==="Point")return[...n.geometry.coordinates];if(n.type==="Point")return[...n.coordinates]}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return[...n];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function us(n){return n.type==="Feature"?n.geometry:n}function ps(n,t,e={}){if(!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");const i=cs(n),s=us(t),o=s.type,r=t.bbox;let a=s.coordinates;if(r&&_s(i,r)===!1)return!1;o==="Polygon"&&(a=[a]);let l=!1;for(var h=0;h<a.length;++h){const d=ls(i,a[h]);if(d===0)return!e.ignoreBoundary;d&&(l=!0)}return l}function _s(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}const hn="moveend zoomend refresh";class dn extends ue{atlas;geojson;static get observedAttributes(){return["hidden","data-collection","data-color","popovertarget"]}constructor(){super(),this.refresh=Xn(this.refresh,300)}connectedCallback(){queueMicrotask(()=>{this.atlas=this.closest("mtds-atlas")||void 0,this.atlas?.map?.on(hn,this.refresh,this),this.geojson=new _.GeoJSON(null,{style:cn(this),onEachFeature:(t,e)=>e.on("click",this.handleEvent,this)}).bindPopup(()=>`#${A(this,"popovertarget")}`),this.refresh(),this.attributeChangedCallback("hidden")})}attributeChangedCallback(t){const e=this.geojson,i=this.atlas?.map;t==="popovertarget"&&e?.getPopup()?.update(),t==="data-color"&&e?.setStyle(cn(this)),t==="data-collection"&&this.refresh(),t==="hidden"&&e&&i&&i[this.hidden?"removeLayer":"addLayer"](e)}disconnectedCallback(){this.atlas?.map?.off(hn,this.refresh,this),this.geojson?.unbindPopup().remove(),this.geojson=this.atlas=void 0}refresh(t){!this.geojson||!this.atlas?.map?.hasLayer(this.geojson)||this.getCollection().then(e=>{const i=e?.links.find(({rel:r})=>r==="items"),s=t===!0?`&nocache=${Date.now()}`:"",o=this.atlas?.map?.getBounds().toBBoxString();e?fetch(`${i?.href}?bbox=${o}${s}`).then(r=>r.json()).then(r=>this.geojson?.clearLayers().addData(r)):this.atlas?.getCollections().then(r=>{const a=`mtds-atlas-matgeo: Please set a vaild data-collection="${Object.keys(r).join(" | ")}"`;console.warn(a)})})}handleEvent(t){t.originalEvent.stopPropagation(),this.atlas?.getCollections().then(e=>{const i=[t.target],s={...t,targets:i,collections:e},o=ds([t.latlng.lng,t.latlng.lat]);this.atlas?.map?.eachLayer(r=>{if(r===t.target)return;(r.feature?.geometry&&ps(o,r.feature.geometry)||r instanceof _.Marker&&r.getLatLng().equals(t.latlng))&&i.push(r)}),this.dispatchEvent(new MouseEvent("click",t.originalEvent)),this.dispatchEvent(new CustomEvent("atlasfeatureclick",{detail:s,bubbles:!0}))})}async getCollection(){return this.atlas?.getCollections().then(t=>t?.[A(this,"data-collection")||""])}}const cn=n=>({color:`var(--mtds-color-${A(n,"data-color")||"main"}-base-default)`});pe("mtds-atlas-matgeo",dn);class un extends ue{atlas;wms;static get observedAttributes(){return["hidden","data-url","popovertarget"]}connectedCallback(){queueMicrotask(()=>{this.atlas=this.closest("mtds-atlas")||void 0,this.refresh()})}attributeChangedCallback(t){t==="data-url"&&this.refresh(),t==="popovertarget"&&this.wms?.getPopup()?.update(),t==="hidden"&&this.wms&&(this.atlas?.map?.[this.hidden?"removeLayer":"addLayer"](this.wms),this.wms.bringToFront())}refresh(){const t=new URL(A(this,"data-url")||""),e=Object.fromEntries(t.searchParams.entries());this.wms?.unbindPopup().remove(),this.wms=new _.TileLayer.WMS(`${t.origin}${t.pathname}`,e),this.attributeChangedCallback("hidden")}disconnectedCallback(){this.wms?.unbindPopup().remove(),this.wms=this.atlas=void 0}}pe("mtds-atlas-wms",un);let Ye=0;const pn=18,fs="https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png",_n="https://matgeoservice-256616427209.europe-north1.run.app/ogc/features/collections",ms=[[57.5,4.73],[71.5,31.44]];class _e extends ue{cluster;map;static get observedAttributes(){return["data-view","data-scrollzoom"]}constructor(){super(),this.attachShadow({mode:"open"}).append(ce("figure")),Qn(this,`@layer leaflet{${Yn}}
737
+ @layer mt.design{${ts}`)}connectedCallback(){const t=this.shadowRoot?.lastElementChild,e=A(this,"data-cluster")??"false",i=new _.TileLayer(fs,{attribution:"&copy; Kartverket",className:"leaflet-kartverket-tiles",maxZoom:pn});this.map=new _.Map(t,{attributionControl:!1,fadeAnimation:!1,layers:[i],zoomControl:!1,zoomSnap:.2}),en(this,"pointerup click",this.#t),this.map.addControl(new _.Control.Attribution({prefix:""})),this.map.addControl(new _.Control.Zoom({position:"bottomright"})),this.map.on("popupopen popupclose",this.#e,this),this.cluster=new _.MarkerClusterGroup({zoomToBoundsOnClick:!0,showCoverageOnHover:!1,disableClusteringAtZoom:e==="false"?1:Number(e)||pn+1,iconCreateFunction:s=>new _.DivIcon({html:`${s.getChildCount()}`,className:"leaflet-cluster-icon",iconSize:[40,40]})}).addTo(this.map);for(const s of _e.observedAttributes)this.attributeChangedCallback(s,null,A(this,s))}attributeChangedCallback(t,e,i){t==="data-view"&&this.setView(i||""),t==="data-scrollzoom"&&this.map?.scrollWheelZoom[i==="false"?"disable":"enable"]()}setView(t,e){const i=`${t}`.split(",").map(parseFloat).filter(Number.isFinite),s=this.cluster?.getBounds();if(i.length===3)return this.map?.setView([i[0],i[1]],i[2],e);if(t!=="fit")return this.map?.fitBounds(ms,e);if(s?.isValid())return this.map?.fitBounds(s.pad(.1),e);this.cluster?.once("layeradd",()=>{setTimeout(()=>this.setView("fit"),50)})}latLngFromPoint(t,e){return this.map?.pointerEventToLatLng({clientX:t,clientY:e})}disconnectedCallback(){Ve(this,"pointerup click",this.#t),this.map?.remove(),this.map=this.cluster=void 0}async getCollections(){return window._matgeoCollections||(window._matgeoCollections=fetch(_n).then(t=>t.json()).then(t=>t.collections.map(e=>[e.id,e])).then(Object.fromEntries)),window._matgeoCollections}#e({type:t,popup:e}){const i=t==="popupopen",s=e.getElement()?.querySelector(".leaflet-popup-content"),o=s?.querySelector(":scope > slot"),r=s?.textContent?.match(/^#(\S+)/)?.[1]||"",a=document.getElementById(o?.name||r);if(!a)return i&&r&&e.close();_.Util.setOptions(e,{maxWidth:this.offsetWidth-40}),A(a,"data-popover",i?A(a,"popover"):null),A(a,"popover",i?null:A(a,"data-popover")),A(a,"slot",i?a.id:null),i&&e.setContent(ce("slot",{name:a.id}))}#t(t){t.type==="click"?Ye&&t.stopPropagation?.():document.body.classList.contains("leaflet-dragging")&&(Ye=setTimeout(()=>{Ye=0},50))}}return pe("mtds-atlas",_e),tn()&&(_.Marker.prototype.options.icon=new _.DivIcon({html:'<div class="leaflet-marker-generated-slot"><div class="leaflet-marker-generated-icon"></div></div>',iconSize:[0,0]})),H.L=_,H.MATGEO_URL=_n,H.MTDSAtlasElement=_e,H.MTDSAtlasMarkerElement=sn,H.MTDSAtlasMatgeoElement=dn,H.MTDSAtlasWMSElement=un,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),H})({});