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 c,x as I,H as q,J as E,q as D}from"./registerWidgets.5bbfbb1a.js";import{L}from"./CircularLoading.fd9aaeaa.js";import{E as C}from"./Error.e057e862.js";import{F as N,R as H}from"./broker.335a4253.js";import{B as M}from"./BackButton.18c3f370.js";import{a as _}from"./asyncComputed.0fa43cb9.js";import{F as V}from"./forms.f7c4808d.js";import{W}from"./workspaces.b6d72d50.js";import"./lottie.5c7f29e3.js";import"./passwordlessManager.d271c8e1.js";import"./icons.96408396.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.ae7130c6.js";import"./Passwordless.6b80be80.js";import"./executeJs.9e1e42e3.js";import"./PlayerNavbar.07fb1819.js";import"./index.f78b9837.js";import"./WidgetsFrame.744aec31.js";import"./colors.71cbc60b.js";import"./Modal.34b86d8f.js";import"./log.81cc6b79.js";import"./activeRecord.0bf8afc8.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]="3537f8c4-1871-4bca-b0ed-8904e12b5c51",s._sentryDebugIdIdentifier="sentry-dbid-3537f8c4-1871-4bca-b0ed-8904e12b5c51")}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:d,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},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}),p())},g=()=>{t.push(`/_editor/form/${encodeURIComponent(r.params.formPath)}`)},w=()=>{a.started=!0},k=()=>{a.started=!1};return(o,l)=>(n(),i("div",z,[e(h)||!e(d)||!e(f)?(n(),B(L,{key:0})):e(u)?(n(),i("div",J,[c(C,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(n(),i("main",K,[I("div",S,[c(N,{ref_key:"runner",ref:m,form:e(d).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:b,onLogout:v,onExit:k,onStart:w},null,8,["form","params","broker"]),c(M,{onExitFullscreenPreview:g})])]))]))}});const ue=D(U,[["__scopeId","data-v-f7c2ba13"]]);export{ue as default};
//# sourceMappingURL=FormPreview.eb1b3b3b.js.map
