1import{y as T,k as P,_ as k,A as y,a4 as c,a5 as u,ag as S,ab as W,ai as C,ao as q,ap as I,Y as R,j as f,D as d,E as j,a1 as F,a0 as z,$ as M,M as Z,aq as O}from"./D0rPpKiU.js";import{W as V}from"#entry";import"./D_gTWDL9.js";const Y={key:0,class:"pb-4"},G={class:"title-bold-8"},H={class:"title-8 text-cool-grey-500"},U=["aria-label"],J={class:"start"},K={class:"end"},Q={class:"title"},X={class:"timezone"},ee={class:"description"},te=T({__name:"AddToCalendarBase",props:{label:{default:"Add to Calendar"},duration:{default:60},title:{default:"Webinar Title"},description:{default:"A default webinar description."},livePageLinkLabel:{default:"Webinar Link"},showEventTime:{type:Boolean,default:!1},addEventScript:{default:"https://addevent.com/libs/atc/1.6.1/atc.min.js"},staticLivePageLink:{default:""},eventStart:{default:""}},setup(o){const r=o,g=R(),v=V(),m=f(!1),l=f(null),s=f(""),b=f(null),h=f(null),_=f({}),L=d(()=>Intl.DateTimeFormat().resolvedOptions().timeZone);function w(a){const i=a.getFullYear(),e=a.getMonth()+1,t=a.getDate(),n=String(a.getHours()).padStart(2,"0"),p=String(a.getMinutes()).padStart(2,"0");return`${i}-${e}-${t} ${n}:${p}`}const $=d(()=>l.value?w(l.value):""),D=d(()=>l.value?w(new Date(l.value.getTime()+r.duration*6e4)):""),x=d(()=>`${r.description} 2 3${r.livePageLinkLabel}: ${s.value}`),A=d(()=>l.value?l.value.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"}):""),B=d(()=>{if(!l.value)return"";const a=l.value.toLocaleDateString(void 0,{timeZoneName:"short"}).split(", ").pop();return`${l.value.toLocaleDateString(void 0,{timeZoneName:"long"}).split(", ").pop()} (${a})`});function E(){const a=b.value?.querySelector("a, button"),i=h.value;if(!a||!i)return;const e=getComputedStyle(a);_.value={display:"inline-flex",alignItems:e.alignItems,justifyContent:e.justifyContent,background:e.background,backgroundColor:e.backgroundColor,backgroundImage:e.backgroundImage,color:e.color,border:e.border,borderRadius:e.borderRadius,height:e.height,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight,fontFamily:e.fontFamily,fontSize:e.fontSize,fontWeight:e.fontWeight,letterSpacing:e.letterSpacing,width:e.width,minWidth:e.minWidth,boxSizing:"border-box",cursor:"pointer",transition:e.transition};const t=i.querySelector(".addeventatc_icon");a.childNodes.forEach(n=>{i.insertBefore(n.cloneNode(!0),t)})}async function N(a){try{const e=(await $fetch("/api/proxy/platform/attendee-webinar",{method:"GET",params:{uuid:a}}))?.attendee;if(e?.timeslot){const n=new Date(e.timeslot);isNaN(n.getTime())||(l.value=n)}const t=e?.webinar?.settings?.maropostConfig?.livePageLink;t&&(s.value=t)}catch(i){console.error("[AddToCalendarBase] Failed to fetch attendee data:",i)}}return P(async()=>{if(r.eventStart){const t=new Date(r.eventStart);isNaN(t.getTime())||(l.value=t)}if(r.staticLivePageLink)s.value=r.staticLivePageLink;else{const t=v.uuid||g.query.a||"";if(t){await N(t);const n=g.query.a||v.uuid;if(n&&s.value)try{const p=new URL(s.value);p.searchParams.set("a",n),s.value=p.toString()}catch{s.value=`${s.value}?a=${n}`}}if(!s.value){const n=g.path.split("/").filter(Boolean)[0];n&&(s.value=`${window.location.origin}/${n}/live`)}}const a=r.addEventScript||"https://addevent.com/libs/atc/1.6.1/atc.min.js",i=document.querySelector(`script[src="${a}"]`),e=async()=>{E(),m.value=!0,globalThis.addeventatc?.refresh(),await j();const n=b.value?.querySelector("a, button");if(n&&h.value){const p=getComputedStyle(n).color;h.value.style.setProperty("color",p,"important")}};if(i)requestAnimationFrame(e);else{const t=document.createElement("script");t.src=a,t.async=!0,t.onload=e,t.onerror=e,document.head.appendChild(t)}}),(a,i)=>(k(),y("div",null,[o.showEventTime&&l.value?(k(),y("div",Y,[c("p",G,[c("strong",null,u(A.value),1)]),c("p",H,u(B.value),1)])):S("",!0),c("div",{ref_key:"styleSourceRef",ref:b,class:"absolute -left-[9999px] -top-[9999px] pointer-events-none","aria-hidden":"true"},[W(a.$slots,"default")],512),C(c("div",{ref_key:"addeventEl",ref:h,class:"addeventatc",style:q(_.value),"aria-label":o.label,"data-test":"webinars-addtocalendar-button"},[i[0]||(i[0]=c("span",{class:"addeventatc_icon"},null,-1)),c("span",J,u($.value),1),c("span",K,u(D.value),1),c("span",Q,u(o.title),1),c("span",X,u(L.value),1),c("span",ee,u(x.value),1)],12,U),[[I,m.value]])]))}}),ae=Object.assign(te,{__name:"AddToCalendarBase"}),ne={key:0},oe=T({__name:"AddToCalendarWrapper",props:{blok:{}},setup(o){const r=o,g=d(()=>{const m=parseInt(r.blok.duration??"",10);return Number.isFinite(m)?m:60}),v=d(()=>r.blok.button?.[0]??null);return(m,l)=>{const s=Z("StoryblokComponent"),b=O("editable");return o.blok?C((k(),y("div",ne,[F(ae,{label:v.value?.label,duration:g.value,title:o.blok.title,de
3scription:o.blok.description,"live-page-link-label":o.blok.live_page_link_label,"show-event-time":o.blok.show_event_time,"add-event-script":o.blok.script,"static-live-page-link":o.blok.live_page_link,"event-start":o.blok.event_start},{default:z(()=>[v.value?(k(),M(s,{key:0,blok:v.value},null,8,["blok"])):S("",!0)]),_:1},8,["label","duration","title","description","live-page-link-label","show-event-time","add-event-script","static-live-page-link","event-start"])])),[[b,o.blok]]):S("",!0)}}}),re=Object.assign(oe,{__name:"AddToCalendarWrapper"});export{re 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.