import{d as x,ex as F,ey as R,E as B,r as I,F as E,b as i,c,bu as e,u as q,e as m,er as D,t as C}from"./registerWidgets.eb5d1044.js";import{L}from"./CircularLoading.255913e4.js";import{E as N}from"./Error.09dba021.js";import{F as M,R as V}from"./broker.e66f4b92.js";import{B as W}from"./BackButton.8c4203dd.js";import{a as _}from"./asyncComputed.8007047f.js";import{F as H}from"./forms.3c90b8ae.js";import{W as S}from"./workspaces.d3480546.js";import{r as U}from"./index.9e50376a.js";import"./lottie.083b517e.js";import"./passwordlessManager.5b579a25.js";import"./pubsub.8f4c78dc.js";import"./storage.0943951e.js";import"./Passwordless.648754ed.js";import"./icons.f9be01a3.js";import"./executeJs.7c9dcc57.js";import"./PlayerNavbar.8f28ca5d.js";import"./Steps.a473820d.js";import"./Modal.b3432d4d.js";import"./WidgetsFrame.dfa61eb0.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.a9c263d2.js";import"./activeRecord.e38b436c.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]="cc2b9ada-cacf-4512-83f2-8ebb35222cbf",a._sentryDebugIdIdentifier="sentry-dbid-cc2b9ada-cacf-4512-83f2-8ebb35222cbf")}catch{}})();const $={class:"page"},j={key:1,class:"error"},z={key:2,style:{width:"100%",height:"100%",display:"flex"}},A={style:{width:"100%",height:"100%",display:"flex"}},G=x({__name:"FormPreview",setup(a){const t=F(),o=R(),s=B({started:!1});function y(r,n){U("preview",t,r,n)}const d=I(null),{loading:h,result:f,error:u,refetch:p}=_(()=>H.get(o.params.formPath)),{result:l}=_(()=>S.get()),v=E(()=>V.create({formPath:o.params.formPath})),b=async()=>{var r;if(!s.started){(r=d.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())},w=()=>{t.push(`/_editor/form/${encodeURIComponent(o.params.formPath)}`)},k=()=>{s.started=!0},P=()=>{s.started=!1};return(r,n)=>(i(),c("div",$,[e(h)||!e(f)||!e(l)?(i(),q(L,{key:0})):e(u)?(i(),c("div",j,[m(N,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(i(),c("main",z,[D("div",A,[m(M,{ref_key:"runner",ref:d,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:g,onLogout:b,onExit:P,onStart:k,onRedirect:y},null,8,["form","params","broker"]),m(W,{onExitFullscreenPreview:w})])]))]))}});const le=C(G,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.397e259d.js.map
