1import{d as k,c as w,a as p,w as L,e as F,b as t,F as _,r as U,o as d,t as f,v as N,k as y,i as D,n as b,m as B,h as V,p as E,f as C,q as I,l as z}from"./runtime-dom.esm-bundler.DpnJ9c__.js";import{_ as A}from"./ResponsiveImage.vue_vue_type_script_setup_true_lang.DeKohkQq.js";const j={class:"form-group"},P=["value"],R=k({__name:"FormSelect",props:{modelValue:{},options:{}},emits:["update:model-value"],setup(h,{emit:a}){const e=h,v=a,r=w({get(){return e.modelValue},set(m){v("update:model-value",m)}});return(m,l)=>(d(),p("label",j,[L(t("select",{class:"form-group__input",name:"type","onUpdate:modelValue":l[0]||(l[0]=i=>r.value=i)},[(d(!0),p(_,null,U(m.options,i=>(d(),p("option",{key:i.label,value:i.value},f(i.label),9,P))),128))],512),[[F,r.value]]),l[1]||(l[1]=t("div",{class:"form-group__icon"},[t("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 20 20","enable-background":"new 0 0 20 20","xml:space":"preserve"},[t("path",{d:`M14.5,11.6c-1.5,1.5-3,3-4.5,4.5c-1.5-1.5-3.2-3.2-4.5-4.5v-1.5c1.3,1.3,2.7,2.7,4,4.1C9.4,10.8,9.4,7.3,9.4,3.9h1.2 2 c0,3.4-0.1,6.9-0.1,10.3c1.3-1.3,2.7-2.7,4-4.1V11.6z`})])],-1))]))}}),q={class:"grid grid-cols-[60px,auto] outline outline-1 -outline-offset-1 outline-primary/20"},Y=k({__name:"FormDate",props:{modelValue:{}},emits:["update:model-value"],setup(h,{emit:a}){const e=h,v=a,r=w({get(){return e.modelValue},set(m){v("update:model-value",m)}});return(m,l)=>(d(),p("label",q,[L(t("input",{class:"col-start-1 col-span-full row-start-1 h-15 pl-15 pr-5 bg-transparent","onUpdate:modelValue":l[0]||(l[0]=i=>r.value=i),type:"date"},null,512),[[N,r.value]]),l[1]||(l[1]=t("div",{class:"col-start-1 row-start-1 w-15 h-15 p-5 fill-current pointer-events-none"},[t("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 20 20","enable-background":"new 0 0 20 20","xml:space":"preserve"},[t("path",{d:`M14.5,11.6c-1.5,1.5-3,3-4.5,4.5c-1.5-1.5-3.2-3.2-4.5-4.5v-1.5c1.3,1.3,2.7,2.7,4,4.1C9.4,10.8,9.4,7.3,9.4,3.9h1.2 3 c0,3.4-0.1,6.9-0.1,10.3c1.3-1.3,2.7-2.7,4-4.1V11.6z`})])],-1))]))}}),G={class:"kgs-grid"},J={class:"col-span-full md:col-span-2 lg:col-span-3"},K={class:"col-span-full md:col-span-2 lg:col-span-3"},H={class:"col-span-full md:col-span-2 lg:col-span-3"},Q=k({__name:"CalendarFilter",props:{modelValue:{},locationOptions:{},typeOptions:{}},emits:["update:model-value","filter-update"],setup(h,{emit:a}){const e=h,v=a,r=w({get(){return e.modelValue},set(m){v("update:model-value",m),v("filter-update")}});return(m,l)=>(d(),p("form",G,[t("div",J,[y(R,{modelValue:r.value.locations,"onUpdate:modelValue":l[0]||(l[0]=i=>r.value.locations=i),options:m.locationOptions},null,8,["modelValue","options"])]),t("div",K,[y(R,{modelValue:r.value.type,"onUpdate:modelValue":l[1]||(l[1]=i=>r.value.type=i),options:m.typeOptions},null,8,["modelValue","options"])]),t("div",H,[y(Y,{modelValue:r.value.date,"onUpdate:modelValue":l[2]||(l[2]=i=>r.value.date=i)},null,8,["modelValue"])])]))}}),W={class:"flex flex-col gap-10 md:gap-20"},X=["href"],Z={class:"relative aspect-[4/5]",itemscope:"",itemtype:"https://schema.org/Event"},ee={class:"absolute inset-0 bg-primary-light"},te={key:0,class:"inline-block text-xs font-bold tracking-widest uppercase px-2 py-1 bg-red-600 text-white w-fit"},se=["datetime"],oe=["datetime"],ae=["datetime"],le={class:"text-h4",itemprop:"name"},ne={class:"link-underline group-hover/event:link-underline-hover"},ie={class:"flex flex-col gap-1 lg:gap-5 lg:flex-row justify-between mt-auto"},re={itemprop:"location"},ue=["onClick"],pe={itemprop:"description"},de=["onClick"],ce=["aria-label"],me=["data-text"],ve={key:1,class:"text-lg text-secondary-dark"},ge=k({__name:"CalendarEvents",props:{results:{},displayRows:{},culture:{},translations:{}},emits:["update-location","update-type"],setup(h,{emit:a}){const e=h,v=a,r=s=>{v("update-location",s)},m=s=>{v("update-type",s)},l=s=>{let g=[];return s>=e.displayRows&&g.push("group-[:not(.active)]:hidden"),s<e.displayRows*2&&g.pu
3sh("group-[:not(.active)]:sm:block"),s<e.displayRows*3&&g.push("group-[:not(.active)]:md:block"),s<e.displayRows*4&&g.push("group-[:not(.active)]:lg:block"),g},i=D(!1),S=s=>{i.value=!i.value},x=w(()=>{const s=e.translations.showMore||"Show more",g=e.translations.showLess||"Show less";return i.value?g:s}),$=w(()=>e.results.length<=e.displayRows?"hidden":e.results.length<=e.displayRows*2?"sm:hidden":e.results.length<=e.displayRows*3?"md:hidden":e.results.length<=e.displayRows*4?"lg:hidden":""),o=w(()=>new Intl.DateTimeFormat(e.culture,{year:"numeric",month:"long",day:"numeric"})),c=s=>`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()}`,u=s=>o.value.format(s),M=s=>({source:s,sizes:[{screenMax:399,width:400,height:500},{screenMax:799,width:800,height:1e3},{screenMax:1279,width:400,height:500},{screenMax:1919,width:480,height:600},{width:520,height:650}],alt:"",fit:"cover"});return(s,g)=>(d(),p("div",W,[s.results&&s.results.length?(d(),p(_,{key:0},[t("div",{class:b(["kgs-grid group",{active:i.value}])},[(d(!0),p(_,null,U(s.results,(n,O)=>(d(),p("div",{key:n.url,class:b(["col-span-full sm:col-span-2 md:col-span-2 lg:col-span-3",l(O)])},[t("a",{class:"group/event",href:n.url},[t("article",Z,[t("div",ee,[n.imageUrl?(d(),p(_,{key:0},[y(A,B({ref_for:!0},M(n.imageUrl)),null,16),g[1]||(g[1]=t("div",{class:"absolute inset-0 bg-black/55"},null,-1))],64)):V("",!0)]),t("div",{class:b(["relative flex flex-col gap-2.5 w-full h-full p-5",n.imageUrl?"text-white":""])},[n.isSoldOut?(d(),p("div",te,f(s.translations.soldOut||"Sold out"),1)):V("",!0),t("div",null,[n.startDate.getTime()!=n.endDate.getTime()?(d(),p(_,{key:0},[t("time",{datetime:c(n.startDate),itemprop:"startDate"},f(u(n.startDate)),9,se),g[2]||(g[2]=E(" â ")),t("time",{datetime:c(n.endDate),itemprop:"endDate"},f(u(n.endDate)),9,oe)],64)):(d(),p("time",{key:1,datetime:c(n.startDate),itemprop:"startDate endDate"},f(u(n.startDate)),9,ae))]),t("h3",le,[t("span",ne,f(n.name),1)]),t("div",ie,[t("div",re,[n.location?(d(),p("button",{key:0,class:"link-underline",onClick:C(T=>r(n.location),["prevent"])},f(n.location),9,ue)):V("",!0)]),t("div",pe,[n.type?(d(),p("button",{key:0,class:"link-underline",onClick:C(T=>m(n.type),["prevent"])},f(n.type),9,de)):V("",!0)])])],2)])],8,X)],2))),128))],2),t("div",{class:b(["text-center",$.value])},[t("button",{class:"btn btn--border","aria-label":x.value,onClick:g[0]||(g[0]=n=>S())},[t("span",{"data-text":x.value},null,8,me)],8,ce)],2)],64)):(d(),p("p",ve,f(s.translations.noResults||"No events found"),1))]))}}),he={class:"flex flex-col gap-3 md:gap-5"},fe=k({__name:"App",props:{culture:{default:"da-DK"},locations:{},defaultLocation:{},types:{},displayRows:{},translations:{}},setup(h){const a=h,e=D({locations:a.defaultLocation??"",type:"",date:""}),v=w(()=>{var o;return((o=a.locations)==null?void 0:o.map((c,u)=>({label:c,value:u===0?"":c})))??[]}),r=w(()=>{var o;return((o=a.types)==null?void 0:o.map((c,u)=>({label:c,value:u===0?"":c})))??[]}),m=w(()=>{if(!e.value.date)return!0;const o=new Date(e.value.date),c=o.getTime();return!(isNaN(c)||o.getFullYear().toString().length!=4)}),l=D(!1),i=D([]),S=async()=>{if(!(!m.value||l.value)){l.value=!0;try{const o=new URL(window.location.origin);o.pathname="/api/events",o.search=new URLSearchParams({culture:a.culture,...e.value,date:e.value.date?new Date(e.value.date).toISOString():""}).toString();const c=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json"}}).then(u=>u.json());i.value=c.map(u=>({...u,startDate:new Date(u.startDate),endDate:new Date(u.endDate),isSoldOut:u.isSoldOut??!1}))}catch(o){console.log(o)}finally{l.value=!1}}},x=o=>{e.value.locations=o},$=o=>{e.value.type=o};return I(e,()=>{S()},{immediate:!0,deep:!0}),(o,c)=>(d(),p("div",he,[y(Q,{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=u=>e.value=u),"location-options":v.value,"type-options":r.value},null,8,["modelValue","location-options","type-options"]),y(ge,{results:i.value,"display-rows":o.displayRows,culture:o.culture,translations:o.translations,onUpdateLocation:x,onUpdateType:$},null,8,["results","display-rows","culture","translations"])]))}});function _e(h){var v,r;const a=h.dataset,e={culture:a.culture,locations:(v=a.locations)==null?void 0:v.split("|"),defaultLocation:a.locationDefault,types:(r=a.types)==null?void 0:r.split("|"),displayRows:a.rows&&a.rows!=="0"?parseInt(a.rows):3,translations:a.translations?JSON.parse(a.translations):{}};z(fe,{...e}).mount(h)}export{_e as default};
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.