import{r as u,e as m,R as h,Q as E,n as I,a5 as w,ah as y,g as T,aO as g}from"./jwt-decode.esm-Da8x-1xB.js";import{l as d}from"./fetch-XZ2P4vxw.js";import{u as C}from"./polling-3x9Kzfs-.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="5c41745d-a99c-4d89-9f4e-8afe4ad33fe1",t._sentryDebugIdIdentifier="sentry-dbid-5c41745d-a99c-4d89-9f4e-8afe4ad33fe1")}catch{}})();const _=8,R=3e3,H=3e3,L=1e3,v=t=>{const n=t.router,a=u(""),r=u(Array(_).fill(!0));let s=0;const i=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),R),p=await d("/_healthcheck",{method:"GET",signal:e.signal,headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}});clearTimeout(o),r.value[s]=p.status===200}catch{r.value[s]=!1}if(s=(s+1)%_,r.value.every(e=>!e)&&a.value){const e=n.currentRoute.value.path,o=new URLSearchParams;o.set("redirect",e),window.location.href=a.value+"?"+o.toString()}},{startPolling:c,endPolling:f}=C({task:i,interval:H}),l=async()=>{const e=await d("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{l()},L);return}const o=await e.json();o.waitingRoomUrl&&(a.value=o.waitingRoomUrl,c())};return{setup:l,cleanUp:f}},b=m({__name:"Home",setup(t){const n=y(),{setup:a,cleanUp:r}=v({router:n});return h(()=>{a()}),E(()=>{r()}),(s,i)=>{const c=w("RouterView");return T(),I(c,{class:"router"})}}}),D=g(b,[["__scopeId","data-v-3737a9c1"]]);export{D as default};
//# sourceMappingURL=Home-BqtxnrYF.js.map
