1import{d as x,r as i,j as e,L as c}from"./index-ujQMwU1B.js";import{c as u,N as h,B as m}from"./Navbar-BVVX5YAz.js";import{f as p}from"./payments.functions-D2Su3pEU.js";import{g}from"./stripe-CuFaIc99.js";import{L as l}from"./loader-circle-CcoUaKOE.js";import{C as f}from"./circle-check-DCJT0lyt.js";import"./auth-middleware-BA2pY57R.js";const j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],y=u("circle-x",j);function z(){const{session_id:a}=x.useSearch(),[s,r]=i.useState("loading"),[d,n]=i.useState("");return i.useEffect(()=>{let o=!0;if(!a){r("error"),n("No order reference found.");return}return p({data:{sessionId:a,environment:g()}}).then(t=>{o&&("error"in t?(r("error"),n(t.error)):t.status==="pending"?r("pending"):r("success"))}).catch(t=>{o&&(r("error"),n(t instanceof Error?t.message:"Something went wrong."))}),()=>{o=!1}},[a]),e.jsxs("main",{className:"min-h-screen bg-background",children:[e.jsx(h,{}),e.jsxs("section",{className:"mx-auto max-w-xl px-5 py-24 text-center",children:[s==="loading"&&e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"mx-auto h-12 w-12 animate-spin text-cyan"}),e.jsx("h1",{className:"mt-6 font-display text-2xl uppercase text-foreground",children:"Confirming your orderâ¦"})]}),s==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(f,{className:"mx-auto h-14 w-14 text-cyan"}),e.jsx("h1",{className:"mt-6 font-display text-3xl uppercase text-foreground",children:"You're in, Knight"}),e.jsx("p",{className:"mt-3 text-muted-foreground",children:"Payment confirmed. Your downloads are unlocked in your library."}),e.jsx(m,{asChild:!0,variant:"hero",size:"lg",className:"mt-8",children:e.jsx(c,{to:"/account",children:"Go to My Library"})})]}),s==="pending"&&e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"mx-auto h-12 w-12 animate-spin text-copper"}),e.jsx("h1",{className:"mt-6 font-display text-2xl uppercase text-foreground",children:"Payment processing"}),e.jsx("p",{className:"mt-3 text-muted-foreground",children:"Your payment is still processing. Check your library again in a moment."}),e.jsx(m,{asChild:!0,variant:"steel",size:"lg",className:"mt-8",children:e.jsx(c,{to:"/account",children:"Go to My Library"})})]}),s==="error"&&e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"mx-auto h-14 w-14 text-destructive"}),e.jsx("h1",{className:"mt-6 font-display text-2xl uppercase text-foreground",children:"We hit a snag"}),e.jsx("p",{className:"mt-3 text-muted-foreground",children:d}),e.jsx(m,{asChild:!0,variant:"steel",size:"lg",className:"mt-8",children:e.jsx(c,{to:"/account",children:"Go to My Library"})})]})]})]})}export{z 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.