1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1636],{19860:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var i=n(37876),o=n(14232),l=n(20061),s=n(76251),a=n(39523),r=n(62529),d=n(16806),u=n(61397),c=n.n(u);let p=n(65364).env.NEXT_PUBLIC_MAPBOX_TOKEN||"pk.eyJ1IjoiZGVubmlzZmMiLCJhIjoiY2xidW40anVxMGh2ODNwdDBobXc3cjA1bSJ9.dcn2eM0m0T137r0r25mdKQ",h={longitude:14.921691,latitude:58.837119};function m(e){var t,n,i,o,l,s;let a=null==e||null==(i=e.node)||null==(n=i.acfDestination)||null==(t=n.destinationMap)?void 0:t.longitude,r=null==e||null==(s=e.node)||null==(l=s.acfDestination)||null==(o=l.destinationMap)?void 0:o.latitude;return"number"==typeof a&&Number.isFinite(a)&&0!==a&&"number"==typeof r&&Number.isFinite(r)&&0!==r}function g(e,t){if(0===t.length)return;if(1===t.length)return void e.easeTo({center:[t[0].longitude,t[0].latitude],zoom:9,duration:800});let n=(0,a.default)(t);if(n.minLng===n.maxLng&&n.minLat===n.maxLat)return void e.easeTo({center:[n.minLng,n.minLat],zoom:9,duration:800});e.fitBounds([[n.minLng,n.minLat],[n.maxLng,n.maxLat]],{padding:{top:10,left:10,right:10,bottom:10},duration:800})}function f(e){let{destinations:t,renderDesktopPopup:n,renderMobilePopup:a,desktopPopupClassName:u=""}=e,{enabled:f}=(0,d.Yq)(),x=(0,o.useRef)(null),v=(0,o.useRef)(!1),[w,b]=(0,o.useState)(null),[j,y]=(0,o.useState)(0),M=(0,o.useMemo)(()=>t.filter(m).map(e=>{var t,n,i,o;return{destination:e,longitude:e.node.acfDestination.destinationMap.longitude,latitude:e.node.acfDestination.destinationMap.latitude,destinationType:(null==(o=e.node.destinationTypes)||null==(i=o.edges)||null==(n=i[0])||null==(t=n.node)?void 0:t.name)||""}}),[t]),L=(0,o.useRef)(null);if(null===L.current){let e=M.map(e=>({longitude:e.longitude,latitude:e.latitude})),t=e.length>0?(0,s.default)(e):null;L.current={longitude:t?t.longitude:h.longitude,latitude:t?t.latitude:h.latitude,zoom:4.5}}let N=(0,o.useMemo)(()=>M.map(e=>({type:"Feature",properties:{cluster:!1,destinationId:e.destination.node.id,destination:e.destination,destinationType:e.destinationType,isEasy:+("Easy"===e.destinationType),isResort:+("Resort"===e.destinationType)},geometry:{type:"Point",coordinates:[e.longitude,e.latitude]}})),[M]),C=(0,o.useMemo)(()=>{let e=new r.A({radius:50,maxZoom:14,reduce:(e,t)=>{e.hasEasy=e.hasEasy||t.isEasy,e.hasResort=e.hasResort||t.isResort}});return e.load(N),e},[N]),k=(0,o.useMemo)(()=>{var e;let t=null==(e=x.current)?void 0:e.getMap();if(!t)return[];try{let e=Math.round(t.getZoom());return C.getClusters([-180,-85,180,85],e)}catch(e){return console.error("[ClusterMap] getClusters error",e),[]}},[C,j,N.length]),{clusterMarkers:D,pointMarkers:E}=(0,o.useMemo)(()=>{let e=[],t=[];return k.forEach(n=>{n.properties.cluster?e.push(n):t.push(n)}),{clusterMarkers:e,pointMarkers:t}},[k]);(0,o.useEffect)(()=>{var e;if(!v.current)return;let t=null==(e=x.current)?void 0:e.getMap();t&&g(t,M)},[M]),(0,o.useEffect)(()=>{var e;if(!w)return;let t=null==(e=x.current)?void 0:e.getMap();if(!t)return;let n=w.node.acfDestination.destinationMap.longitude,i=w.node.acfDestination.destinationMap.latitude;null!=n&&null!=i&&t.easeTo({center:[n,i],duration:500,offset:[0,-100]})},[w]),(0,o.useEffect)(()=>{var e;if(0===j)return;let t=null==(e=x.current)?void 0:e.getMap();if(!t)return;let n=t.getContainer(),i=new ResizeObserver(()=>{t.resize()});return i.observe(n),()=>i.disconnect()},[j]);let T=e=>e<4?30:e<8?38:e<16?48:60,_=()=>b(null);return f?(0,i.jsx)("section",{className:"h-[calc(100vh-130px)] flex-1 bg-gray-100 lg:sticky lg:top-[113px] lg:block lg:h-[calc(100vh-113px)]",children:(0,i.jsxs)("div",{className:"h-full",children:[(0,i.jsx)("div",{className:"h-full w-full lg:absolute lg:inset-0 lg:h-auto",children:(0,i.jsxs)(l.Ay,{ref:x,initialViewState:L.current,onLoad:()=>{var e;v.current=!0;let t=null==(e=x.current)?void 0:e.getMap();if(!t)return void y(e=>e+1);M.length>0&&g(t,M),y(e=>e+1)},onMoveEnd:()=>{y(e=>e+1)},style:{width:"100%",height:"100%"},mapStyle:"mapbox://styles/mapbox/streets-v11",mapboxAccessToken:p,children:[(0,i.jsx)(l.ov,{showCompass:!1}),D.map(e=>{let[t,n]=e.geometry.coordinates,{point_count:o,cluster_id:s}=e.properties;return(0,i.jsx)(l.pH,{longitude:t,latitude:n,onClick:()=>((e,t,n)=>{var i;let o=Math.min(C.getClusterExpansionZoom(e),20);null==(i=x.current)||i.easeTo({center:[t,n],zoom:o,duration:500})})(s,t,n),children:(0,i.jsx)("div",{style:{width:"".concat(T(o),"px"),height:"".concat(T(o),"px"),borderRadius:"50%",backgroundColor:"#d71e25",border:"1px solid white",display:"flex",alignItems:"center",justifyContent:"center",color:"white",fontSize:o<8?"13px":o<16?"14px":"16px",fontWeight:"bold",cursor:"pointer"},children:o})},"cluster-".concat(s))}),E.map(e=>{let[t,n]=e.geometry.coordinates,{destination:o,destinationType:s}=e.properties;return(0,i.jsx)(l.pH,{longitude:t,latitude:n,anchor:"bottom",onClick:e=>{e.originalEvent.stopPropagation(),b(o)},children:(e=>{switch(e){case"Easy":return(0,i.jsx)("img",{src:"/easy-pin.svg",alt:"",width:"32",height:"32"});case"Resort":return(0,i.jsx)("img",{src:"/resort-pin.svg",alt:"",width:"32",height:"32"});default:return(0,i.jsx)("img",{src:"/pin.svg",alt:"",width:"32",height:"32"})}})(s)},"point-".concat(o.node.id))}),w&&null!=w.node.acfDestination.destinationMap.longitude&&null!=w.node.acfDestination.destinationMap.latitude&&(0,i.jsx)(l.zD,{anchor:"top",longitude:w.node.acfDestination.destinationMap.longitude,latitude:w.node.acfDestination.destinationMap.latitude,onClose:_,className:"".concat(c().popup," mt-2 !hidden xl:!block ").concat(u),children:n(w,_)}),(0,i.jsx)(l.tG,{trackUserLocation:!0,showUserLocation:!0,showAccuracyCircle:!0,showUserHeading:!0,fitBoundsOptions:{maxZoom:8}})]})}),w&&a(w,_)]})}):null}},51636:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>p});var i=n(37876);n(14232);var o=n(48230),l=n.n(o),s=n(89368),a=n(19860),r=n(16806),d=n(42908),u=n(46872);let c=()=>(0,i.jsx)("svg",{className:"block flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 16",width:"20",height:"14",children:(0,i.jsx)("path",{fill:"#d71e25",d:"M11.846 11.69c.128-.314.338-.314.466 0l1.346 3.314a.236.236 0 0 1-.16
17.344l-2.757.002a.234.234 0 0 1-.256-.286l1.368-3.373Zm.42-11.646 10.766 6.123a.251.251 0 0 1 .093.345L22.05 8.347a.251.251 0 0 1-.34.09l-7.688-4.37 5.148 8.783a.251.251 0 0 1-.093.345l-1.866 1.06a.251.251 0 0 1-.34-.09L12.078 5.99l-4.79 8.175a.251.251 0 0 1-.34.09L5.081 13.2a.251.251 0 0 1-.093-.345l5.148-8.788L2.45 8.44a.251.251 0 0 1-.34-.091L1.033 6.514a.251.251 0 0 1 .093-.345L11.893.044a.418.418 0 0 1 .372 0Z"})});function p(e){let{destinations:t,queryState:n}=e,o=(0,s.useTranslations)("Filter"),{getRoute:p}=(0,u.fi)(),{setEnabled:h}=(0,r.Yq)(),{onAddToList:m}=(0,d.A)(n);return(0,i.jsx)(a.A,{destinations:t,desktopPopupClassName:"min-w-[280px] overflow-hidden rounded-lg",renderDesktopPopup:(e,t)=>{var n,l;return(0,i.jsxs)("button",{type:"button",onClick:()=>{m(e.node.databaseId,"destinations"),t(),window.innerWidth<1280&&h(!1)},className:"w-full overflow-hidden rounded-lg text-left transition-transform hover:scale-[1.02] focus:outline-none",children:[(null==(l=e.node.acfDestination.destinationListing)||null==(n=l[0])?void 0:n.sourceUrl)&&(0,i.jsx)("img",{src:e.node.acfDestination.destinationListing[0].sourceUrl,alt:e.node.title,className:"h-32 w-full object-cover"}),(0,i.jsxs)("div",{className:"p-3",children:[(0,i.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,i.jsx)(c,{}),(0,i.jsx)("h3",{className:"text-sm font-semibold text-neutral-900",children:e.node.title.replace("First Camp","")})]}),(0,i.jsx)("p",{className:"text-xs text-neutral-600",children:o("ClickToShowCabins")})]})]})},renderMobilePopup:(e,t)=>{var n,o;return(0,i.jsx)("div",{className:"fixed bottom-20 left-1/2 z-50 w-[70%] max-w-xs -translate-x-1/2 overflow-hidden rounded-lg bg-white shadow-xl transition-transform hover:scale-[1.02] focus:outline-none focus:ring-2 focus:ring-red-500 xl:hidden",children:(0,i.jsxs)(l(),{href:"".concat(p("destinationer"),"/").concat(e.node.slug,"/").concat(p("dest_foretagsboende")),className:"relative w-full text-left",children:[(0,i.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),t()},className:"absolute right-2 top-2 z-10 flex h-7 w-7 items-center justify-center rounded-full bg-gray-100 hover:bg-gray-200",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:"h-4 w-4","aria-hidden":"true",children:(0,i.jsx)("path",{stroke:"currentColor",d:"M6.562 13.308 6 12.75l3.092-3.1L6 6.562 6.562 6 9.65 9.092 12.75 6l.562.562-3.096 3.088 3.092 3.1-.562.562-3.096-3.096z"})})}),(null==(o=e.node.acfDestination.destinationListing)||null==(n=o[0])?void 0:n.sourceUrl)&&(0,i.jsx)("img",{src:e.node.acfDestination.destinationListing[0].sourceUrl,alt:e.node.title,className:"mb-2 h-24 w-full object-cover"}),(0,i.jsxs)("div",{className:"mb-1 flex items-center gap-2 px-2",children:[(0,i.jsx)(c,{}),(0,i.jsx)("h3",{className:"text-sm font-semibold text-neutral-900",children:e.node.title.replace("First Camp","")})]}),e.node.excerpt&&(0,i.jsx)("div",{className:"mb-2 line-clamp-2 px-2 text-xs",dangerouslySetInnerHTML:{__html:e.node.excerpt}})]})})}})}},61397:e=>{e.exports={popup:"ClusterMap_popup__ZiAvi"}}}]);
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.