import{d as x,ex as R,ey as F,G as B,r as I,H as E,b as i,d2 as d,u as e,c as q,f as m,e as D,v as C}from"./registerWidgets.d6e66474.js";import{L}from"./CircularLoading.2744e4b0.js";import{E as N}from"./Error.ca4d4213.js";import{F as H,R as M}from"./broker.76347aac.js";import{B as V}from"./BackButton.30a4dc47.js";import{a as _}from"./asyncComputed.5c362931.js";import{F as W}from"./forms.2e38c299.js";import{W as G}from"./workspaces.5e4a741d.js";import{r as S}from"./index.977cda87.js";import"./lottie.b059da2e.js";import"./passwordlessManager.a2051844.js";import"./pubsub.9e806cff.js";import"./storage.d7eb729a.js";import"./Passwordless.83f13a8c.js";import"./icons.4be6cb33.js";import"./executeJs.45861195.js";import"./PlayerNavbar.6876b287.js";import"./Steps.28b1fe2b.js";import"./Modal.87772a38.js";import"./WidgetsFrame.b0e7227e.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.c85f9eb3.js";import"./activeRecord.1009e596.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]="f74c53d3-25f5-4df4-81fe-7fd17d5b3897",s._sentryDebugIdIdentifier="sentry-dbid-f74c53d3-25f5-4df4-81fe-7fd17d5b3897")}catch{}})();const U={class:"page"},$={key:1,class:"error"},j={key:2,style:{width:"100%",height:"100%",display:"flex"}},z={style:{width:"100%",height:"100%",display:"flex"}},A=x({__name:"FormPreview",setup(s){const t=R(),o=F(),a=B({started:!1});function y(r,n){S("preview",t,r,n)}const f=I(null),{loading:h,result:c,error:u,refetch:p}=_(()=>W.get(o.params.formPath)),{result:l}=_(()=>G.get()),v=E(()=>M.create({formPath:o.params.formPath})),g=async()=>{var r;if(!a.started){(r=f.value)==null||r.run();return}a.started=!1},w=({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=()=>{a.started=!0},P=()=>{a.started=!1};return(r,n)=>(i(),d("div",U,[e(h)||!e(c)||!e(l)?(i(),q(L,{key:0})):e(u)?(i(),d("div",$,[m(N,{error:e(u),onReload:e(p)},null,8,["error","onReload"])])):(i(),d("main",j,[D("div",z,[m(H,{ref_key:"runner",ref:f,form:e(c).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:w,onLogout:g,onExit:P,onStart:b,onRedirect:y},null,8,["form","params","broker"]),m(V,{onExitFullscreenPreview:k})])]))]))}});const le=C(A,[["__scopeId","data-v-fa4f1951"]]);export{le as default};
//# sourceMappingURL=FormPreview.80bc8782.js.map
