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.08925b03.js";import{L as C}from"./CircularLoading.f7d06bfa.js";import{E as L}from"./Error.0b38b84a.js";import{F as N,R as H}from"./broker.7961a3f7.js";import{B as M}from"./BackButton.7f560b93.js";import{a as _}from"./asyncComputed.fdfb8cdb.js";import{F as V}from"./forms.fed50698.js";import{W}from"./workspaces.4a948e86.js";import"./lottie.028476ab.js";import"./passwordlessManager.c2cb8449.js";import"./pubsub.7723f722.js";import"./icons.7d877907.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.8670e267.js";import"./Passwordless.5b6366b4.js";import"./executeJs.47243443.js";import"./PlayerNavbar.69c3e338.js";import"./index.a757f6bb.js";import"./WidgetsFrame.eb09d539.js";import"./colors.6a512de1.js";import"./Modal.b942b0e2.js";import"./activeRecord.030cb164.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]="facd3eb5-56ff-4d4a-8c15-1ebce58c97d0",a._sentryDebugIdIdentifier="sentry-dbid-facd3eb5-56ff-4d4a-8c15-1ebce58c97d0")}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}),c=F(null),{loading:h,result:m,error:u,refetch:f}=_(()=>V.get(r.params.formPath)),{result:p}=_(()=>W.get()),y=R(()=>H.create({formPath:r.params.formPath})),v=async()=>{var o;if(!s.started){(o=c.value)==null||o.run();return}s.started=!1},b=({path:o,type:l})=>{l==="dash"?t.push({name:"dashPreview",params:{dashPath:o},query:r.query}):(t.push({name:"form-preview",params:{formPath:o},query:r.query}),f())},g=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},w=()=>{s.started=!0},k=()=>{s.started=!1};return(o,l)=>(n(),d("div",z,[e(h)||!e(m)||!e(p)?(n(),B(C,{key:0})):e(u)?(n(),d("div",J,[i(L,{error:e(u),onReload:e(f)},null,8,["error","onReload"])])):(n(),d("main",K,[I("div",S,[i(N,{ref_key:"runner",ref:c,form:e(m).makeRunnerData(e(p)),params:e(r).query,"is-preview":!0,"enable-auto-focus":!0,broker:e(y),style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:b,onLogout:v,onExit:k,onStart:w},null,8,["form","params","broker"]),i(M,{onExitFullscreenPreview:g})])]))]))}});const ue=D(U,[["__scopeId","data-v-2cdbdd7a"]]);export{ue as default};
//# sourceMappingURL=FormPreview.29eb5fdb.js.map
