import{d as x,J as R,K as F,w as B,r as I,L as E,b as i,c as m,A as e,u as q,e as d,y as D,t as L}from"./registerWidgets.2f354556.js";import{L as C}from"./CircularLoading.f70f248e.js";import{E as N}from"./Error.a5fbdd2d.js";import{F as M,R as V}from"./broker.8b121cd9.js";import{B as W}from"./BackButton.d3af3b6e.js";import{a as _}from"./asyncComputed.7c1b85ba.js";import{F as A}from"./forms.1fbdd547.js";import{W as H}from"./workspaces.0873a2c8.js";import{r as J}from"./index.afe47008.js";import"./lottie.61602e49.js";import"./passwordlessManager.96ab3f5a.js";import"./pubsub.cb65003c.js";import"./Passwordless.1cb3171a.js";import"./icons.1cdfa11b.js";import"./executeJs.27fe2afb.js";import"./PlayerNavbar.bedaf2b3.js";import"./Steps.74e2104a.js";import"./Modal.55b06151.js";import"./WidgetsFrame.ade6550a.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.ab6c6d5f.js";import"./activeRecord.931023a0.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]="05b206ec-7889-4cf4-af1b-1785f0d03b01",s._sentryDebugIdIdentifier="sentry-dbid-05b206ec-7889-4cf4-af1b-1785f0d03b01")}catch{}})();const K={class:"page"},S={key:1,class:"error"},U={key:2,style:{width:"100%",height:"100%",display:"flex"}},$={style:{width:"100%",height:"100%",display:"flex"}},j=x({__name:"FormPreview",setup(s){const t=R(),o=F(),a=B({started:!1});function y(r,n){J("preview",t,r,n)}const c=I(null),{loading:h,result:f,error:u,refetch:p}=_(()=>A.get(o.params.formPath)),{result:l}=_(()=>H.get()),v=E(()=>V.create({formPath:o.params.formPath})),w=async()=>{var r;if(!a.started){(r=c.value)==null||r.run();return}a.started=!1},b=({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())},g=()=>{t.push(`/_editor/form/${encodeURIComponent(o.params.formPath)}`)},k=()=>{a.started=!0},P=()=>{a.started=!1};return(r,n)=>(i(),m("div",K,[e(h)||!e(f)||!e(l)?(i(),q(C,{key:0})):e(u)?(i(),m("div",S,[d(N,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(i(),m("main",U,[D("div",$,[d(M,{ref_key:"runner",ref:c,form:e(f).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:b,onLogout:w,onExit:P,onStart:k,onRedirect:y},null,8,["form","params","broker"]),d(W,{onExitFullscreenPreview:g})])]))]))}});const pe=L(j,[["__scopeId","data-v-fa4f1951"]]);export{pe as default};
//# sourceMappingURL=FormPreview.638bed69.js.map
