import{a as k,r as B,J as I,b as u,f as n,u as b,bL as S,w as p,h as x,g as A,t as C,K as D,bM as N,B as P,aO as h,ak as V,e as g,n as _,k as f,R as v,$ as w,Y as q,b0 as E,b1 as L}from"./jwt-decode.esm-BUhVyVlz.js";import{S as $}from"./Steps-CRI1I7fm.js";import{W as K}from"./PlayerConfigProvider-DFP6gzgm.js";import"./index-CCmPkIyA.js";import"./colorHelpers-PI4QQo4l.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]="8312abf2-6020-4ec2-bc82-449a8bb43374",t._sentryDebugIdIdentifier="sentry-dbid-8312abf2-6020-4ec2-bc82-449a8bb43374")}catch{}})();const F=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(t,{emit:s}){const d=t,i=B(null);I(()=>{i.value&&d.action.setElement(i.value)});const l=s;return(m,o)=>(n(),u(b(S),null,{default:p(()=>[x(b(P),{ref_key:"element",ref:i,class:D(["next-button",t.disabled?"disabled":""]),loading:t.loading,disabled:t.disabled,onClick:o[0]||(o[0]=c=>l("click")),onKeydown:o[1]||(o[1]=N(c=>l("click"),["enter"]))},{default:p(()=>[A(C(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),M=h(F,[["__scopeId","data-v-aea27bb7"]]),O={class:"form"},J={class:"form-wrapper"},R={key:0,class:"buttons"},z=k({__name:"WidgetPreview",setup(t){const s=V(),d=B([]);function i(e){return E[e]||L[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 c(){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(K,{"main-color":"#d14056",class:"preview",background:"#fbfbfb","font-family":"Inter",locale:"en"},{default:p(()=>[o()?(n(),u($,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):g("",!0),_("div",O,[_("div",J,[(n(!0),f(v,null,w(m(),(a,W)=>(n(),f("div",{key:W,class:"widget"},[(n(),u(q(a.component),{"user-props":a.userProps,value:a.userProps.value,errors:d.value},null,8,["user-props","value","errors"]))]))),128))]),c().length?(n(),f("div",R,[(n(!0),f(v,null,w(c(),a=>(n(),u(M,{key:a,"display-name":y(a).name,action:y(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}}),T=h(z,[["__scopeId","data-v-d3d01da6"]]);export{T as default};
//# sourceMappingURL=WidgetPreview-z69AlRbH.js.map
