1import{a as p,b as f,r as d,p as g,q as j,j as e,L as c,_ as b,B as u}from"./index-t0Mu2_aA.js";import{f as m,p as y}from"./gtag-B9ZSgckU.js";import{C as k}from"./card-CPRZ8kHu.js";import{C as w}from"./circle-check-BuOkENcl.js";import{P as N}from"./package-CcqJ-vl2.js";import{S as v}from"./shield-check-6VuvYaAw.js";function _(){const r=p(),{user:i,loading:n}=f(),[t]=d.useState(()=>{if(typeof window>"u")return[];const s=new URLSearchParams(window.location.search).get("orders");return s?s.split(",").filter(Boolean):[]}),{data:a}=g({queryKey:["checkout-success",t],enabled:t.length>0,queryFn:()=>Promise.all(t.map(s=>j("buyerOrder",{id:s}).catch(()=>null)))});d.useEffect(()=>{if(!n){if(t.length===0){m();return}a&&m(y(a,i?.email)??void 0)}},[a,n,i?.email,t]);const o=(a??[]).filter(Boolean),h=t.length>0&&!a;return e.jsxs("div",{className:"mx-auto max-w-2xl space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-700",children:[e.jsxs("header",{className:"border-b border-primary/20 pb-4 text-center",children:[e.jsx("div",{className:"mb-3 flex items-center justify-center gap-2 text-success",children:e.jsx(w,{className:"h-10 w-10"})}),e.jsx("div",{className:"mb-2 flex items-center justify-center gap-2 text-hud",children:e.jsx("span",{className:"font-mono text-[10px] tracking-[0.3em] uppercase",children:r.checkoutSuccess.eyebrow})}),e.jsxs("h1",{className:"font-display text-3xl tracking-tighter text-foreground uppercase",children:[r.checkoutSuccess.title," ",e.jsx("span",{className:"text-success",children:r.checkoutSuccess.titleHighlight})]}),e.jsx("p",{className:"mt-1 font-mono text-[10px] text-muted-foreground uppercase tracking-widest",children:r.checkoutSuccess.subtitle})]}),h?e.jsx("p",{className:"text-center font-mono text-[10px] uppercase tracking-widest text-hud animate-pulse",children:r.checkoutSuccess.loading}):o.length>0?e.jsx(k,{className:"border-primary/20 bg-hud-glass p-0 overflow-hidden",children:e.jsx("ul",{className:"divide-y divide-primary/10",children:o.map(s=>{const l=s.listings?.listing_images?.find(x=>!x.is_proof)?.url;return e.jsx("li",{children:e.jsxs(c,{to:"/buyer/orders/$id",params:{id:s.id},className:"group flex items-center gap-4 px-5 py-4 transition-colors hover:bg-primary/5",children:[e.jsx("div",{className:"h-10 w-14 shrink-0 overflow-hidden border border-primary/10 bg-black/40 p-0.5 clip-path-hud",children:l?e.jsx("img",{src:l,alt:"",className:"h-full w-full object-cover"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center",children:e.jsx(N,{className:"h-4 w-4 text-primary/10"})})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate font-display text-sm tracking-wide text-foreground group-hover:text-hud transition-colors",children:s.listings?.title??r.checkoutSuccess.orderFallback}),e.jsxs("div",{className:"mt-0.5 font-mono text-[9px] uppercase tracking-widest text-muted-foreground",children:[r.checkoutSuccess.viewOrder," â"]})]}),e.jsx("span",{className:"shrink-0 font-display text-base text-hud",children:b(s.amount_cents,s.currency)})]})},s.id)})})}):null,e.jsxs("div",{className:"flex items-start gap-3 border border-primary/10 bg-primary/5 p-4",children:[e.jsx(v,{className:"mt-0.5 h-4 w-4 shrink-0 text-hud"}),e.jsx("p",{className:"font-mono text-[10px] uppercase tracking-widest text-muted-foreground",children:r.checkoutSuccess.note})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[e.jsx(u,{asChild:!0,size:"sm",children:e.jsx(c,{to:"/buyer/orders",children:r.checkoutSuccess.ordersCta})}),e.jsx(u,{asChild:!0,variant:"outline",size:"sm",className:"border-primary/20",children:e.jsx(c,{to:"/browse",children:r.checkoutSuccess.browseCta})})]})]})}export{_ as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.