import{e as k,r as B,S,n as u,g as n,p as g,bV as I,w as p,v as x,q as A,t as C,K as D,bW as N,B as P,aO as W,ak as V,j as b,k as v,f,O as _,Z as w,X as q,b4 as E,b5 as K}from"./jwt-decode.esm-CzNJpMna.js";import{S as L}from"./Steps-DzcCu8nY.js";import{W as O}from"./PlayerConfigProvider-B_tg2hYa.js";import"./index-BAbb188Z.js";import"./colorHelpers-DqllhzUB.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]="840503ba-f4ef-42c7-9746-5a6baa48b7f5",t._sentryDebugIdIdentifier="sentry-dbid-840503ba-f4ef-42c7-9746-5a6baa48b7f5")}catch{}})();const $=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(t,{emit:s}){const c=t,i=B(null);S(()=>{i.value&&c.action.setElement(i.value)});const l=s;return(m,o)=>(n(),u(g(I),null,{default:p(()=>[x(g(P),{ref_key:"element",ref:i,class:D(["next-button",t.disabled?"disabled":""]),loading:t.loading,disabled:t.disabled,onClick:o[0]||(o[0]=d=>l("click")),onKeydown:o[1]||(o[1]=N(d=>l("click"),["enter"]))},{default:p(()=>[A(C(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),F=W($,[["__scopeId","data-v-aea27bb7"]]),M={class:"form"},j={class:"form-wrapper"},z={key:0,class:"buttons"},J=k({__name:"WidgetPreview",setup(t){const s=V(),c=B([]);function i(e){return E[e]||K[e]||null}function l(e){try{const a=JSON.parse(e);if(a.component=i(a.type),!a.component)throw new Error(`Widget ${a.type} not found`);return a.component?a: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,a)=>(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":""})):b("",!0),v("div",M,[v("div",j,[(n(!0),f(_,null,w(m(),(r,h)=>(n(),f("div",{key:h,class:"widget"},[(n(),u(q(r.component),{"user-props":r.userProps,value:r.userProps.value,errors:c.value},null,8,["user-props","value","errors"]))]))),128))]),d().length?(n(),f("div",z,[(n(!0),f(_,null,w(d(),r=>(n(),u(F,{key:r,"display-name":y(r).name,action:y(r)},null,8,["display-name","action"]))),128))])):b("",!0)])]),_:1}))}}),Q=W(J,[["__scopeId","data-v-ee9ec43e"]]);export{Q as default};
//# sourceMappingURL=WidgetPreview-zR5gRak6.js.map
