import{d as x,v as P,r as F,K as R,b as n,c as d,z as e,t as B,e as i,x as I,H as q,J as E,q as D}from"./registerWidgets.60bba559.js";import{L as C}from"./CircularLoading.0edb8bc0.js";import{E as L}from"./Error.dd0cb104.js";import{F as N,R as H}from"./broker.4c6f334d.js";import{B as M}from"./BackButton.dc0ff5f7.js";import{a as _}from"./asyncComputed.d00a688c.js";import{F as V}from"./forms.42a55259.js";import{W}from"./workspaces.46f8580e.js";import"./lottie.fd5d7b21.js";import"./passwordlessManager.e1b568b1.js";import"./pubsub.6df2423b.js";import"./icons.86798a2e.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.11413f0b.js";import"./Passwordless.4a584300.js";import"./executeJs.263d8eb0.js";import"./PlayerNavbar.d70763bf.js";import"./index.7e7f8bb2.js";import"./WidgetsFrame.c566de3c.js";import"./colors.472988d2.js";import"./Modal.8fbea10f.js";import"./activeRecord.5794d4d2.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="799768a3-987a-4ea1-b6d9-4d52cad02a29",a._sentryDebugIdIdentifier="sentry-dbid-799768a3-987a-4ea1-b6d9-4d52cad02a29")}catch{}})();const z={class:"page"},J={key:1,class:"error"},K={key:2,style:{width:"100%",height:"100%",display:"flex"}},S={style:{width:"100%",height:"100%",display:"flex"}},U=x({__name:"FormPreview",setup(a){const t=q(),r=E(),s=P({started:!1}),m=F(null),{loading:h,result:c,error:u,refetch:p}=_(()=>V.get(r.params.formPath)),{result:l}=_(()=>W.get()),y=R(()=>H.create({formPath:r.params.formPath})),v=async()=>{var o;if(!s.started){(o=m.value)==null||o.run();return}s.started=!1},g=({path:o,type:f})=>{f==="dash"?t.push({name:"dashPreview",params:{dashPath:o},query:r.query}):(t.push({name:"form-preview",params:{formPath:o},query:r.query}),p())},w=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},b=()=>{s.started=!0},k=()=>{s.started=!1};return(o,f)=>(n(),d("div",z,[e(h)||!e(c)||!e(l)?(n(),B(C,{key:0})):e(u)?(n(),d("div",J,[i(L,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(n(),d("main",K,[I("div",S,[i(N,{ref_key:"runner",ref:m,form:e(c).makeRunnerData(e(l)),params:e(r).query,"is-preview":!0,"enable-auto-focus":!0,broker:e(y),style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:g,onLogout:v,onExit:k,onStart:b},null,8,["form","params","broker"]),i(M,{onExitFullscreenPreview:w})])]))]))}});const ue=D(U,[["__scopeId","data-v-2cdbdd7a"]]);export{ue as default};
//# sourceMappingURL=FormPreview.fcfd3d04.js.map
