1import{b as R,e as x,r as c,a2 as b,a3 as h,j as i,N as y,l as C,U as I,g as T}from"./index-Tiw4izbZ.js";import{a as m}from"./404-C0x7CMot.js";import"./react-error-boundary-D1H7mSgt.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"58bf95d86c745a632813342779c71c00d275fc26"};var a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="da70832c-03d3-4534-a0c7-cdb25b17b096",t._sentryDebugIdIdentifier="sentry-dbid-da70832c-03d3-4534-a0c7-cdb25b17b096")}catch{}})();const _=(t,a)=>{switch(a.type){case"FETCH_INIT":return{...t,status:"PENDING"};case"FETCH_SUCCESS":return{...t,status:"SUCCESS",value:a.payload,external:a.external};case"FETCH_FAILURE":return{...t,status:"ERROR",error:a.payload};default:throw new Error}},F=()=>{const{t}=R(),o=`https://app.gridaly.com/api/v1/live/${x(({event:s})=>s==null?void 0:s.slug)}/navigation/redirect`,[f,r]=c.useState(),[g,u]=c.useReducer(_,{status:"IDLE",value:null,external:!1,error:!1}),S=()=>{r(h(4))};return c.useEffect(()=>{let s=!1;return f&&(async()=>{await u({type:"FETCH_INIT"});try{s||b.get(o).then(e=>{var n,d;s||(u({type:"FETCH_SUCCESS",payload:(n=e==null?void 0:e.data)==null?void 0:n.redirect,external:(d=e==null?void 0:e.data)==null?void 0:d.external}),r())}).catch(e=>{var n,d,E,p;if(!s){let l=null;(n=e==null?void 0:e.response)!=null&&n.statusText?l=e.response.statusText:(E=(d=e==null?void 0:e.response)==null?void 0:d.data)!=null&&E.message&&(l=e.response.data.message),u({type:"FETCH_FAILURE",payload:l??t("error"),errorStatus:(p=e==null?void 0:e.response)==null?void 0:p.status}),r()}})}catch{s||(u({type:"FETCH_FAILURE",payload:t("error")}),r())}})(),()=>{s=!0}},[f]),{state:g,initRedirect:S}},v=T.div` 2 width: 100%; 3 padding: 0 1rem; 4 margin: 1rem auto; 5`,N=()=>{const{state:t,initRedirect:a}=F();return c.useEffect(()=>{a()},[]),t.status==="ERROR"?i.jsx(v,{children:i.jsx(m,{error:{message:t.error}})}):t.status==="SUCCESS"?t!=null&&t.external?i.jsx(y,{to:`${t==null?void 0:t.value}`}):i.jsx(y,{to:`${C.home.full}${t==null?void 0:t.value}`}):i.jsx(I,{size:"3",container:!0})};export{N as default}; 6//# sourceMappingURL=Redirect-ylf0AwSQ.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.