1import{r as a,j as e,L as F,k as U,y as K,c as D,p as $,z,g as J,H as ge,J as je}from"./index-D6UrFXqh.js";import{A as we,X as q}from"./AppShell-DKhCxBd5.js";import{K as Ne}from"./KycRequiredModal-DuP5RO3_.js";import{A as ve}from"./arrow-left-DJrC1F0y.js";import{W as ke,L as _e}from"./appContent-Bmmk0ks2.js";import{P as re}from"./plus-M6lCFdpo.js";import{R as Ce}from"./refresh-cw-ByC1R9TZ.js";import{C as ne}from"./check-circle-2-BBTiHial.js";import{M as Se}from"./map-pin-ClzH3uwA.js";import{A as H,W as le}from"./Logo-VUZnl8oB.js";import{B as Ae}from"./sparkles-DMSCgezF.js";import{L as Te}from"./lock-keyhole-BMrtgtHr.js";import"./shield-check-Nz0OL0hG.js";import"./createLucideIcon-DBOTLUhc.js";import"./help-circle-DfpDRC0m.js";import"./file-text-DXawlq-x.js";const Ee=[{label:"USD",value:"usd"},{label:"GBP",value:"gbp"},{label:"EUR",value:"eur"},{label:"BRL",value:"brl"},{label:"COP",value:"cop"}],Pe=[{label:"US",value:"us"},{label:"UK",value:"uk"},{label:"EU",value:"eu"}],Le=[{label:"Self",value:"self"},{label:"Third party",value:"third_party"}],Be=[{label:"Checking",value:"checking"},{label:"Savings",value:"savings"}],_={bank:{title:"Bank account withdrawals",description:"Choose from your linked bank accounts or add another destination."},crypto:{title:"Withdraw to an external wallet",description:"Send supported stablecoins from Diba to a Solana wallet."}},C=l=>l?l.split(/[_\s-]+/).filter(Boolean).map(y=>`${y.charAt(0).toUpperCase()}${y.slice(1).toLowerCase()}`).join(" "):"Not provided",ie=l=>l?`â¢â¢â¢â¢ ${l.slice(-4)}`:"Not provided",Ie=l=>[l.street_line_1,l.city,l.state,l.postal_code,l.country].filter(Boolean).join(", "),Ve=()=>{const[l,y]=a.useState("bank"),[G,oe]=a.useState([]),[ce,de]=a.useState(0),[g,S]=a.useState(!0),[X,u]=a.useState(""),[i,Q]=a.useState(null),[j,V]=a.useState(!1),[w,b]=a.useState("details"),[p,A]=a.useState(""),[N,T]=a.useState(""),[h,E]=a.useState(""),[Y,P]=a.useState(!1),[x,r]=a.useState(""),[me,v]=a.useState(!1),[xe,L]=a.useState(!1),[ue,Z]=a.useState(!1),[ee,B]=a.useState(!1),[I,d]=a.useState(""),[k,M]=a.useState(""),[n,pe]=a.useState({currency:"usd",owner_type:"self",bank_name:"",account_owner_name:"",account_type:"us",account_number:"",routing_number:"",checking_or_savings:"checking"}),te=a.useMemo(()=>G.filter(t=>t.is_external_account),[G]);a.useEffect(()=>{if(!k)return;const t=window.setTimeout(()=>M(""),2600);return()=>window.clearTimeout(t)},[k]),a.useEffect(()=>{if(!j)return;const t=window.setTimeout(()=>{const s=w==="pin"?document.getElementById("withdraw-pin-input"):document.getElementById("withdraw-amount-input");s instanceof HTMLInputElement&&s.focus()},0);return()=>window.clearTimeout(t)},[j,w]);const O=async()=>{if(!U()){u("Please log in again to view your linked accounts."),S(!1);return}S(!0),u("");try{const s=await K(D.linkedAccounts),c=await $(s);if(!s.ok){const f=z(c,s.status);if(f){u(f.message);return}u(J(c,s.status,{fallback:"We could not load your linked accounts. Please try again.",serverError:"The linked accounts service is having trouble right now. Please try again shortly."}));return}const o=c??{};oe(Array.isArray(o.results)?o.results:[]),de(o.count??0)}catch{u("Network or server error. Please try again.")}finally{S(!1)}};a.useEffect(()=>{O()},[]);const se=async()=>{if(ue)return;const t=U();if(!t){u("Please log in again to add a bank account.");return}if(t.user.is_kyc_verified){v(!0),d("");return}Z(!0);let s=null;try{ge(),s=await je(t)}catch{s=null}finally{Z(!1)}if(s!=null&&s.user.is_kyc_verified){v(!0),d("");return}L(!0)},R=()=>{v(!1),B(!1),d("")},he=t=>{Q(t),A(""),T(""),E(""),r(""),b("details"),V(!0)},W=()=>{V(!1),Q(null),b("details"),A(""),T(""),E(""),r(""),P(!1)},m=(t,s)=>{pe(c=>({...c,[t]:s})),I&&d("")},be=async()=>{if(!i){r("Select a bank account first.");return}if(!p.trim()||Number(p)<=0){r("Enter a valid amount.");return}if(!N.trim()){r("Add a note for this transfer.");return}if(h.trim().length!==4){r("Enter your 4-digit PIN.");return}P(!0),r("");try{const t=await K(D.bankTransfer,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pin:h.trim(),amount:p.trim(),destination:{currency:i.currency.toLowerCase(),external_account_id:i.external_id},metadata:{note:N.trim()}})}),s=await $(t);if(!t.ok){const o=z(s,t.status);if(o){r(o.message);return}r(J(s,t.status,{fallback:"We could not submit this bank transfer.",serverError:"The bank transfer service is having trouble right now. Please try again shortly."}));return}const c=s??{};M(c.state?`Transfer submitted successfully. Status: ${C(c.state)}.`:"Transfer submitted successfully."),W()}catch{r("Network or server error. Please try again.")}finally{P(!1)}},fe=()=>{if(!i){r("Select a bank account first.");return}if(!p.trim()||Number(p)<=0){r("Enter a valid amount.");return}if(!N.trim()){r("Add a note for this transfer.");return}r(""),b("pin"),window.setTimeout(()=>{const t=document.getElementById("withdraw-pin-input");t instanceof HTMLInputElement&&t.focus()},0)},ye=async()=>{var c;if(!((c=U())!=null&&c.user.is_kyc_verified)){v(!1),L(!0);return}if(["currency","owner_type","bank_name","account_owner_name","account_type","account_number","routing_number","checking_or_savings"].find(o=>!n[o].trim())){d("Fill in all bank account details before saving.");return}B(!0),d("");try{const o=await K(D.linkBankAccount,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({currency:n.currency,owner_type:n.owner_type,details:{bank_name:n.bank_name.trim(),account_owner_name:n.account_owner_name.trim(),account_type:n.account_type.trim(),account:{account_number:n.account_number.trim(),routing_number:n.routing_number.trim(),checking_or_savings:n.checking_or_savings.trim()}}})}),f=await $(o);if(!o.ok){const ae=z(f,o.status);if(ae){d(ae.message);return}d(J(f,o.status,{fallback:"We could not link this bank account. Please try again.",serverError:"The bank linking service is having trouble right now. Please try again shortly."}));return}M("Bank account linked successfully."),R(),await O()}catch{d("Network or server error. Please try again.")}finally{B(!1)}};return e.jsxs(we,{children:[e.jsxs("div",{className:"mx-auto max-w-5xl space-y-5",children:[e.jsxs(F,{to:"/dashboard",className:"inline-flex items-center gap-2 text-sm font-semibold text-slate-500 transition hover:text-primary",children:[e.jsx(ve,{className:"h-4 w-4"}),"Dashboard"]}),e.jsx("section",{className:"rounded-2xl bg-primary text-white shadow-lg shadow-primary/20",children:e.jsxs("div",{className:"flex flex-col gap-5 px-5 py-6 sm:flex-row sm:items-center sm:justify-between sm:px-7",children:[e.jsxs("div",{className:"max-w-2xl",children:[e.jsx("p",{className:"text-sm font-semibold text-white/80",children:"Withdraw Money"}),e.jsx("h1",{className:"mt-2 text-3xl font-bold leading-tight",children:"Choose how you want to withdraw"}),e.jsx("p",{className:"mt-3 max-w-xl text-sm font-medium leading-relaxed text-white/75",children:"Withdraw to a linked bank account or send supported stablecoins to an external Solana wallet."})]}),e.jsx("div",{className:"hidden h-20 w-20 shrink-0 items-center justify-center rounded-2xl bg-white/15 sm:flex",children:e.jsx(ke,{className:"h-10 w-10"})})]})}),e.jsx("section",{className:"rounded-2xl bg-white p-1 shadow-lg shadow-slate-200/80",children:e.jsx("div",{className:"grid grid-cols-2 gap-1",children:["bank","crypto"].map(t=>{const s=l===t;return e.jsx("button",{type:"button",onClick:()=>y(t),className:`rounded-xl px-4 py-3 text-sm font-bold transition ${s?"bg-primary text-white shadow-sm":"bg-white text-slate-500 hover:bg-slate-50"}`,children:t==="bank"?"Bank accounts":"Crypto wallets"},t)})})}),X&&e.jsx("div",{className:"rounded-lg border border-red-100 bg-red-50 px-4 py-3 text-sm text-red-600",children:X}),l==="bank"&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-xl border border-slate-100 bg-white p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs font-bold uppercase text-slate-400",children:"Linked banks"}),e.jsx("p",{className:"mt-1 text-2xl font-bold text-slate-950",children:g?"...":ce})]}),e.jsxs("div",{className:"rounded-xl border border-slate-100 bg-white p-4 shadow-sm",children:[e.jsx("p",{className:"text-xs font-bold uppercase text-slate-400",children:"Withdraw route"}),e.jsx("p",{className:"mt-1 text-2xl font-bold text-slate-950",children:"Bank"})]}),e.jsxs("button",{type:"button",onClick:se,className:"inline-flex items-center justify-center gap-2 rounded-xl bg-primary px-4 py-4 text-sm font-bold text-white shadow-sm transition hover:bg-primary-dark",children:[e.jsx(re,{className:"h-4 w-4"}),"Add bank account"]})]}),e.jsxs("section",{className:"overflow-hidden rounded-xl bg-white shadow-lg shadow-slate-200/80",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-slate-100 px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-slate-950",children:_.bank.title}),e.jsx("p",{className:"mt-1 text-sm font-semibold text-slate-400",children:_.bank.description})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:O,disabled:g,className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-slate-200 text-slate-500 transition hover:border-primary/30 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Refresh linked accounts",children:e.jsx(Ce,{className:`h-4 w-4 ${g?"animate-spin":""}`})}),e.jsx(F,{to:"/dashboard/accounts",className:"inline-flex items-center gap-2 rounded-xl border border-primary/10 bg-primary/5 px-4 py-2.5 text-sm font-bold text-primary transition hover:bg-primary/10",children:"Manage accounts"})]})]}),g?e.jsx("div",{className:"px-4 py-12 text-center",children:e.jsx("p",{className:"text-sm font-semibold text-slate-700",children:"Loading linked accounts..."})}):te.length>0?e.jsx("div",{className:"divide-y divide-slate-100",children:te.map(t=>{const s=Ie(t);return e.jsxs("article",{className:"px-4 py-5 sm:px-5",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 gap-4",children:[e.jsx("span",{className:"inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:e.jsx(_e,{className:"h-6 w-6"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"truncate text-base font-bold text-slate-950",children:t.bank_name}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-50 px-2.5 py-1 text-xs font-bold text-emerald-600",children:[e.jsx(ne,{className:"h-3.5 w-3.5"}),"Ready"]})]}),e.jsx("p",{className:"mt-1 text-sm font-semibold text-slate-500",children:t.account_owner_name}),e.jsxs("p",{className:"mt-2 text-sm font-bold text-slate-800",children:[t.currency.toUpperCase()," ⢠",C(t.checking_or_savings)," â¢"," ",ie(t.account_number)]})]})]}),e.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2 sm:justify-end",children:[e.jsx("span",{className:"rounded-full bg-slate-100 px-3 py-1.5 text-xs font-bold text-slate-600",children:C(t.owner_type)}),e.jsx("span",{className:"rounded-full bg-primary/10 px-3 py-1.5 text-xs font-bold text-primary",children:t.account_type.toUpperCase()})]})]}),e.jsxs("div",{className:"mt-4 grid gap-3 rounded-xl bg-slate-50 p-4 text-sm sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold uppercase text-slate-400",children:"Account type"}),e.jsx("p",{className:"mt-1 font-bold text-slate-700",children:C(t.account_type)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold uppercase text-slate-400",children:"Routing number"}),e.jsx("p",{className:"mt-1 font-bold text-slate-700",children:t.rout
1ing_number??"Not provided"})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx("p",{className:"text-xs font-bold uppercase text-slate-400",children:"Address"}),e.jsxs("p",{className:"mt-1 flex items-start gap-2 font-semibold text-slate-600",children:[e.jsx(Se,{className:"mt-0.5 h-4 w-4 shrink-0 text-slate-400"}),e.jsx("span",{children:s||"Not provided"})]})]})]}),e.jsx("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:justify-end",children:e.jsxs("button",{type:"button",onClick:()=>he(t),className:"inline-flex items-center justify-center gap-2 rounded-xl bg-primary px-4 py-3 text-sm font-bold text-white transition hover:bg-primary-dark",children:["Withdraw to this account",e.jsx(H,{className:"h-4 w-4"})]})})]},t.id)})}):e.jsxs("div",{className:"flex min-h-[320px] flex-col items-center justify-center px-4 py-12 text-center",children:[e.jsx("span",{className:"inline-flex h-20 w-20 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:e.jsx(Ae,{className:"h-10 w-10"})}),e.jsx("h2",{className:"mt-5 text-lg font-bold text-slate-950",children:"No linked bank accounts yet"}),e.jsx("p",{className:"mt-2 max-w-sm text-sm leading-relaxed text-slate-500",children:"Add a bank account here and it will be available for withdrawals."}),e.jsxs("button",{type:"button",onClick:se,className:"mt-5 inline-flex items-center justify-center gap-2 rounded-xl bg-primary px-4 py-3 text-sm font-bold text-white transition hover:bg-primary-dark",children:[e.jsx(re,{className:"h-4 w-4"}),"Link bank account"]})]})]})]}),l==="crypto"&&e.jsxs("section",{className:"rounded-2xl bg-white p-5 shadow-lg shadow-slate-200/80",children:[e.jsxs("div",{className:"flex flex-col gap-5 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"max-w-2xl",children:[e.jsx("h2",{className:"text-xl font-bold text-slate-950",children:_.crypto.title}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-slate-500",children:_.crypto.description})]}),e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full bg-primary/10 px-3 py-2 text-xs font-bold text-primary",children:[e.jsx(le,{className:"h-4 w-4"}),"Solana network"]})]}),e.jsxs("div",{className:"mt-5 rounded-2xl border border-slate-100 bg-slate-50 px-5 py-10 text-center",children:[e.jsx("span",{className:"mx-auto inline-flex h-16 w-16 items-center justify-center rounded-2xl bg-white text-primary shadow-sm",children:e.jsx(le,{className:"h-8 w-8"})}),e.jsx("h3",{className:"mt-4 text-lg font-bold text-slate-950",children:"Send to an external wallet"}),e.jsx("p",{className:"mx-auto mt-2 max-w-md text-sm leading-relaxed text-slate-500",children:"Choose an available stablecoin, enter a Solana wallet address and amount, then confirm the withdrawal with your transaction PIN."}),e.jsxs(F,{to:"/dashboard/send/external",className:"mt-6 inline-flex items-center justify-center gap-2 rounded-xl bg-primary px-5 py-3 text-sm font-bold text-white shadow-sm transition hover:bg-primary-dark",children:["Send to external wallet",e.jsx(H,{className:"h-4 w-4"})]}),e.jsx("p",{className:"mx-auto mt-4 max-w-md text-xs font-semibold leading-relaxed text-amber-700",children:"External wallet transfers cannot usually be reversed. Confirm the network, asset and address carefully."})]})]})]}),j&&i&&w==="details"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-slate-950/40 px-4 py-6 backdrop-blur-[2px] sm:items-center",children:e.jsxs("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl bg-white shadow-2xl shadow-slate-950/20",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-slate-100 px-5 py-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold uppercase text-slate-400",children:"Bank transfer"}),e.jsxs("h2",{className:"mt-1 text-lg font-bold text-slate-950",children:["Withdraw to ",i.bank_name]}),e.jsxs("p",{className:"mt-1 text-sm text-slate-500",children:[i.account_owner_name," ⢠",i.currency.toUpperCase()," â¢"," ",ie(i.account_number)]})]}),e.jsx("button",{type:"button",onClick:W,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-slate-200 text-slate-500 transition hover:text-slate-800","aria-label":"Close bank transfer modal",children:e.jsx(q,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-5 px-5 py-5",children:[e.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:[{label:"1",title:"Amount"},{label:"2",title:"Note"},{label:"3",title:"Review"}].map(t=>e.jsxs("div",{className:"rounded-xl border border-slate-100 bg-slate-50 p-3",children:[e.jsxs("p",{className:"text-xs font-bold uppercase text-slate-400",children:["Step ",t.label]}),e.jsx("p",{className:"mt-1 text-sm font-bold text-slate-950",children:t.title})]},t.title))}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-[1.2fr_0.8fr]",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm font-bold text-slate-700",children:"Amount"}),e.jsx("input",{id:"withdraw-amount-input",type:"number",inputMode:"decimal",min:"0",step:"0.01",value:p,onChange:t=>{A(t.target.value),x&&r("")},placeholder:"1.00",className:"mt-2 h-12 w-full rounded-xl border border-slate-200 px-4 text-sm font-semibold text-slate-800 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm font-bold text-slate-700",children:"Note"}),e.jsx("textarea",{value:N,onChange:t=>{T(t.target.value),x&&r("")},placeholder:"Transfer to my bank",rows:4,className:"mt-2 w-full rounded-xl border border-slate-200 px-4 py-3 text-sm font-semibold text-slate-800 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10"})]})]}),e.jsx("div",{className:"space-y-4 rounded-2xl bg-slate-50 p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold uppercase text-slate-400",children:"Auto-filled destination"}),e.jsxs("div",{className:"mt-3 space-y-3 text-sm text-slate-600",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("span",{className:"font-bold text-slate-500",children:"Bank"}),e.jsx("span",{className:"text-right font-semibold text-slate-800",children:i.bank_name})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("span",{className:"font-bold text-slate-500",children:"Owner"}),e.jsx("span",{className:"text-right font-semibold text-slate-800",children:i.account_owner_name})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsx("span",{className:"font-bold text-slate-500",children:"Destination currency"}),e.jsx("span",{className:"text-right font-semibold text-slate-800",children:i.currency.toLowerCase()})]})]})]})})]}),x&&e.jsx("p",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm font-semibold text-red-600",children:x}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-between",children:[e.jsx("button",{type:"button",onClick:W,className:"inline-flex items-center justify-center rounded-xl border border-slate-200 px-4 py-3 text-sm font-bold text-slate-600 transition hover:bg-slate-50",children:"Cancel"}),e.jsxs("button",{type:"button",onClick:fe,className:"inline-flex items-center justify-center gap-2 rounded-xl bg-primary px-4 py-3 text-sm font-bold text-white transition hover:bg-primary-dark disabled:cursor-not-allowed disabled:opacity-60",children:["Continue to PIN",e.
1jsx(H,{className:"h-4 w-4"})]})]})]})]})}),j&&i&&w==="pin"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-slate-950/40 px-4 py-6 backdrop-blur-[2px] sm:items-center",children:e.jsxs("div",{className:"w-full max-w-sm rounded-2xl bg-white p-5 text-center shadow-2xl shadow-slate-950/20",children:[e.jsx("button",{type:"button",onClick:()=>b("details"),className:"ml-auto flex h-8 w-8 items-center justify-center rounded-full border border-slate-200 text-slate-500 transition hover:text-slate-800","aria-label":"Back to transfer details",children:e.jsx(q,{className:"h-4 w-4"})}),e.jsx("span",{className:"mx-auto mt-1 inline-flex h-14 w-14 items-center justify-center rounded-full bg-primary/10 text-primary",children:e.jsx(Te,{className:"h-7 w-7"})}),e.jsx("h2",{className:"mt-4 text-lg font-bold text-slate-950",children:"Enter Transaction PIN"}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-slate-500",children:"Enter your 4-digit PIN to complete this withdrawal."}),e.jsxs("label",{className:"mt-5 block text-left",children:[e.jsx("span",{className:"sr-only",children:"Transaction PIN"}),e.jsx("input",{id:"withdraw-pin-input",type:"password",inputMode:"numeric",autoComplete:"one-time-code",value:h,onChange:t=>{E(t.target.value.replace(/\D/g,"").slice(0,4)),x&&r("")},className:"sr-only",autoFocus:!0}),e.jsx("span",{className:"flex justify-center gap-3","aria-hidden":"true",children:[0,1,2,3].map(t=>e.jsx("span",{className:`flex h-12 w-12 items-center justify-center rounded-xl border text-lg font-bold ${h[t]?"border-primary bg-primary/10 text-primary":"border-slate-200 bg-slate-50 text-slate-300"}`,children:h[t]?"â¢":""},t))})]}),x&&e.jsx("p",{className:"mt-4 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm font-semibold text-red-600",children:x}),e.jsxs("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row",children:[e.jsx("button",{type:"button",onClick:()=>b("details"),className:"inline-flex flex-1 items-center justify-center rounded-xl border border-slate-200 px-4 py-3 text-sm font-bold text-slate-600 transition hover:bg-slate-50",children:"Back"}),e.jsx("button",{type:"button",onClick:be,disabled:Y||h.length<4,className:"inline-flex flex-1 items-center justify-center rounded-xl bg-primary px-4 py-3 text-sm font-bold text-white transition hover:bg-primary-dark disabled:cursor-not-allowed disabled:opacity-60",children:Y?"Submitting...":"Confirm transfer"})]})]})}),k&&e.jsxs("div",{className:"fixed bottom-24 left-4 right-4 z-50 mx-auto flex max-w-sm items-center justify-center gap-2 rounded-xl bg-slate-950 px-4 py-3 text-sm font-semibold text-white shadow-2xl shadow-slate-950/20 lg:bottom-6",role:"status","aria-live":"polite",children:[e.jsx(ne,{className:"h-4 w-4 text-emerald-300"}),k]}),xe&&e.jsx(Ne,{onClose:()=>L(!1)}),me&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-slate-950/40 px-4 py-6 backdrop-blur-[2px] sm:items-center",children:e.jsxs("div",{className:"w-full max-w-xl overflow-hidden rounded-2xl bg-white shadow-2xl shadow-slate-950/20",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-slate-100 px-5 py-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold uppercase text-slate-400",children:"Add bank account"}),e.jsx("h2",{className:"mt-1 text-lg font-bold text-slate-950",children:"Link another bank account"})]}),e.jsx("button",{type:"button",onClick:R,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-slate-200 text-slate-500 transition hover:text-slate-800","aria-label":"Close add bank account modal",children:e.jsx(q,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[e.jsx("p",{className:"text-sm leading-relaxed text-slate-500",children:"Add the bank details for a withdrawal destination."}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm font-bold text-slate-700",children:"Currency"}),e.jsx("select",{value:n.currency,onChange:t=>m("currency",t.target.value),className:"mt-2 h-12 w-full rounded-xl border border-slate-200 px-4 text-sm font-semibold text-slate-800 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10",children:Ee.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm font-bold text-slate-700",children:"Owner type"}
1),e.jsx("select",{value:n.owner_type,onChange:t=>m("owner_type",t.target.value),className:"mt-2 h-12 w-full rounded-xl border border-slate-200 px-4 text-sm font-semibold text-slate-800 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10",children:Le.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm font-bold text-slate-700",children:"Bank name"}),e.jsx("input",{type:"text",value:n.bank_name,onChange:t=>m("bank_name",t.target.value),placeholder:"Bank of America",className:"mt-2 h-12 w-full rounded-xl border border-slate-200 px-4 text-sm font-semibold text-slate-800 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10"})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm font-bold text-slate-700",children:"Account owner name"}),e.jsx("input",{type:"text",value:n.account_owner_name,onChange:t=>m("account_owner_name",t.target.value),placeholder:"John Doe",className:"mt-2 h-12 w-full rounded-xl border border-slate-200 px-4 text-sm font-semibold text-slate-800 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10"})]})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm font-bold text-slate-700",children:"Account type"}),e.jsx("select",{value:n.account_type,onChange:t=>m("account_type",t.target.value),className:"mt-2 h-12 w-full rounded-xl border border-slate-200 px-4 text-sm font-semibold text-slate-800 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10",children:Pe.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm font-bold text-slate-700",children:"Checking or savings"}),e.jsx("select",{value:n.checking_or_savings,onChange:t=>m("checking_or_savings",t.target.value),className:"mt-2 h-12 w-full rounded-xl border border-slate-200 px-4 text-sm font-semibold text-slate-800 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10",children:Be.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm font-bold text-slate-700",children:"Routing number"}),e.jsx("input",{type:"text",value:n.routing_number,onChange:t=>m("routing_number",t.target.value),placeholder:"000000000",className:"mt-2 h-12 w-full rounded-xl border border-slate-200 px-4 text-sm font-semibold text-slate-800 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10"})]})]}),e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-sm font-bold text-slate-700",children:"Account number"}),e.jsx("input",{type:"text",value:n.account_number,onChange:t=>m("account_number",t.target.value),placeholder:"000000000000",className:"mt-2 h-12 w-full rounded-xl border border-slate-200 px-4 text-sm font-semibold text-slate-800 outline-none focus:border-primary focus:ring-4 focus:ring-primary/10"})]}),I&&e.jsx("p",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm font-semibold text-red-600",children:I}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-between",children:[e.jsx("button",{type:"button",onClick:R,className:"inline-flex items-center justify-center rounded-xl border border-slate-200 px-4 py-3 text-sm font-bold text-slate-600 transition hover:bg-slate-50",children:"Cancel"}),e.jsx("button",{type:"button",onClick:ye,disabled:ee,className:"inline-flex items-center justify-center gap-2 rounded-xl bg-primary px-4 py-3 text-sm font-bold text-white transition hover:bg-primary-dark disabled:cursor-not-allowed disabled:opacity-60",children:ee?"Linking...":"Link bank account"})]})]})]})})]})};export{Ve as default};
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.