{
  "$schema": "https://uipkge.dev/schema/registry-item.json",
  "name": "gift-card-balance-checker",
  "title": "Gift Card Balance Checker",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-angular/blocks/gift-card-balance-checker/gift-card-balance-checker.component.ts",
      "content": "import { Component, DestroyRef, Input, computed, inject, signal, ChangeDetectionStrategy } from '@angular/core'\nimport {\n  ArrowDownLeft,\n  ArrowUpRight,\n  Check,\n  CheckCircle2,\n  Copy,\n  CreditCard,\n  Gift,\n  HelpCircle,\n  Lock,\n  LucideAngularModule,\n  Plus,\n  RefreshCw,\n  ShieldCheck,\n  ShoppingBag,\n  Wallet,\n} from 'lucide-angular'\nimport { cn } from '@/lib/utils'\nimport { UiBadgeComponent } from '@/ui/badge/badge.component'\nimport { UiButtonComponent } from '@/ui/button/button.component'\nimport {\n  UiCardComponent,\n  UiCardContentComponent,\n  UiCardDescriptionComponent,\n  UiCardFooterComponent,\n  UiCardHeaderComponent,\n  UiCardTitleComponent,\n} from '@/ui/card/card.component'\nimport { UiInputComponent } from '@/ui/input/input.component'\nimport {\n  UiTableBodyComponent,\n  UiTableCellComponent,\n  UiTableComponent,\n  UiTableHeadComponent,\n  UiTableHeaderComponent,\n  UiTableRowComponent,\n} from '@/ui/table/table.component'\nimport {\n  UiTooltipComponent,\n  UiTooltipContentComponent,\n  UiTooltipProviderComponent,\n  UiTooltipTriggerComponent,\n} from '@/ui/tooltip/tooltip.component'\n\nexport interface GiftCardTransactionRecord {\n  id: string\n  date: string\n  reference: string\n  title: string\n  subtitle?: string\n  type: 'activation' | 'redemption' | 'reload'\n  amount: number\n  balanceAfter: number\n  status: 'Completed' | 'Pending'\n}\n\nexport type GiftCardFilterType = 'all' | 'redemptions' | 'loads'\n\nconst initialTransactions: GiftCardTransactionRecord[] = [\n  {\n    id: 'tx-1',\n    date: 'Dec 19, 2024',\n    reference: '#ORD-84112',\n    title: 'Store Checkout Redemption',\n    subtitle: 'Order #ORD-84112 · Leather Travel Wallet',\n    type: 'redemption',\n    amount: -15.0,\n    balanceAfter: 150.0,\n    status: 'Completed',\n  },\n  {\n    id: 'tx-2',\n    date: 'Nov 04, 2024',\n    reference: '#ORD-84920',\n    title: 'Store Checkout Redemption',\n    subtitle: 'Order #ORD-84920 · Merino Knit Sweater',\n    type: 'redemption',\n    amount: -35.0,\n    balanceAfter: 165.0,\n    status: 'Completed',\n  },\n  {\n    id: 'tx-3',\n    date: 'Oct 12, 2024',\n    reference: '#ACT-99014',\n    title: 'Initial Activation & Fund Issue',\n    subtitle: 'Digital Storefront Pass Issued',\n    type: 'activation',\n    amount: 200.0,\n    balanceAfter: 200.0,\n    status: 'Completed',\n  },\n]\n\n/** Groups digits in fours: \"7482 - 9104 - 6382 - 8492\" (max 16 digits). */\nexport function formatGiftCardInput(raw: string): string {\n  const digits = raw.replace(/\\D/g, '').slice(0, 16)\n  return digits.replace(/(.{4})(?=.)/g, '$1 - ')\n}\n\n/**\n * Angular port of the React GiftCardBalanceChecker block: card lookup form with a digital\n * gift-card hero, quick fund reloads, balance metrics, a filterable redemption ledger and an\n * in-store barcode pass.\n */\n@Component({\n  changeDetection: ChangeDetectionStrategy.Eager,\n  selector: 'ui-gift-card-balance-checker, [ui-gift-card-balance-checker]',\n  standalone: true,\n  host: {\n    '[attr.data-slot]': '\"gift-card-balance-checker\"',\n    '[class]': 'hostClass',\n  },\n  imports: [\n    LucideAngularModule,\n    UiBadgeComponent,\n    UiButtonComponent,\n    UiCardComponent,\n    UiCardContentComponent,\n    UiCardDescriptionComponent,\n    UiCardFooterComponent,\n    UiCardHeaderComponent,\n    UiCardTitleComponent,\n    UiInputComponent,\n    UiTableBodyComponent,\n    UiTableCellComponent,\n    UiTableComponent,\n    UiTableHeadComponent,\n    UiTableHeaderComponent,\n    UiTableRowComponent,\n    UiTooltipComponent,\n    UiTooltipContentComponent,\n    UiTooltipProviderComponent,\n    UiTooltipTriggerComponent,\n  ],\n  template: `\n    <!-- Header Section -->\n    <div class=\"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between\">\n      <div class=\"space-y-1\">\n        <div class=\"flex items-center gap-2\">\n          <h2 class=\"text-foreground text-2xl font-bold tracking-tight\">Check Gift Card Balance</h2>\n          <span ui-badge variant=\"outline\" class=\"bg-primary/5 text-primary border-primary/20 gap-1\">\n            <lucide-icon [img]=\"CheckCircle2\" [class]=\"'text-primary size-3'\" />\n            Storefront Pass\n          </span>\n        </div>\n        <p class=\"text-muted-foreground text-sm\">\n          Check your remaining card balance, review past order redemptions, or reload funds.\n        </p>\n      </div>\n\n      <div class=\"flex items-center gap-2\">\n        <ui-tooltip-provider [delayDuration]=\"150\">\n          <ui-tooltip>\n            <div\n              ui-tooltip-trigger\n              class=\"border-border bg-card text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs shadow-xs\"\n            >\n              <lucide-icon [img]=\"HelpCircle\" [class]=\"'text-primary size-3.5'\" />\n              <span>PIN &amp; Card Guide</span>\n            </div>\n            <ui-tooltip-content side=\"bottom\" class=\"max-w-xs text-xs\">\n              Locate the 16-digit card code on the back of your physical card or inside your digital gift email. The\n              4-digit security PIN is under the scratch-off foil.\n            </ui-tooltip-content>\n          </ui-tooltip>\n        </ui-tooltip-provider>\n      </div>\n    </div>\n\n    <!-- Feedback Banner if active -->\n    @if (feedbackMessage()) {\n      <div\n        class=\"border-success/20 bg-success/10 text-success flex items-center justify-between rounded-lg border px-4 py-2.5 text-sm\"\n      >\n        <div class=\"flex items-center gap-2\">\n          <lucide-icon [img]=\"CheckCircle2\" [class]=\"'text-success size-4 shrink-0'\" />\n          <span>{{ feedbackMessage() }}</span>\n        </div>\n      </div>\n    }\n\n    <!-- 2-Column Storefront Layout -->\n    <div class=\"grid grid-cols-1 gap-6 lg:grid-cols-12\">\n      <!-- Left Column: Lookup Form & Digital Card Hero -->\n      <div class=\"space-y-6 lg:col-span-5\">\n        <!-- Lookup Card Form -->\n        <div ui-card class=\"border-border shadow-xs\">\n          <div ui-card-header class=\"pb-4\">\n            <div class=\"flex items-center justify-between\">\n              <h3 ui-card-title class=\"text-base font-semibold\">Card Lookup</h3>\n              @if (isVerified()) {\n                <span ui-badge variant=\"outline\" class=\"border-success/30 bg-success/10 text-success gap-1 text-xs\">\n                  <lucide-icon [img]=\"Check\" [class]=\"'size-3'\" />\n                  Active Card\n                </span>\n              }\n            </div>\n            <p ui-card-description class=\"text-xs\">\n              Enter your gift card credentials to view live balance and activity.\n            </p>\n          </div>\n\n          <div ui-card-content class=\"space-y-4 pb-4\">\n            <!-- 16-Digit Card Number Input -->\n            <div class=\"space-y-1.5\">\n              <div class=\"flex items-center justify-between\">\n                <label for=\"gc-number-input-angular\" class=\"text-foreground text-xs font-medium\">\n                  16-Digit Card Number\n                </label>\n                <ui-tooltip-provider [delayDuration]=\"150\">\n                  <ui-tooltip>\n                    <button\n                      ui-tooltip-trigger\n                      type=\"button\"\n                      class=\"text-muted-foreground hover:text-foreground inline-flex items-center focus-visible:outline-none\"\n                      aria-label=\"Gift card number info\"\n                    >\n                      <lucide-icon [img]=\"HelpCircle\" [class]=\"'size-3.5'\" />\n                    </button>\n                    <ui-tooltip-content side=\"top\" class=\"max-w-xs text-xs\">\n                      Enter the 16 digits on the back of your card or in your receipt email.\n                    </ui-tooltip-content>\n                  </ui-tooltip>\n                </ui-tooltip-provider>\n              </div>\n\n              <ui-input\n                id=\"gc-number-input-angular\"\n                [value]=\"cardNumber()\"\n                placeholder=\"XXXX - XXXX - XXXX - XXXX\"\n                [maxLength]=\"25\"\n                class=\"font-mono text-sm\"\n                [prefixIcon]=\"cardIcon\"\n                (valueChange)=\"onCardNumberChange($event)\"\n              />\n              <ng-template #cardIcon><lucide-icon [img]=\"CreditCard\" [class]=\"'size-4'\" /></ng-template>\n            </div>\n\n            <!-- 4-Digit Security PIN Input -->\n            <div class=\"space-y-1.5\">\n              <div class=\"flex items-center justify-between\">\n                <label for=\"gc-pin-input-angular\" class=\"text-foreground text-xs font-medium\">\n                  Security PIN (4 digits)\n                </label>\n                <ui-tooltip-provider [delayDuration]=\"150\">\n                  <ui-tooltip>\n                    <button\n                      ui-tooltip-trigger\n                      type=\"button\"\n                      class=\"text-muted-foreground hover:text-foreground inline-flex items-center focus-visible:outline-none\"\n                      aria-label=\"Security PIN info\"\n                    >\n                      <lucide-icon [img]=\"HelpCircle\" [class]=\"'size-3.5'\" />\n                    </button>\n                    <ui-tooltip-content side=\"top\" class=\"max-w-xs text-xs\">\n                      The 4-digit PIN is revealed by scratching the silver foil or listed in your digital claim email.\n                    </ui-tooltip-content>\n                  </ui-tooltip>\n                </ui-tooltip-provider>\n              </div>\n\n              <ui-input\n                id=\"gc-pin-input-angular\"\n                [value]=\"securityPin()\"\n                type=\"password\"\n                placeholder=\"••••\"\n                [maxLength]=\"4\"\n                showPasswordToggle\n                class=\"font-mono text-sm\"\n                [prefixIcon]=\"lockIcon\"\n                (valueChange)=\"onPinChange($event)\"\n              />\n              <ng-template #lockIcon><lucide-icon [img]=\"Lock\" [class]=\"'size-4'\" /></ng-template>\n            </div>\n\n            <button\n              ui-button\n              type=\"button\"\n              class=\"w-full font-medium\"\n              [disabled]=\"isChecking()\"\n              (click)=\"checkBalance()\"\n            >\n              @if (isChecking()) {\n                <lucide-icon [img]=\"RefreshCw\" [class]=\"'mr-2 size-4 animate-spin'\" />\n                Verifying Balance...\n              } @else {\n                <lucide-icon [img]=\"ShieldCheck\" [class]=\"'mr-2 size-4'\" />\n                Check Balance\n              }\n            </button>\n          </div>\n        </div>\n\n        <!-- Stylized Digital Gift Card Hero Display -->\n        <div\n          class=\"relative overflow-hidden rounded-2xl border border-white/10 bg-gradient-to-br from-zinc-950 via-neutral-900 to-zinc-900 p-6 text-white shadow-lg\"\n        >\n          <div class=\"relative flex flex-col justify-between space-y-6\">\n            <!-- Card Top Bar: Brand & Pass Badge -->\n            <div class=\"flex items-start justify-between\">\n              <div class=\"flex items-center gap-2.5\">\n                <div\n                  class=\"flex size-9 items-center justify-center rounded-xl border border-white/10 bg-white/10 text-white shadow-inner backdrop-blur-md\"\n                >\n                  <lucide-icon [img]=\"Gift\" [class]=\"'text-success size-5'\" />\n                </div>\n                <div>\n                  <p class=\"text-xs font-bold tracking-wider text-neutral-200 uppercase\">Lumen Store</p>\n                  <p class=\"text-xs text-neutral-400\">Digital Gift Pass</p>\n                </div>\n              </div>\n\n              <span\n                ui-badge\n                variant=\"outline\"\n                class=\"gap-1.5 border-white/20 bg-white/10 px-2.5 py-0.5 text-xs text-white backdrop-blur-md\"\n              >\n                <span class=\"bg-success size-1.5 animate-pulse rounded-full\"></span>\n                Verified Active\n              </span>\n            </div>\n\n            <!-- Card Center: Chip Icon & Balance Display -->\n            <div class=\"space-y-1 pt-1\">\n              <div class=\"flex items-center justify-between\">\n                <span class=\"text-xs font-medium tracking-wider text-neutral-400 uppercase\">Available Balance</span>\n                <!-- Chip graphic representation -->\n                <div class=\"flex items-center gap-1 opacity-70\">\n                  <div\n                    class=\"border-warning/20/40 h-5 w-7 rounded-sm border bg-gradient-to-tr from-amber-400/20 to-amber-200/40\"\n                  ></div>\n                  <span class=\"font-mono text-xs tracking-tighter text-neutral-400\">NFC</span>\n                </div>\n              </div>\n\n              <div class=\"flex items-baseline gap-2\">\n                <span class=\"text-3xl font-bold tracking-tight text-white tabular-nums sm:text-4xl\"\n                  >\\${{ currentBalance().toFixed(2) }}</span\n                >\n                <span class=\"text-success text-xs font-medium\">USD</span>\n              </div>\n            </div>\n\n            <!-- Card Footer: Card Number & Expiry terms -->\n            <div class=\"space-y-2 border-t border-white/10 pt-4\">\n              <div class=\"flex items-center justify-between\">\n                <div class=\"flex items-center gap-2\">\n                  <span class=\"font-mono text-sm tracking-widest text-neutral-200\"\n                    >•••• •••• •••• {{ lastFourDigits() }}</span\n                  >\n                  <button\n                    type=\"button\"\n                    class=\"rounded p-1 text-neutral-400 transition-colors hover:text-white focus-visible:ring-1 focus-visible:ring-white/40 focus-visible:outline-none\"\n                    aria-label=\"Copy card number\"\n                    (click)=\"copyCardNumber()\"\n                  >\n                    @if (copied()) {\n                      <lucide-icon [img]=\"Check\" [class]=\"'text-success size-3.5'\" />\n                    } @else {\n                      <lucide-icon [img]=\"Copy\" [class]=\"'size-3.5'\" />\n                    }\n                  </button>\n                </div>\n                @if (copied()) {\n                  <span class=\"animate-in fade-in text-success text-xs font-medium\">Copied!</span>\n                }\n              </div>\n\n              <div class=\"flex items-center justify-between text-xs text-neutral-400\">\n                <span>Never Expires · No Inactivity Fees</span>\n                <span class=\"font-mono text-neutral-500\">PIN: ••••</span>\n              </div>\n            </div>\n          </div>\n        </div>\n\n        <!-- Quick Action Buttons -->\n        <div class=\"space-y-3\">\n          <button ui-button variant=\"default\" class=\"w-full font-medium\" (click)=\"applyToOrder()\">\n            @if (applied()) {\n              <lucide-icon [img]=\"Check\" [class]=\"'text-success mr-2 size-4'\" />\n              Applied to Checkout!\n            } @else {\n              <lucide-icon [img]=\"ShoppingBag\" [class]=\"'mr-2 size-4'\" />\n              Apply to Next Order\n            }\n          </button>\n\n          <!-- Quick Reload Card -->\n          <div ui-card class=\"border-border shadow-xs\">\n            <div ui-card-header class=\"p-4 pb-2\">\n              <div class=\"flex items-center justify-between\">\n                <h3 ui-card-title class=\"text-muted-foreground text-xs font-semibold tracking-wider uppercase\">\n                  Quick Reload Funds\n                </h3>\n                <lucide-icon [img]=\"Plus\" [class]=\"'text-muted-foreground size-3.5'\" />\n              </div>\n            </div>\n            <div ui-card-content class=\"p-4 pt-0\">\n              <p class=\"text-muted-foreground mb-3 text-xs\">\n                Top up your gift card instantly with a saved payment method.\n              </p>\n              <div class=\"grid grid-cols-3 gap-2\">\n                <button\n                  ui-button\n                  variant=\"outline\"\n                  size=\"sm\"\n                  class=\"hover:bg-primary/5 hover:text-primary hover:border-primary/30 w-full font-medium tabular-nums\"\n                  (click)=\"reloadFunds(25)\"\n                >\n                  + $25.00\n                </button>\n                <button\n                  ui-button\n                  variant=\"outline\"\n                  size=\"sm\"\n                  class=\"hover:bg-primary/5 hover:text-primary hover:border-primary/30 w-full font-medium tabular-nums\"\n                  (click)=\"reloadFunds(50)\"\n                >\n                  + $50.00\n                </button>\n                <button\n                  ui-button\n                  variant=\"outline\"\n                  size=\"sm\"\n                  class=\"hover:bg-primary/5 hover:text-primary hover:border-primary/30 w-full font-medium tabular-nums\"\n                  (click)=\"reloadFunds(100)\"\n                >\n                  + $100.00\n                </button>\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <!-- Right Column: Balance Stats & Redemption History Table -->\n      <div class=\"space-y-6 lg:col-span-7\">\n        <!-- Passbook Summary Metrics -->\n        <div class=\"grid grid-cols-1 gap-3 sm:grid-cols-3\">\n          <div class=\"border-border bg-card rounded-xl border p-4 shadow-xs\">\n            <div class=\"text-muted-foreground mb-1 flex items-center justify-between text-xs\">\n              <span>Available Balance</span>\n              <lucide-icon [img]=\"Wallet\" [class]=\"'text-primary size-3.5'\" />\n            </div>\n            <p class=\"text-foreground text-2xl font-bold tracking-tight tabular-nums\">\n              \\${{ currentBalance().toFixed(2) }}\n            </p>\n            <p class=\"text-success mt-1 flex items-center gap-1 text-xs font-medium\">\n              <lucide-icon [img]=\"Check\" [class]=\"'size-3'\" />\n              Ready to spend\n            </p>\n          </div>\n\n          <div class=\"border-border bg-card rounded-xl border p-4 shadow-xs\">\n            <div class=\"text-muted-foreground mb-1 flex items-center justify-between text-xs\">\n              <span>Total Value Loaded</span>\n              <lucide-icon [img]=\"ArrowDownLeft\" [class]=\"'text-success size-3.5'\" />\n            </div>\n            <p class=\"text-foreground text-2xl font-bold tracking-tight tabular-nums\">\n              \\${{ totalLoaded().toFixed(2) }}\n            </p>\n            <p class=\"text-muted-foreground mt-1 text-xs\">All top-ups &amp; issue</p>\n          </div>\n\n          <div class=\"border-border bg-card rounded-xl border p-4 shadow-xs\">\n            <div class=\"text-muted-foreground mb-1 flex items-center justify-between text-xs\">\n              <span>Total Redeemed</span>\n              <lucide-icon [img]=\"ArrowUpRight\" [class]=\"'text-muted-foreground size-3.5'\" />\n            </div>\n            <p class=\"text-foreground text-2xl font-bold tracking-tight tabular-nums\">\n              -\\${{ totalSpent().toFixed(2) }}\n            </p>\n            <p class=\"text-muted-foreground mt-1 text-xs\">Past store orders</p>\n          </div>\n        </div>\n\n        <!-- Redemption & Activity History Card -->\n        <div ui-card class=\"border-border shadow-xs\">\n          <div ui-card-header class=\"pb-3\">\n            <div class=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n              <div>\n                <h3 ui-card-title class=\"text-base font-semibold\">Redemption &amp; Activity History</h3>\n                <p ui-card-description class=\"text-xs\">\n                  Detailed ledger of card issuance, promotional top-ups, and store checkouts.\n                </p>\n              </div>\n\n              <!-- Filter Pills -->\n              <div class=\"border-border bg-muted/40 flex items-center gap-1.5 rounded-lg border p-1 text-xs\">\n                <button type=\"button\" [class]=\"filterClass('all')\" (click)=\"filterType.set('all')\">\n                  All ({{ transactions().length }})\n                </button>\n                <button type=\"button\" [class]=\"filterClass('redemptions')\" (click)=\"filterType.set('redemptions')\">\n                  Redemptions\n                </button>\n                <button type=\"button\" [class]=\"filterClass('loads')\" (click)=\"filterType.set('loads')\">Loads</button>\n              </div>\n            </div>\n          </div>\n\n          <div ui-card-content class=\"p-0\">\n            <div class=\"overflow-x-auto\">\n              <div ui-table>\n                <thead ui-table-header>\n                  <tr ui-table-row>\n                    <th ui-table-head class=\"w-[110px]\">Date</th>\n                    <th ui-table-head>Activity &amp; Reference</th>\n                    <th ui-table-head class=\"w-[90px] text-center\">Type</th>\n                    <th ui-table-head class=\"w-[100px] text-right\">Amount</th>\n                    <th ui-table-head class=\"w-[110px] text-right\">Resulting Balance</th>\n                  </tr>\n                </thead>\n                <tbody ui-table-body>\n                  @for (record of filteredTransactions(); track record.id) {\n                    <tr ui-table-row>\n                      <td ui-table-cell class=\"text-muted-foreground text-xs font-medium\">{{ record.date }}</td>\n                      <td ui-table-cell>\n                        <div class=\"space-y-0.5\">\n                          <p class=\"text-foreground text-sm leading-none font-medium\">{{ record.title }}</p>\n                          @if (record.subtitle) {\n                            <p class=\"text-muted-foreground text-xs\">{{ record.subtitle }}</p>\n                          }\n                        </div>\n                      </td>\n                      <td ui-table-cell class=\"text-center\">\n                        @if (record.type === 'activation') {\n                          <span\n                            ui-badge\n                            variant=\"outline\"\n                            class=\"border-success/30 bg-success/10 text-success px-2 py-0.5 text-xs font-normal\"\n                          >\n                            Activation\n                          </span>\n                        }\n                        @if (record.type === 'reload') {\n                          <span\n                            ui-badge\n                            variant=\"outline\"\n                            class=\"border-info/30 bg-info/10 text-info px-2 py-0.5 text-xs font-normal\"\n                          >\n                            Reload\n                          </span>\n                        }\n                        @if (record.type === 'redemption') {\n                          <span ui-badge variant=\"secondary\" class=\"px-2 py-0.5 text-xs font-normal\">Redemption</span>\n                        }\n                      </td>\n                      <td ui-table-cell [class]=\"amountClass(record)\">{{ amountLabel(record) }}</td>\n                      <td ui-table-cell class=\"text-muted-foreground text-right font-mono text-sm tabular-nums\">\n                        \\${{ record.balanceAfter.toFixed(2) }}\n                      </td>\n                    </tr>\n                  }\n                </tbody>\n              </div>\n            </div>\n          </div>\n\n          <div\n            ui-card-footer\n            class=\"border-border text-muted-foreground flex flex-col gap-3 border-t p-4 text-xs sm:flex-row sm:items-center sm:justify-between\"\n          >\n            <div class=\"flex items-center gap-1.5\">\n              <lucide-icon [img]=\"ShieldCheck\" [class]=\"'text-primary size-4 shrink-0'\" />\n              <span>Protected by 256-bit encryption · Zero liability policy</span>\n            </div>\n            <div class=\"flex items-center gap-3\">\n              <button\n                type=\"button\"\n                class=\"hover:text-foreground flex min-h-6 items-center gap-1 underline-offset-4 hover:underline\"\n                (click)=\"checkBalance()\"\n              >\n                <lucide-icon [img]=\"RefreshCw\" [class]=\"'size-3'\" />\n                Refresh Ledger\n              </button>\n            </div>\n          </div>\n        </div>\n\n        <!-- Digital Passbook Barcode Card -->\n        <div ui-card class=\"border-border bg-muted/20 shadow-xs\">\n          <div ui-card-content class=\"flex flex-col items-center justify-between gap-4 p-4 sm:flex-row sm:p-5\">\n            <div class=\"space-y-1 text-center sm:text-left\">\n              <h4 class=\"text-foreground flex items-center justify-center gap-2 text-sm font-semibold sm:justify-start\">\n                <lucide-icon [img]=\"Wallet\" [class]=\"'text-primary size-4'\" />\n                In-Store Digital Pass\n              </h4>\n              <p class=\"text-muted-foreground max-w-sm text-xs\">\n                Present this barcode at checkout in any physical store location to scan and redeem card funds.\n              </p>\n            </div>\n\n            <!-- Barcode Simulation -->\n            <div class=\"border-border bg-card flex flex-col items-center gap-1.5 rounded-lg border p-3 shadow-xs\">\n              <div class=\"flex h-10 items-end gap-[3px] px-2\" aria-hidden=\"true\">\n                <div class=\"bg-foreground h-full w-[2px]\"></div>\n                <div class=\"bg-foreground h-full w-[4px]\"></div>\n                <div class=\"bg-foreground h-full w-[1px]\"></div>\n                <div class=\"bg-foreground h-full w-[3px]\"></div>\n                <div class=\"bg-foreground h-full w-[2px]\"></div>\n                <div class=\"bg-foreground h-full w-[5px]\"></div>\n                <div class=\"bg-foreground h-full w-[1px]\"></div>\n                <div class=\"bg-foreground h-full w-[3px]\"></div>\n                <div class=\"bg-foreground h-full w-[2px]\"></div>\n                <div class=\"bg-foreground h-full w-[4px]\"></div>\n                <div class=\"bg-foreground h-full w-[2px]\"></div>\n                <div class=\"bg-foreground h-full w-[1px]\"></div>\n                <div class=\"bg-foreground h-full w-[4px]\"></div>\n                <div class=\"bg-foreground h-full w-[2px]\"></div>\n                <div class=\"bg-foreground h-full w-[3px]\"></div>\n              </div>\n              <span class=\"text-muted-foreground font-mono text-xs tracking-widest\">{{ cardNumber() }}</span>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  `,\n})\nexport class UiGiftCardBalanceCheckerComponent {\n  @Input('class') className?: string\n\n  private readonly destroyRef = inject(DestroyRef)\n  private readonly timers = new Set<ReturnType<typeof setTimeout>>()\n\n  protected readonly ArrowDownLeft = ArrowDownLeft\n  protected readonly ArrowUpRight = ArrowUpRight\n  protected readonly Check = Check\n  protected readonly CheckCircle2 = CheckCircle2\n  protected readonly Copy = Copy\n  protected readonly CreditCard = CreditCard\n  protected readonly Gift = Gift\n  protected readonly HelpCircle = HelpCircle\n  protected readonly Lock = Lock\n  protected readonly Plus = Plus\n  protected readonly RefreshCw = RefreshCw\n  protected readonly ShieldCheck = ShieldCheck\n  protected readonly ShoppingBag = ShoppingBag\n  protected readonly Wallet = Wallet\n\n  readonly cardNumber = signal('7482 - 9104 - 6382 - 8492')\n  readonly securityPin = signal('4829')\n  readonly isChecking = signal(false)\n  readonly isVerified = signal(true)\n  readonly copied = signal(false)\n  readonly applied = signal(false)\n  readonly feedbackMessage = signal<string | null>(null)\n  readonly filterType = signal<GiftCardFilterType>('all')\n  readonly transactions = signal<GiftCardTransactionRecord[]>(initialTransactions)\n\n  readonly currentBalance = computed(() => {\n    const list = this.transactions()\n    return list.length === 0 ? 0 : list[0]!.balanceAfter\n  })\n\n  readonly totalLoaded = computed(() =>\n    this.transactions()\n      .filter((t) => t.amount > 0)\n      .reduce((sum, t) => sum + t.amount, 0),\n  )\n\n  readonly totalSpent = computed(() =>\n    Math.abs(\n      this.transactions()\n        .filter((t) => t.amount < 0)\n        .reduce((sum, t) => sum + t.amount, 0),\n    ),\n  )\n\n  readonly lastFourDigits = computed(() => {\n    const digits = this.cardNumber().replace(/\\D/g, '')\n    return digits.length >= 4 ? digits.slice(-4) : '8492'\n  })\n\n  readonly filteredTransactions = computed(() => {\n    const filter = this.filterType()\n    const list = this.transactions()\n    if (filter === 'redemptions') return list.filter((t) => t.type === 'redemption')\n    if (filter === 'loads') return list.filter((t) => t.type === 'activation' || t.type === 'reload')\n    return list\n  })\n\n  constructor() {\n    this.destroyRef.onDestroy(() => {\n      for (const t of this.timers) clearTimeout(t)\n      this.timers.clear()\n    })\n  }\n\n  get hostClass(): string {\n    return cn('block w-full space-y-6', this.className)\n  }\n\n  protected filterClass(type: GiftCardFilterType): string {\n    return cn(\n      'rounded px-2.5 py-1 font-medium transition-colors',\n      this.filterType() === type\n        ? 'bg-background text-foreground shadow-xs'\n        : 'text-muted-foreground hover:text-foreground',\n    )\n  }\n\n  protected amountClass(record: GiftCardTransactionRecord): string {\n    return cn('text-right text-sm font-medium tabular-nums', record.amount > 0 ? 'text-success' : 'text-foreground')\n  }\n\n  protected amountLabel(record: GiftCardTransactionRecord): string {\n    return record.amount > 0 ? `+$${record.amount.toFixed(2)}` : `-$${Math.abs(record.amount).toFixed(2)}`\n  }\n\n  private later(fn: () => void, ms: number): void {\n    const t = setTimeout(() => {\n      this.timers.delete(t)\n      fn()\n    }, ms)\n    this.timers.add(t)\n  }\n\n  onCardNumberChange(value: string): void {\n    this.cardNumber.set(formatGiftCardInput(value))\n  }\n\n  onPinChange(value: string): void {\n    this.securityPin.set(value.replace(/\\D/g, '').slice(0, 4))\n  }\n\n  checkBalance(): void {\n    this.isChecking.set(true)\n    this.feedbackMessage.set(null)\n    this.later(() => {\n      this.isChecking.set(false)\n      this.isVerified.set(true)\n      this.feedbackMessage.set(`Gift card verified. Current active balance is $${this.currentBalance().toFixed(2)}.`)\n      this.later(() => this.feedbackMessage.set(null), 4000)\n    }, 500)\n  }\n\n  copyCardNumber(): void {\n    const raw = this.cardNumber().replace(/\\s+/g, '')\n    if (typeof navigator !== 'undefined' && navigator.clipboard) {\n      navigator.clipboard.writeText(raw).catch(() => {})\n    }\n    this.copied.set(true)\n    this.later(() => this.copied.set(false), 2000)\n  }\n\n  applyToOrder(): void {\n    this.copyCardNumber()\n    this.applied.set(true)\n    this.feedbackMessage.set(`Card ending in ${this.lastFourDigits()} copied and applied to your checkout session!`)\n    this.later(() => {\n      this.applied.set(false)\n      this.feedbackMessage.set(null)\n    }, 4000)\n  }\n\n  reloadFunds(amount: number): void {\n    const newBalance = this.currentBalance() + amount\n    const newRecord: GiftCardTransactionRecord = {\n      id: `tx-${Date.now()}`,\n      date: 'Today',\n      reference: `#RLD-${Math.floor(10000 + Math.random() * 90000)}`,\n      title: 'Manual Online Fund Reload',\n      subtitle: `Instant Online Top-Up (+ $${amount.toFixed(2)})`,\n      type: 'reload',\n      amount,\n      balanceAfter: newBalance,\n      status: 'Completed',\n    }\n    this.transactions.update((prev) => [newRecord, ...prev])\n    this.feedbackMessage.set(\n      `Successfully reloaded +$${amount.toFixed(2)}! New card balance: $${newBalance.toFixed(2)}.`,\n    )\n    this.later(() => this.feedbackMessage.set(null), 4000)\n  }\n}\n",
      "type": "registry:block",
      "target": "~/src/app/components/blocks/gift-card-balance-checker/gift-card-balance-checker.component.ts"
    },
    {
      "path": "packages/registry-angular/blocks/gift-card-balance-checker/index.ts",
      "content": "export {\n  UiGiftCardBalanceCheckerComponent,\n  formatGiftCardInput,\n  type GiftCardFilterType,\n  type GiftCardTransactionRecord,\n} from './gift-card-balance-checker.component'\n",
      "type": "registry:block",
      "target": "~/src/app/components/blocks/gift-card-balance-checker/index.ts"
    }
  ],
  "dependencies": [
    "lucide-angular"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/angular/badge.json",
    "https://uipkge.dev/r/angular/button.json",
    "https://uipkge.dev/r/angular/card.json",
    "https://uipkge.dev/r/angular/input.json",
    "https://uipkge.dev/r/angular/table.json",
    "https://uipkge.dev/r/angular/tooltip.json"
  ],
  "description": "Customer storefront gift card balance lookup, live digital card passbook, quick fund reloading, and complete redemption audit history ledger.",
  "categories": [
    "commerce",
    "ecommerce",
    "finance",
    "app"
  ]
}