{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkout-payment-failed",
  "type": "registry:component",
  "title": "Checkout Payment Failed",
  "description": "A declined payment screen that explains the reason and offers three ways forward: retry the same card, enter another card, or pay by bank transfer with copyable sample details. A support card sits alongside with the order reference.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "checkout",
    "checkout",
    "declined",
    "error state",
    "recovery",
    "bank transfer",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/checkout-payment-failed",
  "files": [
    {
      "path": "registry/hyperblur/checkout-payment-failed.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/checkout-payment-failed.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type PaymentRecoveryMethod = \"retry\" | \"card\" | \"transfer\";\n\nexport interface PaymentRecoveryValues {\n  method: PaymentRecoveryMethod;\n  amount: number;\n  cardLast4: string;\n}\n\nexport interface PaymentFailedBank {\n  bank: string;\n  accountName: string;\n  account: string;\n  routing: string;\n}\n\nexport interface CheckoutPaymentFailedProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  title?: string;\n  merchant?: string;\n  amount?: number;\n  currency?: string;\n  cardLabel?: string;\n  reason?: string;\n  reference?: string;\n  bank?: PaymentFailedBank;\n  supportEmail?: string;\n  replyTime?: string;\n  defaultMethod?: PaymentRecoveryMethod;\n  onRecover?: (values: PaymentRecoveryValues) => void;\n  onContact?: (channel: \"chat\" | \"email\") => void;\n  accent?: string;\n}\n\nconst defaultBank: PaymentFailedBank = {\n  bank: \"Harbor Point Bank\",\n  accountName: \"Northwind Supply LLC\",\n  account: \"0000 4471 2290\",\n  routing: \"000 111 222\",\n};\n\nconst onlyDigits = (v: string) => v.replace(/\\D/g, \"\");\n\nfunction luhn(v: string) {\n  const d = onlyDigits(v);\n  if (d.length < 13) return false;\n  let sum = 0;\n  let dbl = false;\n  for (let i = d.length - 1; i >= 0; i -= 1) {\n    let n = d.charCodeAt(i) - 48;\n    if (dbl) {\n      n *= 2;\n      if (n > 9) n -= 9;\n    }\n    sum += n;\n    dbl = !dbl;\n  }\n  return sum % 10 === 0;\n}\n\nconst css = `\n.hb-qg7 {\n  --hb-qg7-accent: #f43f5e;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  isolation: isolate;\n  overflow: hidden;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-qg7 *, .hb-qg7 *::before, .hb-qg7 *::after { box-sizing: border-box; }\n.hb-qg7::before { content: \"\"; position: absolute; left: 50%; top: -260px; width: 900px; height: 520px; margin-left: -450px; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-qg7-accent) 14%, transparent), transparent); }\n.hb-qg7-inner { max-width: 1120px; margin: 0 auto; padding: clamp(44px, 7cqw, 100px) clamp(16px, 4cqw, 32px); display: grid; gap: 20px; align-items: start; }\n@container (min-width: 860px) { .hb-qg7-inner { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; } }\n.hb-qg7-main { border: 1px solid rgba(255,255,255,.08); border-radius: 22px; background: linear-gradient(180deg, #121212, #0d0d0d); padding: clamp(20px, 3.4cqw, 34px); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }\n.hb-qg7-top { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }\n.hb-qg7-icon { position: relative; width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--hb-qg7-accent) 14%, #111); border: 1px solid color-mix(in srgb, var(--hb-qg7-accent) 40%, transparent); color: var(--hb-qg7-accent); animation: hb-qg7-shake .6s .2s cubic-bezier(.36,.07,.19,.97) both; }\n.hb-qg7-icon::after { content: \"\"; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid var(--hb-qg7-accent); animation: hb-qg7-ring 2.4s 1s ease-out infinite; opacity: 0; }\n@keyframes hb-qg7-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }\n@keyframes hb-qg7-ring { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(1.45); opacity: 0; } }\n.hb-qg7-icon svg { width: 24px; height: 24px; }\n.hb-qg7-title { margin: 0; font-size: clamp(24px, 3.6cqw, 34px); letter-spacing: -0.03em; font-weight: 600; line-height: 1.1; }\n.hb-qg7-lead { margin: 8px 0 0; color: #8f8f8f; font-size: 15px; line-height: 1.55; max-width: 560px; }\n.hb-qg7-lead b { color: #ededed; font-weight: 500; }\n.hb-qg7-facts { margin: 22px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; overflow: hidden; }\n.hb-qg7-fact { padding: 12px 14px; display: grid; gap: 3px; border-right: 1px solid rgba(255,255,255,.06); }\n.hb-qg7-fact:last-child { border-right: 0; }\n.hb-qg7-fact dt { font-size: 11px; color: #6b6b6b; text-transform: uppercase; letter-spacing: .06em; }\n.hb-qg7-fact dd { margin: 0; font-size: 13px; font-weight: 500; }\n.hb-qg7-fact dd[data-bad=\"true\"] { color: #fda4af; }\n.hb-qg7-h { margin: 28px 0 12px; font-size: 14px; font-weight: 600; color: #a1a1a1; }\n.hb-qg7-opts { display: grid; gap: 10px; }\n.hb-qg7-opt { border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: #0d0d0d; transition: border-color .2s, background .2s; }\n.hb-qg7-opt[data-on=\"true\"] { border-color: color-mix(in srgb, #ededed 40%, transparent); background: #131313; }\n.hb-qg7-radio { width: 100%; display: grid; grid-template-columns: 20px 36px 1fr auto; gap: 12px; align-items: center; text-align: left; background: none; border: 0; color: inherit; font: inherit; padding: 14px 16px; cursor: pointer; border-radius: 14px; }\n.hb-qg7-radio:focus-visible { outline: 2px solid var(--hb-qg7-accent); outline-offset: -2px; }\n.hb-qg7-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.25); display: grid; place-items: center; }\n.hb-qg7-dot::after { content: \"\"; width: 8px; height: 8px; border-radius: 50%; background: #ededed; transform: scale(0); transition: transform .2s cubic-bezier(.3,1.5,.5,1); }\n.hb-qg7-opt[data-on=\"true\"] .hb-qg7-dot { border-color: #ededed; }\n.hb-qg7-opt[data-on=\"true\"] .hb-qg7-dot::after { transform: scale(1); }\n.hb-qg7-oico { width: 36px; height: 36px; border-radius: 10px; background: #1a1a1a; border: 1px solid rgba(255,255,255,.08); display: grid; place-items: center; color: #d4d4d4; }\n.hb-qg7-oico svg { width: 16px; height: 16px; }\n.hb-qg7-radio b { display: block; font-size: 14px; font-weight: 600; }\n.hb-qg7-radio small { display: block; font-size: 12px; color: #8f8f8f; margin-top: 2px; }\n.hb-qg7-badge { font-size: 11px; color: #a1a1a1; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }\n.hb-qg7-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s cubic-bezier(.2,.8,.2,1); }\n.hb-qg7-opt[data-on=\"true\"] .hb-qg7-more { grid-template-rows: 1fr; }\n.hb-qg7-more > div { overflow: hidden; }\n.hb-qg7-pad { padding: 0 16px 16px 84px; }\n@container (max-width: 520px) { .hb-qg7-pad { padding-left: 16px; } .hb-qg7-badge { display: none; } .hb-qg7-radio { grid-template-columns: 20px 36px 1fr; } }\n.hb-qg7-row { display: grid; grid-template-columns: 1.6fr 1fr .8fr; gap: 8px; }\n.hb-qg7-input { width: 100%; height: 42px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: #0a0a0a; color: #ededed; font: inherit; font-size: 14px; padding: 0 12px; outline: none; transition: border-color .2s, box-shadow .2s; }\n.hb-qg7-input::placeholder { color: #555; }\n.hb-qg7-input:focus { border-color: #ededed; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }\n.hb-qg7-input[aria-invalid=\"true\"] { border-color: var(--hb-qg7-accent); }\n.hb-qg7-bank { display: grid; gap: 1px; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.06); }\n.hb-qg7-bank div { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: center; padding: 9px 12px; background: #0f0f0f; font-size: 13px; }\n.hb-qg7-bank span { color: #8f8f8f; font-size: 12px; }\n.hb-qg7-bank b { font-weight: 500; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hb-qg7-copy { background: none; border: 1px solid rgba(255,255,255,.1); color: #a1a1a1; border-radius: 6px; font: inherit; font-size: 11px; padding: 3px 8px; cursor: pointer; }\n.hb-qg7-copy:hover { color: #ededed; border-color: rgba(255,255,255,.25); }\n.hb-qg7-copy:focus-visible, .hb-qg7-cta:focus-visible, .hb-qg7-sbtn:focus-visible { outline: 2px solid var(--hb-qg7-accent); outline-offset: 2px; }\n.hb-qg7-note { margin: 8px 0 0; font-size: 12px; color: #6b6b6b; }\n.hb-qg7-err { margin: 8px 0 0; font-size: 12px; color: #fda4af; }\n.hb-qg7-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.06); }\n.hb-qg7-foot p { margin: 0; font-size: 12px; color: #6b6b6b; }\n.hb-qg7-cta { height: 48px; padding: 0 22px; border: 0; border-radius: 12px; background: #ededed; color: #0a0a0a; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; transition: filter .2s, transform .15s; }\n.hb-qg7-cta:hover { filter: brightness(.92); }\n.hb-qg7-cta:active { transform: translateY(1px); }\n.hb-qg7-cta[disabled] { cursor: progress; opacity: .8; }\n.hb-qg7-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0,0,0,.2); border-top-color: #0a0a0a; animation: hb-qg7-rot .8s linear infinite; }\n@keyframes hb-qg7-rot { to { transform: rotate(360deg); } }\n.hb-qg7-ok { display: flex; gap: 14px; align-items: center; margin-top: 22px; padding: 16px; border-radius: 14px; border: 1px solid rgba(52,211,153,.3); background: rgba(52,211,153,.08); animation: hb-qg7-in .4s ease; }\n@keyframes hb-qg7-in { from { opacity: 0; transform: translateY(6px); } }\n.hb-qg7-ok svg { width: 28px; height: 28px; color: #34d399; flex: none; }\n.hb-qg7-ok b { display: block; font-size: 14px; }\n.hb-qg7-ok span { font-size: 13px; color: #a1a1a1; }\n.hb-qg7-side { display: grid; gap: 14px; }\n.hb-qg7-card { border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: #111; padding: 20px; }\n.hb-qg7-avatars { display: flex; }\n.hb-qg7-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #0a0a0a; border: 2px solid #111; margin-left: -8px; }\n.hb-qg7-av:first-child { margin-left: 0; }\n.hb-qg7-online { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #a1a1a1; margin-left: 10px; align-self: center; }\n.hb-qg7-online::before { content: \"\"; width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.18); }\n.hb-qg7-card h3 { margin: 14px 0 4px; font-size: 16px; font-weight: 600; }\n.hb-qg7-card p { margin: 0; font-size: 13px; color: #8f8f8f; line-height: 1.55; }\n.hb-qg7-sbtns { display: grid; gap: 8px; margin-top: 16px; }\n.hb-qg7-sbtn { height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: #171717; color: #ededed; font: inherit; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; transition: background .2s; }\n.hb-qg7-sbtn:hover { background: #1f1f1f; }\n.hb-qg7-sbtn svg { width: 14px; height: 14px; }\n.hb-qg7-ref { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; color: #6b6b6b; }\n.hb-qg7-ref code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #d4d4d4; font-size: 12px; }\n.hb-qg7-why { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13px; color: #a1a1a1; }\n.hb-qg7-why li { display: flex; gap: 8px; }\n.hb-qg7-why li::before { content: \"\"; flex: none; width: 5px; height: 5px; border-radius: 50%; margin-top: 7px; background: var(--hb-qg7-accent); }\n@media (prefers-reduced-motion: reduce) {\n  .hb-qg7 *, .hb-qg7 *::before, .hb-qg7 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nconst options: { id: PaymentRecoveryMethod; title: string; hint: string; badge: string }[] = [\n  { id: \"retry\", title: \"Try the same card again\", hint: \"Approve the charge in your banking app first, then retry.\", badge: \"Fastest\" },\n  { id: \"card\", title: \"Use a different card\", hint: \"Debit or credit. Your order stays reserved.\", badge: \"Instant\" },\n  { id: \"transfer\", title: \"Pay by bank transfer\", hint: \"We ship as soon as the transfer lands.\", badge: \"1 to 2 days\" },\n];\n\nfunction OptionIcon({ id }: { id: PaymentRecoveryMethod }) {\n  if (id === \"retry\") return <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M13.5 8A5.5 5.5 0 113.9 4.3M3.5 1.5v3h3\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>;\n  if (id === \"card\") return <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><rect x=\"1.5\" y=\"3.5\" width=\"13\" height=\"9\" rx=\"2\" stroke=\"currentColor\" strokeWidth=\"1.5\" /><path d=\"M1.5 6.5h13M4 10h3\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" /></svg>;\n  return <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M2 6.5L8 2.5l6 4M3 7v5M6.3 7v5M9.7 7v5M13 7v5M2 13.5h12\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>;\n}\n\nexport function CheckoutPaymentFailed({\n  title = \"Your payment was declined\",\n  merchant = \"Northwind Supply\",\n  amount = 86.4,\n  currency = \"USD\",\n  cardLabel = \"Visa ending 0341\",\n  reason = \"Insufficient funds\",\n  reference = \"NW-20931\",\n  bank = defaultBank,\n  supportEmail = \"billing@northwind.example\",\n  replyTime = \"about 6 minutes\",\n  defaultMethod = \"retry\",\n  onRecover,\n  onContact,\n  accent = \"#f43f5e\",\n  className = \"\",\n  style,\n  ...rest\n}: CheckoutPaymentFailedProps) {\n  const uid = React.useId();\n  const money = React.useMemo(() => new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency }), [currency]);\n  const [method, setMethod] = React.useState<PaymentRecoveryMethod>(defaultMethod);\n  const [card, setCard] = React.useState(\"\");\n  const [expiry, setExpiry] = React.useState(\"\");\n  const [cvc, setCvc] = React.useState(\"\");\n  const [error, setError] = React.useState(\"\");\n  const [copied, setCopied] = React.useState(\"\");\n  const [status, setStatus] = React.useState<\"idle\" | \"processing\" | \"done\">(\"idle\");\n  const refs = React.useRef<(HTMLButtonElement | null)[]>([]);\n  const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n  React.useEffect(() => () => {\n    if (timer.current) clearTimeout(timer.current);\n  }, []);\n\n  const pick = (i: number) => {\n    const n = (i + options.length) % options.length;\n    setMethod(options[n].id);\n    setError(\"\");\n    refs.current[n]?.focus();\n  };\n\n  const onKey = (e: React.KeyboardEvent, i: number) => {\n    if (e.key === \"ArrowDown\" || e.key === \"ArrowRight\") {\n      e.preventDefault();\n      pick(i + 1);\n    } else if (e.key === \"ArrowUp\" || e.key === \"ArrowLeft\") {\n      e.preventDefault();\n      pick(i - 1);\n    }\n  };\n\n  const copy = (label: string, value: string) => {\n    navigator.clipboard?.writeText(value).then(\n      () => {\n        setCopied(label);\n        setTimeout(() => setCopied(\"\"), 1400);\n      },\n      () => undefined,\n    );\n  };\n\n  const go = () => {\n    if (status !== \"idle\") return;\n    if (method === \"card\") {\n      if (!luhn(card)) return setError(\"That card number does not look right.\");\n      if (!/^(0[1-9]|1[0-2]) \\/ \\d{2}$/.test(expiry)) return setError(\"Use MM / YY for the expiry date.\");\n      if (onlyDigits(cvc).length < 3) return setError(\"Enter the security code.\");\n    }\n    setError(\"\");\n    setStatus(\"processing\");\n    timer.current = setTimeout(() => {\n      setStatus(\"done\");\n      onRecover?.({ method, amount, cardLast4: method === \"card\" ? onlyDigits(card).slice(-4) : method === \"retry\" ? onlyDigits(cardLabel).slice(-4) : \"\" });\n    }, 1200);\n  };\n\n  const ctaLabel = method === \"retry\" ? `Retry ${money.format(amount)}` : method === \"card\" ? `Pay ${money.format(amount)}` : \"I have sent the transfer\";\n  const doneText =\n    method === \"transfer\"\n      ? { t: \"Thanks, we are watching for it\", s: `Your order ships as soon as ${money.format(amount)} arrives with reference ${reference}.` }\n      : { t: \"Payment went through\", s: `${money.format(amount)} paid to ${merchant}. Your order is back in the queue.` };\n  const vars = { \"--hb-qg7-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-qg7 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-checkout-payment-failed\" precedence=\"default\">{css}</style>\n      <div className=\"hb-qg7-inner\">\n        <div className=\"hb-qg7-main\">\n          <div className=\"hb-qg7-top\">\n            <span className=\"hb-qg7-icon\" aria-hidden=\"true\">\n              <svg viewBox=\"0 0 24 24\" fill=\"none\"><rect x=\"2.5\" y=\"5\" width=\"19\" height=\"14\" rx=\"3\" stroke=\"currentColor\" strokeWidth=\"1.7\" /><path d=\"M2.5 9.5h19\" stroke=\"currentColor\" strokeWidth=\"1.7\" /><path d=\"M15 13.5l4 4M19 13.5l-4 4\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" /></svg>\n            </span>\n            <div style={{ flex: 1, minWidth: 220 }}>\n              <h2 className=\"hb-qg7-title\">{title}</h2>\n              <p className=\"hb-qg7-lead\">Your bank turned down the <b>{money.format(amount)}</b> charge from {merchant}. Nothing was taken from your account and your items are held for 24 hours.</p>\n            </div>\n          </div>\n          <dl className=\"hb-qg7-facts\">\n            <div className=\"hb-qg7-fact\"><dt>Card</dt><dd>{cardLabel}</dd></div>\n            <div className=\"hb-qg7-fact\"><dt>Reason</dt><dd data-bad=\"true\">{reason}</dd></div>\n            <div className=\"hb-qg7-fact\"><dt>Order</dt><dd>{reference}</dd></div>\n          </dl>\n          {status === \"done\" ? (\n            <div className=\"hb-qg7-ok\" role=\"status\">\n              <svg viewBox=\"0 0 28 28\" fill=\"none\" aria-hidden=\"true\"><circle cx=\"14\" cy=\"14\" r=\"12.5\" stroke=\"currentColor\" strokeWidth=\"1.6\" /><path d=\"M8.5 14.4l3.6 3.6 7.4-7.6\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n              <div><b>{doneText.t}</b><span>{doneText.s}</span></div>\n            </div>\n          ) : (\n            <>\n              <h3 className=\"hb-qg7-h\" id={`${uid}-opts`}>Choose how to finish your order</h3>\n              <div className=\"hb-qg7-opts\" role=\"radiogroup\" aria-labelledby={`${uid}-opts`}>\n                {options.map((o, i) => {\n                  const on = o.id === method;\n                  return (\n                    <div key={o.id} className=\"hb-qg7-opt\" data-on={on ? \"true\" : \"false\"}>\n                      <button\n                        ref={(el) => { refs.current[i] = el; }}\n                        type=\"button\"\n                        role=\"radio\"\n                        aria-checked={on}\n                        tabIndex={on ? 0 : -1}\n                        className=\"hb-qg7-radio\"\n                        onClick={() => pick(i)}\n                        onKeyDown={(e) => onKey(e, i)}\n                      >\n                        <span className=\"hb-qg7-dot\" aria-hidden=\"true\" />\n                        <span className=\"hb-qg7-oico\"><OptionIcon id={o.id} /></span>\n                        <span><b>{o.title}</b><small>{o.hint}</small></span>\n                        <span className=\"hb-qg7-badge\">{o.badge}</span>\n                      </button>\n                      {o.id !== \"retry\" ? (\n                        <div className=\"hb-qg7-more\" aria-hidden={on ? undefined : true}>\n                          <div>\n                            <div className=\"hb-qg7-pad\">\n                              {o.id === \"card\" ? (\n                                <>\n                                  <div className=\"hb-qg7-row\">\n                                    <input className=\"hb-qg7-input\" aria-label=\"Card number\" inputMode=\"numeric\" autoComplete=\"cc-number\" placeholder=\"5555 5555 5555 4444\" tabIndex={on ? 0 : -1} value={card} aria-invalid={error && method === \"card\" ? \"true\" : undefined} onChange={(e) => setCard(onlyDigits(e.target.value).slice(0, 19).replace(/(\\d{4})(?=\\d)/g, \"$1 \"))} />\n                                    <input className=\"hb-qg7-input\" aria-label=\"Expiry date\" inputMode=\"numeric\" autoComplete=\"cc-exp\" placeholder=\"MM / YY\" tabIndex={on ? 0 : -1} value={expiry} onChange={(e) => { const d = onlyDigits(e.target.value).slice(0, 4); setExpiry(d.length > 2 ? `${d.slice(0, 2)} / ${d.slice(2)}` : d); }} />\n                                    <input className=\"hb-qg7-input\" aria-label=\"Security code\" inputMode=\"numeric\" autoComplete=\"cc-csc\" placeholder=\"CVC\" tabIndex={on ? 0 : -1} value={cvc} onChange={(e) => setCvc(onlyDigits(e.target.value).slice(0, 4))} />\n                                  </div>\n                                  {error ? <p className=\"hb-qg7-err\" role=\"alert\">{error}</p> : <p className=\"hb-qg7-note\">Test mode. Card details never leave this page.</p>}\n                                </>\n                              ) : (\n                                <>\n                                  <div className=\"hb-qg7-bank\">\n                                    {[\n                                      [\"Bank\", bank.bank],\n                                      [\"Account name\", bank.accountName],\n                                      [\"Account\", bank.account],\n                                      [\"Routing\", bank.routing],\n                                      [\"Reference\", reference],\n                                    ].map(([k, v]) => (\n                                      <div key={k}>\n                                        <span>{k}</span>\n                                        <b>{v}</b>\n                                        <button type=\"button\" className=\"hb-qg7-copy\" tabIndex={on ? 0 : -1} onClick={() => copy(k, v)} aria-label={`Copy ${k}`}>{copied === k ? \"Copied\" : \"Copy\"}</button>\n                                      </div>\n                                    ))}\n                                  </div>\n                                  <p className=\"hb-qg7-note\">Sample details for a demo account. Always include the reference.</p>\n                                </>\n                              )}\n                            </div>\n                          </div>\n                        </div>\n                      ) : null}\n                    </div>\n                  );\n                })}\n              </div>\n              <div className=\"hb-qg7-foot\">\n                <p>Items held until tomorrow, 10:42.</p>\n                <button type=\"button\" className=\"hb-qg7-cta\" onClick={go} disabled={status === \"processing\"}>\n                  {status === \"processing\" ? <><span className=\"hb-qg7-spin\" aria-hidden=\"true\" />Working on it</> : ctaLabel}\n                </button>\n              </div>\n            </>\n          )}\n        </div>\n        <aside className=\"hb-qg7-side\">\n          <div className=\"hb-qg7-card\">\n            <div className=\"hb-qg7-avatars\" aria-hidden=\"true\">\n              <span className=\"hb-qg7-av\" style={{ background: \"#fda4af\" }}>RK</span>\n              <span className=\"hb-qg7-av\" style={{ background: \"#93c5fd\" }}>TO</span>\n              <span className=\"hb-qg7-av\" style={{ background: \"#fcd34d\" }}>LM</span>\n              <span className=\"hb-qg7-online\">Online</span>\n            </div>\n            <h3>Need a hand?</h3>\n            <p>The billing team replies in {replyTime}. Share your order reference and we will sort it out.</p>\n            <div className=\"hb-qg7-sbtns\">\n              <button type=\"button\" className=\"hb-qg7-sbtn\" onClick={() => onContact?.(\"chat\")}>\n                <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M2.5 7.5a5.5 5 0 1111 0 5.5 5 0 01-7.6 4.6L2.5 13l.9-2.7a4.8 4.8 0 01-.9-2.8z\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinejoin=\"round\" /></svg>\n                Chat with billing\n              </button>\n              <a className=\"hb-qg7-sbtn\" href={`mailto:${supportEmail}?subject=${encodeURIComponent(`Declined payment ${reference}`)}`} onClick={() => onContact?.(\"email\")}>\n                <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><rect x=\"1.5\" y=\"3\" width=\"13\" height=\"10\" rx=\"2\" stroke=\"currentColor\" strokeWidth=\"1.4\" /><path d=\"M2 4l6 5 6-5\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinejoin=\"round\" /></svg>\n                Email {supportEmail.split(\"@\")[0]}\n              </a>\n            </div>\n            <div className=\"hb-qg7-ref\">\n              <span>Reference <code>{reference}</code></span>\n              <button type=\"button\" className=\"hb-qg7-copy\" onClick={() => copy(\"ref\", reference)}>{copied === \"ref\" ? \"Copied\" : \"Copy\"}</button>\n            </div>\n          </div>\n          <div className=\"hb-qg7-card\">\n            <h3 style={{ marginTop: 0 }}>Why cards get declined</h3>\n            <ul className=\"hb-qg7-why\">\n              <li>Not enough available balance or credit</li>\n              <li>The bank flagged an unusual purchase</li>\n              <li>Expired card or a typo in the details</li>\n            </ul>\n          </div>\n        </aside>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}