import{e as k,r as B,W as I,n as u,g as n,p as b,bN as N,w as p,v as P,q as S,t as x,O as A,bO as C,B as D,aP as W,an as q,j as g,k as v,f,R as _,a1 as w,$ as V,b0 as E,b1 as $}from"./jwt-decode.esm-CuqABuF0.js";import{S as L}from"./Steps-B8CWfzxA.js";import{W as O}from"./PlayerConfigProvider-DRr52D-b.js";import"./index-BuNHV0sx.js";import"./colorHelpers-CyiO3ixI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="f84beb8c-49fe-4113-b995-8c100c2fd68b",t._sentryDebugIdIdentifier="sentry-dbid-f84beb8c-49fe-4113-b995-8c100c2fd68b")}catch{}})();const F=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(t,{emit:s}){const c=t,i=B(null);I(()=>{i.value&&c.action.setElement(i.value)});const l=s;return(m,o)=>(n(),u(b(N),null,{default:p(()=>[P(b(D),{ref_key:"element",ref:i,class:A(["next-button",t.disabled?"disabled":""]),loading:t.loading,disabled:t.disabled,onClick:o[0]||(o[0]=d=>l("click")),onKeydown:o[1]||(o[1]=C(d=>l("click"),["enter"]))},{default:p(()=>[S(x(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),K=W(F,[["__scopeId","data-v-aea27bb7"]]),M={class:"form"},R={class:"form-wrapper"},j={key:0,class:"buttons"},z=k({__name:"WidgetPreview",setup(t){const s=q(),c=B([]);function i(e){return E[e]||$[e]||null}function l(e){try{const r=JSON.parse(e);if(r.component=i(r.type),!r.component)throw new Error(`Widget ${r.type} not found`);return r.component?r:null}catch{return null}}function m(){const e=s.query.widget;return Array.isArray(e)?e.map(l).filter(Boolean):[l(e)]}function o(){return s.query.steps==="true"}function d(){const e=s.query.button;return e?Array.isArray(e)?e:[e]:[]}const y=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,r)=>(n(),u(O,{"main-color":"var(--ac-brand-primary)",class:"preview",background:"var(--ac-bg-secondary)","font-family":"Inter",locale:"en"},{default:p(()=>[o()?(n(),u(L,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):g("",!0),v("div",M,[v("div",R,[(n(!0),f(_,null,w(m(),(a,h)=>(n(),f("div",{key:h,class:"widget"},[(n(),u(V(a.component),{"user-props":a.userProps,value:a.userProps.value,errors:c.value},null,8,["user-props","value","errors"]))]))),128))]),d().length?(n(),f("div",j,[(n(!0),f(_,null,w(d(),a=>(n(),u(K,{key:a,"display-name":y(a).name,action:y(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}}),U=W(z,[["__scopeId","data-v-ee9ec43e"]]);export{U as default};
//# sourceMappingURL=WidgetPreview-BldwW6Vc.js.map
