import{f as u,d as m,e3 as h,J as y,a8 as w,r as g,c as v,o as b,Q as I}from"./index.e310aebb.js";import{l as d}from"./fetch.ac0cc198.js";import{u as C}from"./polling.debfe6c7.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]="aba89770-f8ac-4378-8235-e1fe5caf49ed",t._sentryDebugIdIdentifier="sentry-dbid-aba89770-f8ac-4378-8235-e1fe5caf49ed")}catch{}})();const _=4,H=t=>{const n=t.router,a=u(""),r=u(Array(_).fill(!0));let s=0;const l=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),1e3),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:l,interval:2e3}),i=async()=>{const e=await d("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{i()},1e3);return}const o=await e.json();o.waitingRoomUrl&&(a.value=o.waitingRoomUrl,c())};return{setup:i,cleanUp:f}},R=m({__name:"Home",setup(t){const n=h(),{setup:a,cleanUp:r}=H({router:n});return y(()=>{a()}),w(()=>{r()}),(s,l)=>{const c=g("RouterView");return b(),v(c,{class:"router"})}}});const U=I(R,[["__scopeId","data-v-3737a9c1"]]);export{U as default};
//# sourceMappingURL=Home.f80fb065.js.map
