1(self.webpackChunksvk_designsystem=self.webpackChunksvk_designsystem||[]).push([[631],{53362:function(module){module.exports=function(obj){obj||(obj={});var __t,__p="",__e=_.escape,__j=Array.prototype.join;function print(){__p+=__j.call(arguments,"")}with(obj)__p+='<aside class="map-panel map-panel--cluster" id="panel-'+__e(markers[0].data.id)+'-nav" surface="primary-100">\n\t<div class="map-panel__container">\n\t\t<h2 class="map-panel__title">Välj en plats</h2>\n\t\t<ul class="map-panel__list list--none">\n\t\t\t',markers.forEach((e,t)=>{__p+='\n\t\t\t\t<li>\n\t\t\t\t\t<button class="svk-link map-panel-marker-btn" data-index="'+__e(t)+'">\n\t\t\t\t\t\t'+__e(e.data.title)+"\n\t\t\t\t\t</button>\n\t\t\t\t</li>\n\t\t\t"}),__p+='\n\t\t</ul>\n\t</div>\n\t<button class="svk-button button--icon map-panel-nav-close" aria-label="Stäng">\n\t\t<svk-icon name="close"></svk-icon>\n\t</button>\n</aside>\n';return __p}},37870:function(module,__unused_webpack_exports,__webpack_require__){var moment=__webpack_require__(95093);module.exports=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;with(obj)__p+='<aside class="map-panel map-panel--place" id="panel-'+__e(data.id)+'" surface="primary-100">\n\t<button class="svk-button button--icon map-panel-close" aria-label="Stäng">\n\t\t<svk-icon name="close"></svk-icon>\n\t</button>\n\t<img class="map-panel__image" src="'+__e(data.images[0])+'?doprocessing=1&w=500" />\n\t<div class="map-panel__content">\n\t\t<div class="paragraph-75 content__date">\n\t\t\tStart: '+__e(moment(data.start).format("D MMMM YYYY"))+'\n\t\t</div>\n\t\t<h3 class="heading-04 content__title">\n\t\t\t<a href="'+__e(data.url)+'">'+__e(data.title)+'</a>\n\t\t</h3>\n\t\t<div class="label-75 content__place">\n\t\t\t'+(null==(__t=getPlaceTitle(data))?"":__t)+'\n\t\t</div>\n\t\t<p class="paragraph-75 content__text">'+__e(data.description)+"</p>\n\t</div>\n</aside>\n";return __p}},28619:function(e,t,n){"use strict";n.d(t,{T4:function(){return c},em:function(){return l}});const i=["maps","geometry","geocoding"];let s=null,o={};function a(){return window.google?.maps?Promise.resolve(window.google.maps):s||(s=new Promise((e,t)=>{const n="__svkGoogleMapsCoreLoaded",i=document.createElement("script"),o=encodeURIComponent("AIzaSyDlZrwxkgarRlpukU1YMKgtqlTbJImFt6o");window[n]=()=>{delete window[n],e(window.google.maps)},i.async=!0,i.src=`//maps.googleapis.com/maps/api/js?key=${o}&language=sv&v=weekly&loading=async&callback=${n}`,i.onerror=()=>{delete window[n],s=null,t(new Error("Failed to load Google Maps JS API (core).\nExisting script tags:\n"+[...document.scripts].map(e=>e.src||"").filter(e=>e.includes("maps.googleapis.com/maps/api/js")).join("\n")))},document.head.appendChild(i)}),s)}function r(e){const t=function(e){return window.google?.maps?"maps"===e&&window.google.maps.Map?window.google.maps:"marker"===e&&window.google.maps.marker?window.google.maps.marker:"geometry"===e&&window.google.maps.geometry?window.google.maps.geometry:"geocoding"===e&&window.google.maps.Geocoder?window.google.maps:null:null}(e);if(t)return Promise.resolve(t);if(!o[e]){if("function"!=typeof google.maps.importLibrary)return Promise.reject(new Error(`Google Maps library "${e}" is not available on this page.`));o[e]=google.maps.importLibrary(e)}return o[e]}function l(e=[]){const t=[...new Set(e)];return a().then(()=>Promise.all(t.map(e=>r(e))))}function c(e){return l(i).then(()=>{"function"==typeof e&&e()}).catch(console.error)}},40651:function(e,t,n){"use strict";n.d(t,{ml:function(){return l},po:function(){return h},ur:function(){return m}});const i="#000",s="#fff",o=1,a=99999;function r(e={}){return{width:e.width||44,height:e.height||52}}function l(e){if(e&&e.position)return e.position instanceof google.maps.LatLng||"function"==typeof e.position.lat&&"function"==typeof e.position.lng?e.position:"number"==typeof e.position.lat&&"number"==typeof e.position.lng?new google.maps.LatLng(e.position.lat,e.position.lng):void 0}function c(e){let t=r(e.icon?.size),n=e.icon?.labelOrigin||{x:22,y:22},o=(e.icon?.origin?.x||0)>=t.width,a=void 0!==e.markerLabel,l=e.markerLabel?.fontSize||"16px";e.markerContent.style.width=`${t.width}px`,e.markerContent.style.height=`${t.height}px`,e.markerContent.style.backgroundImage=`url(${e.icon.url})`,e.markerContent.style.backgroundSize=`${2*t.width}px ${t.height}px`,e.markerContent.style.backgroundPosition=o?`-${t.width}px 0`:"0 0",a?(e.markerLabelEl.textContent=e.markerLabel.text||"",e.markerLabelEl.style.display="block",e.markerLabelEl.style.left=`${n.x}px`,e.markerLabelEl.style.top=`${n.y}px`,e.markerLabelEl.style.fontFamily=e.markerLabel.fontFamily||"DM Sans",e.markerLabelEl.style.fontSize=l,e.markerLabelEl.style.fontWeight=e.markerLabel.fontWeight||"500",e.markerLabelEl.style.color=e.markerLabel.color||(o?s:i)):(e.markerLabelEl.style.display="none",e.markerLabelEl.textContent="")}function h({map:e,position:t,title:n,data:i,icon:s,label:a,zIndex:h=o}){const{AdvancedMarkerElement:m}=google.maps.marker,{content:d,label:p}=function(){const e=document.createElement("div"),t=document.createElement("span");return e.className="svk-map-marker",t.className="svk-map-marker__label",Object.assign(e.style,{position:"relative",display:"block",backgroundRepeat:"no-repeat",backgroundPosition:"0 0",cursor:"pointer",transform:"translate3d(0, 0, 0)"}
1),Object.assign(t.style,{position:"absolute",transform:"translate(-50%, -50%)",textAlign:"center",pointerEvents:"none",lineHeight:"1",whiteSpace:"nowrap"}),e.appendChild(t),{content:e,label:t}}(),u=new m({map:e,position:t,title:n,content:d,gmpClickable:!0,zIndex:h});return u.data=i,u.icon={...s,size:r(s?.size),origin:s?.origin||new google.maps.Point(0,0),labelOrigin:s?.labelOrigin||{x:22,y:22}},u.markerLabel=a?{...a}:void 0,u.markerContent=d,u.markerLabelEl=p,u.defaultZIndex=h,u.getPosition=function(){return l(this)},u.getLabel=function(){return this.markerLabel?{...this.markerLabel}:void 0},u.setLabel=function(e){this.markerLabel=e?{...e}:void 0,c(this)},u.setIcon=function(e){this.icon={...this.icon,...e,size:r(e?.size||this.icon?.size),origin:e?.origin||this.icon?.origin||new google.maps.Point(0,0),labelOrigin:e?.labelOrigin||this.icon?.labelOrigin||{x:22,y:22}},c(this)},u.setZIndex=function(e){this.zIndex=e},c(u),u}function m({iconUrl:e,textColor:t=i,fontFamily:n="DM Sans",fontSize:s="16px",fontWeight:o="500",titleFormatter:r}){return{render(i){let l=i.count;return h({position:i.position,title:r?r(l):`${l} markorer`,icon:{url:e,size:{width:44,height:52},origin:new google.maps.Point(0,0),labelOrigin:{x:22,y:22}},label:{text:String(l),color:t,fontFamily:n,fontSize:s,fontWeight:o},zIndex:a+l})}}}},3012:function(e,t,n){"use strict";n.r(t),n.d(t,{SvkConfirmationMap:function(){return h}});var i=n(33730),s=n(10766),o=n(28619),a=n(40651),r=n(99499),l=n(5693),c=n(74329);n(95093).locale("sv");class h extends HTMLElement{constructor(){super(),this.dom={},this.dom.el=this,this.filter=s.store.get().filter,this.options={cluster:!0,data:[],markerEvent:"panel",fullscreenControl:!1,streetViewControl:!1,scrollwheel:!1,minZoom:2,maxZoom:18},this.components={},this.map=null,this.bounds=void 0,this.initZoomLevel=void 0,this.items=[],this.markers=[],this.currentMarker=void 0,this.currentCluster=void 0,this.markerCluster=null,this.handleStoreChange=this.handleStoreChange.bind(this)}connectedCallback(){(0,o.em)(["marker"]).then(()=>{this.initMap(),this.initComponents(),this.addMarkers(),this.bindEvents()})}disconnectedCallback(){s.store.removeChangeListener(this.handleStoreChange)}initMap(){this.mapStyles={mapId:"692f62d000d4d233",...this.options},void 0!==this.filter.place?(this.mapStyles.zoom=12,this.mapStyles.center=new window.google.maps.LatLng(this.filter.latitude,this.filter.longitude)):(this.mapStyles.zoom=3.9,this.mapStyles.center=new window.google.maps.LatLng(61,17)),this.mapStyles.zoomControlOptions={position:window.google.maps.ControlPosition.LEFT_CENTER},this.innerHTML='<div class="map-container"></div><button class="map__reset-zoom svk-button button--secondary button--size-75 js-reset-zoom">Ã
terställ zoom</button>',this.map=new google.maps.Map(this.querySelector(".map-container"),this.mapStyles),this.markerCluster=new r.w1({map:this.map,markers:this.markers,algorithm:new r.t9({maxZoom:19,radius:60}),renderer:(0,a.ur)({iconUrl:"/assets/presentation/verktygsladan/assets/svg/pin-number.svg",textColor:"#000",fontFamily:"DM Sans",fontSize:"16px",fontWeight:"500",titleFormatter:e=>`${e} platser`}),onClusterClick:(e,t)=>this.handleClusterClick(t,e)}),this.bounds=new google.maps.LatLngBounds}initComponents(){this.components.mapPanel=new l.default(this.dom.el,{onClose:this.handleOnPanelClose.bind(this)}),this.options.cluster&&(this.components.mapClusterNav=new c.default(this.dom.el,{onClose:this.handleMenuPanelClose.bind(this),onClick:this.handleMenuPanelItemClick.bind(this)}))}async fetchData(){let e={...this.filter};return void 0!==e.view&&delete e.view,(await fetch(`/webapi/api-v2/confirmation/search?apiKey=cbe1f4b6-552e-497f-a3d4-dde7409c3566&${i.As(e)}`)).json()}adjustMapBounds(){this.markers.length?(this.map.fitBounds(this.bounds),google.maps.event.addListenerOnce(this.map,"bounds_changed",()=>{this.initZoomLevel=this.map.getZoom(),this.initZoomLevel>=10&&(this.initZoomLevel=10)})):(this.map.setCenter(new window.google.maps.LatLng(61,17)),this.map.setZoom(3.9))}addMarkers(){this.fetchData().then(e=>{e.confirmations.forEach(e=>{if(null!==e.geoLocation){const t=this.createMarker(e);this.markers.push(t)}}),s.store.updateCount(this.markers.length),this.markerCluster.addMarkers(this.markers),this.adjustMapBounds()})}createMarker(e,t){const n=e.geoLocation.split(","),i=(0,a.po)({position:new google.maps.LatLng(n[0],n[1]),map:this.map,data:e,icon:{url:"/assets/presentation/verktygsladan/assets/svg/pin-default.svg",size:new google.maps.Size(44,54),labelOrigin:{x:22,y:22},origin:new google.maps.Point(0,0)}});return i.addListener("click",e=>{this.handleMarkerClick(e,i)}),this.bounds.extend(i.position),i}
1removeAllMarkers(){this.markers.forEach(e=>{"map"in e&&(e.map=null)}),this.markers=[],this.markerCluster.clearMarkers(),this.bounds=new google.maps.LatLngBounds}activateCurrentMarker(e){e.setIcon({url:e.icon.url,size:new google.maps.Size(e.icon.size.width,e.icon.size.height),origin:new google.maps.Point(e.icon.size.width,0)}),this.currentMarker=e,this.map.panTo(e.getPosition())}deActivateCurrentMarker(){if(void 0===this.currentMarker)return!1;if(this.options.sorted){var e=this.currentMarker.getLabel();e.color="#000",this.currentMarker.setLabel(e),this.currentMarker.setZIndex(-1*parseInt(e.text))}this.currentMarker.setIcon({url:this.currentMarker.icon.url,size:new google.maps.Size(this.currentMarker.icon.size.width,this.currentMarker.icon.size.height),origin:new google.maps.Point(0,0),labelOrigin:{x:22,y:22}}),this.currentMarker=void 0}handleMenuPanelItemClick(e){if(this.currentMarker){let t=this.currentMarker.data.id;if(this.components.mapPanel.closePanel(),this.deActivateCurrentMarker(),t===e.data.id)return}void 0!==this.currentCluster&&(this.components.mapClusterNav.closeMenuPanel(),this.currentCluster=void 0),this.components.mapPanel.openPanel(e.data),this.activateCurrentMarker(e)}handleMenuPanelClose(){this.currentCluster=void 0}handleOnPanelClose(){this.deActivateCurrentMarker()}handleMarkerClick(e,t){if(this.currentMarker){let e=this.currentMarker.data.id;if(this.components.mapPanel.closePanel(),this.deActivateCurrentMarker(),e===t.data.id)return;this.activateCurrentMarker(t),setTimeout(()=>{this.components.mapPanel.openPanel(t.data)},300)}else void 0!==this.currentCluster&&(this.components.mapClusterNav.closeMenuPanel(),this.currentCluster=void 0),this.components.mapPanel.openPanel(t.data),this.activateCurrentMarker(t)}handleClusterClick(e){let t=e.markers||[];if(void 0!==this.currentMarker&&(this.components.mapPanel.closePanel(),this.deActivateCurrentMarker()),void 0!==this.currentCluster&&this.currentCluster.markers[0].data.id===t[0]?.data.id)this.components.mapClusterNav.closeMenuPanel(),this.components.mapPanel.closePanel(),this.currentCluster=void 0;else if(this.map.getZoom()>=18){this.currentCluster=e,this.components.mapClusterNav.openMenuPanel(t);let n=(0,a.ml)(t[0]);n&&this.map.setCenter(n)}else e.bounds&&this.map.fitBounds(e.bounds)}handleStoreChange(e){this.filter=e.filter,this.removeAllMarkers(),this.addMarkers()}handleResetZoom(){this.initZoomLevel>=10?this.map.setZoom(10):this.map.fitBounds(this.bounds)}bindEvents(){s.store.onChange(this.handleStoreChange),this.map.addListener("zoom_changed",()=>{setTimeout(()=>{const e=this.map.getZoom();void 0!==this.initZoomLevel&&(e>this.initZoomLevel?this.querySelector(".js-reset-zoom").classList.add("is-active"):this.querySelector(".js-reset-zoom").classList.remove("is-active"))},50)}),this.querySelector(".js-reset-zoom").addEventListener("click",this.handleResetZoom.bind(this))}template(){this.innerHTML='\n\t\t\t<div class="results__header">\n\t\t\t\t<div class="results__total-container">\n\t\t\t\t\t<span class="results__total label-75" role="alert" aria-live="assertive" aria-atomic="true"></span>\n\t\t\t\t\t<button class="svk-button results__filter-button js-open-filter">Filtrera</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t'}}window.customElements.define("svk-confirmation-map",h)},74329:function(e,t,n){"use strict";n.r(t);var i=n(53362),s=n(48357);t.default=class{constructor(e,t={}){this.dom={},this.dom.el=e,this.currentPanel=null,this.handleCloseClick=this.handleCloseClick.bind(this),this.options=t,this.currentMarkers=void 0,this.bindEvents()}openMenuPanel(e){this.currentMarkers=[...e],this.dom.el.insertAdjacentHTML("beforeend",i({markers:e})),this.currentPanel=this.dom.el.querySelector(`#panel-${e[0].data.id}-nav`),s(this.currentPanel,{translateX:[0,300]},{duration:150}),this.dom.el.querySelector(".map-panel-nav-close").addEventListener("click",this.handleCloseClick)}closeMenuPanel(){null!==this.currentPanel&&(s(this.currentPanel,{translateX:[300,0]},{duration:150,complete:()=>{this.dom.el.querySelector(".map-panel-nav-close").removeEventListener("click",this.handleCloseClick),this.currentPanel.parentElement.removeChild(this.currentPanel),this.currentPanel=null}}),this.options.onClose&&"function"==typeof this.options.onClose&&this.options.onClose(),this.currentMarkers=void 0)}handleCloseClick(){this.closeMenuPanel()}handleClick(e){if(e.target.matches(".map-panel-marker-btn")){let t=parseInt(e.target.getAttribute("data-index"),10),n=this.currentMarkers[t];this.options.onClick&&"function"==typeof this.options.onClick&&(setTimeout(()=>{this.options.onClick(n)},300),this.closeMenuPanel())}}bindEvents(){this.dom.el.addEventListener("click",this.handleClick.bind(this))}}},5693:function(e,t,n){"use strict";n.r(t);var i=n(37870),s=n(48357);t.default=class{constructor(e,t={}){this.dom={},this.dom.el=e,this.currentPanel=null,this.currentMarker=void 0,this.handleCloseClick=this.handleCloseClick.bind(this),this.options=t}getPlaceTitle(e){let t="";if(null!==e.placeName&&(t+=e.placeName),null!==e.places&&e.places.length){""!==t&&(t+=" â "),t+=e.places.shift(),e.places.length&&(t+="<br />",e.places=[...new Set(e.places)],t+=e.places.join(", "))}return t}
1openPanel(e){this.currentMarker=e,this.dom.el.insertAdjacentHTML("beforeend",i({getPlaceTitle:this.getPlaceTitle,data:e})),this.currentPanel=this.dom.el.querySelector(`#panel-${e.id}`),this.dom.el.querySelector(".map-panel-close").addEventListener("click",this.handleCloseClick),s(this.currentPanel,{translateX:["0%","100%"]},{duration:150})}closePanel(){null!==this.currentPanel&&(this.currentPanel=this.dom.el.querySelector("#panel-"+this.currentMarker.id),s(this.currentPanel,{translateX:["100%","0%"]},{duration:150,complete:()=>{this.dom.el.querySelector(".map-panel-close").removeEventListener("click",this.handleCloseClick),this.currentPanel.parentElement.removeChild(this.currentPanel),this.currentPanel=null}}),this.options.onClose&&"function"==typeof this.options.onClose&&this.options.onClose(this.currentMarker.id),this.currentMarker=void 0)}handleCloseClick(){this.closePanel()}}}}]);
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.