import{_ as h}from"./ActionButton.vue_vue_type_script_setup_true_lang.af8cb7d2.js";import{S as k}from"./Steps.f9247165.js";import{W}from"./WidgetsFrame.20e6738d.js";import{d as V,ey as B,r as c,b as r,u as a,eq as I,eu as f,er as p,c as u,ez as m,eG as q,bw as _,l as D,m as P,t as S}from"./registerWidgets.0d6f36c3.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[n]="ec9e8829-ac04-4d84-b234-db937f67cc0f",s._sentryDebugIdIdentifier="sentry-dbid-ec9e8829-ac04-4d84-b234-db937f67cc0f")}catch{}})();const x={class:"form"},A={class:"form-wrapper"},C={key:0,class:"buttons"},E=V({__name:"WidgetPreview",setup(s){const n=B(),i=c([]);function y(e){return D[e]||P[e]||null}function l(e){try{console.log(e);const t=JSON.parse(e);if(t.component=y(t.type),t.refValue=c(t.defaultValue),!t.component)throw new Error(`Widget ${t.type} not found`);return t.value=c(t.defaultValue),console.log(t),t.component?t:null}catch(t){return console.error(t),null}}function g(){const e=n.query.widget;return Array.isArray(e)?e.map(l).filter(Boolean):[l(e)]}function b(){return n.query.steps==="true"}function d(){const e=n.query.button;return e?Array.isArray(e)?e:[e]:[]}const v=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:I(()=>[b()?(r(),a(k,{key:0,"steps-info":{current:2,total:3}})):f("",!0),p("div",x,[p("div",A,[(r(!0),u(_,null,m(g(),(o,w)=>(r(),u("div",{key:w,class:"widget"},[(r(),a(q(o.component),{"user-props":o.userProps,value:o.defaultValue,errors:i.value},null,8,["user-props","value","errors"]))]))),128))]),d().length?(r(),u("div",C,[(r(!0),u(_,null,m(d(),o=>(r(),a(h,{key:o,action:v(o)},null,8,["action"]))),128))])):f("",!0)])]),_:1}))}});const $=S(E,[["__scopeId","data-v-5622e5f2"]]);export{$ as default};
//# sourceMappingURL=WidgetPreview.4cf9236f.js.map
