import{d as P,v as x,r as F,K as R,b as n,c as i,z as e,t as B,e as d,x as I,H as q,J as E,q as D}from"./registerWidgets.29ceb1a3.js";import{L}from"./CircularLoading.f0b3522c.js";import{E as C}from"./Error.9385b331.js";import{F as N,R as H}from"./broker.bffb79f6.js";import{B as M}from"./BackButton.358e997b.js";import{a as _}from"./asyncComputed.9ed582d0.js";import{F as V}from"./forms.7d77f27e.js";import{W}from"./workspaces.8cc8d5a8.js";import"./lottie.dc9b75c3.js";import"./passwordlessManager.68f14bfc.js";import"./icons.3ddac2d4.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.58d6f594.js";import"./Passwordless.aeb71179.js";import"./executeJs.fc18b508.js";import"./PlayerNavbar.560ce26d.js";import"./index.2f0d1fcf.js";import"./WidgetsFrame.2255c592.js";import"./colors.9ea007bd.js";import"./Modal.466a15f5.js";import"./log.59215350.js";import"./activeRecord.ab1afca6.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="a0525343-3e46-4bed-a82d-f4e977409d72",s._sentryDebugIdIdentifier="sentry-dbid-a0525343-3e46-4bed-a82d-f4e977409d72")}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=P({__name:"FormPreview",setup(s){const t=q(),r=E(),a=x({started:!1}),m=F(null),{loading:h,result:c,error:u,refetch:p}=_(()=>V.get(r.params.formPath)),{result:f}=_(()=>W.get()),y=R(()=>H.create({isLocal:!1,formPath:r.params.formPath,isPreview:!0})),v=async()=>{var o;if(!a.started){(o=m.value)==null||o.run();return}a.started=!1},g=({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}),p())},w=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},b=()=>{a.started=!0},k=()=>{a.started=!1};return(o,l)=>(n(),i("div",z,[e(h)||!e(c)||!e(f)?(n(),B(L,{key:0})):e(u)?(n(),i("div",J,[d(C,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(n(),i("main",K,[I("div",S,[d(N,{ref_key:"runner",ref:m,form:e(c).makeRunnerData(e(f)),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"]),d(M,{onExitFullscreenPreview:w})])]))]))}});const ue=D(U,[["__scopeId","data-v-f7c2ba13"]]);export{ue as default};
//# sourceMappingURL=FormPreview.2407a179.js.map
