!function(){function e(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);o&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,r)}return t}function o(o){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach(function(e){t(o,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(n,e))})}return o}function t(e,o,t){return(o=function(e){var o=function(e,o){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,o||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(e)}(e,"string");return"symbol"==typeof o?o:o+""}(o))in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}System.register(["./rolldown-runtime-legacy-Djb2rrqm.js","./index-legacy-Bbj6l0yZ.js","./context-BrD4AniQ-legacy-txE7vzzL.js","./constants-DOpa8YMW-legacy-TnabVEaS.js","./esm-Be30MpcN-legacy-D8iPI9WH.js","./esm-k7KI3vER-legacy-DjAkR8OT.js","./mapbox-jb8Zev6T-legacy-C4Ly-PG-.js"],function(e,t){var r,n,i,l,a,c,s,u,m,p,f,g,b,d,v;return e("default",function({children:e}){let{mapProvider:t,locale:r,center:n,zoom:i=c.zoom,minZoom:s,maxZoom:u,pitch:m=c.pitch,bearing:g=c.bearing,cooperativeGestures:y=c.cooperativeGestures,zoomPosition:h}=l();return"mapbox"===t.name?(0,b.jsxs)(f,{mapboxAccessToken:t.apiKey,initialViewState:o(o({},n),{},{zoom:i,pitch:m,bearing:g}),cooperativeGestures:y,minZoom:s,maxZoom:u,mapStyle:`mapbox://styles/${t.theme||a.mapbox}`,interactiveLayerIds:["road-label","waterway-label"],locale:d[r],children:[(0,b.jsx)(v,{}),h&&(0,b.jsx)(p,{position:h}),e]}):null}),{setters:[function(e){r=e.a},function(e){n=e.St,i=e.q},function(e){l=e.n},function(e){a=e.i,c=e.t},function(e){s=e.n},function(e){u=e.t},function(e){m=e.o,p=e.r,f=e.s}],execute:function(){g=r(n(),1),b=i(),d={en:{"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},fr:{"AttributionControl.ToggleAttribution":"Afficher/Masquer l’attribution","FullscreenControl.Enter":"Passer en plein écran","FullscreenControl.Exit":"Quitter le plein écran","GeolocateControl.FindMyLocation":"Trouver ma position","GeolocateControl.LocationNotAvailable":"Position non disponible","LogoControl.Title":"Page d’accueil Mapbox","Map.Title":"Carte","NavigationControl.ResetBearing":"Réinitialiser l’orientation au nord","NavigationControl.ZoomIn":"Zoomer","NavigationControl.ZoomOut":"Dézoomer","ScrollZoomBlocker.CtrlMessage":"Utilisez ctrl + défilement pour zoomer sur la carte","ScrollZoomBlocker.CmdMessage":"Utilisez ⌘ + défilement pour zoomer sur la carte","TouchPanBlocker.Message":"Utilisez deux doigts pour déplacer la carte"}},v=()=>{let{current:e}=m(),{centerPinMarkerPoints:o,markerPoints:t,locationBoundary:r,setZoom:n,mapPadding:i}=l(),[a,c]=(0,g.useState)(void 0),p=(0,g.useRef)(void 0),f=(0,g.useCallback)(()=>{e&&n(e.getZoom())},[e,n]);return(0,g.useEffect)(()=>(f(),null!=e&&e.on("zoom",f),()=>{null==e||e.off("zoom",f)}),[e,f]),(0,g.useEffect)(()=>{if(!e)return;let n=[];if(void 0!==r&&r.length>0?n.push(...r):void 0!==t&&t.length>0?(n.push(...t),o&&n.push(o)):void 0!==o&&n.push(o),0===n.length)return;let i=u(s(n));(!p.current||!i.every((e,o)=>{var t;return e===(null===(t=p.current)||void 0===t?void 0:t[o])}))&&(p.current=i,c(i))},[e,t,r,o]),(0,g.useEffect)(()=>{if(!e||void 0===a)return;let[o,t,r,n]=a,l=.1*(r-o)||.001,c=.1*(n-t)||.001;e.fitBounds([[o-l,t-c],[r+l,n+c]],{retainPadding:!1,padding:i,maxZoom:17,duration:700})},[e,a,i]),null}}}})}();
//# sourceMappingURL=Mapbox-CIislOVu-legacy-cLG5ak5Z.js.map