import{r as R}from"./index.a4839d52.js";import{u as b}from"./uuid.164febd5.js";import{F as q,R as x}from"./broker.d0c95620.js";import{d as S,v as B,a2 as g,K as m,z as a,b as s,c as u,e as K,t as k,J as E,H as N,O,Q as T,x as d,q as F}from"./registerWidgets.787b786f.js";import{D as L,m as C}from"./DashPlayer.b825c6ff.js";import{a as V}from"./asyncComputed.3103aa62.js";import{r as j,n as z}from"./runnerData.7ed5e5ab.js";import{L as A}from"./CircularLoading.738c357f.js";import"./passwordlessManager.42099b8c.js";import"./pubsub.dd86dbcf.js";import"./icons.e9d866c3.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.9fa1407c.js";import"./Passwordless.a8ede9c5.js";import"./executeJs.0a44fba5.js";import"./PlayerNavbar.7e0c6963.js";import"./WidgetsFrame.ffa4e614.js";import"./colors.d63f40df.js";import"./Modal.9eb19c24.js";import"./lottie.221bef6b.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="ec0bde7e-ce1b-43af-9942-2314ce7a50e7",r._sentryDebugIdIdentifier="sentry-dbid-ec0bde7e-ce1b-43af-9942-2314ce7a50e7")}catch{}})();async function H(r){const e=await fetch(`/_api/${r}`);if(e.status==404)return null;if(!e.ok)throw new Error(await e.text());const{form:n,dash:c}=await e.json();return{form:n&&j(n),dash:c&&z(c)}}const p=r=>(O("data-v-ee57bae4"),r=r(),T(),r),J={key:0,class:"loading"},Q={key:1,class:"error"},$=p(()=>d("h1",null,"Oops! Something went wrong",-1)),G=p(()=>d("p",null,"An unknown error ocurred. Please try again or contact support.",-1)),M=[$,G],U={key:2,class:"form"},W={key:3,class:"dash-wrapper"},X={key:4,class:"error not-found"},Y=p(()=>d("h1",null,"Page not found",-1)),Z=p(()=>d("p",null,"The page you requested could not be found.",-1)),ee=[Y,Z],te=S({__name:"Player",setup(r){const e=E(),n=N(),c=B({playerKey:b()}),f=({path:t})=>{n.push({name:"player",query:e.query,params:{path:t.split("/")}})},_=async()=>{c.playerKey=b()};g([()=>e.path,()=>e.query],()=>_());const{loading:w,result:o,error:D}=V(()=>{var t;return H((t=e.path.slice(1))!=null?t:"")}),y=m(()=>l.value?x.create({formPath:l.value.path}):null),l=m(()=>{var t,i;return(i=(t=o.value)==null?void 0:t.form)!=null?i:null}),h=m(()=>{var i,v;if(!((i=o.value)!=null&&i.dash))return null;const t=C((v=o.value)==null?void 0:v.dash);return t.onRedirect(({url:I,queryParams:P})=>R(n,I,P)),t});return g(o,()=>{var t;!o.value||(o.value.form?document.title=(t=o.value.form.welcomeTitle)!=null?t:o.value.form.title:o.value.dash&&(document.title=o.value.dash.title))}),(t,i)=>a(w)?(s(),u("div",J,[K(A)])):a(D)?(s(),u("div",Q,M)):a(l)&&a(y)?(s(),u("div",U,[(s(),k(q,{key:c.playerKey,class:"player",form:a(l),params:a(e).query,broker:a(y),"enable-auto-focus":!0,onNavigate:f,onLogout:_},null,8,["form","params","broker"]))])):a(h)?(s(),u("div",W,[(s(),k(L,{key:c.playerKey,class:"player","is-preview":!1,params:a(e).query,"dash-player-service":a(h),onNavigate:f},null,8,["params","dash-player-service"]))])):(s(),u("div",X,ee))}});const ke=F(te,[["__scopeId","data-v-ee57bae4"]]);export{ke as default};
//# sourceMappingURL=Player.932b8c0e.js.map
