import{g as zr,b as G,r as m,a as Yi,R as Zr,c as Br}from"./vendor-react-CVHocMAO.js";var Dr=function r(u,s){if(u===s)return!0;if(u&&s&&typeof u=="object"&&typeof s=="object"){if(u.constructor!==s.constructor)return!1;var l,c,f;if(Array.isArray(u)){if(l=u.length,l!=s.length)return!1;for(c=l;c--!==0;)if(!r(u[c],s[c]))return!1;return!0}if(u.constructor===RegExp)return u.source===s.source&&u.flags===s.flags;if(u.valueOf!==Object.prototype.valueOf)return u.valueOf()===s.valueOf();if(u.toString!==Object.prototype.toString)return u.toString()===s.toString();if(f=Object.keys(u),l=f.length,l!==Object.keys(s).length)return!1;for(c=l;c--!==0;)if(!Object.prototype.hasOwnProperty.call(s,f[c]))return!1;for(c=l;c--!==0;){var p=f[c];if(!r(u[p],s[p]))return!1}return!0}return u!==u&&s!==s};const ge=zr(Dr),Rr="1.8.3";function Lt(r,u){var s={};for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&u.indexOf(l)<0&&(s[l]=r[l]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,l=Object.getOwnPropertySymbols(r);c<l.length;c++)u.indexOf(l[c])<0&&Object.prototype.propertyIsEnumerable.call(r,l[c])&&(s[l[c]]=r[l[c]]);return s}function Ui(r,u,s,l){function c(f){return f instanceof s?f:new s(function(p){p(f)})}return new(s||(s=Promise))(function(f,p){function y(v){try{b(l.next(v))}catch(T){p(T)}}function w(v){try{b(l.throw(v))}catch(T){p(T)}}function b(v){v.done?f(v.value):c(v.value).then(y,w)}b((l=l.apply(r,[])).next())})}function Nr(r,u){r.src=u}const Fr=r=>{var u,s,l,c="The Google Maps JavaScript API",f="google",p="importLibrary",y="__ib__",w=document,b=window,v=b[f]||(b[f]={}),T=v.maps||(v.maps={}),E=new Set,g=new URLSearchParams,M=()=>u||(u=new Promise(async(C,P)=>{var O;await(s=w.createElement("script")),g.set("libraries",[...E]+"");for(l in r)g.set(l.replace(/[A-Z]/g,I=>"_"+I[0].toLowerCase()),r[l]);g.set("callback",f+".maps."+y),Nr(s,"https://maps.googleapis.com/maps/api/js?"+g),T[y]=C,s.onerror=()=>u=P(Error(c+" could not load.")),s.nonce=((O=w.querySelector("script[nonce]"))==null?void 0:O.nonce)||"",w.head.append(s)}));T[p]?console.warn(c+" only loads once. Ignoring:",r):T[p]=(C,...P)=>E.add(C)&&M().then(()=>T[p](C,...P))},Hr=r=>`The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(r)}) will be ignored.`,Wr=r=>`The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(r)}) will be ignored.`,Ur=()=>{},Gr=()=>{};let Gi=!1;function jr(r){if(Gi){Ur(Hr(r));return}qr(r),Gi=!0}async function Vr(r){var u,s;if(!((s=(u=window==null?void 0:window.google)==null?void 0:u.maps)!=null&&s.importLibrary))throw new Error("google.maps.importLibrary is not installed.");return await google.maps.importLibrary(r)}function qr(r){var s,l;const u=!!((l=(s=window.google)==null?void 0:s.maps)!=null&&l.importLibrary);u&&Gr(Wr(r)),u||Fr(r)}const yt={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED",FAILED:"FAILED",AUTH_FAILURE:"AUTH_FAILURE"},Jr="GMP_visgl_rgmlibrary_v1_default",Kr=[`gmp_visgl_reactgooglemaps_v${Rr}`],ee=G.createContext(null);let Bt=yt.NOT_LOADED,Ne;const Cn=new Set;function Fe(r){r!==Bt&&(Bt=r,Cn.forEach(u=>u(Bt)))}function Yr(){const[r,u]=m.useState({});return{mapInstances:r,addMapInstance:(f,p="default")=>{u(y=>Object.assign(Object.assign({},y),{[p]:f}))},removeMapInstance:(f="default")=>{u(p=>{var y=f;p[y];var w=Lt(p,[typeof y=="symbol"?y:y+""]);return w})},clearMapInstances:()=>{u({})}}}function Xr(){const[r,u]=m.useState({});return{map3dInstances:r,addMap3DInstance:(f,p="default")=>{u(y=>Object.assign(Object.assign({},y),{[p]:f}))},removeMap3DInstance:(f="default")=>{u(p=>{var y=f;p[y];var w=Lt(p,[typeof y=="symbol"?y:y+""]);return w})},clearMap3DInstances:()=>{u({})}}}function $r(r){const{onLoad:u,onError:s,apiKey:l,version:c,libraries:f=[],region:p,language:y,authReferrerPolicy:w,channel:b,solutionChannel:v,fetchAppCheckToken:T}=r,[E,g]=m.useState(Bt),[M,C]=m.useReducer((I,A)=>I[A.name]?I:Object.assign(Object.assign({},I),{[A.name]:A.value}),{}),P=m.useMemo(()=>{const I={apiKey:l,version:c,libraries:f.join(","),region:p,language:y,authReferrerPolicy:w,channel:b,solutionChannel:v};return JSON.stringify(I)},[l,c,f,p,y,w,b,v]),O=m.useCallback(I=>Ui(this,void 0,void 0,function*(){if(M[I])return M[I];const A=yield Vr(I);return C({name:I,value:A}),A}),[M]);return m.useEffect(()=>(Cn.add(g),g(Bt),()=>{Cn.delete(g)}),[]),m.useEffect(()=>{Ui(this,void 0,void 0,function*(){var I,A;try{Ne&&Ne!==P&&console.warn("The Google Maps JavaScript API has already been loaded with different parameters. The new parameters will be ignored. If you need to use different parameters, please refresh the page.");const F=["core","maps",...f];if(!((A=(I=window.google)===null||I===void 0?void 0:I.maps)===null||A===void 0)&&A.importLibrary){Ne||Fe(yt.LOADED),yield Promise.all(F.map(k=>O(k))),u&&u();return}if(Bt===yt.LOADING||Bt===yt.LOADED){Bt===yt.LOADED&&u&&u();return}Ne=P,Fe(yt.LOADING);const W=Object.fromEntries(Object.entries({key:l,v:c,libraries:f,region:p,language:y,authReferrerPolicy:w}).filter(([,k])=>k!==void 0));b!==void 0&&b>=0&&b<=999&&(W.channel=String(b)),v===void 0?W.solutionChannel=Jr:v!==""&&(W.solutionChannel=v),jr(W),yield Promise.all(F.map(k=>O(k))),Fe(yt.LOADED),u&&u()}catch(F){Fe(yt.FAILED),s?s(F):console.error("The Google Maps JavaScript API failed to load.",F)}})},[P,u,s,O,f]),m.useEffect(()=>{if(E!==yt.LOADED)return;const I=google.maps.Settings.getInstance();T?I.fetchAppCheckToken=T:I.fetchAppCheckToken&&(I.fetchAppCheckToken=null)},[E,T]),{status:E,loadedLibraries:M,importLibrary:O}}function Qr(r){return m.useMemo(()=>r.disableUsageAttribution?null:Kr,[r.disableUsageAttribution])}const Ma=r=>{const{children:u}=r,s=Lt(r,["children"]),{mapInstances:l,addMapInstance:c,removeMapInstance:f,clearMapInstances:p}=Yr(),{map3dInstances:y,addMap3DInstance:w,removeMap3DInstance:b,clearMap3DInstances:v}=Xr(),{status:T,loadedLibraries:E,importLibrary:g}=$r(s),M=Qr(s),C=m.useMemo(()=>({mapInstances:l,addMapInstance:c,removeMapInstance:f,clearMapInstances:p,map3dInstances:y,addMap3DInstance:w,removeMap3DInstance:b,clearMap3DInstances:v,status:T,loadedLibraries:E,importLibrary:g,internalUsageAttributionIds:M}),[l,c,f,p,y,w,b,v,T,E,g,M]);return G.createElement(ee.Provider,{value:C},u)};function ts(r,u){for(const s of os){const l=u[s],c=Xi[s];m.useEffect(()=>{if(!r||!l)return;const f=google.maps.event.addListener(r,c,p=>{l(es(c,r,p))});return()=>f.remove()},[r,c,l])}}function es(r,u,s){var l;const c={type:r,map:u,detail:{},stoppable:!1,stop:()=>{}};if(ns.includes(r)){const f=c,p=u.getCenter(),y=u.getZoom(),w=u.getHeading()||0,b=u.getTilt()||0,v=u.getBounds();return(!p||!v||!Number.isFinite(y))&&console.warn("[createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),f.detail={center:(p==null?void 0:p.toJSON())||{lat:0,lng:0},zoom:y||0,heading:w,tilt:b,bounds:(v==null?void 0:v.toJSON())||{north:90,east:180,south:-90,west:-180}},f}else if(is.includes(r)){if(!s)throw new Error("[createEvent] mouse events must provide a srcEvent");const f=c;return f.domEvent=s.domEvent,f.stoppable=!0,f.stop=()=>s.stop(),f.detail={latLng:((l=s.latLng)===null||l===void 0?void 0:l.toJSON())||null,placeId:s.placeId},f}return c}const Xi={onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onContextmenu:"contextmenu",onDblclick:"dblclick",onDrag:"drag",onDragend:"dragend",onDragstart:"dragstart",onHeadingChanged:"heading_changed",onIdle:"idle",onIsFractionalZoomEnabledChanged:"isfractionalzoomenabled_changed",onMapCapabilitiesChanged:"mapcapabilities_changed",onMapTypeIdChanged:"maptypeid_changed",onMousemove:"mousemove",onMouseout:"mouseout",onMouseover:"mouseover",onProjectionChanged:"projection_changed",onRenderingTypeChanged:"renderingtype_changed",onTilesLoaded:"tilesloaded",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed",onCameraChanged:"bounds_changed"},ns=["bounds_changed","center_changed","heading_changed","tilt_changed","zoom_changed"],is=["click","contextmenu","dblclick","mousemove","mouseout","mouseover"],os=Object.keys(Xi);function ve(r,u){const s=m.useRef(r);return u(r,s.current)||(s.current=r),s.current}function rs(r,u,s){m.useEffect(r,[ve(u,s)])}function $i(r,u){rs(r,u,ge)}const ss=new Set(["backgroundColor","clickableIcons","controlSize","disableDefaultUI","disableDoubleClickZoom","draggable","draggableCursor","draggingCursor","fullscreenControl","fullscreenControlOptions","gestureHandling","headingInteractionEnabled","isFractionalZoomEnabled","keyboardShortcuts","mapTypeControl","mapTypeControlOptions","mapTypeId","maxZoom","minZoom","noClear","panControl","panControlOptions","restriction","rotateControl","rotateControlOptions","scaleControl","scaleControlOptions","scrollwheel","streetView","streetViewControl","streetViewControlOptions","styles","tiltInteractionEnabled","zoomControl","zoomControlOptions"]);function as(r,u){const s={},l=Object.keys(u);for(const c of l)ss.has(c)&&(s[c]=u[c]);$i(()=>{r&&r.setOptions(s)},[s])}function Qi(){var r;return((r=m.useContext(ee))===null||r===void 0?void 0:r.status)||yt.NOT_LOADED}function us(r,u){const{viewport:s,viewState:l}=u,c=!!s;return m.useLayoutEffect(()=>{if(!r||!l)return;const{latitude:f,longitude:p,bearing:y,pitch:w,zoom:b}=l;r.moveCamera({center:{lat:f,lng:p},heading:y,tilt:w,zoom:b+1})},[r,l]),c}function ls(r){return!r||typeof r!="object"||!("lat"in r&&"lng"in r)?!1:Number.isFinite(r.lat)&&Number.isFinite(r.lng)}function to(r,u){if(!r||!u)return!1;const s=We(r),l=We(u);return!(s.lat!==l.lat||s.lng!==l.lng)}function We(r){return ls(r)?r:r.toJSON()}function ji(r){if("north"in r&&"south"in r&&"east"in r&&"west"in r)return r;const u=r.getNorthEast().toJSON(),s=r.getSouthWest().toJSON();return{north:u.lat,east:u.lng,south:s.lat,west:s.lng}}function hs(r,u){if(!r||!u)return!1;const s=ji(r),l=ji(u);return s.north===l.north&&s.south===l.south&&s.east===l.east&&s.west===l.west}function eo(r,u){if(!r||!u)return r===u;const s="getArray"in u?u.getArray():u;if(r.length!==s.length)return!1;for(let l=0;l<r.length;l++)if(!to(r[l],s[l]))return!1;return!0}function cs(r,u){if(!r||!u)return r===u;const s="getArray"in u?u.getArray().map(l=>l.getArray()):u;if(r.length!==s.length)return!1;for(let l=0;l<r.length;l++)if(!eo(r[l],s[l]))return!1;return!0}function ds(r,u,s){const l=s.center?We(s.center):null;let c=null,f=null;l&&Number.isFinite(l.lat)&&Number.isFinite(l.lng)&&(c=l.lat,f=l.lng);const p=Number.isFinite(s.zoom)?s.zoom:null,y=Number.isFinite(s.heading)?s.heading:null,w=Number.isFinite(s.tilt)?s.tilt:null;m.useLayoutEffect(()=>{if(!r)return;const b={};let v=!1;c!==null&&f!==null&&(u.current.center.lat!==c||u.current.center.lng!==f)&&(b.center={lat:c,lng:f},v=!0),p!==null&&u.current.zoom!==p&&(b.zoom=p,v=!0),y!==null&&u.current.heading!==y&&(b.heading=y,v=!0),w!==null&&u.current.tilt!==w&&(b.tilt=w,v=!0),v&&r.moveCamera(b)})}const fs=()=>{const r={position:"absolute",top:0,left:0,bottom:0,right:0,zIndex:999,display:"flex",flexFlow:"column nowrap",textAlign:"center",justifyContent:"center",fontSize:".8rem",color:"rgba(0,0,0,0.6)",background:"#dddddd",padding:"1rem 1.5rem"};return G.createElement("div",{style:r},G.createElement("h2",null,"Error: AuthFailure"),G.createElement("p",null,"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the ",G.createElement("code",null,"APIProvider.apiKey")," prop is correct. Check the error-message in the console for further details."))};function En(){const[r,u]=m.useState(null),s=m.useCallback(l=>u(l),[u]);return[r,s]}function no(){return Qi()===yt.LOADED}function io(){const[,r]=m.useReducer(u=>u+1,0);return r}function _s(r,u){const s=r.getCenter(),l=r.getZoom(),c=r.getHeading()||0,f=r.getTilt()||0,p=r.getBounds();(!s||!p||!Number.isFinite(l))&&console.warn("[useTrackedCameraState] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),Object.assign(u.current,{center:(s==null?void 0:s.toJSON())||{lat:0,lng:0},zoom:l||0,heading:c,tilt:f})}function ms(r){const u=io(),s=m.useRef({center:{lat:0,lng:0},heading:0,tilt:0,zoom:0});return m.useEffect(()=>{if(!r)return;const l=google.maps.event.addListener(r,"bounds_changed",()=>{_s(r,s),u()});return()=>l.remove()},[r,u]),s}class He{static has(u){return this.entries[u]&&this.entries[u].length>0}static pop(u){return this.entries[u]&&this.entries[u].pop()||null}static push(u,s){this.entries[u]||(this.entries[u]=[]),this.entries[u].push(s)}}He.entries={};function ps(r,u){const s=no(),[l,c]=m.useState(null),[f,p]=En(),y=ms(l),{id:w,defaultBounds:b,defaultCenter:v,defaultZoom:T,defaultHeading:E,defaultTilt:g,reuseMaps:M,renderingType:C,colorScheme:P}=r,O=Lt(r,["id","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme"]),I=r.zoom!==void 0||r.defaultZoom!==void 0,A=r.center!==void 0||r.defaultCenter!==void 0;!b&&(!I||!A)&&console.warn("<Map> component is missing configuration. You have to provide zoom and center (via the `zoom`/`defaultZoom` and `center`/`defaultCenter` props) or specify the region to show using `defaultBounds`. See https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required"),!O.center&&v&&(O.center=v),!O.zoom&&Number.isFinite(T)&&(O.zoom=T),!O.heading&&Number.isFinite(E)&&(O.heading=E),!O.tilt&&Number.isFinite(g)&&(O.tilt=g);const F=O.internalUsageAttributionIds;F==null?O.internalUsageAttributionIds=u.internalUsageAttributionIds:O.internalUsageAttributionIds=[...u.internalUsageAttributionIds||[],...F];for(const k of Object.keys(O))O[k]===void 0&&delete O[k];const W=m.useRef(void 0);return m.useEffect(()=>{if(!f||!s)return;const{addMapInstance:k,removeMapInstance:D}=u,{mapId:q}=r,et=`${q||"default"}:${C||"default"}:${P||"LIGHT"}`;let j,$;if(M&&He.has(et)?($=He.pop(et),j=$.getDiv(),f.appendChild(j),$.setOptions(O),setTimeout(()=>$.moveCamera({}),0)):(j=document.createElement("div"),j.style.height="100%",f.appendChild(j),$=new google.maps.Map(j,Object.assign(Object.assign(Object.assign({},O),C?{renderingType:C}:{}),P?{colorScheme:P}:{}))),c($),k($,w),b){const{padding:lt}=b,Ut=Lt(b,["padding"]);$.fitBounds(Ut,lt)}else(!I||!A)&&$.fitBounds({east:180,west:-180,south:-90,north:90});if(W.current){const{mapId:lt,cameraState:Ut}=W.current;lt!==q&&$.moveCamera(Ut)}return()=>{W.current={mapId:q,cameraState:y.current},j.remove(),M?He.push(et,$):google.maps.event.clearInstanceListeners($),c(null),D(w)}},[f,s,w,r.mapId,r.renderingType,r.colorScheme]),[l,p,y]}const oo=G.createContext(null),gs=r=>{const{children:u,id:s,className:l,style:c}=r,f=m.useContext(ee),p=Qi();if(!f)throw new Error("<Map> can only be used inside an <ApiProvider> component.");const[y,w,b]=ps(r,f);ds(y,b,r),ts(y,r),as(y,r);const v=us(y,r),T=!!r.controlled;m.useEffect(()=>{if(y)return v&&y.setOptions({disableDefaultUI:!0}),(v||T)&&y.setOptions({gestureHandling:"none",keyboardShortcuts:!1}),()=>{y.setOptions({gestureHandling:r.gestureHandling,keyboardShortcuts:r.keyboardShortcuts})}},[y,v,T,r.gestureHandling,r.keyboardShortcuts]);const E=r.center?We(r.center):null;let g=null,M=null;E&&Number.isFinite(E.lat)&&Number.isFinite(E.lng)&&(g=E.lat,M=E.lng);const C=m.useMemo(()=>{var I,A,F;return{center:{lat:g??0,lng:M??0},zoom:(I=r.zoom)!==null&&I!==void 0?I:0,heading:(A=r.heading)!==null&&A!==void 0?A:0,tilt:(F=r.tilt)!==null&&F!==void 0?F:0}},[g,M,r.zoom,r.heading,r.tilt]);m.useLayoutEffect(()=>{if(!y||!T)return;y.moveCamera(C);const I=y.addListener("bounds_changed",()=>{y.moveCamera(C)});return()=>I.remove()},[y,T,C]);const P=m.useMemo(()=>Object.assign({width:"100%",height:"100%",position:"relative",zIndex:v?-1:0},c),[c,v]),O=m.useMemo(()=>({map:y}),[y]);return p===yt.AUTH_FAILURE?G.createElement("div",{style:Object.assign({position:"relative"},l?{}:P),className:l},G.createElement(fs,null)):G.createElement("div",Object.assign({ref:w,"data-testid":"map",style:l?void 0:P,className:l},s?{id:s}:{}),y?G.createElement(oo.Provider,{value:O},u):null)};gs.deckGLViewProps=!0;const Vi=new Set;function vs(...r){const u=JSON.stringify(r);Vi.has(u)||(Vi.add(u),console.error(...r))}const ne=(r=null)=>{const u=m.useContext(ee),{map:s}=m.useContext(oo)||{};if(u===null)return vs("useMap(): failed to retrieve APIProviderContext. Make sure that the <APIProvider> component exists and that the component you are calling `useMap()` from is a sibling of the <APIProvider>."),null;const{mapInstances:l}=u;return r!==null?l[r]||null:s||l.default||null};function Ue(r){const u=no(),s=m.useContext(ee);return m.useEffect(()=>{!u||!s||s.importLibrary(r)},[u,s,r]),(s==null?void 0:s.loadedLibraries[r])||null}var Tn;const{useLayoutEffect:ys,useRef:ws}=Zr,Ps=(Tn=m.useInsertionEffect)!==null&&Tn!==void 0?Tn:ys;function Ls(){throw new Error("useEffectEvent: invalid call during rendering.")}function xs(r){const u=ws(Ls);return Ps(()=>{u.current=r},[r]),(...s)=>u.current(...s)}const ro=xs,bs=()=>{};function X(r,u,s){const l=ro(s??bs),c=!!s;m.useEffect(()=>{if(!r||!u||!c)return;const f=google.maps.event.addListener(r,u,l);return()=>f.remove()},[r,u,c])}function ut(r,u,s){m.useEffect(()=>{r&&(r[u]=s)},[r,u,s])}const Ts=()=>{};function Mn(r,u,s){const l=ro(s??Ts),c=!!s;m.useEffect(()=>{if(!r||!u||!c)return;const f=l;return r.addEventListener(u,f),()=>r.removeEventListener(u,f)},[r,u,c])}class Cs{constructor(){this.renderedStyles=new Set,this.styleElement=null}getStyleElement(){return this.styleElement||(this.styleElement=document.createElement("style"),this.styleElement.setAttribute("data-rgm-anchor-styles",""),document.head.appendChild(this.styleElement)),this.styleElement}addAdvancedMarkerPointerEventsOverwrite(){if(this.renderedStyles.has("marker-pointer-events"))return;const u=this.getStyleElement();u.textContent+=`
      gmp-advanced-marker[data-origin='rgm'] {
        pointer-events: none !important;
      }
    `,this.renderedStyles.add("marker-pointer-events")}cleanup(){this.styleElement&&(this.styleElement.remove(),this.styleElement=null,this.renderedStyles.clear())}}const Es=new Cs;function Ms(r,u){var s;if(!(!((s=google==null?void 0:google.maps)===null||s===void 0)&&s.version))return;const l=google.maps.version.split("."),c=parseInt(l[0],10),f=parseInt(l[1],10);return c>r||c===r&&f>=u}const Os=G.createContext(null),Ss={BOTTOM:["50%","100%"]},ks=m.forwardRef((r,u)=>{const{children:s,style:l,className:c,anchorPoint:f}=r,[p,y]=As(r),w=m.useMemo(()=>p?{marker:p}:null,[p]);return m.useImperativeHandle(u,()=>p,[p]),y?G.createElement(Os.Provider,{value:w},Yi.createPortal(G.createElement(Is,{anchorPoint:f,styles:l,className:c},s),y)):null});ks.displayName="AdvancedMarker";function On(r){return r.nodeType===Node.ELEMENT_NODE}const Is=({children:r,styles:u,className:s})=>G.createElement("div",{className:s,style:u},r);function As(r){const[u,s]=m.useState(null),[l,c]=m.useState(null),f=ne(),p=Ue("marker"),{children:y,onClick:w,className:b,onMouseEnter:v,onMouseLeave:T,onDrag:E,onDragStart:g,onDragEnd:M,collisionBehavior:C,clickable:P,draggable:O,position:I,title:A,zIndex:F,anchorPoint:W,anchorLeft:k,anchorTop:D}=r,q=m.Children.count(y);return m.useEffect(()=>{if(!f||!p)return;const et=new p.AdvancedMarkerElement;et.map=f,s(et);let j=null;return q>0&&(j=document.createElement("div"),et.content=j,c(j)),()=>{et.map=null,j==null||j.remove(),s(null),c(null)}},[f,p,q]),m.useEffect(()=>{!(u!=null&&u.content)||!On(u.content)||q>0||(u.content.className=b??"")},[u,b,q]),zs(u,W,k,D,q>0),ut(u,"position",I),ut(u,"title",A??""),ut(u,"zIndex",F),ut(u,"collisionBehavior",C),m.useEffect(()=>{u&&(O!==void 0?u.gmpDraggable=O:E||g||M?u.gmpDraggable=!0:u.gmpDraggable=!1)},[u,O,E,M,g]),m.useEffect(()=>{if(!u)return;const et=P!==void 0?P:!!w||!!v||!!T;u.gmpClickable=et,et&&(u!=null&&u.content)&&On(u.content)&&(u.content.style.pointerEvents="all",w&&(u.content.style.cursor="pointer"))},[u,P,w,v,T]),X(u,"click",w),X(u,"drag",E),X(u,"dragstart",g),X(u,"dragend",M),Mn(u==null?void 0:u.element,"mouseenter",v),Mn(u==null?void 0:u.element,"mouseleave",T),[u,l]}function zs(r,u,s,l,c){m.useEffect(()=>{if(!r||!c)return;const f=Ms(3,62),p=r.content;if(!(!p||!On(p))){if(s!==void 0||l!==void 0){f||console.warn(`AdvancedMarker: The anchorLeft and anchorTop props are only supported in Google Maps API version 3.62 and above. The current version is ${google.maps.version}.`),r.anchorLeft=s,r.anchorTop=l,u!==void 0&&console.warn("AdvancedMarker: the anchorPoint prop is ignored when anchorLeft and/or anchorTop are set.");return}if(u!==void 0){const[y,w]=u??Ss.BOTTOM,b=`calc(-1 * ${y})`,v=`calc(-1 * ${w})`;f?(r.anchorLeft=b,r.anchorTop=v,p.style.transform=""):(p.style.transform=`translate(50%, 100%) translate(${b}, ${v})`,r.dataset.origin="rgm",Es.addAdvancedMarkerPointerEventsOverwrite())}}},[r,u,s,l,c])}function Zs(r){var u,s,l;const{onClick:c,onDrag:f,onDragStart:p,onDragEnd:y,onMouseOver:w,onMouseOut:b,onRadiusChanged:v,onCenterChanged:T,center:E,defaultCenter:g,radius:M,defaultRadius:C}=r,P=Lt(r,["onClick","onDrag","onDragStart","onDragEnd","onMouseOver","onMouseOut","onRadiusChanged","onCenterChanged","center","defaultCenter","radius","defaultRadius"]),[O,I]=m.useState(null),A=ne(),F=ve(Object.assign(Object.assign({},P),{clickable:(u=P.clickable)!==null&&u!==void 0?u:!!c,draggable:(s=P.draggable)!==null&&s!==void 0?s:!!(f||p||y||T),editable:(l=P.editable)!==null&&l!==void 0?l:!!v}),ge);return m.useEffect(()=>{if(!A){A===void 0&&console.error("<Circle> has to be inside a Map component.");return}const W=new google.maps.Circle(Object.assign(Object.assign({},F),{center:E??g,radius:M??C}));return W.setMap(A),I(W),()=>{W.setMap(null),I(null)}},[A]),X(O,"click",c),X(O,"drag",f),X(O,"dragstart",p),X(O,"dragend",y),X(O,"mouseover",w),X(O,"mouseout",b),X(O,"radius_changed",v?()=>{const W=O==null?void 0:O.getRadius();W!==void 0&&v(W)}:null),X(O,"center_changed",T?()=>{T(O==null?void 0:O.getCenter())}:null),m.useEffect(()=>{O&&O.setOptions(F)},[O,F]),m.useEffect(()=>{!O||!E||to(E,O.getCenter())||O.setCenter(E)},[O,E]),m.useEffect(()=>{!O||M===void 0||M!==O.getRadius()&&O.setRadius(M)},[O,M]),O}const Bs=m.forwardRef((r,u)=>{const s=Zs(r);return m.useImperativeHandle(u,()=>s,[s]),G.createElement(G.Fragment,null)});Bs.displayName="Circle";function Ds(r,u,s){if(u!=null&&typeof u!="object")throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");const l=r.style;if(s==null){if(u==null)return;for(const c in u)u.hasOwnProperty(c)&&qi(l,c,u[c]);return}for(const c in s)s.hasOwnProperty(c)&&(u==null||!u.hasOwnProperty(c))&&(c.indexOf("--")===0?l.setProperty(c,""):c==="float"?l.cssFloat="":l[c]="");if(u!=null)for(const c in u){const f=u[c];u.hasOwnProperty(c)&&s[c]!==f&&qi(l,c,f)}}function qi(r,u,s){const l=u.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?r.setProperty(u,""):u==="float"?r.cssFloat="":r[u]="":l?r.setProperty(u,s):typeof s=="number"&&s!==0&&!Ns(u)?r[u]=s+"px":u==="float"?r.cssFloat=s:r[u]=(""+s).trim()}const Rs=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function Ns(r){return Rs.has(r)}function Ji(r){const u=r.getPaths(),s=[];for(let l=0;l<u.getLength();l++)s.push(u.getAt(l).getArray());return s}function Fs(r){var u,s,l;const{onClick:c,onDrag:f,onDragStart:p,onDragEnd:y,onMouseOver:w,onMouseOut:b,onPathsChanged:v,polygon:T,encodedPaths:E,paths:g,defaultPaths:M}=r,C=Lt(r,["onClick","onDrag","onDragStart","onDragEnd","onMouseOver","onMouseOut","onPathsChanged","polygon","encodedPaths","paths","defaultPaths"]),[P,O]=m.useState(null),I=ne(),A=Ue("geometry"),F=m.useRef(!1),W=ve(Object.assign(Object.assign({},C),{clickable:(u=C.clickable)!==null&&u!==void 0?u:!!c,draggable:(s=C.draggable)!==null&&s!==void 0?s:!!(f||p||y||v),editable:(l=C.editable)!==null&&l!==void 0?l:!!v}),ge);return m.useEffect(()=>{if(!I){I===void 0&&console.error("<Polygon> has to be inside a Map component.");return}let k;if(T){k=T;const D=g??M;D&&Array.isArray(D)&&k.setPaths(D),k.setOptions(W)}else{const D=g??M,q=Object.assign({},W);D&&Array.isArray(D)&&(q.paths=D),k=new google.maps.Polygon(q)}return k.setMap(I),O(k),()=>{k.setMap(null),O(null)}},[I,T]),X(P,"click",c),X(P,"drag",f),X(P,"dragstart",p),X(P,"mouseover",w),X(P,"mouseout",b),X(P,"dragend",k=>{y==null||y(k),v&&P&&!F.current&&v(Ji(P))}),m.useEffect(()=>{if(!P||!v)return;const k=[],D=P.getPaths();if(typeof D.getLength!="function"||typeof D.getAt!="function")return;const q=()=>{F.current||v(Ji(P))},et=j=>{k.push(google.maps.event.addListener(j,"insert_at",q)),k.push(google.maps.event.addListener(j,"remove_at",q)),k.push(google.maps.event.addListener(j,"set_at",q))};for(let j=0;j<D.getLength();j++)et(D.getAt(j));return k.push(google.maps.event.addListener(D,"insert_at",j=>{et(D.getAt(j)),q()})),k.push(google.maps.event.addListener(D,"set_at",j=>{et(D.getAt(j)),q()})),k.push(google.maps.event.addListener(D,"remove_at",q)),()=>{k.forEach(j=>j.remove())}},[P,v,g,E,W.editable,W.draggable]),m.useEffect(()=>{P&&P.setOptions(W)},[P,W]),m.useEffect(()=>{if(!P||!g||!Array.isArray(g))return;const k=g[0],D=Array.isArray(k)?g:[g],q=P.getPaths();cs(D,q)||(F.current=!0,P.setPaths(g),F.current=!1)},[P,g]),m.useEffect(()=>{if(!P||!E||!A)return;F.current=!0;const k=E.map(D=>A.encoding.decodePath(D));P.setPaths(k),F.current=!1},[P,E,A]),P}const Hs=m.forwardRef((r,u)=>{const s=Fs(r);return m.useImperativeHandle(u,()=>s,[s]),G.createElement(G.Fragment,null)});Hs.displayName="Polygon";function Ws(r){var u,s,l;const{onClick:c,onDrag:f,onDragStart:p,onDragEnd:y,onMouseOver:w,onMouseOut:b,onPathChanged:v,polyline:T,encodedPath:E,path:g,defaultPath:M}=r,C=Lt(r,["onClick","onDrag","onDragStart","onDragEnd","onMouseOver","onMouseOut","onPathChanged","polyline","encodedPath","path","defaultPath"]),[P,O]=m.useState(null),I=ne(),A=Ue("geometry"),F=m.useRef(!1),W=ve(Object.assign(Object.assign({},C),{clickable:(u=C.clickable)!==null&&u!==void 0?u:!!c,draggable:(s=C.draggable)!==null&&s!==void 0?s:!!(f||p||y||v),editable:(l=C.editable)!==null&&l!==void 0?l:!!v}),ge);return m.useEffect(()=>{if(!I){I===void 0&&console.error("<Polyline> has to be inside a Map component.");return}let k;if(T){k=T;const D=g??M;D&&Array.isArray(D)&&k.setPath(D),k.setOptions(W)}else{const D=g??M,q=Object.assign({},W);D&&Array.isArray(D)&&(q.path=D),k=new google.maps.Polyline(q)}return k.setMap(I),O(k),()=>{k.setMap(null),O(null)}},[I,T]),X(P,"click",c),X(P,"drag",f),X(P,"dragstart",p),X(P,"mouseover",w),X(P,"mouseout",b),X(P,"dragend",k=>{y==null||y(k),v&&P&&!F.current&&v(P.getPath().getArray())}),m.useEffect(()=>{if(!P||!v)return;const k=P.getPath();if(!k)return;const D=()=>{F.current||v(k.getArray())},q=[google.maps.event.addListener(k,"insert_at",D),google.maps.event.addListener(k,"remove_at",D),google.maps.event.addListener(k,"set_at",D)];return()=>{q.forEach(et=>et.remove())}},[P,v,g,E,W.editable,W.draggable]),m.useEffect(()=>{P&&P.setOptions(W)},[P,W]),m.useEffect(()=>{if(!P||!g)return;const k=P.getPath();eo(g,k)||(F.current=!0,P.setPath(g),F.current=!1)},[P,g]),m.useEffect(()=>{if(!P||!E||!A)return;F.current=!0;const k=A.encoding.decodePath(E);P.setPath(k),F.current=!1},[P,E,A]),P}const Us=m.forwardRef((r,u)=>{const s=Ws(r);return m.useImperativeHandle(u,()=>s,[s]),G.createElement(G.Fragment,null)});Us.displayName="Polyline";const Gs={center:{lat:0,lng:0,altitude:0},range:0,heading:0,tilt:0,roll:0},js=["center","range","heading","tilt","roll"];function Vs(r,u,s){const l=r[s];if(l!=null)if(s==="center"){const c=l;u.current.center=c.toJSON?c.toJSON():c}else u.current[s]=l}function qs(r){const u=io(),s=m.useRef(Object.assign({},Gs));return m.useEffect(()=>{if(!r)return;const l=[];for(const c of js){const f=`gmp-${c}change`,p=()=>{Vs(r,s,c),u()};r.addEventListener(f,p),l.push(()=>r.removeEventListener(f,p))}return()=>{for(const c of l)c()}},[r,u]),s}function Js(r){const u=Ue("maps3d"),[s,l]=m.useState(!1),[,c]=En(),[f,p]=En(),y=qs(f);return m.useEffect(()=>{customElements.whenDefined("gmp-map-3d").then(()=>{l(!0)})},[]),m.useEffect(()=>{if(!f)return;const{center:b,heading:v,tilt:T,range:E,roll:g,defaultCenter:M,defaultHeading:C,defaultTilt:P,defaultRange:O,defaultRoll:I,id:A,style:F,className:W,children:k,onCenterChanged:D,onHeadingChanged:q,onTiltChanged:et,onRangeChanged:j,onRollChanged:$,onCameraChanged:lt,onClick:Ut,onSteadyChange:xt,onAnimationEnd:In,onError:_t,mode:Gt,gestureHandling:R}=r,ye=Lt(r,["center","heading","tilt","range","roll","defaultCenter","defaultHeading","defaultTilt","defaultRange","defaultRoll","id","style","className","children","onCenterChanged","onHeadingChanged","onTiltChanged","onRangeChanged","onRollChanged","onCameraChanged","onClick","onSteadyChange","onAnimationEnd","onError","mode","gestureHandling"]),B=b??M,Q=v??C,ht=T??P,ct=E??O,nt=g??I,V=Object.assign({},ye);B&&(V.center=B),Q!==void 0&&(V.heading=Q),ht!==void 0&&(V.tilt=ht),ct!==void 0&&(V.range=ct),nt!==void 0&&(V.roll=nt),Object.assign(f,V)},[f]),[f,c,p,y,!!u&&s]}function Ks(r){return r?"toJSON"in r&&typeof r.toJSON=="function"?r.toJSON():r:null}function Ys(r,u,s){var l,c,f,p,y,w,b;const v=Ks(s.center),T=(l=v==null?void 0:v.lat)!==null&&l!==void 0?l:null,E=(c=v==null?void 0:v.lng)!==null&&c!==void 0?c:null,g=(f=v==null?void 0:v.altitude)!==null&&f!==void 0?f:null,M=(p=s.range)!==null&&p!==void 0?p:null,C=(y=s.heading)!==null&&y!==void 0?y:null,P=(w=s.tilt)!==null&&w!==void 0?w:null,O=(b=s.roll)!==null&&b!==void 0?b:null;m.useLayoutEffect(()=>{var I;if(!r)return;const A=u.current;T!==null&&E!==null&&(A.center.lat!==T||A.center.lng!==E||g!==null&&A.center.altitude!==g)&&(r.center={lat:T,lng:E,altitude:(I=g??A.center.altitude)!==null&&I!==void 0?I:0}),M!==null&&A.range!==M&&(r.range=M),C!==null&&A.heading!==C&&(r.heading=C),P!==null&&A.tilt!==P&&(r.tilt=P),O!==null&&A.roll!==O&&(r.roll=O)})}const Ki=["gmp-centerchange","gmp-headingchange","gmp-tiltchange","gmp-rangechange","gmp-rollchange"];function te(r,u){const s=r.center;let l;return s&&"toJSON"in s&&typeof s.toJSON=="function"?l=s.toJSON():s?l=s:l={lat:0,lng:0,altitude:0},{type:u,map3d:r,detail:{center:l,range:r.range||0,heading:r.heading||0,tilt:r.tilt||0,roll:r.roll||0}}}function Xs(r,u){const s=u;return{type:"gmp-click",map3d:r,detail:{position:u.position||null,placeId:s.placeId}}}function $s(r,u){return{type:"gmp-steadychange",map3d:r,detail:{isSteady:u.isSteady}}}function Qs(r,u){const{onCenterChanged:s,onHeadingChanged:l,onTiltChanged:c,onRangeChanged:f,onRollChanged:p,onCameraChanged:y,onClick:w,onSteadyChange:b,onAnimationEnd:v,onError:T}=u;Wt(r,"gmp-centerchange",s,te),Wt(r,"gmp-headingchange",l,te),Wt(r,"gmp-tiltchange",c,te),Wt(r,"gmp-rangechange",f,te),Wt(r,"gmp-rollchange",p,te),m.useEffect(()=>{if(!r||!y)return;const E=()=>{y(te(r,"camerachange"))};for(const g of Ki)r.addEventListener(g,E);return()=>{for(const g of Ki)r.removeEventListener(g,E)}},[r,y]),m.useEffect(()=>{if(!r||!w)return;const E=g=>{w(Xs(r,g))};return r.addEventListener("gmp-click",E),()=>r.removeEventListener("gmp-click",E)},[r,w]),m.useEffect(()=>{if(!r||!b)return;const E=g=>{b($s(r,g))};return r.addEventListener("gmp-steadychange",E),()=>r.removeEventListener("gmp-steadychange",E)},[r,b]),Wt(r,"gmp-animationend",v,(E,g)=>({type:g,map3d:E})),Wt(r,"gmp-error",T,(E,g)=>({type:g,map3d:E}))}function Wt(r,u,s,l){m.useEffect(()=>{if(!r||!s)return;const c=()=>{s(l(r,u))};return r.addEventListener(u,c),()=>r.removeEventListener(u,c)},[r,u,s,l])}const ta=new Set(["bounds","defaultUIHidden","gestureHandling","internalUsageAttributionIds","maxAltitude","maxHeading","maxTilt","minAltitude","minHeading","minTilt","mode"]);function ea(r,u){const s=m.useMemo(()=>{const l={},c=Object.keys(u);for(const f of c){if(!ta.has(f))continue;const p=u[f];p!==void 0&&(l[f]=p)}return l},[u]);$i(()=>{r&&Object.assign(r,s)},[r,s])}const na=G.createContext(null),ia={width:"100%",height:"100%",position:"relative"},oa=m.forwardRef((r,u)=>{const{children:s,id:l,className:c,style:f}=r,p=m.useContext(ee);if(!p)throw new Error("<Map3D> can only be used inside an <APIProvider> component.");const{addMap3DInstance:y,removeMap3DInstance:w}=p,[b,v,T,E,g]=Js(r);Ys(b,E,r),Qs(b,r),ea(b,r),m.useEffect(()=>{if(!b)return;const P=l??"default";return y(b,P),()=>{w(P)}},[b,l]),m.useImperativeHandle(u,()=>({map3d:b,flyCameraAround:P=>{b==null||b.flyCameraAround(P)},flyCameraTo:P=>{b==null||b.flyCameraTo(P)},stopCameraAnimation:()=>{b==null||b.stopCameraAnimation()}}),[b]);const M=m.useMemo(()=>Object.assign(Object.assign({},ia),f),[f]),C=m.useMemo(()=>({map3d:b}),[b]);return g?G.createElement("div",Object.assign({ref:v,"data-testid":"map-3d",style:c?void 0:M,className:c},l?{id:l}:{}),G.createElement("gmp-map-3d",{ref:T,style:{width:"100%",height:"100%"}},b&&G.createElement(na.Provider,{value:C},s))):G.createElement("div",Object.assign({ref:v,"data-testid":"map-3d",style:c?void 0:M,className:c},l?{id:l}:{}))});oa.displayName="Map3D";const ra=m.createContext(null),sa=m.forwardRef(function(u,s){const{children:l,onClick:c,position:f,altitudeMode:p,collisionBehavior:y,drawsWhenOccluded:w,extruded:b,label:v,sizePreserved:T,zIndex:E,title:g}=u,M=!!c,[C,P]=m.useState(null),[O,I]=m.useState(!1),A=m.useMemo(()=>{const k=document.createElement("div");return k.style.display="none",document.body.appendChild(k),k},[]);m.useEffect(()=>()=>A.remove(),[A]);const F=m.useCallback(k=>{P(k),typeof s=="function"?s(k):s&&(s.current=k)},[s]);Mn(C,"gmp-click",c),m.useLayoutEffect(()=>{if(O||!C||!A)return;for(;C.firstChild;)C.removeChild(C.firstChild);const k=Array.from(A.childNodes);for(const D of k){if(D.nodeType!==Node.ELEMENT_NODE)continue;const q=D,et=q.tagName.toLowerCase();if(et==="img"||et==="svg"){const j=document.createElement("template");j.content.appendChild(q.cloneNode(!0)),C.appendChild(j)}else C.appendChild(q.cloneNode(!0))}},[C,A,l,O]);const W=m.useMemo(()=>({marker:C,setContentHandledExternally:I}),[C]);return ut(C,"position",f),ut(C,"altitudeMode",p),ut(C,"collisionBehavior",y),ut(C,"drawsWhenOccluded",w),ut(C,"extruded",b),ut(C,"label",v),ut(C,"sizePreserved",T),ut(C,"zIndex",E),ut(C,"title",g??""),G.createElement(ra.Provider,{value:W},M?G.createElement("gmp-marker-3d-interactive",{ref:F}):G.createElement("gmp-marker-3d",{ref:F}),Yi.createPortal(l,A))});sa.displayName="Marker3D";const aa=m.forwardRef(function(u,s){var l;const{children:c,headerContent:f,style:p,className:y,open:w=!0,position:b,anchor:v,anchorId:T,altitudeMode:E,lightDismissDisabled:g,autoPanDisabled:M,onClose:C}=u,[P,O]=m.useState(null),I=m.useRef(null);m.useImperativeHandle(s,()=>P,[P]),ua(P,w,C),ut(P,"open",w??!1),ut(P,"altitudeMode",E),ut(P,"lightDismissDisabled",g),ut(P,"autoPanDisabled",M);const A=(l=v??T)!==null&&l!==void 0?l:b;return ut(P,"positionAnchor",A),m.useLayoutEffect(()=>{P&&(Ds(P,p||null,I.current),I.current=p||null)},[P,p]),G.createElement("gmp-popover",{ref:O,className:y},f&&G.createElement("div",{slot:"header"},f),c)});aa.displayName="Popover";function ua(r,u,s){const l=m.useRef(void 0),c=m.useRef(u);m.useEffect(()=>{c.current=u},[u]),m.useEffect(()=>{if(!r||!s)return;const f=new MutationObserver(p=>{for(const y of p)if(y.type==="attributes"&&y.attributeName==="open"){const w=r.hasAttribute("open");l.current===!0&&!w&&c.current!==!1&&s(),l.current=w}});return f.observe(r,{attributes:!0,attributeFilter:["open"]}),l.current=r.hasAttribute("open"),()=>{f.disconnect()}},[r,s])}function la(r){const[u,s]=m.useState(null),l=ne(),{onClick:c,onDrag:f,onDragStart:p,onDragEnd:y,onMouseOver:w,onMouseOut:b}=r,v=Lt(r,["onClick","onDrag","onDragStart","onDragEnd","onMouseOver","onMouseOut"]),{position:T,draggable:E}=v;return m.useEffect(()=>{if(!l){l===void 0&&console.error("<Marker> has to be inside a Map component.");return}const g=new google.maps.Marker(v);return g.setMap(l),s(g),()=>{g.setMap(null),s(null)}},[l]),m.useEffect(()=>{if(!u)return;const g=u,M=google.maps.event;return c&&M.addListener(g,"click",c),f&&M.addListener(g,"drag",f),p&&M.addListener(g,"dragstart",p),y&&M.addListener(g,"dragend",y),w&&M.addListener(g,"mouseover",w),b&&M.addListener(g,"mouseout",b),u.setDraggable(!!E),()=>{M.clearInstanceListeners(g)}},[u,E,c,f,p,y,w,b]),m.useEffect(()=>{u&&v&&u.setOptions(v)},[u,v]),m.useEffect(()=>{E||!T||!u||u.setPosition(T)},[E,T,u]),u}const ha=m.forwardRef((r,u)=>{const s=la(r);return m.useImperativeHandle(u,()=>s,[s]),G.createElement(G.Fragment,null)});ha.displayName="Marker";function ca(r){var u,s,l;const{onClick:c,onDrag:f,onDragStart:p,onDragEnd:y,onMouseOver:w,onMouseOut:b,onBoundsChanged:v,bounds:T,defaultBounds:E}=r,g=Lt(r,["onClick","onDrag","onDragStart","onDragEnd","onMouseOver","onMouseOut","onBoundsChanged","bounds","defaultBounds"]),[M,C]=m.useState(null),P=ne(),O=ve(Object.assign(Object.assign({},g),{clickable:(u=g.clickable)!==null&&u!==void 0?u:!!c,draggable:(s=g.draggable)!==null&&s!==void 0?s:!!(f||p||y||v),editable:(l=g.editable)!==null&&l!==void 0?l:!!v}),ge);return m.useEffect(()=>{if(!P){P===void 0&&console.error("<Rectangle> has to be inside a Map component.");return}const I=new google.maps.Rectangle(Object.assign(Object.assign({},O),{bounds:T??E}));return I.setMap(P),C(I),()=>{I.setMap(null),C(null)}},[P]),X(M,"click",c),X(M,"drag",f),X(M,"dragstart",p),X(M,"dragend",y),X(M,"mouseover",w),X(M,"mouseout",b),X(M,"bounds_changed",v?()=>{v(M==null?void 0:M.getBounds())}:null),m.useEffect(()=>{M&&M.setOptions(O)},[M,O]),m.useEffect(()=>{!M||!T||hs(T,M.getBounds())||M.setBounds(T)},[M,T]),M}const da=m.forwardRef((r,u)=>{const s=ca(r);return m.useImperativeHandle(u,()=>s,[s]),G.createElement(G.Fragment,null)});da.displayName="Rectangle";function fa(r,u){const s=m.useRef(u);m.useEffect(function(){u!==s.current&&r.attributionControl!=null&&(s.current!=null&&r.attributionControl.removeAttribution(s.current),u!=null&&r.attributionControl.addAttribution(u)),s.current=u},[r,u])}const _a=1;function ma(r){return Object.freeze({__version:_a,map:r})}const so=m.createContext(null),pa=so.Provider;function ga(){const r=m.useContext(so);if(r==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return r}function va(r){function u(s,l){const{instance:c}=r(s).current;return m.useImperativeHandle(l,()=>c),null}return m.forwardRef(u)}function ya(r,u){const s=m.useRef();m.useEffect(function(){return u!=null&&r.instance.on(u),s.current=u,function(){s.current!=null&&r.instance.off(s.current),s.current=null}},[r,u])}function ao(r,u){const s=r.pane??u.pane;return s?{...r,pane:s}:r}var Sn={exports:{}};/* @preserve
 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
 */(function(r,u){(function(s,l){l(u)})(Br,function(s){var l="1.9.4";function c(t){var e,n,i,o;for(n=1,i=arguments.length;n<i;n++){o=arguments[n];for(e in o)t[e]=o[e]}return t}var f=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function p(t,e){var n=Array.prototype.slice;if(t.bind)return t.bind.apply(t,n.call(arguments,1));var i=n.call(arguments,2);return function(){return t.apply(e,i.length?i.concat(n.call(arguments)):arguments)}}var y=0;function w(t){return"_leaflet_id"in t||(t._leaflet_id=++y),t._leaflet_id}function b(t,e,n){var i,o,a,h;return h=function(){i=!1,o&&(a.apply(n,o),o=!1)},a=function(){i?o=arguments:(t.apply(n,arguments),setTimeout(h,e),i=!0)},a}function v(t,e,n){var i=e[1],o=e[0],a=i-o;return t===i&&n?t:((t-o)%a+a)%a+o}function T(){return!1}function E(t,e){if(e===!1)return t;var n=Math.pow(10,e===void 0?6:e);return Math.round(t*n)/n}function g(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function M(t){return g(t).split(/\s+/)}function C(t,e){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?f(t.options):{});for(var n in e)t.options[n]=e[n];return t.options}function P(t,e,n){var i=[];for(var o in t)i.push(encodeURIComponent(n?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(!e||e.indexOf("?")===-1?"?":"&")+i.join("&")}var O=/\{ *([\w_ -]+) *\}/g;function I(t,e){return t.replace(O,function(n,i){var o=e[i];if(o===void 0)throw new Error("No value provided for variable "+n);return typeof o=="function"&&(o=o(e)),o})}var A=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function F(t,e){for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}var W="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function k(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var D=0;function q(t){var e=+new Date,n=Math.max(0,16-(e-D));return D=e+n,window.setTimeout(t,n)}var et=window.requestAnimationFrame||k("RequestAnimationFrame")||q,j=window.cancelAnimationFrame||k("CancelAnimationFrame")||k("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function $(t,e,n){if(n&&et===q)t.call(e);else return et.call(window,p(t,e))}function lt(t){t&&j.call(window,t)}var Ut={__proto__:null,extend:c,create:f,bind:p,get lastId(){return y},stamp:w,throttle:b,wrapNum:v,falseFn:T,formatNum:E,trim:g,splitWords:M,setOptions:C,getParamString:P,template:I,isArray:A,indexOf:F,emptyImageUrl:W,requestFn:et,cancelFn:j,requestAnimFrame:$,cancelAnimFrame:lt};function xt(){}xt.extend=function(t){var e=function(){C(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},n=e.__super__=this.prototype,i=f(n);i.constructor=e,e.prototype=i;for(var o in this)Object.prototype.hasOwnProperty.call(this,o)&&o!=="prototype"&&o!=="__super__"&&(e[o]=this[o]);return t.statics&&c(e,t.statics),t.includes&&(In(t.includes),c.apply(null,[i].concat(t.includes))),c(i,t),delete i.statics,delete i.includes,i.options&&(i.options=n.options?f(n.options):{},c(i.options,t.options)),i._initHooks=[],i.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var a=0,h=i._initHooks.length;a<h;a++)i._initHooks[a].call(this)}},e},xt.include=function(t){var e=this.prototype.options;return c(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},xt.mergeOptions=function(t){return c(this.prototype.options,t),this},xt.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),n=typeof t=="function"?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};function In(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=A(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var _t={on:function(t,e,n){if(typeof t=="object")for(var i in t)this._on(i,t[i],e);else{t=M(t);for(var o=0,a=t.length;o<a;o++)this._on(t[o],e,n)}return this},off:function(t,e,n){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var i in t)this._off(i,t[i],e);else{t=M(t);for(var o=arguments.length===1,a=0,h=t.length;a<h;a++)o?this._off(t[a]):this._off(t[a],e,n)}return this},_on:function(t,e,n,i){if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}if(this._listens(t,e,n)===!1){n===this&&(n=void 0);var o={fn:e,ctx:n};i&&(o.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(o)}},_off:function(t,e,n){var i,o,a;if(this._events&&(i=this._events[t],!!i)){if(arguments.length===1){if(this._firingCount)for(o=0,a=i.length;o<a;o++)i[o].fn=T;delete this._events[t];return}if(typeof e!="function"){console.warn("wrong listener type: "+typeof e);return}var h=this._listens(t,e,n);if(h!==!1){var d=i[h];this._firingCount&&(d.fn=T,this._events[t]=i=i.slice()),i.splice(h,1)}}},fire:function(t,e,n){if(!this.listens(t,n))return this;var i=c({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var a=0,h=o.length;a<h;a++){var d=o[a],_=d.fn;d.once&&this.off(t,_,d.ctx),_.call(d.ctx||this,i)}this._firingCount--}}return n&&this._propagateEvent(i),this},listens:function(t,e,n,i){typeof t!="string"&&console.warn('"string" type argument expected');var o=e;typeof e!="function"&&(i=!!e,o=void 0,n=void 0);var a=this._events&&this._events[t];if(a&&a.length&&this._listens(t,o,n)!==!1)return!0;if(i){for(var h in this._eventParents)if(this._eventParents[h].listens(t,e,n,i))return!0}return!1},_listens:function(t,e,n){if(!this._events)return!1;var i=this._events[t]||[];if(!e)return!!i.length;n===this&&(n=void 0);for(var o=0,a=i.length;o<a;o++)if(i[o].fn===e&&i[o].ctx===n)return o;return!1},once:function(t,e,n){if(typeof t=="object")for(var i in t)this._on(i,t[i],e,!0);else{t=M(t);for(var o=0,a=t.length;o<a;o++)this._on(t[o],e,n,!0)}return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[w(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[w(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,c({layer:t.target,propagatedFrom:t.target},t),!0)}};_t.addEventListener=_t.on,_t.removeEventListener=_t.clearAllEventListeners=_t.off,_t.addOneTimeEventListener=_t.once,_t.fireEvent=_t.fire,_t.hasEventListeners=_t.listens;var Gt=xt.extend(_t);function R(t,e,n){this.x=n?Math.round(t):t,this.y=n?Math.round(e):e}var ye=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};R.prototype={clone:function(){return new R(this.x,this.y)},add:function(t){return this.clone()._add(B(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(B(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new R(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new R(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=ye(this.x),this.y=ye(this.y),this},distanceTo:function(t){t=B(t);var e=t.x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return t=B(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=B(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+E(this.x)+", "+E(this.y)+")"}};function B(t,e,n){return t instanceof R?t:A(t)?new R(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new R(t.x,t.y):new R(t,e,n)}function Q(t,e){if(t)for(var n=e?[t,e]:t,i=0,o=n.length;i<o;i++)this.extend(n[i])}Q.prototype={extend:function(t){var e,n;if(!t)return this;if(t instanceof R||typeof t[0]=="number"||"x"in t)e=n=B(t);else if(t=ht(t),e=t.min,n=t.max,!e||!n)return this;return!this.min&&!this.max?(this.min=e.clone(),this.max=n.clone()):(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)),this},getCenter:function(t){return B((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return B(this.min.x,this.max.y)},getTopRight:function(){return B(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return typeof t[0]=="number"||t instanceof R?t=B(t):t=ht(t),t instanceof Q?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=ht(t);var e=this.min,n=this.max,i=t.min,o=t.max,a=o.x>=e.x&&i.x<=n.x,h=o.y>=e.y&&i.y<=n.y;return a&&h},overlaps:function(t){t=ht(t);var e=this.min,n=this.max,i=t.min,o=t.max,a=o.x>e.x&&i.x<n.x,h=o.y>e.y&&i.y<n.y;return a&&h},isValid:function(){return!!(this.min&&this.max)},pad:function(t){var e=this.min,n=this.max,i=Math.abs(e.x-n.x)*t,o=Math.abs(e.y-n.y)*t;return ht(B(e.x-i,e.y-o),B(n.x+i,n.y+o))},equals:function(t){return t?(t=ht(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function ht(t,e){return!t||t instanceof Q?t:new Q(t,e)}function ct(t,e){if(t)for(var n=e?[t,e]:t,i=0,o=n.length;i<o;i++)this.extend(n[i])}ct.prototype={extend:function(t){var e=this._southWest,n=this._northEast,i,o;if(t instanceof V)i=t,o=t;else if(t instanceof ct){if(i=t._southWest,o=t._northEast,!i||!o)return this}else return t?this.extend(J(t)||nt(t)):this;return!e&&!n?(this._southWest=new V(i.lat,i.lng),this._northEast=new V(o.lat,o.lng)):(e.lat=Math.min(i.lat,e.lat),e.lng=Math.min(i.lng,e.lng),n.lat=Math.max(o.lat,n.lat),n.lng=Math.max(o.lng,n.lng)),this},pad:function(t){var e=this._southWest,n=this._northEast,i=Math.abs(e.lat-n.lat)*t,o=Math.abs(e.lng-n.lng)*t;return new ct(new V(e.lat-i,e.lng-o),new V(n.lat+i,n.lng+o))},getCenter:function(){return new V((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new V(this.getNorth(),this.getWest())},getSouthEast:function(){return new V(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){typeof t[0]=="number"||t instanceof V||"lat"in t?t=J(t):t=nt(t);var e=this._southWest,n=this._northEast,i,o;return t instanceof ct?(i=t.getSouthWest(),o=t.getNorthEast()):i=o=t,i.lat>=e.lat&&o.lat<=n.lat&&i.lng>=e.lng&&o.lng<=n.lng},intersects:function(t){t=nt(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast(),a=o.lat>=e.lat&&i.lat<=n.lat,h=o.lng>=e.lng&&i.lng<=n.lng;return a&&h},overlaps:function(t){t=nt(t);var e=this._southWest,n=this._northEast,i=t.getSouthWest(),o=t.getNorthEast(),a=o.lat>e.lat&&i.lat<n.lat,h=o.lng>e.lng&&i.lng<n.lng;return a&&h},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return t?(t=nt(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function nt(t,e){return t instanceof ct?t:new ct(t,e)}function V(t,e,n){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,n!==void 0&&(this.alt=+n)}V.prototype={equals:function(t,e){if(!t)return!1;t=J(t);var n=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return n<=(e===void 0?1e-9:e)},toString:function(t){return"LatLng("+E(this.lat,t)+", "+E(this.lng,t)+")"},distanceTo:function(t){return At.distance(this,J(t))},wrap:function(){return At.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return nt([this.lat-e,this.lng-n],[this.lat+e,this.lng+n])},clone:function(){return new V(this.lat,this.lng,this.alt)}};function J(t,e,n){return t instanceof V?t:A(t)&&typeof t[0]!="object"?t.length===3?new V(t[0],t[1],t[2]):t.length===2?new V(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new V(t.lat,"lng"in t?t.lng:t.lon,t.alt):e===void 0?null:new V(t,e,n)}var Mt={latLngToPoint:function(t,e){var n=this.projection.project(t),i=this.scale(e);return this.transformation._transform(n,i)},pointToLatLng:function(t,e){var n=this.scale(e),i=this.transformation.untransform(t,n);return this.projection.unproject(i)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,n=this.scale(t),i=this.transformation.transform(e.min,n),o=this.transformation.transform(e.max,n);return new Q(i,o)},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?v(t.lng,this.wrapLng,!0):t.lng,n=this.wrapLat?v(t.lat,this.wrapLat,!0):t.lat,i=t.alt;return new V(n,e,i)},wrapLatLngBounds:function(t){var e=t.getCenter(),n=this.wrapLatLng(e),i=e.lat-n.lat,o=e.lng-n.lng;if(i===0&&o===0)return t;var a=t.getSouthWest(),h=t.getNorthEast(),d=new V(a.lat-i,a.lng-o),_=new V(h.lat-i,h.lng-o);return new ct(d,_)}},At=c({},Mt,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var n=Math.PI/180,i=t.lat*n,o=e.lat*n,a=Math.sin((e.lat-t.lat)*n/2),h=Math.sin((e.lng-t.lng)*n/2),d=a*a+Math.cos(i)*Math.cos(o)*h*h,_=2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d));return this.R*_}}),An=6378137,Ge={R:An,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,n=this.MAX_LATITUDE,i=Math.max(Math.min(n,t.lat),-n),o=Math.sin(i*e);return new R(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new V((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:function(){var t=An*Math.PI;return new Q([-t,-t],[t,t])}()};function je(t,e,n,i){if(A(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=n,this._d=i}je.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new R((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};function ie(t,e,n,i){return new je(t,e,n,i)}var Ve=c({},At,{code:"EPSG:3857",projection:Ge,transformation:function(){var t=.5/(Math.PI*Ge.R);return ie(t,.5,-t,.5)}()}),lo=c({},Ve,{code:"EPSG:900913"});function zn(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Zn(t,e){var n="",i,o,a,h,d,_;for(i=0,a=t.length;i<a;i++){for(d=t[i],o=0,h=d.length;o<h;o++)_=d[o],n+=(o?"L":"M")+_.x+" "+_.y;n+=e?z.svg?"z":"x":""}return n||"M0 0"}var qe=document.documentElement.style,we="ActiveXObject"in window,ho=we&&!document.addEventListener,Bn="msLaunchUri"in navigator&&!("documentMode"in document),Je=bt("webkit"),Dn=bt("android"),Rn=bt("android 2")||bt("android 3"),co=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),fo=Dn&&bt("Google")&&co<537&&!("AudioNode"in window),Ke=!!window.opera,Nn=!Bn&&bt("chrome"),Fn=bt("gecko")&&!Je&&!Ke&&!we,_o=!Nn&&bt("safari"),Hn=bt("phantom"),Wn="OTransition"in qe,mo=navigator.platform.indexOf("Win")===0,Un=we&&"transition"in qe,Ye="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Rn,Gn="MozPerspective"in qe,po=!window.L_DISABLE_3D&&(Un||Ye||Gn)&&!Wn&&!Hn,oe=typeof orientation<"u"||bt("mobile"),go=oe&&Je,vo=oe&&Ye,jn=!window.PointerEvent&&window.MSPointerEvent,Vn=!!(window.PointerEvent||jn),qn="ontouchstart"in window||!!window.TouchEvent,yo=!window.L_NO_TOUCH&&(qn||Vn),wo=oe&&Ke,Po=oe&&Fn,Lo=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,xo=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",T,e),window.removeEventListener("testPassiveEventSupport",T,e)}catch{}return t}(),bo=function(){return!!document.createElement("canvas").getContext}(),Xe=!!(document.createElementNS&&zn("svg").createSVGRect),To=!!Xe&&function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Co=!Xe&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&typeof e.adj=="object"}catch{return!1}}(),Eo=navigator.platform.indexOf("Mac")===0,Mo=navigator.platform.indexOf("Linux")===0;function bt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var z={ie:we,ielt9:ho,edge:Bn,webkit:Je,android:Dn,android23:Rn,androidStock:fo,opera:Ke,chrome:Nn,gecko:Fn,safari:_o,phantom:Hn,opera12:Wn,win:mo,ie3d:Un,webkit3d:Ye,gecko3d:Gn,any3d:po,mobile:oe,mobileWebkit:go,mobileWebkit3d:vo,msPointer:jn,pointer:Vn,touch:yo,touchNative:qn,mobileOpera:wo,mobileGecko:Po,retina:Lo,passiveEvents:xo,canvas:bo,svg:Xe,vml:Co,inlineSvg:To,mac:Eo,linux:Mo},Jn=z.msPointer?"MSPointerDown":"pointerdown",Kn=z.msPointer?"MSPointerMove":"pointermove",Yn=z.msPointer?"MSPointerUp":"pointerup",Xn=z.msPointer?"MSPointerCancel":"pointercancel",$e={touchstart:Jn,touchmove:Kn,touchend:Yn,touchcancel:Xn},$n={touchstart:zo,touchmove:Pe,touchend:Pe,touchcancel:Pe},jt={},Qn=!1;function Oo(t,e,n){return e==="touchstart"&&Ao(),$n[e]?(n=$n[e].bind(this,n),t.addEventListener($e[e],n,!1),n):(console.warn("wrong event specified:",e),T)}function So(t,e,n){if(!$e[e]){console.warn("wrong event specified:",e);return}t.removeEventListener($e[e],n,!1)}function ko(t){jt[t.pointerId]=t}function Io(t){jt[t.pointerId]&&(jt[t.pointerId]=t)}function ti(t){delete jt[t.pointerId]}function Ao(){Qn||(document.addEventListener(Jn,ko,!0),document.addEventListener(Kn,Io,!0),document.addEventListener(Yn,ti,!0),document.addEventListener(Xn,ti,!0),Qn=!0)}function Pe(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var n in jt)e.touches.push(jt[n]);e.changedTouches=[e],t(e)}}function zo(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&dt(e),Pe(t,e)}function Zo(t){var e={},n,i;for(i in t)n=t[i],e[i]=n&&n.bind?n.bind(t):n;return t=e,e.type="dblclick",e.detail=2,e.isTrusted=!1,e._simulated=!0,e}var Bo=200;function Do(t,e){t.addEventListener("dblclick",e);var n=0,i;function o(a){if(a.detail!==1){i=a.detail;return}if(!(a.pointerType==="mouse"||a.sourceCapabilities&&!a.sourceCapabilities.firesTouchEvents)){var h=ri(a);if(!(h.some(function(_){return _ instanceof HTMLLabelElement&&_.attributes.for})&&!h.some(function(_){return _ instanceof HTMLInputElement||_ instanceof HTMLSelectElement}))){var d=Date.now();d-n<=Bo?(i++,i===2&&e(Zo(a))):i=1,n=d}}}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function Ro(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var Qe=be(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),re=be(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ei=re==="webkitTransition"||re==="OTransition"?re+"End":"transitionend";function ni(t){return typeof t=="string"?document.getElementById(t):t}function se(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||n==="auto")&&document.defaultView){var i=document.defaultView.getComputedStyle(t,null);n=i?i[e]:null}return n==="auto"?null:n}function Y(t,e,n){var i=document.createElement(t);return i.className=e||"",n&&n.appendChild(i),i}function it(t){var e=t.parentNode;e&&e.removeChild(t)}function Le(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Vt(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function qt(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function tn(t,e){if(t.classList!==void 0)return t.classList.contains(e);var n=xe(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function H(t,e){if(t.classList!==void 0)for(var n=M(e),i=0,o=n.length;i<o;i++)t.classList.add(n[i]);else if(!tn(t,e)){var a=xe(t);en(t,(a?a+" ":"")+e)}}function ot(t,e){t.classList!==void 0?t.classList.remove(e):en(t,g((" "+xe(t)+" ").replace(" "+e+" "," ")))}function en(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e}function xe(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function pt(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&No(t,e)}function No(t,e){var n=!1,i="DXImageTransform.Microsoft.Alpha";try{n=t.filters.item(i)}catch{if(e===1)return}e=Math.round(e*100),n?(n.Enabled=e!==100,n.Opacity=e):t.style.filter+=" progid:"+i+"(opacity="+e+")"}function be(t){for(var e=document.documentElement.style,n=0;n<t.length;n++)if(t[n]in e)return t[n];return!1}function Dt(t,e,n){var i=e||new R(0,0);t.style[Qe]=(z.ie3d?"translate("+i.x+"px,"+i.y+"px)":"translate3d("+i.x+"px,"+i.y+"px,0)")+(n?" scale("+n+")":"")}function rt(t,e){t._leaflet_pos=e,z.any3d?Dt(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Rt(t){return t._leaflet_pos||new R(0,0)}var ae,ue,nn;if("onselectstart"in document)ae=function(){N(window,"selectstart",dt)},ue=function(){tt(window,"selectstart",dt)};else{var le=be(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);ae=function(){if(le){var t=document.documentElement.style;nn=t[le],t[le]="none"}},ue=function(){le&&(document.documentElement.style[le]=nn,nn=void 0)}}function on(){N(window,"dragstart",dt)}function rn(){tt(window,"dragstart",dt)}var Te,sn;function an(t){for(;t.tabIndex===-1;)t=t.parentNode;t.style&&(Ce(),Te=t,sn=t.style.outlineStyle,t.style.outlineStyle="none",N(window,"keydown",Ce))}function Ce(){Te&&(Te.style.outlineStyle=sn,Te=void 0,sn=void 0,tt(window,"keydown",Ce))}function ii(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function un(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Fo={__proto__:null,TRANSFORM:Qe,TRANSITION:re,TRANSITION_END:ei,get:ni,getStyle:se,create:Y,remove:it,empty:Le,toFront:Vt,toBack:qt,hasClass:tn,addClass:H,removeClass:ot,setClass:en,getClass:xe,setOpacity:pt,testProp:be,setTransform:Dt,setPosition:rt,getPosition:Rt,get disableTextSelection(){return ae},get enableTextSelection(){return ue},disableImageDrag:on,enableImageDrag:rn,preventOutline:an,restoreOutline:Ce,getSizedParentNode:ii,getScale:un};function N(t,e,n,i){if(e&&typeof e=="object")for(var o in e)hn(t,o,e[o],n);else{e=M(e);for(var a=0,h=e.length;a<h;a++)hn(t,e[a],n,i)}return this}var Tt="_leaflet_events";function tt(t,e,n,i){if(arguments.length===1)oi(t),delete t[Tt];else if(e&&typeof e=="object")for(var o in e)cn(t,o,e[o],n);else if(e=M(e),arguments.length===2)oi(t,function(d){return F(e,d)!==-1});else for(var a=0,h=e.length;a<h;a++)cn(t,e[a],n,i);return this}function oi(t,e){for(var n in t[Tt]){var i=n.split(/\d/)[0];(!e||e(i))&&cn(t,i,null,null,n)}}var ln={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function hn(t,e,n,i){var o=e+w(n)+(i?"_"+w(i):"");if(t[Tt]&&t[Tt][o])return this;var a=function(d){return n.call(i||t,d||window.event)},h=a;!z.touchNative&&z.pointer&&e.indexOf("touch")===0?a=Oo(t,e,a):z.touch&&e==="dblclick"?a=Do(t,a):"addEventListener"in t?e==="touchstart"||e==="touchmove"||e==="wheel"||e==="mousewheel"?t.addEventListener(ln[e]||e,a,z.passiveEvents?{passive:!1}:!1):e==="mouseenter"||e==="mouseleave"?(a=function(d){d=d||window.event,fn(t,d)&&h(d)},t.addEventListener(ln[e],a,!1)):t.addEventListener(e,h,!1):t.attachEvent("on"+e,a),t[Tt]=t[Tt]||{},t[Tt][o]=a}function cn(t,e,n,i,o){o=o||e+w(n)+(i?"_"+w(i):"");var a=t[Tt]&&t[Tt][o];if(!a)return this;!z.touchNative&&z.pointer&&e.indexOf("touch")===0?So(t,e,a):z.touch&&e==="dblclick"?Ro(t,a):"removeEventListener"in t?t.removeEventListener(ln[e]||e,a,!1):t.detachEvent("on"+e,a),t[Tt][o]=null}function Nt(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function dn(t){return hn(t,"wheel",Nt),this}function he(t){return N(t,"mousedown touchstart dblclick contextmenu",Nt),t._leaflet_disable_click=!0,this}function dt(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ft(t){return dt(t),Nt(t),this}function ri(t){if(t.composedPath)return t.composedPath();for(var e=[],n=t.target;n;)e.push(n),n=n.parentNode;return e}function si(t,e){if(!e)return new R(t.clientX,t.clientY);var n=un(e),i=n.boundingClientRect;return new R((t.clientX-i.left)/n.x-e.clientLeft,(t.clientY-i.top)/n.y-e.clientTop)}var Ho=z.linux&&z.chrome?window.devicePixelRatio:z.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function ai(t){return z.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/Ho:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function fn(t,e){var n=e.relatedTarget;if(!n)return!0;try{for(;n&&n!==t;)n=n.parentNode}catch{return!1}return n!==t}var Wo={__proto__:null,on:N,off:tt,stopPropagation:Nt,disableScrollPropagation:dn,disableClickPropagation:he,preventDefault:dt,stop:Ft,getPropagationPath:ri,getMousePosition:si,getWheelDelta:ai,isExternalTarget:fn,addListener:N,removeListener:tt},ui=Gt.extend({run:function(t,e,n,i){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(i||.5,.2),this._startPos=Rt(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=$(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=this._duration*1e3;e<n?this._runFrame(this._easeOut(e/n),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var n=this._startPos.add(this._offset.multiplyBy(t));e&&n._round(),rt(this._el,n),this.fire("step")},_complete:function(){lt(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),K=Gt.extend({options:{crs:Ve,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},initialize:function(t,e){e=C(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=p(this._onResize,this),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(J(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=re&&z.any3d&&!z.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),N(this._proxy,ei,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,n){if(e=e===void 0?this._zoom:this._limitZoom(e),t=this._limitCenter(J(t),e,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&n!==!0){n.animate!==void 0&&(n.zoom=c({animate:n.animate},n.zoom),n.pan=c({animate:n.animate,duration:n.duration},n.pan));var i=this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan);if(i)return clearTimeout(this._sizeTimer),this}return this._resetView(t,e,n.pan&&n.pan.noMoveStart),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(z.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(z.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,n){var i=this.getZoomScale(e),o=this.getSize().divideBy(2),a=t instanceof R?t:this.latLngToContainerPoint(t),h=a.subtract(o).multiplyBy(1-1/i),d=this.containerPointToLatLng(o.add(h));return this.setView(d,e,{zoom:n})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():nt(t);var n=B(e.paddingTopLeft||e.padding||[0,0]),i=B(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,n.add(i));if(o=typeof e.maxZoom=="number"?Math.min(e.maxZoom,o):o,o===1/0)return{center:t.getCenter(),zoom:o};var a=i.subtract(n).divideBy(2),h=this.project(t.getSouthWest(),o),d=this.project(t.getNorthEast(),o),_=this.unproject(h.add(d).divideBy(2).add(a),o);return{center:_,zoom:o}},fitBounds:function(t,e){if(t=nt(t),!t.isValid())throw new Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(t,e);return this.setView(n.center,n.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(t=B(t).round(),e=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 ui,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),e.animate!==!1){H(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,n,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,n){if(n=n||{},n.animate===!1||!z.any3d)return this.setView(t,e,n);this._stop();var i=this.project(this.getCenter()),o=this.project(t),a=this.getSize(),h=this._zoom;t=J(t),e=e===void 0?h:e;var d=Math.max(a.x,a.y),_=d*this.getZoomScale(h,e),x=o.distanceTo(i)||1,S=1.42,Z=S*S;function U(st){var Re=st?-1:1,Sr=st?_:d,kr=_*_-d*d+Re*Z*Z*x*x,Ir=2*Sr*Z*x,bn=kr/Ir,Wi=Math.sqrt(bn*bn+1)-bn,Ar=Wi<1e-9?-18:Math.log(Wi);return Ar}function ft(st){return(Math.exp(st)-Math.exp(-st))/2}function at(st){return(Math.exp(st)+Math.exp(-st))/2}function vt(st){return ft(st)/at(st)}var mt=U(0);function Qt(st){return d*(at(mt)/at(mt+S*st))}function Cr(st){return d*(at(mt)*vt(mt+S*st)-ft(mt))/Z}function Er(st){return 1-Math.pow(1-st,1.5)}var Mr=Date.now(),Fi=(U(1)-mt)/S,Or=n.duration?1e3*n.duration:1e3*Fi*.8;function Hi(){var st=(Date.now()-Mr)/Or,Re=Er(st)*Fi;st<=1?(this._flyToFrame=$(Hi,this),this._move(this.unproject(i.add(o.subtract(i).multiplyBy(Cr(Re)/x)),h),this.getScaleZoom(d/Qt(Re),h),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),Hi.call(this),this},flyToBounds:function(t,e){var n=this._getBoundsCenterZoom(t,e);return this.flyTo(n.center,n.zoom,e)},setMaxBounds:function(t){return t=nt(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:function(t){var 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:function(t){var 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:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),i=this._limitCenter(n,this._zoom,nt(t));return n.equals(i)||this.panTo(i,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var n=B(e.paddingTopLeft||e.padding||[0,0]),i=B(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),a=this.project(t),h=this.getPixelBounds(),d=ht([h.min.add(n),h.max.subtract(i)]),_=d.getSize();if(!d.contains(a)){this._enforcingBounds=!0;var x=a.subtract(d.getCenter()),S=d.extend(a).getSize().subtract(_);o.x+=x.x<0?-S.x:S.x,o.y+=x.y<0?-S.y:S.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=c({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),i=e.divideBy(2).round(),o=n.divideBy(2).round(),a=i.subtract(o);return!a.x&&!a.y?this:(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(p(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:n}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=c({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=p(this._handleGeolocationResponse,this),n=p(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,n,t):navigator.geolocation.getCurrentPosition(e,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,n=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: "+n+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=t.coords.latitude,n=t.coords.longitude,i=new V(e,n),o=i.toBounds(t.coords.accuracy*2),a=this._locateOptions;if(a.setView){var h=this.getBoundsZoom(o);this.setView(i,a.maxZoom?Math.min(h,a.maxZoom):h)}var d={latlng:i,bounds:o,timestamp:t.timestamp};for(var _ in t.coords)typeof t.coords[_]=="number"&&(d[_]=t.coords[_]);this.fire("locationfound",d)}},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),it(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(lt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)it(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),i=Y("div",n,e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),n=this.unproject(t.getTopRight());return new ct(e,n)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=nt(t),n=B(n||[0,0]);var i=this.getZoom()||0,o=this.getMinZoom(),a=this.getMaxZoom(),h=t.getNorthWest(),d=t.getSouthEast(),_=this.getSize().subtract(n),x=ht(this.project(d,i),this.project(h,i)).getSize(),S=z.any3d?this.options.zoomSnap:1,Z=_.x/x.x,U=_.y/x.y,ft=e?Math.max(Z,U):Math.min(Z,U);return i=this.getScaleZoom(ft,i),S&&(i=Math.round(i/(S/100))*(S/100),i=e?Math.ceil(i/S)*S:Math.floor(i/S)*S),Math.max(o,Math.min(a,i))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new R(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new Q(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=e===void 0?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=e===void 0?this._zoom:e;var i=n.zoom(t*n.scale(e));return isNaN(i)?1/0:i},project:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.latLngToPoint(J(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(B(t),e)},layerPointToLatLng:function(t){var e=B(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(J(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(J(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(nt(t))},distance:function(t,e){return this.options.crs.distance(J(t),J(e))},containerPointToLayerPoint:function(t){return B(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return B(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(B(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(J(t)))},mouseEventToContainerPoint:function(t){return si(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ni(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");N(e,"scroll",this._onScroll,this),this._containerId=w(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&z.any3d,H(t,"leaflet-container"+(z.touch?" leaflet-touch":"")+(z.retina?" leaflet-retina":"")+(z.ielt9?" leaflet-oldie":"")+(z.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=se(t,"position");e!=="absolute"&&e!=="relative"&&e!=="fixed"&&e!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),rt(this._mapPane,new R(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(H(t.markerPane,"leaflet-zoom-hide"),H(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,n){rt(this._mapPane,new R(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,n)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n,i){e===void 0&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),i?n&&n.pinch&&this.fire("zoom",n):((o||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return lt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){rt(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[w(this._container)]=this;var e=t?tt:N;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),z.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){lt(this._resizeRequest),this._resizeRequest=$(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n=[],i,o=e==="mouseout"||e==="mouseover",a=t.target||t.srcElement,h=!1;a;){if(i=this._targets[w(a)],i&&(e==="click"||e==="preclick")&&this._draggableMoved(i)){h=!0;break}if(i&&i.listens(e,!0)&&(o&&!fn(a,t)||(n.push(i),o))||a===this._container)break;a=a.parentNode}return!n.length&&!h&&!o&&this.listens(e,!0)&&(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))){var n=t.type;n==="mousedown"&&an(e),this._fireDOMEvent(t,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if(t.type==="click"){var i=c({},t);i.type="preclick",this._fireDOMEvent(i,i.type,n)}var o=this._findEventTargets(t,e);if(n){for(var a=[],h=0;h<n.length;h++)n[h].listens(e,!0)&&a.push(n[h]);o=a.concat(o)}if(o.length){e==="contextmenu"&&dt(t);var d=o[0],_={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var x=d.getLatLng&&(!d._radius||d._radius<=10);_.containerPoint=x?this.latLngToContainerPoint(d.getLatLng()):this.mouseEventToContainerPoint(t),_.layerPoint=this.containerPointToLayerPoint(_.containerPoint),_.latlng=x?d.getLatLng():this.layerPointToLatLng(_.layerPoint)}for(h=0;h<o.length;h++)if(o[h].fire(e,_,!0),_.originalEvent._stopped||o[h].options.bubblingMouseEvents===!1&&F(this._mouseEvents,e)!==-1)return}},_draggableMoved:function(t){return t=t.dragging&&t.dragging.enabled()?t:this,t.dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Rt(this._mapPane)||new R(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){var n=t&&e!==void 0?this._getNewPixelOrigin(t,e):this.getPixelOrigin();return n.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var n=this.getSize()._divideBy(2);return this.project(t,e)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,n){var i=this._getNewPixelOrigin(n,e);return this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,n){var i=this._getNewPixelOrigin(n,e);return ht([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,n){if(!n)return t;var i=this.project(t,e),o=this.getSize().divideBy(2),a=new Q(i.subtract(o),i.add(o)),h=this._getBoundsOffset(a,n,e);return Math.abs(h.x)<=1&&Math.abs(h.y)<=1?t:this.unproject(i.add(h),e)},_limitOffset:function(t,e){if(!e)return t;var n=this.getPixelBounds(),i=new Q(n.min.add(t),n.max.add(t));return t.add(this._getBoundsOffset(i,e))},_getBoundsOffset:function(t,e,n){var i=ht(this.project(e.getNorthEast(),n),this.project(e.getSouthWest(),n)),o=i.min.subtract(t.min),a=i.max.subtract(t.max),h=this._rebound(o.x,-a.x),d=this._rebound(o.y,-a.y);return new R(h,d)},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),i=z.any3d?this.options.zoomSnap:1;return i&&(t=Math.round(t/i)*i),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ot(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return(e&&e.animate)!==!0&&!this.getSize().contains(n)?!1:(this.panBy(n,e),!0)},_createAnimProxy:function(){var t=this._proxy=Y("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var n=Qe,i=this._proxy.style[n];Dt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),i===this._proxy.style[n]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){it(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Dt(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||n.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var i=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/i);return n.animate!==!0&&!this.getSize().contains(o)?!1:($(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,H(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:i}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(p(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ot(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Uo(t,e){return new K(t,e)}var wt=xt.extend({options:{position:"topright"},initialize:function(t){C(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),i=t._controlCorners[n];return H(e,"leaflet-control"),n.indexOf("bottom")!==-1?i.insertBefore(e,i.firstChild):i.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(it(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ce=function(t){return new wt(t)};K.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",n=this._controlContainer=Y("div",e+"control-container",this._container);function i(o,a){var h=e+o+" "+e+a;t[o+a]=Y("div",h,n)}i("top","left"),i("top","right"),i("bottom","left"),i("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)it(this._controlCorners[t]);it(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var li=wt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,i){return n<i?-1:i<n?1:0}},initialize:function(t,e,n){C(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var i in t)this._addLayer(t[i],i);for(i in e)this._addLayer(e[i],i,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return wt.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(w(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){H(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(H(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ot(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ot(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=Y("div",t),n=this.options.collapsed;e.setAttribute("aria-haspopup",!0),he(e),dn(e);var i=this._section=Y("section",t+"-list");n&&(this._map.on("click",this.collapse,this),N(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var o=this._layersLink=Y("a",t+"-toggle",e);o.href="#",o.title="Layers",o.setAttribute("role","button"),N(o,{keydown:function(a){a.keyCode===13&&this._expandSafely()},click:function(a){dt(a),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=Y("div",t+"-base",i),this._separator=Y("div",t+"-separator",i),this._overlaysList=Y("div",t+"-overlays",i),e.appendChild(i)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&w(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,n){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:n}),this.options.sortLayers&&this._layers.sort(p(function(i,o){return this.options.sortFunction(i.layer,o.layer,i.name,o.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Le(this._baseLayersList),Le(this._overlaysList),this._layerControlInputs=[];var t,e,n,i,o=0;for(n=0;n<this._layers.length;n++)i=this._layers[n],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,o+=i.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(w(t.target)),n=e.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",i=document.createElement("div");return i.innerHTML=n,i.firstChild},_addItem:function(t){var e=document.createElement("label"),n=this._map.hasLayer(t.layer),i;t.overlay?(i=document.createElement("input"),i.type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=n):i=this._createRadioElement("leaflet-base-layers_"+w(this),n),this._layerControlInputs.push(i),i.layerId=w(t.layer),N(i,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var a=document.createElement("span");e.appendChild(a),a.appendChild(i),a.appendChild(o);var h=t.overlay?this._overlaysList:this._baseLayersList;return h.appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,e,n,i=[],o=[];this._handlingClick=!0;for(var a=t.length-1;a>=0;a--)e=t[a],n=this._getLayer(e.layerId).layer,e.checked?i.push(n):e.checked||o.push(n);for(a=0;a<o.length;a++)this._map.hasLayer(o[a])&&this._map.removeLayer(o[a]);for(a=0;a<i.length;a++)this._map.hasLayer(i[a])||this._map.addLayer(i[a]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t=this._layerControlInputs,e,n,i=this._map.getZoom(),o=t.length-1;o>=0;o--)e=t[o],n=this._getLayer(e.layerId).layer,e.disabled=n.options.minZoom!==void 0&&i<n.options.minZoom||n.options.maxZoom!==void 0&&i>n.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,N(t,"click",dt),this.expand();var e=this;setTimeout(function(){tt(t,"click",dt),e._preventClick=!1})}}),Go=function(t,e,n){return new li(t,e,n)},_n=wt.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=Y("div",e+" leaflet-bar"),i=this.options;return this._zoomInButton=this._createButton(i.zoomInText,i.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(i.zoomOutText,i.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,i,o){var a=Y("a",n,i);return a.innerHTML=t,a.href="#",a.title=e,a.setAttribute("role","button"),a.setAttribute("aria-label",e),he(a),N(a,"click",Ft),N(a,"click",o,this),N(a,"click",this._refocusOnMap,this),a},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ot(this._zoomInButton,e),ot(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(H(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(H(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});K.mergeOptions({zoomControl:!0}),K.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new _n,this.addControl(this.zoomControl))});var jo=function(t){return new _n(t)},hi=wt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=Y("div",e),i=this.options;return this._addScales(i,e+"-line",n),t.on(i.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=Y("div",e,n)),t.imperial&&(this._iScale=Y("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,n,e/t)},_updateImperial:function(t){var e=t*3.2808399,n,i,o;e>5280?(n=e/5280,i=this._getRoundNum(n),this._updateScale(this._iScale,i+" mi",i/n)):(o=this._getRoundNum(e),this._updateScale(this._iScale,o+" ft",o/e))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,e*n}}),Vo=function(t){return new hi(t)},qo='<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>',mn=wt.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(z.inlineSvg?qo+" ":"")+"Leaflet</a>"},initialize:function(t){C(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=Y("div","leaflet-control-attribution"),he(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(' <span aria-hidden="true">|</span> ')}}});K.mergeOptions({attributionControl:!0}),K.addInitHook(function(){this.options.attributionControl&&new mn().addTo(this)});var Jo=function(t){return new mn(t)};wt.Layers=li,wt.Zoom=_n,wt.Scale=hi,wt.Attribution=mn,ce.layers=Go,ce.zoom=jo,ce.scale=Vo,ce.attribution=Jo;var Ct=xt.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Ct.addTo=function(t,e){return t.addHandler(e,this),this};var Ko={Events:_t},ci=z.touch?"touchstart mousedown":"mousedown",zt=Gt.extend({options:{clickTolerance:3},initialize:function(t,e,n,i){C(this,i),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(N(this._dragStartTarget,ci,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(zt._dragging===this&&this.finishDrag(!0),tt(this._dragStartTarget,ci,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!tn(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){zt._dragging===this&&this.finishDrag();return}if(!(zt._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(zt._dragging=this,this._preventOutline&&an(this._element),on(),ae(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,n=ii(this._element);this._startPoint=new R(e.clientX,e.clientY),this._startPos=Rt(this._element),this._parentScale=un(n);var i=t.type==="mousedown";N(document,i?"mousemove":"touchmove",this._onMove,this),N(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var e=t.touches&&t.touches.length===1?t.touches[0]:t,n=new R(e.clientX,e.clientY)._subtract(this._startPoint);!n.x&&!n.y||Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,dt(t),this._moved||(this.fire("dragstart"),this._moved=!0,H(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),H(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=t,this._updatePosition())}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),rt(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){ot(document.body,"leaflet-dragging"),this._lastTarget&&(ot(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),tt(document,"mousemove touchmove",this._onMove,this),tt(document,"mouseup touchend touchcancel",this._onUp,this),rn(),ue();var e=this._moved&&this._moving;this._moving=!1,zt._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function di(t,e,n){var i,o=[1,4,2,8],a,h,d,_,x,S,Z,U;for(a=0,S=t.length;a<S;a++)t[a]._code=Ht(t[a],e);for(d=0;d<4;d++){for(Z=o[d],i=[],a=0,S=t.length,h=S-1;a<S;h=a++)_=t[a],x=t[h],_._code&Z?x._code&Z||(U=Ee(x,_,Z,e,n),U._code=Ht(U,e),i.push(U)):(x._code&Z&&(U=Ee(x,_,Z,e,n),U._code=Ht(U,e),i.push(U)),i.push(_));t=i}return t}function fi(t,e){var n,i,o,a,h,d,_,x,S;if(!t||t.length===0)throw new Error("latlngs not passed");gt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var Z=J([0,0]),U=nt(t),ft=U.getNorthWest().distanceTo(U.getSouthWest())*U.getNorthEast().distanceTo(U.getNorthWest());ft<1700&&(Z=pn(t));var at=t.length,vt=[];for(n=0;n<at;n++){var mt=J(t[n]);vt.push(e.project(J([mt.lat-Z.lat,mt.lng-Z.lng])))}for(d=_=x=0,n=0,i=at-1;n<at;i=n++)o=vt[n],a=vt[i],h=o.y*a.x-a.y*o.x,_+=(o.x+a.x)*h,x+=(o.y+a.y)*h,d+=h*3;d===0?S=vt[0]:S=[_/d,x/d];var Qt=e.unproject(B(S));return J([Qt.lat+Z.lat,Qt.lng+Z.lng])}function pn(t){for(var e=0,n=0,i=0,o=0;o<t.length;o++){var a=J(t[o]);e+=a.lat,n+=a.lng,i++}return J([e/i,n/i])}var Yo={__proto__:null,clipPolygon:di,polygonCenter:fi,centroid:pn};function _i(t,e){if(!e||!t.length)return t.slice();var n=e*e;return t=Qo(t,n),t=$o(t,n),t}function mi(t,e,n){return Math.sqrt(de(t,e,n,!0))}function Xo(t,e,n){return de(t,e,n)}function $o(t,e){var n=t.length,i=typeof Uint8Array<"u"?Uint8Array:Array,o=new i(n);o[0]=o[n-1]=1,gn(t,o,e,0,n-1);var a,h=[];for(a=0;a<n;a++)o[a]&&h.push(t[a]);return h}function gn(t,e,n,i,o){var a=0,h,d,_;for(d=i+1;d<=o-1;d++)_=de(t[d],t[i],t[o],!0),_>a&&(h=d,a=_);a>n&&(e[h]=1,gn(t,e,n,i,h),gn(t,e,n,h,o))}function Qo(t,e){for(var n=[t[0]],i=1,o=0,a=t.length;i<a;i++)tr(t[i],t[o])>e&&(n.push(t[i]),o=i);return o<a-1&&n.push(t[a-1]),n}var pi;function gi(t,e,n,i,o){var a=i?pi:Ht(t,n),h=Ht(e,n),d,_,x;for(pi=h;;){if(!(a|h))return[t,e];if(a&h)return!1;d=a||h,_=Ee(t,e,d,n,o),x=Ht(_,n),d===a?(t=_,a=x):(e=_,h=x)}}function Ee(t,e,n,i,o){var a=e.x-t.x,h=e.y-t.y,d=i.min,_=i.max,x,S;return n&8?(x=t.x+a*(_.y-t.y)/h,S=_.y):n&4?(x=t.x+a*(d.y-t.y)/h,S=d.y):n&2?(x=_.x,S=t.y+h*(_.x-t.x)/a):n&1&&(x=d.x,S=t.y+h*(d.x-t.x)/a),new R(x,S,o)}function Ht(t,e){var n=0;return t.x<e.min.x?n|=1:t.x>e.max.x&&(n|=2),t.y<e.min.y?n|=4:t.y>e.max.y&&(n|=8),n}function tr(t,e){var n=e.x-t.x,i=e.y-t.y;return n*n+i*i}function de(t,e,n,i){var o=e.x,a=e.y,h=n.x-o,d=n.y-a,_=h*h+d*d,x;return _>0&&(x=((t.x-o)*h+(t.y-a)*d)/_,x>1?(o=n.x,a=n.y):x>0&&(o+=h*x,a+=d*x)),h=t.x-o,d=t.y-a,i?h*h+d*d:new R(o,a)}function gt(t){return!A(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function vi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),gt(t)}function yi(t,e){var n,i,o,a,h,d,_,x;if(!t||t.length===0)throw new Error("latlngs not passed");gt(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var S=J([0,0]),Z=nt(t),U=Z.getNorthWest().distanceTo(Z.getSouthWest())*Z.getNorthEast().distanceTo(Z.getNorthWest());U<1700&&(S=pn(t));var ft=t.length,at=[];for(n=0;n<ft;n++){var vt=J(t[n]);at.push(e.project(J([vt.lat-S.lat,vt.lng-S.lng])))}for(n=0,i=0;n<ft-1;n++)i+=at[n].distanceTo(at[n+1])/2;if(i===0)x=at[0];else for(n=0,a=0;n<ft-1;n++)if(h=at[n],d=at[n+1],o=h.distanceTo(d),a+=o,a>i){_=(a-i)/o,x=[d.x-_*(d.x-h.x),d.y-_*(d.y-h.y)];break}var mt=e.unproject(B(x));return J([mt.lat+S.lat,mt.lng+S.lng])}var er={__proto__:null,simplify:_i,pointToSegmentDistance:mi,closestPointOnSegment:Xo,clipSegment:gi,_getEdgeIntersection:Ee,_getBitCode:Ht,_sqClosestPointOnSegment:de,isFlat:gt,_flat:vi,polylineCenter:yi},vn={project:function(t){return new R(t.lng,t.lat)},unproject:function(t){return new V(t.y,t.x)},bounds:new Q([-180,-90],[180,90])},yn={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Q([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var e=Math.PI/180,n=this.R,i=t.lat*e,o=this.R_MINOR/n,a=Math.sqrt(1-o*o),h=a*Math.sin(i),d=Math.tan(Math.PI/4-i/2)/Math.pow((1-h)/(1+h),a/2);return i=-n*Math.log(Math.max(d,1e-10)),new R(t.lng*e*n,i)},unproject:function(t){for(var e=180/Math.PI,n=this.R,i=this.R_MINOR/n,o=Math.sqrt(1-i*i),a=Math.exp(-t.y/n),h=Math.PI/2-2*Math.atan(a),d=0,_=.1,x;d<15&&Math.abs(_)>1e-7;d++)x=o*Math.sin(h),x=Math.pow((1-x)/(1+x),o/2),_=Math.PI/2-2*Math.atan(a*x)-h,h+=_;return new V(h*e,t.x*e/n)}},nr={__proto__:null,LonLat:vn,Mercator:yn,SphericalMercator:Ge},ir=c({},At,{code:"EPSG:3395",projection:yn,transformation:function(){var t=.5/(Math.PI*yn.R);return ie(t,.5,-t,.5)}()}),wi=c({},At,{code:"EPSG:4326",projection:vn,transformation:ie(1/180,1,-1/180,.5)}),or=c({},Mt,{projection:vn,transformation:ie(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,i=e.lat-t.lat;return Math.sqrt(n*n+i*i)},infinite:!0});Mt.Earth=At,Mt.EPSG3395=ir,Mt.EPSG3857=Ve,Mt.EPSG900913=lo,Mt.EPSG4326=wi,Mt.Simple=or;var Pt=Gt.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[w(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[w(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",function(){e.off(n,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});K.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=w(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var e=w(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return w(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){t=t?A(t)?t:[t]:[];for(var e=0,n=t.length;e<n;e++)this.addLayer(t[e])},_addZoomLimit:function(t){(!isNaN(t.options.maxZoom)||!isNaN(t.options.minZoom))&&(this._zoomBoundLayers[w(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=w(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,n=this._getZoomSpan();for(var i in this._zoomBoundLayers){var o=this._zoomBoundLayers[i].options;t=o.minZoom===void 0?t:Math.min(t,o.minZoom),e=o.maxZoom===void 0?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,n!==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)}});var Jt=Pt.extend({initialize:function(t,e){C(this,e),this._layers={};var n,i;if(t)for(n=0,i=t.length;n<i;n++)this.addLayer(t[n])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var 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:function(t){var e=typeof t=="number"?t:this.getLayerId(t);return e in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e=Array.prototype.slice.call(arguments,1),n,i;for(n in this._layers)i=this._layers[n],i[t]&&i[t].apply(i,e);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return w(t)}}),rr=function(t,e){return new Jt(t,e)},Ot=Jt.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Jt.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Jt.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new ct;for(var e in this._layers){var n=this._layers[e];t.extend(n.getBounds?n.getBounds():n.getLatLng())}return t}}),sr=function(t,e){return new Ot(t,e)},Kt=xt.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){C(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var n=this._getIconUrl(t);if(!n){if(t==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var i=this._createImg(n,e&&e.tagName==="IMG"?e:null);return this._setIconStyles(i,t),(this.options.crossOrigin||this.options.crossOrigin==="")&&(i.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),i},_setIconStyles:function(t,e){var n=this.options,i=n[e+"Size"];typeof i=="number"&&(i=[i,i]);var o=B(i),a=B(e==="shadow"&&n.shadowAnchor||n.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(n.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:function(t,e){return e=e||document.createElement("img"),e.src=t,e},_getIconUrl:function(t){return z.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function ar(t){return new Kt(t)}var fe=Kt.extend({options:{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]},_getIconUrl:function(t){return typeof fe.imagePath!="string"&&(fe.imagePath=this._detectIconPath()),(this.options.imagePath||fe.imagePath)+Kt.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(n,i,o){var a=i.exec(n);return a&&a[o]};return t=e(t,/^url\((['"])?(.+)\1\)$/,2),t&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=Y("div","leaflet-default-icon-path",document.body),e=se(t,"background-image")||se(t,"backgroundImage");if(document.body.removeChild(t),e=this._stripUrl(e),e)return e;var n=document.querySelector('link[href$="leaflet.css"]');return n?n.href.substring(0,n.href.length-11-1):""}}),Pi=Ct.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new zt(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),H(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ot(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,n=e._map,i=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,a=Rt(e._icon),h=n.getPixelBounds(),d=n.getPixelOrigin(),_=ht(h.min._subtract(d).add(o),h.max._subtract(d).subtract(o));if(!_.contains(a)){var x=B((Math.max(_.max.x,a.x)-_.max.x)/(h.max.x-_.max.x)-(Math.min(_.min.x,a.x)-_.min.x)/(h.min.x-_.min.x),(Math.max(_.max.y,a.y)-_.max.y)/(h.max.y-_.max.y)-(Math.min(_.min.y,a.y)-_.min.y)/(h.min.y-_.min.y)).multiplyBy(i);n.panBy(x,{animate:!1}),this._draggable._newPos._add(x),this._draggable._startPos._add(x),rt(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=$(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(lt(this._panRequest),this._panRequest=$(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,n=e._shadow,i=Rt(e._icon),o=e._map.layerPointToLatLng(i);n&&rt(n,i),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){lt(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Me=Pt.extend({options:{icon:new fe,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){C(this,e),this._latlng=J(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&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:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=J(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=t.icon.createIcon(this._icon),i=!1;n!==this._icon&&(this._icon&&this._removeIcon(),i=!0,t.title&&(n.title=t.title),n.tagName==="IMG"&&(n.alt=t.alt||"")),H(n,e),t.keyboard&&(n.tabIndex="0",n.setAttribute("role","button")),this._icon=n,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&N(n,"focus",this._panOnFocus,this);var o=t.icon.createShadow(this._shadow),a=!1;o!==this._shadow&&(this._removeShadow(),a=!0),o&&(H(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),i&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&a&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&tt(this._icon,"focus",this._panOnFocus,this),it(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&it(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&rt(this._icon,t),this._shadow&&rt(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(H(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Pi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Pi(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&pt(this._icon,t),this._shadow&&pt(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var e=this.options.icon.options,n=e.iconSize?B(e.iconSize):B(0,0),i=e.iconAnchor?B(e.iconAnchor):B(0,0);t.panInside(this._latlng,{paddingTopLeft:i,paddingBottomRight:n.subtract(i)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function ur(t,e){return new Me(t,e)}var Zt=Pt.extend({options:{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,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return C(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Oe=Zt.extend({options:{fill:!0,radius:10},initialize:function(t,e){C(this,e),this._latlng=J(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=J(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return Zt.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,n=this._clickTolerance(),i=[t+n,e+n];this._pxBounds=new Q(this._point.subtract(i),this._point.add(i))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function lr(t,e){return new Oe(t,e)}var wn=Oe.extend({initialize:function(t,e,n){if(typeof e=="number"&&(e=c({},n,{radius:e})),C(this,e),this._latlng=J(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new ct(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Zt.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,n=this._map,i=n.options.crs;if(i.distance===At.distance){var o=Math.PI/180,a=this._mRadius/At.R/o,h=n.project([e+a,t]),d=n.project([e-a,t]),_=h.add(d).divideBy(2),x=n.unproject(_).lat,S=Math.acos((Math.cos(a*o)-Math.sin(e*o)*Math.sin(x*o))/(Math.cos(e*o)*Math.cos(x*o)))/o;(isNaN(S)||S===0)&&(S=a/Math.cos(Math.PI/180*e)),this._point=_.subtract(n.getPixelOrigin()),this._radius=isNaN(S)?0:_.x-n.project([x,t-S]).x,this._radiusY=_.y-h.y}else{var Z=i.unproject(i.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(Z).x}this._updateBounds()}});function hr(t,e,n){return new wn(t,e,n)}var St=Zt.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){C(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e=1/0,n=null,i=de,o,a,h=0,d=this._parts.length;h<d;h++)for(var _=this._parts[h],x=1,S=_.length;x<S;x++){o=_[x-1],a=_[x];var Z=i(t,o,a,!0);Z<e&&(e=Z,n=i(t,o,a))}return n&&(n.distance=Math.sqrt(e)),n},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return yi(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=J(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new ct,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return gt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],n=gt(t),i=0,o=t.length;i<o;i++)n?(e[i]=J(t[i]),this._bounds.extend(e[i])):e[i]=this._convertLatLngs(t[i]);return e},_project:function(){var t=new Q;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new R(t,t);this._rawPxBounds&&(this._pxBounds=new Q([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,n){var i=t[0]instanceof V,o=t.length,a,h;if(i){for(h=[],a=0;a<o;a++)h[a]=this._map.latLngToLayerPoint(t[a]),n.extend(h[a]);e.push(h)}else for(a=0;a<o;a++)this._projectLatlngs(t[a],e,n)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}var e=this._parts,n,i,o,a,h,d,_;for(n=0,o=0,a=this._rings.length;n<a;n++)for(_=this._rings[n],i=0,h=_.length;i<h-1;i++)d=gi(_[i],_[i+1],t,i,!0),d&&(e[o]=e[o]||[],e[o].push(d[0]),(d[1]!==_[i+1]||i===h-2)&&(e[o].push(d[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,n=0,i=t.length;n<i;n++)t[n]=_i(t[n],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var n,i,o,a,h,d,_=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,a=this._parts.length;n<a;n++)for(d=this._parts[n],i=0,h=d.length,o=h-1;i<h;o=i++)if(!(!e&&i===0)&&mi(t,d[o],d[i])<=_)return!0;return!1}});function cr(t,e){return new St(t,e)}St._flat=vi;var Yt=St.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return fi(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=St.prototype._convertLatLngs.call(this,t),n=e.length;return n>=2&&e[0]instanceof V&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){St.prototype._setLatLngs.call(this,t),gt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return gt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new R(e,e);if(t=new Q(t.min.subtract(n),t.max.add(n)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var i=0,o=this._rings.length,a;i<o;i++)a=di(this._rings[i],t,!0),a.length&&this._parts.push(a)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e=!1,n,i,o,a,h,d,_,x;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(a=0,_=this._parts.length;a<_;a++)for(n=this._parts[a],h=0,x=n.length,d=x-1;h<x;d=h++)i=n[h],o=n[d],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(e=!e);return e||St.prototype._containsPoint.call(this,t,!0)}});function dr(t,e){return new Yt(t,e)}var kt=Ot.extend({initialize:function(t,e){C(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=A(t)?t:t.features,n,i,o;if(e){for(n=0,i=e.length;n<i;n++)o=e[n],(o.geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var a=this.options;if(a.filter&&!a.filter(t))return this;var h=Se(t,a);return h?(h.feature=Ae(t),h.defaultOptions=h.options,this.resetStyle(h),a.onEachFeature&&a.onEachFeature(t,h),this.addLayer(h)):this},resetStyle:function(t){return t===void 0?this.eachLayer(this.resetStyle,this):(t.options=c({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){t.setStyle&&(typeof e=="function"&&(e=e(t.feature)),t.setStyle(e))}});function Se(t,e){var n=t.type==="Feature"?t.geometry:t,i=n?n.coordinates:null,o=[],a=e&&e.pointToLayer,h=e&&e.coordsToLatLng||Pn,d,_,x,S;if(!i&&!n)return null;switch(n.type){case"Point":return d=h(i),Li(a,t,d,e);case"MultiPoint":for(x=0,S=i.length;x<S;x++)d=h(i[x]),o.push(Li(a,t,d,e));return new Ot(o);case"LineString":case"MultiLineString":return _=ke(i,n.type==="LineString"?0:1,h),new St(_,e);case"Polygon":case"MultiPolygon":return _=ke(i,n.type==="Polygon"?1:2,h),new Yt(_,e);case"GeometryCollection":for(x=0,S=n.geometries.length;x<S;x++){var Z=Se({geometry:n.geometries[x],type:"Feature",properties:t.properties},e);Z&&o.push(Z)}return new Ot(o);case"FeatureCollection":for(x=0,S=n.features.length;x<S;x++){var U=Se(n.features[x],e);U&&o.push(U)}return new Ot(o);default:throw new Error("Invalid GeoJSON object.")}}function Li(t,e,n,i){return t?t(e,n):new Me(n,i&&i.markersInheritOptions&&i)}function Pn(t){return new V(t[1],t[0],t[2])}function ke(t,e,n){for(var i=[],o=0,a=t.length,h;o<a;o++)h=e?ke(t[o],e-1,n):(n||Pn)(t[o]),i.push(h);return i}function Ln(t,e){return t=J(t),t.alt!==void 0?[E(t.lng,e),E(t.lat,e),E(t.alt,e)]:[E(t.lng,e),E(t.lat,e)]}function Ie(t,e,n,i){for(var o=[],a=0,h=t.length;a<h;a++)o.push(e?Ie(t[a],gt(t[a])?0:e-1,n,i):Ln(t[a],i));return!e&&n&&o.length>0&&o.push(o[0].slice()),o}function Xt(t,e){return t.feature?c({},t.feature,{geometry:e}):Ae(e)}function Ae(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var xn={toGeoJSON:function(t){return Xt(this,{type:"Point",coordinates:Ln(this.getLatLng(),t)})}};Me.include(xn),wn.include(xn),Oe.include(xn),St.include({toGeoJSON:function(t){var e=!gt(this._latlngs),n=Ie(this._latlngs,e?1:0,!1,t);return Xt(this,{type:(e?"Multi":"")+"LineString",coordinates:n})}}),Yt.include({toGeoJSON:function(t){var e=!gt(this._latlngs),n=e&&!gt(this._latlngs[0]),i=Ie(this._latlngs,n?2:e?1:0,!0,t);return e||(i=[i]),Xt(this,{type:(n?"Multi":"")+"Polygon",coordinates:i})}}),Jt.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(n){e.push(n.toGeoJSON(t).geometry.coordinates)}),Xt(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(e==="MultiPoint")return this.toMultiPoint(t);var n=e==="GeometryCollection",i=[];return this.eachLayer(function(o){if(o.toGeoJSON){var a=o.toGeoJSON(t);if(n)i.push(a.geometry);else{var h=Ae(a);h.type==="FeatureCollection"?i.push.apply(i,h.features):i.push(h)}}}),n?Xt(this,{geometries:i,type:"GeometryCollection"}):{type:"FeatureCollection",features:i}}});function xi(t,e){return new kt(t,e)}var fr=xi,ze=Pt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,n){this._url=t,this._bounds=nt(e),C(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(H(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){it(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&Vt(this._image),this},bringToBack:function(){return this._map&&qt(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=nt(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",e=this._image=t?this._url:Y("img");if(H(e,"leaflet-image-layer"),this._zoomAnimated&&H(e,"leaflet-zoom-animated"),this.options.className&&H(e,this.options.className),e.onselectstart=T,e.onmousemove=T,e.onload=p(this.fire,this,"load"),e.onerror=p(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Dt(this._image,n,e)},_reset:function(){var t=this._image,e=new Q(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=e.getSize();rt(t,e.min),t.style.width=n.x+"px",t.style.height=n.y+"px"},_updateOpacity:function(){pt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),_r=function(t,e,n){return new ze(t,e,n)},bi=ze.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",e=this._image=t?this._url:Y("video");if(H(e,"leaflet-image-layer"),this._zoomAnimated&&H(e,"leaflet-zoom-animated"),this.options.className&&H(e,this.options.className),e.onselectstart=T,e.onmousemove=T,e.onloadeddata=p(this.fire,this,"load"),t){for(var n=e.getElementsByTagName("source"),i=[],o=0;o<n.length;o++)i.push(n[o].src);this._url=n.length>0?i:[e.src];return}A(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var a=0;a<this._url.length;a++){var h=Y("source");h.src=this._url[a],e.appendChild(h)}}});function mr(t,e,n){return new bi(t,e,n)}var Ti=ze.extend({_initImage:function(){var t=this._image=this._url;H(t,"leaflet-image-layer"),this._zoomAnimated&&H(t,"leaflet-zoom-animated"),this.options.className&&H(t,this.options.className),t.onselectstart=T,t.onmousemove=T}});function pr(t,e,n){return new Ti(t,e,n)}var Et=Pt.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof V||A(t))?(this._latlng=J(t),C(this,e)):(C(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&pt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&pt(this._container,1),this.bringToFront(),this.options.interactive&&(H(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(pt(this._container,0),this._removeTimeout=setTimeout(p(it,void 0,this._container),200)):it(this._container),this.options.interactive&&(ot(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=J(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Vt(this._container),this},bringToBack:function(){return this._map&&qt(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof Ot){e=null;var n=this._source._layers;for(var i in n)if(n[i]._map){e=n[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:function(){if(this._content){var 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:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=B(this.options.offset),n=this._getAnchor();this._zoomAnimated?rt(this._container,t.add(n)):e=e.add(t).add(n);var i=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=i+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}});K.include({_initOverlay:function(t,e,n,i){var o=e;return o instanceof t||(o=new t(i).setContent(e)),n&&o.setLatLng(n),o}}),Pt.include({_initOverlay:function(t,e,n,i){var o=n;return o instanceof t?(C(o,i),o._source=this):(o=e&&!i?e:new t(i,this),o.setContent(n)),o}});var Ze=Et.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(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,Et.prototype.openOn.call(this,t)},onAdd:function(t){Et.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Zt||this._source.on("preclick",Nt))},onRemove:function(t){Et.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Zt||this._source.off("preclick",Nt))},getEvents:function(){var t=Et.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=Y("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=Y("div",t+"-content-wrapper",e);if(this._contentNode=Y("div",t+"-content",n),he(e),dn(this._contentNode),N(e,"contextmenu",Nt),this._tipContainer=Y("div",t+"-tip-container",e),this._tip=Y("div",t+"-tip",this._tipContainer),this.options.closeButton){var i=this._closeButton=Y("a",t+"-close-button",e);i.setAttribute("role","button"),i.setAttribute("aria-label","Close popup"),i.href="#close",i.innerHTML='<span aria-hidden="true">&#215;</span>',N(i,"click",function(o){dt(o),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var n=t.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),e.width=n+1+"px",e.whiteSpace="",e.height="";var i=t.offsetHeight,o=this.options.maxHeight,a="leaflet-popup-scrolled";o&&i>o?(e.height=o+"px",H(t,a)):ot(t,a),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();rt(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(se(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,i=this._containerWidth,o=new R(this._containerLeft,-n-this._containerBottom);o._add(Rt(this._container));var a=t.layerPointToContainerPoint(o),h=B(this.options.autoPanPadding),d=B(this.options.autoPanPaddingTopLeft||h),_=B(this.options.autoPanPaddingBottomRight||h),x=t.getSize(),S=0,Z=0;a.x+i+_.x>x.x&&(S=a.x+i-x.x+_.x),a.x-S-d.x<0&&(S=a.x-d.x),a.y+n+_.y>x.y&&(Z=a.y+n-x.y+_.y),a.y-Z-d.y<0&&(Z=a.y-d.y),(S||Z)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([S,Z]))}},_getAnchor:function(){return B(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),gr=function(t,e){return new Ze(t,e)};K.mergeOptions({closePopupOnClick:!0}),K.include({openPopup:function(t,e,n){return this._initOverlay(Ze,t,e,n).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),Pt.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Ze,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Ot||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){Ft(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof Zt)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var Be=Et.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Et.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Et.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Et.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",e=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Y("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+w(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,i=this._map,o=this._container,a=i.latLngToContainerPoint(i.getCenter()),h=i.layerPointToContainerPoint(t),d=this.options.direction,_=o.offsetWidth,x=o.offsetHeight,S=B(this.options.offset),Z=this._getAnchor();d==="top"?(e=_/2,n=x):d==="bottom"?(e=_/2,n=0):d==="center"?(e=_/2,n=x/2):d==="right"?(e=0,n=x/2):d==="left"?(e=_,n=x/2):h.x<a.x?(d="right",e=0,n=x/2):(d="left",e=_+(S.x+Z.x)*2,n=x/2),t=t.subtract(B(e,n,!0)).add(S).add(Z),ot(o,"leaflet-tooltip-right"),ot(o,"leaflet-tooltip-left"),ot(o,"leaflet-tooltip-top"),ot(o,"leaflet-tooltip-bottom"),H(o,"leaflet-tooltip-"+d),rt(o,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&pt(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return B(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),vr=function(t,e){return new Be(t,e)};K.include({openTooltip:function(t,e,n){return this._initOverlay(Be,t,e,n).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),Pt.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Be,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(!(!t&&this._tooltipHandlersAdded)){var e=t?"off":"on",n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,n.click=this._openTooltip,this._map?this._addFocusListeners():n.add=this._addFocusListeners),this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),this[e](n),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof Ot||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e=typeof t.getElement=="function"&&t.getElement();e&&(N(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),N(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var e=typeof t.getElement=="function"&&t.getElement();e&&e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var e=this;this._map.once("moveend",function(){e._openOnceFlag=!1,e._openTooltip(t)});return}this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)}},_moveTooltip:function(t){var e=t.latlng,n,i;this._tooltip.options.sticky&&t.originalEvent&&(n=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(n),e=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(e)}});var Ci=Kt.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&t.tagName==="DIV"?t:document.createElement("div"),n=this.options;if(n.html instanceof Element?(Le(e),e.appendChild(n.html)):e.innerHTML=n.html!==!1?n.html:"",n.bgPos){var i=B(n.bgPos);e.style.backgroundPosition=-i.x+"px "+-i.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function yr(t){return new Ci(t)}Kt.Default=fe;var _e=Pt.extend({options:{tileSize:256,opacity:1,updateWhenIdle:z.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},initialize:function(t){C(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),it(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Vt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(qt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=b(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof R?t:new R(t,t)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e=this.getPane().children,n=-t(-1/0,1/0),i=0,o=e.length,a;i<o;i++)a=e[i].style.zIndex,e[i]!==this._container&&a&&(n=t(n,+a));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!z.ielt9){pt(this._container,this.options.opacity);var t=+new Date,e=!1,n=!1;for(var i in this._tiles){var o=this._tiles[i];if(!(!o.current||!o.loaded)){var a=Math.min(1,(t-o.loaded)/200);pt(o.el,a),a<1?e=!0:(o.active?n=!0:this._onOpaqueTile(o),o.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),e&&(lt(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this))}},_onOpaqueTile:T,_initContainer:function(){this._container||(this._container=Y("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(t!==void 0){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===t?(this._levels[n].el.style.zIndex=e-Math.abs(t-n),this._onUpdateLevel(n)):(it(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var i=this._levels[t],o=this._map;return i||(i=this._levels[t]={},i.el=Y("div","leaflet-tile-container leaflet-zoom-animated",this._container),i.el.style.zIndex=e,i.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),i.zoom=t,this._setZoomTransform(i,o.getCenter(),o.getZoom()),T(i.el.offsetWidth),this._onCreateLevel(i)),this._level=i,i}},_onUpdateLevel:T,_onRemoveLevel:T,_onCreateLevel:T,_pruneTiles:function(){if(this._map){var t,e,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom){this._removeAllTiles();return}for(t in this._tiles)e=this._tiles[t],e.retain=e.current;for(t in this._tiles)if(e=this._tiles[t],e.current&&!e.active){var 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(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)it(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,n,i){var o=Math.floor(t/2),a=Math.floor(e/2),h=n-1,d=new R(+o,+a);d.z=+h;var _=this._tileCoordsToKey(d),x=this._tiles[_];return x&&x.active?(x.retain=!0,!0):(x&&x.loaded&&(x.retain=!0),h>i?this._retainParent(o,a,h,i):!1)},_retainChildren:function(t,e,n,i){for(var o=2*t;o<2*t+2;o++)for(var a=2*e;a<2*e+2;a++){var h=new R(o,a);h.z=n+1;var d=this._tileCoordsToKey(h),_=this._tiles[d];if(_&&_.active){_.retain=!0;continue}else _&&_.loaded&&(_.retain=!0);n+1<i&&this._retainChildren(o,a,n+1,i)}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return e.minNativeZoom!==void 0&&t<e.minNativeZoom?e.minNativeZoom:e.maxNativeZoom!==void 0&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,n,i){var 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);var a=this.options.updateWhenZooming&&o!==this._tileZoom;(!i||a)&&(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),o!==void 0&&this._update(t),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var n in this._levels)this._setZoomTransform(this._levels[n],t,e)},_setZoomTransform:function(t,e,n){var i=this._map.getZoomScale(n,t.zoom),o=t.origin.multiplyBy(i).subtract(this._map._getNewPixelOrigin(e,n)).round();z.any3d?Dt(t.el,o,i):rt(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,n=this._tileSize=this.getTileSize(),i=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]],i).x/n.x),Math.ceil(t.project([0,e.wrapLng[1]],i).x/n.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],i).y/n.x),Math.ceil(t.project([e.wrapLat[1],0],i).y/n.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(t){var e=this._map,n=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),i=e.getZoomScale(n,this._tileZoom),o=e.project(t,this._tileZoom).floor(),a=e.getSize().divideBy(i*2);return new Q(o.subtract(a),o.add(a))},_update:function(t){var e=this._map;if(e){var n=this._clampZoom(e.getZoom());if(t===void 0&&(t=e.getCenter()),this._tileZoom!==void 0){var i=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(i),a=o.getCenter(),h=[],d=this.options.keepBuffer,_=new Q(o.getBottomLeft().subtract([d,-d]),o.getTopRight().add([d,-d]));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(var x in this._tiles){var S=this._tiles[x].coords;(S.z!==this._tileZoom||!_.contains(new R(S.x,S.y)))&&(this._tiles[x].current=!1)}if(Math.abs(n-this._tileZoom)>1){this._setView(t,n);return}for(var Z=o.min.y;Z<=o.max.y;Z++)for(var U=o.min.x;U<=o.max.x;U++){var ft=new R(U,Z);if(ft.z=this._tileZoom,!!this._isValidTile(ft)){var at=this._tiles[this._tileCoordsToKey(ft)];at?at.current=!0:h.push(ft)}}if(h.sort(function(mt,Qt){return mt.distanceTo(a)-Qt.distanceTo(a)}),h.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var vt=document.createDocumentFragment();for(U=0;U<h.length;U++)this._addTile(h[U],vt);this._level.el.appendChild(vt)}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var n=this._globalTileRange;if(!e.wrapLng&&(t.x<n.min.x||t.x>n.max.x)||!e.wrapLat&&(t.y<n.min.y||t.y>n.max.y))return!1}if(!this.options.bounds)return!0;var i=this._tileCoordsToBounds(t);return nt(this.options.bounds).overlaps(i)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),i=t.scaleBy(n),o=i.add(n),a=e.unproject(i,t.z),h=e.unproject(o,t.z);return[a,h]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new ct(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new R(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(it(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){H(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=T,t.onmousemove=T,z.ielt9&&this.options.opacity<1&&pt(t,this.options.opacity)},_addTile:function(t,e){var n=this._getTilePos(t),i=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),p(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&$(p(this._tileReady,this,t,null,o)),rt(o,n),this._tiles[i]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var i=this._tileCoordsToKey(t);n=this._tiles[i],n&&(n.loaded=+new Date,this._map._fadeAnimated?(pt(n.el,0),lt(this._fadeFrame),this._fadeFrame=$(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(H(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),z.ielt9||!this._map._fadeAnimated?$(this._pruneTiles,this):setTimeout(p(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new R(this._wrapX?v(t.x,this._wrapX):t.x,this._wrapY?v(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new Q(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function wr(t){return new _e(t)}var $t=_e.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,e=C(this,e),e.detectRetina&&z.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:function(t,e){return this._url===t&&e===void 0&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var n=document.createElement("img");return N(n,"load",p(this._tileOnLoad,this,e,n)),N(n,"error",p(this._tileOnError,this,e,n)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.src=this.getTileUrl(t),n},getTileUrl:function(t){var e={r:z.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return I(this._url,c(e,this.options))},_tileOnLoad:function(t,e){z.ielt9?setTimeout(p(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var i=this.options.errorTileUrl;i&&e.getAttribute("src")!==i&&(e.src=i),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,n=this.options.zoomReverse,i=this.options.zoomOffset;return n&&(t=e-t),t+i},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=T,e.onerror=T,!e.complete)){e.src=W;var n=this._tiles[t].coords;it(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:n})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",W),_e.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(!(!this._map||n&&n.getAttribute("src")===W))return _e.prototype._tileReady.call(this,t,e,n)}});function Ei(t,e){return new $t(t,e)}var Mi=$t.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=c({},this.defaultWmsParams);for(var i in e)i in this.options||(n[i]=e[i]);e=C(this,e);var o=e.detectRetina&&z.retina?2:1,a=this.getTileSize();n.width=a.x*o,n.height=a.y*o,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,$t.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,i=ht(n.project(e[0]),n.project(e[1])),o=i.min,a=i.max,h=(this._wmsVersion>=1.3&&this._crs===wi?[o.y,o.x,a.y,a.x]:[o.x,o.y,a.x,a.y]).join(","),d=$t.prototype.getTileUrl.call(this,t);return d+P(this.wmsParams,d,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+h},setParams:function(t,e){return c(this.wmsParams,t),e||this.redraw(),this}});function Pr(t,e){return new Mi(t,e)}$t.WMS=Mi,Ei.wms=Pr;var It=Pt.extend({options:{padding:.1},initialize:function(t){C(this,t),w(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),H(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),i=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),a=i.multiplyBy(-n).add(o).subtract(this._map._getNewPixelOrigin(t,e));z.any3d?Dt(this._container,a,n):rt(this._container,a)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new Q(n,n.add(e.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Oi=It.extend({options:{tolerance:0},getEvents:function(){var t=It.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){It.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");N(t,"mousemove",this._onMouseMove,this),N(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),N(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){lt(this._redrawRequest),delete this._ctx,it(this._container),tt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var e in this._layers)t=this._layers[e],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){It.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),i=z.retina?2:1;rt(e,t.min),e.width=i*n.x,e.height=i*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",z.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){It.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[w(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,i=e.prev;n?n.prev=i:this._drawLast=i,i?i.next=n:this._drawFirst=n,delete t._order,delete this._layers[w(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var e=t.options.dashArray.split(/[, ]+/),n=[],i,o;for(o=0;o<e.length;o++){if(i=Number(e[o]),isNaN(i))return;n.push(i)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||$(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Q,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var 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:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var n=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var 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:function(t,e){if(this._drawing){var n,i,o,a,h=t._parts,d=h.length,_=this._ctx;if(d){for(_.beginPath(),n=0;n<d;n++){for(i=0,o=h[n].length;i<o;i++)a=h[n][i],_[i?"lineTo":"moveTo"](a.x,a.y);e&&_.closePath()}this._fillStroke(_,t)}}},_updateCircle:function(t){if(!(!this._drawing||t._empty())){var e=t._point,n=this._ctx,i=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||i)/i;o!==1&&(n.save(),n.scale(1,o)),n.beginPath(),n.arc(e.x,e.y/o,i,0,Math.PI*2,!1),o!==1&&n.restore(),this._fillStroke(n,t)}},_fillStroke:function(t,e){var n=e.options;n.fill&&(t.globalAlpha=n.fillOpacity,t.fillStyle=n.fillColor||n.color,t.fill(n.fillRule||"evenodd")),n.stroke&&n.weight!==0&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=n.opacity,t.lineWidth=n.weight,t.strokeStyle=n.color,t.lineCap=n.lineCap,t.lineJoin=n.lineJoin,t.stroke())},_onClick:function(t){for(var e=this._map.mouseEventToLayerPoint(t),n,i,o=this._drawFirst;o;o=o.next)n=o.layer,n.options.interactive&&n._containsPoint(e)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(n))&&(i=n);this._fireEvent(i?[i]:!1,t)},_onMouseMove:function(t){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ot(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var n,i,o=this._drawFirst;o;o=o.next)n=o.layer,n.options.interactive&&n._containsPoint(e)&&(i=n);i!==this._hoveredLayer&&(this._handleMouseOut(t),i&&(H(this._container,"leaflet-interactive"),this._fireEvent([i],t,"mouseover"),this._hoveredLayer=i)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,t),this._mouseHoverThrottled=!0,setTimeout(p(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,n){this._map._fireDOMEvent(e,n||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var n=e.next,i=e.prev;if(n)n.prev=i;else return;i?i.next=n:n&&(this._drawFirst=n),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t)}},_bringToBack:function(t){var e=t._order;if(e){var n=e.next,i=e.prev;if(i)i.next=n;else return;n?n.prev=i:i&&(this._drawLast=i),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t)}}});function Si(t){return z.canvas?new Oi(t):null}var me=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Lr={_initContainer:function(){this._container=Y("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(It.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=me("shape");H(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=me("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[w(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;it(e),t.removeInteractiveTarget(e),delete this._layers[w(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,i=t.options,o=t._container;o.stroked=!!i.stroke,o.filled=!!i.fill,i.stroke?(e||(e=t._stroke=me("stroke")),o.appendChild(e),e.weight=i.weight+"px",e.color=i.color,e.opacity=i.opacity,i.dashArray?e.dashStyle=A(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=i.lineCap.replace("butt","flat"),e.joinstyle=i.lineJoin):e&&(o.removeChild(e),t._stroke=null),i.fill?(n||(n=t._fill=me("fill")),o.appendChild(n),n.color=i.fillColor||i.color,n.opacity=i.fillOpacity):n&&(o.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),i=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+i+" 0,"+65535*360)},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){Vt(t._container)},_bringToBack:function(t){qt(t._container)}},De=z.vml?me:zn,pe=It.extend({_initContainer:function(){this._container=De("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=De("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){it(this._container),tt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){It.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;(!this._svgSize||!this._svgSize.equals(e))&&(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),rt(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=De("path");t.options.className&&H(e,t.options.className),t.options.interactive&&H(e,"leaflet-interactive"),this._updateStyle(t),this._layers[w(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){it(t._path),t.removeInteractiveTarget(t._path),delete this._layers[w(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,Zn(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),i=Math.max(Math.round(t._radiusY),1)||n,o="a"+n+","+i+" 0 1,0 ",a=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+o+n*2+",0 "+o+-n*2+",0 ";this._setPath(t,a)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){Vt(t._path)},_bringToBack:function(t){qt(t._path)}});z.vml&&pe.include(Lr);function ki(t){return z.svg||z.vml?new pe(t):null}K.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var e=this._paneRenderers[t];return e===void 0&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Si(t)||ki(t)}});var Ii=Yt.extend({initialize:function(t,e){Yt.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=nt(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function xr(t,e){return new Ii(t,e)}pe.create=De,pe.pointsToPath=Zn,kt.geometryToLayer=Se,kt.coordsToLatLng=Pn,kt.coordsToLatLngs=ke,kt.latLngToCoords=Ln,kt.latLngsToCoords=Ie,kt.getFeature=Xt,kt.asFeature=Ae,K.mergeOptions({boxZoom:!0});var Ai=Ct.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){N(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){tt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){it(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ae(),on(),this._startPoint=this._map.mouseEventToContainerPoint(t),N(document,{contextmenu:Ft,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=Y("div","leaflet-zoom-box",this._container),H(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new Q(this._point,this._startPoint),n=e.getSize();rt(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(it(this._box),ot(this._container,"leaflet-crosshair")),ue(),rn(),tt(document,{contextmenu:Ft,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(p(this._resetState,this),0);var e=new ct(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});K.addInitHook("addHandler","boxZoom",Ai),K.mergeOptions({doubleClickZoom:!0});var zi=Ct.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),i=e.options.zoomDelta,o=t.originalEvent.shiftKey?n-i:n+i;e.options.doubleClickZoom==="center"?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});K.addInitHook("addHandler","doubleClickZoom",zi),K.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Zi=Ct.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new zt(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))}H(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ot(this._map._container,"leaflet-grab"),ot(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=nt(this._map.options.maxBounds);this._offsetLimit=ht(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:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var 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:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,i=this._draggable._newPos.x,o=(i-e+n)%t+e-n,a=(i+e+n)%t-e-n,h=Math.abs(o+n)<Math.abs(a+n)?o:a;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=h},_onDragEnd:function(t){var e=this._map,n=e.options,i=!n.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),i)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,h=n.easeLinearity,d=o.multiplyBy(h/a),_=d.distanceTo([0,0]),x=Math.min(n.inertiaMaxSpeed,_),S=d.multiplyBy(x/_),Z=x/(n.inertiaDeceleration*h),U=S.multiplyBy(-Z/2).round();!U.x&&!U.y?e.fire("moveend"):(U=e._limitOffset(U,e.options.maxBounds),$(function(){e.panBy(U,{duration:Z,easeLinearity:h,noMoveStart:!0,animate:!0})}))}}});K.addInitHook("addHandler","dragging",Zi),K.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Bi=Ct.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),N(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),tt(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,n=t.scrollTop||e.scrollTop,i=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(i,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e=this._panKeys={},n=this.keyCodes,i,o;for(i=0,o=n.left.length;i<o;i++)e[n.left[i]]=[-1*t,0];for(i=0,o=n.right.length;i<o;i++)e[n.right[i]]=[t,0];for(i=0,o=n.down.length;i<o;i++)e[n.down[i]]=[0,t];for(i=0,o=n.up.length;i<o;i++)e[n.up[i]]=[0,-1*t]},_setZoomDelta:function(t){var e=this._zoomKeys={},n=this.keyCodes,i,o;for(i=0,o=n.zoomIn.length;i<o;i++)e[n.zoomIn[i]]=t;for(i=0,o=n.zoomOut.length;i<o;i++)e[n.zoomOut[i]]=-t},_addHooks:function(){N(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){tt(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=t.keyCode,n=this._map,i;if(e in this._panKeys){if(!n._panAnim||!n._panAnim._inProgress)if(i=this._panKeys[e],t.shiftKey&&(i=B(i).multiplyBy(3)),n.options.maxBounds&&(i=n._limitOffset(B(i),n.options.maxBounds)),n.options.worldCopyJump){var o=n.wrapLatLng(n.unproject(n.project(n.getCenter()).add(i)));n.panTo(o)}else n.panBy(i)}else if(e in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[e]);else if(e===27&&n._popup&&n._popup.options.closeOnEscapeKey)n.closePopup();else return;Ft(t)}}});K.addInitHook("addHandler","keyboard",Bi),K.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Di=Ct.extend({addHooks:function(){N(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){tt(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=ai(t),n=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(p(this._performZoom,this),i),Ft(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),n=this._map.options.zoomSnap||0;t._stop();var i=this._delta/(this._map.options.wheelPxPerZoomLevel*4),o=4*Math.log(2/(1+Math.exp(-Math.abs(i))))/Math.LN2,a=n?Math.ceil(o/n)*n:o,h=t._limitZoom(e+(this._delta>0?a:-a))-e;this._delta=0,this._startTime=null,h&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+h):t.setZoomAround(this._lastMousePos,e+h))}});K.addInitHook("addHandler","scrollWheelZoom",Di);var br=600;K.mergeOptions({tapHold:z.touchNative&&z.safari&&z.mobile,tapTolerance:15});var Ri=Ct.extend({addHooks:function(){N(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){tt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var e=t.touches[0];this._startPos=this._newPos=new R(e.clientX,e.clientY),this._holdTimeout=setTimeout(p(function(){this._cancel(),this._isTapValid()&&(N(document,"touchend",dt),N(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),br),N(document,"touchend touchcancel contextmenu",this._cancel,this),N(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){tt(document,"touchend",dt),tt(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),tt(document,"touchend touchcancel contextmenu",this._cancel,this),tt(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new R(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var n=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});n._simulated=!0,e.target.dispatchEvent(n)}});K.addInitHook("addHandler","tapHold",Ri),K.mergeOptions({touchZoom:z.touch,bounceAtZoomLimits:!0});var Ni=Ct.extend({addHooks:function(){H(this._map._container,"leaflet-touch-zoom"),N(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ot(this._map._container,"leaflet-touch-zoom"),tt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(!(!t.touches||t.touches.length!==2||e._animatingZoom||this._zooming)){var n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),e.options.touchZoom!=="center"&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(i)._divideBy(2))),this._startDist=n.distanceTo(i),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),N(document,"touchmove",this._onTouchMove,this),N(document,"touchend touchcancel",this._onTouchEnd,this),dt(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var e=this._map,n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]),o=n.distanceTo(i)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),e.options.touchZoom==="center"){if(this._center=this._startLatLng,o===1)return}else{var a=n._add(i)._divideBy(2)._subtract(this._centerPoint);if(o===1&&a.x===0&&a.y===0)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),lt(this._animRequest);var h=p(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=$(h,this,!0),dt(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,lt(this._animRequest),tt(document,"touchmove",this._onTouchMove,this),tt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});K.addInitHook("addHandler","touchZoom",Ni),K.BoxZoom=Ai,K.DoubleClickZoom=zi,K.Drag=Zi,K.Keyboard=Bi,K.ScrollWheelZoom=Di,K.TapHold=Ri,K.TouchZoom=Ni,s.Bounds=Q,s.Browser=z,s.CRS=Mt,s.Canvas=Oi,s.Circle=wn,s.CircleMarker=Oe,s.Class=xt,s.Control=wt,s.DivIcon=Ci,s.DivOverlay=Et,s.DomEvent=Wo,s.DomUtil=Fo,s.Draggable=zt,s.Evented=Gt,s.FeatureGroup=Ot,s.GeoJSON=kt,s.GridLayer=_e,s.Handler=Ct,s.Icon=Kt,s.ImageOverlay=ze,s.LatLng=V,s.LatLngBounds=ct,s.Layer=Pt,s.LayerGroup=Jt,s.LineUtil=er,s.Map=K,s.Marker=Me,s.Mixin=Ko,s.Path=Zt,s.Point=R,s.PolyUtil=Yo,s.Polygon=Yt,s.Polyline=St,s.Popup=Ze,s.PosAnimation=ui,s.Projection=nr,s.Rectangle=Ii,s.Renderer=It,s.SVG=pe,s.SVGOverlay=Ti,s.TileLayer=$t,s.Tooltip=Be,s.Transformation=je,s.Util=Ut,s.VideoOverlay=bi,s.bind=p,s.bounds=ht,s.canvas=Si,s.circle=hr,s.circleMarker=lr,s.control=ce,s.divIcon=yr,s.extend=c,s.featureGroup=sr,s.geoJSON=xi,s.geoJson=fr,s.gridLayer=wr,s.icon=ar,s.imageOverlay=_r,s.latLng=J,s.latLngBounds=nt,s.layerGroup=rr,s.map=Uo,s.marker=ur,s.point=B,s.polygon=dr,s.polyline=cr,s.popup=gr,s.rectangle=xr,s.setOptions=C,s.stamp=w,s.svg=ki,s.svgOverlay=pr,s.tileLayer=Ei,s.tooltip=vr,s.transformation=ie,s.version=l,s.videoOverlay=mr;var Tr=window.L;s.noConflict=function(){return window.L=Tr,this},window.L=s})})(Sn,Sn.exports);var uo=Sn.exports;function wa(r,u,s){return Object.freeze({instance:r,context:u,container:s})}function Pa(r,u){return u==null?function(l,c){const f=m.useRef();return f.current||(f.current=r(l,c)),f}:function(l,c){const f=m.useRef();f.current||(f.current=r(l,c));const p=m.useRef(l),{instance:y}=f.current;return m.useEffect(function(){p.current!==l&&(u(y,l,p.current),p.current=l)},[y,l,c]),f}}function La(r,u){m.useEffect(function(){return(u.layerContainer??u.map).addLayer(r.instance),function(){var f;(f=u.layerContainer)==null||f.removeLayer(r.instance),u.map.removeLayer(r.instance)}},[u,r])}function xa(r){return function(s){const l=ga(),c=r(ao(s,l),l);return fa(l.map,s.attribution),ya(c.current,s.eventHandlers),La(c.current,l),c}}function ba(r,u){const s=Pa(r,u),l=xa(s);return va(l)}function Ta(r,u,s){const{opacity:l,zIndex:c}=u;l!=null&&l!==s.opacity&&r.setOpacity(l),c!=null&&c!==s.zIndex&&r.setZIndex(c)}function kn(){return kn=Object.assign||function(r){for(var u=1;u<arguments.length;u++){var s=arguments[u];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(r[l]=s[l])}return r},kn.apply(this,arguments)}function Ca({bounds:r,boundsOptions:u,center:s,children:l,className:c,id:f,placeholder:p,style:y,whenReady:w,zoom:b,...v},T){const[E]=m.useState({className:c,id:f,style:y}),[g,M]=m.useState(null);m.useImperativeHandle(T,()=>(g==null?void 0:g.map)??null,[g]);const C=m.useCallback(O=>{if(O!==null&&g===null){const I=new uo.Map(O,v);s!=null&&b!=null?I.setView(s,b):r!=null&&I.fitBounds(r,u),w!=null&&I.whenReady(w),M(ma(I))}},[]);m.useEffect(()=>()=>{g==null||g.map.remove()},[g]);const P=g?G.createElement(pa,{value:g},l):p??null;return G.createElement("div",kn({},E,{ref:C}),P)}const Oa=m.forwardRef(Ca),Sa=ba(function({url:u,...s},l){const c=new uo.TileLayer(u,ao(s,l));return wa(c,l)},function(u,s,l){Ta(u,s,l);const{url:c}=s;c!=null&&c!==l.url&&u.setUrl(c)});export{Ma as A,gs as M,Sa as T,ne as a,ks as b,Oa as c,Ue as u};