import{d as x,J as R,K as F,w as B,r as I,L as E,b as i,c as d,A as e,u as q,e as m,y as D,t as L}from"./registerWidgets.f8dfb33f.js";import{L as C}from"./CircularLoading.fb5be9eb.js";import{E as N}from"./Error.fe8dac30.js";import{F as M,R as V}from"./broker.02f9ba67.js";import{B as W}from"./BackButton.5e5329d6.js";import{a as _}from"./asyncComputed.a78c0f7f.js";import{F as A}from"./forms.037ed7b4.js";import{W as H}from"./workspaces.9c133c0c.js";import{r as J}from"./index.d2b139a4.js";import"./lottie.c7ecbe32.js";import"./passwordlessManager.e17ec9bd.js";import"./pubsub.4b58e722.js";import"./Passwordless.7e4ecc5c.js";import"./icons.074088c2.js";import"./executeJs.95fae432.js";import"./PlayerNavbar.76c6ee55.js";import"./Steps.5db1e50f.js";import"./Modal.b37564e2.js";import"./WidgetsFrame.cdf1adec.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.8e142d0a.js";import"./activeRecord.b9bfe1cb.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="dd272a91-7922-4ca0-852a-9dbe8d15cda4",a._sentryDebugIdIdentifier="sentry-dbid-dd272a91-7922-4ca0-852a-9dbe8d15cda4")}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(a){const t=R(),o=F(),s=B({started:!1});function y(r,n){J("preview",t,r,n)}const c=I(null),{loading:h,result:u,error:f,refetch:p}=_(()=>A.get(o.params.formPath)),{result:l}=_(()=>H.get()),v=E(()=>V.create({formPath:o.params.formPath})),w=async()=>{var r;if(!s.started){(r=c.value)==null||r.run();return}s.started=!1},g=({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())},k=()=>{t.push(`/_editor/form/${encodeURIComponent(o.params.formPath)}`)},b=()=>{s.started=!0},P=()=>{s.started=!1};return(r,n)=>(i(),d("div",K,[e(h)||!e(u)||!e(l)?(i(),q(C,{key:0})):e(f)?(i(),d("div",S,[m(N,{error:e(f),onReload:e(p)},null,8,["error","onReload"])])):(i(),d("main",U,[D("div",$,[m(M,{ref_key:"runner",ref:c,form:e(u).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:g,onLogout:w,onExit:P,onStart:b,onRedirect:y},null,8,["form","params","broker"]),m(W,{onExitFullscreenPreview:k})])]))]))}});const pe=L(j,[["__scopeId","data-v-fa4f1951"]]);export{pe as default};
//# sourceMappingURL=FormPreview.e74e546f.js.map
