import{r as u,e as m,M as h,K as E,n as I,a2 as w,ae as y,g as T,aM as g}from"./jwt-decode.esm-C7p7KYmD.js";import{l as d}from"./fetch-Bd2rZJLr.js";import{u as C}from"./polling-CSxJG2et.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]="800c500a-7e5c-4506-a5fd-cdd777255b1c",t._sentryDebugIdIdentifier="sentry-dbid-800c500a-7e5c-4506-a5fd-cdd777255b1c")}catch{}})();const _=8,H=3e3,L=3e3,R=1e3,b=t=>{const n=t.router,r=u(""),a=u(Array(_).fill(!0));let s=0;const i=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),H),f=await d("/_healthcheck",{method:"GET",signal:e.signal,headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}});clearTimeout(o),a.value[s]=f.status===200}catch{a.value[s]=!1}if(s=(s+1)%_,a.value.every(e=>!e)&&r.value){const e=n.currentRoute.value.path,o=new URLSearchParams;o.set("redirect",e),window.location.href=r.value+"?"+o.toString()}},{startPolling:c,endPolling:p}=C({task:i,interval:L}),l=async()=>{const e=await d("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{l()},R);return}const o=await e.json();o.waitingRoomUrl&&(r.value=o.waitingRoomUrl,c())};return{setup:l,cleanUp:p}},v=m({__name:"Home",setup(t){const n=y(),{setup:r,cleanUp:a}=b({router:n});return h(()=>{r()}),E(()=>{a()}),(s,i)=>{const c=w("RouterView");return T(),I(c,{class:"router"})}}}),D=g(v,[["__scopeId","data-v-3737a9c1"]]);export{D as default};
//# sourceMappingURL=Home-8LfNjI0K.js.map
