{
  "schemaVersion": 1,
  "slug": "travel-budget-calculator",
  "category": "travel",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "406aa0a41f2ec6863b7d2a61cb8e883b67e5d6045b3529e313141bea8e33a66f",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/travel-budget-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 = (f₀N + h × (d − 1) + F × N × d + L × d) × (1 + c ÷ 100)",
    "vars": [
      [
        "N",
        "Travelers"
      ],
      [
        "d",
        "Trip days"
      ],
      [
        "f₀",
        "Flights per person"
      ],
      [
        "h",
        "Hotel per night"
      ],
      [
        "F",
        "Food + activities, per person-day"
      ],
      [
        "c",
        "Contingency (%)"
      ]
    ],
    "note": "Flights, food and activities = per-person rate × travellers (and days where applicable); accommodation = nightly rate × max(0, days − 1); local transport = group daily rate × days. Contingency = subtotal × entered percentage. Inputs are USD scenarios, not price forecasts."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const flights = flightsPerPerson*travelers; const nights = Math.max(0, days-1); const accommodation = hotelPerNight*nights; const food = foodPerPersonDay*travelers*days; const activities = activitiesPerPersonDay*travelers*days; const transport = localTransportPerDay*days; const subtotal = flights+accommodation+food+activities+transport; const contingencyAmount = subtotal*contingency/100; const total = subtotal+contingencyAmount; return { flights, accommodation, food, activities, contingencyAmount, total, perPerson: total/travelers, perDay: total/days };",
    "inputs": [
      {
        "name": "travelers",
        "type": "number",
        "default": 2,
        "min": 1,
        "max": 30,
        "step": 1,
        "slider": true
      },
      {
        "name": "days",
        "type": "number",
        "default": 7,
        "min": 1,
        "max": 365,
        "step": 1,
        "slider": true
      },
      {
        "name": "flightsPerPerson",
        "type": "number",
        "default": 450,
        "min": 0,
        "max": 20000,
        "step": 10,
        "slider": true
      },
      {
        "name": "hotelPerNight",
        "type": "number",
        "default": 160,
        "min": 0,
        "max": 5000,
        "step": 5,
        "slider": true
      },
      {
        "name": "foodPerPersonDay",
        "type": "number",
        "default": 55,
        "min": 0,
        "max": 1000,
        "step": 5,
        "slider": true
      },
      {
        "name": "activitiesPerPersonDay",
        "type": "number",
        "default": 35,
        "min": 0,
        "max": 1000,
        "step": 5,
        "slider": true
      },
      {
        "name": "localTransportPerDay",
        "type": "number",
        "default": 20,
        "min": 0,
        "max": 1000,
        "step": 5,
        "slider": true
      },
      {
        "name": "contingency",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 50,
        "step": 1,
        "slider": true,
        "advanced": true
      }
    ],
    "outputs": [
      {
        "name": "total",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "perPerson",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "flights",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "accommodation",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "food",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "activities",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "contingencyAmount",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "perDay",
        "precision": 0,
        "unit": "USD"
      }
    ],
    "interpret": null
  }
}
