import{d as k,r as B,o as A,b as n,c as l,w as p,f as I,am as P,f4 as S,eZ as C,fq as D,u as y,bF as N,fw as V,E as h,f1 as q,eX as g,e as v,eV as c,f2 as b,f3 as E,ay as w,n as x,p as F}from"./outputWidgets.bff33647.js";import{S as L}from"./Steps.76d6eef0.js";import{W as $}from"./WidgetsFrame.830e3752.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]="91c1aa84-9602-457c-9a76-85604af7b7fe",o._sentryDebugIdIdentifier="sentry-dbid-91c1aa84-9602-457c-9a76-85604af7b7fe")}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 A(()=>{u.value&&d.action.setElement(u.value)}),(r,i)=>(n(),l(y(V),null,{default:p(()=>[I(y(N),{ref_key:"element",ref:u,class:C(["next-button",r.disabled?"disabled":""]),loading:r.loading,disabled:r.disabled,onClick:i[0]||(i[0]=f=>t("click")),onKeydown:i[1]||(i[1]=D(f=>t("click"),["enter"]))},{default:p(()=>[P(S(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=q(),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 _(){const e=t.query.button;return e?Array.isArray(e)?e:[e]:[]}const m=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,s)=>(n(),l($,{"main-color":"#d14056",class:"preview",theme:"#fbfbfb","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(E(a.component),{"user-props":a.userProps,value:a.userProps.value,errors:d.value},null,8,["user-props","value","errors"]))]))),128))]),_().length?(n(),c("div",J,[(n(!0),c(w,null,b(_(),a=>(n(),l(M,{key:a,"display-name":m(a).name,action:m(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}});const G=h(R,[["__scopeId","data-v-350e6330"]]);export{G as default};
//# sourceMappingURL=WidgetPreview.e0391a0e.js.map
