import{s as c,t as l,p as S,f as ge,A as he,a as J,d as U,u as Y,b as K,c as pe,e as ve,g as p,h as I,o as me,n as fe,i as ye,j as we,k as r,S as u,N as Ee,H as be,l as Se,G as M,m as z,M as C,L as D,r as N,q as xe,v as ke,w as O,C as $e,x as Ce,D as He,E as Le,y as De,z as Re,B as Te,F as Pe,P as Q,I as Fe,J as _e}from"./index-7832e1e4.js";import{R as j}from"./related-posts-list-f981d27b.js";import"./related-posts-list.style-e9f56063.js";const{spacing:v}=l,Ae=c.div` container-type: inline-size; margin: ${m=>m.adjustForHcpHeader?l.header.desktop.height.fixedHcp.value+l.header.desktop.height.fixedHcp.unit:v.xl} 0; @media print { display: none; } ${l.mediaQueries.mobileMax} { margin: 0; } `,Be=c.div` ${l.mediaQueries.mobileMax} { padding: 0 20px; } `,Ge=c.div` ${m=>m.fullWidth?"":` padding-right: ${v.l}; border-right: 1px solid red; ${l.mediaQueries.tabletMax} { padding-right: 0; border-right: none; } `} `,q=c.div` color: ${S.gray}; height: 5.86rem; font-family: ${ge}; font-size: 1.64rem; padding-top: 1rem; display: flex; gap: 0.5rem; `,W=c(he)` height: max-content; color: ${S.gray}; &:hover { color: ${l.palette.pink}; } `,V=c.div` color: ${S.red}; `,Ie=c.div` position: relative; background-color: white; border-radius: 1.43rem; padding: ${v.xl} ${v.m} ${v.ms} ${v.m}; margin: ${v.xs} 0; ${l.mediaQueries.mobileMax} { padding: ${v.s}; } `,Me=c.div` display: flex; justify-content: space-between; padding: ${v.xxxs} ${v.m}; ${l.mediaQueries.mobileMax} { flex-direction: column; padding: 0; } `,ze=c.div` font-family: ${J}; font-weight: 800; font-size: 1.29rem; color: ${l.palette.darkGray}; padding-right: 3rem; ${l.mediaQueries.mobileMax} { border-bottom: 1px solid ${S.red}; padding-bottom: 3rem; } `,Ne=c.div` display: flex; flex-direction: column; font-family: ${J}; font-weight: 800; font-size: 1.29rem; color: ${l.palette.darkGray}; gap: 0.5rem; padding-left: 3rem; text-wrap: nowrap; border-left: 1px solid ${S.red}; ${l.mediaQueries.mobileMax} { border-left: none; padding-top: 3rem; padding-left: 0; } `,Oe=c.div` display: flex; flex-direction: row; gap: 1rem; `,Qe=c.div` display: flex; flex-direction: row; gap: 1rem; white-space: normal; `,R=c.p` margin: 0; `,je=c.p` margin: 0; `,qe=U.gql` query GetEvent($key: String!) { event: resource(key: $key) { content key } } `,We=U.gql` query GetRelatedEvents( $tags: [String] ) { relatedEvents: resources( type: "event" tags: $tags ) { content } } `,Ve=(m,H)=>{var w,g,f;const{createCachedResource:x}=Y(K),[k]=x(We,()=>({tags:m}),!0);return(f=(g=(w=k())==null?void 0:w.relatedEvents)==null?void 0:g.filter(h=>h.content.id!==H))==null?void 0:f.filter(h=>new Date(h.content.date).getTime()>=new Date().getTime())},Je=Pe("<div>"),Xe=()=>{const m=pe(),H=ve(),{appStore:x,setCacheType:k,setStatusCode:w,localize:g,eventsListingPage:f,hcpEventsListingPage:h,viewport:L,userState:X,pageRegistration:Z,createCachedResource:ee,siteInfo:T,headerSettings:te}=Y(K),P=()=>L.width<=l.breakpoints.ORIGINAL_TABLET,E=()=>L.width<=l.breakpoints.MOBILE,ne=ee(qe,()=>({key:`/event/${H.eventSlug}`}),!0),[o]=ne,re=()=>{var i,e,t;return(t=(e=(i=o())==null?void 0:i.event)==null?void 0:e.content)==null?void 0:t.tags},oe=()=>{var i,e,t;return(t=(e=(i=o())==null?void 0:i.event)==null?void 0:e.content)==null?void 0:t.id},$=p(()=>Ve(re(),oe()));I(me(()=>m.hash,()=>fe({id:m.hash.replace("#",""),smallScreen:E(),isCareSite:T.siteType==="atos-care"})));const ie=()=>!E(),b=()=>F()?(k(Q.none),!0):(k(Q.defaultCache),!1),F=()=>{var i,e,t;return m.pathname==="/"?!1:x.isHcp()?!0:!!((t=(e=(i=o())==null?void 0:i.event)==null?void 0:e.content)!=null&&t.isHealthcareProfessional)},_=()=>{const i=F();return x.setHcp(i),null};_(),I(()=>{_()});const ae=()=>{var i,e,t,n,a,s;return((t=(e=(i=o())==null?void 0:i.event)==null?void 0:e.content)==null?void 0:t.isHealthcareProfessional)&&!((s=(a=(n=o())==null?void 0:n.event)==null?void 0:a.content)!=null&&s.isVisibleForPublic)&&!X.user&&Z.url!==""},se=()=>{var e,t,n,a,s;const i=(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.eventDate;return Fe((s=(a=o())==null?void 0:a.event)==null?void 0:s.content)?g("on-demand","On demand"):i?_e(i,T.key):""},A=p(()=>{var i,e;return(e=(i=o())==null?void 0:i.event)!=null&&e.content?(typeof w=="function"&&w(200),!1):(typeof w=="function"&&w(404),!0)}),le=()=>{var e,t,n,a,s,d;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)!=null&&n.showRelatedEvents&&((d=(s=(a=o())==null?void 0:a.event)==null?void 0:s.content)==null?void 0:d.relatedEventsPosition)==="sidebar"&&!P()?[8,4]:[12]},B=()=>{var n,a,s,d,y,G;const i=((s=(a=(n=o())==null?void 0:n.event)==null?void 0:a.content)==null?void 0:s.eventExpireDate)||((G=(y=(d=o())==null?void 0:d.event)==null?void 0:y.content)==null?void 0:G.eventDate);if(!i)return!0;const e=new Date;e.setHours(0,0,0,0);const t=new Date(i);return t.setHours(0,0,0,0),t>=e},de=()=>{var i,e,t,n,a,s,d;return(t=(e=(i=o())==null?void 0:i.event)==null?void 0:e.content)!=null&&t.isFullyBooked||!B()?!1:(d=(s=(a=(n=o())==null?void 0:n.event)==null?void 0:a.content)==null?void 0:s.eventRegistrationLink)==null?void 0:d.url},ce=()=>te.activateHcpHeader&&b()&&!ue(),ue=()=>L.width<=l.breakpoints.ORIGINAL_TABLET;return(()=>{const i=ye(Je);return we(i,r(Ae,{get adjustForHcpHeader(){return ce()},get children(){return[r(u,{get when(){return A()&&!o.loading},get children(){return r(Ee,{})}}),r(u,{get when(){return!A()&&!o.loading},get children(){return[r(be,{get isHcp(){return b()}}),r(Se,{get seo(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.seo},get title(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.post_title}}),r(u,{get when(){return E()},get children(){return r(M,{templateShorthand:[12],isLayoutGrid:!0,get children(){return r(q,{get children(){return r(z,{get children(){return[r(C,{get when(){return b()&&h.url},get children(){return r(D,{get url(){return h.url},get label(){return h.title},plainStyle:!0,arrowDirection:"left",size:"small"})}}),r(C,{get when(){return!b()&&f.url},get children(){return r(D,{get url(){return f.url},get label(){return f.title},plainStyle:!0,arrowDirection:"left",size:"small"})}})]}})}})}})}}),r(Be,{get children(){return r(M,{get templateShorthand(){return le()||[8,4]},get isLayoutGrid(){return ie()},get children(){return[r(Ge,{get fullWidth(){var e,t,n,a,s,d;return!((n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)!=null&&n.showRelatedEvents)||((d=(s=(a=o())==null?void 0:a.event)==null?void 0:s.content)==null?void 0:d.relatedEventsPosition)==="bottom"||P()},get children(){return[r(u,{get when(){return!E()},get children(){return r(q,{get children(){return r(z,{get children(){return[r(C,{get when(){return b()&&h.url},get children(){return[r(W,{get href(){return h.url},get children(){return[p(()=>h.title)," /"]}}),r(V,{get children(){var e,t,n;return N((n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.post_title)}})]}}),r(C,{get when(){return!b()&&f.url},get children(){return[r(W,{get href(){return f.url},get children(){return[p(()=>f.title)," /"]}}),r(V,{get children(){var e,t,n;return N((n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.post_title)}})]}})]}})}})}}),r(Ie,{get children(){return[r(u,{get when(){return ae()},get children(){return r(xe,{})}}),r(Me,{get children(){return[r(ze,{get children(){return[r(ke,{tag:"h1",get children(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.post_title}}),r(u,{get when(){var e,t,n;return((n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.listCardContent.displayHostName)==="yes"},get children(){return r(je,{get children(){return[p(()=>g("hosted-by","Hosted By")),": ",p(()=>{var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.listCardContent.hostName})]}})}})]}}),r(Ne,{get children(){return[r(u,{get when(){var e,t,n;return p(()=>!!E())()&&((n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.isFullyBooked)},get children(){return r(R,{get children(){return g("event-fully-booked","Fully Booked")}})}}),r(Oe,{get children(){return[r(O,{top:-5,get children(){return r($e,{height:2.21,width:1.79})}}),r(R,{get children(){return se()}})]}}),r(u,{get when(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.eventLocation},get children(){return r(Qe,{get children(){return[r(O,{top:-2,get children(){return r(Ce,{height:2.21,width:1.79})}}),r(R,{get children(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.eventLocation}})]}})}}),r(u,{get when(){return de()},get children(){return r(D,{get url(){return o().event.content.eventRegistrationLink.url},get opensInNewTab(){return o().event.content.eventRegistrationLink.target==="_blank"},get label(){return g("register-now","Register now")},arrowDirection:"right",arrowPosition:"right",get arrowColor(){return l.palette.red},plainStyle:!0,get labelColor(){return l.palette.red},size:"large"})}}),r(u,{get when(){return!E()},get children(){return r(He,{type:"event",size:"small",get customText(){return p(()=>{var e,t,n;return!!((n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)!=null&&n.isFullyBooked)})()?g("event-fully-booked","Fully Booked"):void 0}})}})]}})]}}),r(Le,{get gotoEventId(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.gotoEventId},get isDisabledEvent(){return!B()},get children(){return r(De,{get content(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.blocks},get permalink(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.permalink},get pageTitle(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.post_title}})}}),r(Re,{type:"event",get permalink(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.permalink},get title(){var e,t,n;return(n=(t=(e=o())==null?void 0:e.event)==null?void 0:t.content)==null?void 0:n.post_title},get data(){var e,t;return(t=(e=o())==null?void 0:e.event)==null?void 0:t.content}})]}})]}}),r(u,{get when(){var e;return p(()=>{var t,n,a,s,d,y;return!!((a=(n=(t=o())==null?void 0:t.event)==null?void 0:n.content)!=null&&a.showRelatedEvents&&((y=(d=(s=o())==null?void 0:s.event)==null?void 0:d.content)==null?void 0:y.relatedEventsPosition)==="sidebar")})()&&((e=$())==null?void 0:e.length)>0},get children(){return r(j,{get heading(){return g("related-events","Related events")},orientation:"vertical",get relatedPosts(){return $()}})}})]}})}}),r(u,{get when(){var e;return p(()=>{var t,n,a,s,d,y;return!!((a=(n=(t=o())==null?void 0:t.event)==null?void 0:n.content)!=null&&a.showRelatedEvents&&((y=(d=(s=o())==null?void 0:s.event)==null?void 0:d.content)==null?void 0:y.relatedEventsPosition)==="bottom")})()&&((e=$())==null?void 0:e.length)>0},get children(){return r(Te,{widthType:"bgFull",templateShorthand:[12],isLayoutSection:!0,get children(){return r(j,{get heading(){return g("related-events","Related events")},orientation:"horizontal",get relatedPosts(){return $()}})}})}})]}})]}})),i})()};export{Xe as Event}; //# sourceMappingURL=event-384c6ab4.js.map