import{F as I,r as R,R as B}from"./FormRunner.7f1c00d4.js";import{d as P,eB as q,eA as x,G as D,J as p,H as y,u as d,b as a,ev as i,f as E,c as F,eE as S,eF as K,e as u,v as L}from"./outputWidgets.dbd82eb7.js";import{u as h}from"./uuid.0158e52d.js";import{a as N}from"./asyncComputed.35cc7f64.js";import{g as A}from"./api.f1e7b757.js";import{L as C}from"./CircularLoading.b2833a2e.js";import"./url.1be4a3aa.js";import"./Passwordless.03f20546.js";import"./index.8290c50d.js";import"./pubsub.56ebc718.js";import"./icons.fd03d9d3.js";import"./PlayerNavbar.ff74ed66.js";import"./ActionButton.1e06a0b3.js";import"./WidgetsFrame.2ba1aca7.js";import"./index.4a72e789.js";import"./Base.9ecb2d1e.js";import"./Link.dc03c6cd.js";import"./Paragraph.1b3bd714.js";import"./Text.2567a5bf.js";import"./Title.8245238f.js";import"./Card.38da23c4.js";import"./TabPane.fd8f21ee.js";import"./hasIn.0a3acbb0.js";import"./runnerData.48f35186.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="54992682-e838-43e6-9fdf-2ecfec7d1546",o._sentryDebugIdIdentifier="sentry-dbid-54992682-e838-43e6-9fdf-2ecfec7d1546")}catch{}})();const c=o=>(S("data-v-485e3719"),o=o(),K(),o),T={key:0,class:"loading"},V={key:1,class:"error"},G=c(()=>u("h1",null,"Oops! Something went wrong",-1)),H=c(()=>u("p",null,"An unknown error ocurred. Please try again or contact support.",-1)),J=[G,H],O={key:2,class:"form"},j={key:3,class:"error not-found",style:{height:"100vh"}},z=c(()=>u("h1",null,"Page not found",-1)),M=c(()=>u("p",null,"The page you requested could not be found.",-1)),Q=[z,M],U=P({__name:"Player",setup(o){const t=q(),l=x(),m=D({playerKey:h()});p(t,()=>w());function v(e,s){R("player",l,e,s)}const g=({path:e})=>{l.push({name:"player",query:t.query,params:{path:e.split("/")}})},f=async()=>{m.playerKey=h()};p([()=>t.path,()=>t.query],()=>f());const{loading:k,result:r,error:b,refetch:w}=N(()=>{var e;return A((e=t.path.slice(1))!=null?e:"")}),_=y(()=>n.value?B.create(n.value.id):null),n=y(()=>{var e,s;return(s=(e=r.value)==null?void 0:e.form)!=null?s:null});return p(r,()=>{var e;!r.value||r.value.form&&(document.title=(e=r.value.form.welcomeTitle)!=null?e:r.value.form.title)}),(e,s)=>d(k)?(a(),i("div",T,[E(C)])):d(b)?(a(),i("div",V,J)):n.value&&_.value?(a(),i("div",O,[(a(),F(I,{key:m.playerKey,class:"player",form:n.value,"is-preview":!1,params:d(t).query,broker:_.value,"enable-auto-focus":!0,onNavigate:g,onLogout:f,onRedirect:v},null,8,["form","params","broker"]))])):(a(),i("div",j,Q))}});const ge=L(U,[["__scopeId","data-v-485e3719"]]);export{ge as default};
//# sourceMappingURL=Player.c99a115b.js.map
