1import{R as h}from"./RevenueCatWrapper-B0FnxB_u.js";import{e as c}from"./entrypoints/pdf.ts-DDuZt5yk.js";import{T as s}from"./MapStyles-B4-ZXg6d.js";import{_ as g,a as m,o as d,b as o,e as w,n as p,t as y,f as _}from"./index-BDyiCXYp.js";const a="map-fullscreen";function f(e){return e.fullscreenEnabled!==!1&&typeof e.documentElement.requestFullscreen=="function"&&typeof e.exitFullscreen=="function"}function i(e){return e.body.classList.contains(a)}function F(e){e.body.classList.add(a),f(e)&&!e.fullscreenElement&&e.documentElement.requestFullscreen().catch(()=>{})}function r(e){e.body.classList.remove(a),e.fullscreenElement&&typeof e.exitFullscreen=="function"&&e.exitFullscreen().catch(()=>{})}function L(e){return i(e)?(r(e),!1):(F(e),!0)}function S(e){return f(e)&&i(e)&&!e.fullscreenElement?(e.body.classList.remove(a),!0):!1}function E(e,t){return t==="Escape"&&i(e)&&!e.fullscreenElement}function T(e){return e?{icon:"close_fullscreen",label:"Exit full screen"}:{icon:"open_in_full",label:"Full screen"}}const M=35e3,B={name:"MapControlsHorizontal",props:{fitBounds:{type:Array,default:()=>[[-180,-85],[180,85]]},fitBoundsPadding:{type:Number,default:40},marginTop:{type:[Number,String],default:null},showFullscreen:{type:Boolean,default:!1}},data(){return{is3DEnabled:s.is3DModeEnabled(),locationSpinTimeoutId:null,isFullscreen:i(document)}},computed:{fullscreenPresentation(){return T(this.isFullscreen)},containerStyle(){return this.marginTop!==null?{top:typeof this.marginTop=="number"?`${this.marginTop}px`:this.marginTop}:{}}},mounted(){window.geolocateLocated=()=>this.stopLocationSpin(),window.geolocateError=()=>this.stopLocationSpin(),c.on("map:3d-state-changed",this.handle3DStateChange),this.showFullscreen&&(document.addEventListener("fullscreenchange",this.handleFullscreenChange),document.addEventListener("keydown",this.handleFullscreenKeydown))},beforeUnmount(){this.clearLocationSpinTimeout(),c.off("map:3d-state-changed",this.handle3DStateChange),this.showFullscreen&&(document.removeEventListener("fullscreenchange",this.handleFullscreenChange),document.removeEventListener("keydown",this.handleFullscreenKeydown),i(document)&&r(document))},methods:{zoomIn(){window.map.zoomIn()},zoomOut(){window.map.zoomOut()},orientationButton(){window.map.flyTo({pitch:0,bearing:0})},boundsButton(){window.map.fitBounds(this.fitBounds,{padding:this.fitBoundsPadding})},clearLocationSpinTimeout(){this.locationSpinTimeoutId&&(window.clearTimeout(this.locationSpinTimeoutId),this.locationSpinTimeoutId=null)},stopLocationSpin(){var e;this.clearLocationSpinTimeout(),(e=document.getElementById("location_icon"))==null||e.classList.remove("spin")},locationButton(){var t;(t=document.getElementById("location_icon"))==null||t.classList.add("spin"),this.clearLocationSpinTimeout(),this.locationSpinTimeoutId=window.setTimeout(this.stopLocationSpin,M);const e=window.geoLocate;if(!e||typeof e.permissionAndTrigger!="function"){console.error("Location control is not ready yet."),this.stopLocationSpin();return}e.permissionAndTrigger()},async toggle3D(){if(!await h.isProOrProPlus()){window.location.href="/purchases";return}const t=!s.is3DModeEnabled();s.set3DMode(t),this.is3DEnabled=s.is3DModeEnabled()},handle3DStateChange(e){this.is3DEnabled=e},toggleFullscreen(){this.isFullscreen=L(document),this.resizeMapSoon()},handleFullscreenChange(){S(document),this.isFullscreen=i(document),this.resizeMapSoon()},handleFullscreenKeydown(e){E(document,e.key)&&(r(document),this.isFullscreen=!1,this.resizeMapSoon())},resizeMapSoon(){window.requestAnimationFrame(()=>{var e,t;return(t=(e=window.map)==null?void 0:e.resize)==null?void 0:t.call(e)})}}},C=["aria-label","title"],z=["aria-label","title"],v=["aria-label","title"],D=["aria-label","title"],I=["aria-label","title"],P=["aria-label","title"],k=["aria-label","title"],A={class:"material-icons"};function O(e,t,b,N,u,n){return d(),m("div",{class:"map-buttons-container justify-content-center",style:_(n.containerStyle)},[o("button",{class:"map-btn","aria-label":e.$t("components.map_controls.my_location_2"),title:e.$t("components.map_controls.my_location"),onClick:t[0]||(t[0]=(...l)=>n.locationButton&&n.locationButton(...l))}
1,t[7]||(t[7]=[o("span",{class:"material-icons",id:"location_icon"},"my_location",-1)]),8,C),o("button",{class:"map-btn","aria-label":e.$t("components.map_controls.zoom_out_2"),title:e.$t("components.map_controls.zoom_out"),onClick:t[1]||(t[1]=(...l)=>n.zoomOut&&n.zoomOut(...l))},t[8]||(t[8]=[o("span",{class:"material-icons"},"remove",-1)]),8,z),o("button",{class:"map-btn","aria-label":e.$t("components.map_controls.zoom_in_2"),title:e.$t("components.map_controls.zoom_in"),onClick:t[2]||(t[2]=(...l)=>n.zoomIn&&n.zoomIn(...l))},t[9]||(t[9]=[o("span",{class:"material-icons"},"add",-1)]),8,v),o("button",{class:"map-btn","aria-label":e.$t("components.map_controls.reset_bearing_pitch"),title:e.$t("components.map_controls.reset_bearing_and_tilt"),onClick:t[3]||(t[3]=(...l)=>n.orientationButton&&n.orientationButton(...l))},t[10]||(t[10]=[o("svg",{width:"10",height:"23",viewBox:"0 0 12 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M6 0L11.1962 9H0.803848L6 0Z",fill:"white"}),o("path",{opacity:"0.4",d:"M6 23L0.803849 14L11.1962 14L6 23Z",fill:"white"})],-1)]),8,D),o("button",{class:"map-btn","aria-label":e.$t("components.map_controls.fit_map_to_bounds_2"),title:e.$t("components.map_controls.fit_map_to_bounds"),onClick:t[4]||(t[4]=(...l)=>n.boundsButton&&n.boundsButton(...l))},t[11]||(t[11]=[o("span",{class:"material-icons"},"crop_free",-1)]),8,I),o("button",{class:p(["map-btn",{active:u.is3DEnabled}]),"aria-label":e.$t("components.map_controls.toggle_3d_mode"),title:e.$t("components.map_controls.toggle_3d_terrain"),onClick:t[5]||(t[5]=(...l)=>n.toggle3D&&n.toggle3D(...l))},t[12]||(t[12]=[o("span",null,[o("strong",null,"3D")],-1)]),10,P),b.showFullscreen?(d(),m("button",{key:0,class:p(["map-btn",{active:u.isFullscreen}]),"aria-label":n.fullscreenPresentation.label,title:n.fullscreenPresentation.label,onClick:t[6]||(t[6]=(...l)=>n.toggleFullscreen&&n.toggleFullscreen(...l))},[o("span",A,y(n.fullscreenPresentation.icon),1)],10,k)):w("",!0)],4)}const U=g(B,[["render",O]]);export{U as M}; 2//# sourceMappingURL=MapControls-DicO-K29.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.