import{d as k,r as B,o as C,b as n,c as l,w as p,f as A,aq as D,eE as I,ey as P,f2 as S,u as y,bF as N,f3 as q,v as h,eB as E,ew as g,e as v,eu as c,eC as b,eD as V,aC as w,n as x,p as F}from"./outputWidgets.f017b1ba.js";import{S as L}from"./Steps.ce2711d2.js";import{W as $}from"./WidgetsFrame.ba21a3b2.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="81040796-42ec-47c5-9db3-e75483ae942d",o._sentryDebugIdIdentifier="sentry-dbid-81040796-42ec-47c5-9db3-e75483ae942d")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(o,{emit:t}){const d=o,u=B(null);return C(()=>{u.value&&d.action.setElement(u.value)}),(r,i)=>(n(),l(y(q),null,{default:p(()=>[A(y(N),{ref_key:"element",ref:u,class:P(["next-button",r.disabled?"disabled":""]),loading:r.loading,disabled:r.disabled,onClick:i[0]||(i[0]=f=>t("click")),onKeydown:i[1]||(i[1]=S(f=>t("click"),["enter"]))},{default:p(()=>[D(I(r.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}});const M=h(K,[["__scopeId","data-v-e711f126"]]),O={class:"form"},z={class:"form-wrapper"},J={key:0,class:"buttons"},R=k({__name:"WidgetPreview",setup(o){const t=E(),d=B([]);function u(e){return x[e]||F[e]||null}function r(e){try{const s=JSON.parse(e);if(s.component=u(s.type),!s.component)throw new Error(`Widget ${s.type} not found`);return s.component?s:null}catch{return null}}function i(){const e=t.query.widget;return Array.isArray(e)?e.map(r).filter(Boolean):[r(e)]}function f(){return t.query.steps==="true"}function m(){const e=t.query.button;return e?Array.isArray(e)?e:[e]:[]}const _=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,s)=>(n(),l($,{"main-color":"#d14056",class:"preview",theme:"#fbfbfb",runtime:"form","font-family":"Inter"},{default:p(()=>[f()?(n(),l(L,{key:0,"steps-info":{current:2,total:3}})):g("",!0),v("div",O,[v("div",z,[(n(!0),c(w,null,b(i(),(a,W)=>(n(),c("div",{key:W,class:"widget"},[(n(),l(V(a.component),{"user-props":a.userProps,value:a.userProps.value,errors:d.value},null,8,["user-props","value","errors"]))]))),128))]),m().length?(n(),c("div",J,[(n(!0),c(w,null,b(m(),a=>(n(),l(M,{key:a,"display-name":_(a).name,action:_(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}});const Q=h(R,[["__scopeId","data-v-ef293d5b"]]);export{Q as default};
//# sourceMappingURL=WidgetPreview.d19311d7.js.map
