import{F as I,r as R,R as B}from"./FormRunner.ed2bf080.js";import{d as P,eB as q,eA as x,G as D,J as d,H as y,u as p,b as a,ev as c,f as E,c as F,eE as S,eF as K,e as u,v as L}from"./outputWidgets.52d47f16.js";import{u as h}from"./uuid.b341dc09.js";import{a as N}from"./asyncComputed.4c8b6226.js";import{a as A}from"./api.446787ee.js";import{L as C}from"./CircularLoading.ffe1bfc6.js";import"./url.0e01f007.js";import"./Passwordless.d51cbe08.js";import"./index.4feb2d4b.js";import"./pubsub.aae16efd.js";import"./icons.22b07466.js";import"./PlayerNavbar.e7613152.js";import"./ActionButton.5d7beaee.js";import"./WidgetsFrame.e7eb2dd0.js";import"./Card.d6c2b757.js";import"./TabPane.1fb9df7d.js";import"./hasIn.1b3df496.js";import"./Typography.3ab66b91.js";import"./runnerData.048603d1.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]="c0e375ad-3cc3-4e3f-b4e4-bd46d49ef096",o._sentryDebugIdIdentifier="sentry-dbid-c0e375ad-3cc3-4e3f-b4e4-bd46d49ef096")}catch{}})();const i=o=>(S("data-v-485e3719"),o=o(),K(),o),T={key:0,class:"loading"},V={key:1,class:"error"},G=i(()=>u("h1",null,"Oops! Something went wrong",-1)),H=i(()=>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=i(()=>u("h1",null,"Page not found",-1)),M=i(()=>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()});d(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("/")}})},_=async()=>{m.playerKey=h()};d([()=>t.path,()=>t.query],()=>_());const{loading:b,result:r,error:k,refetch:w}=N(()=>{var e;return A((e=t.path.slice(1))!=null?e:"")}),f=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 d(r,()=>{var e;!r.value||r.value.form&&(document.title=(e=r.value.form.welcomeTitle)!=null?e:r.value.form.title)}),(e,s)=>p(b)?(a(),c("div",T,[E(C)])):p(k)?(a(),c("div",V,J)):n.value&&f.value?(a(),c("div",O,[(a(),F(I,{key:m.playerKey,class:"player",form:n.value,"is-preview":!1,params:p(t).query,broker:f.value,"enable-auto-focus":!0,onNavigate:g,onLogout:_,onRedirect:v},null,8,["form","params","broker"]))])):(a(),c("div",j,Q))}});const _e=L(U,[["__scopeId","data-v-485e3719"]]);export{_e as default};
//# sourceMappingURL=Player.dd1a33f9.js.map
