{
  "schemaVersion": 1,
  "slug": "cost-of-baby-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "4b2e4be5ceff0e90dfb5ff190cc62e7f528706592ac978bdc4b9fd78a8326c71",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/cost-of-baby-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "T = 365 × n × c + F + C + 12 × I + G",
    "vars": [
      [
        "n",
        "Diapers per day"
      ],
      [
        "c",
        "Cost per diaper"
      ],
      [
        "F",
        "Annual feeding cost (0 / 600 / 1400)"
      ],
      [
        "C",
        "Annual childcare cost (0 / 8400 / 16800 / 33600)"
      ],
      [
        "I",
        "Monthly insurance & medical"
      ],
      [
        "G",
        "One-off gear budget"
      ]
    ],
    "note": "First-year estimate = diapers/day × unit cost × 365 + user-entered annual feeding and childcare budgets + one-time gear + extra monthly insurance/medical cost × 12. Enter USD amounts only; no currency conversion or regional prices are provided.; no regional prices are assumed."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const vals=[Number(diapersPerDay),Number(costPerDiaper),Number(feedingBudget),Number(childcareBudget),Number(gearBudget),Number(insurance)];if(vals.some(v=>!Number.isFinite(v)||v<0)||!Number.isInteger(Number(diapersPerDay)))return{diapers:null,feedingCost:null,childcareCost:null,totalFirstYear:null,monthly:null,__error:'inputError'};const diapers=diapersPerDay*365*costPerDiaper,feedingCost=feedingBudget,childcareCost=childcareBudget,totalFirstYear=diapers+feedingCost+childcareCost+insurance*12+gearBudget;return{diapers,feedingCost,childcareCost,totalFirstYear,monthly:totalFirstYear/12};",
    "inputs": [
      {
        "name": "diapersPerDay",
        "type": "number",
        "default": 8,
        "min": 0,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "costPerDiaper",
        "type": "number",
        "default": 0.28,
        "min": 0,
        "max": 3,
        "step": 0.01,
        "slider": true
      },
      {
        "name": "feedingBudget",
        "type": "number",
        "default": 1400,
        "min": 0,
        "max": 100000,
        "step": 50
      },
      {
        "name": "childcareBudget",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 500000,
        "step": 500
      },
      {
        "name": "gearBudget",
        "type": "number",
        "default": 2000,
        "min": 0,
        "max": 30000,
        "step": 50,
        "slider": true
      },
      {
        "name": "insurance",
        "type": "number",
        "default": 150,
        "min": 0,
        "max": 5000,
        "step": 10,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "diapers",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "feedingCost",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "childcareCost",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "totalFirstYear",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "monthly",
        "precision": 0,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
