1import{r as m,e as f,j as t,a2 as E,g as d,f as T,b as u,aq as R,a0 as y,i as C,bv as I,d as L,U as W}from"./index-Tiw4izbZ.js";import{m as D}from"./react-error-boundary-D1H7mSgt.js";import{O as G,C as P}from"./404-C0x7CMot.js";import{bn as U,w as N,b5 as z}from"./StatusWrapper-hulzzCnv.js";import{B as q}from"./Badge-DSx3_LL1.js";import"./index-CjN5q58W.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"58bf95d86c745a632813342779c71c00d275fc26"};var r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="a1cb6ba3-5485-4ffa-9da4-84a60698060d",e._sentryDebugIdIdentifier="sentry-dbid-a1cb6ba3-5485-4ffa-9da4-84a60698060d")}catch{}})();const p=Object.freeze({SET_STATUS:"SET_STATUS",SET_TICKET_DATA:"SET_TICKET_DATA"}),w={status:"IDLE",ticket:{}},O=(e,r)=>{switch(r.type){case p.SET_STATUS:return{...e,status:r.payload};case p.SET_TICKET_DATA:return{...e,ticket:r.payload};default:return w}},h=m.createContext(w),B=({children:e})=>{const[r,a]=m.useReducer(O,w),s=`https://app.gridaly.com/api/v1/event/${f(({landingPage:c})=>c==null?void 0:c.slug)}/ticket`,i=({cancelToken:c,attendeeUuid:l,userToken:x})=>{a({type:p.SET_STATUS,payload:"PENDING"}),E.get(`${s}/${l}/${x}`,{cancelToken:c.token}).then(b=>{a({type:p.SET_STATUS,payload:"SUCCESS"}),a({type:p.SET_TICKET_DATA,payload:b.data})}).catch(()=>{a({type:p.SET_STATUS,payload:"ERROR"})})},n=m.useMemo(()=>({state:r,getTicketData:i}),[r]);return t.jsx(h.Provider,{value:n,children:e})},F=d.p` 2 color: ${({theme:e})=>e.grey900}; 3 font-weight: ${({theme:e})=>e.bold}; 4 font-size: 1.1rem; 5 line-height: 1.6rem; 6 margin-bottom: 0.5rem; 7`,g=d.p` 8 font-size: 0.9rem; 9 line-height: 1.2rem; 10 color: ${({theme:e})=>e.grey900}; 11 margin: 0; 12 13 ${({featured:e})=>e&&T` 14 color: ${({theme:r})=>r.grey400}; 15 text-transform: uppercase; 16 font-weight: ${({theme:r})=>r.bold}; 17 `} 18`,H=d.div` 19 display: grid; 20 grid-template-columns: 1.5rem 1fr; 21 color: ${({theme:e})=>e.primary}; 22 width: 100%; 23 margin-bottom: 1rem; 24`,j=({text:e,icon:r})=>t.jsxs(H,{children:[t.jsx("i",{className:`fa-solid ${r}`}),t.jsx(g,{children:e})]}),K=d.div` 25 display: flex; 26 flex-direction: column; 27 gap: 1.9rem; 28 29 @media (min-width: ${({theme:e})=>e.breakpoints.sm}) { 30 gap: 1.1rem; 31 } 32`,M=d.div` 33 display: flex; 34 flex-direction: column; 35 gap: 1rem; 36 37 @media (min-width: ${({theme:e})=>e.breakpoints.sm}) { 38 gap: 1.25rem; 39 } 40 41 > div > *:first-child { 42 margin-bottom: 0.5rem; 43 } 44`,Q=d.div` 45 display: flex; 46 flex-wrap: wrap; 47 gap: 0.5rem; 48`,V=d.div` 49 width: 11.3rem; 50 height: 5.4rem; 51 max-width: 11.3rem; 52 max-height: 5.4rem; 53 54 img { 55 object-fit: contain; 56 width: 100%; 57 height: 100%; 58 } 59 60 @media (max-width: ${({theme:e})=>e.breakpoints.sm}) { 61 margin: auto; 62 } 63 @media (min-width: ${({theme:e})=>e.breakpoints.sm}) { 64 img { 65 object-position: 0; 66 } 67 } 68`,X=d.div` 69 width: 100%; 70 text-align: center; 71 display: flex; 72 align-items: center; 73 justify-content: center; 74 75 @media (min-width: ${({theme:e})=>e.breakpoints.sm}) { 76 margin-top: 1rem; 77 } 78`,J=d.div` 79 display: flex; 80 flex-direction: column; 81 gap: 1.5rem; 82 align-items: center; 83`,v=d.a` 84 text-align: center; 85 86 img { 87 min-height: 2.7rem; 88 } 89`,Y=()=>{const{t:e}=u(),{range:r,formatInTimeZone:a}=R(),o=f(({landingPage:_})=>_),{name:s,startingAt:i,endingAt:n,variant:c,venue:l,organiser:x,branding:b}=o??{},k=m.useMemo(()=>({shortStartingDate:r(i,n),onlyTime:a(i,"HH:mm")}),[i,n]),A=m.useMemo(()=>c==="online"?t.jsx(j,{icon:"fa-map-marker-alt",text:e("general.onlineGridaly")}):l!=null&&l.name?l!=null&&l.url?t.jsx("a",{href:l==null?void 0:l.url,target:"_blank",rel:"noopener noreferrer",children:t.jsx(j,{icon:"fa-map-marker-alt",text:l.name})}):t.jsx(j,{icon:"fa-map-marker-alt",text:l.name}):null,[c,l]);return t.jsxs(K,{children:[b.logo&&t.jsx(V,{children:t.jsx("img",{src:b.logo,alt:s})}),t.jsxs("div",{children:[t.jsx(F,{children:s}),x.name&&t.jsx(g,{featured:!0,children:x.name})]}),t.jsxs("div",{children:[t.jsx(j,{icon:"fa-calendar-alt",text:`${k.shortStartingDate} | ${k.onlyTime}`}),A]})]})},Z=()=>{const{t:e}
89=u(),{state:{ticket:r}}=m.useContext(h),{permissions:a,eventAccessUrl:o}=r??{};return!(a!=null&&a.canLive)||!(a!=null&&a.canLogin)?null:t.jsx(y.Root,{variant:"neutral",mode:"stroke",asChild:!0,children:t.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:e("general.loginPlatform")})})},ee=()=>{const{state:{ticket:e}}=m.useContext(h),r=e==null?void 0:e.token,[a,o]=m.useState();return m.useEffect(()=>{r&&U.toDataURL(r,{width:250,margin:4,padding:8,color:{dark:"#000",light:"#fff"}},(s,i)=>{s&&console.error(s),o(i)})},[r]),a?t.jsx(X,{children:t.jsx("img",{src:a,alt:"qr code"})}):null},te="/assets/pl-Du9OWcjt.svg",re="/assets/cs-0AjuVMp4.svg",ae="/assets/de-CN9GuSVU.svg",se="/assets/en-CErk_MfJ.svg",ne=()=>{const{t:e}=u(),{language:r}=C,a=f(({global:s})=>s==null?void 0:s.languages);switch(a==null?void 0:a.find(s=>s.id===r)){case"pl":return t.jsx("img",{src:te,alt:e("general.addToAppleWallet")});case"cs":return t.jsx("img",{src:re,alt:e("general.addToAppleWallet")});case"de":return t.jsx("img",{src:ae,alt:e("general.addToAppleWallet")});case"en":default:return t.jsx("img",{src:se,alt:e("general.addToAppleWallet")})}},oe="/assets/pl-CoUvq82V.svg",ie="/assets/cs-DogfUXA5.svg",le="/assets/de-BbxpIj6b.svg",de="/assets/en-DLqW-8Qh.svg",ce=()=>{const{t:e}=u(),{language:r}=C,a=f(({global:s})=>s==null?void 0:s.languages);switch(a==null?void 0:a.find(s=>s.id===r)){case"pl":return t.jsx("img",{src:oe,alt:e("general.addToGooglePay")});case"cs":return t.jsx("img",{src:ie,alt:e("general.addToGooglePay")});case"de":return t.jsx("img",{src:le,alt:e("general.addToGooglePay")});case"en":default:return t.jsx("img",{src:de,alt:e("general.addToGooglePay")})}},me=()=>{const{t:e}=u(),{state:{ticket:r}}=m.useContext(h),{pdf:a,applePass:o,googlePass:s}=(r==null?void 0:r.ticketDownload)??{};if(!a&&!o&&!s)return null;const i=n=>I(n,{ticketName:r==null?void 0:r.ticketName});return t.jsxs(J,{children:[o&&t.jsx(v,{href:o,target:"_blank",rel:"noreferrer",onClick:()=>i("ticketDownloadApple"),children:t.jsx(ne,{})}),s&&t.jsx(v,{href:s,target:"_blank",rel:"noreferrer",onClick:()=>i("ticketDownloadGoogle"),children:t.jsx(ce,{})}),a&&t.jsx(y.Root,{variant:"neutral",mode:"filled",asChild:!0,children:t.jsxs("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:()=>i("ticketDownloadPdf"),children:[t.jsx(y.Icon,{as:N}),e("general.ticketDownload")]})})]})},ge=()=>{var a,o,s,i;const{t:e}=u(),{state:{ticket:r}}=m.useContext(h);return t.jsxs(M,{children:[(r==null?void 0:r.name)&&t.jsxs("div",{children:[t.jsx(g,{featured:!0,children:e("general.fullName")}),t.jsx(g,{children:r==null?void 0:r.name})]}),(r==null?void 0:r.email)&&t.jsxs("div",{children:[t.jsx(g,{featured:!0,children:e("general.emailAdress")}),t.jsx(g,{children:r==null?void 0:r.email})]}),((a=r==null?void 0:r.roles)==null?void 0:a.length)>0&&t.jsxs("div",{children:[t.jsx(g,{featured:!0,children:e("general.participatesAs")}),(o=r==null?void 0:r.roles)==null?void 0:o.map(n=>t.jsx(g,{children:n==null?void 0:n.name},n==null?void 0:n.id))]}),(r==null?void 0:r.ticketName)&&t.jsxs("div",{children:[t.jsx(g,{featured:!0,children:e("general.ticketType")}),t.jsx(g,{children:r==null?void 0:r.ticketName})]}),((s=r==null?void 0:r.addonables)==null?void 0:s.length)>0&&t.jsxs("div",{children:[t.jsx(g,{featured:!0,children:e("general.addons")}),t.jsx(Q,{children:(i=r==null?void 0:r.addonables)==null?void 0:i.map(n=>t.jsx(q,{value:n==null?void 0:n.name,variant:"opacity",color:"grey600",fontSize:"0.9rem"},n==null?void 0:n.id))})]}),(r==null?void 0:r.customFields)&&t.jsx(z,{customFields:r.customFields,questionStyles:{color:"grey500",lineHeight:"1.2rem"},textStyles:{color:"grey900",lineHeight:"1.2rem"},gap:"0.5rem"})]})},S="rgb(96, 109, 178)",pe=d.div` 90 overflow: auto; 91 width: 100%; 92 height: 100%; 93 background: ${({theme:e})=>e.white}; 94 padding: 2.9rem 1.1rem; 95 96 ${({backgroundColor:e})=>e&&T` 97 background: ${e}; 98 `} 99 100 ${({backgroundImage:e})=>e&&T` 101 background-image: url(${e}); 102 background-position: center center; 103 background-size: cover; 104 background-repeat: no-repeat; 105 `} 106 107 @media (min-width: ${({theme:e})=>e.breakpoints.sm}) { 108 display: grid; 109 justify-content: center; 110 } 111`,ue=d.div` 112 @media (max-width: ${({theme:e})=>e.breakpoints.sm}) { 113 ${({theme:e})=>e.shadowRegular({})}; 114 background: ${({theme:e})=>e.white}; 115 border-radius: ${({theme:e})=>e.borderRadius900}; 116 /* Keeps the separator's notch circles inside the card: they are white, so against the 117 event background they would otherwise read as bumps instead of cut-outs. */ 118 overflow: hidden; 119 } 120 121 @media (min-width: ${({theme:e})=>e.breakpoints.sm}) { 122 display: grid; 123 grid-template-columns: 1fr auto 1fr; 124 max-width: 50rem; 125 align-self: safe center; 126 127 > * { 128 background: ${({theme:e})=>e.white}; 129 ${({theme:e})=>e.shadowRegular({})}; 130 131 &:first-child { 132 border-radius: ${({theme:e})=>`${e.borderRadius900} 0 0 ${e.borderRadius900}`}; 133 } 134 135 &:last-child { 136 border-radius: ${({theme:e})=>`0 ${e.borderRadius900} ${e.borderRadius900} 0`}; 137 } 138 } 139 } 140`,$=d.div` 141 display: flex; 142 flex-direction: column; 143 gap: 1.5rem; 144 padding: 1.9rem 1.25rem; 145 146 @media (min-width: ${({theme:e})=>e.breakpoints.sm}) { 147 padding: 2.1rem; 148 149 ${({largeGap:e})=>e&&T` 150 gap: 2.5rem; 151 `} 152 } 153`,he=d.div` 154 @media (max-width: ${({theme:e})=>e.breakpoints.sm}) { 155 position: relative; 156 width: 100%; 157 margin: 1rem 0; 158 border-top: 2px dashed ${({theme:e})=>e.grey200}; 159 &:after {
160 content: ''; 161 z-index: 1; 162 position: absolute; 163 display: block; 164 width: 1.9rem; 165 height: 1.9rem; 166 border-radius: 50%; 167 background-color: ${({theme:e})=>e.white}; 168 top: 0; 169 right: 0; 170 transform: translate(50%, -50%); 171 box-shadow: inset 4px 0px 10px -9px ${({theme:e})=>e.transparentize({color:S})}; 172 } 173 &:before { 174 content: ''; 175 z-index: 1; 176 position: absolute; 177 display: block; 178 width: 1.9rem; 179 height: 1.9rem; 180 border-radius: 50%; 181 background-color: ${({theme:e})=>e.white}; 182 top: 0; 183 left: 0; 184 transform: translate(-50%, -50%); 185 box-shadow: inset -4px 0px 10px -9px ${({theme:e})=>e.transparentize({color:S})}; 186 } 187 } 188 189 @media (min-width: ${({theme:e})=>e.breakpoints.sm}) { 190 height: calc(100% - 1.6rem); 191 width: 1.6rem; 192 margin: 0.8rem 0; 193 position: relative; 194 box-shadow: 195 0 1px 0 0 #fff, 196 0 -1px 0 0 #fff; 197 display: flex; 198 justify-content: center; 199 200 > * { 201 height: 100%; 202 border-right: 2px dashed ${({theme:e})=>e.grey200}; 203 transform: translateX(-50%); 204 } 205 206 &:after, 207 &:before { 208 content: ''; 209 width: 2.5rem; 210 height: 2.5rem; 211 position: absolute; 212 right: 0.8rem; 213 transform: translate(50%, -50%) rotate(45deg); 214 215 border: 8px solid transparent; 216 border-bottom-color: #fff; 217 border-right-color: #fff; 218 border-radius: 100%; 219 pointer-events: none; 220 } 221 &:before { 222 top: -0.8rem; 223 } 224 &:after { 225 transform: translate(50%, 50%) rotate(225deg); 226 bottom: -0.8rem; 227 } 228 } 229`,fe=()=>{var i,n;const{state:{status:e},getTicketData:r}=m.useContext(h),a=f(({landingPage:c})=>c),{attendeeUuid:o,userToken:s}=L();return m.useEffect(()=>{const c=E.CancelToken.source();return r({cancelToken:c,attendeeUuid:o,userToken:s}),()=>c.cancel()},[]),e==="PENDING"||e==="IDLE"?t.jsx(W,{size:"3",container:!0}):e==="ERROR"?t.jsx(P,{}):t.jsx(pe,{backgroundColor:(i=a==null?void 0:a.colors)==null?void 0:i.background,backgroundImage:(n=a==null?void 0:a.branding)==null?void 0:n.bg,children:t.jsxs(ue,{children:[t.jsxs($,{children:[t.jsx(Y,{}),t.jsx(ge,{})]}),t.jsx(he,{children:t.jsx("div",{})}),t.jsxs($,{largeGap:!0,children:[t.jsx(ee,{}),t.jsx(me,{}),t.jsx(Z,{})]})]})})},xe=()=>t.jsx(D,{FallbackComponent:()=>null,children:t.jsx(B,{children:t.jsx(G,{children:t.jsx(fe,{})})})}),ve=()=>t.jsx(D,{FallbackComponent:()=>null,children:t.jsx(xe,{})});export{ve as default}; 230//# sourceMappingURL=Ticket-CHie-LW9.js.map
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.