import{d as k,r as B,X as S,B as u,m as n,D as g,bv as W,G as f,g as C,$ as I,V as A,aG as N,bw as P,H as V,ap as h,S as q,p as _,q as b,l as c,F as v,U as w,aH as E,aC as $,aD as F}from"./jwt-decode.esm-Dca5fHH5.js";import{S as L}from"./Steps-C6PdqcTg.js";import{W as x}from"./PlayerConfigProvider-COveBbiz.js";import"./index-BFZHdHfr.js";import"./colorHelpers-DW8ZpCiU.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="4c47f173-a96a-4288-8a12-4446de9b0058",r._sentryDebugIdIdentifier="sentry-dbid-4c47f173-a96a-4288-8a12-4446de9b0058")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(r,{emit:t}){const d=r,l=B(null);return S(()=>{l.value&&d.action.setElement(l.value)}),(a,i)=>(n(),u(g(W),null,{default:f(()=>[C(g(V),{ref_key:"element",ref:l,class:N(["next-button",a.disabled?"disabled":""]),loading:a.loading,disabled:a.disabled,onClick:i[0]||(i[0]=p=>t("click")),onKeydown:i[1]||(i[1]=P(p=>t("click"),["enter"]))},{default:f(()=>[I(A(a.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),G=h(K,[["__scopeId","data-v-aea27bb7"]]),H={class:"form"},M={class:"form-wrapper"},O={key:0,class:"buttons"},z=k({__name:"WidgetPreview",setup(r){const t=q(),d=B([]);function l(e){return $[e]||F[e]||null}function a(e){try{const s=JSON.parse(e);if(s.component=l(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(a).filter(Boolean):[a(e)]}function p(){return t.query.steps==="true"}function m(){const e=t.query.button;return e?Array.isArray(e)?e:[e]:[]}const y=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,s)=>(n(),u(x,{"main-color":"#d14056",class:"preview",background:"#fbfbfb","font-family":"Inter",locale:"en"},{default:f(()=>[p()?(n(),u(L,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):_("",!0),b("div",H,[b("div",M,[(n(!0),c(v,null,w(i(),(o,D)=>(n(),c("div",{key:D,class:"widget"},[(n(),u(E(o.component),{"user-props":o.userProps,value:o.userProps.value,errors:d.value},null,8,["user-props","value","errors"]))]))),128))]),m().length?(n(),c("div",O,[(n(!0),c(v,null,w(m(),o=>(n(),u(G,{key:o,"display-name":y(o).name,action:y(o)},null,8,["display-name","action"]))),128))])):_("",!0)])]),_:1}))}}),Q=h(z,[["__scopeId","data-v-e1ac7894"]]);export{Q as default};
//# sourceMappingURL=WidgetPreview-B1rqfTLV.js.map
