import{r as u,e as m,W as h,x as E,n as I,a9 as w,aj as y,g as T,aP as g}from"./jwt-decode.esm-CuqABuF0.js";import{l as _}from"./fetch-BGWsR7Pn.js";import{u as C}from"./polling-Dbvvni7o.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]="346e27e7-255c-4245-a078-d06e2c6f80c0",t._sentryDebugIdIdentifier="sentry-dbid-346e27e7-255c-4245-a078-d06e2c6f80c0")}catch{}})();const d=8,H=3e3,L=3e3,R=1e3,v=t=>{const n=t.router,r=u(""),s=u(Array(d).fill(!0));let a=0;const i=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),H),f=await _("/_healthcheck",{method:"GET",signal:e.signal,headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}});clearTimeout(o),s.value[a]=f.status===200}catch{s.value[a]=!1}if(a=(a+1)%d,s.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 _("/_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}},b=m({__name:"Home",setup(t){const n=y(),{setup:r,cleanUp:s}=v({router:n});return h(()=>{r()}),E(()=>{s()}),(a,i)=>{const c=w("RouterView");return T(),I(c,{class:"router"})}}}),k=g(b,[["__scopeId","data-v-3737a9c1"]]);export{k as default};
//# sourceMappingURL=Home-aFsQDXn7.js.map
