1import{_ as V}from"./COFEzP2a.js";import{_ as j}from"./B0Qvdz15.js";import{_ as A}from"./9Hhzt7AZ.js";import{d as $}from"./Bd92y-L6.js";import{k as F,o as i,c as f,a as d,t as _,d as x,j as v,i as y,w as B,h as l,D as O,ac as R,I as U,F as M,r as P,b as z,C as H,m as E}from"./BWxz35FO.js";import{h as G}from"./DhjfO_53.js";import{_ as Y}from"./DlAUqK2U.js";import{_ as K}from"./CLuUwmWl.js";const p=e=>e&&G.decode(String(e).trim())||null;function Q(e){if(!e)return[];const r=[e.postcode,e.city].map(p).filter(Boolean).join(" ");return[p(e.title),p(e.street),r||null,p(e.country)].filter(Boolean)}function J(e){return p(e==null?void 0:e.title)}function q(e){return Q(e).join(", ")}function W(e){if(!e)return null;const r=p(e.link);if(r)return r;const c=q(e);return c?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(c)}`:null}const X=()=>{const e=t=>!Number.isNaN(t.getTime()),r=(t="")=>String(t).replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/,/g,"\\,").replace(/;/g,"\\;"),c=(t,o=!0)=>{const n=s=>String(s).padStart(2,"0"),a=[t.getFullYear(),n(t.getMonth()+1),n(t.getDate())].join("");return o?a+"T"+[n(t.getHours()),n(t.getMinutes()),n(t.getSeconds())].join(""):a},D=(t,o)=>{const n=u(t,o);return n?["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//SK Rapid//DE",n,"END:VCALENDAR"].join(`\r 2`):(console.error("Failed to create ICS data for event:",t),null)},u=(t,o)=>{var w,I,N,C,L;let n=(w=t.title)==null?void 0:w.trim();!t.is_match&&(o==null?void 0:o.length)>=1&&(n=t.title+" · "+o[0].name);const a=q(t.location),s=(I=t.start_date)==null?void 0:I.trim(),h=(((N=t.start_time)==null?void 0:N.trim())||"00:00").slice(0,5),b=((C=t.end_date)==null?void 0:C.trim())||s,g=(((L=t.end_time)==null?void 0:L.trim())||"23:59").slice(0,5),m=new Date(`${s}T${h}:00`),k=new Date(`${b}T${g}:00`);if(!e(m)||!e(k))return console.error("Invalid event date/time"),null;if(!n||!s)return null;const S=h==="00:00"&&g==="23:59"&&s===b;return["BEGIN:VEVENT",`UID:event-${t.id}@skrapid.at`,`DTSTAMP:${c(new Date)}`,`SUMMARY:${r(n)}`,`LOCATION:${r(a)}`,`DTSTART:${c(m,!S)}`,`DTEND:${c(k,!S)}`,"END:VEVENT"].join(`\r 3`)};return{createEventIcs:u,createSingleEventIcs:D,downloadIcsFile:(t,o)=>{const n=new Blob([t],{type:"text/calendar"}),a=URL.createObjectURL(n),s=document.createElement("a");s.href=a,s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(a)}}},Z={class:"b-event"},ee={class:"b-event__inner"},te={class:"b-event__date-time"},ne={class:"b-event__date"},ae={class:"b-date__day"},re={key:0,class:"b-event__time"},oe={key:0},se={class:"b-event__content"},ie={class:"b-event__content-header"},le={key:0,class:"b-event__heading"},ce={key:1,class:"b-event__categories"},de={class:"b-event__actions"},ue={__name:"Event",props:{title:{type:String,required:!0,default:null},location:{type:String,required:!1,default:null},day:{type:[String,Number],required:!0,default:null},month:{type:[String,Number],required:!1,default:null},startTime:{type:String,required:!1,default:null},endTime:{type:String,required:!1,default:null},categories:{type:Array,required:!1,default:()=>[]},actions:{type:Boolean,required:!1,default:!1},link:{type:String,required:!1,default:null},rawData:{type:Object,required:!1,default:null}},setup(e){const r=e,{createSingleEventIcs:c,downloadIcsFile:D}=X(),u=F().public.frontendUrl;u==null||u.replace(/^https?/,"webcal");const T=()=>{const a=c(r.rawData,r.categories);if(!a){console.error("Failed to create ICS data for event:",r.rawData);return}D(a,`event-${r.rawData.id}.ics`)},t=E(()=>{var a;return((a=r.rawData)==null?void 0:a.location)||null}),o=E(()=>
3{if(t.value){const a=J(t.value);if(a)return a}return r.location?$(r.location):null}),n=E(()=>t.value?W(t.value):null);return(a,s)=>{const h=V,b=j,g=A;return i(),f("div",Z,[d("div",ee,[d("div",te,[d("div",ne,[d("span",ae,_(e.day)+"."+_(e.month)+".",1)]),e.startTime?(i(),f("div",re,[x(_(e.startTime),1),e.endTime?(i(),f("span",oe,"â"+_(e.endTime),1)):v("",!0)])):v("",!0)]),d("div",se,[d("header",ie,[(i(),y(R(e.link?l(K):"div"),O(e.link?{to:e.link}:{},{class:"b-event__content-title"}),{default:B(()=>[e.title?(i(),f("h3",le,_(("decodeHtmlEntities"in a?a.decodeHtmlEntities:l($))(e.title)),1)):v("",!0)]),_:1},16)),l(o)?(i(),y(R(l(n)?"a":"div"),{key:0,class:U(["b-event__location",{"b-link":l(n)}]),href:l(n)||void 0,target:l(n)?"_blank":void 0,rel:l(n)?"noopener noreferrer":void 0},{default:B(()=>[d("span",null,_(l(o)),1),l(n)?(i(),y(h,{key:0,name:"arrow-up-right",size:"12"})):v("",!0)]),_:1},8,["class","href","target","rel"])):v("",!0),e.categories?(i(),f("div",ce,[(i(!0),f(M,null,P(e.categories,m=>(i(),y(b,{key:m.id,label:m.name,value:m.slug,static:""},null,8,["label","value"]))),128))])):v("",!0)])]),d("div",de,[z(g,{type:"simple",size:"s",icon:"calendar-event-line",label:a.$t("event.save"),onClick:H(T,["stop"])},null,8,["label"])])])])}}},ye=Y(ue,[["__scopeId","data-v-2ad8f500"]]);export{ye as _};
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.