import{_ as F}from"./DdLHI-PN.js";import{u as T,_ as J,a as O,b as R}from"./BTsg9mRw.js";import{_ as G}from"./CggM3aGT.js";import{a3 as H,a7 as K,a as Q,$ as W,E as X,a8 as Y,af as Z,bq as ee}from"./BDl4c6dV.js";import{j as te,a as B,k as ae,z as se,o as oe,L as ne,O as le,I as s,P as l,a0 as ie,a1 as ce,u as t,_ as re,U as P,R as ue,S as D}from"./DGQDO-VU.js";import"./DewCGe9j.js";import"./WU7YL9Lk.js";import"./B9zcJ6At.js";import"./DuXmP_XX.js";const me={class:"flex min-h-screen flex-col font-body text-base/6 text-black antialiased anchor-scrolling-none"},de={id:"header",class:"sticky inset-x-0 top-0 z-50 flex-none overflow-hidden border-b border-gray-200 bg-white text-sm shadow-sm outline-none lg:shadow-sm xl:border-b xl:shadow-none"},fe={class:"container relative flex flex-col items-center justify-center py-3.5 md:py-4"},he={class:"-mb-4 mt-4 w-screen bg-yellow-100 p-[0.9rem] text-center text-xs/none"},$e=te({__name:"checkout",setup(_e){const c=B(null),i=B(!1),r=H(),u=K("layout"),a=ae(()=>u.data.value),{unhandled:L,handled:M}=Q(),{toggle:m}=W("VoucherSlideIn"),{enabledVaultItems:o,getVaultItems:q}=X();return Y(async()=>{await Promise.all([L(()=>u.fetchBySlug("default",3)),q()])},"$mrJdsCMilw"),T(),se(async()=>{c.value=Z(()=>{var n;(n=location.hash)!=null&&n.includes("#/payment")?i.value=!0:i.value=!1},500);const e=[];r.data.value||e.push(M(()=>r.fetch())),e.length&&await Promise.all(e)}),oe(()=>{clearInterval(c.value)}),(e,n)=>{var d,f,h,_,p;const z=F,A=J,U=O,j=G,E=R;return ne(),le("div",me,[s(z),l("header",de,[l("div",fe,[s(A,{class:"h-[21px] w-[155px] md:h-[31px] md:w-[227px]","link-to":"/?home"}),ie(l("div",he,[re(P(e.$t("basket.vouchers_available",((d=t(o))==null?void 0:d.length)||0,{quantity:((f=t(o))==null?void 0:f.length)||0}))+" ",1),l("button",{type:"button",class:"underline hover:no-underline",onClick:n[0]||(n[0]=(...v)=>t(m)&&t(m)(...v))},P(e.$t("basket.vouchers_show",(h=t(o))==null?void 0:h.length,{quantity:(_=t(o))==null?void 0:_.length})),1)],512),[[ce,((p=t(o))==null?void 0:p.length)&&i.value]])])]),ue(e.$slots,"default",{class:"min-h-screen flex-1"}),s(j,null,{default:D(()=>[s(U)]),_:1}),s(ee,{ssr:""},{lazy:D(({visible:v})=>{var y,g,b,x,w,k,S,$,C,I,N,V;return[s(E,{data:{theme:(g=(y=a.value)==null?void 0:y.fields)==null?void 0:g.theme,paymentMethods:(x=(b=a.value)==null?void 0:b.fields)==null?void 0:x.paymentMethods,legal:(k=(w=a.value)==null?void 0:w.fields)==null?void 0:k.legal,microcopy:($=(S=a.value)==null?void 0:S.fields)==null?void 0:$.microcopy,footerNavigation1:(I=(C=a.value)==null?void 0:C.fields)==null?void 0:I.footerNavigation1,footerNavigation2:(V=(N=a.value)==null?void 0:N.fields)==null?void 0:V.footerNavigation2,checkout:!0}},null,8,["data"])]}),_:1})])}}});export{$e as default};