{
  "schemaVersion": 1,
  "slug": "jet-lag-calculator",
  "category": "travel",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "fe826bcc8d190f60a1f146b49a6fc7f86e3df4f8430f3c9e636aabeb4c5cfef2",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/jet-lag-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": "D = Δz ÷ r_d",
    "vars": [
      [
        "D",
        "baseline adaptation estimate (days)"
      ],
      [
        "Δz",
        "time-zone hours crossed"
      ],
      [
        "r_d",
        "average adaptation rate: east 1 h/day; west 1.5 h/day"
      ]
    ],
    "note": "Uses CDC Yellow Book average rates: eastward 1 time-zone hour/day and westward 1.5 hours/day. This is a baseline estimate, not an individual forecast or clinical assessment."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const rate = direction === 'east' ? 1 : 1.5; const adjustmentDays = timezones/rate; const plan = direction === 'east' ? 'Eastward travel shifts the body clock earlier; review destination-time light and sleep guidance' : 'Westward travel shifts the body clock later; review destination-time light and sleep guidance'; const note = isNightFlight === 'yes' ? 'On a night flight, use destination local time as a reference for sleep and activities' : 'Adaptation varies; use destination-time cues and current travel-health guidance'; return { adjustmentDays, plan, note };",
    "inputs": [
      {
        "name": "timezones",
        "type": "number",
        "default": 6,
        "min": 0,
        "max": 14,
        "step": 1,
        "slider": true
      },
      {
        "name": "direction",
        "type": "select",
        "default": "east",
        "options": [
          {
            "value": "east"
          },
          {
            "value": "west"
          }
        ]
      },
      {
        "name": "isNightFlight",
        "type": "select",
        "default": "no",
        "options": [
          {
            "value": "no"
          },
          {
            "value": "yes"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "adjustmentDays",
        "precision": 1,
        "unit": "days"
      },
      {
        "name": "plan",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "note",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
