import{d as k,r as B,k as I,o as n,a as u,b as f,f as A,g as P,ec as S,e9 as C,eE as D,u as y,bR as N,eW as E,_ as W,ea as V,h as b,e as g,a5 as c,eb as v,ee as q,aR as w,I as x,J as L}from"./jwt-decode.esm.febfd28e.js";import{S as $}from"./Steps.f131345f.js";import{W as F}from"./PlayerConfigProvider.24fc167a.js";import"./index.0d8ae5c8.js";import"./colorHelpers.e47d6f05.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="57a70b68-f8b7-4e0c-bc2a-c23f53d4be7a",o._sentryDebugIdIdentifier="sentry-dbid-57a70b68-f8b7-4e0c-bc2a-c23f53d4be7a")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(o,{emit:t}){const d=o,l=B(null);return I(()=>{l.value&&d.action.setElement(l.value)}),(a,i)=>(n(),u(y(E),null,{default:f(()=>[A(y(N),{ref_key:"element",ref:l,class:C(["next-button",a.disabled?"disabled":""]),loading:a.loading,disabled:a.disabled,onClick:i[0]||(i[0]=p=>t("click")),onKeydown:i[1]||(i[1]=D(p=>t("click"),["enter"]))},{default:f(()=>[P(S(a.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}});const R=W(K,[["__scopeId","data-v-aea27bb7"]]),J={class:"form"},M={class:"form-wrapper"},O={key:0,class:"buttons"},z=k({__name:"WidgetPreview",setup(o){const t=V(),d=B([]);function l(e){return x[e]||L[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 _(){const e=t.query.button;return e?Array.isArray(e)?e:[e]:[]}const m=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,s)=>(n(),u(F,{"main-color":"#d14056",class:"preview",background:"#fbfbfb","font-family":"Inter",locale:"en"},{default:f(()=>[p()?(n(),u($,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):b("",!0),g("div",J,[g("div",M,[(n(!0),c(w,null,v(i(),(r,h)=>(n(),c("div",{key:h,class:"widget"},[(n(),u(q(r.component),{"user-props":r.userProps,value:r.userProps.value,errors:d.value},null,8,["user-props","value","errors"]))]))),128))]),_().length?(n(),c("div",O,[(n(!0),c(w,null,v(_(),r=>(n(),u(R,{key:r,"display-name":m(r).name,action:m(r)},null,8,["display-name","action"]))),128))])):b("",!0)])]),_:1}))}});const U=W(z,[["__scopeId","data-v-e1ac7894"]]);export{U as default};
//# sourceMappingURL=WidgetPreview.5dbd91bd.js.map
