import{d as x,ex as F,ey as R,E as B,r as I,F as E,b as i,c as m,bu as e,u as q,e as d,er as D,t as C}from"./registerWidgets.6f5be576.js";import{L}from"./CircularLoading.63d0a6e6.js";import{E as N}from"./Error.af796f47.js";import{F as M,R as V}from"./broker.a6c4370f.js";import{B as W}from"./BackButton.0588bb94.js";import{a as _}from"./asyncComputed.ea0bb8a8.js";import{F as H}from"./forms.10b6c538.js";import{W as S}from"./workspaces.79e459cd.js";import{r as U}from"./index.2b5138c8.js";import"./lottie.df73e4a1.js";import"./passwordlessManager.1e2193ad.js";import"./pubsub.1dc45978.js";import"./storage.d8b26e7f.js";import"./Passwordless.c72ce9bc.js";import"./icons.b2622455.js";import"./executeJs.abe9c76a.js";import"./PlayerNavbar.9ab27066.js";import"./Steps.413031ec.js";import"./Modal.dd94f88f.js";import"./WidgetsFrame.cc779991.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.86f32ac5.js";import"./activeRecord.eb203c6f.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]="6a77bf9d-ff25-46a3-9801-e4fea17ec20e",a._sentryDebugIdIdentifier="sentry-dbid-6a77bf9d-ff25-46a3-9801-e4fea17ec20e")}catch{}})();const $={class:"page"},j={key:1,class:"error"},z={key:2,style:{width:"100%",height:"100%",display:"flex"}},A={style:{width:"100%",height:"100%",display:"flex"}},G=x({__name:"FormPreview",setup(a){const t=F(),o=R(),s=B({started:!1});function y(r,n){U("preview",t,r,n)}const f=I(null),{loading:h,result:c,error:u,refetch:p}=_(()=>H.get(o.params.formPath)),{result:l}=_(()=>S.get()),v=E(()=>V.create({formPath:o.params.formPath})),g=async()=>{var r;if(!s.started){(r=f.value)==null||r.run();return}s.started=!1},w=({path:r,type:n})=>{n==="dash"?t.push({name:"dashPreview",params:{dashPath:r},query:o.query}):(t.push({name:"formPreview",params:{formPath:r},query:o.query}),p())},k=()=>{t.push(`/_editor/form/${encodeURIComponent(o.params.formPath)}`)},b=()=>{s.started=!0},P=()=>{s.started=!1};return(r,n)=>(i(),m("div",$,[e(h)||!e(c)||!e(l)?(i(),q(L,{key:0})):e(u)?(i(),m("div",j,[d(N,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(i(),m("main",z,[D("div",A,[d(M,{ref_key:"runner",ref:f,form:e(c).makeRunnerData(e(l)),params:e(o).query,"is-preview":!0,"enable-auto-focus":!0,broker:v.value,style:{height:"unset",flex:1,overflow:"hidden"},onNavigate:w,onLogout:g,onExit:P,onStart:b,onRedirect:y},null,8,["form","params","broker"]),d(W,{onExitFullscreenPreview:k})])]))]))}});const le=C(G,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.1f0f21a2.js.map
