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.9f96e537.js";import{L}from"./CircularLoading.c1f8d14a.js";import{E as C}from"./Error.de79aae8.js";import{F as N,R as H}from"./broker.458b5417.js";import{B as M}from"./BackButton.acdc1ea1.js";import{a as _}from"./asyncComputed.0a45b9d8.js";import{F as V}from"./forms.77cb14f1.js";import{W}from"./workspaces.c7762dda.js";import"./lottie.2c3db159.js";import"./passwordlessManager.5f237f08.js";import"./icons.4255d62c.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.9754ad47.js";import"./Passwordless.89fc3fc4.js";import"./executeJs.de5bda16.js";import"./PlayerNavbar.6a5e884d.js";import"./index.2a31702d.js";import"./WidgetsFrame.7e615d48.js";import"./colors.b5e37374.js";import"./Modal.add412a5.js";import"./log.0cea70fb.js";import"./activeRecord.81c11d03.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]="92e4daa8-d5c8-4866-96d9-ec8f1bc5615d",s._sentryDebugIdIdentifier="sentry-dbid-92e4daa8-d5c8-4866-96d9-ec8f1bc5615d")}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}),c=F(null),{loading:h,result:m,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=c.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(m)||!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:c,form:e(m).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.5ca9f9fb.js.map
