import{r as u,a as _,D as h,k as w,p as y,a4 as b,ad as g,e as v,aN as I}from"./jwt-decode.esm-CQm3LY6y.js";import{l as d}from"./fetch-D_GCFhB2.js";import{u as k}from"./polling-DSadHAPO.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]="cd315db8-0297-44ab-9c10-5a64521fe2af",t._sentryDebugIdIdentifier="sentry-dbid-cd315db8-0297-44ab-9c10-5a64521fe2af")}catch{}})();const f=4,C=t=>{const n=t.router,a=u(""),r=u(Array(f).fill(!0));let s=0;const i=async()=>{try{const e=new AbortController,o=setTimeout(()=>e.abort(),1e3),m=await d("/_healthcheck",{method:"GET",signal:e.signal,headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}});clearTimeout(o),r.value[s]=m.status===200}catch{r.value[s]=!1}if(s=(s+1)%f,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:p}=k({task:i,interval:2e3}),l=async()=>{const e=await d("/_editor/api/web-editor/",{method:"GET"});if(!e.ok){setTimeout(()=>{l()},1e3);return}const o=await e.json();o.waitingRoomUrl&&(a.value=o.waitingRoomUrl,c())};return{setup:l,cleanUp:p}},R=_({__name:"Home",setup(t){const n=g(),{setup:a,cleanUp:r}=C({router:n});return h(()=>{a()}),w(()=>{r()}),(s,i)=>{const c=b("RouterView");return v(),y(c,{class:"router"})}}}),U=I(R,[["__scopeId","data-v-3737a9c1"]]);export{U as default};
//# sourceMappingURL=Home-BNEZg3J6.js.map
