{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "wallet",
  "title": "Wallet",
  "author": "AlgorizeTech",
  "description": "An interactive fintech cardholder wallet component featuring 3 serially staggered cards, curved pocket scoop, bottom thumb cutout, and light/dark mode styling.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "src/components/custom/blocks/WalletBlock.tsx",
      "content": "\"use client\";\n\nimport React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport { Eye, EyeOff, Nfc } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { springLinear } from \"./motion-curves\";\nimport { DEFAULT_WALLET_CARDS, type WalletCardItem } from \"./wallet-data\";\n\n// The cards move on a spring (stiffness 280, damping 22, mass 0.8) drawn as a\n// CSS `linear()` curve; the flip and the balance swap are plain eases.\nconst CARD_SPRING = springLinear({ stiffness: 280, damping: 22, mass: 0.8 });\nconst FLIP_TRANSITION = \"transform 0.55s cubic-bezier(0.23, 1, 0.32, 1)\";\nconst EASE_OUT = \"cubic-bezier(0, 0, 0.58, 1)\";\nconst BALANCE_TRANSITION = `opacity 0.2s ${EASE_OUT}, transform 0.2s ${EASE_OUT}, filter 0.2s ${EASE_OUT}`;\n\ntype BalancePhase = \"from\" | \"shown\" | \"leaving\";\n\n/**\n * The balance swaps one way at a time: the showing one fades out upwards,\n * then the other comes in from below. The first one comes in on mount.\n * Changing back while one is leaving brings it back from where it is.\n */\nfunction useBalanceSwap(masked: boolean) {\n  const [shownMasked, setShownMasked] = useState(masked);\n  // Whether the shown one is still at its starting look, about to come in.\n  const [entering, setEntering] = useState(true);\n  // The shown one leaves whenever it is not the wanted one; changing back\n  // while it leaves brings it back from where it is.\n  const leaving = masked !== shownMasked;\n  const phase: BalancePhase = leaving ? \"leaving\" : entering ? \"from\" : \"shown\";\n\n  // Coming in: each balance mounts afresh (its own key) at the starting\n  // look; once a frame has painted that look, transition to the resting one.\n  // Two animation frames rather than reading `offsetWidth`: that read forces a\n  // synchronous layout of the whole page at the moment the balance mounts,\n  // which is expensive when the wallet is hydrated inside a large document.\n  const frame = useRef(0);\n  const enter = useCallback((node: HTMLDivElement | null) => {\n    if (!node) return;\n    const token = ++frame.current;\n    requestAnimationFrame(() =>\n      requestAnimationFrame(() => {\n        if (frame.current === token) setEntering(false);\n      }),\n    );\n  }, []);\n  useEffect(() => {\n    return () => {\n      // Invalidates any frame still pending when the wallet unmounts.\n      frame.current = -1;\n    };\n  }, []);\n\n  const settle = () => {\n    if (!leaving) return;\n    setShownMasked(masked);\n    setEntering(true);\n  };\n\n  // In case the transition never ends (a hidden tab, `display: none`).\n  useEffect(() => {\n    if (!leaving) return;\n    const t = window.setTimeout(() => {\n      setShownMasked(masked);\n      setEntering(true);\n    }, 250);\n    return () => window.clearTimeout(t);\n  }, [leaving, masked]);\n\n  const y = phase === \"from\" ? 4 : phase === \"leaving\" ? -4 : 0;\n  const style: React.CSSProperties = {\n    opacity: phase === \"shown\" ? 1 : 0,\n    transform: y ? `translateY(${y}px)` : \"none\",\n    // Only the revealed balance blurs.\n    filter: shownMasked ? undefined : `blur(${phase === \"shown\" ? 0 : 4}px)`,\n    transition: phase === \"from\" ? \"none\" : BALANCE_TRANSITION,\n  };\n  const onTransitionEnd = (e: React.TransitionEvent<HTMLDivElement>) => {\n    if (e.target === e.currentTarget && e.propertyName === \"opacity\") settle();\n  };\n  // `enter` is the balance element's callback ref.\n  return { shownMasked, enter, style, onTransitionEnd };\n}\n\n// ==========================================\n// TYPES & DATA STRUCTURES\n// ==========================================\nexport type { WalletCardItem };\n\nexport interface WalletProps extends React.HTMLAttributes<HTMLDivElement> {\n  cards?: WalletCardItem[];\n  overallBalance?: string;\n  overallLabel?: string;\n  revealText?: string;\n  concealText?: string;\n  maskedBalance?: string;\n  allowReveal?: boolean;\n  defaultRevealed?: boolean;\n  autoRevealOnHover?: boolean;\n  walletColor?: string;\n  /** Prompt shown above the closed wallet on pointer devices. Pass \"\" to hide. */\n  hint?: string;\n  /** The same prompt on touch screens, where the wallet opens on tap. */\n  touchHint?: string;\n  /** Prompt shown once the cards are out, on pointer devices. Pass \"\" to hide. */\n  openHint?: string;\n  /** The open prompt on touch screens. */\n  touchOpenHint?: string;\n}\n\n// ==========================================\n// SUBCOMPONENT: METALLIC EMV CHIP\n// ==========================================\nfunction EmvChip({ className }: { className?: string }) {\n  return (\n    <div\n      className={cn(\n        \"relative w-9 h-7 rounded-md bg-gradient-to-br from-amber-200 via-amber-400 to-amber-500 p-0.5 shadow-sm border border-amber-600/40 overflow-hidden\",\n        className\n      )}\n    >\n      <div className=\"w-full h-full border border-amber-700/30 rounded-[3px] flex items-center justify-center relative bg-gradient-to-b from-amber-300/40 to-transparent\">\n        <div className=\"absolute inset-x-0 h-[1px] bg-amber-700/40 top-1/2 -translate-y-1/2\" />\n        <div className=\"absolute inset-y-0 w-[1px] bg-amber-700/40 left-1/3\" />\n        <div className=\"absolute inset-y-0 w-[1px] bg-amber-700/40 right-1/3\" />\n        <div className=\"w-2.5 h-2.5 rounded-full border border-amber-700/40 bg-amber-200/50\" />\n      </div>\n    </div>\n  );\n}\n\n// ==========================================\n// MAIN COMPONENT: WALLET\n// ==========================================\nexport function Wallet({\n  cards = DEFAULT_WALLET_CARDS,\n  overallBalance = \"$89,000.00\",\n  overallLabel = \"Overall Balance\",\n  revealText = \"Reveal balance\",\n  concealText = \"Conceal balance\",\n  maskedBalance = \"✱✱✱✱✱✱✱✱\",\n  allowReveal = true,\n  defaultRevealed = false,\n  autoRevealOnHover = false,\n  walletColor,\n  hint = \"Hover to view cards\",\n  touchHint = \"Tap to view cards\",\n  openHint = \"Click a card to view details\",\n  touchOpenHint = \"Tap a card to view details\",\n  className,\n  ...props\n}: WalletProps) {\n  const activeCards = cards.length > 0 ? cards : DEFAULT_WALLET_CARDS;\n  const baseColor =\n    !walletColor || walletColor === \"primary\" || walletColor === \"default\"\n      ? \"var(--primary, #6366f1)\"\n      : walletColor;\n  // The wallet wears a soft tint of the colour rather than the colour itself\n  // (the same OKLCH recipe as Folder), with a deep ink of the same hue on it.\n  const flapColor = `oklch(from ${baseColor} 0.88 calc(c * 0.4) h)`;\n  const plateColor = `oklch(from ${baseColor} 0.8 calc(c * 0.5) h)`;\n  const ink = `oklch(from ${baseColor} 0.32 calc(c * 0.6) h)`;\n  const inkAlpha = (a: number) => `oklch(from ${baseColor} 0.32 calc(c * 0.6) h / ${a})`;\n  const [isHovered, setIsHovered] = useState(false);\n  const [isRevealed, setIsRevealed] = useState(defaultRevealed);\n  const [elevatedCardIdx, setElevatedCardIdx] = useState<number | null>(null);\n  const [isFlipped, setIsFlipped] = useState(false);\n\n  const shouldShowBalance = isRevealed || (autoRevealOnHover && isHovered);\n  const {\n    shownMasked: balanceMasked,\n    enter: enterBalance,\n    style: balanceStyle,\n    onTransitionEnd: onBalanceTransitionEnd,\n  } = useBalanceSwap(!shouldShowBalance);\n\n  // Stagger offsets for the 3 cards when hovered:\n  // Card 0 (back, Amber) -> y: -130px\n  // Card 1 (middle, Fuchsia) -> y: -75px\n  // Card 2 (front, Blue) -> y: -20px\n  const cardStaggers = [\n    { y: -130, scale: 0.96, delay: 0.12, rotate: -1 },\n    { y: -75, scale: 0.98, delay: 0.06, rotate: 0.8 },\n    { y: -20, scale: 1.0, delay: 0.0, rotate: 0 },\n  ];\n\n  // At rest each card peeks the same strip above the one in front of it, so\n  // the closed wallet reads as a stack. The scale shrinks a card from its\n  // bottom edge, so the back cards rise a little further to keep the strips\n  // even (16px each).\n  const restY = [-54, -34, -14];\n\n  const handleCardClick = (idx: number, e: React.MouseEvent) => {\n    e.stopPropagation();\n    if (elevatedCardIdx === idx) {\n      // Card is already elevated: toggle flip front/back!\n      setIsFlipped((prev) => !prev);\n    } else {\n      // Elevate this card and reset flip to front face\n      setElevatedCardIdx(idx);\n      setIsFlipped(false);\n    }\n  };\n\n  return (\n    <div\n      className={cn(\n        \"relative flex flex-col items-center justify-center p-4 sm:p-12 w-full select-none\",\n        className\n      )}\n      {...props}\n    >\n      {/* Outer interactive wallet frame */}\n      <div\n        className=\"relative w-full max-w-[380px] h-[470px] flex items-end justify-center cursor-pointer group\"\n        onMouseEnter={() => setIsHovered(true)}\n        onMouseLeave={() => {\n          setIsHovered(false);\n          setElevatedCardIdx(null);\n          setIsFlipped(false);\n        }}\n        onClick={() => {\n          // If clicked outside cards while elevated, un-elevate\n          if (elevatedCardIdx !== null) {\n            setElevatedCardIdx(null);\n            setIsFlipped(false);\n          } else {\n            setIsHovered((prev) => !prev);\n          }\n        }}\n      >\n        {/* Prompts in the space the cards rise into: one while closed, one\n            while the cards are out, and none once a card is lifted over it. */}\n        {[\n          { key: \"closed\", shown: !isHovered && elevatedCardIdx === null, text: hint, touch: touchHint },\n          { key: \"open\", shown: isHovered && elevatedCardIdx === null, text: openHint, touch: touchOpenHint },\n        ].map(({ key, shown, text, touch }) =>\n          text || touch ? (\n            <p\n              key={key}\n              aria-hidden=\"true\"\n              className=\"absolute inset-x-0 top-[17%] text-center text-[13px] font-medium text-muted-foreground pointer-events-none transition-[opacity,translate] duration-300\"\n              style={{ opacity: shown ? 1 : 0, translate: shown ? \"0 0\" : \"0 -6px\" }}\n            >\n              <span className=\"[@media(hover:none)]:hidden\">{text}</span>\n              <span className=\"hidden [@media(hover:none)]:inline\">{touch}</span>\n            </p>\n          ) : null\n        )}\n\n        {/* ========================================================= */}\n        {/* LAYER 1: BACK PLATE (Nicher Pit - Rear Sleeve)            */}\n        {/* Height is 242px with matching 28px rounded corners        */}\n        {/* ========================================================= */}\n        <svg\n          viewBox=\"0 0 380 242\"\n          className=\"absolute bottom-0 inset-x-0 w-full h-[242px] pointer-events-none drop-shadow-sm\"\n          preserveAspectRatio=\"none\"\n        >\n          <path\n            d=\"\n              M 28 0\n              H 352\n              A 28 28 0 0 1 380 28\n              V 214\n              A 28 28 0 0 1 352 242\n              H 28\n              A 28 28 0 0 1 0 214\n              V 28\n              A 28 28 0 0 1 28 0\n              Z\n            \"\n            className=\"transition-colors duration-300\"\n            style={{\n              fill: plateColor,\n              stroke: \"rgba(255, 255, 255, 0.2)\",\n            }}\n            strokeWidth=\"1.5\"\n          />\n        </svg>\n\n        {/* ========================================================= */}\n        {/* LAYER 2: THE 3 CARDS                                      */}\n        {/* Supports serial hover, elevation on click, and 3D flip    */}\n        {/* ========================================================= */}\n        {activeCards.slice(0, 3).map((card, idx) => {\n          const stagger = cardStaggers[idx] || cardStaggers[0];\n          const isElevated = elevatedCardIdx === idx;\n          const isCardFlippedNow = isElevated && isFlipped;\n\n          // Target Y:\n          // If elevated: rises high up (-230px)\n          // Else if hovered: normal stagger position\n          // Else: tucked inside wallet, peeking as a stack\n          let targetY = restY[idx] ?? 0;\n          if (isElevated) {\n            targetY = -230;\n          } else if (isHovered) {\n            targetY = stagger.y;\n          }\n\n          // Target scale & rotation\n          const targetScale = isElevated ? 1.03 : isHovered ? stagger.scale : 1 - (2 - idx) * 0.02;\n          const targetRotate = isElevated ? 0 : isHovered ? stagger.rotate : 0;\n\n          // Z-index: elevated card has top priority (50), higher than front flap (40)\n          const zIndex = isElevated ? 50 : 10 + idx * 10;\n          const delay = isElevated ? 0 : isHovered ? stagger.delay : (2 - idx) * 0.04;\n\n          return (\n            <div\n              key={card.id || `card-${idx}`}\n              className=\"absolute bottom-[35px] left-[5%] w-[90%] h-[195px] cursor-pointer\"\n              style={{\n                zIndex,\n                perspective: 1200,\n                transformOrigin: \"bottom center\",\n                translate: `0 ${targetY}px`,\n                scale: targetScale,\n                rotate: `${targetRotate}deg`,\n                transition: [\"translate\", \"scale\", \"rotate\"]\n                  .map((property) => `${property} ${CARD_SPRING.duration}ms ${CARD_SPRING.easing} ${delay}s`)\n                  .join(\", \"),\n              }}\n              onClick={(e) => handleCardClick(idx, e)}\n            >\n              {/* 3D Rotator for Card Flip */}\n              <div\n                className=\"w-full h-full relative\"\n                style={{\n                  transformStyle: \"preserve-3d\",\n                  transform: `rotateY(${isCardFlippedNow ? 180 : 0}deg)`,\n                  transition: FLIP_TRANSITION,\n                }}\n              >\n                {/* =================================================== */}\n                {/* FRONT FACE (Ager Pit)                               */}\n                {/* =================================================== */}\n                <div\n                  style={{\n                    backfaceVisibility: \"hidden\",\n                    WebkitBackfaceVisibility: \"hidden\",\n                  }}\n                  className={cn(\n                    \"absolute inset-0 p-4 flex flex-col justify-between border rounded-[22px] overflow-hidden shadow-lg transition-colors duration-200\",\n                    `bg-gradient-to-r ${card.gradientLight || \"from-amber-400 to-amber-500\"}`,\n                    `dark:bg-gradient-to-r ${card.gradientDark || \"from-amber-400 to-amber-600\"}`,\n                    \"border-black/5 dark:border-white/10\"\n                  )}\n                >\n                  {/* Surface specular highlight */}\n                  <div className=\"absolute inset-0 rounded-[22px] bg-gradient-to-b from-white/20 via-transparent to-black/10 pointer-events-none\" />\n\n                  {/* Header: Name & Balance */}\n                  <div className=\"flex items-center justify-between relative z-10\">\n                    <div className=\"flex items-center gap-2\">\n                      <span\n                        className={cn(\n                          \"font-bold text-sm sm:text-base tracking-tight\",\n                          card.textColorLight || \"text-zinc-950\",\n                          `dark:${card.textColorDark || \"text-white\"}`\n                        )}\n                      >\n                        {card.name}\n                      </span>\n                      {card.tag && (\n                        <span\n                          className={cn(\n                            \"text-[10px] font-mono uppercase tracking-wider px-1.5 py-0.5 rounded border\",\n                            \"bg-black/5 dark:bg-white/10 border-black/10 dark:border-white/20\",\n                            card.subtextColorLight || \"text-zinc-800\",\n                            `dark:${card.subtextColorDark || \"text-zinc-200\"}`\n                          )}\n                        >\n                          {card.tag}\n                        </span>\n                      )}\n                    </div>\n\n                    <span\n                      className={cn(\n                        \"font-mono font-semibold text-sm sm:text-base tracking-tight\",\n                        card.textColorLight || \"text-zinc-950\",\n                        `dark:${card.textColorDark || \"text-white\"}`\n                      )}\n                    >\n                      {card.balance}\n                    </span>\n                  </div>\n\n                  {/* Middle: EMV Chip & NFC */}\n                  <div className=\"flex items-center justify-between relative z-10 mt-auto mb-2\">\n                    {card.hasChip ? (\n                      <EmvChip />\n                    ) : (\n                      <div className=\"w-9 h-7 rounded-md border border-black/10 dark:border-white/20 flex items-center justify-center bg-black/5 dark:bg-white/5\">\n                        <Nfc\n                          className={cn(\n                            \"w-4 h-4 opacity-70\",\n                            card.textColorLight || \"text-zinc-900\",\n                            `dark:${card.textColorDark || \"text-white\"}`\n                          )}\n                        />\n                      </div>\n                    )}\n\n                    <Nfc\n                      className={cn(\n                        \"w-5 h-5 opacity-60\",\n                        card.textColorLight || \"text-zinc-900\",\n                        `dark:${card.textColorDark || \"text-white\"}`\n                      )}\n                    />\n                  </div>\n\n                  {/* Footer: Card Number, Expiry, Issuer */}\n                  <div className=\"flex items-center justify-between text-xs font-mono relative z-10\">\n                    <span\n                      className={cn(\n                        \"opacity-90 font-medium tracking-wider\",\n                        card.textColorLight || \"text-zinc-900\",\n                        `dark:${card.textColorDark || \"text-white\"}`\n                      )}\n                    >\n                      {card.cardNumber || \"•••• 4829\"}\n                    </span>\n                    <div className=\"flex items-center gap-3\">\n                      <span\n                        className={cn(\n                          \"opacity-80 font-medium\",\n                          card.subtextColorLight || \"text-zinc-800\",\n                          `dark:${card.subtextColorDark || \"text-zinc-200\"}`\n                        )}\n                      >\n                        {card.expiry || \"12/29\"}\n                      </span>\n                      <span\n                        className={cn(\n                          \"font-sans font-bold text-[10px] tracking-wider uppercase opacity-85\",\n                          card.textColorLight || \"text-zinc-900\",\n                          `dark:${card.textColorDark || \"text-white\"}`\n                        )}\n                      >\n                        {card.issuer || \"PINSTACK\"}\n                      </span>\n                    </div>\n                  </div>\n                </div>\n\n                {/* =================================================== */}\n                {/* BACK FACE (Ulta Pit - Magnetic Stripe & CVV)        */}\n                {/* =================================================== */}\n                <div\n                  style={{\n                    backfaceVisibility: \"hidden\",\n                    WebkitBackfaceVisibility: \"hidden\",\n                    transform: \"rotateY(180deg)\",\n                  }}\n                  className={cn(\n                    \"absolute inset-0 flex flex-col justify-between border rounded-[22px] overflow-hidden shadow-lg transition-colors duration-200\",\n                    `bg-gradient-to-r ${card.gradientLight || \"from-amber-400 to-amber-500\"}`,\n                    `dark:bg-gradient-to-r ${card.gradientDark || \"from-amber-400 to-amber-600\"}`,\n                    \"border-black/5 dark:border-white/10\"\n                  )}\n                >\n                  {/* Top: Black Magnetic Stripe */}\n                  <div className=\"w-full h-8 bg-zinc-950 mt-3 shadow-inner relative\">\n                    <div className=\"absolute inset-0 bg-gradient-to-r from-transparent via-white/5 to-transparent\" />\n                  </div>\n\n                  {/* Middle: Signature Box with CVV + Shiny Hologram Badge */}\n                  <div className=\"px-4 flex items-center justify-between gap-3 my-auto\">\n                    {/* Signature Box */}\n                    <div className=\"h-8 bg-white/95 rounded-sm flex items-center justify-between px-3 flex-1 border border-black/10 shadow-inner\">\n                      <span className=\"text-[8px] sm:text-[9px] font-sans font-semibold tracking-wider text-zinc-400 uppercase select-none\">\n                        {card.backSignatureLabel || \"AUTHORIZED SIGNATURE\"}\n                      </span>\n                      <span className=\"text-xs font-mono font-bold italic text-zinc-900 tracking-wider\">\n                        {card.cvv || \"832\"}\n                      </span>\n                    </div>\n\n                    {/* Shiny Hologram Emblem */}\n                    <div className=\"w-8 h-8 rounded-lg bg-gradient-to-tr from-amber-400 via-rose-500 to-indigo-500 p-0.5 shadow-sm border border-white/30 flex items-center justify-center shrink-0\">\n                      <div className=\"w-4 h-4 rounded-full border border-white/60 bg-white/15 flex items-center justify-center\">\n                        <div className=\"w-1.5 h-1.5 rounded-full bg-white/80\" />\n                      </div>\n                    </div>\n                  </div>\n\n                  {/* Footer: Legal Disclaimer & Currency Name */}\n                  <div className=\"px-4 pb-3 flex items-end justify-between text-white\">\n                    <div className=\"flex flex-col text-left\">\n                      <span className=\"font-bold text-[8.5px] uppercase tracking-wider opacity-90 leading-tight\">\n                        {card.backSubtitle || \"GLOBAL SECURE ASSET CARD\"}\n                      </span>\n                      <span className=\"text-[7.5px] font-medium tracking-wide opacity-70 leading-tight\">\n                        {card.backNotice || `NOT VALID UNLESS SIGNED • ISSUED BY ${card.issuer || \"PINSTACK\"}`}\n                      </span>\n                    </div>\n\n                    <span className=\"font-extrabold text-xs tracking-wider uppercase opacity-95\">\n                      {card.name.toUpperCase()}\n                    </span>\n                  </div>\n                </div>\n              </div>\n            </div>\n          );\n        })}\n\n        {/* ========================================================= */}\n        {/* LAYER 3: FRONT POCKET FLAP (Uporer Pit)                   */}\n        {/* Full solid theme color: changes when theme switches       */}\n        {/* ========================================================= */}\n        <div\n          className=\"absolute bottom-0 w-full h-[225px] rounded-b-[28px] pointer-events-none\"\n          style={{ zIndex: 40 }}\n        >\n          {/* SVG Shape: Center scoop at top, fully closed at bottom */}\n          <svg\n            viewBox=\"0 0 380 225\"\n            className=\"absolute inset-0 w-full h-full pointer-events-none\"\n            preserveAspectRatio=\"none\"\n          >\n            <path\n              d=\"\n                M 28 0\n                H 115\n                C 135 0, 150 28, 190 28\n                C 230 28, 245 0, 265 0\n                H 352\n                A 28 28 0 0 1 380 28\n                V 197\n                A 28 28 0 0 1 352 225\n                H 28\n                A 28 28 0 0 1 0 197\n                V 28\n                A 28 28 0 0 1 28 0\n                Z\n              \"\n              className=\"transition-colors duration-300\"\n              style={{\n                fill: flapColor,\n                stroke: \"rgba(255, 255, 255, 0.55)\",\n              }}\n              strokeWidth=\"1.5\"\n            />\n          </svg>\n\n          {/* Front Face Content: Balance, Reveal Button, Subtitle, Bottom Accent */}\n          <div className=\"absolute inset-0 flex flex-col items-center justify-between py-5 px-6 pointer-events-auto\">\n            {/* Top: Reveal / Conceal Balance Toggle */}\n            <div className=\"mt-4 flex items-center justify-center\">\n              {allowReveal && (\n                <button\n                  type=\"button\"\n                  onClick={(e) => {\n                    e.stopPropagation();\n                    setIsRevealed((prev) => !prev);\n                  }}\n                  className=\"flex items-center gap-1.5 text-xs font-medium px-3 py-1 rounded-full transition-all duration-200 cursor-pointer border bg-white/40 hover:bg-white/60 backdrop-blur-sm\"\n                  style={{ color: ink, borderColor: inkAlpha(0.15) }}\n                >\n                  <span>{shouldShowBalance ? concealText : revealText}</span>\n                  {shouldShowBalance ? (\n                    <EyeOff className=\"w-3.5 h-3.5\" />\n                  ) : (\n                    <Eye className=\"w-3.5 h-3.5\" />\n                  )}\n                </button>\n              )}\n            </div>\n\n            {/* Middle: Masked vs Unmasked Balance */}\n            <div className=\"flex flex-col items-center justify-center my-auto\" style={{ color: ink }}>\n              {!balanceMasked ? (\n                <div\n                  key=\"unmasked\"\n                  ref={enterBalance}\n                  style={balanceStyle}\n                  onTransitionEnd={onBalanceTransitionEnd}\n                  className=\"text-2xl sm:text-3xl font-extrabold tracking-tight font-sans transition-colors\"\n                >\n                  {overallBalance}\n                </div>\n              ) : (\n                <div\n                  key=\"masked\"\n                  ref={enterBalance}\n                  style={balanceStyle}\n                  onTransitionEnd={onBalanceTransitionEnd}\n                  className=\"text-xl sm:text-2xl font-mono font-bold tracking-[0.35em] transition-colors\"\n                >\n                  {maskedBalance}\n                </div>\n              )}\n\n              {/* Subtitle */}\n              <span className=\"text-[11px] sm:text-xs font-semibold tracking-wider mt-1 uppercase transition-colors\"\n                style={{ color: inkAlpha(0.7) }}>\n                {overallLabel}\n              </span>\n            </div>\n\n            {/* Bottom: Solid decorative thumb notch accent on full color face */}\n            <div\n              className=\"w-11 h-4 rounded-t-full transition-colors border-t border-x\"\n              style={{ background: inkAlpha(0.14), borderColor: inkAlpha(0.1) }}\n            />\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n\nexport default Wallet;\n",
      "type": "registry:component",
      "target": "components/custom/blocks/WalletBlock.tsx"
    },
    {
      "path": "src/components/custom/blocks/motion-curves.ts",
      "content": "/**\n * Motion curves with no animation library behind them.\n *\n * The components here ship as CSS, GSAP or Motion builds that must move\n * identically, so the curves are computed once, from the same numbers, and\n * handed to whichever engine runs them:\n *\n *   - `cubicBezier(x1, y1, x2, y2)` → an easing function (GSAP accepts any\n *     `(progress) => value` as `ease`), exact for Motion's `ease: [..]` arrays\n *     and for CSS `cubic-bezier()`.\n *   - `spring({ stiffness, damping, mass })` → the analytic solution Motion\n *     Motion uses, as an easing function plus the time it takes to settle, or\n *     as a CSS `linear()` string for a fixed start and end.\n *   - `createSpringFollower` → a value that chases a moving target through the\n *     same spring every frame, like Motion's `useSpring`, for pointer-driven\n *     motion that no fixed curve can describe.\n */\n\n// ---------------------------------------------------------------------------\n// Cubic bezier\n// ---------------------------------------------------------------------------\n\n/**\n * The CSS / Motion cubic-bezier as a function of progress. Newton-Raphson\n * with a bisection fallback, the same solver browsers use.\n */\nexport function cubicBezier(x1: number, y1: number, x2: number, y2: number) {\n  if (x1 === y1 && x2 === y2) return (t: number) => t;\n\n  const a = (p1: number, p2: number) => 1 - 3 * p2 + 3 * p1;\n  const b = (p1: number, p2: number) => 3 * p2 - 6 * p1;\n  const c = (p1: number) => 3 * p1;\n  const at = (t: number, p1: number, p2: number) =>\n    ((a(p1, p2) * t + b(p1, p2)) * t + c(p1)) * t;\n  const slope = (t: number, p1: number, p2: number) =>\n    3 * a(p1, p2) * t * t + 2 * b(p1, p2) * t + c(p1);\n\n  const solveX = (x: number) => {\n    let t = x;\n    for (let i = 0; i < 8; i++) {\n      const s = slope(t, x1, x2);\n      if (Math.abs(s) < 1e-6) break;\n      const err = at(t, x1, x2) - x;\n      if (Math.abs(err) < 1e-7) return t;\n      t -= err / s;\n    }\n    let lo = 0;\n    let hi = 1;\n    t = x;\n    for (let i = 0; i < 30 && hi - lo > 1e-7; i++) {\n      const value = at(t, x1, x2);\n      if (value < x) lo = t;\n      else hi = t;\n      t = (lo + hi) / 2;\n    }\n    return t;\n  };\n\n  return (x: number) => (x <= 0 ? 0 : x >= 1 ? 1 : at(solveX(x), y1, y2));\n}\n\n/** Motion's named eases, as the cubic-beziers they are. */\nexport const MOTION_EASE = {\n  linear: [0, 0, 1, 1],\n  easeIn: [0.42, 0, 1, 1],\n  easeOut: [0, 0, 0.58, 1],\n  easeInOut: [0.42, 0, 0.58, 1],\n  circIn: [0.55, 0, 1, 0.45],\n  circOut: [0.55, 0, 0.45, 1],\n  circInOut: [0.85, 0, 0.15, 1],\n  backIn: [0.31, 0.01, 0.66, -0.59],\n  backOut: [0.33, 1.53, 0.69, 0.99],\n  anticipate: [0.66, -0.56, 0.34, 1.35],\n} as const;\n\n/**\n * Motion's default layout transition (`layout` / `layoutId`):\n * `{ duration: 0.45, ease: [0.4, 0, 0.1, 1] }`.\n */\nexport const LAYOUT_TRANSITION = { duration: 0.45, ease: [0.4, 0, 0.1, 1] as const };\n\n// ---------------------------------------------------------------------------\n// Spring\n// ---------------------------------------------------------------------------\n\nexport interface SpringOptions {\n  /** Motion default 100. */\n  stiffness?: number;\n  /** Motion default 10. */\n  damping?: number;\n  /** Motion default 1. */\n  mass?: number;\n  /** Starting velocity, in units of the whole distance per second. */\n  velocity?: number;\n  /** How close to the end counts as settled, as a fraction of the distance. */\n  restDelta?: number;\n}\n\n/**\n * Normalised position (0 → 1) of a spring released from 0 towards 1, at time\n * `t` seconds. The closed-form solution Motion's `spring()` generator\n * uses for the under-, critically and over-damped cases.\n */\nexport function springAt(options: SpringOptions = {}) {\n  const { stiffness = 100, damping = 10, mass = 1, velocity = 0 } = options;\n  const zeta = damping / (2 * Math.sqrt(stiffness * mass));\n  const omega0 = Math.sqrt(stiffness / mass);\n  // Motion's convention: distance still to cover, velocity toward it negated.\n  const delta = 1;\n  const v0 = -velocity;\n\n  if (zeta < 1) {\n    const omegaD = omega0 * Math.sqrt(1 - zeta * zeta);\n    return (t: number) => {\n      const envelope = Math.exp(-zeta * omega0 * t);\n      return (\n        1 -\n        envelope *\n          (((v0 + zeta * omega0 * delta) / omegaD) * Math.sin(omegaD * t) +\n            delta * Math.cos(omegaD * t))\n      );\n    };\n  }\n  if (zeta === 1) {\n    return (t: number) => 1 - Math.exp(-omega0 * t) * (delta + (v0 + omega0 * delta) * t);\n  }\n  const omegaD = omega0 * Math.sqrt(zeta * zeta - 1);\n  return (t: number) => {\n    const envelope = Math.exp(-zeta * omega0 * t);\n    const freq = Math.min(omegaD * t, 300);\n    return (\n      1 -\n      (envelope *\n        ((v0 + zeta * omega0 * delta) * Math.sinh(freq) + omegaD * delta * Math.cosh(freq))) /\n        omegaD\n    );\n  };\n}\n\n/** Seconds until the spring stays within `restDelta` of its end. */\nexport function springDuration(options: SpringOptions = {}) {\n  const at = springAt(options);\n  const restDelta = options.restDelta ?? 0.001;\n  const step = 1 / 240;\n  let lastOutside = 0;\n  for (let t = 0; t <= 10; t += step) {\n    if (Math.abs(1 - at(t)) > restDelta) lastOutside = t;\n    else if (t - lastOutside > 0.1) break;\n  }\n  return Math.max(lastOutside + step, step);\n}\n\n/**\n * A spring as a duration and an easing function over it — what GSAP takes:\n *\n *   const { duration, ease } = springEase({ stiffness: 300, damping: 20 });\n *   gsap.to(el, { y: 0, duration, ease });\n *\n * Exact for a fixed start and end; a spring that has to react mid-flight to a\n * new target needs `createSpringFollower` instead.\n */\nexport function springEase(options: SpringOptions = {}) {\n  const duration = springDuration(options);\n  const at = springAt(options);\n  return {\n    duration,\n    ease: (progress: number) => (progress >= 1 ? 1 : at(progress * duration)),\n  };\n}\n\n/**\n * A spring as a CSS `linear()` easing and its duration in ms, for\n * `transition` / `animation` with a fixed start and end.\n *\n *   const { easing, duration } = springLinear({ stiffness: 400, damping: 30 });\n *   el.style.transition = `transform ${duration}ms ${easing}`;\n */\nexport function springLinear(options: SpringOptions = {}, pointsPerSecond = 60) {\n  const duration = springDuration(options);\n  const at = springAt(options);\n  const count = Math.max(Math.ceil(duration * pointsPerSecond), 8);\n  const points: string[] = [];\n  for (let i = 0; i <= count; i++) {\n    const t = (i / count) * duration;\n    points.push(String(Math.round((i === count ? 1 : at(t)) * 10000) / 10000));\n  }\n  return { easing: `linear(${points.join(\", \")})`, duration: Math.round(duration * 1000) };\n}\n\n// ---------------------------------------------------------------------------\n// Spring follower (useSpring equivalent)\n// ---------------------------------------------------------------------------\n\n/** Something that calls back once per frame with the time since the last, in ms. */\nexport interface FrameTicker {\n  add: (callback: (deltaMs: number) => void) => () => void;\n}\n\n/** requestAnimationFrame as a ticker — the library-free default. */\nexport const rafTicker: FrameTicker = {\n  add(callback) {\n    let last = performance.now();\n    let frame = requestAnimationFrame(function tick(now) {\n      callback(now - last);\n      last = now;\n      frame = requestAnimationFrame(tick);\n    });\n    return () => cancelAnimationFrame(frame);\n  },\n};\n\nexport interface SpringFollower {\n  /** Chase a new target from wherever the value is now, keeping its velocity. */\n  set: (target: number) => void;\n  /** Move to a value instantly, with no motion. */\n  jump: (value: number) => void;\n  get: () => number;\n  destroy: () => void;\n}\n\n/**\n * A value that follows its target through a spring, integrating the same\n * equation of motion Motion's `useSpring` solves — so a pointer-driven spring\n * reads the same in every build. Runs only while moving; `onUpdate` receives\n * each new value.\n */\nexport function createSpringFollower(\n  initial: number,\n  onUpdate: (value: number) => void,\n  options: SpringOptions & { restSpeed?: number; ticker?: FrameTicker } = {},\n): SpringFollower {\n  const { stiffness = 100, damping = 10, mass = 1, ticker = rafTicker } = options;\n  const restDelta = options.restDelta ?? 0.01;\n  const restSpeed = options.restSpeed ?? 0.01;\n  let value = initial;\n  let target = initial;\n  let velocity = 0;\n  let stop: (() => void) | null = null;\n\n  const step = (deltaMs: number) => {\n    // Fixed 1ms sub-steps keep the integration stable for stiff springs and\n    // independent of the frame rate.\n    const steps = Math.min(Math.max(Math.round(deltaMs), 1), 250);\n    for (let i = 0; i < steps; i++) {\n      const force = -stiffness * (value - target) - damping * velocity;\n      velocity += (force / mass) * 0.001;\n      value += velocity * 0.001;\n    }\n    if (Math.abs(target - value) < restDelta && Math.abs(velocity) < restSpeed) {\n      value = target;\n      velocity = 0;\n      stop?.();\n      stop = null;\n    }\n    onUpdate(value);\n  };\n\n  return {\n    set(next) {\n      target = next;\n      if (!stop && value !== target) stop = ticker.add(step);\n    },\n    jump(next) {\n      stop?.();\n      stop = null;\n      value = target = next;\n      velocity = 0;\n      onUpdate(value);\n    },\n    get: () => value,\n    destroy() {\n      stop?.();\n      stop = null;\n    },\n  };\n}\n",
      "type": "registry:component",
      "target": "components/custom/blocks/motion-curves.ts"
    },
    {
      "path": "src/components/custom/blocks/wallet-data.ts",
      "content": "// Card shape and sample cards for WalletBlock. Kept out of the component file\n// so it stays a components-only module (React Fast Refresh).\n\nexport interface WalletCardItem {\n  id?: string;\n  name: string;\n  balance: string;\n  currency?: string;\n  gradientLight?: string;\n  gradientDark?: string;\n  textColorLight?: string;\n  textColorDark?: string;\n  subtextColorLight?: string;\n  subtextColorDark?: string;\n  hasChip?: boolean;\n  cardNumber?: string;\n  expiry?: string;\n  cvv?: string;\n  tag?: string;\n  issuer?: string;\n  backSignatureLabel?: string;\n  backSubtitle?: string;\n  backNotice?: string;\n}\n\n// 3 authentic cards matching the reference design\nexport const DEFAULT_WALLET_CARDS: WalletCardItem[] = [\n  {\n    id: \"card-1\",\n    name: \"Pounds\",\n    balance: \"€46,000.00\",\n    currency: \"GBP\",\n    gradientLight: \"from-amber-400 via-amber-400 to-amber-500\",\n    gradientDark: \"from-amber-400 via-amber-500 to-amber-600\",\n    textColorLight: \"text-amber-950\",\n    textColorDark: \"text-amber-950\",\n    subtextColorLight: \"text-amber-900/80\",\n    subtextColorDark: \"text-amber-950/70\",\n    cardNumber: \"•••• 9142\",\n    expiry: \"08/29\",\n    cvv: \"614\",\n    tag: \"SAVINGS\",\n    issuer: \"PINSTACK\",\n  },\n  {\n    id: \"card-2\",\n    name: \"Pounds\",\n    balance: \"€46,000.00\",\n    currency: \"GBP\",\n    gradientLight: \"from-fuchsia-500 via-purple-500 to-violet-600\",\n    gradientDark: \"from-fuchsia-600 via-purple-600 to-violet-700\",\n    textColorLight: \"text-white\",\n    textColorDark: \"text-white\",\n    subtextColorLight: \"text-white/80\",\n    subtextColorDark: \"text-white/70\",\n    cardNumber: \"•••• 3058\",\n    expiry: \"11/28\",\n    cvv: \"832\",\n    tag: \"CURRENT\",\n    issuer: \"PINSTACK\",\n  },\n  {\n    id: \"card-3\",\n    name: \"Euros\",\n    balance: \"€46,000.00\",\n    currency: \"EUR\",\n    gradientLight: \"from-blue-600 via-indigo-600 to-blue-700\",\n    gradientDark: \"from-blue-600 via-indigo-600 to-blue-800\",\n    textColorLight: \"text-white\",\n    textColorDark: \"text-white\",\n    subtextColorLight: \"text-blue-100/80\",\n    subtextColorDark: \"text-blue-200/70\",\n    hasChip: true,\n    cardNumber: \"•••• 4829\",\n    expiry: \"09/30\",\n    cvv: \"429\",\n    tag: \"PRIMARY\",\n    issuer: \"PINSTACK\",\n  },\n];\n",
      "type": "registry:component",
      "target": "components/custom/blocks/wallet-data.ts"
    }
  ],
  "docs": "Named export: Wallet. Accepts cards array, overallBalance, allowReveal, and autoRevealOnHover.",
  "categories": [
    "data-display",
    "marketing",
    "actions"
  ],
  "type": "registry:component"
}
