import{L as _}from"./CircularLoading-CkYtte64.js";import{e as b,r as s,S as h,ag as v,f as r,j as y,v as u,ba as w,g as n,aO as k}from"./jwt-decode.esm-CzNJpMna.js";import{W as D}from"./Watermark-BVgdxgEk.js";import{u as I}from"./userStore-awX4g_0u.js";import{b as x}from"./workspaceStore-CfaRGIsm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="e2fa2fc2-a1c5-4344-97b2-bac1869946c2",e._sentryDebugIdIdentifier="sentry-dbid-e2fa2fc2-a1c5-4344-97b2-bac1869946c2")}catch{}})();const S={class:"page-container"},W={key:0,class:"loading"},E={key:1,class:"error-container"},V=["srcdoc"],C=b({__name:"PageStageView",props:{uiData:{}},setup(e){const a=e,d=v(),f=s(!0),i=s(""),t=s(!1),g=s(null);return h(async()=>{const o=I();o.loadJWT();try{const c=a.uiData.path?`/_page/${a.uiData.path}`:"/_page-home",l=await x(c,{headers:o.authHeaders});if(l.status===401){o.removeJWT(),d.push({name:"playerLogin",query:{redirect:`/${a.uiData.path}`}});return}if(l.ok){const p=await l.text();if(p){const m=`<base href="${c}" target="_top">`;i.value=m+p}else t.value=!0}else t.value=!0}catch{t.value=!0}f.value=!1}),(o,c)=>(n(),r("div",S,[f.value?(n(),r("div",W,[u(_)])):t.value?(n(),r("div",E,[u(w,{"error-message":null,"execution-id":null,locale:"en"})])):i.value?(n(),r("iframe",{key:2,ref_key:"iframeRef",ref:g,class:"page-iframe",srcdoc:i.value,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-top-navigation-by-user-activation"},null,8,V)):y("",!0),u(D,{"page-id":e.uiData.id,locale:"en"},null,8,["page-id"])]))}}),B=k(C,[["__scopeId","data-v-12b241db"]]);export{B as P};
//# sourceMappingURL=PageStageView-BCgPEw6p.js.map
