1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1829],{11829:function(e,r,t){t.r(r),t.d(r,{PaymentMethods:function(){return o}});var a=t(57437),s=t(2265),l=t(88226),d=t(84286);let o=()=>{let[e,r]=(0,s.useState)([]),[t,o]=(0,s.useState)(!0),[i,n]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=!0,t=e=>401===e||403===e?"Please sign in again to view your payment methods.":e>=500?"Something went wrong on our side. Please try again shortly.":"Failed to load payment methods. Please try again.";return(async()=>{try{let a=await fetch("/api/payments/methods",{cache:"no-store"});if(!a.ok)throw Error(t(a.status));let s=await a.json(),l=Array.isArray(null==s?void 0:s.methods)?s.methods:[];e&&r(l)}catch(r){e&&n((null==r?void 0:r.message)||"Failed to load payment methods. Please try again.")}finally{e&&o(!1)}})(),()=>{e=!1}},[]);let c=e.length>0,x=(0,s.useMemo)(()=>e,[e]);return(0,a.jsxs)("div",{className:"bg-white rounded-[16px] p-8 md:p-12 shadow-sm border border-[var(--color-border-lighter)] font-outfit",children:[(0,a.jsx)("div",{className:"flex items-center justify-between gap-4 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-[22px] md:text-[24px] font-bold text-[var(--color-neutral-dark)] mb-1",children:"Payment Methods"}),(0,a.jsx)("p",{className:"text-[var(--color-neutral-600)] text-[14px] md:text-[16px]",children:"Your saved payment methods are listed below."})]})}),t?(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[1,2].map(e=>(0,a.jsx)("div",{className:"h-[96px] rounded-[12px] border border-[var(--color-border-light)] bg-[var(--color-surface-muted)] animate-pulse"},e))}):i?(0,a.jsx)("div",{className:"rounded-[12px] border border-red-200 bg-red-50 px-4 py-3 text-[14px] text-red-700",children:i}):c?(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:x.map(e=>{let r=[e.brand||e.provider||"Card",e.last4?"**** ".concat(e.last4):null].filter(Boolean).join(" "),t=e.exp_month&&e.exp_year?"".concat(e.exp_month,"/").concat(e.exp_year):null;return(0,a.jsxs)("div",{className:"border border-[var(--color-border-light)] rounded-[12px] p-4 flex items-center justify-between bg-white",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-[var(--color-brand-primary-lighter)] flex items-center justify-center",children:(0,a.jsx)(l.Z,{size:20,className:"text-[var(--color-brand-primary-light)]"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[15px] font-semibold text-[var(--color-neutral-dark)]",children:r}),(0,a.jsxs)("div",{className:"text-[12px] text-[var(--color-neutral-600)]",children:[e.kind||"Stored Method",t?" ⢠Exp ".concat(t):""]})]})]}),(0,a.jsx)("div",{className:"text-[12px] text-[var(--color-neutral-300)] uppercase tracking-wide",children:e.provider||"Provider"})]},e.id)})}):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center text-center min-h-[280px]",children:[(0,a.jsx)("div",{className:"w-[80px] h-[80px] bg-[var(--color-brand-primary-lighter)] rounded-full flex items-center justify-center mb-6",children:(0,a.jsx)(l.Z,{size:40,className:"text-[var(--color-brand-primary-light)]"})}),(0,a.jsx)("h4",{className:"text-[20px] font-bold text-[var(--color-neutral-dark)] mb-3",children:"No Saved Methods"}),(0,a.jsx)("p",{className:"text-[var(--color-neutral-600)] text-[15px] max-w-[320px] mb-6",children:"Payment methods are stored after a successful checkout. Complete a payment to save one here."}),(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 px-6 py-3 bg-[var(--color-brand-primary-light)]/5 text-[var(--color-brand-primary-light)] rounded-full border border-[var(--color-brand-primary-light)]/10",children:[(0,a.jsx)(d.Z,{size:20}),(0,a.jsx)("span",{className:"text-[13px] font-bold uppercase tracking-wider",children:"Secure Checkout"})]})]})]})}}}]);
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.