{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "safe-note-calculator",
  "title": "Safe Note Calculator",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/safe-note-calculator/SafeNoteCalculator.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport {\n  BadgePercent,\n  Check,\n  CheckCircle2,\n  Copy,\n  DollarSign,\n  FileSpreadsheet,\n  Layers,\n  Percent,\n  PieChart,\n  Scale,\n  ShieldCheck,\n  TrendingUp,\n} from 'lucide-react'\nimport { cn } from '@/lib/utils'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'\nimport { Input } from '@/components/ui/input'\nimport { Separator } from '@/components/ui/separator'\nimport { Slider } from '@/components/ui/slider'\nimport { Switch } from '@/components/ui/switch'\nimport { Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow } from '@/components/ui/table'\nimport { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'\n\ntype RoundPreset = 'seed-standard' | 'preseed-safe' | 'uncapped-discount' | 'bridge-round'\n\ninterface PresetConfig {\n  id: RoundPreset\n  label: string\n  investment: number\n  valuationCap: number\n  hasDiscount: boolean\n  discountRate: number\n  shares: number\n  seriesAPreMoney: number\n  description: string\n}\n\nconst PRESETS: Record<RoundPreset, PresetConfig> = {\n  'seed-standard': {\n    id: 'seed-standard',\n    label: 'Standard Seed ($1M @ $15M)',\n    investment: 1_000_000,\n    valuationCap: 15_000_000,\n    hasDiscount: true,\n    discountRate: 20,\n    shares: 10_000_000,\n    seriesAPreMoney: 25_000_000,\n    description: 'Standard YC Post-Money SAFE with $15M valuation cap and optional 20% discount clause.',\n  },\n  'preseed-safe': {\n    id: 'preseed-safe',\n    label: 'Pre-Seed ($500K @ $8M)',\n    investment: 500_000,\n    valuationCap: 8_000_000,\n    hasDiscount: true,\n    discountRate: 20,\n    shares: 10_000_000,\n    seriesAPreMoney: 18_000_000,\n    description: 'Early-stage angel or accelerator round with $8M valuation cap.',\n  },\n  'uncapped-discount': {\n    id: 'uncapped-discount',\n    label: 'Uncapped (25% Disc)',\n    investment: 750_000,\n    valuationCap: 60_000_000,\n    hasDiscount: true,\n    discountRate: 25,\n    shares: 10_000_000,\n    seriesAPreMoney: 20_000_000,\n    description: 'High valuation cap structure where the 25% discount governs share conversion price.',\n  },\n  'bridge-round': {\n    id: 'bridge-round',\n    label: 'Growth Bridge ($2M @ $25M)',\n    investment: 2_000_000,\n    valuationCap: 25_000_000,\n    hasDiscount: true,\n    discountRate: 15,\n    shares: 10_000_000,\n    seriesAPreMoney: 45_000_000,\n    description: 'Late seed extension bridging into a larger institutional Series A equity round.',\n  },\n}\n\nconst INVESTMENT_MARKS = {\n  100000: '$100K',\n  1000000: '$1M',\n  2500000: '$2.5M',\n  5000000: '$5M',\n}\n\nconst VALUATION_CAP_MARKS = {\n  2000000: '$2M',\n  15000000: '$15M',\n  30000000: '$30M',\n  50000000: '$50M',\n}\n\nconst DISCOUNT_RATE_MARKS = {\n  10: '10%',\n  15: '15%',\n  20: '20%',\n  25: '25%',\n  30: '30%',\n}\n\nconst SERIES_A_MARKS = {\n  5000000: '$5M',\n  25000000: '$25M',\n  50000000: '$50M',\n  80000000: '$80M',\n}\n\nconst SCENARIO_VALUATIONS = [10_000_000, 15_000_000, 20_000_000, 25_000_000, 40_000_000, 60_000_000]\n\n// Number & Currency Formatters\nconst fmtCurrency = (val: number) => {\n  return new Intl.NumberFormat('en-US', {\n    style: 'currency',\n    currency: 'USD',\n    minimumFractionDigits: 2,\n    maximumFractionDigits: 2,\n  }).format(val || 0)\n}\n\nconst fmtCurrencyWhole = (val: number) => {\n  return new Intl.NumberFormat('en-US', {\n    style: 'currency',\n    currency: 'USD',\n    minimumFractionDigits: 0,\n    maximumFractionDigits: 0,\n  }).format(val || 0)\n}\n\nconst fmtPercent = (val: number, decimals = 2) => {\n  return `${(val || 0).toFixed(decimals)}%`\n}\n\nconst fmtNumber = (val: number) => {\n  return new Intl.NumberFormat('en-US', {\n    maximumFractionDigits: 0,\n  }).format(val || 0)\n}\n\nexport function SafeNoteCalculator({ className }: { className?: string }) {\n  const [selectedPreset, setSelectedPreset] = React.useState<RoundPreset>('seed-standard')\n  const [investmentAmount, setInvestmentAmount] = React.useState(1_000_000)\n  const [valuationCap, setValuationCap] = React.useState(15_000_000)\n  const [hasDiscount, setHasDiscount] = React.useState(true)\n  const [discountRate, setDiscountRate] = React.useState(20)\n  const [companyCapitalization, setCompanyCapitalization] = React.useState(10_000_000)\n  const [seriesAPreMoney, setSeriesAPreMoney] = React.useState(25_000_000)\n  const [copied, setCopied] = React.useState(false)\n\n  const handlePresetChange = React.useCallback((value: string) => {\n    const presetId = value as RoundPreset\n    setSelectedPreset(presetId)\n    const preset = PRESETS[presetId]\n    if (preset) {\n      setInvestmentAmount(preset.investment)\n      setValuationCap(preset.valuationCap)\n      setHasDiscount(preset.hasDiscount)\n      setDiscountRate(preset.discountRate)\n      setCompanyCapitalization(preset.shares)\n      setSeriesAPreMoney(preset.seriesAPreMoney)\n    }\n  }, [])\n\n  // Core SAFE conversion economics\n  const calculations = React.useMemo(() => {\n    const inv = Math.max(1, investmentAmount)\n    const cap = Math.max(1, valuationCap)\n    const shares = Math.max(1, companyCapitalization)\n    const seriesA = Math.max(1, seriesAPreMoney)\n    const disc = hasDiscount ? Math.max(0, Math.min(99, discountRate)) : 0\n\n    // Series A unqualified price per share\n    const seriesAPricePerShare = seriesA / shares\n\n    // Cap conversion price per share\n    const capPricePerShare = cap / shares\n\n    // Discount conversion price per share\n    const discountPricePerShare = hasDiscount ? seriesAPricePerShare * (1 - disc / 100) : seriesAPricePerShare\n\n    // In YC Post-Money SAFE, investor converts at the lower of Cap Price or Discount Price\n    let conversionPrice = capPricePerShare\n    let governingMechanism: 'cap' | 'discount' = 'cap'\n\n    if (hasDiscount && discountPricePerShare < capPricePerShare) {\n      conversionPrice = discountPricePerShare\n      governingMechanism = 'discount'\n    } else {\n      conversionPrice = capPricePerShare\n      governingMechanism = 'cap'\n    }\n\n    // Converted shares issued\n    const safeShares = conversionPrice > 0 ? Math.round(inv / conversionPrice) : 0\n\n    // Equity percentage calculation\n    const safeOwnershipPct = Math.min(100, Math.max(0, (safeShares / shares) * 100))\n    const founderShares = Math.max(0, shares - safeShares)\n    const founderOwnershipPct = Math.max(0, 100 - safeOwnershipPct)\n\n    // Effective discount achieved vs Series A price\n    const effectiveDiscountPct =\n      seriesAPricePerShare > 0\n        ? Math.max(0, ((seriesAPricePerShare - conversionPrice) / seriesAPricePerShare) * 100)\n        : 0\n\n    // Implied Value of SAFE stake at Series A price\n    const impliedSeriesAValue = safeShares * seriesAPricePerShare\n    const valueGain = Math.max(0, impliedSeriesAValue - inv)\n    const paperRoiMultiple = inv > 0 ? impliedSeriesAValue / inv : 1\n\n    return {\n      seriesAPricePerShare,\n      capPricePerShare,\n      discountPricePerShare,\n      conversionPrice,\n      governingMechanism,\n      safeShares,\n      founderShares,\n      totalShares: shares,\n      safeOwnershipPct,\n      founderOwnershipPct,\n      effectiveDiscountPct,\n      impliedSeriesAValue,\n      valueGain,\n      paperRoiMultiple,\n    }\n  }, [investmentAmount, valuationCap, companyCapitalization, seriesAPreMoney, hasDiscount, discountRate])\n\n  // Sensitivity scenarios across different Series A pre-money valuations\n  const scenarioResults = React.useMemo(() => {\n    const inv = Math.max(1, investmentAmount)\n    const cap = Math.max(1, valuationCap)\n    const shares = Math.max(1, companyCapitalization)\n    const disc = hasDiscount ? Math.max(0, Math.min(99, discountRate)) : 0\n\n    return SCENARIO_VALUATIONS.map((scenarioValuation) => {\n      const seriesAPrice = scenarioValuation / shares\n      const capPrice = cap / shares\n      const discountPrice = hasDiscount ? seriesAPrice * (1 - disc / 100) : seriesAPrice\n\n      let convPrice = capPrice\n      let mechanism = 'Valuation Cap'\n      if (hasDiscount && discountPrice < capPrice) {\n        convPrice = discountPrice\n        mechanism = `Discount (${disc}%)`\n      }\n\n      const issuedShares = convPrice > 0 ? Math.round(inv / convPrice) : 0\n      const ownershipPct = (issuedShares / shares) * 100\n      const effectiveDiscount = seriesAPrice > 0 ? Math.max(0, ((seriesAPrice - convPrice) / seriesAPrice) * 100) : 0\n      const impliedValue = issuedShares * seriesAPrice\n      const isCurrentTarget = scenarioValuation === seriesAPreMoney\n\n      return {\n        valuation: scenarioValuation,\n        seriesAPrice,\n        convPrice,\n        mechanism,\n        issuedShares,\n        ownershipPct,\n        effectiveDiscount,\n        impliedValue,\n        isCurrentTarget,\n      }\n    })\n  }, [investmentAmount, valuationCap, companyCapitalization, hasDiscount, discountRate, seriesAPreMoney])\n\n  const copySummary = React.useCallback(() => {\n    const c = calculations\n    const text = `YC Post-Money SAFE Conversion Summary:\n- Investment Amount: ${fmtCurrency(investmentAmount)}\n- Valuation Cap: ${fmtCurrency(valuationCap)}\n- Series A Target: ${fmtCurrency(seriesAPreMoney)} Pre-Money\n- Investor Ownership: ${fmtPercent(c.safeOwnershipPct)} (${fmtNumber(c.safeShares)} shares)\n- Conversion Price: ${fmtCurrency(c.conversionPrice)} / share (vs Series A ${fmtCurrency(c.seriesAPricePerShare)})\n- Effective Discount: ${fmtPercent(c.effectiveDiscountPct)}\n- Governing Term: ${c.governingMechanism === 'cap' ? 'Valuation Cap' : 'Discount Rate'}`\n\n    navigator.clipboard?.writeText(text)\n    setCopied(true)\n    setTimeout(() => {\n      setCopied(false)\n    }, 2000)\n  }, [calculations, investmentAmount, valuationCap, seriesAPreMoney])\n\n  return (\n    <div\n      data-slot=\"safe-note-calculator\"\n      className={cn('mx-auto w-full max-w-6xl space-y-8 p-4 sm:p-6 lg:p-8', className)}\n    >\n      {/* Header */}\n      <div className=\"flex flex-col items-center gap-4 text-center\">\n        <Badge wrap variant=\"outline\" className=\"gap-1.5 px-3 py-1 text-xs font-medium tracking-wider uppercase\">\n          <Scale className=\"text-primary size-3.5\" />\n          YC Post-Money SAFE v1.1 · Valuation Cap + Discount\n        </Badge>\n        <div className=\"space-y-2\">\n          <h2 className=\"text-foreground text-2xl font-bold tracking-tight sm:text-3xl lg:text-4xl\">\n            Y Combinator Post-Money SAFE Calculator\n          </h2>\n          <p className=\"text-muted-foreground mx-auto max-w-2xl text-sm sm:text-base\">\n            Model founder dilution, investor ownership percentages, and conversion price per share.\n          </p>\n        </div>\n\n        {/* Preset Tabs */}\n        <div className=\"mt-2 flex w-full justify-center\">\n          <Tabs value={selectedPreset} onValueChange={handlePresetChange} className=\"w-full sm:w-auto\">\n            <TabsList variant=\"segmented\" className=\"grid w-full grid-cols-2 sm:flex sm:w-auto\">\n              <TabsTrigger value=\"seed-standard\" className=\"gap-1.5\">\n                <ShieldCheck className=\"size-3.5\" />\n                Standard Seed\n              </TabsTrigger>\n              <TabsTrigger value=\"preseed-safe\" className=\"gap-1.5\">\n                <TrendingUp className=\"size-3.5\" />\n                Pre-Seed SAFE\n              </TabsTrigger>\n              <TabsTrigger value=\"uncapped-discount\" className=\"gap-1.5\">\n                <BadgePercent className=\"size-3.5\" />\n                Uncapped Disc\n              </TabsTrigger>\n              <TabsTrigger value=\"bridge-round\" className=\"gap-1.5\">\n                <Layers className=\"size-3.5\" />\n                Growth Bridge\n              </TabsTrigger>\n            </TabsList>\n          </Tabs>\n        </div>\n      </div>\n\n      {/* 2-Column Calculator Layout */}\n      <div className=\"grid grid-cols-1 gap-8 lg:grid-cols-12 lg:items-start\">\n        {/* Left Input Card */}\n        <div className=\"space-y-6 lg:col-span-7\">\n          <Card>\n            <CardHeader>\n              <CardTitle className=\"flex items-center gap-2\">\n                <DollarSign className=\"text-primary size-5\" />\n                SAFE Terms & Round Inputs\n              </CardTitle>\n              <CardDescription>\n                Configure investment size, valuation cap, optional discount rate, capitalization, and Series A targets.\n              </CardDescription>\n            </CardHeader>\n            <CardContent className=\"space-y-7\">\n              {/* 1. Investment Amount */}\n              <div className=\"space-y-3.5\">\n                <div className=\"flex items-center justify-between gap-4\">\n                  <div>\n                    <span className=\"text-foreground text-sm font-medium\">Investment Amount</span>\n                    <p className=\"text-muted-foreground text-xs\">Total cash invested into the SAFE.</p>\n                  </div>\n                  <div className=\"w-36 sm:w-44\">\n                    <Input\n                      id=\"safe-investment-input\"\n                      type=\"number\"\n                      size=\"small\"\n                      min={25000}\n                      max={10000000}\n                      step={25000}\n                      prefix=\"$\"\n                      value={investmentAmount}\n                      onChange={(e) => setInvestmentAmount(Number(e.target.value) || 0)}\n                    />\n                  </div>\n                </div>\n                <div className=\"pb-5\">\n                  <Slider\n                    value={[investmentAmount]}\n                    min={100000}\n                    max={5000000}\n                    step={25000}\n                    marks={INVESTMENT_MARKS}\n                    tooltip={(val) => `$${val.toLocaleString('en-US')}`}\n                    onValueChange={(val) => setInvestmentAmount(val[0] ?? 0)}\n                  />\n                </div>\n                <div className=\"flex flex-wrap items-center gap-1.5 pt-1\">\n                  <span className=\"text-muted-foreground text-xs\">Quick select:</span>\n                  {[250000, 500000, 1000000, 1500000, 2000000, 3000000].map((amt) => (\n                    <Button\n                      key={amt}\n                      variant=\"outline\"\n                      size=\"sm\"\n                      className=\"h-6 px-2 text-xs\"\n                      onClick={() => setInvestmentAmount(amt)}\n                    >\n                      ${amt >= 1000000 ? `${(amt / 1000000).toFixed(amt % 1000000 === 0 ? 0 : 1)}M` : `${amt / 1000}K`}\n                    </Button>\n                  ))}\n                </div>\n              </div>\n\n              <Separator />\n\n              {/* 2. Post-Money Valuation Cap */}\n              <div className=\"space-y-3.5\">\n                <div className=\"flex items-center justify-between gap-4\">\n                  <div>\n                    <span className=\"text-foreground text-sm font-medium\">Post-Money Valuation Cap</span>\n                    <p className=\"text-muted-foreground text-xs\">Maximum valuation ceiling for conversion.</p>\n                  </div>\n                  <div className=\"w-36 sm:w-44\">\n                    <Input\n                      id=\"safe-cap-input\"\n                      type=\"number\"\n                      size=\"small\"\n                      min={500000}\n                      max={100000000}\n                      step={500000}\n                      prefix=\"$\"\n                      value={valuationCap}\n                      onChange={(e) => setValuationCap(Number(e.target.value) || 0)}\n                    />\n                  </div>\n                </div>\n                <div className=\"pb-5\">\n                  <Slider\n                    value={[valuationCap]}\n                    min={2000000}\n                    max={50000000}\n                    step={500000}\n                    marks={VALUATION_CAP_MARKS}\n                    tooltip={(val) => `$${val.toLocaleString('en-US')}`}\n                    onValueChange={(val) => setValuationCap(val[0] ?? 0)}\n                  />\n                </div>\n                <div className=\"flex flex-wrap items-center gap-1.5 pt-1\">\n                  <span className=\"text-muted-foreground text-xs\">Cap benchmarks:</span>\n                  {[5000000, 8000000, 12000000, 15000000, 20000000, 30000000].map((cap) => (\n                    <Button\n                      key={cap}\n                      variant=\"outline\"\n                      size=\"sm\"\n                      className=\"h-6 px-2 text-xs\"\n                      onClick={() => setValuationCap(cap)}\n                    >\n                      ${(cap / 1000000).toFixed(0)}M\n                    </Button>\n                  ))}\n                </div>\n              </div>\n\n              <Separator />\n\n              {/* 3. Discount Rate Input & Toggle */}\n              <div className=\"space-y-3.5\">\n                <div className=\"flex items-center justify-between gap-4\">\n                  <div className=\"space-y-1\">\n                    <div className=\"flex items-center gap-2\">\n                      <span className=\"text-foreground text-sm font-medium\">Discount Rate Clause</span>\n                      {hasDiscount ? (\n                        <Badge\n                          wrap\n                          variant=\"outline\"\n                          className=\"border-success/20 bg-success/10 text-success text-xs font-normal\"\n                        >\n                          Active\n                        </Badge>\n                      ) : (\n                        <Badge wrap variant=\"outline\" className=\"text-muted-foreground text-xs font-normal\">\n                          Cap Only\n                        </Badge>\n                      )}\n                    </div>\n                    <p className=\"text-muted-foreground text-xs\">\n                      Percentage discount on Series A price if cap is not exceeded.\n                    </p>\n                  </div>\n                  <div className=\"flex flex-wrap items-center gap-3\">\n                    <Switch\n                      checked={hasDiscount}\n                      onCheckedChange={setHasDiscount}\n                      aria-label=\"Toggle discount clause\"\n                    />\n                    {hasDiscount && (\n                      <div className=\"w-24 sm:w-28\">\n                        <Input\n                          id=\"safe-discount-input\"\n                          type=\"number\"\n                          size=\"small\"\n                          min={0}\n                          max={50}\n                          step={1}\n                          suffix=\"%\"\n                          value={discountRate}\n                          onChange={(e) => setDiscountRate(Number(e.target.value) || 0)}\n                        />\n                      </div>\n                    )}\n                  </div>\n                </div>\n\n                {hasDiscount && (\n                  <div className=\"space-y-3 pt-1\">\n                    <div className=\"pb-5\">\n                      <Slider\n                        value={[discountRate]}\n                        min={5}\n                        max={35}\n                        step={1}\n                        marks={DISCOUNT_RATE_MARKS}\n                        tooltip={(val) => `${val}% Discount`}\n                        onValueChange={(val) => setDiscountRate(val[0] ?? 0)}\n                      />\n                    </div>\n                    <div className=\"flex flex-wrap items-center gap-1.5 pt-1\">\n                      <span className=\"text-muted-foreground text-xs\">Standard rates:</span>\n                      {[10, 15, 20, 25, 30].map((rate) => (\n                        <Button\n                          key={rate}\n                          variant={discountRate === rate ? 'default' : 'outline'}\n                          size=\"sm\"\n                          className=\"h-6 px-2 text-xs\"\n                          onClick={() => setDiscountRate(rate)}\n                        >\n                          {rate}%\n                        </Button>\n                      ))}\n                    </div>\n                  </div>\n                )}\n              </div>\n\n              <Separator />\n\n              {/* 4. Company Existing Capitalization */}\n              <div className=\"space-y-3.5\">\n                <div className=\"flex items-center justify-between gap-4\">\n                  <div>\n                    <span className=\"text-foreground text-sm font-medium\">Company Existing Capitalization</span>\n                    <p className=\"text-muted-foreground text-xs\">Total pre-conversion issued shares and option pool.</p>\n                  </div>\n                  <div className=\"w-36 sm:w-44\">\n                    <Input\n                      id=\"safe-shares-input\"\n                      type=\"number\"\n                      size=\"small\"\n                      min={1000000}\n                      max={100000000}\n                      step={500000}\n                      suffix=\"Shares\"\n                      value={companyCapitalization}\n                      onChange={(e) => setCompanyCapitalization(Number(e.target.value) || 0)}\n                    />\n                  </div>\n                </div>\n                <div className=\"flex flex-wrap items-center gap-1.5 pt-1\">\n                  <span className=\"text-muted-foreground text-xs\">Common share counts:</span>\n                  {[5000000, 8000000, 10000000, 12000000, 15000000].map((count) => (\n                    <Button\n                      key={count}\n                      variant={companyCapitalization === count ? 'default' : 'outline'}\n                      size=\"sm\"\n                      className=\"h-6 px-2 text-xs\"\n                      onClick={() => setCompanyCapitalization(count)}\n                    >\n                      {(count / 1000000).toFixed(0)}M Shares\n                    </Button>\n                  ))}\n                </div>\n              </div>\n\n              <Separator />\n\n              {/* 5. Series A Pre-Money Target */}\n              <div className=\"space-y-3.5\">\n                <div className=\"flex items-center justify-between gap-4\">\n                  <div>\n                    <span className=\"text-foreground text-sm font-medium\">Series A Pre-Money Target</span>\n                    <p className=\"text-muted-foreground text-xs\">Target qualified financing equity valuation.</p>\n                  </div>\n                  <div className=\"w-36 sm:w-44\">\n                    <Input\n                      id=\"safe-series-a-input\"\n                      type=\"number\"\n                      size=\"small\"\n                      min={1000000}\n                      max={200000000}\n                      step={1000000}\n                      prefix=\"$\"\n                      value={seriesAPreMoney}\n                      onChange={(e) => setSeriesAPreMoney(Number(e.target.value) || 0)}\n                    />\n                  </div>\n                </div>\n                <div className=\"pb-5\">\n                  <Slider\n                    value={[seriesAPreMoney]}\n                    min={5000000}\n                    max={80000000}\n                    step={1000000}\n                    marks={SERIES_A_MARKS}\n                    tooltip={(val) => `$${val.toLocaleString('en-US')}`}\n                    onValueChange={(val) => setSeriesAPreMoney(val[0] ?? 0)}\n                  />\n                </div>\n                <div className=\"flex flex-wrap items-center gap-1.5 pt-1\">\n                  <span className=\"text-muted-foreground text-xs\">Series A benchmarks:</span>\n                  {[15000000, 20000000, 25000000, 35000000, 50000000, 75000000].map((target) => (\n                    <Button\n                      key={target}\n                      variant=\"outline\"\n                      size=\"sm\"\n                      className=\"h-6 px-2 text-xs\"\n                      onClick={() => setSeriesAPreMoney(target)}\n                    >\n                      ${(target / 1000000).toFixed(0)}M\n                    </Button>\n                  ))}\n                </div>\n              </div>\n            </CardContent>\n          </Card>\n        </div>\n\n        {/* Right Results Card (Sticky on desktop) */}\n        <div className=\"lg:sticky lg:top-8 lg:col-span-5\">\n          <Card className=\"border-border bg-card shadow-xs\">\n            <CardHeader className=\"pb-4\">\n              <div className=\"flex items-center justify-between\">\n                <span className=\"text-muted-foreground text-xs font-semibold tracking-wider uppercase\">\n                  Investor Ownership Stake\n                </span>\n                <Badge\n                  variant=\"secondary\"\n                  className={\n                    calculations.governingMechanism === 'cap'\n                      ? 'bg-primary/10 text-primary border-primary/20 text-xs font-semibold'\n                      : 'border-success/20 bg-success/10 text-success text-xs font-semibold'\n                  }\n                >\n                  {calculations.governingMechanism === 'cap' ? 'Cap Governs' : 'Discount Governs'}\n                </Badge>\n              </div>\n              <div className=\"mt-4\">\n                <div className=\"flex items-baseline gap-2\">\n                  <span className=\"text-foreground text-3xl font-bold tracking-tight tabular-nums sm:text-4xl\">\n                    {fmtPercent(calculations.safeOwnershipPct)}\n                  </span>\n                  <span className=\"text-muted-foreground text-sm font-medium\">Post-SAFE Ownership</span>\n                </div>\n                <p className=\"text-muted-foreground mt-1 text-xs\">\n                  SAFE investor receives{' '}\n                  <span className=\"text-foreground font-semibold tabular-nums\">\n                    {fmtNumber(calculations.safeShares)}\n                  </span>{' '}\n                  shares at conversion.\n                </p>\n              </div>\n            </CardHeader>\n\n            <CardContent className=\"space-y-5\">\n              <Separator />\n\n              {/* Key Economics Metrics Grid */}\n              <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2\">\n                <div className=\"bg-muted/40 rounded-lg border p-3\">\n                  <span className=\"text-muted-foreground block text-xs\">SAFE Conversion Price</span>\n                  <span className=\"text-foreground text-base font-bold tabular-nums\">\n                    {fmtCurrency(calculations.conversionPrice)}\n                  </span>\n                  <span className=\"text-muted-foreground block text-xs tabular-nums\">\n                    vs Series A {fmtCurrency(calculations.seriesAPricePerShare)}\n                  </span>\n                </div>\n\n                <div className=\"bg-muted/40 rounded-lg border p-3\">\n                  <span className=\"text-muted-foreground block text-xs\">Converted Shares Issued</span>\n                  <span className=\"text-foreground text-base font-bold tabular-nums\">\n                    {fmtNumber(calculations.safeShares)}\n                  </span>\n                  <span className=\"text-muted-foreground block text-xs\">Equity units</span>\n                </div>\n\n                <div className=\"bg-muted/40 rounded-lg border p-3\">\n                  <span className=\"text-muted-foreground block text-xs\">Effective Discount</span>\n                  <span className=\"text-success text-success text-base font-bold tabular-nums\">\n                    {fmtPercent(calculations.effectiveDiscountPct)}\n                  </span>\n                  <span className=\"text-muted-foreground block text-xs\">Savings vs Series A</span>\n                </div>\n\n                <div className=\"bg-muted/40 rounded-lg border p-3\">\n                  <span className=\"text-muted-foreground block text-xs\">Implied Series A Value</span>\n                  <span className=\"text-foreground text-base font-bold tabular-nums\">\n                    {fmtCurrencyWhole(calculations.impliedSeriesAValue)}\n                  </span>\n                  <span className=\"text-success text-success block text-xs tabular-nums\">\n                    +{fmtCurrencyWhole(calculations.valueGain)} ({calculations.paperRoiMultiple.toFixed(2)}x)\n                  </span>\n                </div>\n              </div>\n\n              <Separator />\n\n              {/* Visual Equity Distribution Bar */}\n              <div className=\"space-y-2.5\">\n                <div className=\"flex items-center justify-between text-xs font-medium\">\n                  <span className=\"text-foreground\">Founders vs. SAFE Investor</span>\n                  <span className=\"text-muted-foreground tabular-nums\">\n                    {fmtPercent(calculations.founderOwnershipPct)} / {fmtPercent(calculations.safeOwnershipPct)}\n                  </span>\n                </div>\n                <div className=\"bg-muted relative flex h-3 w-full overflow-hidden rounded-full shadow-inner\">\n                  <div\n                    className=\"bg-primary h-full transition-[width] duration-300\"\n                    style={{ width: `${calculations.founderOwnershipPct}%` }}\n                  />\n                  <div\n                    className=\"bg-success h-full transition-[width] duration-300\"\n                    style={{ width: `${calculations.safeOwnershipPct}%` }}\n                  />\n                </div>\n                <div className=\"text-muted-foreground flex flex-col gap-1.5 text-xs sm:flex-row sm:items-center sm:justify-between\">\n                  <div className=\"flex items-center gap-1.5\">\n                    <span className=\"bg-primary size-2 shrink-0 rounded-full\" />\n                    <span>\n                      Founders: {fmtPercent(calculations.founderOwnershipPct)} ({fmtNumber(calculations.founderShares)}{' '}\n                      sh)\n                    </span>\n                  </div>\n                  <div className=\"flex items-center gap-1.5\">\n                    <span className=\"bg-success size-2 shrink-0 rounded-full\" />\n                    <span>\n                      SAFE: {fmtPercent(calculations.safeOwnershipPct)} ({fmtNumber(calculations.safeShares)} sh)\n                    </span>\n                  </div>\n                </div>\n              </div>\n\n              <Separator />\n\n              {/* Post-Conversion Dilution Breakdown Table */}\n              <div className=\"space-y-2\">\n                <span className=\"text-foreground text-xs font-semibold tracking-wider uppercase\">\n                  Post-Conversion Dilution Breakdown\n                </span>\n                <div className=\"overflow-hidden rounded-lg border\">\n                  <div className=\"overflow-x-auto\">\n                    <Table density=\"compact\">\n                      <TableHeader>\n                        <TableRow>\n                          <TableHead className=\"text-xs\">Stakeholder</TableHead>\n                          <TableHead className=\"text-right text-xs\">Ownership</TableHead>\n                          <TableHead className=\"text-right text-xs\">Shares</TableHead>\n                          <TableHead className=\"text-right text-xs\">Implied Value</TableHead>\n                        </TableRow>\n                      </TableHeader>\n                      <TableBody>\n                        <TableRow>\n                          <TableCell className=\"text-xs font-medium\">Founders & Existing</TableCell>\n                          <TableCell className=\"text-right text-xs font-medium tabular-nums\">\n                            {fmtPercent(calculations.founderOwnershipPct)}\n                          </TableCell>\n                          <TableCell className=\"text-right text-xs tabular-nums\">\n                            {fmtNumber(calculations.founderShares)}\n                          </TableCell>\n                          <TableCell className=\"text-right text-xs tabular-nums\">\n                            {fmtCurrencyWhole(calculations.founderShares * calculations.seriesAPricePerShare)}\n                          </TableCell>\n                        </TableRow>\n                        <TableRow>\n                          <TableCell className=\"text-success text-xs font-medium\">SAFE Seed Investors</TableCell>\n                          <TableCell className=\"text-success text-success text-right text-xs font-bold tabular-nums\">\n                            {fmtPercent(calculations.safeOwnershipPct)}\n                          </TableCell>\n                          <TableCell className=\"text-right text-xs font-semibold tabular-nums\">\n                            {fmtNumber(calculations.safeShares)}\n                          </TableCell>\n                          <TableCell className=\"text-right text-xs font-semibold tabular-nums\">\n                            {fmtCurrencyWhole(calculations.impliedSeriesAValue)}\n                          </TableCell>\n                        </TableRow>\n                      </TableBody>\n                      <TableFooter>\n                        <TableRow>\n                          <TableCell className=\"text-xs font-bold\">Total Post-SAFE</TableCell>\n                          <TableCell className=\"text-right text-xs font-bold tabular-nums\">100.00%</TableCell>\n                          <TableCell className=\"text-right text-xs font-bold tabular-nums\">\n                            {fmtNumber(calculations.totalShares)}\n                          </TableCell>\n                          <TableCell className=\"text-right text-xs font-bold tabular-nums\">\n                            {fmtCurrencyWhole(seriesAPreMoney)}\n                          </TableCell>\n                        </TableRow>\n                      </TableFooter>\n                    </Table>\n                  </div>\n                </div>\n              </div>\n\n              <Separator />\n\n              {/* Key SAFE Takeaways Checklist */}\n              <ul className=\"text-muted-foreground space-y-2 text-xs\">\n                <li className=\"flex items-center gap-2\">\n                  <CheckCircle2 className=\"text-primary size-3.5 shrink-0\" />\n                  <span>Post-money cap fixes ownership before Series A round</span>\n                </li>\n                <li className=\"flex items-center gap-2\">\n                  <CheckCircle2 className=\"text-primary size-3.5 shrink-0\" />\n                  <span>Converts to Preferred Stock with investor liquidation preference</span>\n                </li>\n                <li className=\"flex items-center gap-2\">\n                  <CheckCircle2 className=\"text-primary size-3.5 shrink-0\" />\n                  <span>No debt maturity dates, no interest accrual compounding</span>\n                </li>\n              </ul>\n            </CardContent>\n\n            <CardFooter className=\"flex flex-col gap-2.5 pt-2\">\n              <Button className=\"w-full gap-2 font-semibold shadow-xs\" size=\"lg\" onClick={copySummary}>\n                {copied ? <Check className=\"text-success size-4\" /> : <Copy className=\"size-4\" />}\n                {copied ? 'Copied Summary to Clipboard!' : 'Copy Valuation Breakdown'}\n              </Button>\n              <Button variant=\"outline\" className=\"w-full gap-2\" size=\"default\">\n                <FileSpreadsheet className=\"size-4\" />\n                Export Cap Table Summary\n              </Button>\n            </CardFooter>\n          </Card>\n        </div>\n      </div>\n\n      {/* Bottom Section: Series A Valuation Sensitivity Table */}\n      <Card>\n        <CardHeader className=\"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between\">\n          <div>\n            <CardTitle className=\"flex items-center gap-2\">\n              <TrendingUp className=\"text-primary size-5\" />\n              Series A Qualified Financing Sensitivity Matrix\n            </CardTitle>\n            <CardDescription>\n              Simulate how SAFE investor ownership percentage, share price, and conversion mechanism respond across\n              different next-round valuations.\n            </CardDescription>\n          </div>\n        </CardHeader>\n        <CardContent>\n          <div className=\"overflow-x-auto\">\n            <Table density=\"cozy\">\n              <TableHeader>\n                <TableRow>\n                  <TableHead>Series A Valuation</TableHead>\n                  <TableHead className=\"text-right\">Series A Price</TableHead>\n                  <TableHead className=\"text-right\">SAFE Conversion Price</TableHead>\n                  <TableHead>Governing Term</TableHead>\n                  <TableHead className=\"text-right\">Shares Issued</TableHead>\n                  <TableHead className=\"text-right\">SAFE Ownership</TableHead>\n                  <TableHead className=\"text-right\">Effective Savings</TableHead>\n                  <TableHead className=\"text-right\">Implied Stake Value</TableHead>\n                </TableRow>\n              </TableHeader>\n              <TableBody>\n                {scenarioResults.map((row) => (\n                  <TableRow key={row.valuation} className={row.isCurrentTarget ? 'bg-primary/5 font-medium' : ''}>\n                    <TableCell className=\"font-medium\">\n                      <div className=\"flex items-center gap-2\">\n                        <span className=\"tabular-nums\">{fmtCurrencyWhole(row.valuation)}</span>\n                        {row.isCurrentTarget && (\n                          <Badge wrap variant=\"default\" className=\"h-5 px-1.5 text-xs\">\n                            Current Target\n                          </Badge>\n                        )}\n                      </div>\n                    </TableCell>\n                    <TableCell className=\"text-right tabular-nums\">{fmtCurrency(row.seriesAPrice)}</TableCell>\n                    <TableCell className=\"text-foreground text-right font-semibold tabular-nums\">\n                      {fmtCurrency(row.convPrice)}\n                    </TableCell>\n                    <TableCell>\n                      <Badge\n                        variant=\"outline\"\n                        className={\n                          row.mechanism === 'Valuation Cap'\n                            ? 'border-primary/20 bg-primary/10 text-primary text-xs'\n                            : 'border-success/20 bg-success/10 text-success text-xs'\n                        }\n                      >\n                        {row.mechanism}\n                      </Badge>\n                    </TableCell>\n                    <TableCell className=\"text-right tabular-nums\">{fmtNumber(row.issuedShares)}</TableCell>\n                    <TableCell className=\"text-foreground text-right font-bold tabular-nums\">\n                      {fmtPercent(row.ownershipPct)}\n                    </TableCell>\n                    <TableCell className=\"text-success text-success text-right font-medium tabular-nums\">\n                      {fmtPercent(row.effectiveDiscount)}\n                    </TableCell>\n                    <TableCell className=\"text-right font-semibold tabular-nums\">\n                      {fmtCurrencyWhole(row.impliedValue)}\n                    </TableCell>\n                  </TableRow>\n                ))}\n              </TableBody>\n            </Table>\n          </div>\n        </CardContent>\n      </Card>\n\n      {/* Post-Money SAFE Legal & Governance Guide */}\n      <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n        <Card className=\"p-4\">\n          <div className=\"flex items-start gap-3\">\n            <div className=\"bg-primary/10 text-primary mt-0.5 rounded-md p-2\">\n              <ShieldCheck className=\"size-4\" />\n            </div>\n            <div className=\"space-y-1\">\n              <h4 className=\"text-foreground text-sm font-semibold\">Post-Money Cap Protection</h4>\n              <p className=\"text-muted-foreground text-xs leading-relaxed\">\n                Acts as an ownership percentage guarantee for seed investors prior to the priced round, regardless of\n                subsequent SAFE issuances.\n              </p>\n            </div>\n          </div>\n        </Card>\n\n        <Card className=\"p-4\">\n          <div className=\"flex items-start gap-3\">\n            <div className=\"bg-success/10 text-success mt-0.5 rounded-md p-2\">\n              <Percent className=\"size-4\" />\n            </div>\n            <div className=\"space-y-1\">\n              <h4 className=\"text-foreground text-sm font-semibold\">Discount Rate Safety Net</h4>\n              <p className=\"text-muted-foreground text-xs leading-relaxed\">\n                Protects investors if Series A prices below the valuation cap, guaranteeing a 15%–25% discount off the\n                institutional share price.\n              </p>\n            </div>\n          </div>\n        </Card>\n\n        <Card className=\"p-4\">\n          <div className=\"flex items-start gap-3\">\n            <div className=\"bg-warning/10 text-warning mt-0.5 rounded-md p-2\">\n              <PieChart className=\"size-4\" />\n            </div>\n            <div className=\"space-y-1\">\n              <h4 className=\"text-foreground text-sm font-semibold\">Founder Dilution Transparency</h4>\n              <p className=\"text-muted-foreground text-xs leading-relaxed\">\n                YC v1.1 post-money SAFEs dilute only founders and common shareholders, eliminating pre-money SAFE\n                circular dilution surprises.\n              </p>\n            </div>\n          </div>\n        </Card>\n      </div>\n    </div>\n  )\n}\n\nexport default SafeNoteCalculator\n",
      "type": "registry:block",
      "target": "~/components/blocks/SafeNoteCalculator.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/input.json",
    "https://uipkge.dev/r/react/separator.json",
    "https://uipkge.dev/r/react/slider.json",
    "https://uipkge.dev/r/react/switch.json",
    "https://uipkge.dev/r/react/table.json",
    "https://uipkge.dev/r/react/tabs.json"
  ],
  "description": "Y Combinator Post-Money SAFE note valuation, conversion share price, effective discount, and cap table equity dilution simulator with interactive parameter controls and Series A financing sensitivity matrix.",
  "categories": [
    "finance",
    "legal",
    "billing"
  ]
}