use-weather-forecast 0.1.34 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +97 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +97 -57
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/index.ts
|
|
@@ -322,7 +312,7 @@ function WeatherIcon({ condition, ...props }) {
|
|
|
322
312
|
}
|
|
323
313
|
|
|
324
314
|
// src/components/WeatherForecast.tsx
|
|
325
|
-
var import_react2 =
|
|
315
|
+
var import_react2 = require("react");
|
|
326
316
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
327
317
|
var WIND_SPEED_UNIT_LABELS = {
|
|
328
318
|
kmh: "km/h",
|
|
@@ -344,6 +334,24 @@ function formatInZone(instant, timezone, options) {
|
|
|
344
334
|
return new Intl.DateTimeFormat([], options).format(instant);
|
|
345
335
|
}
|
|
346
336
|
}
|
|
337
|
+
function clockParts(instant, timezone) {
|
|
338
|
+
const options = { hour: "numeric", minute: "2-digit", second: "2-digit" };
|
|
339
|
+
const format = (() => {
|
|
340
|
+
try {
|
|
341
|
+
return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || void 0 });
|
|
342
|
+
} catch {
|
|
343
|
+
return new Intl.DateTimeFormat([], options);
|
|
344
|
+
}
|
|
345
|
+
})();
|
|
346
|
+
const parts = format.formatToParts(instant);
|
|
347
|
+
const part = (type) => parts.find((p) => p.type === type)?.value;
|
|
348
|
+
const hour = part("hour");
|
|
349
|
+
const minute = part("minute");
|
|
350
|
+
const second = part("second");
|
|
351
|
+
if (!hour || !minute || !second) return { main: format.format(instant), tail: "" };
|
|
352
|
+
const dayPeriod = part("dayPeriod");
|
|
353
|
+
return { main: `${hour}:${minute}`, tail: `:${second}${dayPeriod ? ` ${dayPeriod}` : ""}` };
|
|
354
|
+
}
|
|
347
355
|
function zoneLabel(instant, timezone) {
|
|
348
356
|
const options = { hour: "numeric", timeZoneName: "short" };
|
|
349
357
|
try {
|
|
@@ -364,9 +372,14 @@ function parseCalendarDate(date) {
|
|
|
364
372
|
if (!year || !month || !day) return new Date(date);
|
|
365
373
|
return new Date(year, month - 1, day);
|
|
366
374
|
}
|
|
367
|
-
function upcomingDayLabel(date
|
|
368
|
-
|
|
369
|
-
|
|
375
|
+
function upcomingDayLabel(date) {
|
|
376
|
+
return parseCalendarDate(date).toLocaleDateString([], { weekday: "short" });
|
|
377
|
+
}
|
|
378
|
+
function upcomingDayDetail(day, windSpeedUnitLabel) {
|
|
379
|
+
const details = [];
|
|
380
|
+
if (day.precipitationSum !== void 0) details.push(`${day.precipitationSum.toFixed(1)} mm`);
|
|
381
|
+
if (day.windSpeedMax !== void 0) details.push(`${day.windSpeedMax.toFixed(1)} ${windSpeedUnitLabel} wind`);
|
|
382
|
+
return details.length > 0 ? details.join(" \xB7 ") : void 0;
|
|
370
383
|
}
|
|
371
384
|
var styles = {
|
|
372
385
|
root: {
|
|
@@ -382,34 +395,45 @@ var styles = {
|
|
|
382
395
|
hours: { display: "flex", gap: 12, overflowX: "auto", paddingBottom: 4 },
|
|
383
396
|
hourCard: { minWidth: 72, textAlign: "center", padding: 8, borderRadius: 8, background: "#f9fafb" },
|
|
384
397
|
dayRow: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 10, padding: "8px 0", borderBottom: "1px solid #f3f4f6" },
|
|
385
|
-
|
|
386
|
-
//
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
//
|
|
399
|
-
//
|
|
398
|
+
// Card-sized: a fixed maximum width with generous, even padding, so the
|
|
399
|
+
// widget reads as a self-contained tile wherever it is dropped in.
|
|
400
|
+
compactRoot: {
|
|
401
|
+
fontFamily: "system-ui, sans-serif",
|
|
402
|
+
display: "flex",
|
|
403
|
+
flexDirection: "column",
|
|
404
|
+
gap: 14,
|
|
405
|
+
padding: 18,
|
|
406
|
+
borderRadius: 16,
|
|
407
|
+
width: "100%",
|
|
408
|
+
maxWidth: 340,
|
|
409
|
+
boxSizing: "border-box"
|
|
410
|
+
},
|
|
411
|
+
// Current conditions stack down the card; the upcoming days sit in a row
|
|
412
|
+
// along the bottom.
|
|
413
|
+
compactBody: { display: "flex", flexDirection: "column", gap: 10 },
|
|
414
|
+
compactCity: { fontSize: 15, fontWeight: 700, lineHeight: 1.2 },
|
|
415
|
+
compactHeader: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 8 },
|
|
416
|
+
compactTemp: { fontSize: 32, fontWeight: 600, lineHeight: 1 },
|
|
417
|
+
// The short-term outlook ("59 deg in 6h") trails the current temperature.
|
|
418
|
+
compactOutlook: { display: "flex", alignItems: "center", gap: 4, fontSize: 12, opacity: 0.75, whiteSpace: "nowrap" },
|
|
419
|
+
compactTime: { fontSize: 26, fontWeight: 600, lineHeight: 1.1 },
|
|
420
|
+
compactSeconds: { fontSize: 13, fontWeight: 500, opacity: 0.6 },
|
|
421
|
+
compactDate: { fontSize: 11, opacity: 0.7, marginTop: 2 },
|
|
422
|
+
compactStats: { display: "flex", flexWrap: "wrap", gap: 14, fontSize: 12, opacity: 0.9 },
|
|
423
|
+
// Three equal columns along the bottom edge, each stacking weekday / icon /
|
|
424
|
+
// high-low so the row stays readable at card width.
|
|
400
425
|
upcoming: {
|
|
401
|
-
flex: "1 1 260px",
|
|
402
426
|
display: "grid",
|
|
403
|
-
gridTemplateColumns: "
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
427
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
428
|
+
gap: 8,
|
|
429
|
+
paddingTop: 12,
|
|
430
|
+
borderTop: "1px solid currentColor",
|
|
431
|
+
borderTopColor: "rgba(128,128,128,0.25)",
|
|
408
432
|
fontSize: 12
|
|
409
433
|
},
|
|
410
|
-
upcomingDay: {
|
|
411
|
-
|
|
412
|
-
|
|
434
|
+
upcomingDay: { display: "flex", flexDirection: "column", alignItems: "center", gap: 4, textAlign: "center" },
|
|
435
|
+
upcomingDayName: { opacity: 0.7, whiteSpace: "nowrap" },
|
|
436
|
+
upcomingTemps: { whiteSpace: "nowrap" },
|
|
413
437
|
compactStat: { display: "flex", alignItems: "center", gap: 4, whiteSpace: "nowrap" },
|
|
414
438
|
unitSwitch: { display: "inline-flex", alignItems: "center", cursor: "pointer", userSelect: "none" },
|
|
415
439
|
rain: { color: "#2563eb", whiteSpace: "nowrap" },
|
|
@@ -466,29 +490,39 @@ function SingleWeatherForecast(props) {
|
|
|
466
490
|
const timezone = data.location?.timezone;
|
|
467
491
|
const currentDate = formatInZone(now, timezone, { weekday: "short", month: "short", day: "numeric" });
|
|
468
492
|
const currentTime = formatInZone(now, timezone, { hour: "numeric", minute: "2-digit", second: "2-digit", timeZoneName: "short" });
|
|
469
|
-
const currentClock =
|
|
493
|
+
const currentClock = clockParts(now, timezone);
|
|
470
494
|
const currentZone = zoneLabel(now, timezone);
|
|
471
495
|
if (props.compact) {
|
|
472
496
|
const forecastBase = new Date(data.current.time);
|
|
473
497
|
const today = data.daily[0];
|
|
474
498
|
const in6Hours = closestHour(data.hourly, new Date(forecastBase.getTime() + 6 * 60 * 60 * 1e3));
|
|
475
499
|
const windSpeedUnitLabel = WIND_SPEED_UNIT_LABELS[props.windSpeedUnit ?? "mph"];
|
|
476
|
-
const upcomingDays = data.daily.slice(1,
|
|
477
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.
|
|
478
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: styles.
|
|
500
|
+
const upcomingDays = data.daily.slice(1, 4);
|
|
501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: props.className, style: { ...styles.compactRoot, ...props.style }, children: [
|
|
502
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: styles.compactBody, children: [
|
|
503
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: styles.compactCity, children: [
|
|
504
|
+
data.location?.city || "Current location",
|
|
505
|
+
data.location?.region ? `, ${data.location.region}` : ""
|
|
506
|
+
] }),
|
|
479
507
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: styles.compactHeader, children: [
|
|
480
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(WeatherIcon, { condition: data.current.icon, width:
|
|
481
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
508
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(WeatherIcon, { condition: data.current.icon, width: 30, height: 30, title: "Current weather" }),
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { style: styles.compactTemp, children: data.current.temperature }),
|
|
510
|
+
renderUnitSwitch(13),
|
|
511
|
+
in6Hours && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: styles.compactOutlook, children: [
|
|
512
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(WeatherIcon, { condition: in6Hours.icon, width: 14, height: 14, title: "In 6 hours" }),
|
|
513
|
+
in6Hours.temperature,
|
|
514
|
+
"\xB0 6h",
|
|
515
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RainBadge, { probability: in6Hours.precipitationProbability, compact: true })
|
|
516
|
+
] })
|
|
517
|
+
] }),
|
|
518
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
519
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: styles.compactTime, children: [
|
|
520
|
+
currentClock.main,
|
|
521
|
+
currentClock.tail && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: styles.compactSeconds, children: currentClock.tail })
|
|
522
|
+
] }),
|
|
523
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: styles.compactDate, children: [
|
|
524
|
+
currentDate,
|
|
525
|
+
currentZone ? ` \xB7 ${currentZone}` : ""
|
|
492
526
|
] })
|
|
493
527
|
] }),
|
|
494
528
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: styles.compactStats, children: [
|
|
@@ -503,33 +537,29 @@ function SingleWeatherForecast(props) {
|
|
|
503
537
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: styles.compactStat, children: [
|
|
504
538
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(WindIcon, { width: 16, height: 16, title: "Wind speed" }),
|
|
505
539
|
data.current.windSpeed !== void 0 ? `${Math.round(data.current.windSpeed)} ${windSpeedUnitLabel}` : "\u2014"
|
|
506
|
-
] }),
|
|
507
|
-
in6Hours && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: styles.compactStat, children: [
|
|
508
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(WeatherIcon, { condition: in6Hours.icon, width: 16, height: 16, title: "In 6 hours" }),
|
|
509
|
-
in6Hours.temperature,
|
|
510
|
-
"\xB0 in 6h",
|
|
511
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RainBadge, { probability: in6Hours.precipitationProbability, compact: true })
|
|
512
540
|
] })
|
|
513
541
|
] })
|
|
514
542
|
] }),
|
|
515
|
-
upcomingDays.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: styles.upcoming, children: upcomingDays.map((day
|
|
516
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: styles.
|
|
517
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(WeatherIcon, { condition: day.icon, width:
|
|
543
|
+
upcomingDays.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: styles.upcoming, children: upcomingDays.map((day) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: styles.upcomingDay, title: upcomingDayDetail(day, windSpeedUnitLabel), children: [
|
|
544
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: styles.upcomingDayName, children: upcomingDayLabel(day.date) }),
|
|
545
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(WeatherIcon, { condition: day.icon, width: 18, height: 18 }),
|
|
518
546
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: styles.upcomingTemps, children: [
|
|
519
547
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("strong", { children: [
|
|
520
548
|
day.max,
|
|
521
549
|
"\xB0"
|
|
522
550
|
] }),
|
|
523
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { opacity: 0.
|
|
551
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { opacity: 0.6 }, children: [
|
|
524
552
|
" / ",
|
|
525
553
|
day.min,
|
|
526
554
|
"\xB0"
|
|
527
555
|
] })
|
|
528
556
|
] }),
|
|
529
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.
|
|
530
|
-
|
|
557
|
+
day.precipitationProbabilityMax !== void 0 && day.precipitationProbabilityMax > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { style: { ...styles.rain, fontSize: 11 }, children: [
|
|
558
|
+
day.precipitationProbabilityMax,
|
|
559
|
+
"%"
|
|
560
|
+
] })
|
|
531
561
|
] }, day.date)) })
|
|
532
|
-
] })
|
|
562
|
+
] });
|
|
533
563
|
}
|
|
534
564
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: props.className, style: { ...styles.root, ...props.style }, children: [
|
|
535
565
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/weatherCodes.ts","../src/lib/cache.ts","../src/api/geolocation.ts","../src/api/forecast.ts","../src/hooks/useWeatherForecast.ts","../src/icons/BaseIcon.tsx","../src/icons/weather-icons.tsx","../src/icons/WeatherIcon.tsx","../src/components/WeatherForecast.tsx"],"sourcesContent":["export * from './types';\nexport * from './weatherCodes';\nexport { clearWeatherForecastCache } from './lib/cache';\nexport * from './api/geolocation';\nexport * from './api/forecast';\nexport * from './hooks/useWeatherForecast';\nexport * from './icons/WeatherIcon';\nexport * from './components/WeatherForecast';\n","import type { WeatherCondition } from './types';\n\nexport function getWeatherIcon(code: number, isDay = 1): WeatherCondition {\n if (code === 0) return 'sun';\n if ([1, 2].includes(code)) return isDay ? 'cloud-sun' : 'clouds';\n if (code === 3) return 'clouds';\n if ([45, 48].includes(code)) return 'cloud-fog';\n if ([51, 53, 55, 56, 57].includes(code)) return 'cloud-drizzle';\n if ([61, 63].includes(code)) return 'cloud-showers';\n if ([65, 66, 67, 80, 81, 82].includes(code)) return 'cloud-showers-heavy';\n if ([71, 73, 75, 77, 85, 86].includes(code)) return 'cloud-snow';\n if (code === 95) return 'cloud-bolt';\n if ([96, 99].includes(code)) return 'cloud-hail';\n return 'clouds';\n}\n","const CACHE_PREFIX = 'weather-forecast-cache:';\nconst CACHE_TTL_MS = 30 * 60 * 1000;\n\ntype CacheEntry<T> = {\n timestamp: number;\n data: T;\n};\n\nfunction getStorage(): Storage | null {\n if (typeof window === 'undefined' || !window.localStorage) return null;\n return window.localStorage;\n}\n\n/** Returns the cached value for `key` if it was written within the last 30 minutes. */\nexport function readCachedForecast<T>(key: string): T | null {\n const storage = getStorage();\n if (!storage) return null;\n\n try {\n const raw = storage.getItem(CACHE_PREFIX + key);\n if (!raw) return null;\n\n const entry = JSON.parse(raw) as CacheEntry<T>;\n if (Date.now() - entry.timestamp > CACHE_TTL_MS) {\n storage.removeItem(CACHE_PREFIX + key);\n return null;\n }\n\n return entry.data;\n } catch {\n return null;\n }\n}\n\nexport function writeCachedForecast<T>(key: string, data: T): void {\n const storage = getStorage();\n if (!storage) return;\n\n try {\n const entry: CacheEntry<T> = { timestamp: Date.now(), data };\n storage.setItem(CACHE_PREFIX + key, JSON.stringify(entry));\n } catch {\n // Storage full or unavailable (e.g. private browsing) — safe to ignore,\n // the next call will simply hit the network again.\n }\n}\n\n/** Clears all cached forecasts. Mainly useful for tests/debugging. */\nexport function clearWeatherForecastCache(): void {\n const storage = getStorage();\n if (!storage) return;\n\n for (let i = storage.length - 1; i >= 0; i--) {\n const key = storage.key(i);\n if (key?.startsWith(CACHE_PREFIX)) storage.removeItem(key);\n }\n}\n","import type { WeatherLocation } from '../types';\n\nconst DEFAULT_IP_API_URL = 'https://ipapi.co';\n\ntype IpApiResponse = {\n city?: string;\n region?: string;\n country_name?: string;\n timezone?: string;\n latitude?: number;\n longitude?: number;\n error?: boolean;\n reason?: string;\n};\n\ntype GeoWorkerResponse = {\n city?: string;\n region?: string;\n country?: string;\n timezone?: string;\n latitude?: number | string;\n longitude?: number | string;\n};\n\nexport async function getClientLocation(geoEndpoint?: string, ip?: string): Promise<WeatherLocation> {\n if (geoEndpoint) {\n const url = ip ? `${geoEndpoint}?ip=${encodeURIComponent(ip)}` : geoEndpoint;\n const res = await fetch(url);\n if (!res.ok) throw new Error(`Geolocation worker lookup failed: ${res.status}`);\n const data: GeoWorkerResponse = await res.json();\n\n return {\n city: data.city,\n region: data.region,\n country: data.country,\n timezone: data.timezone,\n latitude: Number(data.latitude),\n longitude: Number(data.longitude),\n };\n }\n\n const res = await fetch(`${DEFAULT_IP_API_URL}/${ip ? `${encodeURIComponent(ip)}/` : ''}json/`);\n if (!res.ok) throw new Error(`ipapi.co lookup failed: ${res.status}`);\n const data: IpApiResponse = await res.json();\n\n if (data.error) {\n throw new Error(`ipapi.co lookup failed: ${data.reason ?? 'unknown error'}`);\n }\n\n return {\n city: data.city,\n region: data.region,\n country: data.country_name,\n timezone: data.timezone,\n latitude: Number(data.latitude),\n longitude: Number(data.longitude),\n };\n}\n","import type { WeatherForecastData, WeatherForecastOptions, WeatherLocation } from '../types';\nimport { getWeatherIcon } from '../weatherCodes';\nimport { getClientLocation } from './geolocation';\nimport { readCachedForecast, writeCachedForecast } from '../lib/cache';\n\nfunction buildUrl(latitude: number, longitude: number, options: WeatherForecastOptions) {\n const params = new URLSearchParams({\n latitude: String(latitude),\n longitude: String(longitude),\n timezone: options.location?.timezone || 'auto',\n temperature_unit: options.temperatureUnit || 'fahrenheit',\n wind_speed_unit: options.windSpeedUnit || 'mph',\n forecast_days: String(options.forecastDays ?? 5),\n forecast_hours: String(options.forecastHours ?? 24),\n current: [\n 'temperature_2m',\n 'weather_code',\n 'is_day',\n 'rain',\n 'showers',\n 'snowfall',\n 'wind_speed_10m',\n ].join(','),\n hourly: [\n 'temperature_2m',\n 'weather_code',\n 'precipitation_probability',\n 'rain',\n 'showers',\n 'snowfall',\n ].join(','),\n daily: [\n 'temperature_2m_max',\n 'temperature_2m_min',\n 'weather_code',\n 'precipitation_probability_max',\n 'precipitation_sum',\n 'wind_speed_10m_max',\n ].join(','),\n });\n\n return `https://api.open-meteo.com/v1/forecast?${params.toString()}`;\n}\n\nexport async function getWeatherForecast(\n options: WeatherForecastOptions = {}\n): Promise<WeatherForecastData> {\n let location: WeatherLocation;\n\n if (typeof options.latitude === 'number' && typeof options.longitude === 'number') {\n location = {\n ...options.location,\n latitude: options.latitude,\n longitude: options.longitude,\n };\n } else {\n location = await getClientLocation(options.geoEndpoint, options.ip);\n }\n\n const url = buildUrl(location.latitude, location.longitude, { ...options, location });\n\n const cached = readCachedForecast<WeatherForecastData>(url);\n if (cached) return cached;\n\n const response = await fetch(url, { headers: { 'Content-Type': 'application/json' } });\n\n if (!response.ok) {\n throw new Error(`Weather request failed: ${response.status} ${response.statusText}`);\n }\n\n const data = await response.json();\n\n if (!data?.current || !data?.hourly || !data?.daily) {\n throw new Error('Invalid weather response');\n }\n\n const result: WeatherForecastData = {\n location: { ...location, timezone: data.timezone || location.timezone },\n current: {\n time: data.current.time,\n temperature: Math.round(data.current.temperature_2m),\n weatherCode: data.current.weather_code,\n icon: getWeatherIcon(data.current.weather_code, data.current.is_day),\n isDay: data.current.is_day,\n rain: data.current.rain,\n showers: data.current.showers,\n snowfall: data.current.snowfall,\n windSpeed: data.current.wind_speed_10m,\n },\n hourly: data.hourly.time.map((time: string, index: number) => ({\n time,\n temperature: Math.round(data.hourly.temperature_2m[index]),\n weatherCode: data.hourly.weather_code[index],\n precipitationProbability: data.hourly.precipitation_probability?.[index],\n rain: data.hourly.rain?.[index],\n showers: data.hourly.showers?.[index],\n snowfall: data.hourly.snowfall?.[index],\n icon: getWeatherIcon(data.hourly.weather_code[index]),\n })),\n daily: data.daily.time.map((date: string, index: number) => ({\n date,\n min: Math.round(data.daily.temperature_2m_min[index]),\n max: Math.round(data.daily.temperature_2m_max[index]),\n weatherCode: data.daily.weather_code[index],\n precipitationProbabilityMax: data.daily.precipitation_probability_max?.[index],\n precipitationSum: data.daily.precipitation_sum?.[index],\n windSpeedMax: data.daily.wind_speed_10m_max?.[index],\n icon: getWeatherIcon(data.daily.weather_code[index]),\n })),\n };\n\n writeCachedForecast(url, result);\n return result;\n}\n","import { useEffect, useState } from 'react';\nimport type { WeatherForecastData, WeatherForecastOptions } from '../types';\nimport { getWeatherForecast } from '../api/forecast';\n\nexport function useWeatherForecast(options: WeatherForecastOptions = {}) {\n const [data, setData] = useState<WeatherForecastData | null>(null);\n const [error, setError] = useState<Error | null>(null);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n let active = true;\n setLoading(true);\n setError(null);\n\n getWeatherForecast(options)\n .then((result) => { if (active) setData(result); })\n .catch((err) => { if (active) setError(err instanceof Error ? err : new Error('Unknown error')); })\n .finally(() => { if (active) setLoading(false); });\n\n return () => { active = false; };\n }, [\n options.latitude,\n options.longitude,\n options.geoEndpoint,\n options.ip,\n options.forecastDays,\n options.forecastHours,\n options.temperatureUnit,\n options.windSpeedUnit,\n options.location?.timezone,\n ]);\n\n return { data, error, loading };\n}\n","import React from 'react';\nimport type { IconProps } from '../types';\n\nexport function BaseIcon({ title, children, ...props }: IconProps & { children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={title ? 'img' : 'presentation'}\n aria-hidden={title ? undefined : true}\n aria-label={title}\n {...props}\n >\n {title ? <title>{title}</title> : null}\n {children}\n </svg>\n );\n}\n","import React from 'react';\nimport type { IconProps } from '../types';\nimport { BaseIcon } from './BaseIcon';\n\nexport const CloudBoltIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M7 18a4.815 4.815 0 0 1-3.327-1.318A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 0 7h-1m-4.75-5L11 17.5h3.375l-2.25 4.5\" /></BaseIcon>\n);\nexport const CloudDrizzleIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M12 18v1m-3-4v1m6-1v1m2 3v1M7 19v1m-3-3.034a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662\" /></BaseIcon>\n);\nexport const CloudFogIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M5 21h7m4 0h3M8 17h8\" /></BaseIcon>\n);\nexport const CloudHailIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8 17.45v.1m-1.5 3.9v.1m10.5-4.1v.1m-1.5 3.9v.1m-3-4.1v.1m-1.5 3.9v.1m10.475-4.575A3.5 3.5 0 0 0 19 11h-1c.146-.65.148-1.32.006-1.97a4.784 4.784 0 0 0-.831-1.823 5.36 5.36 0 0 0-1.544-1.398 5.964 5.964 0 0 0-2.02-.759 6.224 6.224 0 0 0-2.19-.006 5.971 5.971 0 0 0-2.024.749C8.157 6.533 7.295 7.687 7 9a4.815 4.815 0 0 0-3.327 1.318A4.403 4.403 0 0 0 2.295 13.5c0 1.194.496 2.338 1.378 3.182.105.1.214.195.327.284m4.5.534a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm10.5-4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-3-4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z\" /></BaseIcon>\n);\nexport const CloudShowersIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M12 13v2m0 3v2m4-5v2m0 3v2m-8-7v2m0 3v2\" /></BaseIcon>\n);\nexport const CloudShowersHeavyIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M16 15v6m-8-6v6m4-8v6\" /></BaseIcon>\n);\nexport const CloudSleetIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M13.5 17.45a1 1 0 1 0-2 0h2Zm-2 .1a1 1 0 1 0 2 0h-2Zm.5 3.9a1 1 0 1 0-2 0h2Zm-2 .1a1 1 0 1 0 2 0h-2Zm-6.327-4.868.692-.723-.692.723ZM7 9v1a1 1 0 0 0 .976-.781L7 9Zm2.397-3.207.512.858-.512-.858ZM18 11l-.976-.219A1 1 0 0 0 18 12v-1Zm2.768 5.268a1 1 0 0 0 1.414 1.414l-.707-.707-.707-.707ZM3.379 17.75a1 1 0 0 0 1.242-1.567L4 16.966l-.62.784Zm5.55-.379a1 1 0 0 0-1.857-.742L8 17l.928.371ZM5.071 21.63a1 1 0 0 0 1.856.742L6 22l-.928-.371Zm13.857-4.258a1 1 0 0 0-1.857-.742L18 17l.928.371Zm-3.857 4.258a1 1 0 0 0 1.857.742L16 22l-.928-.371ZM13 17.5h-1a.5.5 0 0 1 .5-.5v2a1.5 1.5 0 0 0 1.5-1.5h-1Zm-.5.5v-1a.5.5 0 0 1 .5.5h-2a1.5 1.5 0 0 0 1.5 1.5v-1Zm-.5-.5h1a.5.5 0 0 1-.5.5v-2a1.5 1.5 0 0 0-1.5 1.5h1Zm.5-.5v1a.5.5 0 0 1-.5-.5h2a1.5 1.5 0 0 0-1.5-1.5v1Zm0 .45h-1v.1h2v-.1h-1Zm-1 4.05h-1a.5.5 0 0 1 .5-.5v2a1.5 1.5 0 0 0 1.5-1.5h-1Zm-.5.5v-1a.5.5 0 0 1 .5.5h-2A1.5 1.5 0 0 0 11 23v-1Zm-.5-.5h1a.5.5 0 0 1-.5.5v-2a1.5 1.5 0 0 0-1.5 1.5h1Zm.5-.5v1a.5.5 0 0 1-.5-.5h2A1.5 1.5 0 0 0 11 20v1Zm0 .45h-1v.1h2v-.1h-1Zm-7.327-4.768.692-.723a3.403 3.403 0 0 1-1.07-2.459h-2c0 1.473.613 2.877 1.687 3.905l.691-.723ZM2.295 13.5h1c0-.914.38-1.8 1.07-2.46l-.692-.722-.69-.723A5.403 5.403 0 0 0 1.294 13.5h1Zm1.378-3.182.692.723A3.815 3.815 0 0 1 7 10V8c-1.499 0-2.945.57-4.018 1.595l.691.723ZM7 9l.976.219c.23-1.024.91-1.956 1.933-2.568l-.512-.858-.513-.859c-1.456.87-2.5 2.245-2.86 3.847L7 9Zm2.397-3.207.512.858a4.972 4.972 0 0 1 1.686-.622l-.173-.985-.174-.985a6.971 6.971 0 0 0-2.364.875l.513.859Zm2.025-.749.173.985a5.223 5.223 0 0 1 1.837.005l.18-.984.178-.984a7.223 7.223 0 0 0-2.542-.007l.174.985Zm2.19.006-.18.984c.606.11 1.177.326 1.681.631l.518-.856.518-.855a6.963 6.963 0 0 0-2.359-.888l-.179.984Zm2.02.76-.519.855c.505.305.93.693 1.257 1.136l.805-.594.805-.594a6.361 6.361 0 0 0-1.831-1.659l-.518.855Zm1.543 1.397-.805.594c.326.442.549.932.66 1.441l.976-.212.978-.213a5.786 5.786 0 0 0-1.005-2.204l-.804.594Zm.831 1.823-.977.212c.111.509.11 1.031-.005 1.539L18 11l.976.219c.178-.792.18-1.609.008-2.402l-.978.213ZM18 11v1h1v-2h-1v1Zm1 0v1a2.5 2.5 0 0 1 1.768.732l.707-.707.707-.707A4.5 4.5 0 0 0 19 10v1Zm2.475 1.025-.707.707A2.5 2.5 0 0 1 21.5 14.5h2a4.5 4.5 0 0 0-1.318-3.182l-.707.707ZM22.5 14.5h-1a2.5 2.5 0 0 1-.732 1.768l.707.707.707.707A4.5 4.5 0 0 0 23.5 14.5h-1ZM4 16.966l.62-.784a3.684 3.684 0 0 1-.255-.223l-.692.723-.69.723c.126.121.259.237.396.345L4 16.966ZM8 17l-.928-.371-2 5L6 22l.928.371 2-5L8 17Zm10 0-.928-.371-2 5L16 22l.928.371 2-5L18 17Z\" /></BaseIcon>\n);\nexport const CloudSnowIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8 15h2m-1-1v2m5-1h2m-1-1v2M5 21h2m-1-1v2m5-2h2m-1-1v2m5 0h2m-1-1v2M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662\" /></BaseIcon>\n);\nexport const CloudSunIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M10.201 19.997c-1.977 0-3.58-1.544-3.58-3.448 0-1.903 1.603-3.446 3.58-3.446.303-1.355 1.38-2.461 2.827-2.902 1.445-.44 3.042-.148 4.186.77 1.144.915 1.663 2.312 1.361 3.667h.761c1.472 0 2.664 1.2 2.664 2.68A2.672 2.672 0 0 1 19.336 20h-9.134m2.66-12.934a4.166 4.166 0 0 0-2.677-1.732m2.677 1.732 2.744-1.892m-2.744 1.892c.55.796.802 1.754.723 2.709m-3.4-4.44a4.167 4.167 0 0 0-3.118.667m3.118-.668.602-3.278m-3.72 3.946A4.167 4.167 0 0 0 5.334 8.68m1.733-2.678L5.174 3.26m.16 5.42c-.2 1.088.041 2.21.669 3.12m-.669-3.12-3.278-.601m3.947 3.72-2.744 1.893m2.744-1.893a4.167 4.167 0 0 0 2.174 1.607\" /></BaseIcon>\n);\nexport const CloudsIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8.958 21.05C6.772 21.05 5 19.344 5 17.24s1.772-3.81 3.958-3.81c.335-1.498 1.525-2.72 3.124-3.207 1.598-.487 3.363-.164 4.628.85 1.264 1.011 1.837 2.556 1.504 4.053h.842A2.953 2.953 0 0 1 22 18.09a2.954 2.954 0 0 1-2.945 2.964H8.958M18 8c-.5-2.5-3.532-3.401-5.5-2.5a3.117 3.117 0 0 0-2.11-2.312c-1.352-.411-2.845-.138-3.915.72-1.07.855-1.554 2.161-1.273 3.428h-.711A2.498 2.498 0 0 0 2 9.843c0 1.094.695 2.023 1.666 2.366\" /></BaseIcon>\n);\nexport const SnowflakeIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"m9.25 4-1 2H6m-2.25 4L5 12m0 0-1.25 2M5 12h3m-3 0H2.5m17.75-2L19 12l1.25 2M6 18h2.25l1 2M14 9h-4m4 0 3-5m-3 5 2 3m-6-3L7 4m3 5-2 3m0 0 2 3m0 0-3 5m3-5h4m2-3-2 3m2-3h5.5M14 15l3 5M14.75 4l1 2H18m0 12h-2.25l-1 2\" /></BaseIcon>\n);\nexport const SunIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M12 4V2m0 20v-2m10-8h-2M4 12H2m15.657-5.657 1.414-1.414M4.93 19.07l1.414-1.414m12.728 1.414-1.414-1.414M6.343 6.343 4.93 4.929M7 12a5 5 0 1 0 10 0 5 5 0 0 0-10 0Z\" /></BaseIcon>\n);\nexport const WindIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2\" /></BaseIcon>\n);\n","import React from 'react';\nimport type { IconProps, WeatherCondition } from '../types';\nimport {\n CloudBoltIcon,\n CloudDrizzleIcon,\n CloudFogIcon,\n CloudHailIcon,\n CloudShowersHeavyIcon,\n CloudShowersIcon,\n CloudSleetIcon,\n CloudSnowIcon,\n CloudSunIcon,\n CloudsIcon,\n SnowflakeIcon,\n SunIcon,\n} from './weather-icons';\n\nconst iconMap: Record<WeatherCondition, React.ComponentType<IconProps>> = {\n sun: SunIcon,\n 'cloud-sun': CloudSunIcon,\n clouds: CloudsIcon,\n 'cloud-fog': CloudFogIcon,\n 'cloud-drizzle': CloudDrizzleIcon,\n 'cloud-showers': CloudShowersIcon,\n 'cloud-showers-heavy': CloudShowersHeavyIcon,\n 'cloud-sleet': CloudSleetIcon,\n 'cloud-snow': CloudSnowIcon,\n snowflake: SnowflakeIcon,\n 'cloud-bolt': CloudBoltIcon,\n 'cloud-hail': CloudHailIcon,\n};\n\nexport function WeatherIcon({ condition, ...props }: IconProps & { condition: WeatherCondition }) {\n const Icon = iconMap[condition] || CloudsIcon;\n return <Icon {...props} />;\n}\n","import React, { useEffect, useState } from 'react';\nimport { useWeatherForecast } from '../hooks/useWeatherForecast';\nimport type { HourlyWeather, TemperatureUnit, WeatherForecastOptions, WindSpeedUnit } from '../types';\nimport { WeatherIcon } from '../icons/WeatherIcon';\nimport { WindIcon } from '../icons/weather-icons';\n\ntype Props = WeatherForecastOptions & {\n className?: string;\n style?: React.CSSProperties;\n compact?: boolean;\n};\n\nconst WIND_SPEED_UNIT_LABELS: Record<WindSpeedUnit, string> = {\n kmh: 'km/h',\n mph: 'mph',\n ms: 'm/s',\n kn: 'kn',\n};\n\nfunction closestHour(hourly: HourlyWeather[], targetTime: Date): HourlyWeather | undefined {\n return hourly.reduce<HourlyWeather | undefined>((closest, hour) => {\n const diff = Math.abs(new Date(hour.time).getTime() - targetTime.getTime());\n const closestDiff = closest ? Math.abs(new Date(closest.time).getTime() - targetTime.getTime()) : Infinity;\n return diff < closestDiff ? hour : closest;\n }, undefined);\n}\n\n// Format a real instant in a specific IANA timezone, falling back to the\n// browser's local zone if the timezone string is missing or invalid.\nfunction formatInZone(instant: Date, timezone: string | undefined, options: Intl.DateTimeFormatOptions): string {\n try {\n return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || undefined }).format(instant);\n } catch {\n return new Intl.DateTimeFormat([], options).format(instant);\n }\n}\n\n// Just the zone abbreviation (e.g. \"GMT+2\"), so it can be shown apart from the\n// clock itself.\nfunction zoneLabel(instant: Date, timezone: string | undefined): string {\n const options: Intl.DateTimeFormatOptions = { hour: 'numeric', timeZoneName: 'short' };\n try {\n const format = (() => {\n try {\n return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || undefined });\n } catch {\n return new Intl.DateTimeFormat([], options);\n }\n })();\n return format.formatToParts(instant).find((part) => part.type === 'timeZoneName')?.value ?? '';\n } catch {\n return '';\n }\n}\n\n// Daily dates arrive as plain \"YYYY-MM-DD\" calendar days; `new Date(...)` would\n// read those as UTC midnight and roll back a day in western timezones, so build\n// the date from its parts and let it stay a local calendar day.\nfunction parseCalendarDate(date: string): Date {\n const [year, month, day] = date.split('-').map(Number);\n if (!year || !month || !day) return new Date(date);\n return new Date(year, month - 1, day);\n}\n\n// The day right after today reads better as \"Tomorrow\" than as its weekday.\nfunction upcomingDayLabel(date: string, offsetFromToday: number): string {\n if (offsetFromToday === 1) return 'Tomorrow';\n return parseCalendarDate(date).toLocaleDateString([], { weekday: 'long' });\n}\n\nconst styles = {\n root: {\n fontFamily: 'system-ui, sans-serif',\n border: '1px solid #e5e7eb',\n borderRadius: 12,\n padding: 16,\n background: '#fff',\n color: '#111827',\n maxWidth: 640,\n } as React.CSSProperties,\n row: { display: 'flex', alignItems: 'center', gap: 8 } as React.CSSProperties,\n hours: { display: 'flex', gap: 12, overflowX: 'auto', paddingBottom: 4 } as React.CSSProperties,\n hourCard: { minWidth: 72, textAlign: 'center' as const, padding: 8, borderRadius: 8, background: '#f9fafb' },\n dayRow: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 10, padding: '8px 0', borderBottom: '1px solid #f3f4f6' } as React.CSSProperties,\n compactRoot: { fontFamily: 'system-ui, sans-serif', display: 'flex', flexDirection: 'column', gap: 8, padding: '10px 14px', borderRadius: 8 } as React.CSSProperties,\n // Current conditions on the left, upcoming days on the right; both columns\n // wrap to full width when the widget is too narrow to hold them side by side.\n compactBody: { display: 'flex', flexWrap: 'wrap', alignItems: 'flex-start', gap: 12 } as React.CSSProperties,\n compactCurrent: { flex: '1 1 45%', minWidth: 140, display: 'flex', flexDirection: 'column', gap: 8 } as React.CSSProperties,\n compactHeader: { display: 'flex', alignItems: 'center', gap: 10 } as React.CSSProperties,\n compactHeaderText: { display: 'flex', alignItems: 'baseline', gap: 8, flexWrap: 'wrap' } as React.CSSProperties,\n compactTime: { fontSize: 18, fontWeight: 600, lineHeight: 1.15 } as React.CSSProperties,\n compactDate: { fontSize: 11, opacity: 0.7 } as React.CSSProperties,\n compactStats: { display: 'flex', flexWrap: 'wrap', gap: 12, fontSize: 12, opacity: 0.9 } as React.CSSProperties,\n // A shared grid keeps the day / icon / temps / rain / wind columns aligned\n // across every upcoming row.\n // Columns are content-sized (so no column can be squeezed away) and the spare\n // width is spread between them; that also makes the grid's min-content width\n // large enough to wrap below the current conditions on narrow screens.\n upcoming: {\n flex: '1 1 260px',\n display: 'grid',\n gridTemplateColumns: 'auto auto auto auto auto',\n justifyContent: 'space-between',\n alignItems: 'center',\n columnGap: 10,\n rowGap: 6,\n fontSize: 12,\n } as React.CSSProperties,\n upcomingDay: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', opacity: 0.85 } as React.CSSProperties,\n upcomingTemps: { whiteSpace: 'nowrap', textAlign: 'right' } as React.CSSProperties,\n upcomingMetric: { whiteSpace: 'nowrap', textAlign: 'right', opacity: 0.7 } as React.CSSProperties,\n compactStat: { display: 'flex', alignItems: 'center', gap: 4, whiteSpace: 'nowrap' } as React.CSSProperties,\n unitSwitch: { display: 'inline-flex', alignItems: 'center', cursor: 'pointer', userSelect: 'none' } as React.CSSProperties,\n rain: { color: '#2563eb', whiteSpace: 'nowrap' } as React.CSSProperties,\n tz: { fontSize: 12, opacity: 0.7, marginTop: 2 } as React.CSSProperties,\n list: { display: 'flex', flexDirection: 'column' } as React.CSSProperties,\n};\n\n// Precipitation chance is only surfaced when there is a non-zero chance of it.\nfunction RainBadge({ probability, compact }: { probability?: number; compact?: boolean }) {\n if (probability === undefined || probability === null || probability <= 0) return null;\n return <span style={styles.rain}>{compact ? ` · ${probability}%` : ` · ${probability}% rain`}</span>;\n}\n\n/**\n * Renders one location's forecast: a live current time (ticking, in the\n * location's own timezone), a clickable degF / degC unit switch, high/low and\n * precipitation for the next hours and days.\n */\nfunction SingleWeatherForecast(props: Props) {\n // Temperature unit is local state so the degF / degC switch can toggle it;\n // it is seeded from (and re-synced to) the temperatureUnit prop.\n const [unit, setUnit] = useState<TemperatureUnit>(props.temperatureUnit ?? 'fahrenheit');\n useEffect(() => {\n setUnit(props.temperatureUnit ?? 'fahrenheit');\n }, [props.temperatureUnit]);\n\n const { data, loading, error } = useWeatherForecast({ ...props, temperatureUnit: unit });\n\n // A ticking clock so the displayed current time stays accurate to the second.\n const [now, setNow] = useState(() => new Date());\n useEffect(() => {\n const id = setInterval(() => setNow(new Date()), 1000);\n return () => clearInterval(id);\n }, []);\n\n const toggleUnit = () => setUnit((u) => (u === 'celsius' ? 'fahrenheit' : 'celsius'));\n\n const renderUnitSwitch = (fontSize: number) => (\n <span\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation();\n toggleUnit();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggleUnit();\n }\n }}\n title=\"Switch temperature units\"\n aria-label={`Switch temperature units, currently ${unit === 'celsius' ? 'Celsius' : 'Fahrenheit'}`}\n style={{ ...styles.unitSwitch, fontSize }}\n >\n <span style={{ fontWeight: unit === 'fahrenheit' ? 700 : 400, opacity: unit === 'fahrenheit' ? 1 : 0.45 }}>°F</span>\n <span style={{ opacity: 0.4, margin: '0 3px' }}>|</span>\n <span style={{ fontWeight: unit === 'celsius' ? 700 : 400, opacity: unit === 'celsius' ? 1 : 0.45 }}>°C</span>\n </span>\n );\n\n // Keep showing the last forecast while a unit switch refetches in the\n // background; only suppress output on the very first load.\n if (loading && !data) return null;\n if (error) return <div className={props.className} style={props.style}>Error: {error.message}</div>;\n if (!data) return <div className={props.className} style={props.style}>No forecast available.</div>;\n\n const timezone = data.location?.timezone;\n const currentDate = formatInZone(now, timezone, { weekday: 'short', month: 'short', day: 'numeric' });\n const currentTime = formatInZone(now, timezone, { hour: 'numeric', minute: '2-digit', second: '2-digit', timeZoneName: 'short' });\n // The compact layout shows the clock at a larger size, so the zone label is\n // split off onto the smaller date line to keep the time on one line.\n const currentClock = formatInZone(now, timezone, { hour: 'numeric', minute: '2-digit', second: '2-digit' });\n const currentZone = zoneLabel(now, timezone);\n\n if (props.compact) {\n const forecastBase = new Date(data.current.time);\n const today = data.daily[0];\n const in6Hours = closestHour(data.hourly, new Date(forecastBase.getTime() + 6 * 60 * 60 * 1000));\n const windSpeedUnitLabel = WIND_SPEED_UNIT_LABELS[props.windSpeedUnit ?? 'mph'];\n // Today already has its own column on the left, so the upcoming list starts\n // at tomorrow and stays short enough to sit beside it.\n const upcomingDays = data.daily.slice(1, 5);\n\n return (\n <div className={props.className} style={{ ...styles.compactRoot, ...props.style }}>\n <div style={styles.compactBody}>\n <div style={styles.compactCurrent}>\n <div style={styles.compactHeader}>\n <WeatherIcon condition={data.current.icon} width={24} height={24} title=\"Current weather\" />\n <div>\n <div style={styles.compactHeaderText}>\n <strong style={{ fontSize: 16 }}>{data.current.temperature}</strong>\n {renderUnitSwitch(12)}\n <span style={{ fontSize: 14, opacity: 0.8 }}>\n {data.location?.city || 'Current location'}\n </span>\n </div>\n <div style={styles.compactTime}>{currentClock}</div>\n <div style={styles.compactDate}>\n {currentDate}\n {currentZone ? ` · ${currentZone}` : ''}\n </div>\n </div>\n </div>\n\n <div style={styles.compactStats}>\n {today && (\n <span style={styles.compactStat}>\n <WeatherIcon condition={today.icon} width={16} height={16} title=\"Today's high and low\" />\n {today.max}° / {today.min}°\n <RainBadge probability={today.precipitationProbabilityMax} compact />\n </span>\n )}\n <span style={styles.compactStat}>\n <WindIcon width={16} height={16} title=\"Wind speed\" />\n {data.current.windSpeed !== undefined ? `${Math.round(data.current.windSpeed)} ${windSpeedUnitLabel}` : '—'}\n </span>\n {in6Hours && (\n <span style={styles.compactStat}>\n <WeatherIcon condition={in6Hours.icon} width={16} height={16} title=\"In 6 hours\" />\n {in6Hours.temperature}° in 6h\n <RainBadge probability={in6Hours.precipitationProbability} compact />\n </span>\n )}\n </div>\n </div>\n\n {upcomingDays.length > 0 && (\n <div style={styles.upcoming}>\n {upcomingDays.map((day, index) => (\n <React.Fragment key={day.date}>\n <span style={styles.upcomingDay}>{upcomingDayLabel(day.date, index + 1)}</span>\n <WeatherIcon condition={day.icon} width={16} height={16} />\n <span style={styles.upcomingTemps}>\n <strong>{day.max}°</strong>\n <span style={{ opacity: 0.7 }}> / {day.min}°</span>\n </span>\n <span style={styles.upcomingMetric}>\n {day.precipitationSum !== undefined ? `${day.precipitationSum.toFixed(1)} mm` : '—'}\n </span>\n <span style={styles.upcomingMetric}>\n {day.windSpeedMax !== undefined ? `${day.windSpeedMax.toFixed(1)} ${windSpeedUnitLabel}` : '—'}\n </span>\n </React.Fragment>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n }\n\n return (\n <div className={props.className} style={{ ...styles.root, ...props.style }}>\n <div>\n <h3 style={{ margin: 0, fontSize: 20 }}>\n {data.location?.city || 'Current location'}\n {data.location?.region ? `, ${data.location.region}` : ''}\n </h3>\n <div style={styles.tz}>\n {currentDate} · {currentTime}\n {timezone ? ` · ${timezone}` : ''}\n </div>\n <div style={{ ...styles.row, marginTop: 8 }}>\n <WeatherIcon condition={data.current.icon} width={28} height={28} title=\"Current weather\" />\n <strong style={{ fontSize: 28 }}>{data.current.temperature}</strong>\n {renderUnitSwitch(14)}\n </div>\n </div>\n\n <div style={{ marginTop: 20 }}>\n <h4 style={{ margin: '0 0 10px 0' }}>Next hours</h4>\n <div style={styles.hours}>\n {data.hourly.slice(0, props.forecastHours ?? 12).map((hour) => (\n <div key={hour.time} style={styles.hourCard}>\n <div style={{ fontSize: 12 }}>{new Date(hour.time).toLocaleTimeString([], { hour: 'numeric' })}</div>\n <WeatherIcon condition={hour.icon} width={20} height={20} style={{ margin: '6px auto' }} />\n <div>{hour.temperature}°</div>\n {hour.precipitationProbability !== undefined && hour.precipitationProbability > 0 && (\n <div style={{ ...styles.rain, fontSize: 12 }}>{hour.precipitationProbability}%</div>\n )}\n </div>\n ))}\n </div>\n </div>\n\n <div style={{ marginTop: 20 }}>\n <h4 style={{ margin: '0 0 10px 0' }}>Next days</h4>\n <div>\n {data.daily.map((day) => (\n <div key={day.date} style={styles.dayRow}>\n <div style={{ width: 120 }}>{new Date(day.date).toLocaleDateString([], { weekday: 'short', month: 'short', day: 'numeric' })}</div>\n <WeatherIcon condition={day.icon} width={20} height={20} />\n <div>\n {day.min}° / {day.max}°\n {day.precipitationProbabilityMax !== undefined && day.precipitationProbabilityMax > 0 && (\n <span style={styles.rain}> · {day.precipitationProbabilityMax}%</span>\n )}\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * Weather forecast widget. When `locations` is provided, one forecast is\n * rendered per location; otherwise a single auto-detected forecast is shown.\n */\nexport function WeatherForecast(props: Props) {\n const { locations, ...rest } = props;\n\n if (locations && locations.length > 0) {\n const gap = props.compact ? 8 : 16;\n return (\n <div style={{ ...styles.list, gap }}>\n {locations.map((loc, index) => (\n <SingleWeatherForecast\n key={`${loc.label ?? ''}:${loc.latitude ?? ''}:${loc.longitude ?? ''}:${index}`}\n {...rest}\n latitude={typeof loc.latitude === 'number' ? loc.latitude : undefined}\n longitude={typeof loc.longitude === 'number' ? loc.longitude : undefined}\n location={{ city: loc.label, timezone: loc.timezone }}\n />\n ))}\n </div>\n );\n }\n\n return <SingleWeatherForecast {...rest} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;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A,UACzB,IAAI,gCAAgC,UAAa,IAAI,8BAA8B,KAClF,8CAAC,UAAK,OAAO,OAAO,MAAM;AAAA;AAAA,YAAW,IAAI;AAAA,YAA4B;AAAA,aAAC;AAAA,WAE1E;AAAA,WARQ,IAAI,IASd,CACD,GACH;AAAA,OACF;AAAA,KACF;AAEJ;AAMO,SAAS,gBAAgB,OAAc;AAC5C,QAAM,EAAE,WAAW,GAAG,KAAK,IAAI;AAE/B,MAAI,aAAa,UAAU,SAAS,GAAG;AACrC,UAAM,MAAM,MAAM,UAAU,IAAI;AAChC,WACE,6CAAC,SAAI,OAAO,EAAE,GAAG,OAAO,MAAM,IAAI,GAC/B,oBAAU,IAAI,CAAC,KAAK,UACnB;AAAA,MAAC;AAAA;AAAA,QAEE,GAAG;AAAA,QACJ,UAAU,OAAO,IAAI,aAAa,WAAW,IAAI,WAAW;AAAA,QAC5D,WAAW,OAAO,IAAI,cAAc,WAAW,IAAI,YAAY;AAAA,QAC/D,UAAU,EAAE,MAAM,IAAI,OAAO,UAAU,IAAI,SAAS;AAAA;AAAA,MAJ/C,GAAG,IAAI,SAAS,EAAE,IAAI,IAAI,YAAY,EAAE,IAAI,IAAI,aAAa,EAAE,IAAI,KAAK;AAAA,IAK/E,CACD,GACH;AAAA,EAEJ;AAEA,SAAO,6CAAC,yBAAuB,GAAG,MAAM;AAC1C;","names":["res","data","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","React"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/weatherCodes.ts","../src/lib/cache.ts","../src/api/geolocation.ts","../src/api/forecast.ts","../src/hooks/useWeatherForecast.ts","../src/icons/BaseIcon.tsx","../src/icons/weather-icons.tsx","../src/icons/WeatherIcon.tsx","../src/components/WeatherForecast.tsx"],"sourcesContent":["export * from './types';\nexport * from './weatherCodes';\nexport { clearWeatherForecastCache } from './lib/cache';\nexport * from './api/geolocation';\nexport * from './api/forecast';\nexport * from './hooks/useWeatherForecast';\nexport * from './icons/WeatherIcon';\nexport * from './components/WeatherForecast';\n","import type { WeatherCondition } from './types';\n\nexport function getWeatherIcon(code: number, isDay = 1): WeatherCondition {\n if (code === 0) return 'sun';\n if ([1, 2].includes(code)) return isDay ? 'cloud-sun' : 'clouds';\n if (code === 3) return 'clouds';\n if ([45, 48].includes(code)) return 'cloud-fog';\n if ([51, 53, 55, 56, 57].includes(code)) return 'cloud-drizzle';\n if ([61, 63].includes(code)) return 'cloud-showers';\n if ([65, 66, 67, 80, 81, 82].includes(code)) return 'cloud-showers-heavy';\n if ([71, 73, 75, 77, 85, 86].includes(code)) return 'cloud-snow';\n if (code === 95) return 'cloud-bolt';\n if ([96, 99].includes(code)) return 'cloud-hail';\n return 'clouds';\n}\n","const CACHE_PREFIX = 'weather-forecast-cache:';\nconst CACHE_TTL_MS = 30 * 60 * 1000;\n\ntype CacheEntry<T> = {\n timestamp: number;\n data: T;\n};\n\nfunction getStorage(): Storage | null {\n if (typeof window === 'undefined' || !window.localStorage) return null;\n return window.localStorage;\n}\n\n/** Returns the cached value for `key` if it was written within the last 30 minutes. */\nexport function readCachedForecast<T>(key: string): T | null {\n const storage = getStorage();\n if (!storage) return null;\n\n try {\n const raw = storage.getItem(CACHE_PREFIX + key);\n if (!raw) return null;\n\n const entry = JSON.parse(raw) as CacheEntry<T>;\n if (Date.now() - entry.timestamp > CACHE_TTL_MS) {\n storage.removeItem(CACHE_PREFIX + key);\n return null;\n }\n\n return entry.data;\n } catch {\n return null;\n }\n}\n\nexport function writeCachedForecast<T>(key: string, data: T): void {\n const storage = getStorage();\n if (!storage) return;\n\n try {\n const entry: CacheEntry<T> = { timestamp: Date.now(), data };\n storage.setItem(CACHE_PREFIX + key, JSON.stringify(entry));\n } catch {\n // Storage full or unavailable (e.g. private browsing) — safe to ignore,\n // the next call will simply hit the network again.\n }\n}\n\n/** Clears all cached forecasts. Mainly useful for tests/debugging. */\nexport function clearWeatherForecastCache(): void {\n const storage = getStorage();\n if (!storage) return;\n\n for (let i = storage.length - 1; i >= 0; i--) {\n const key = storage.key(i);\n if (key?.startsWith(CACHE_PREFIX)) storage.removeItem(key);\n }\n}\n","import type { WeatherLocation } from '../types';\n\nconst DEFAULT_IP_API_URL = 'https://ipapi.co';\n\ntype IpApiResponse = {\n city?: string;\n region?: string;\n country_name?: string;\n timezone?: string;\n latitude?: number;\n longitude?: number;\n error?: boolean;\n reason?: string;\n};\n\ntype GeoWorkerResponse = {\n city?: string;\n region?: string;\n country?: string;\n timezone?: string;\n latitude?: number | string;\n longitude?: number | string;\n};\n\nexport async function getClientLocation(geoEndpoint?: string, ip?: string): Promise<WeatherLocation> {\n if (geoEndpoint) {\n const url = ip ? `${geoEndpoint}?ip=${encodeURIComponent(ip)}` : geoEndpoint;\n const res = await fetch(url);\n if (!res.ok) throw new Error(`Geolocation worker lookup failed: ${res.status}`);\n const data: GeoWorkerResponse = await res.json();\n\n return {\n city: data.city,\n region: data.region,\n country: data.country,\n timezone: data.timezone,\n latitude: Number(data.latitude),\n longitude: Number(data.longitude),\n };\n }\n\n const res = await fetch(`${DEFAULT_IP_API_URL}/${ip ? `${encodeURIComponent(ip)}/` : ''}json/`);\n if (!res.ok) throw new Error(`ipapi.co lookup failed: ${res.status}`);\n const data: IpApiResponse = await res.json();\n\n if (data.error) {\n throw new Error(`ipapi.co lookup failed: ${data.reason ?? 'unknown error'}`);\n }\n\n return {\n city: data.city,\n region: data.region,\n country: data.country_name,\n timezone: data.timezone,\n latitude: Number(data.latitude),\n longitude: Number(data.longitude),\n };\n}\n","import type { WeatherForecastData, WeatherForecastOptions, WeatherLocation } from '../types';\nimport { getWeatherIcon } from '../weatherCodes';\nimport { getClientLocation } from './geolocation';\nimport { readCachedForecast, writeCachedForecast } from '../lib/cache';\n\nfunction buildUrl(latitude: number, longitude: number, options: WeatherForecastOptions) {\n const params = new URLSearchParams({\n latitude: String(latitude),\n longitude: String(longitude),\n timezone: options.location?.timezone || 'auto',\n temperature_unit: options.temperatureUnit || 'fahrenheit',\n wind_speed_unit: options.windSpeedUnit || 'mph',\n forecast_days: String(options.forecastDays ?? 5),\n forecast_hours: String(options.forecastHours ?? 24),\n current: [\n 'temperature_2m',\n 'weather_code',\n 'is_day',\n 'rain',\n 'showers',\n 'snowfall',\n 'wind_speed_10m',\n ].join(','),\n hourly: [\n 'temperature_2m',\n 'weather_code',\n 'precipitation_probability',\n 'rain',\n 'showers',\n 'snowfall',\n ].join(','),\n daily: [\n 'temperature_2m_max',\n 'temperature_2m_min',\n 'weather_code',\n 'precipitation_probability_max',\n 'precipitation_sum',\n 'wind_speed_10m_max',\n ].join(','),\n });\n\n return `https://api.open-meteo.com/v1/forecast?${params.toString()}`;\n}\n\nexport async function getWeatherForecast(\n options: WeatherForecastOptions = {}\n): Promise<WeatherForecastData> {\n let location: WeatherLocation;\n\n if (typeof options.latitude === 'number' && typeof options.longitude === 'number') {\n location = {\n ...options.location,\n latitude: options.latitude,\n longitude: options.longitude,\n };\n } else {\n location = await getClientLocation(options.geoEndpoint, options.ip);\n }\n\n const url = buildUrl(location.latitude, location.longitude, { ...options, location });\n\n const cached = readCachedForecast<WeatherForecastData>(url);\n if (cached) return cached;\n\n const response = await fetch(url, { headers: { 'Content-Type': 'application/json' } });\n\n if (!response.ok) {\n throw new Error(`Weather request failed: ${response.status} ${response.statusText}`);\n }\n\n const data = await response.json();\n\n if (!data?.current || !data?.hourly || !data?.daily) {\n throw new Error('Invalid weather response');\n }\n\n const result: WeatherForecastData = {\n location: { ...location, timezone: data.timezone || location.timezone },\n current: {\n time: data.current.time,\n temperature: Math.round(data.current.temperature_2m),\n weatherCode: data.current.weather_code,\n icon: getWeatherIcon(data.current.weather_code, data.current.is_day),\n isDay: data.current.is_day,\n rain: data.current.rain,\n showers: data.current.showers,\n snowfall: data.current.snowfall,\n windSpeed: data.current.wind_speed_10m,\n },\n hourly: data.hourly.time.map((time: string, index: number) => ({\n time,\n temperature: Math.round(data.hourly.temperature_2m[index]),\n weatherCode: data.hourly.weather_code[index],\n precipitationProbability: data.hourly.precipitation_probability?.[index],\n rain: data.hourly.rain?.[index],\n showers: data.hourly.showers?.[index],\n snowfall: data.hourly.snowfall?.[index],\n icon: getWeatherIcon(data.hourly.weather_code[index]),\n })),\n daily: data.daily.time.map((date: string, index: number) => ({\n date,\n min: Math.round(data.daily.temperature_2m_min[index]),\n max: Math.round(data.daily.temperature_2m_max[index]),\n weatherCode: data.daily.weather_code[index],\n precipitationProbabilityMax: data.daily.precipitation_probability_max?.[index],\n precipitationSum: data.daily.precipitation_sum?.[index],\n windSpeedMax: data.daily.wind_speed_10m_max?.[index],\n icon: getWeatherIcon(data.daily.weather_code[index]),\n })),\n };\n\n writeCachedForecast(url, result);\n return result;\n}\n","import { useEffect, useState } from 'react';\nimport type { WeatherForecastData, WeatherForecastOptions } from '../types';\nimport { getWeatherForecast } from '../api/forecast';\n\nexport function useWeatherForecast(options: WeatherForecastOptions = {}) {\n const [data, setData] = useState<WeatherForecastData | null>(null);\n const [error, setError] = useState<Error | null>(null);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n let active = true;\n setLoading(true);\n setError(null);\n\n getWeatherForecast(options)\n .then((result) => { if (active) setData(result); })\n .catch((err) => { if (active) setError(err instanceof Error ? err : new Error('Unknown error')); })\n .finally(() => { if (active) setLoading(false); });\n\n return () => { active = false; };\n }, [\n options.latitude,\n options.longitude,\n options.geoEndpoint,\n options.ip,\n options.forecastDays,\n options.forecastHours,\n options.temperatureUnit,\n options.windSpeedUnit,\n options.location?.timezone,\n ]);\n\n return { data, error, loading };\n}\n","import React from 'react';\nimport type { IconProps } from '../types';\n\nexport function BaseIcon({ title, children, ...props }: IconProps & { children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={title ? 'img' : 'presentation'}\n aria-hidden={title ? undefined : true}\n aria-label={title}\n {...props}\n >\n {title ? <title>{title}</title> : null}\n {children}\n </svg>\n );\n}\n","import React from 'react';\nimport type { IconProps } from '../types';\nimport { BaseIcon } from './BaseIcon';\n\nexport const CloudBoltIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M7 18a4.815 4.815 0 0 1-3.327-1.318A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 0 7h-1m-4.75-5L11 17.5h3.375l-2.25 4.5\" /></BaseIcon>\n);\nexport const CloudDrizzleIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M12 18v1m-3-4v1m6-1v1m2 3v1M7 19v1m-3-3.034a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662\" /></BaseIcon>\n);\nexport const CloudFogIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M5 21h7m4 0h3M8 17h8\" /></BaseIcon>\n);\nexport const CloudHailIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8 17.45v.1m-1.5 3.9v.1m10.5-4.1v.1m-1.5 3.9v.1m-3-4.1v.1m-1.5 3.9v.1m10.475-4.575A3.5 3.5 0 0 0 19 11h-1c.146-.65.148-1.32.006-1.97a4.784 4.784 0 0 0-.831-1.823 5.36 5.36 0 0 0-1.544-1.398 5.964 5.964 0 0 0-2.02-.759 6.224 6.224 0 0 0-2.19-.006 5.971 5.971 0 0 0-2.024.749C8.157 6.533 7.295 7.687 7 9a4.815 4.815 0 0 0-3.327 1.318A4.403 4.403 0 0 0 2.295 13.5c0 1.194.496 2.338 1.378 3.182.105.1.214.195.327.284m4.5.534a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm10.5-4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-3-4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z\" /></BaseIcon>\n);\nexport const CloudShowersIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M12 13v2m0 3v2m4-5v2m0 3v2m-8-7v2m0 3v2\" /></BaseIcon>\n);\nexport const CloudShowersHeavyIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M16 15v6m-8-6v6m4-8v6\" /></BaseIcon>\n);\nexport const CloudSleetIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M13.5 17.45a1 1 0 1 0-2 0h2Zm-2 .1a1 1 0 1 0 2 0h-2Zm.5 3.9a1 1 0 1 0-2 0h2Zm-2 .1a1 1 0 1 0 2 0h-2Zm-6.327-4.868.692-.723-.692.723ZM7 9v1a1 1 0 0 0 .976-.781L7 9Zm2.397-3.207.512.858-.512-.858ZM18 11l-.976-.219A1 1 0 0 0 18 12v-1Zm2.768 5.268a1 1 0 0 0 1.414 1.414l-.707-.707-.707-.707ZM3.379 17.75a1 1 0 0 0 1.242-1.567L4 16.966l-.62.784Zm5.55-.379a1 1 0 0 0-1.857-.742L8 17l.928.371ZM5.071 21.63a1 1 0 0 0 1.856.742L6 22l-.928-.371Zm13.857-4.258a1 1 0 0 0-1.857-.742L18 17l.928.371Zm-3.857 4.258a1 1 0 0 0 1.857.742L16 22l-.928-.371ZM13 17.5h-1a.5.5 0 0 1 .5-.5v2a1.5 1.5 0 0 0 1.5-1.5h-1Zm-.5.5v-1a.5.5 0 0 1 .5.5h-2a1.5 1.5 0 0 0 1.5 1.5v-1Zm-.5-.5h1a.5.5 0 0 1-.5.5v-2a1.5 1.5 0 0 0-1.5 1.5h1Zm.5-.5v1a.5.5 0 0 1-.5-.5h2a1.5 1.5 0 0 0-1.5-1.5v1Zm0 .45h-1v.1h2v-.1h-1Zm-1 4.05h-1a.5.5 0 0 1 .5-.5v2a1.5 1.5 0 0 0 1.5-1.5h-1Zm-.5.5v-1a.5.5 0 0 1 .5.5h-2A1.5 1.5 0 0 0 11 23v-1Zm-.5-.5h1a.5.5 0 0 1-.5.5v-2a1.5 1.5 0 0 0-1.5 1.5h1Zm.5-.5v1a.5.5 0 0 1-.5-.5h2A1.5 1.5 0 0 0 11 20v1Zm0 .45h-1v.1h2v-.1h-1Zm-7.327-4.768.692-.723a3.403 3.403 0 0 1-1.07-2.459h-2c0 1.473.613 2.877 1.687 3.905l.691-.723ZM2.295 13.5h1c0-.914.38-1.8 1.07-2.46l-.692-.722-.69-.723A5.403 5.403 0 0 0 1.294 13.5h1Zm1.378-3.182.692.723A3.815 3.815 0 0 1 7 10V8c-1.499 0-2.945.57-4.018 1.595l.691.723ZM7 9l.976.219c.23-1.024.91-1.956 1.933-2.568l-.512-.858-.513-.859c-1.456.87-2.5 2.245-2.86 3.847L7 9Zm2.397-3.207.512.858a4.972 4.972 0 0 1 1.686-.622l-.173-.985-.174-.985a6.971 6.971 0 0 0-2.364.875l.513.859Zm2.025-.749.173.985a5.223 5.223 0 0 1 1.837.005l.18-.984.178-.984a7.223 7.223 0 0 0-2.542-.007l.174.985Zm2.19.006-.18.984c.606.11 1.177.326 1.681.631l.518-.856.518-.855a6.963 6.963 0 0 0-2.359-.888l-.179.984Zm2.02.76-.519.855c.505.305.93.693 1.257 1.136l.805-.594.805-.594a6.361 6.361 0 0 0-1.831-1.659l-.518.855Zm1.543 1.397-.805.594c.326.442.549.932.66 1.441l.976-.212.978-.213a5.786 5.786 0 0 0-1.005-2.204l-.804.594Zm.831 1.823-.977.212c.111.509.11 1.031-.005 1.539L18 11l.976.219c.178-.792.18-1.609.008-2.402l-.978.213ZM18 11v1h1v-2h-1v1Zm1 0v1a2.5 2.5 0 0 1 1.768.732l.707-.707.707-.707A4.5 4.5 0 0 0 19 10v1Zm2.475 1.025-.707.707A2.5 2.5 0 0 1 21.5 14.5h2a4.5 4.5 0 0 0-1.318-3.182l-.707.707ZM22.5 14.5h-1a2.5 2.5 0 0 1-.732 1.768l.707.707.707.707A4.5 4.5 0 0 0 23.5 14.5h-1ZM4 16.966l.62-.784a3.684 3.684 0 0 1-.255-.223l-.692.723-.69.723c.126.121.259.237.396.345L4 16.966ZM8 17l-.928-.371-2 5L6 22l.928.371 2-5L8 17Zm10 0-.928-.371-2 5L16 22l.928.371 2-5L18 17Z\" /></BaseIcon>\n);\nexport const CloudSnowIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8 15h2m-1-1v2m5-1h2m-1-1v2M5 21h2m-1-1v2m5-2h2m-1-1v2m5 0h2m-1-1v2M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662\" /></BaseIcon>\n);\nexport const CloudSunIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M10.201 19.997c-1.977 0-3.58-1.544-3.58-3.448 0-1.903 1.603-3.446 3.58-3.446.303-1.355 1.38-2.461 2.827-2.902 1.445-.44 3.042-.148 4.186.77 1.144.915 1.663 2.312 1.361 3.667h.761c1.472 0 2.664 1.2 2.664 2.68A2.672 2.672 0 0 1 19.336 20h-9.134m2.66-12.934a4.166 4.166 0 0 0-2.677-1.732m2.677 1.732 2.744-1.892m-2.744 1.892c.55.796.802 1.754.723 2.709m-3.4-4.44a4.167 4.167 0 0 0-3.118.667m3.118-.668.602-3.278m-3.72 3.946A4.167 4.167 0 0 0 5.334 8.68m1.733-2.678L5.174 3.26m.16 5.42c-.2 1.088.041 2.21.669 3.12m-.669-3.12-3.278-.601m3.947 3.72-2.744 1.893m2.744-1.893a4.167 4.167 0 0 0 2.174 1.607\" /></BaseIcon>\n);\nexport const CloudsIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8.958 21.05C6.772 21.05 5 19.344 5 17.24s1.772-3.81 3.958-3.81c.335-1.498 1.525-2.72 3.124-3.207 1.598-.487 3.363-.164 4.628.85 1.264 1.011 1.837 2.556 1.504 4.053h.842A2.953 2.953 0 0 1 22 18.09a2.954 2.954 0 0 1-2.945 2.964H8.958M18 8c-.5-2.5-3.532-3.401-5.5-2.5a3.117 3.117 0 0 0-2.11-2.312c-1.352-.411-2.845-.138-3.915.72-1.07.855-1.554 2.161-1.273 3.428h-.711A2.498 2.498 0 0 0 2 9.843c0 1.094.695 2.023 1.666 2.366\" /></BaseIcon>\n);\nexport const SnowflakeIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"m9.25 4-1 2H6m-2.25 4L5 12m0 0-1.25 2M5 12h3m-3 0H2.5m17.75-2L19 12l1.25 2M6 18h2.25l1 2M14 9h-4m4 0 3-5m-3 5 2 3m-6-3L7 4m3 5-2 3m0 0 2 3m0 0-3 5m3-5h4m2-3-2 3m2-3h5.5M14 15l3 5M14.75 4l1 2H18m0 12h-2.25l-1 2\" /></BaseIcon>\n);\nexport const SunIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M12 4V2m0 20v-2m10-8h-2M4 12H2m15.657-5.657 1.414-1.414M4.93 19.07l1.414-1.414m12.728 1.414-1.414-1.414M6.343 6.343 4.93 4.929M7 12a5 5 0 1 0 10 0 5 5 0 0 0-10 0Z\" /></BaseIcon>\n);\nexport const WindIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2\" /></BaseIcon>\n);\n","import React from 'react';\nimport type { IconProps, WeatherCondition } from '../types';\nimport {\n CloudBoltIcon,\n CloudDrizzleIcon,\n CloudFogIcon,\n CloudHailIcon,\n CloudShowersHeavyIcon,\n CloudShowersIcon,\n CloudSleetIcon,\n CloudSnowIcon,\n CloudSunIcon,\n CloudsIcon,\n SnowflakeIcon,\n SunIcon,\n} from './weather-icons';\n\nconst iconMap: Record<WeatherCondition, React.ComponentType<IconProps>> = {\n sun: SunIcon,\n 'cloud-sun': CloudSunIcon,\n clouds: CloudsIcon,\n 'cloud-fog': CloudFogIcon,\n 'cloud-drizzle': CloudDrizzleIcon,\n 'cloud-showers': CloudShowersIcon,\n 'cloud-showers-heavy': CloudShowersHeavyIcon,\n 'cloud-sleet': CloudSleetIcon,\n 'cloud-snow': CloudSnowIcon,\n snowflake: SnowflakeIcon,\n 'cloud-bolt': CloudBoltIcon,\n 'cloud-hail': CloudHailIcon,\n};\n\nexport function WeatherIcon({ condition, ...props }: IconProps & { condition: WeatherCondition }) {\n const Icon = iconMap[condition] || CloudsIcon;\n return <Icon {...props} />;\n}\n","import React, { useEffect, useState } from 'react';\nimport { useWeatherForecast } from '../hooks/useWeatherForecast';\nimport type { DailyWeather, HourlyWeather, TemperatureUnit, WeatherForecastOptions, WindSpeedUnit } from '../types';\nimport { WeatherIcon } from '../icons/WeatherIcon';\nimport { WindIcon } from '../icons/weather-icons';\n\ntype Props = WeatherForecastOptions & {\n className?: string;\n style?: React.CSSProperties;\n compact?: boolean;\n};\n\nconst WIND_SPEED_UNIT_LABELS: Record<WindSpeedUnit, string> = {\n kmh: 'km/h',\n mph: 'mph',\n ms: 'm/s',\n kn: 'kn',\n};\n\nfunction closestHour(hourly: HourlyWeather[], targetTime: Date): HourlyWeather | undefined {\n return hourly.reduce<HourlyWeather | undefined>((closest, hour) => {\n const diff = Math.abs(new Date(hour.time).getTime() - targetTime.getTime());\n const closestDiff = closest ? Math.abs(new Date(closest.time).getTime() - targetTime.getTime()) : Infinity;\n return diff < closestDiff ? hour : closest;\n }, undefined);\n}\n\n// Format a real instant in a specific IANA timezone, falling back to the\n// browser's local zone if the timezone string is missing or invalid.\nfunction formatInZone(instant: Date, timezone: string | undefined, options: Intl.DateTimeFormatOptions): string {\n try {\n return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || undefined }).format(instant);\n } catch {\n return new Intl.DateTimeFormat([], options).format(instant);\n }\n}\n\n// The clock is shown with the hour and minute large and the seconds (plus any\n// AM/PM marker) trailing in a smaller, dimmer size, so split it into those two\n// halves. Falls back to one undivided string if the locale's parts are not\n// where we expect them.\nfunction clockParts(instant: Date, timezone: string | undefined): { main: string; tail: string } {\n const options: Intl.DateTimeFormatOptions = { hour: 'numeric', minute: '2-digit', second: '2-digit' };\n const format = (() => {\n try {\n return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || undefined });\n } catch {\n return new Intl.DateTimeFormat([], options);\n }\n })();\n const parts = format.formatToParts(instant);\n const part = (type: Intl.DateTimeFormatPartTypes) => parts.find((p) => p.type === type)?.value;\n const hour = part('hour');\n const minute = part('minute');\n const second = part('second');\n if (!hour || !minute || !second) return { main: format.format(instant), tail: '' };\n const dayPeriod = part('dayPeriod');\n return { main: `${hour}:${minute}`, tail: `:${second}${dayPeriod ? ` ${dayPeriod}` : ''}` };\n}\n\n// Just the zone abbreviation (e.g. \"GMT+2\"), so it can be shown apart from the\n// clock itself.\nfunction zoneLabel(instant: Date, timezone: string | undefined): string {\n const options: Intl.DateTimeFormatOptions = { hour: 'numeric', timeZoneName: 'short' };\n try {\n const format = (() => {\n try {\n return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || undefined });\n } catch {\n return new Intl.DateTimeFormat([], options);\n }\n })();\n return format.formatToParts(instant).find((part) => part.type === 'timeZoneName')?.value ?? '';\n } catch {\n return '';\n }\n}\n\n// Daily dates arrive as plain \"YYYY-MM-DD\" calendar days; `new Date(...)` would\n// read those as UTC midnight and roll back a day in western timezones, so build\n// the date from its parts and let it stay a local calendar day.\nfunction parseCalendarDate(date: string): Date {\n const [year, month, day] = date.split('-').map(Number);\n if (!year || !month || !day) return new Date(date);\n return new Date(year, month - 1, day);\n}\n\n// The upcoming days sit in narrow columns along the bottom of the card, so\n// they are labelled with the abbreviated weekday (\"Fri\") rather than a full\n// name or \"Tomorrow\".\nfunction upcomingDayLabel(date: string): string {\n return parseCalendarDate(date).toLocaleDateString([], { weekday: 'short' });\n}\n\n// Daily totals that no longer have a column of their own in the card layout are\n// kept as hover text so the detail is still reachable.\nfunction upcomingDayDetail(day: DailyWeather, windSpeedUnitLabel: string): string | undefined {\n const details: string[] = [];\n if (day.precipitationSum !== undefined) details.push(`${day.precipitationSum.toFixed(1)} mm`);\n if (day.windSpeedMax !== undefined) details.push(`${day.windSpeedMax.toFixed(1)} ${windSpeedUnitLabel} wind`);\n return details.length > 0 ? details.join(' · ') : undefined;\n}\n\nconst styles = {\n root: {\n fontFamily: 'system-ui, sans-serif',\n border: '1px solid #e5e7eb',\n borderRadius: 12,\n padding: 16,\n background: '#fff',\n color: '#111827',\n maxWidth: 640,\n } as React.CSSProperties,\n row: { display: 'flex', alignItems: 'center', gap: 8 } as React.CSSProperties,\n hours: { display: 'flex', gap: 12, overflowX: 'auto', paddingBottom: 4 } as React.CSSProperties,\n hourCard: { minWidth: 72, textAlign: 'center' as const, padding: 8, borderRadius: 8, background: '#f9fafb' },\n dayRow: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 10, padding: '8px 0', borderBottom: '1px solid #f3f4f6' } as React.CSSProperties,\n // Card-sized: a fixed maximum width with generous, even padding, so the\n // widget reads as a self-contained tile wherever it is dropped in.\n compactRoot: {\n fontFamily: 'system-ui, sans-serif',\n display: 'flex',\n flexDirection: 'column',\n gap: 14,\n padding: 18,\n borderRadius: 16,\n width: '100%',\n maxWidth: 340,\n boxSizing: 'border-box',\n } as React.CSSProperties,\n // Current conditions stack down the card; the upcoming days sit in a row\n // along the bottom.\n compactBody: { display: 'flex', flexDirection: 'column', gap: 10 } as React.CSSProperties,\n compactCity: { fontSize: 15, fontWeight: 700, lineHeight: 1.2 } as React.CSSProperties,\n compactHeader: { display: 'flex', alignItems: 'center', flexWrap: 'wrap', gap: 8 } as React.CSSProperties,\n compactTemp: { fontSize: 32, fontWeight: 600, lineHeight: 1 } as React.CSSProperties,\n // The short-term outlook (\"59 deg in 6h\") trails the current temperature.\n compactOutlook: { display: 'flex', alignItems: 'center', gap: 4, fontSize: 12, opacity: 0.75, whiteSpace: 'nowrap' } as React.CSSProperties,\n compactTime: { fontSize: 26, fontWeight: 600, lineHeight: 1.1 } as React.CSSProperties,\n compactSeconds: { fontSize: 13, fontWeight: 500, opacity: 0.6 } as React.CSSProperties,\n compactDate: { fontSize: 11, opacity: 0.7, marginTop: 2 } as React.CSSProperties,\n compactStats: { display: 'flex', flexWrap: 'wrap', gap: 14, fontSize: 12, opacity: 0.9 } as React.CSSProperties,\n // Three equal columns along the bottom edge, each stacking weekday / icon /\n // high-low so the row stays readable at card width.\n upcoming: {\n display: 'grid',\n gridTemplateColumns: 'repeat(3, 1fr)',\n gap: 8,\n paddingTop: 12,\n borderTop: '1px solid currentColor',\n borderTopColor: 'rgba(128,128,128,0.25)',\n fontSize: 12,\n } as React.CSSProperties,\n upcomingDay: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4, textAlign: 'center' } as React.CSSProperties,\n upcomingDayName: { opacity: 0.7, whiteSpace: 'nowrap' } as React.CSSProperties,\n upcomingTemps: { whiteSpace: 'nowrap' } as React.CSSProperties,\n compactStat: { display: 'flex', alignItems: 'center', gap: 4, whiteSpace: 'nowrap' } as React.CSSProperties,\n unitSwitch: { display: 'inline-flex', alignItems: 'center', cursor: 'pointer', userSelect: 'none' } as React.CSSProperties,\n rain: { color: '#2563eb', whiteSpace: 'nowrap' } as React.CSSProperties,\n tz: { fontSize: 12, opacity: 0.7, marginTop: 2 } as React.CSSProperties,\n list: { display: 'flex', flexDirection: 'column' } as React.CSSProperties,\n};\n\n// Precipitation chance is only surfaced when there is a non-zero chance of it.\nfunction RainBadge({ probability, compact }: { probability?: number; compact?: boolean }) {\n if (probability === undefined || probability === null || probability <= 0) return null;\n return <span style={styles.rain}>{compact ? ` · ${probability}%` : ` · ${probability}% rain`}</span>;\n}\n\n/**\n * Renders one location's forecast: a live current time (ticking, in the\n * location's own timezone), a clickable degF / degC unit switch, high/low and\n * precipitation for the next hours and days.\n */\nfunction SingleWeatherForecast(props: Props) {\n // Temperature unit is local state so the degF / degC switch can toggle it;\n // it is seeded from (and re-synced to) the temperatureUnit prop.\n const [unit, setUnit] = useState<TemperatureUnit>(props.temperatureUnit ?? 'fahrenheit');\n useEffect(() => {\n setUnit(props.temperatureUnit ?? 'fahrenheit');\n }, [props.temperatureUnit]);\n\n const { data, loading, error } = useWeatherForecast({ ...props, temperatureUnit: unit });\n\n // A ticking clock so the displayed current time stays accurate to the second.\n const [now, setNow] = useState(() => new Date());\n useEffect(() => {\n const id = setInterval(() => setNow(new Date()), 1000);\n return () => clearInterval(id);\n }, []);\n\n const toggleUnit = () => setUnit((u) => (u === 'celsius' ? 'fahrenheit' : 'celsius'));\n\n const renderUnitSwitch = (fontSize: number) => (\n <span\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation();\n toggleUnit();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggleUnit();\n }\n }}\n title=\"Switch temperature units\"\n aria-label={`Switch temperature units, currently ${unit === 'celsius' ? 'Celsius' : 'Fahrenheit'}`}\n style={{ ...styles.unitSwitch, fontSize }}\n >\n <span style={{ fontWeight: unit === 'fahrenheit' ? 700 : 400, opacity: unit === 'fahrenheit' ? 1 : 0.45 }}>°F</span>\n <span style={{ opacity: 0.4, margin: '0 3px' }}>|</span>\n <span style={{ fontWeight: unit === 'celsius' ? 700 : 400, opacity: unit === 'celsius' ? 1 : 0.45 }}>°C</span>\n </span>\n );\n\n // Keep showing the last forecast while a unit switch refetches in the\n // background; only suppress output on the very first load.\n if (loading && !data) return null;\n if (error) return <div className={props.className} style={props.style}>Error: {error.message}</div>;\n if (!data) return <div className={props.className} style={props.style}>No forecast available.</div>;\n\n const timezone = data.location?.timezone;\n const currentDate = formatInZone(now, timezone, { weekday: 'short', month: 'short', day: 'numeric' });\n const currentTime = formatInZone(now, timezone, { hour: 'numeric', minute: '2-digit', second: '2-digit', timeZoneName: 'short' });\n // The compact layout shows the clock at a larger size, so the zone label is\n // split off onto the smaller date line to keep the time on one line.\n const currentClock = clockParts(now, timezone);\n const currentZone = zoneLabel(now, timezone);\n\n if (props.compact) {\n const forecastBase = new Date(data.current.time);\n const today = data.daily[0];\n const in6Hours = closestHour(data.hourly, new Date(forecastBase.getTime() + 6 * 60 * 60 * 1000));\n const windSpeedUnitLabel = WIND_SPEED_UNIT_LABELS[props.windSpeedUnit ?? 'mph'];\n // Today is already summarised in the card's own stats line, so the bottom\n // row starts at tomorrow and shows the next three days.\n const upcomingDays = data.daily.slice(1, 4);\n\n return (\n <div className={props.className} style={{ ...styles.compactRoot, ...props.style }}>\n <div style={styles.compactBody}>\n <div style={styles.compactCity}>\n {data.location?.city || 'Current location'}\n {data.location?.region ? `, ${data.location.region}` : ''}\n </div>\n\n <div style={styles.compactHeader}>\n <WeatherIcon condition={data.current.icon} width={30} height={30} title=\"Current weather\" />\n <strong style={styles.compactTemp}>{data.current.temperature}</strong>\n {renderUnitSwitch(13)}\n {in6Hours && (\n <span style={styles.compactOutlook}>\n <WeatherIcon condition={in6Hours.icon} width={14} height={14} title=\"In 6 hours\" />\n {in6Hours.temperature}° 6h\n <RainBadge probability={in6Hours.precipitationProbability} compact />\n </span>\n )}\n </div>\n\n <div>\n <div style={styles.compactTime}>\n {currentClock.main}\n {currentClock.tail && <span style={styles.compactSeconds}>{currentClock.tail}</span>}\n </div>\n <div style={styles.compactDate}>\n {currentDate}\n {currentZone ? ` · ${currentZone}` : ''}\n </div>\n </div>\n\n <div style={styles.compactStats}>\n {today && (\n <span style={styles.compactStat}>\n <WeatherIcon condition={today.icon} width={16} height={16} title=\"Today's high and low\" />\n {today.max}° / {today.min}°\n <RainBadge probability={today.precipitationProbabilityMax} compact />\n </span>\n )}\n <span style={styles.compactStat}>\n <WindIcon width={16} height={16} title=\"Wind speed\" />\n {data.current.windSpeed !== undefined ? `${Math.round(data.current.windSpeed)} ${windSpeedUnitLabel}` : '—'}\n </span>\n </div>\n </div>\n\n {upcomingDays.length > 0 && (\n <div style={styles.upcoming}>\n {upcomingDays.map((day) => (\n <div key={day.date} style={styles.upcomingDay} title={upcomingDayDetail(day, windSpeedUnitLabel)}>\n <span style={styles.upcomingDayName}>{upcomingDayLabel(day.date)}</span>\n <WeatherIcon condition={day.icon} width={18} height={18} />\n <span style={styles.upcomingTemps}>\n <strong>{day.max}°</strong>\n <span style={{ opacity: 0.6 }}> / {day.min}°</span>\n </span>\n {day.precipitationProbabilityMax !== undefined && day.precipitationProbabilityMax > 0 && (\n <span style={{ ...styles.rain, fontSize: 11 }}>{day.precipitationProbabilityMax}%</span>\n )}\n </div>\n ))}\n </div>\n )}\n </div>\n );\n }\n\n return (\n <div className={props.className} style={{ ...styles.root, ...props.style }}>\n <div>\n <h3 style={{ margin: 0, fontSize: 20 }}>\n {data.location?.city || 'Current location'}\n {data.location?.region ? `, ${data.location.region}` : ''}\n </h3>\n <div style={styles.tz}>\n {currentDate} · {currentTime}\n {timezone ? ` · ${timezone}` : ''}\n </div>\n <div style={{ ...styles.row, marginTop: 8 }}>\n <WeatherIcon condition={data.current.icon} width={28} height={28} title=\"Current weather\" />\n <strong style={{ fontSize: 28 }}>{data.current.temperature}</strong>\n {renderUnitSwitch(14)}\n </div>\n </div>\n\n <div style={{ marginTop: 20 }}>\n <h4 style={{ margin: '0 0 10px 0' }}>Next hours</h4>\n <div style={styles.hours}>\n {data.hourly.slice(0, props.forecastHours ?? 12).map((hour) => (\n <div key={hour.time} style={styles.hourCard}>\n <div style={{ fontSize: 12 }}>{new Date(hour.time).toLocaleTimeString([], { hour: 'numeric' })}</div>\n <WeatherIcon condition={hour.icon} width={20} height={20} style={{ margin: '6px auto' }} />\n <div>{hour.temperature}°</div>\n {hour.precipitationProbability !== undefined && hour.precipitationProbability > 0 && (\n <div style={{ ...styles.rain, fontSize: 12 }}>{hour.precipitationProbability}%</div>\n )}\n </div>\n ))}\n </div>\n </div>\n\n <div style={{ marginTop: 20 }}>\n <h4 style={{ margin: '0 0 10px 0' }}>Next days</h4>\n <div>\n {data.daily.map((day) => (\n <div key={day.date} style={styles.dayRow}>\n <div style={{ width: 120 }}>{new Date(day.date).toLocaleDateString([], { weekday: 'short', month: 'short', day: 'numeric' })}</div>\n <WeatherIcon condition={day.icon} width={20} height={20} />\n <div>\n {day.min}° / {day.max}°\n {day.precipitationProbabilityMax !== undefined && day.precipitationProbabilityMax > 0 && (\n <span style={styles.rain}> · {day.precipitationProbabilityMax}%</span>\n )}\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * Weather forecast widget. When `locations` is provided, one forecast is\n * rendered per location; otherwise a single auto-detected forecast is shown.\n */\nexport function WeatherForecast(props: Props) {\n const { locations, ...rest } = props;\n\n if (locations && locations.length > 0) {\n const gap = props.compact ? 8 : 16;\n return (\n <div style={{ ...styles.list, gap }}>\n {locations.map((loc, index) => (\n <SingleWeatherForecast\n key={`${loc.label ?? ''}:${loc.latitude ?? ''}:${loc.longitude ?? ''}:${index}`}\n {...rest}\n latitude={typeof loc.latitude === 'number' ? loc.latitude : undefined}\n longitude={typeof loc.longitude === 'number' ? loc.longitude : undefined}\n location={{ city: loc.label, timezone: loc.timezone }}\n />\n ))}\n </div>\n );\n }\n\n return <SingleWeatherForecast {...rest} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,SAAS,eAAe,MAAc,QAAQ,GAAqB;AACxE,MAAI,SAAS,EAAG,QAAO;AACvB,MAAI,CAAC,GAAG,CAAC,EAAE,SAAS,IAAI,EAAG,QAAO,QAAQ,cAAc;AACxD,MAAI,SAAS,EAAG,QAAO;AACvB,MAAI,CAAC,IAAI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;AAChC,WACE,6CAAC,SAAI,OAAO,EAAE,GAAG,OAAO,MAAM,IAAI,GAC/B,oBAAU,IAAI,CAAC,KAAK,UACnB;AAAA,MAAC;AAAA;AAAA,QAEE,GAAG;AAAA,QACJ,UAAU,OAAO,IAAI,aAAa,WAAW,IAAI,WAAW;AAAA,QAC5D,WAAW,OAAO,IAAI,cAAc,WAAW,IAAI,YAAY;AAAA,QAC/D,UAAU,EAAE,MAAM,IAAI,OAAO,UAAU,IAAI,SAAS;AAAA;AAAA,MAJ/C,GAAG,IAAI,SAAS,EAAE,IAAI,IAAI,YAAY,EAAE,IAAI,IAAI,aAAa,EAAE,IAAI,KAAK;AAAA,IAK/E,CACD,GACH;AAAA,EAEJ;AAEA,SAAO,6CAAC,yBAAuB,GAAG,MAAM;AAC1C;","names":["res","data","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime"]}
|
package/dist/index.js
CHANGED
|
@@ -280,7 +280,7 @@ function WeatherIcon({ condition, ...props }) {
|
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
// src/components/WeatherForecast.tsx
|
|
283
|
-
import
|
|
283
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
284
284
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
285
285
|
var WIND_SPEED_UNIT_LABELS = {
|
|
286
286
|
kmh: "km/h",
|
|
@@ -302,6 +302,24 @@ function formatInZone(instant, timezone, options) {
|
|
|
302
302
|
return new Intl.DateTimeFormat([], options).format(instant);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
+
function clockParts(instant, timezone) {
|
|
306
|
+
const options = { hour: "numeric", minute: "2-digit", second: "2-digit" };
|
|
307
|
+
const format = (() => {
|
|
308
|
+
try {
|
|
309
|
+
return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || void 0 });
|
|
310
|
+
} catch {
|
|
311
|
+
return new Intl.DateTimeFormat([], options);
|
|
312
|
+
}
|
|
313
|
+
})();
|
|
314
|
+
const parts = format.formatToParts(instant);
|
|
315
|
+
const part = (type) => parts.find((p) => p.type === type)?.value;
|
|
316
|
+
const hour = part("hour");
|
|
317
|
+
const minute = part("minute");
|
|
318
|
+
const second = part("second");
|
|
319
|
+
if (!hour || !minute || !second) return { main: format.format(instant), tail: "" };
|
|
320
|
+
const dayPeriod = part("dayPeriod");
|
|
321
|
+
return { main: `${hour}:${minute}`, tail: `:${second}${dayPeriod ? ` ${dayPeriod}` : ""}` };
|
|
322
|
+
}
|
|
305
323
|
function zoneLabel(instant, timezone) {
|
|
306
324
|
const options = { hour: "numeric", timeZoneName: "short" };
|
|
307
325
|
try {
|
|
@@ -322,9 +340,14 @@ function parseCalendarDate(date) {
|
|
|
322
340
|
if (!year || !month || !day) return new Date(date);
|
|
323
341
|
return new Date(year, month - 1, day);
|
|
324
342
|
}
|
|
325
|
-
function upcomingDayLabel(date
|
|
326
|
-
|
|
327
|
-
|
|
343
|
+
function upcomingDayLabel(date) {
|
|
344
|
+
return parseCalendarDate(date).toLocaleDateString([], { weekday: "short" });
|
|
345
|
+
}
|
|
346
|
+
function upcomingDayDetail(day, windSpeedUnitLabel) {
|
|
347
|
+
const details = [];
|
|
348
|
+
if (day.precipitationSum !== void 0) details.push(`${day.precipitationSum.toFixed(1)} mm`);
|
|
349
|
+
if (day.windSpeedMax !== void 0) details.push(`${day.windSpeedMax.toFixed(1)} ${windSpeedUnitLabel} wind`);
|
|
350
|
+
return details.length > 0 ? details.join(" \xB7 ") : void 0;
|
|
328
351
|
}
|
|
329
352
|
var styles = {
|
|
330
353
|
root: {
|
|
@@ -340,34 +363,45 @@ var styles = {
|
|
|
340
363
|
hours: { display: "flex", gap: 12, overflowX: "auto", paddingBottom: 4 },
|
|
341
364
|
hourCard: { minWidth: 72, textAlign: "center", padding: 8, borderRadius: 8, background: "#f9fafb" },
|
|
342
365
|
dayRow: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 10, padding: "8px 0", borderBottom: "1px solid #f3f4f6" },
|
|
343
|
-
|
|
344
|
-
//
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
//
|
|
357
|
-
//
|
|
366
|
+
// Card-sized: a fixed maximum width with generous, even padding, so the
|
|
367
|
+
// widget reads as a self-contained tile wherever it is dropped in.
|
|
368
|
+
compactRoot: {
|
|
369
|
+
fontFamily: "system-ui, sans-serif",
|
|
370
|
+
display: "flex",
|
|
371
|
+
flexDirection: "column",
|
|
372
|
+
gap: 14,
|
|
373
|
+
padding: 18,
|
|
374
|
+
borderRadius: 16,
|
|
375
|
+
width: "100%",
|
|
376
|
+
maxWidth: 340,
|
|
377
|
+
boxSizing: "border-box"
|
|
378
|
+
},
|
|
379
|
+
// Current conditions stack down the card; the upcoming days sit in a row
|
|
380
|
+
// along the bottom.
|
|
381
|
+
compactBody: { display: "flex", flexDirection: "column", gap: 10 },
|
|
382
|
+
compactCity: { fontSize: 15, fontWeight: 700, lineHeight: 1.2 },
|
|
383
|
+
compactHeader: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 8 },
|
|
384
|
+
compactTemp: { fontSize: 32, fontWeight: 600, lineHeight: 1 },
|
|
385
|
+
// The short-term outlook ("59 deg in 6h") trails the current temperature.
|
|
386
|
+
compactOutlook: { display: "flex", alignItems: "center", gap: 4, fontSize: 12, opacity: 0.75, whiteSpace: "nowrap" },
|
|
387
|
+
compactTime: { fontSize: 26, fontWeight: 600, lineHeight: 1.1 },
|
|
388
|
+
compactSeconds: { fontSize: 13, fontWeight: 500, opacity: 0.6 },
|
|
389
|
+
compactDate: { fontSize: 11, opacity: 0.7, marginTop: 2 },
|
|
390
|
+
compactStats: { display: "flex", flexWrap: "wrap", gap: 14, fontSize: 12, opacity: 0.9 },
|
|
391
|
+
// Three equal columns along the bottom edge, each stacking weekday / icon /
|
|
392
|
+
// high-low so the row stays readable at card width.
|
|
358
393
|
upcoming: {
|
|
359
|
-
flex: "1 1 260px",
|
|
360
394
|
display: "grid",
|
|
361
|
-
gridTemplateColumns: "
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
395
|
+
gridTemplateColumns: "repeat(3, 1fr)",
|
|
396
|
+
gap: 8,
|
|
397
|
+
paddingTop: 12,
|
|
398
|
+
borderTop: "1px solid currentColor",
|
|
399
|
+
borderTopColor: "rgba(128,128,128,0.25)",
|
|
366
400
|
fontSize: 12
|
|
367
401
|
},
|
|
368
|
-
upcomingDay: {
|
|
369
|
-
|
|
370
|
-
|
|
402
|
+
upcomingDay: { display: "flex", flexDirection: "column", alignItems: "center", gap: 4, textAlign: "center" },
|
|
403
|
+
upcomingDayName: { opacity: 0.7, whiteSpace: "nowrap" },
|
|
404
|
+
upcomingTemps: { whiteSpace: "nowrap" },
|
|
371
405
|
compactStat: { display: "flex", alignItems: "center", gap: 4, whiteSpace: "nowrap" },
|
|
372
406
|
unitSwitch: { display: "inline-flex", alignItems: "center", cursor: "pointer", userSelect: "none" },
|
|
373
407
|
rain: { color: "#2563eb", whiteSpace: "nowrap" },
|
|
@@ -424,29 +458,39 @@ function SingleWeatherForecast(props) {
|
|
|
424
458
|
const timezone = data.location?.timezone;
|
|
425
459
|
const currentDate = formatInZone(now, timezone, { weekday: "short", month: "short", day: "numeric" });
|
|
426
460
|
const currentTime = formatInZone(now, timezone, { hour: "numeric", minute: "2-digit", second: "2-digit", timeZoneName: "short" });
|
|
427
|
-
const currentClock =
|
|
461
|
+
const currentClock = clockParts(now, timezone);
|
|
428
462
|
const currentZone = zoneLabel(now, timezone);
|
|
429
463
|
if (props.compact) {
|
|
430
464
|
const forecastBase = new Date(data.current.time);
|
|
431
465
|
const today = data.daily[0];
|
|
432
466
|
const in6Hours = closestHour(data.hourly, new Date(forecastBase.getTime() + 6 * 60 * 60 * 1e3));
|
|
433
467
|
const windSpeedUnitLabel = WIND_SPEED_UNIT_LABELS[props.windSpeedUnit ?? "mph"];
|
|
434
|
-
const upcomingDays = data.daily.slice(1,
|
|
435
|
-
return /* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */ jsxs2("div", { style: styles.
|
|
468
|
+
const upcomingDays = data.daily.slice(1, 4);
|
|
469
|
+
return /* @__PURE__ */ jsxs2("div", { className: props.className, style: { ...styles.compactRoot, ...props.style }, children: [
|
|
470
|
+
/* @__PURE__ */ jsxs2("div", { style: styles.compactBody, children: [
|
|
471
|
+
/* @__PURE__ */ jsxs2("div", { style: styles.compactCity, children: [
|
|
472
|
+
data.location?.city || "Current location",
|
|
473
|
+
data.location?.region ? `, ${data.location.region}` : ""
|
|
474
|
+
] }),
|
|
437
475
|
/* @__PURE__ */ jsxs2("div", { style: styles.compactHeader, children: [
|
|
438
|
-
/* @__PURE__ */ jsx4(WeatherIcon, { condition: data.current.icon, width:
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
/* @__PURE__ */ jsx4(
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
476
|
+
/* @__PURE__ */ jsx4(WeatherIcon, { condition: data.current.icon, width: 30, height: 30, title: "Current weather" }),
|
|
477
|
+
/* @__PURE__ */ jsx4("strong", { style: styles.compactTemp, children: data.current.temperature }),
|
|
478
|
+
renderUnitSwitch(13),
|
|
479
|
+
in6Hours && /* @__PURE__ */ jsxs2("span", { style: styles.compactOutlook, children: [
|
|
480
|
+
/* @__PURE__ */ jsx4(WeatherIcon, { condition: in6Hours.icon, width: 14, height: 14, title: "In 6 hours" }),
|
|
481
|
+
in6Hours.temperature,
|
|
482
|
+
"\xB0 6h",
|
|
483
|
+
/* @__PURE__ */ jsx4(RainBadge, { probability: in6Hours.precipitationProbability, compact: true })
|
|
484
|
+
] })
|
|
485
|
+
] }),
|
|
486
|
+
/* @__PURE__ */ jsxs2("div", { children: [
|
|
487
|
+
/* @__PURE__ */ jsxs2("div", { style: styles.compactTime, children: [
|
|
488
|
+
currentClock.main,
|
|
489
|
+
currentClock.tail && /* @__PURE__ */ jsx4("span", { style: styles.compactSeconds, children: currentClock.tail })
|
|
490
|
+
] }),
|
|
491
|
+
/* @__PURE__ */ jsxs2("div", { style: styles.compactDate, children: [
|
|
492
|
+
currentDate,
|
|
493
|
+
currentZone ? ` \xB7 ${currentZone}` : ""
|
|
450
494
|
] })
|
|
451
495
|
] }),
|
|
452
496
|
/* @__PURE__ */ jsxs2("div", { style: styles.compactStats, children: [
|
|
@@ -461,33 +505,29 @@ function SingleWeatherForecast(props) {
|
|
|
461
505
|
/* @__PURE__ */ jsxs2("span", { style: styles.compactStat, children: [
|
|
462
506
|
/* @__PURE__ */ jsx4(WindIcon, { width: 16, height: 16, title: "Wind speed" }),
|
|
463
507
|
data.current.windSpeed !== void 0 ? `${Math.round(data.current.windSpeed)} ${windSpeedUnitLabel}` : "\u2014"
|
|
464
|
-
] }),
|
|
465
|
-
in6Hours && /* @__PURE__ */ jsxs2("span", { style: styles.compactStat, children: [
|
|
466
|
-
/* @__PURE__ */ jsx4(WeatherIcon, { condition: in6Hours.icon, width: 16, height: 16, title: "In 6 hours" }),
|
|
467
|
-
in6Hours.temperature,
|
|
468
|
-
"\xB0 in 6h",
|
|
469
|
-
/* @__PURE__ */ jsx4(RainBadge, { probability: in6Hours.precipitationProbability, compact: true })
|
|
470
508
|
] })
|
|
471
509
|
] })
|
|
472
510
|
] }),
|
|
473
|
-
upcomingDays.length > 0 && /* @__PURE__ */ jsx4("div", { style: styles.upcoming, children: upcomingDays.map((day
|
|
474
|
-
/* @__PURE__ */ jsx4("span", { style: styles.
|
|
475
|
-
/* @__PURE__ */ jsx4(WeatherIcon, { condition: day.icon, width:
|
|
511
|
+
upcomingDays.length > 0 && /* @__PURE__ */ jsx4("div", { style: styles.upcoming, children: upcomingDays.map((day) => /* @__PURE__ */ jsxs2("div", { style: styles.upcomingDay, title: upcomingDayDetail(day, windSpeedUnitLabel), children: [
|
|
512
|
+
/* @__PURE__ */ jsx4("span", { style: styles.upcomingDayName, children: upcomingDayLabel(day.date) }),
|
|
513
|
+
/* @__PURE__ */ jsx4(WeatherIcon, { condition: day.icon, width: 18, height: 18 }),
|
|
476
514
|
/* @__PURE__ */ jsxs2("span", { style: styles.upcomingTemps, children: [
|
|
477
515
|
/* @__PURE__ */ jsxs2("strong", { children: [
|
|
478
516
|
day.max,
|
|
479
517
|
"\xB0"
|
|
480
518
|
] }),
|
|
481
|
-
/* @__PURE__ */ jsxs2("span", { style: { opacity: 0.
|
|
519
|
+
/* @__PURE__ */ jsxs2("span", { style: { opacity: 0.6 }, children: [
|
|
482
520
|
" / ",
|
|
483
521
|
day.min,
|
|
484
522
|
"\xB0"
|
|
485
523
|
] })
|
|
486
524
|
] }),
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
|
|
525
|
+
day.precipitationProbabilityMax !== void 0 && day.precipitationProbabilityMax > 0 && /* @__PURE__ */ jsxs2("span", { style: { ...styles.rain, fontSize: 11 }, children: [
|
|
526
|
+
day.precipitationProbabilityMax,
|
|
527
|
+
"%"
|
|
528
|
+
] })
|
|
489
529
|
] }, day.date)) })
|
|
490
|
-
] })
|
|
530
|
+
] });
|
|
491
531
|
}
|
|
492
532
|
return /* @__PURE__ */ jsxs2("div", { className: props.className, style: { ...styles.root, ...props.style }, children: [
|
|
493
533
|
/* @__PURE__ */ jsxs2("div", { children: [
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/weatherCodes.ts","../src/lib/cache.ts","../src/api/geolocation.ts","../src/api/forecast.ts","../src/hooks/useWeatherForecast.ts","../src/icons/BaseIcon.tsx","../src/icons/weather-icons.tsx","../src/icons/WeatherIcon.tsx","../src/components/WeatherForecast.tsx"],"sourcesContent":["import type { WeatherCondition } from './types';\n\nexport function getWeatherIcon(code: number, isDay = 1): WeatherCondition {\n if (code === 0) return 'sun';\n if ([1, 2].includes(code)) return isDay ? 'cloud-sun' : 'clouds';\n if (code === 3) return 'clouds';\n if ([45, 48].includes(code)) return 'cloud-fog';\n if ([51, 53, 55, 56, 57].includes(code)) return 'cloud-drizzle';\n if ([61, 63].includes(code)) return 'cloud-showers';\n if ([65, 66, 67, 80, 81, 82].includes(code)) return 'cloud-showers-heavy';\n if ([71, 73, 75, 77, 85, 86].includes(code)) return 'cloud-snow';\n if (code === 95) return 'cloud-bolt';\n if ([96, 99].includes(code)) return 'cloud-hail';\n return 'clouds';\n}\n","const CACHE_PREFIX = 'weather-forecast-cache:';\nconst CACHE_TTL_MS = 30 * 60 * 1000;\n\ntype CacheEntry<T> = {\n timestamp: number;\n data: T;\n};\n\nfunction getStorage(): Storage | null {\n if (typeof window === 'undefined' || !window.localStorage) return null;\n return window.localStorage;\n}\n\n/** Returns the cached value for `key` if it was written within the last 30 minutes. */\nexport function readCachedForecast<T>(key: string): T | null {\n const storage = getStorage();\n if (!storage) return null;\n\n try {\n const raw = storage.getItem(CACHE_PREFIX + key);\n if (!raw) return null;\n\n const entry = JSON.parse(raw) as CacheEntry<T>;\n if (Date.now() - entry.timestamp > CACHE_TTL_MS) {\n storage.removeItem(CACHE_PREFIX + key);\n return null;\n }\n\n return entry.data;\n } catch {\n return null;\n }\n}\n\nexport function writeCachedForecast<T>(key: string, data: T): void {\n const storage = getStorage();\n if (!storage) return;\n\n try {\n const entry: CacheEntry<T> = { timestamp: Date.now(), data };\n storage.setItem(CACHE_PREFIX + key, JSON.stringify(entry));\n } catch {\n // Storage full or unavailable (e.g. private browsing) — safe to ignore,\n // the next call will simply hit the network again.\n }\n}\n\n/** Clears all cached forecasts. Mainly useful for tests/debugging. */\nexport function clearWeatherForecastCache(): void {\n const storage = getStorage();\n if (!storage) return;\n\n for (let i = storage.length - 1; i >= 0; i--) {\n const key = storage.key(i);\n if (key?.startsWith(CACHE_PREFIX)) storage.removeItem(key);\n }\n}\n","import type { WeatherLocation } from '../types';\n\nconst DEFAULT_IP_API_URL = 'https://ipapi.co';\n\ntype IpApiResponse = {\n city?: string;\n region?: string;\n country_name?: string;\n timezone?: string;\n latitude?: number;\n longitude?: number;\n error?: boolean;\n reason?: string;\n};\n\ntype GeoWorkerResponse = {\n city?: string;\n region?: string;\n country?: string;\n timezone?: string;\n latitude?: number | string;\n longitude?: number | string;\n};\n\nexport async function getClientLocation(geoEndpoint?: string, ip?: string): Promise<WeatherLocation> {\n if (geoEndpoint) {\n const url = ip ? `${geoEndpoint}?ip=${encodeURIComponent(ip)}` : geoEndpoint;\n const res = await fetch(url);\n if (!res.ok) throw new Error(`Geolocation worker lookup failed: ${res.status}`);\n const data: GeoWorkerResponse = await res.json();\n\n return {\n city: data.city,\n region: data.region,\n country: data.country,\n timezone: data.timezone,\n latitude: Number(data.latitude),\n longitude: Number(data.longitude),\n };\n }\n\n const res = await fetch(`${DEFAULT_IP_API_URL}/${ip ? `${encodeURIComponent(ip)}/` : ''}json/`);\n if (!res.ok) throw new Error(`ipapi.co lookup failed: ${res.status}`);\n const data: IpApiResponse = await res.json();\n\n if (data.error) {\n throw new Error(`ipapi.co lookup failed: ${data.reason ?? 'unknown error'}`);\n }\n\n return {\n city: data.city,\n region: data.region,\n country: data.country_name,\n timezone: data.timezone,\n latitude: Number(data.latitude),\n longitude: Number(data.longitude),\n };\n}\n","import type { WeatherForecastData, WeatherForecastOptions, WeatherLocation } from '../types';\nimport { getWeatherIcon } from '../weatherCodes';\nimport { getClientLocation } from './geolocation';\nimport { readCachedForecast, writeCachedForecast } from '../lib/cache';\n\nfunction buildUrl(latitude: number, longitude: number, options: WeatherForecastOptions) {\n const params = new URLSearchParams({\n latitude: String(latitude),\n longitude: String(longitude),\n timezone: options.location?.timezone || 'auto',\n temperature_unit: options.temperatureUnit || 'fahrenheit',\n wind_speed_unit: options.windSpeedUnit || 'mph',\n forecast_days: String(options.forecastDays ?? 5),\n forecast_hours: String(options.forecastHours ?? 24),\n current: [\n 'temperature_2m',\n 'weather_code',\n 'is_day',\n 'rain',\n 'showers',\n 'snowfall',\n 'wind_speed_10m',\n ].join(','),\n hourly: [\n 'temperature_2m',\n 'weather_code',\n 'precipitation_probability',\n 'rain',\n 'showers',\n 'snowfall',\n ].join(','),\n daily: [\n 'temperature_2m_max',\n 'temperature_2m_min',\n 'weather_code',\n 'precipitation_probability_max',\n 'precipitation_sum',\n 'wind_speed_10m_max',\n ].join(','),\n });\n\n return `https://api.open-meteo.com/v1/forecast?${params.toString()}`;\n}\n\nexport async function getWeatherForecast(\n options: WeatherForecastOptions = {}\n): Promise<WeatherForecastData> {\n let location: WeatherLocation;\n\n if (typeof options.latitude === 'number' && typeof options.longitude === 'number') {\n location = {\n ...options.location,\n latitude: options.latitude,\n longitude: options.longitude,\n };\n } else {\n location = await getClientLocation(options.geoEndpoint, options.ip);\n }\n\n const url = buildUrl(location.latitude, location.longitude, { ...options, location });\n\n const cached = readCachedForecast<WeatherForecastData>(url);\n if (cached) return cached;\n\n const response = await fetch(url, { headers: { 'Content-Type': 'application/json' } });\n\n if (!response.ok) {\n throw new Error(`Weather request failed: ${response.status} ${response.statusText}`);\n }\n\n const data = await response.json();\n\n if (!data?.current || !data?.hourly || !data?.daily) {\n throw new Error('Invalid weather response');\n }\n\n const result: WeatherForecastData = {\n location: { ...location, timezone: data.timezone || location.timezone },\n current: {\n time: data.current.time,\n temperature: Math.round(data.current.temperature_2m),\n weatherCode: data.current.weather_code,\n icon: getWeatherIcon(data.current.weather_code, data.current.is_day),\n isDay: data.current.is_day,\n rain: data.current.rain,\n showers: data.current.showers,\n snowfall: data.current.snowfall,\n windSpeed: data.current.wind_speed_10m,\n },\n hourly: data.hourly.time.map((time: string, index: number) => ({\n time,\n temperature: Math.round(data.hourly.temperature_2m[index]),\n weatherCode: data.hourly.weather_code[index],\n precipitationProbability: data.hourly.precipitation_probability?.[index],\n rain: data.hourly.rain?.[index],\n showers: data.hourly.showers?.[index],\n snowfall: data.hourly.snowfall?.[index],\n icon: getWeatherIcon(data.hourly.weather_code[index]),\n })),\n daily: data.daily.time.map((date: string, index: number) => ({\n date,\n min: Math.round(data.daily.temperature_2m_min[index]),\n max: Math.round(data.daily.temperature_2m_max[index]),\n weatherCode: data.daily.weather_code[index],\n precipitationProbabilityMax: data.daily.precipitation_probability_max?.[index],\n precipitationSum: data.daily.precipitation_sum?.[index],\n windSpeedMax: data.daily.wind_speed_10m_max?.[index],\n icon: getWeatherIcon(data.daily.weather_code[index]),\n })),\n };\n\n writeCachedForecast(url, result);\n return result;\n}\n","import { useEffect, useState } from 'react';\nimport type { WeatherForecastData, WeatherForecastOptions } from '../types';\nimport { getWeatherForecast } from '../api/forecast';\n\nexport function useWeatherForecast(options: WeatherForecastOptions = {}) {\n const [data, setData] = useState<WeatherForecastData | null>(null);\n const [error, setError] = useState<Error | null>(null);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n let active = true;\n setLoading(true);\n setError(null);\n\n getWeatherForecast(options)\n .then((result) => { if (active) setData(result); })\n .catch((err) => { if (active) setError(err instanceof Error ? err : new Error('Unknown error')); })\n .finally(() => { if (active) setLoading(false); });\n\n return () => { active = false; };\n }, [\n options.latitude,\n options.longitude,\n options.geoEndpoint,\n options.ip,\n options.forecastDays,\n options.forecastHours,\n options.temperatureUnit,\n options.windSpeedUnit,\n options.location?.timezone,\n ]);\n\n return { data, error, loading };\n}\n","import React from 'react';\nimport type { IconProps } from '../types';\n\nexport function BaseIcon({ title, children, ...props }: IconProps & { children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={title ? 'img' : 'presentation'}\n aria-hidden={title ? undefined : true}\n aria-label={title}\n {...props}\n >\n {title ? <title>{title}</title> : null}\n {children}\n </svg>\n );\n}\n","import React from 'react';\nimport type { IconProps } from '../types';\nimport { BaseIcon } from './BaseIcon';\n\nexport const CloudBoltIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M7 18a4.815 4.815 0 0 1-3.327-1.318A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 0 7h-1m-4.75-5L11 17.5h3.375l-2.25 4.5\" /></BaseIcon>\n);\nexport const CloudDrizzleIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M12 18v1m-3-4v1m6-1v1m2 3v1M7 19v1m-3-3.034a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662\" /></BaseIcon>\n);\nexport const CloudFogIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M5 21h7m4 0h3M8 17h8\" /></BaseIcon>\n);\nexport const CloudHailIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8 17.45v.1m-1.5 3.9v.1m10.5-4.1v.1m-1.5 3.9v.1m-3-4.1v.1m-1.5 3.9v.1m10.475-4.575A3.5 3.5 0 0 0 19 11h-1c.146-.65.148-1.32.006-1.97a4.784 4.784 0 0 0-.831-1.823 5.36 5.36 0 0 0-1.544-1.398 5.964 5.964 0 0 0-2.02-.759 6.224 6.224 0 0 0-2.19-.006 5.971 5.971 0 0 0-2.024.749C8.157 6.533 7.295 7.687 7 9a4.815 4.815 0 0 0-3.327 1.318A4.403 4.403 0 0 0 2.295 13.5c0 1.194.496 2.338 1.378 3.182.105.1.214.195.327.284m4.5.534a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm10.5-4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-3-4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z\" /></BaseIcon>\n);\nexport const CloudShowersIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M12 13v2m0 3v2m4-5v2m0 3v2m-8-7v2m0 3v2\" /></BaseIcon>\n);\nexport const CloudShowersHeavyIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M16 15v6m-8-6v6m4-8v6\" /></BaseIcon>\n);\nexport const CloudSleetIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M13.5 17.45a1 1 0 1 0-2 0h2Zm-2 .1a1 1 0 1 0 2 0h-2Zm.5 3.9a1 1 0 1 0-2 0h2Zm-2 .1a1 1 0 1 0 2 0h-2Zm-6.327-4.868.692-.723-.692.723ZM7 9v1a1 1 0 0 0 .976-.781L7 9Zm2.397-3.207.512.858-.512-.858ZM18 11l-.976-.219A1 1 0 0 0 18 12v-1Zm2.768 5.268a1 1 0 0 0 1.414 1.414l-.707-.707-.707-.707ZM3.379 17.75a1 1 0 0 0 1.242-1.567L4 16.966l-.62.784Zm5.55-.379a1 1 0 0 0-1.857-.742L8 17l.928.371ZM5.071 21.63a1 1 0 0 0 1.856.742L6 22l-.928-.371Zm13.857-4.258a1 1 0 0 0-1.857-.742L18 17l.928.371Zm-3.857 4.258a1 1 0 0 0 1.857.742L16 22l-.928-.371ZM13 17.5h-1a.5.5 0 0 1 .5-.5v2a1.5 1.5 0 0 0 1.5-1.5h-1Zm-.5.5v-1a.5.5 0 0 1 .5.5h-2a1.5 1.5 0 0 0 1.5 1.5v-1Zm-.5-.5h1a.5.5 0 0 1-.5.5v-2a1.5 1.5 0 0 0-1.5 1.5h1Zm.5-.5v1a.5.5 0 0 1-.5-.5h2a1.5 1.5 0 0 0-1.5-1.5v1Zm0 .45h-1v.1h2v-.1h-1Zm-1 4.05h-1a.5.5 0 0 1 .5-.5v2a1.5 1.5 0 0 0 1.5-1.5h-1Zm-.5.5v-1a.5.5 0 0 1 .5.5h-2A1.5 1.5 0 0 0 11 23v-1Zm-.5-.5h1a.5.5 0 0 1-.5.5v-2a1.5 1.5 0 0 0-1.5 1.5h1Zm.5-.5v1a.5.5 0 0 1-.5-.5h2A1.5 1.5 0 0 0 11 20v1Zm0 .45h-1v.1h2v-.1h-1Zm-7.327-4.768.692-.723a3.403 3.403 0 0 1-1.07-2.459h-2c0 1.473.613 2.877 1.687 3.905l.691-.723ZM2.295 13.5h1c0-.914.38-1.8 1.07-2.46l-.692-.722-.69-.723A5.403 5.403 0 0 0 1.294 13.5h1Zm1.378-3.182.692.723A3.815 3.815 0 0 1 7 10V8c-1.499 0-2.945.57-4.018 1.595l.691.723ZM7 9l.976.219c.23-1.024.91-1.956 1.933-2.568l-.512-.858-.513-.859c-1.456.87-2.5 2.245-2.86 3.847L7 9Zm2.397-3.207.512.858a4.972 4.972 0 0 1 1.686-.622l-.173-.985-.174-.985a6.971 6.971 0 0 0-2.364.875l.513.859Zm2.025-.749.173.985a5.223 5.223 0 0 1 1.837.005l.18-.984.178-.984a7.223 7.223 0 0 0-2.542-.007l.174.985Zm2.19.006-.18.984c.606.11 1.177.326 1.681.631l.518-.856.518-.855a6.963 6.963 0 0 0-2.359-.888l-.179.984Zm2.02.76-.519.855c.505.305.93.693 1.257 1.136l.805-.594.805-.594a6.361 6.361 0 0 0-1.831-1.659l-.518.855Zm1.543 1.397-.805.594c.326.442.549.932.66 1.441l.976-.212.978-.213a5.786 5.786 0 0 0-1.005-2.204l-.804.594Zm.831 1.823-.977.212c.111.509.11 1.031-.005 1.539L18 11l.976.219c.178-.792.18-1.609.008-2.402l-.978.213ZM18 11v1h1v-2h-1v1Zm1 0v1a2.5 2.5 0 0 1 1.768.732l.707-.707.707-.707A4.5 4.5 0 0 0 19 10v1Zm2.475 1.025-.707.707A2.5 2.5 0 0 1 21.5 14.5h2a4.5 4.5 0 0 0-1.318-3.182l-.707.707ZM22.5 14.5h-1a2.5 2.5 0 0 1-.732 1.768l.707.707.707.707A4.5 4.5 0 0 0 23.5 14.5h-1ZM4 16.966l.62-.784a3.684 3.684 0 0 1-.255-.223l-.692.723-.69.723c.126.121.259.237.396.345L4 16.966ZM8 17l-.928-.371-2 5L6 22l.928.371 2-5L8 17Zm10 0-.928-.371-2 5L16 22l.928.371 2-5L18 17Z\" /></BaseIcon>\n);\nexport const CloudSnowIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8 15h2m-1-1v2m5-1h2m-1-1v2M5 21h2m-1-1v2m5-2h2m-1-1v2m5 0h2m-1-1v2M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662\" /></BaseIcon>\n);\nexport const CloudSunIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M10.201 19.997c-1.977 0-3.58-1.544-3.58-3.448 0-1.903 1.603-3.446 3.58-3.446.303-1.355 1.38-2.461 2.827-2.902 1.445-.44 3.042-.148 4.186.77 1.144.915 1.663 2.312 1.361 3.667h.761c1.472 0 2.664 1.2 2.664 2.68A2.672 2.672 0 0 1 19.336 20h-9.134m2.66-12.934a4.166 4.166 0 0 0-2.677-1.732m2.677 1.732 2.744-1.892m-2.744 1.892c.55.796.802 1.754.723 2.709m-3.4-4.44a4.167 4.167 0 0 0-3.118.667m3.118-.668.602-3.278m-3.72 3.946A4.167 4.167 0 0 0 5.334 8.68m1.733-2.678L5.174 3.26m.16 5.42c-.2 1.088.041 2.21.669 3.12m-.669-3.12-3.278-.601m3.947 3.72-2.744 1.893m2.744-1.893a4.167 4.167 0 0 0 2.174 1.607\" /></BaseIcon>\n);\nexport const CloudsIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8.958 21.05C6.772 21.05 5 19.344 5 17.24s1.772-3.81 3.958-3.81c.335-1.498 1.525-2.72 3.124-3.207 1.598-.487 3.363-.164 4.628.85 1.264 1.011 1.837 2.556 1.504 4.053h.842A2.953 2.953 0 0 1 22 18.09a2.954 2.954 0 0 1-2.945 2.964H8.958M18 8c-.5-2.5-3.532-3.401-5.5-2.5a3.117 3.117 0 0 0-2.11-2.312c-1.352-.411-2.845-.138-3.915.72-1.07.855-1.554 2.161-1.273 3.428h-.711A2.498 2.498 0 0 0 2 9.843c0 1.094.695 2.023 1.666 2.366\" /></BaseIcon>\n);\nexport const SnowflakeIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"m9.25 4-1 2H6m-2.25 4L5 12m0 0-1.25 2M5 12h3m-3 0H2.5m17.75-2L19 12l1.25 2M6 18h2.25l1 2M14 9h-4m4 0 3-5m-3 5 2 3m-6-3L7 4m3 5-2 3m0 0 2 3m0 0-3 5m3-5h4m2-3-2 3m2-3h5.5M14 15l3 5M14.75 4l1 2H18m0 12h-2.25l-1 2\" /></BaseIcon>\n);\nexport const SunIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M12 4V2m0 20v-2m10-8h-2M4 12H2m15.657-5.657 1.414-1.414M4.93 19.07l1.414-1.414m12.728 1.414-1.414-1.414M6.343 6.343 4.93 4.929M7 12a5 5 0 1 0 10 0 5 5 0 0 0-10 0Z\" /></BaseIcon>\n);\nexport const WindIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2\" /></BaseIcon>\n);\n","import React from 'react';\nimport type { IconProps, WeatherCondition } from '../types';\nimport {\n CloudBoltIcon,\n CloudDrizzleIcon,\n CloudFogIcon,\n CloudHailIcon,\n CloudShowersHeavyIcon,\n CloudShowersIcon,\n CloudSleetIcon,\n CloudSnowIcon,\n CloudSunIcon,\n CloudsIcon,\n SnowflakeIcon,\n SunIcon,\n} from './weather-icons';\n\nconst iconMap: Record<WeatherCondition, React.ComponentType<IconProps>> = {\n sun: SunIcon,\n 'cloud-sun': CloudSunIcon,\n clouds: CloudsIcon,\n 'cloud-fog': CloudFogIcon,\n 'cloud-drizzle': CloudDrizzleIcon,\n 'cloud-showers': CloudShowersIcon,\n 'cloud-showers-heavy': CloudShowersHeavyIcon,\n 'cloud-sleet': CloudSleetIcon,\n 'cloud-snow': CloudSnowIcon,\n snowflake: SnowflakeIcon,\n 'cloud-bolt': CloudBoltIcon,\n 'cloud-hail': CloudHailIcon,\n};\n\nexport function WeatherIcon({ condition, ...props }: IconProps & { condition: WeatherCondition }) {\n const Icon = iconMap[condition] || CloudsIcon;\n return <Icon {...props} />;\n}\n","import React, { useEffect, useState } from 'react';\nimport { useWeatherForecast } from '../hooks/useWeatherForecast';\nimport type { HourlyWeather, TemperatureUnit, WeatherForecastOptions, WindSpeedUnit } from '../types';\nimport { WeatherIcon } from '../icons/WeatherIcon';\nimport { WindIcon } from '../icons/weather-icons';\n\ntype Props = WeatherForecastOptions & {\n className?: string;\n style?: React.CSSProperties;\n compact?: boolean;\n};\n\nconst WIND_SPEED_UNIT_LABELS: Record<WindSpeedUnit, string> = {\n kmh: 'km/h',\n mph: 'mph',\n ms: 'm/s',\n kn: 'kn',\n};\n\nfunction closestHour(hourly: HourlyWeather[], targetTime: Date): HourlyWeather | undefined {\n return hourly.reduce<HourlyWeather | undefined>((closest, hour) => {\n const diff = Math.abs(new Date(hour.time).getTime() - targetTime.getTime());\n const closestDiff = closest ? Math.abs(new Date(closest.time).getTime() - targetTime.getTime()) : Infinity;\n return diff < closestDiff ? hour : closest;\n }, undefined);\n}\n\n// Format a real instant in a specific IANA timezone, falling back to the\n// browser's local zone if the timezone string is missing or invalid.\nfunction formatInZone(instant: Date, timezone: string | undefined, options: Intl.DateTimeFormatOptions): string {\n try {\n return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || undefined }).format(instant);\n } catch {\n return new Intl.DateTimeFormat([], options).format(instant);\n }\n}\n\n// Just the zone abbreviation (e.g. \"GMT+2\"), so it can be shown apart from the\n// clock itself.\nfunction zoneLabel(instant: Date, timezone: string | undefined): string {\n const options: Intl.DateTimeFormatOptions = { hour: 'numeric', timeZoneName: 'short' };\n try {\n const format = (() => {\n try {\n return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || undefined });\n } catch {\n return new Intl.DateTimeFormat([], options);\n }\n })();\n return format.formatToParts(instant).find((part) => part.type === 'timeZoneName')?.value ?? '';\n } catch {\n return '';\n }\n}\n\n// Daily dates arrive as plain \"YYYY-MM-DD\" calendar days; `new Date(...)` would\n// read those as UTC midnight and roll back a day in western timezones, so build\n// the date from its parts and let it stay a local calendar day.\nfunction parseCalendarDate(date: string): Date {\n const [year, month, day] = date.split('-').map(Number);\n if (!year || !month || !day) return new Date(date);\n return new Date(year, month - 1, day);\n}\n\n// The day right after today reads better as \"Tomorrow\" than as its weekday.\nfunction upcomingDayLabel(date: string, offsetFromToday: number): string {\n if (offsetFromToday === 1) return 'Tomorrow';\n return parseCalendarDate(date).toLocaleDateString([], { weekday: 'long' });\n}\n\nconst styles = {\n root: {\n fontFamily: 'system-ui, sans-serif',\n border: '1px solid #e5e7eb',\n borderRadius: 12,\n padding: 16,\n background: '#fff',\n color: '#111827',\n maxWidth: 640,\n } as React.CSSProperties,\n row: { display: 'flex', alignItems: 'center', gap: 8 } as React.CSSProperties,\n hours: { display: 'flex', gap: 12, overflowX: 'auto', paddingBottom: 4 } as React.CSSProperties,\n hourCard: { minWidth: 72, textAlign: 'center' as const, padding: 8, borderRadius: 8, background: '#f9fafb' },\n dayRow: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 10, padding: '8px 0', borderBottom: '1px solid #f3f4f6' } as React.CSSProperties,\n compactRoot: { fontFamily: 'system-ui, sans-serif', display: 'flex', flexDirection: 'column', gap: 8, padding: '10px 14px', borderRadius: 8 } as React.CSSProperties,\n // Current conditions on the left, upcoming days on the right; both columns\n // wrap to full width when the widget is too narrow to hold them side by side.\n compactBody: { display: 'flex', flexWrap: 'wrap', alignItems: 'flex-start', gap: 12 } as React.CSSProperties,\n compactCurrent: { flex: '1 1 45%', minWidth: 140, display: 'flex', flexDirection: 'column', gap: 8 } as React.CSSProperties,\n compactHeader: { display: 'flex', alignItems: 'center', gap: 10 } as React.CSSProperties,\n compactHeaderText: { display: 'flex', alignItems: 'baseline', gap: 8, flexWrap: 'wrap' } as React.CSSProperties,\n compactTime: { fontSize: 18, fontWeight: 600, lineHeight: 1.15 } as React.CSSProperties,\n compactDate: { fontSize: 11, opacity: 0.7 } as React.CSSProperties,\n compactStats: { display: 'flex', flexWrap: 'wrap', gap: 12, fontSize: 12, opacity: 0.9 } as React.CSSProperties,\n // A shared grid keeps the day / icon / temps / rain / wind columns aligned\n // across every upcoming row.\n // Columns are content-sized (so no column can be squeezed away) and the spare\n // width is spread between them; that also makes the grid's min-content width\n // large enough to wrap below the current conditions on narrow screens.\n upcoming: {\n flex: '1 1 260px',\n display: 'grid',\n gridTemplateColumns: 'auto auto auto auto auto',\n justifyContent: 'space-between',\n alignItems: 'center',\n columnGap: 10,\n rowGap: 6,\n fontSize: 12,\n } as React.CSSProperties,\n upcomingDay: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', opacity: 0.85 } as React.CSSProperties,\n upcomingTemps: { whiteSpace: 'nowrap', textAlign: 'right' } as React.CSSProperties,\n upcomingMetric: { whiteSpace: 'nowrap', textAlign: 'right', opacity: 0.7 } as React.CSSProperties,\n compactStat: { display: 'flex', alignItems: 'center', gap: 4, whiteSpace: 'nowrap' } as React.CSSProperties,\n unitSwitch: { display: 'inline-flex', alignItems: 'center', cursor: 'pointer', userSelect: 'none' } as React.CSSProperties,\n rain: { color: '#2563eb', whiteSpace: 'nowrap' } as React.CSSProperties,\n tz: { fontSize: 12, opacity: 0.7, marginTop: 2 } as React.CSSProperties,\n list: { display: 'flex', flexDirection: 'column' } as React.CSSProperties,\n};\n\n// Precipitation chance is only surfaced when there is a non-zero chance of it.\nfunction RainBadge({ probability, compact }: { probability?: number; compact?: boolean }) {\n if (probability === undefined || probability === null || probability <= 0) return null;\n return <span style={styles.rain}>{compact ? ` · ${probability}%` : ` · ${probability}% rain`}</span>;\n}\n\n/**\n * Renders one location's forecast: a live current time (ticking, in the\n * location's own timezone), a clickable degF / degC unit switch, high/low and\n * precipitation for the next hours and days.\n */\nfunction SingleWeatherForecast(props: Props) {\n // Temperature unit is local state so the degF / degC switch can toggle it;\n // it is seeded from (and re-synced to) the temperatureUnit prop.\n const [unit, setUnit] = useState<TemperatureUnit>(props.temperatureUnit ?? 'fahrenheit');\n useEffect(() => {\n setUnit(props.temperatureUnit ?? 'fahrenheit');\n }, [props.temperatureUnit]);\n\n const { data, loading, error } = useWeatherForecast({ ...props, temperatureUnit: unit });\n\n // A ticking clock so the displayed current time stays accurate to the second.\n const [now, setNow] = useState(() => new Date());\n useEffect(() => {\n const id = setInterval(() => setNow(new Date()), 1000);\n return () => clearInterval(id);\n }, []);\n\n const toggleUnit = () => setUnit((u) => (u === 'celsius' ? 'fahrenheit' : 'celsius'));\n\n const renderUnitSwitch = (fontSize: number) => (\n <span\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation();\n toggleUnit();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggleUnit();\n }\n }}\n title=\"Switch temperature units\"\n aria-label={`Switch temperature units, currently ${unit === 'celsius' ? 'Celsius' : 'Fahrenheit'}`}\n style={{ ...styles.unitSwitch, fontSize }}\n >\n <span style={{ fontWeight: unit === 'fahrenheit' ? 700 : 400, opacity: unit === 'fahrenheit' ? 1 : 0.45 }}>°F</span>\n <span style={{ opacity: 0.4, margin: '0 3px' }}>|</span>\n <span style={{ fontWeight: unit === 'celsius' ? 700 : 400, opacity: unit === 'celsius' ? 1 : 0.45 }}>°C</span>\n </span>\n );\n\n // Keep showing the last forecast while a unit switch refetches in the\n // background; only suppress output on the very first load.\n if (loading && !data) return null;\n if (error) return <div className={props.className} style={props.style}>Error: {error.message}</div>;\n if (!data) return <div className={props.className} style={props.style}>No forecast available.</div>;\n\n const timezone = data.location?.timezone;\n const currentDate = formatInZone(now, timezone, { weekday: 'short', month: 'short', day: 'numeric' });\n const currentTime = formatInZone(now, timezone, { hour: 'numeric', minute: '2-digit', second: '2-digit', timeZoneName: 'short' });\n // The compact layout shows the clock at a larger size, so the zone label is\n // split off onto the smaller date line to keep the time on one line.\n const currentClock = formatInZone(now, timezone, { hour: 'numeric', minute: '2-digit', second: '2-digit' });\n const currentZone = zoneLabel(now, timezone);\n\n if (props.compact) {\n const forecastBase = new Date(data.current.time);\n const today = data.daily[0];\n const in6Hours = closestHour(data.hourly, new Date(forecastBase.getTime() + 6 * 60 * 60 * 1000));\n const windSpeedUnitLabel = WIND_SPEED_UNIT_LABELS[props.windSpeedUnit ?? 'mph'];\n // Today already has its own column on the left, so the upcoming list starts\n // at tomorrow and stays short enough to sit beside it.\n const upcomingDays = data.daily.slice(1, 5);\n\n return (\n <div className={props.className} style={{ ...styles.compactRoot, ...props.style }}>\n <div style={styles.compactBody}>\n <div style={styles.compactCurrent}>\n <div style={styles.compactHeader}>\n <WeatherIcon condition={data.current.icon} width={24} height={24} title=\"Current weather\" />\n <div>\n <div style={styles.compactHeaderText}>\n <strong style={{ fontSize: 16 }}>{data.current.temperature}</strong>\n {renderUnitSwitch(12)}\n <span style={{ fontSize: 14, opacity: 0.8 }}>\n {data.location?.city || 'Current location'}\n </span>\n </div>\n <div style={styles.compactTime}>{currentClock}</div>\n <div style={styles.compactDate}>\n {currentDate}\n {currentZone ? ` · ${currentZone}` : ''}\n </div>\n </div>\n </div>\n\n <div style={styles.compactStats}>\n {today && (\n <span style={styles.compactStat}>\n <WeatherIcon condition={today.icon} width={16} height={16} title=\"Today's high and low\" />\n {today.max}° / {today.min}°\n <RainBadge probability={today.precipitationProbabilityMax} compact />\n </span>\n )}\n <span style={styles.compactStat}>\n <WindIcon width={16} height={16} title=\"Wind speed\" />\n {data.current.windSpeed !== undefined ? `${Math.round(data.current.windSpeed)} ${windSpeedUnitLabel}` : '—'}\n </span>\n {in6Hours && (\n <span style={styles.compactStat}>\n <WeatherIcon condition={in6Hours.icon} width={16} height={16} title=\"In 6 hours\" />\n {in6Hours.temperature}° in 6h\n <RainBadge probability={in6Hours.precipitationProbability} compact />\n </span>\n )}\n </div>\n </div>\n\n {upcomingDays.length > 0 && (\n <div style={styles.upcoming}>\n {upcomingDays.map((day, index) => (\n <React.Fragment key={day.date}>\n <span style={styles.upcomingDay}>{upcomingDayLabel(day.date, index + 1)}</span>\n <WeatherIcon condition={day.icon} width={16} height={16} />\n <span style={styles.upcomingTemps}>\n <strong>{day.max}°</strong>\n <span style={{ opacity: 0.7 }}> / {day.min}°</span>\n </span>\n <span style={styles.upcomingMetric}>\n {day.precipitationSum !== undefined ? `${day.precipitationSum.toFixed(1)} mm` : '—'}\n </span>\n <span style={styles.upcomingMetric}>\n {day.windSpeedMax !== undefined ? `${day.windSpeedMax.toFixed(1)} ${windSpeedUnitLabel}` : '—'}\n </span>\n </React.Fragment>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n }\n\n return (\n <div className={props.className} style={{ ...styles.root, ...props.style }}>\n <div>\n <h3 style={{ margin: 0, fontSize: 20 }}>\n {data.location?.city || 'Current location'}\n {data.location?.region ? `, ${data.location.region}` : ''}\n </h3>\n <div style={styles.tz}>\n {currentDate} · {currentTime}\n {timezone ? ` · ${timezone}` : ''}\n </div>\n <div style={{ ...styles.row, marginTop: 8 }}>\n <WeatherIcon condition={data.current.icon} width={28} height={28} title=\"Current weather\" />\n <strong style={{ fontSize: 28 }}>{data.current.temperature}</strong>\n {renderUnitSwitch(14)}\n </div>\n </div>\n\n <div style={{ marginTop: 20 }}>\n <h4 style={{ margin: '0 0 10px 0' }}>Next hours</h4>\n <div style={styles.hours}>\n {data.hourly.slice(0, props.forecastHours ?? 12).map((hour) => (\n <div key={hour.time} style={styles.hourCard}>\n <div style={{ fontSize: 12 }}>{new Date(hour.time).toLocaleTimeString([], { hour: 'numeric' })}</div>\n <WeatherIcon condition={hour.icon} width={20} height={20} style={{ margin: '6px auto' }} />\n <div>{hour.temperature}°</div>\n {hour.precipitationProbability !== undefined && hour.precipitationProbability > 0 && (\n <div style={{ ...styles.rain, fontSize: 12 }}>{hour.precipitationProbability}%</div>\n )}\n </div>\n ))}\n </div>\n </div>\n\n <div style={{ marginTop: 20 }}>\n <h4 style={{ margin: '0 0 10px 0' }}>Next days</h4>\n <div>\n {data.daily.map((day) => (\n <div key={day.date} style={styles.dayRow}>\n <div style={{ width: 120 }}>{new Date(day.date).toLocaleDateString([], { weekday: 'short', month: 'short', day: 'numeric' })}</div>\n <WeatherIcon condition={day.icon} width={20} height={20} />\n <div>\n {day.min}° / {day.max}°\n {day.precipitationProbabilityMax !== undefined && day.precipitationProbabilityMax > 0 && (\n <span style={styles.rain}> · {day.precipitationProbabilityMax}%</span>\n )}\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * Weather forecast widget. When `locations` is provided, one forecast is\n * rendered per location; otherwise a single auto-detected forecast is shown.\n */\nexport function WeatherForecast(props: Props) {\n const { locations, ...rest } = props;\n\n if (locations && locations.length > 0) {\n const gap = props.compact ? 8 : 16;\n return (\n <div style={{ ...styles.list, gap }}>\n {locations.map((loc, index) => (\n <SingleWeatherForecast\n key={`${loc.label ?? ''}:${loc.latitude ?? ''}:${loc.longitude ?? ''}:${index}`}\n {...rest}\n latitude={typeof loc.latitude === 'number' ? loc.latitude : undefined}\n longitude={typeof loc.longitude === 'number' ? loc.longitude : undefined}\n location={{ city: loc.label, timezone: loc.timezone }}\n />\n ))}\n </div>\n );\n }\n\n return <SingleWeatherForecast {...rest} />;\n}\n"],"mappings":";AAEO,SAAS,eAAe,MAAc,QAAQ,GAAqB;AACxE,MAAI,SAAS,EAAG,QAAO;AACvB,MAAI,CAAC,GAAG,CAAC,EAAE,SAAS,I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,IAAI,aAAa,EAAE,IAAI,KAAK;AAAA,IAK/E,CACD,GACH;AAAA,EAEJ;AAEA,SAAO,gBAAAA,KAAC,yBAAuB,GAAG,MAAM;AAC1C;","names":["res","data","jsx","jsx","useEffect","useState","jsx","jsxs","useState","useEffect"]}
|
|
1
|
+
{"version":3,"sources":["../src/weatherCodes.ts","../src/lib/cache.ts","../src/api/geolocation.ts","../src/api/forecast.ts","../src/hooks/useWeatherForecast.ts","../src/icons/BaseIcon.tsx","../src/icons/weather-icons.tsx","../src/icons/WeatherIcon.tsx","../src/components/WeatherForecast.tsx"],"sourcesContent":["import type { WeatherCondition } from './types';\n\nexport function getWeatherIcon(code: number, isDay = 1): WeatherCondition {\n if (code === 0) return 'sun';\n if ([1, 2].includes(code)) return isDay ? 'cloud-sun' : 'clouds';\n if (code === 3) return 'clouds';\n if ([45, 48].includes(code)) return 'cloud-fog';\n if ([51, 53, 55, 56, 57].includes(code)) return 'cloud-drizzle';\n if ([61, 63].includes(code)) return 'cloud-showers';\n if ([65, 66, 67, 80, 81, 82].includes(code)) return 'cloud-showers-heavy';\n if ([71, 73, 75, 77, 85, 86].includes(code)) return 'cloud-snow';\n if (code === 95) return 'cloud-bolt';\n if ([96, 99].includes(code)) return 'cloud-hail';\n return 'clouds';\n}\n","const CACHE_PREFIX = 'weather-forecast-cache:';\nconst CACHE_TTL_MS = 30 * 60 * 1000;\n\ntype CacheEntry<T> = {\n timestamp: number;\n data: T;\n};\n\nfunction getStorage(): Storage | null {\n if (typeof window === 'undefined' || !window.localStorage) return null;\n return window.localStorage;\n}\n\n/** Returns the cached value for `key` if it was written within the last 30 minutes. */\nexport function readCachedForecast<T>(key: string): T | null {\n const storage = getStorage();\n if (!storage) return null;\n\n try {\n const raw = storage.getItem(CACHE_PREFIX + key);\n if (!raw) return null;\n\n const entry = JSON.parse(raw) as CacheEntry<T>;\n if (Date.now() - entry.timestamp > CACHE_TTL_MS) {\n storage.removeItem(CACHE_PREFIX + key);\n return null;\n }\n\n return entry.data;\n } catch {\n return null;\n }\n}\n\nexport function writeCachedForecast<T>(key: string, data: T): void {\n const storage = getStorage();\n if (!storage) return;\n\n try {\n const entry: CacheEntry<T> = { timestamp: Date.now(), data };\n storage.setItem(CACHE_PREFIX + key, JSON.stringify(entry));\n } catch {\n // Storage full or unavailable (e.g. private browsing) — safe to ignore,\n // the next call will simply hit the network again.\n }\n}\n\n/** Clears all cached forecasts. Mainly useful for tests/debugging. */\nexport function clearWeatherForecastCache(): void {\n const storage = getStorage();\n if (!storage) return;\n\n for (let i = storage.length - 1; i >= 0; i--) {\n const key = storage.key(i);\n if (key?.startsWith(CACHE_PREFIX)) storage.removeItem(key);\n }\n}\n","import type { WeatherLocation } from '../types';\n\nconst DEFAULT_IP_API_URL = 'https://ipapi.co';\n\ntype IpApiResponse = {\n city?: string;\n region?: string;\n country_name?: string;\n timezone?: string;\n latitude?: number;\n longitude?: number;\n error?: boolean;\n reason?: string;\n};\n\ntype GeoWorkerResponse = {\n city?: string;\n region?: string;\n country?: string;\n timezone?: string;\n latitude?: number | string;\n longitude?: number | string;\n};\n\nexport async function getClientLocation(geoEndpoint?: string, ip?: string): Promise<WeatherLocation> {\n if (geoEndpoint) {\n const url = ip ? `${geoEndpoint}?ip=${encodeURIComponent(ip)}` : geoEndpoint;\n const res = await fetch(url);\n if (!res.ok) throw new Error(`Geolocation worker lookup failed: ${res.status}`);\n const data: GeoWorkerResponse = await res.json();\n\n return {\n city: data.city,\n region: data.region,\n country: data.country,\n timezone: data.timezone,\n latitude: Number(data.latitude),\n longitude: Number(data.longitude),\n };\n }\n\n const res = await fetch(`${DEFAULT_IP_API_URL}/${ip ? `${encodeURIComponent(ip)}/` : ''}json/`);\n if (!res.ok) throw new Error(`ipapi.co lookup failed: ${res.status}`);\n const data: IpApiResponse = await res.json();\n\n if (data.error) {\n throw new Error(`ipapi.co lookup failed: ${data.reason ?? 'unknown error'}`);\n }\n\n return {\n city: data.city,\n region: data.region,\n country: data.country_name,\n timezone: data.timezone,\n latitude: Number(data.latitude),\n longitude: Number(data.longitude),\n };\n}\n","import type { WeatherForecastData, WeatherForecastOptions, WeatherLocation } from '../types';\nimport { getWeatherIcon } from '../weatherCodes';\nimport { getClientLocation } from './geolocation';\nimport { readCachedForecast, writeCachedForecast } from '../lib/cache';\n\nfunction buildUrl(latitude: number, longitude: number, options: WeatherForecastOptions) {\n const params = new URLSearchParams({\n latitude: String(latitude),\n longitude: String(longitude),\n timezone: options.location?.timezone || 'auto',\n temperature_unit: options.temperatureUnit || 'fahrenheit',\n wind_speed_unit: options.windSpeedUnit || 'mph',\n forecast_days: String(options.forecastDays ?? 5),\n forecast_hours: String(options.forecastHours ?? 24),\n current: [\n 'temperature_2m',\n 'weather_code',\n 'is_day',\n 'rain',\n 'showers',\n 'snowfall',\n 'wind_speed_10m',\n ].join(','),\n hourly: [\n 'temperature_2m',\n 'weather_code',\n 'precipitation_probability',\n 'rain',\n 'showers',\n 'snowfall',\n ].join(','),\n daily: [\n 'temperature_2m_max',\n 'temperature_2m_min',\n 'weather_code',\n 'precipitation_probability_max',\n 'precipitation_sum',\n 'wind_speed_10m_max',\n ].join(','),\n });\n\n return `https://api.open-meteo.com/v1/forecast?${params.toString()}`;\n}\n\nexport async function getWeatherForecast(\n options: WeatherForecastOptions = {}\n): Promise<WeatherForecastData> {\n let location: WeatherLocation;\n\n if (typeof options.latitude === 'number' && typeof options.longitude === 'number') {\n location = {\n ...options.location,\n latitude: options.latitude,\n longitude: options.longitude,\n };\n } else {\n location = await getClientLocation(options.geoEndpoint, options.ip);\n }\n\n const url = buildUrl(location.latitude, location.longitude, { ...options, location });\n\n const cached = readCachedForecast<WeatherForecastData>(url);\n if (cached) return cached;\n\n const response = await fetch(url, { headers: { 'Content-Type': 'application/json' } });\n\n if (!response.ok) {\n throw new Error(`Weather request failed: ${response.status} ${response.statusText}`);\n }\n\n const data = await response.json();\n\n if (!data?.current || !data?.hourly || !data?.daily) {\n throw new Error('Invalid weather response');\n }\n\n const result: WeatherForecastData = {\n location: { ...location, timezone: data.timezone || location.timezone },\n current: {\n time: data.current.time,\n temperature: Math.round(data.current.temperature_2m),\n weatherCode: data.current.weather_code,\n icon: getWeatherIcon(data.current.weather_code, data.current.is_day),\n isDay: data.current.is_day,\n rain: data.current.rain,\n showers: data.current.showers,\n snowfall: data.current.snowfall,\n windSpeed: data.current.wind_speed_10m,\n },\n hourly: data.hourly.time.map((time: string, index: number) => ({\n time,\n temperature: Math.round(data.hourly.temperature_2m[index]),\n weatherCode: data.hourly.weather_code[index],\n precipitationProbability: data.hourly.precipitation_probability?.[index],\n rain: data.hourly.rain?.[index],\n showers: data.hourly.showers?.[index],\n snowfall: data.hourly.snowfall?.[index],\n icon: getWeatherIcon(data.hourly.weather_code[index]),\n })),\n daily: data.daily.time.map((date: string, index: number) => ({\n date,\n min: Math.round(data.daily.temperature_2m_min[index]),\n max: Math.round(data.daily.temperature_2m_max[index]),\n weatherCode: data.daily.weather_code[index],\n precipitationProbabilityMax: data.daily.precipitation_probability_max?.[index],\n precipitationSum: data.daily.precipitation_sum?.[index],\n windSpeedMax: data.daily.wind_speed_10m_max?.[index],\n icon: getWeatherIcon(data.daily.weather_code[index]),\n })),\n };\n\n writeCachedForecast(url, result);\n return result;\n}\n","import { useEffect, useState } from 'react';\nimport type { WeatherForecastData, WeatherForecastOptions } from '../types';\nimport { getWeatherForecast } from '../api/forecast';\n\nexport function useWeatherForecast(options: WeatherForecastOptions = {}) {\n const [data, setData] = useState<WeatherForecastData | null>(null);\n const [error, setError] = useState<Error | null>(null);\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n let active = true;\n setLoading(true);\n setError(null);\n\n getWeatherForecast(options)\n .then((result) => { if (active) setData(result); })\n .catch((err) => { if (active) setError(err instanceof Error ? err : new Error('Unknown error')); })\n .finally(() => { if (active) setLoading(false); });\n\n return () => { active = false; };\n }, [\n options.latitude,\n options.longitude,\n options.geoEndpoint,\n options.ip,\n options.forecastDays,\n options.forecastHours,\n options.temperatureUnit,\n options.windSpeedUnit,\n options.location?.timezone,\n ]);\n\n return { data, error, loading };\n}\n","import React from 'react';\nimport type { IconProps } from '../types';\n\nexport function BaseIcon({ title, children, ...props }: IconProps & { children: React.ReactNode }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={title ? 'img' : 'presentation'}\n aria-hidden={title ? undefined : true}\n aria-label={title}\n {...props}\n >\n {title ? <title>{title}</title> : null}\n {children}\n </svg>\n );\n}\n","import React from 'react';\nimport type { IconProps } from '../types';\nimport { BaseIcon } from './BaseIcon';\n\nexport const CloudBoltIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M7 18a4.815 4.815 0 0 1-3.327-1.318A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 0 7h-1m-4.75-5L11 17.5h3.375l-2.25 4.5\" /></BaseIcon>\n);\nexport const CloudDrizzleIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M12 18v1m-3-4v1m6-1v1m2 3v1M7 19v1m-3-3.034a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662\" /></BaseIcon>\n);\nexport const CloudFogIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M5 21h7m4 0h3M8 17h8\" /></BaseIcon>\n);\nexport const CloudHailIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8 17.45v.1m-1.5 3.9v.1m10.5-4.1v.1m-1.5 3.9v.1m-3-4.1v.1m-1.5 3.9v.1m10.475-4.575A3.5 3.5 0 0 0 19 11h-1c.146-.65.148-1.32.006-1.97a4.784 4.784 0 0 0-.831-1.823 5.36 5.36 0 0 0-1.544-1.398 5.964 5.964 0 0 0-2.02-.759 6.224 6.224 0 0 0-2.19-.006 5.971 5.971 0 0 0-2.024.749C8.157 6.533 7.295 7.687 7 9a4.815 4.815 0 0 0-3.327 1.318A4.403 4.403 0 0 0 2.295 13.5c0 1.194.496 2.338 1.378 3.182.105.1.214.195.327.284m4.5.534a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm10.5-4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-3-4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-1.5 4a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z\" /></BaseIcon>\n);\nexport const CloudShowersIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M12 13v2m0 3v2m4-5v2m0 3v2m-8-7v2m0 3v2\" /></BaseIcon>\n);\nexport const CloudShowersHeavyIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662M16 15v6m-8-6v6m4-8v6\" /></BaseIcon>\n);\nexport const CloudSleetIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M13.5 17.45a1 1 0 1 0-2 0h2Zm-2 .1a1 1 0 1 0 2 0h-2Zm.5 3.9a1 1 0 1 0-2 0h2Zm-2 .1a1 1 0 1 0 2 0h-2Zm-6.327-4.868.692-.723-.692.723ZM7 9v1a1 1 0 0 0 .976-.781L7 9Zm2.397-3.207.512.858-.512-.858ZM18 11l-.976-.219A1 1 0 0 0 18 12v-1Zm2.768 5.268a1 1 0 0 0 1.414 1.414l-.707-.707-.707-.707ZM3.379 17.75a1 1 0 0 0 1.242-1.567L4 16.966l-.62.784Zm5.55-.379a1 1 0 0 0-1.857-.742L8 17l.928.371ZM5.071 21.63a1 1 0 0 0 1.856.742L6 22l-.928-.371Zm13.857-4.258a1 1 0 0 0-1.857-.742L18 17l.928.371Zm-3.857 4.258a1 1 0 0 0 1.857.742L16 22l-.928-.371ZM13 17.5h-1a.5.5 0 0 1 .5-.5v2a1.5 1.5 0 0 0 1.5-1.5h-1Zm-.5.5v-1a.5.5 0 0 1 .5.5h-2a1.5 1.5 0 0 0 1.5 1.5v-1Zm-.5-.5h1a.5.5 0 0 1-.5.5v-2a1.5 1.5 0 0 0-1.5 1.5h1Zm.5-.5v1a.5.5 0 0 1-.5-.5h2a1.5 1.5 0 0 0-1.5-1.5v1Zm0 .45h-1v.1h2v-.1h-1Zm-1 4.05h-1a.5.5 0 0 1 .5-.5v2a1.5 1.5 0 0 0 1.5-1.5h-1Zm-.5.5v-1a.5.5 0 0 1 .5.5h-2A1.5 1.5 0 0 0 11 23v-1Zm-.5-.5h1a.5.5 0 0 1-.5.5v-2a1.5 1.5 0 0 0-1.5 1.5h1Zm.5-.5v1a.5.5 0 0 1-.5-.5h2A1.5 1.5 0 0 0 11 20v1Zm0 .45h-1v.1h2v-.1h-1Zm-7.327-4.768.692-.723a3.403 3.403 0 0 1-1.07-2.459h-2c0 1.473.613 2.877 1.687 3.905l.691-.723ZM2.295 13.5h1c0-.914.38-1.8 1.07-2.46l-.692-.722-.69-.723A5.403 5.403 0 0 0 1.294 13.5h1Zm1.378-3.182.692.723A3.815 3.815 0 0 1 7 10V8c-1.499 0-2.945.57-4.018 1.595l.691.723ZM7 9l.976.219c.23-1.024.91-1.956 1.933-2.568l-.512-.858-.513-.859c-1.456.87-2.5 2.245-2.86 3.847L7 9Zm2.397-3.207.512.858a4.972 4.972 0 0 1 1.686-.622l-.173-.985-.174-.985a6.971 6.971 0 0 0-2.364.875l.513.859Zm2.025-.749.173.985a5.223 5.223 0 0 1 1.837.005l.18-.984.178-.984a7.223 7.223 0 0 0-2.542-.007l.174.985Zm2.19.006-.18.984c.606.11 1.177.326 1.681.631l.518-.856.518-.855a6.963 6.963 0 0 0-2.359-.888l-.179.984Zm2.02.76-.519.855c.505.305.93.693 1.257 1.136l.805-.594.805-.594a6.361 6.361 0 0 0-1.831-1.659l-.518.855Zm1.543 1.397-.805.594c.326.442.549.932.66 1.441l.976-.212.978-.213a5.786 5.786 0 0 0-1.005-2.204l-.804.594Zm.831 1.823-.977.212c.111.509.11 1.031-.005 1.539L18 11l.976.219c.178-.792.18-1.609.008-2.402l-.978.213ZM18 11v1h1v-2h-1v1Zm1 0v1a2.5 2.5 0 0 1 1.768.732l.707-.707.707-.707A4.5 4.5 0 0 0 19 10v1Zm2.475 1.025-.707.707A2.5 2.5 0 0 1 21.5 14.5h2a4.5 4.5 0 0 0-1.318-3.182l-.707.707ZM22.5 14.5h-1a2.5 2.5 0 0 1-.732 1.768l.707.707.707.707A4.5 4.5 0 0 0 23.5 14.5h-1ZM4 16.966l.62-.784a3.684 3.684 0 0 1-.255-.223l-.692.723-.69.723c.126.121.259.237.396.345L4 16.966ZM8 17l-.928-.371-2 5L6 22l.928.371 2-5L8 17Zm10 0-.928-.371-2 5L16 22l.928.371 2-5L18 17Z\" /></BaseIcon>\n);\nexport const CloudSnowIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8 15h2m-1-1v2m5-1h2m-1-1v2M5 21h2m-1-1v2m5-2h2m-1-1v2m5 0h2m-1-1v2M4 16.966a4.63 4.63 0 0 1-.327-.284A4.403 4.403 0 0 1 2.295 13.5c0-1.194.496-2.338 1.378-3.182A4.815 4.815 0 0 1 7 9c.295-1.313 1.157-2.466 2.397-3.207a5.971 5.971 0 0 1 2.025-.749 6.224 6.224 0 0 1 2.19.006c.721.131 1.408.39 2.02.76a5.36 5.36 0 0 1 1.543 1.397c.407.552.69 1.172.831 1.823.142.65.14 1.32-.006 1.97h1a3.5 3.5 0 0 1 1.5 6.662\" /></BaseIcon>\n);\nexport const CloudSunIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M10.201 19.997c-1.977 0-3.58-1.544-3.58-3.448 0-1.903 1.603-3.446 3.58-3.446.303-1.355 1.38-2.461 2.827-2.902 1.445-.44 3.042-.148 4.186.77 1.144.915 1.663 2.312 1.361 3.667h.761c1.472 0 2.664 1.2 2.664 2.68A2.672 2.672 0 0 1 19.336 20h-9.134m2.66-12.934a4.166 4.166 0 0 0-2.677-1.732m2.677 1.732 2.744-1.892m-2.744 1.892c.55.796.802 1.754.723 2.709m-3.4-4.44a4.167 4.167 0 0 0-3.118.667m3.118-.668.602-3.278m-3.72 3.946A4.167 4.167 0 0 0 5.334 8.68m1.733-2.678L5.174 3.26m.16 5.42c-.2 1.088.041 2.21.669 3.12m-.669-3.12-3.278-.601m3.947 3.72-2.744 1.893m2.744-1.893a4.167 4.167 0 0 0 2.174 1.607\" /></BaseIcon>\n);\nexport const CloudsIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M8.958 21.05C6.772 21.05 5 19.344 5 17.24s1.772-3.81 3.958-3.81c.335-1.498 1.525-2.72 3.124-3.207 1.598-.487 3.363-.164 4.628.85 1.264 1.011 1.837 2.556 1.504 4.053h.842A2.953 2.953 0 0 1 22 18.09a2.954 2.954 0 0 1-2.945 2.964H8.958M18 8c-.5-2.5-3.532-3.401-5.5-2.5a3.117 3.117 0 0 0-2.11-2.312c-1.352-.411-2.845-.138-3.915.72-1.07.855-1.554 2.161-1.273 3.428h-.711A2.498 2.498 0 0 0 2 9.843c0 1.094.695 2.023 1.666 2.366\" /></BaseIcon>\n);\nexport const SnowflakeIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"m9.25 4-1 2H6m-2.25 4L5 12m0 0-1.25 2M5 12h3m-3 0H2.5m17.75-2L19 12l1.25 2M6 18h2.25l1 2M14 9h-4m4 0 3-5m-3 5 2 3m-6-3L7 4m3 5-2 3m0 0 2 3m0 0-3 5m3-5h4m2-3-2 3m2-3h5.5M14 15l3 5M14.75 4l1 2H18m0 12h-2.25l-1 2\" /></BaseIcon>\n);\nexport const SunIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M12 4V2m0 20v-2m10-8h-2M4 12H2m15.657-5.657 1.414-1.414M4.93 19.07l1.414-1.414m12.728 1.414-1.414-1.414M6.343 6.343 4.93 4.929M7 12a5 5 0 1 0 10 0 5 5 0 0 0-10 0Z\" /></BaseIcon>\n);\nexport const WindIcon = (props: IconProps) => (\n <BaseIcon {...props}><path d=\"M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2\" /></BaseIcon>\n);\n","import React from 'react';\nimport type { IconProps, WeatherCondition } from '../types';\nimport {\n CloudBoltIcon,\n CloudDrizzleIcon,\n CloudFogIcon,\n CloudHailIcon,\n CloudShowersHeavyIcon,\n CloudShowersIcon,\n CloudSleetIcon,\n CloudSnowIcon,\n CloudSunIcon,\n CloudsIcon,\n SnowflakeIcon,\n SunIcon,\n} from './weather-icons';\n\nconst iconMap: Record<WeatherCondition, React.ComponentType<IconProps>> = {\n sun: SunIcon,\n 'cloud-sun': CloudSunIcon,\n clouds: CloudsIcon,\n 'cloud-fog': CloudFogIcon,\n 'cloud-drizzle': CloudDrizzleIcon,\n 'cloud-showers': CloudShowersIcon,\n 'cloud-showers-heavy': CloudShowersHeavyIcon,\n 'cloud-sleet': CloudSleetIcon,\n 'cloud-snow': CloudSnowIcon,\n snowflake: SnowflakeIcon,\n 'cloud-bolt': CloudBoltIcon,\n 'cloud-hail': CloudHailIcon,\n};\n\nexport function WeatherIcon({ condition, ...props }: IconProps & { condition: WeatherCondition }) {\n const Icon = iconMap[condition] || CloudsIcon;\n return <Icon {...props} />;\n}\n","import React, { useEffect, useState } from 'react';\nimport { useWeatherForecast } from '../hooks/useWeatherForecast';\nimport type { DailyWeather, HourlyWeather, TemperatureUnit, WeatherForecastOptions, WindSpeedUnit } from '../types';\nimport { WeatherIcon } from '../icons/WeatherIcon';\nimport { WindIcon } from '../icons/weather-icons';\n\ntype Props = WeatherForecastOptions & {\n className?: string;\n style?: React.CSSProperties;\n compact?: boolean;\n};\n\nconst WIND_SPEED_UNIT_LABELS: Record<WindSpeedUnit, string> = {\n kmh: 'km/h',\n mph: 'mph',\n ms: 'm/s',\n kn: 'kn',\n};\n\nfunction closestHour(hourly: HourlyWeather[], targetTime: Date): HourlyWeather | undefined {\n return hourly.reduce<HourlyWeather | undefined>((closest, hour) => {\n const diff = Math.abs(new Date(hour.time).getTime() - targetTime.getTime());\n const closestDiff = closest ? Math.abs(new Date(closest.time).getTime() - targetTime.getTime()) : Infinity;\n return diff < closestDiff ? hour : closest;\n }, undefined);\n}\n\n// Format a real instant in a specific IANA timezone, falling back to the\n// browser's local zone if the timezone string is missing or invalid.\nfunction formatInZone(instant: Date, timezone: string | undefined, options: Intl.DateTimeFormatOptions): string {\n try {\n return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || undefined }).format(instant);\n } catch {\n return new Intl.DateTimeFormat([], options).format(instant);\n }\n}\n\n// The clock is shown with the hour and minute large and the seconds (plus any\n// AM/PM marker) trailing in a smaller, dimmer size, so split it into those two\n// halves. Falls back to one undivided string if the locale's parts are not\n// where we expect them.\nfunction clockParts(instant: Date, timezone: string | undefined): { main: string; tail: string } {\n const options: Intl.DateTimeFormatOptions = { hour: 'numeric', minute: '2-digit', second: '2-digit' };\n const format = (() => {\n try {\n return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || undefined });\n } catch {\n return new Intl.DateTimeFormat([], options);\n }\n })();\n const parts = format.formatToParts(instant);\n const part = (type: Intl.DateTimeFormatPartTypes) => parts.find((p) => p.type === type)?.value;\n const hour = part('hour');\n const minute = part('minute');\n const second = part('second');\n if (!hour || !minute || !second) return { main: format.format(instant), tail: '' };\n const dayPeriod = part('dayPeriod');\n return { main: `${hour}:${minute}`, tail: `:${second}${dayPeriod ? ` ${dayPeriod}` : ''}` };\n}\n\n// Just the zone abbreviation (e.g. \"GMT+2\"), so it can be shown apart from the\n// clock itself.\nfunction zoneLabel(instant: Date, timezone: string | undefined): string {\n const options: Intl.DateTimeFormatOptions = { hour: 'numeric', timeZoneName: 'short' };\n try {\n const format = (() => {\n try {\n return new Intl.DateTimeFormat([], { ...options, timeZone: timezone || undefined });\n } catch {\n return new Intl.DateTimeFormat([], options);\n }\n })();\n return format.formatToParts(instant).find((part) => part.type === 'timeZoneName')?.value ?? '';\n } catch {\n return '';\n }\n}\n\n// Daily dates arrive as plain \"YYYY-MM-DD\" calendar days; `new Date(...)` would\n// read those as UTC midnight and roll back a day in western timezones, so build\n// the date from its parts and let it stay a local calendar day.\nfunction parseCalendarDate(date: string): Date {\n const [year, month, day] = date.split('-').map(Number);\n if (!year || !month || !day) return new Date(date);\n return new Date(year, month - 1, day);\n}\n\n// The upcoming days sit in narrow columns along the bottom of the card, so\n// they are labelled with the abbreviated weekday (\"Fri\") rather than a full\n// name or \"Tomorrow\".\nfunction upcomingDayLabel(date: string): string {\n return parseCalendarDate(date).toLocaleDateString([], { weekday: 'short' });\n}\n\n// Daily totals that no longer have a column of their own in the card layout are\n// kept as hover text so the detail is still reachable.\nfunction upcomingDayDetail(day: DailyWeather, windSpeedUnitLabel: string): string | undefined {\n const details: string[] = [];\n if (day.precipitationSum !== undefined) details.push(`${day.precipitationSum.toFixed(1)} mm`);\n if (day.windSpeedMax !== undefined) details.push(`${day.windSpeedMax.toFixed(1)} ${windSpeedUnitLabel} wind`);\n return details.length > 0 ? details.join(' · ') : undefined;\n}\n\nconst styles = {\n root: {\n fontFamily: 'system-ui, sans-serif',\n border: '1px solid #e5e7eb',\n borderRadius: 12,\n padding: 16,\n background: '#fff',\n color: '#111827',\n maxWidth: 640,\n } as React.CSSProperties,\n row: { display: 'flex', alignItems: 'center', gap: 8 } as React.CSSProperties,\n hours: { display: 'flex', gap: 12, overflowX: 'auto', paddingBottom: 4 } as React.CSSProperties,\n hourCard: { minWidth: 72, textAlign: 'center' as const, padding: 8, borderRadius: 8, background: '#f9fafb' },\n dayRow: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 10, padding: '8px 0', borderBottom: '1px solid #f3f4f6' } as React.CSSProperties,\n // Card-sized: a fixed maximum width with generous, even padding, so the\n // widget reads as a self-contained tile wherever it is dropped in.\n compactRoot: {\n fontFamily: 'system-ui, sans-serif',\n display: 'flex',\n flexDirection: 'column',\n gap: 14,\n padding: 18,\n borderRadius: 16,\n width: '100%',\n maxWidth: 340,\n boxSizing: 'border-box',\n } as React.CSSProperties,\n // Current conditions stack down the card; the upcoming days sit in a row\n // along the bottom.\n compactBody: { display: 'flex', flexDirection: 'column', gap: 10 } as React.CSSProperties,\n compactCity: { fontSize: 15, fontWeight: 700, lineHeight: 1.2 } as React.CSSProperties,\n compactHeader: { display: 'flex', alignItems: 'center', flexWrap: 'wrap', gap: 8 } as React.CSSProperties,\n compactTemp: { fontSize: 32, fontWeight: 600, lineHeight: 1 } as React.CSSProperties,\n // The short-term outlook (\"59 deg in 6h\") trails the current temperature.\n compactOutlook: { display: 'flex', alignItems: 'center', gap: 4, fontSize: 12, opacity: 0.75, whiteSpace: 'nowrap' } as React.CSSProperties,\n compactTime: { fontSize: 26, fontWeight: 600, lineHeight: 1.1 } as React.CSSProperties,\n compactSeconds: { fontSize: 13, fontWeight: 500, opacity: 0.6 } as React.CSSProperties,\n compactDate: { fontSize: 11, opacity: 0.7, marginTop: 2 } as React.CSSProperties,\n compactStats: { display: 'flex', flexWrap: 'wrap', gap: 14, fontSize: 12, opacity: 0.9 } as React.CSSProperties,\n // Three equal columns along the bottom edge, each stacking weekday / icon /\n // high-low so the row stays readable at card width.\n upcoming: {\n display: 'grid',\n gridTemplateColumns: 'repeat(3, 1fr)',\n gap: 8,\n paddingTop: 12,\n borderTop: '1px solid currentColor',\n borderTopColor: 'rgba(128,128,128,0.25)',\n fontSize: 12,\n } as React.CSSProperties,\n upcomingDay: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 4, textAlign: 'center' } as React.CSSProperties,\n upcomingDayName: { opacity: 0.7, whiteSpace: 'nowrap' } as React.CSSProperties,\n upcomingTemps: { whiteSpace: 'nowrap' } as React.CSSProperties,\n compactStat: { display: 'flex', alignItems: 'center', gap: 4, whiteSpace: 'nowrap' } as React.CSSProperties,\n unitSwitch: { display: 'inline-flex', alignItems: 'center', cursor: 'pointer', userSelect: 'none' } as React.CSSProperties,\n rain: { color: '#2563eb', whiteSpace: 'nowrap' } as React.CSSProperties,\n tz: { fontSize: 12, opacity: 0.7, marginTop: 2 } as React.CSSProperties,\n list: { display: 'flex', flexDirection: 'column' } as React.CSSProperties,\n};\n\n// Precipitation chance is only surfaced when there is a non-zero chance of it.\nfunction RainBadge({ probability, compact }: { probability?: number; compact?: boolean }) {\n if (probability === undefined || probability === null || probability <= 0) return null;\n return <span style={styles.rain}>{compact ? ` · ${probability}%` : ` · ${probability}% rain`}</span>;\n}\n\n/**\n * Renders one location's forecast: a live current time (ticking, in the\n * location's own timezone), a clickable degF / degC unit switch, high/low and\n * precipitation for the next hours and days.\n */\nfunction SingleWeatherForecast(props: Props) {\n // Temperature unit is local state so the degF / degC switch can toggle it;\n // it is seeded from (and re-synced to) the temperatureUnit prop.\n const [unit, setUnit] = useState<TemperatureUnit>(props.temperatureUnit ?? 'fahrenheit');\n useEffect(() => {\n setUnit(props.temperatureUnit ?? 'fahrenheit');\n }, [props.temperatureUnit]);\n\n const { data, loading, error } = useWeatherForecast({ ...props, temperatureUnit: unit });\n\n // A ticking clock so the displayed current time stays accurate to the second.\n const [now, setNow] = useState(() => new Date());\n useEffect(() => {\n const id = setInterval(() => setNow(new Date()), 1000);\n return () => clearInterval(id);\n }, []);\n\n const toggleUnit = () => setUnit((u) => (u === 'celsius' ? 'fahrenheit' : 'celsius'));\n\n const renderUnitSwitch = (fontSize: number) => (\n <span\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation();\n toggleUnit();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggleUnit();\n }\n }}\n title=\"Switch temperature units\"\n aria-label={`Switch temperature units, currently ${unit === 'celsius' ? 'Celsius' : 'Fahrenheit'}`}\n style={{ ...styles.unitSwitch, fontSize }}\n >\n <span style={{ fontWeight: unit === 'fahrenheit' ? 700 : 400, opacity: unit === 'fahrenheit' ? 1 : 0.45 }}>°F</span>\n <span style={{ opacity: 0.4, margin: '0 3px' }}>|</span>\n <span style={{ fontWeight: unit === 'celsius' ? 700 : 400, opacity: unit === 'celsius' ? 1 : 0.45 }}>°C</span>\n </span>\n );\n\n // Keep showing the last forecast while a unit switch refetches in the\n // background; only suppress output on the very first load.\n if (loading && !data) return null;\n if (error) return <div className={props.className} style={props.style}>Error: {error.message}</div>;\n if (!data) return <div className={props.className} style={props.style}>No forecast available.</div>;\n\n const timezone = data.location?.timezone;\n const currentDate = formatInZone(now, timezone, { weekday: 'short', month: 'short', day: 'numeric' });\n const currentTime = formatInZone(now, timezone, { hour: 'numeric', minute: '2-digit', second: '2-digit', timeZoneName: 'short' });\n // The compact layout shows the clock at a larger size, so the zone label is\n // split off onto the smaller date line to keep the time on one line.\n const currentClock = clockParts(now, timezone);\n const currentZone = zoneLabel(now, timezone);\n\n if (props.compact) {\n const forecastBase = new Date(data.current.time);\n const today = data.daily[0];\n const in6Hours = closestHour(data.hourly, new Date(forecastBase.getTime() + 6 * 60 * 60 * 1000));\n const windSpeedUnitLabel = WIND_SPEED_UNIT_LABELS[props.windSpeedUnit ?? 'mph'];\n // Today is already summarised in the card's own stats line, so the bottom\n // row starts at tomorrow and shows the next three days.\n const upcomingDays = data.daily.slice(1, 4);\n\n return (\n <div className={props.className} style={{ ...styles.compactRoot, ...props.style }}>\n <div style={styles.compactBody}>\n <div style={styles.compactCity}>\n {data.location?.city || 'Current location'}\n {data.location?.region ? `, ${data.location.region}` : ''}\n </div>\n\n <div style={styles.compactHeader}>\n <WeatherIcon condition={data.current.icon} width={30} height={30} title=\"Current weather\" />\n <strong style={styles.compactTemp}>{data.current.temperature}</strong>\n {renderUnitSwitch(13)}\n {in6Hours && (\n <span style={styles.compactOutlook}>\n <WeatherIcon condition={in6Hours.icon} width={14} height={14} title=\"In 6 hours\" />\n {in6Hours.temperature}° 6h\n <RainBadge probability={in6Hours.precipitationProbability} compact />\n </span>\n )}\n </div>\n\n <div>\n <div style={styles.compactTime}>\n {currentClock.main}\n {currentClock.tail && <span style={styles.compactSeconds}>{currentClock.tail}</span>}\n </div>\n <div style={styles.compactDate}>\n {currentDate}\n {currentZone ? ` · ${currentZone}` : ''}\n </div>\n </div>\n\n <div style={styles.compactStats}>\n {today && (\n <span style={styles.compactStat}>\n <WeatherIcon condition={today.icon} width={16} height={16} title=\"Today's high and low\" />\n {today.max}° / {today.min}°\n <RainBadge probability={today.precipitationProbabilityMax} compact />\n </span>\n )}\n <span style={styles.compactStat}>\n <WindIcon width={16} height={16} title=\"Wind speed\" />\n {data.current.windSpeed !== undefined ? `${Math.round(data.current.windSpeed)} ${windSpeedUnitLabel}` : '—'}\n </span>\n </div>\n </div>\n\n {upcomingDays.length > 0 && (\n <div style={styles.upcoming}>\n {upcomingDays.map((day) => (\n <div key={day.date} style={styles.upcomingDay} title={upcomingDayDetail(day, windSpeedUnitLabel)}>\n <span style={styles.upcomingDayName}>{upcomingDayLabel(day.date)}</span>\n <WeatherIcon condition={day.icon} width={18} height={18} />\n <span style={styles.upcomingTemps}>\n <strong>{day.max}°</strong>\n <span style={{ opacity: 0.6 }}> / {day.min}°</span>\n </span>\n {day.precipitationProbabilityMax !== undefined && day.precipitationProbabilityMax > 0 && (\n <span style={{ ...styles.rain, fontSize: 11 }}>{day.precipitationProbabilityMax}%</span>\n )}\n </div>\n ))}\n </div>\n )}\n </div>\n );\n }\n\n return (\n <div className={props.className} style={{ ...styles.root, ...props.style }}>\n <div>\n <h3 style={{ margin: 0, fontSize: 20 }}>\n {data.location?.city || 'Current location'}\n {data.location?.region ? `, ${data.location.region}` : ''}\n </h3>\n <div style={styles.tz}>\n {currentDate} · {currentTime}\n {timezone ? ` · ${timezone}` : ''}\n </div>\n <div style={{ ...styles.row, marginTop: 8 }}>\n <WeatherIcon condition={data.current.icon} width={28} height={28} title=\"Current weather\" />\n <strong style={{ fontSize: 28 }}>{data.current.temperature}</strong>\n {renderUnitSwitch(14)}\n </div>\n </div>\n\n <div style={{ marginTop: 20 }}>\n <h4 style={{ margin: '0 0 10px 0' }}>Next hours</h4>\n <div style={styles.hours}>\n {data.hourly.slice(0, props.forecastHours ?? 12).map((hour) => (\n <div key={hour.time} style={styles.hourCard}>\n <div style={{ fontSize: 12 }}>{new Date(hour.time).toLocaleTimeString([], { hour: 'numeric' })}</div>\n <WeatherIcon condition={hour.icon} width={20} height={20} style={{ margin: '6px auto' }} />\n <div>{hour.temperature}°</div>\n {hour.precipitationProbability !== undefined && hour.precipitationProbability > 0 && (\n <div style={{ ...styles.rain, fontSize: 12 }}>{hour.precipitationProbability}%</div>\n )}\n </div>\n ))}\n </div>\n </div>\n\n <div style={{ marginTop: 20 }}>\n <h4 style={{ margin: '0 0 10px 0' }}>Next days</h4>\n <div>\n {data.daily.map((day) => (\n <div key={day.date} style={styles.dayRow}>\n <div style={{ width: 120 }}>{new Date(day.date).toLocaleDateString([], { weekday: 'short', month: 'short', day: 'numeric' })}</div>\n <WeatherIcon condition={day.icon} width={20} height={20} />\n <div>\n {day.min}° / {day.max}°\n {day.precipitationProbabilityMax !== undefined && day.precipitationProbabilityMax > 0 && (\n <span style={styles.rain}> · {day.precipitationProbabilityMax}%</span>\n )}\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * Weather forecast widget. When `locations` is provided, one forecast is\n * rendered per location; otherwise a single auto-detected forecast is shown.\n */\nexport function WeatherForecast(props: Props) {\n const { locations, ...rest } = props;\n\n if (locations && locations.length > 0) {\n const gap = props.compact ? 8 : 16;\n return (\n <div style={{ ...styles.list, gap }}>\n {locations.map((loc, index) => (\n <SingleWeatherForecast\n key={`${loc.label ?? ''}:${loc.latitude ?? ''}:${loc.longitude ?? ''}:${index}`}\n {...rest}\n latitude={typeof loc.latitude === 'number' ? loc.latitude : undefined}\n longitude={typeof loc.longitude === 'number' ? loc.longitude : undefined}\n location={{ city: loc.label, timezone: loc.timezone }}\n />\n ))}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