{
  "schemaVersion": 1,
  "slug": "puppy-weight-calculator",
  "category": "pets",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "daf809be5b1b8b3a5da869c234ca1ddbf0df41edc02ceca821e7bad0fa7dcfe0",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/puppy-weight-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": "adult weight scenario = current weight/(assumed grown percent/100)",
    "vars": [],
    "note": "Unsupported six-month, twelve-month and maturity-age predictions are no longer produced. This is not a validated veterinary forecast; use breed/parent information and repeated weights with a veterinarian or an evidence-based growth chart."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-31",
    "basis": "This is an explicit weight scenario: adult weight = current weight ÷ your assumed fraction already grown. The initial 50% is illustrative and is not inferred from age, breed size or a growth chart. Age and size are context only. Unsupported six-month, twelve-month and maturity-age predictions are no longer produced. This is not a validated veterinary forecast; use breed/parent information and repeated weights with a veterinarian or an evidence-based growth chart.",
    "limitations": "Unsupported six-month, twelve-month and maturity-age predictions are no longer produced. This is not a validated veterinary forecast; use breed/parent information and repeated weights with a veterinarian or an evidence-based growth chart.",
    "implementationHash": "daf809be5b1b8b3a5da869c234ca1ddbf0df41edc02ceca821e7bad0fa7dcfe0",
    "sources": [
      {
        "name": "WALTHAM — puppy growth charts and their limits",
        "url": "https://www.waltham.com/resources/puppy-growth-charts"
      }
    ],
    "referenceRole": "context"
  },
  "contract": {
    "compute": "try{if(((true)&&(!Number.isFinite(currentWeight)||currentWeight<0.2||currentWeight>200))||((true)&&(!Number.isFinite(ageWeeks)||ageWeeks<1||ageWeeks>78))||((true)&&(!Number.isFinite(assumedGrownPercent)||assumedGrownPercent<1||assumedGrownPercent>100)))throw new Error('inputError');const calculate=function(){const h=(function context() {\n  const DAY=86400000;\n  const own=(o,k)=>Object.prototype.hasOwnProperty.call(o,k);\n  const fail=()=>{throw new Error('inputError');};\n  const num=(v,min=-Infinity,max=Infinity,integer=false)=>{\n    if(!Number.isFinite(v)||v<min||v>max||(integer&&!Number.isInteger(v)))fail();return v;\n  };\n  const choice=(v,values)=>{if(!values.includes(v))fail();return v;};\n  const date=s=>{if(typeof s!=='string'||!/^\\d{4}-\\d{2}-\\d{2}$/.test(s)||s.startsWith('0000'))fail();const d=new Date(s+'T00:00:00Z');if(!Number.isFinite(+d)||d.toISOString().slice(0,10)!==s)fail();return d;};\n  const iso=d=>{if(!Number.isFinite(+d)||d.getUTCFullYear()<1||d.getUTCFullYear()>9999)fail();return d.toISOString().slice(0,10);};\n  const shift=(d,n)=>{const r=new Date(+d+n*DAY);iso(r);return r;};\n  const month=(d,n)=>{const r=new Date(+d);r.setUTCDate(1);r.setUTCMonth(r.getUTCMonth()+n);const end=new Date(+r);end.setUTCMonth(end.getUTCMonth()+1,0);r.setUTCDate(Math.min(d.getUTCDate(),end.getUTCDate()));iso(r);return r;};\n  const weekdays=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];\n  const work=(d,count)=>{let n=Math.floor(count/7)*5;for(let k=0;k<count%7;k++){const w=(d.getUTCDay()+k)%7;if(w!==0&&w!==6)n++;}return n;};\n  const wholeMonths=(a,b)=>{let n=(b.getUTCFullYear()-a.getUTCFullYear())*12+b.getUTCMonth()-a.getUTCMonth();if(n>=0&&+month(a,n)>+b)n--;if(n<0&&+month(a,n)<+b)n++;return n;};\n  return {DAY,own,fail,num,choice,date,iso,shift,month,weekdays,work,wholeMonths};\n})();const result=(function(v,h){\n    const {num,choice}=h;num(v.currentWeight,0.2,200);num(v.ageWeeks,1,78);choice(v.sizeClass,['toy','small','medium','large','giant']);num(v.assumedGrownPercent,1,100);\n    const adultWeight=v.currentWeight/(v.assumedGrownPercent/100);\n    return {adultWeight,adultWeightKg:adultWeight*0.45359237,growthLeft:adultWeight-v.currentWeight,percentGrown:v.assumedGrownPercent,matureAge:null,weightAt6Months:null,weightAt12Months:null,breedHint:null};\n  })({\"currentWeight\":(currentWeight),\"ageWeeks\":(ageWeeks),\"sizeClass\":(sizeClass),\"assumedGrownPercent\":(assumedGrownPercent)},h);return result;};const out=calculate();return Object.fromEntries([\"adultWeight\",\"adultWeightKg\",\"growthLeft\",\"percentGrown\",\"matureAge\"].map(k=>[k,out[k]??null]).concat(Object.entries(out).filter(([k])=>k.startsWith('__'))));}catch(error){return Object.assign(Object.fromEntries([\"adultWeight\",\"adultWeightKg\",\"growthLeft\",\"percentGrown\",\"matureAge\"].map(k=>[k,null])),{__error:error.message==='openingsExceedWallArea'?'openingsExceedWallArea':'inputError'});}",
    "inputs": [
      {
        "name": "currentWeight",
        "type": "number",
        "default": 12,
        "min": 0.2,
        "max": 200,
        "step": 0.1,
        "slider": true,
        "strictRange": true,
        "requiredValue": true
      },
      {
        "name": "ageWeeks",
        "type": "number",
        "default": 14,
        "min": 1,
        "max": 78,
        "step": 0.1,
        "slider": true,
        "strictRange": true,
        "requiredValue": true
      },
      {
        "name": "sizeClass",
        "type": "select",
        "default": "medium",
        "options": [
          {
            "value": "toy"
          },
          {
            "value": "small"
          },
          {
            "value": "medium"
          },
          {
            "value": "large"
          },
          {
            "value": "giant"
          }
        ]
      },
      {
        "type": "number",
        "default": 50,
        "min": 1,
        "max": 100,
        "step": 0.01,
        "strictRange": true,
        "requiredValue": true,
        "advanced": false,
        "name": "assumedGrownPercent"
      }
    ],
    "outputs": [
      {
        "name": "adultWeight",
        "precision": 1,
        "unit": "lb",
        "notation": "auto"
      },
      {
        "name": "adultWeightKg",
        "precision": 1,
        "unit": "kg",
        "notation": "auto"
      },
      {
        "name": "growthLeft",
        "precision": 1,
        "unit": "lb",
        "notation": "auto"
      },
      {
        "name": "percentGrown",
        "precision": 1,
        "unit": "%",
        "notation": "auto"
      },
      {
        "name": "matureAge",
        "precision": 0,
        "unit": "months",
        "optional": true,
        "notation": "auto"
      }
    ],
    "interpret": null
  }
}
