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

72
pwa/node_modules/own-keys/test/index.js generated vendored Normal file
View file

@ -0,0 +1,72 @@
'use strict';
var test = require('tape');
var hasSymbols = require('has-symbols/shams')();
var hasPropertyDescriptors = require('has-property-descriptors')();
var ownKeys = require('../');
/** @type {(a: PropertyKey, b: PropertyKey) => number} */
function comparator(a, b) {
if (typeof a === 'string' && typeof b === 'string') {
return a.localeCompare(b);
}
if (typeof a === 'number' && typeof b === 'number') {
return a - b;
}
return typeof a === 'symbol' ? 1 : -1;
}
test('ownKeys', function (t) {
t.equal(typeof ownKeys, 'function', 'is a function');
t.equal(
ownKeys.length,
1,
'has a length of 1'
);
t.test('basics', function (st) {
var obj = { a: 1, b: 2 };
if (hasPropertyDescriptors) {
Object.defineProperty(obj, 'c', {
configurable: true,
enumerable: false,
writable: true,
value: 3
});
}
st.deepEqual(
ownKeys(obj).sort(comparator),
(hasPropertyDescriptors ? ['a', 'b', 'c'] : ['a', 'b']).sort(comparator),
'includes non-enumerable properties'
);
st.end();
});
t.test('symbols', { skip: !hasSymbols }, function (st) {
/** @type {Record<PropertyKey, unknown>} */
var obj = { a: 1 };
var sym = Symbol('b');
obj[sym] = 2;
var nonEnumSym = Symbol('c');
Object.defineProperty(obj, nonEnumSym, {
configurable: true,
enumerable: false,
writable: true,
value: 3
});
st.deepEqual(
ownKeys(obj).sort(comparator),
['a', sym, nonEnumSym].sort(comparator),
'works with symbols, both enum and non-enum'
);
st.end();
});
t.end();
});