import{d as x,v as P,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.b581b882.js";import{L as C}from"./CircularLoading.187bc0bb.js";import{E as L}from"./Error.c22b9bfd.js";import{F as N,R as H}from"./broker.7dd7c6d6.js";import{B as M}from"./BackButton.8e05a182.js";import{a as _}from"./asyncComputed.d5ac46d6.js";import{F as V}from"./forms.d431a804.js";import{W}from"./workspaces.c5c1498d.js";import"./lottie.11a8eda8.js";import"./passwordlessManager.202da07d.js";import"./pubsub.e8d7f2be.js";import"./icons.5e5a9af6.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.31abc16f.js";import"./Passwordless.d73d43e7.js";import"./executeJs.4676d347.js";import"./PlayerNavbar.d65f9d76.js";import"./index.b85de9d3.js";import"./WidgetsFrame.c7d52d0d.js";import"./colors.9b427580.js";import"./Modal.b2162631.js";import"./activeRecord.d86e77f4.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]="566f9290-cc9a-4253-8628-d4533c404456",s._sentryDebugIdIdentifier="sentry-dbid-566f9290-cc9a-4253-8628-d4533c404456")}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(s){const t=q(),r=E(),a=P({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({formPath:r.params.formPath})),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)}`)},k=()=>{a.started=!0},b=()=>{a.started=!1};return(o,l)=>(n(),i("div",z,[e(h)||!e(c)||!e(f)?(n(),B(C,{key:0})):e(u)?(n(),i("div",J,[d(L,{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:b,onStart:k},null,8,["form","params","broker"]),d(M,{onExitFullscreenPreview:w})])]))]))}});const ue=D(U,[["__scopeId","data-v-2cdbdd7a"]]);export{ue as default};
//# sourceMappingURL=FormPreview.fe853505.js.map
