import{_ as w}from"./ActionButton.vue_vue_type_script_setup_true_lang.eac698ad.js";import{S as h}from"./Steps.cb980244.js";import{W}from"./WidgetsFrame.d2e169f5.js";import{d as k,eA as B,r as I,b as r,c as a,w as P,ew as f,e as p,eu as u,eB as m,eI as x,bg as _,m as A,n as D,x as S}from"./outputWidgets.df0b7764.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[s]="a36fae6d-00f8-4b92-b490-71c1bffb99e4",o._sentryDebugIdIdentifier="sentry-dbid-a36fae6d-00f8-4b92-b490-71c1bffb99e4")}catch{}})();const q={class:"form"},C={class:"form-wrapper"},E={key:0,class:"buttons"},L=k({__name:"WidgetPreview",setup(o){const s=B(),i=I([]);function y(e){return A[e]||D[e]||null}function c(e){try{const t=JSON.parse(e);if(t.component=y(t.type),!t.component)throw new Error(`Widget ${t.type} not found`);return t.component?t:null}catch(t){return console.error(t),null}}function g(){const e=s.query.widget;return Array.isArray(e)?e.map(c).filter(Boolean):[c(e)]}function b(){return s.query.steps==="true"}function l(){const e=s.query.button;return e?Array.isArray(e)?e:[e]:[]}const d=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,t)=>(r(),a(W,{"main-color":"#d14056",class:"preview",theme:"#fbfbfb",runtime:"dash","font-family":"Inter"},{default:P(()=>[b()?(r(),a(h,{key:0,"steps-info":{current:2,total:3}})):f("",!0),p("div",q,[p("div",C,[(r(!0),u(_,null,m(g(),(n,v)=>(r(),u("div",{key:v,class:"widget"},[(r(),a(x(n.component),{"user-props":n.userProps,value:n.userProps.value,errors:i.value},null,8,["user-props","value","errors"]))]))),128))]),l().length?(r(),u("div",E,[(r(!0),u(_,null,m(l(),n=>(r(),a(w,{key:n,"display-name":d(n).name,action:d(n)},null,8,["display-name","action"]))),128))])):f("",!0)])]),_:1}))}});const $=S(L,[["__scopeId","data-v-572c34ce"]]);export{$ as default};
//# sourceMappingURL=WidgetPreview.f3418b51.js.map
