import{B as e,C as t,G as n,S as r,ft as i,j as a,l as o,m as s,o as c,p as l,s as u,u as d}from"./runtime-core.esm-bundler-DTXUv7Wx.js";import{a as f,t as p}from"./vue-router-Cyqru1db.js";import{t as m}from"./Icon-CtR1FGIT.js";import{t as h}from"./i18n-DK-nbHGh.js";import{a as g}from"./api-DlB23x7f.js";import{t as _}from"./Button-JT3QbcL8.js";var v={class:`min-h-svh flex flex-col bg-cream`},y={class:`text-ink flex-1 flex flex-col justify-center`},b={class:`mx-auto w-full max-w-3xl px-6 sm:px-8 md:px-12 lg:px-16 py-10 sm:py-14 md:py-16 lg:py-20`},x={class:`rounded-md border border-line bg-paper p-8 md:p-10 flex flex-col gap-6 items-center text-center`},S={class:`relative w-20 h-20`},C={class:`absolute inset-0 rounded-full bg-brand text-accent flex items-center justify-center`},w={class:`eyebrow`},T={class:`font-display font-normal leading-[1.05] tracking-tight text-ink text-headline-md`},E={class:`italic font-light text-brand`},D={class:`text-base leading-relaxed text-muted max-w-md`},O={key:0,class:`mt-2 inline-flex items-center gap-2 rounded-pill border border-cream-dark bg-cream px-4 py-2 text-[13px] text-ink`},k={class:`eyebrow text-muted`},A={class:`font-mono text-[12px] text-brand`},j={key:1,class:`text-[13px] text-danger mt-2`,role:`alert`,"aria-live":`polite`},M={class:`mt-4 flex flex-col gap-3 w-full max-w-sm`},N={key:2,class:`text-[12px] text-muted mt-2`},P={__name:`CheckoutSuccessPage`,setup(P){let{t:F}=h(),I=f(),L=e(null),R=e(``),z=e(!0),B=c(()=>String(I.query.order||``));return r(async()=>{if(!B.value){R.value=F(`checkout.success.missing`),z.value=!1;return}try{L.value=await g({orderId:B.value})}catch(e){R.value=e?.message||F(`checkout.error.generic`)}finally{z.value=!1}}),(e,r)=>(t(),d(`div`,v,[u(`main`,y,[u(`div`,b,[u(`article`,x,[u(`div`,S,[r[0]||=u(`span`,{"aria-hidden":`true`,class:`absolute inset-0 rounded-full bg-brand-wash`,style:{animation:`var(--animate-pulse-soft)`}},null,-1),u(`span`,C,[s(m,{name:`check`,size:36,"stroke-width":2.4})])]),u(`p`,w,i(n(F)(`checkout.success.eyebrow`)),1),u(`h1`,T,[l(i(n(F)(`checkout.success.headline`))+` `,1),u(`em`,E,i(n(F)(`checkout.success.headline.em`)),1)]),u(`p`,D,i(n(F)(`checkout.success.sub`)),1),B.value?(t(),d(`div`,O,[u(`span`,k,i(n(F)(`checkout.success.orderId`)),1),u(`span`,A,i(B.value),1)])):o(``,!0),R.value?(t(),d(`p`,j,i(R.value),1)):o(``,!0),u(`div`,M,[s(n(p),{to:`/`,class:`block`},{default:a(()=>[s(_,{variant:`primary`,size:`lg`,class:`w-full`},{default:a(()=>[l(i(n(F)(`checkout.success.cta.home`)),1)]),_:1})]),_:1}),s(n(p),{to:`/shop`,class:`block`},{default:a(()=>[s(_,{variant:`secondary`,size:`lg`,class:`w-full`},{default:a(()=>[l(i(n(F)(`checkout.success.cta.shop`)),1)]),_:1})]),_:1})]),!z.value&&L.value?(t(),d(`p`,N,i(n(F)(`checkout.success.email`)),1)):o(``,!0)])])])]))}};export{P as default};