Add progressive web app companion for cross-platform access

Vite + TypeScript PWA that mirrors the Android app's core features:
- Pre-processed shelter data (build-time UTM33N→WGS84 conversion)
- Leaflet map with shelter markers, user location, and offline tiles
- Canvas compass arrow (ported from DirectionArrowView.kt)
- IndexedDB shelter cache with 7-day staleness check
- Service worker with CacheFirst tiles and precached app shell
- i18n for en, nb, nn (ported from Android strings.xml)
- iOS/Android compass handling with low-pass filter
- Respects user map interaction (no auto-snap on pan/zoom)
- Build revision cache-breaker for reliable SW updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-03-08 17:41:38 +01:00
commit e8428de775
12051 changed files with 1799735 additions and 0 deletions

34
pwa/node_modules/es-abstract/5/ToNumber.js generated vendored Normal file
View file

@ -0,0 +1,34 @@
'use strict';
var ToPrimitive = require('./ToPrimitive');
var callBound = require('call-bound');
var $replace = callBound('String.prototype.replace');
var safeRegexTester = require('safe-regex-test');
var isNonDecimal = safeRegexTester(/^0[ob]|^[+-]0x/);
var $Number = Number;
// http://262.ecma-international.org/5.1/#sec-9.3
module.exports = function ToNumber(value) {
var prim = ToPrimitive(value, $Number);
if (typeof prim !== 'string') {
return $Number(prim);
}
var trimmed = $replace(
prim,
// eslint-disable-next-line no-control-regex
/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g,
''
);
if (isNonDecimal(trimmed)) {
return NaN;
}
return +trimmed;
};