commit 6fc0a01c560cd7bf5095a6b5377fbb4f1cab3a2d Author: Elijah Date: Tue Oct 20 19:04:12 2026 -0700 first commit diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ee88612 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +node_modules +dist +data +.env +.local +test-results diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1c16cda --- /dev/null +++ b/.env.example @@ -0,0 +1,7 @@ +# Copy to .env. Never commit .env. +APP_ORIGIN=https://calio.example.com +CALIO_USERNAME=calio +CALIO_PASSWORD=replace-with-a-long-unique-password +CALIO_PORT=3000 +# Only for local testing with APP_ORIGIN=http://localhost:3000: +# COOKIE_SECURE=false diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..18c6ede --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,48 @@ +name: Verify and publish Calio container +on: + push: + pull_request: + workflow_dispatch: + +jobs: + build-and-push: + if: github.event.deleted != true + runs-on: ubuntu-latest + env: + JOB_IMAGE: calio-ci:${{ github.run_id }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Node 24 + uses: https://github.com/actions/setup-node@v4 + with: + node-version: "24" + - name: Install locked dependencies + run: npm ci --no-audit --no-fund + - name: Run tests + run: npm test + - name: Build application + run: npm run build + - name: Build production container + env: + COMMIT_SHA: ${{ github.sha }} + run: docker build --label "org.opencontainers.image.revision=$COMMIT_SHA" -t "$JOB_IMAGE" . + - name: Smoke test container and persistent data + run: | + node scripts/container-smoke.js "$JOB_IMAGE" + node scripts/container-smoke.js "$JOB_IMAGE" --unraid + - name: Publish image to Forgejo registry + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + env: + FORGEJO_PAT: ${{ secrets.FORGEJO_PAT }} + SOURCE_IMAGE: ${{ env.JOB_IMAGE }} + REGISTRY_USERNAME: ${{ vars.REGISTRY_USERNAME || github.repository_owner }} + REPOSITORY: ${{ github.repository }} + CI_EVENT: ${{ github.event_name }} + COMMIT_SHA: ${{ github.sha }} + TARGET_REF: ${{ github.ref }} + MAIN_BRANCH: ${{ github.event.repository.default_branch || 'main' }} + run: node scripts/publish-image.js + - name: Remove temporary build tag + if: always() + run: docker image rm "$JOB_IMAGE" || true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..33f11de --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +node_modules/ +dist/ +data/ +.env +*.tsbuildinfo +coverage/ +test-results/ +playwright-report/ +.local/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f8f3fdf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM node:24-alpine AS build +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --no-audit --no-fund +COPY tsconfig.json vite.config.ts index.html ./ +COPY src ./src +COPY shared ./shared +COPY public ./public +COPY scripts/build-sw.js ./scripts/build-sw.js +RUN npm run build + +FROM node:24-alpine AS runtime +LABEL org.opencontainers.image.title="Calio" \ + org.opencontainers.image.description="Personal offline-first nutrition and weight journal" \ + org.opencontainers.image.source="https://git.elijahkuntz.com/Elijah/Calio" +ENV NODE_ENV=production PORT=3000 DATA_DIR=/data +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --omit=dev --no-audit --no-fund && npm cache clean --force && mkdir /data && chown node:node /data +COPY --from=build /app/dist ./dist +COPY server ./server +COPY shared ./shared +USER node +VOLUME /data +EXPOSE 3000 +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s CMD node -e "fetch('http://127.0.0.1:3000/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" +CMD ["node", "server/index.js"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..c4ad7bd --- /dev/null +++ b/README.md @@ -0,0 +1,104 @@ +# Calio + +A single-user, self-hosted nutrition journal. PWA first, with a responsive desktop layout, light/dark/system themes, configurable accent colors, and no third-party analytics, fonts, or nutrition services. Dark mode uses neutral near-black and charcoal surfaces; choose a preset or custom accent under Settings → Look & feel, then save preferences. Accent preferences sync between devices and remain available offline. + +## Included + +- Daily calorie vessel with colliding physics bubbles, week navigation, meal journal, editable entries, fractional servings. New bubbles drop from the top as calories increase. +- Saved foods and reusable plates. Logging a plate creates an atomic batch of independent food entries. Logs retain a nutrition snapshot when library foods change. +- Independently enabled calorie, protein, carbohydrate, fat, fiber, sugar and sodium goals. +- Weight journal in lb or kg; internally stored in kg. Multiple weigh-ins are retained, with the latest measurement per day used in charts. +- 7 / 30 / 90 / 365 day nutrition and weight trends. Unlogged days are excluded from intake averages. +- Markdown, CSV and JSON export with date range, nutrient and weight selections. Markdown is designed for LLM analysis. Data is downloaded locally, never submitted to an LLM. Save preferences to remember the export format, range preset and selections. +- Password authentication, IndexedDB offline journal/outbox, a precached app shell, automatic foreground/reconnect sync, and explicit PWA update prompts. + +Barcode lookup and nutrition-label OCR are deferred. This release uses manual nutrition entry and saved foods. It does not include Apple Watch integration, HealthKit, fasting, reminders or water tracking; those screenshot features were not part of the requested core. + +## Deploy on Unraid + +Forgejo builds and publishes the image; Unraid runs it through **Docker → Add Container**. Compose is optional and is not required for deployment. Follow [the Unraid setup guide](docs/UNRAID.md), or import [the Docker template](unraid/calio.xml). + +Use repository `git.elijahkuntz.com/elijah/calio:latest`, container port `3000` (suggested host port `3080`), and a persistent mapping from `/mnt/user/appdata/calio` to `/data`. Set `APP_ORIGIN` to the exact **HTTPS origin, without a trailing slash**, `CALIO_USERNAME` to your username, and `CALIO_PASSWORD` to a unique password of at least 12 characters. There is no registration screen or default password. The template runs as Unraid's `99:100`; the mapped directory must be writable by that user. The image's standalone default is UID 1000. + +Forward your HTTPS reverse proxy to `http://:3080`, or to `calio:3000` on a shared Docker network. All paths, including `/api`, must reach Calio. Open the public HTTPS address and sign in once while online. On iPhone, use Safari → Share → **Add to Home Screen**. On Android, use Chrome's **Install app** / **Add to home screen**. Desktop browsers work too. + +The registry image becomes available after the source is pushed and the first publishing workflow succeeds. See the Forgejo setup below for the required registry secret. + +HTTPS is required for installed-device service workers and secure authentication cookies. `COOKIE_SECURE=false` is accepted only when `APP_ORIGIN` uses `localhost` or `127.0.0.1`; use it solely for local tests. Production defaults to Secure, HttpOnly, SameSite=Strict cookies. + +For an optional local source trial, copy `.env.example` to `.env`, set a password, `APP_ORIGIN=http://localhost:3000` and `COOKIE_SECURE=false`, then run `docker compose up -d --build` and visit `http://localhost:3000`. These local settings cannot be used to install from a phone over a LAN IP. + +### Credentials and secrets + +The server supports `CALIO_PASSWORD`, `CALIO_PASSWORD_FILE`, `CALIO_PASSWORD_HASH`, or `CALIO_PASSWORD_HASH_FILE`. File variants accept Docker secrets. A hash avoids retaining a plaintext password in container configuration. Generate a salted scrypt hash by piping a password into `npm run --silent password` (stdin only). Do not put real passwords in shell history. + +When using a hash, replace the `CALIO_PASSWORD` container variable with `CALIO_PASSWORD_HASH`. For a file, mount it read-only and set the appropriate `_FILE` variable to its container path. `.env` and runtime data are ignored by Git. + +Sessions expire after 30 days and persist in SQLite. Changing credentials does not revoke existing sessions automatically. To invalidate all sessions, stop the app and delete the rows from the `sessions` table using a SQLite tool, then restart. The public login is rate limited to 10 requests per 15 minutes per connection IP; behind a proxy this conservatively shares the limit across clients. The app does not trust arbitrary forwarded-IP headers. + +## Persistent data, updates and backups + +SQLite lives at `/data/calio.sqlite`, mapped to `/mnt/user/appdata/calio` on Unraid. Keep this directory and mapping when replacing the image. The optional Compose setup uses a named `calio-data` volume instead. Schema migrations are versioned and transactional; an older app refuses to open a newer schema. + +Before updating, make a consistent backup while Calio is running: + +```sh +docker exec calio node server/backup.js /data/backups/before-update.sqlite +docker cp calio:/data/backups/before-update.sqlite ./calio-backup.sqlite +``` + +Choose a new filename for each backup. `VACUUM INTO` captures a consistent SQLite snapshot, including committed writes in WAL; copying only the live main database file is not a safe backup. Keep a copy off the server. Nutrition exports are useful for analysis but are **not** full database backups (they omit library data, tombstones and sessions). + +Use Unraid's **Check for Updates → Update** to pull the new `latest` image and recreate the container with its saved settings. Forgejo publishes images; it does not automatically update or restart Unraid. You can pin the repository field to a full commit SHA or a published `v*` version tag for repeatable deployment. The PWA will offer **Update** after loading online; accepting it changes app code without clearing IndexedDB. Pending local changes must sync before applying an update. + +To restore a database backup: stop Calio, preserve the current data directory, replace `calio.sqlite` with the backup, and remove the old `calio.sqlite-wal` and `calio.sqlite-shm` sidecars **while stopped**. Preserve ownership for the configured container user (`99:100` with the Unraid template; `1000:1000` by default), then restart. A server-only restore does not remove newer records already cached on devices: those may sync back. For a deliberate rollback, export pending device changes first, clear this site's device storage on each device, then sign in and fetch the restored journal. Do not clear device storage before saving unsynced entries. + +### Offline and conflict behavior + +- After the first authenticated sync, the complete journal, settings, food library and plates are held in IndexedDB. The complete current day can be reopened, edited, logged and exported offline. +- An IndexedDB transaction saves each local mutation and its outbox entry together. A plate's entries are saved as one transaction. Requests acknowledge only the exact versions sent, so a local edit made during a sync remains queued. +- Sync runs on app start, reconnect, return to the foreground, and once a minute while visible. It does not depend on iOS background sync support. If a server is unavailable, entries remain on-device and a retry status is shown. +- Independent record additions merge. Edits to the same record use the latest device edit timestamp; exact ties use an ordinal payload comparison for the same result on all devices. Settings are one record, so the latest complete settings edit wins. Deletions are retained as tombstones so stale devices cannot resurrect records. Requests are retried idempotently. +- Keep device clocks accurate. Edits over five minutes ahead of the server are rejected with a visible sync error; they remain on-device and can be exported. Once the server clock catches up they can sync. This avoids a bad device clock permanently outranking normal edits. +- An expired session preserves the local journal and asks for sign-in to resume server sync. Explicit sign-out requires pending changes to sync, then removes this device's journal. The offline cache is accessible to someone with access to this unlocked browser/device; it is not an encrypted vault. +- Browser storage can be cleared or evicted by the OS. Calio requests persistent storage, but the browser decides whether to grant it. Sync and backups remain the durable record. Check the sync status before clearing browser data or leaving a device. +- Each sync currently exchanges the complete record set. This keeps the single-user implementation auditable and caches all history; very large multi-year journals may eventually benefit from incremental pagination. + +### Bubble motion + +Tap **Enable tilt** beneath the calorie circle to allow device orientation. On iPhone, Safari asks for motion/orientation permission from that tap; the public site must use HTTPS. The app remembers the choice for the current page session and does not transmit sensor readings. Portrait, landscape and upside-down positions are mapped to the screen's gravity direction. Devices without sensors, or with permission denied, retain downward gravity and the **Give a nudge** control. + +The circle uses a bounded Matter.js simulation: bubbles collide with each other and the circular wall, new calorie bubbles drop from the top, and removing calories removes the corresponding particles. Bubbles draw smaller than their collision boundaries, creating a small visible gap between them. A full hexagonal packing defines the 100% capacity; near a full vessel, the numeric readout moves below the circle so it does not hide dots. The particle count caps at the daily goal; over-goal calories still show the exact excess and a red ring. With the calorie goal disabled, the display uses a fixed 2,500 kcal visual scale. The animation sleeps when settled, pauses in hidden tabs, and honors the device's reduced-motion preference with a still arrangement. The graphic is an approximate visual; the numeric calorie total is authoritative. + +## Forgejo CI and container registry + +`.forgejo/workflows/build.yml` runs on every branch/tag push, pull request and manual dispatch. It installs locked dependencies, runs tests and a production build, builds the Docker image, and runs `scripts/container-smoke.js` with both the image default user and Unraid's `99:100`. The smoke test uses temporary containers/volumes, verifies auth and static assets, and recreates the container to verify journal/session persistence. Probes run inside the container, so socket-mounted runners do not depend on host port forwarding. + +The workflow matches the existing Docker-capable `unraid-runner` label, `ubuntu-latest`, and uses the same secret name as the Study pipeline: + +- In Forgejo account **Settings → Applications**, create a token with `write:package` permission. In Calio **Settings → Actions → Secrets**, save it as `FORGEJO_PAT`. A secret configured only on Study is not automatically available to Calio. Keep the token out of source files and chat. +- Optionally set repository variable `REGISTRY_USERNAME` if the token owner differs from the repository owner. +- Ensure the registry is enabled at `git.elijahkuntz.com` and the runner can reach Docker Hub/GitHub actions and npm. +- Every successful push publishes `git.elijahkuntz.com/elijah/calio:`. +- Successful default-branch (`main`) builds also update `:latest`. Before promotion, the workflow checks the remote branch head to avoid promoting an already superseded build. +- Valid `v*` tags also publish a version alias, such as `:v0.1.0`. Other branches and release tags do not overwrite `:latest`. +- Pull requests verify without publishing or requiring registry credentials. Deleted refs are skipped. Manual dispatch uses the same publication rules as a push. +- Each workflow run uses a unique local image tag, keeping concurrent builds separate. The workflow does not deploy to or restart your server. + +The repository configuration is ready, but a successful live publish still requires `FORGEJO_PAT` and the initial source push. No token, registry publication or server deployment has been performed locally. + +## Develop and verify + +Node 24+ is required for built-in SQLite. `npm ci` installs the lockfile. `npm test` covers authentication, validation, deterministic merges, tombstones, persistence, and client outbox handling. + +For a production preview, run `npm run build`, configure the same environment variables above, then `npm start`. For live UI editing, run `npm run dev:server` on port 3000 and `npm run dev` on port 5173, with `APP_ORIGIN=http://localhost:5173` and `COOKIE_SECURE=false`. Vite proxies `/api`; the service worker is registered only in production builds. + +```sh +npm test +npm run build +docker build -t calio:local . +node scripts/container-smoke.js calio:local +node scripts/container-smoke.js calio:local --unraid +``` + +App code is in `src/`, shared schemas/merge rules in `shared/`, and the Express/SQLite server in `server/`. The handwritten service worker is generated from production asset hashes by `scripts/build-sw.js`. Icons are committed PNGs; `scripts/generate-icons.ps1` regenerates them on Windows without external assets. diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..7ec8ecc --- /dev/null +++ b/compose.yaml @@ -0,0 +1,24 @@ +services: + calio: + build: . + image: calio:local + restart: unless-stopped + ports: + - "127.0.0.1:${CALIO_PORT:-3000}:3000" + environment: + APP_ORIGIN: ${APP_ORIGIN:?Set APP_ORIGIN to your public HTTPS origin} + CALIO_USERNAME: ${CALIO_USERNAME:-calio} + CALIO_PASSWORD: ${CALIO_PASSWORD:?Set a password of at least 12 characters} + COOKIE_SECURE: ${COOKIE_SECURE:-true} + volumes: + - calio-data:/data + security_opt: + - no-new-privileges:true + cap_drop: + - ALL + read_only: true + tmpfs: + - /tmp + stop_grace_period: 20s +volumes: + calio-data: diff --git a/docs/UNRAID.md b/docs/UNRAID.md new file mode 100644 index 0000000..de87535 --- /dev/null +++ b/docs/UNRAID.md @@ -0,0 +1,70 @@ +# Calio on Unraid + +Forgejo builds the image. Install and update it with Unraid's standard Docker interface; Docker Compose is not required. + +## Publish the first image + +The existing `unraid-runner` uses the required `ubuntu-latest` label. Its job environment needs Docker CLI/daemon access, as in the Study build pipeline. Calio installs Node 24 during the job. + +1. In your Forgejo account's **Settings → Applications**, generate a token with `write:package` permission. +2. In the **Calio** repository, open **Settings → Actions → Secrets** and add `FORGEJO_PAT`. This matches Study's secret name. A Study-only secret must also be added to Calio, or supplied at an organization scope that includes Calio. +3. Push the Calio source. Check the repository's Actions page for the completed workflow. Tests, the application build, and both container smoke tests must pass before publishing. +4. The first successful main build publishes `git.elijahkuntz.com/elijah/calio:latest`. Ensure the resulting package is public if Unraid should pull without registry credentials. If using a private package, authenticate Unraid's Docker daemon to the registry with a separate package-read token. + +The token's account defaults to the repository owner, `Elijah`. Set repository variable `REGISTRY_USERNAME` only if using another account that has permission to publish to this owner. Tokens are used at runtime and never baked into the image. + +All branch and tag pushes are built. Successful pushes publish a full commit SHA tag, main also promotes `latest`, and valid `v*` tags add a version alias. PRs only verify. Publishing does not restart the running app. + +## Add the container + +Use **Docker → Add Container** and fill in the following values. Alternatively, copy [calio.xml](../unraid/calio.xml) to `/boot/config/plugins/dockerMan/templates-user/my-calio.xml` on Unraid and select the Calio user template. + +| Field | Value | +| -------------------------------- | ------------------------------------------------------------------------------------------ | +| Name | `calio` | +| Repository | `git.elijahkuntz.com/elijah/calio:latest` | +| Network | `bridge`, or your reverse proxy's shared Docker network | +| Container port | `3000/TCP` | +| Host port | `3080` (choose another unused port if necessary) | +| Container path | `/data` (read/write) | +| Host path | `/mnt/user/appdata/calio` | +| Variable `APP_ORIGIN` | Your exact public HTTPS origin, e.g. `https://calio.example.com`, without a trailing slash | +| Variable `CALIO_USERNAME` | Your single sign-in username | +| Variable `CALIO_PASSWORD` | A unique password of at least 12 characters | +| Variable `COOKIE_SECURE` | `true` | +| Variable `TZ` | `America/Phoenix`, or your timezone | +| Extra Parameters (Advanced View) | `--user=99:100 --cap-drop=ALL --security-opt=no-new-privileges` | +| WebUI (Advanced View) | The same public HTTPS origin as `APP_ORIGIN` | + +Keep **Privileged** off. The template uses Unraid's `nobody:users` identity (`99:100`). Create the dedicated appdata directory and give that identity ownership before starting. For a new installation using exactly the default path, run in the Unraid terminal: + +```sh +mkdir -p /mnt/user/appdata/calio +chown 99:100 /mnt/user/appdata/calio +chmod 770 /mnt/user/appdata/calio +``` + +These commands affect only Calio's directory. If you choose another path, use that path instead. Calio does not implement `PUID`/`PGID` environment variables: Docker's `--user` selects the identity. If migrating existing data, ensure its database and sidecar files are also writable by the chosen identity while Calio is stopped. The standalone image otherwise defaults to UID 1000. + +Configure your HTTPS reverse proxy to forward **all paths** to `http://:3080`, or `http://calio:3000` on a shared Docker network. Leave `/api` intact. Open the public HTTPS address for sign-in and PWA installation. The upstream HTTP port alone does not provide the secure cookies or service worker origin needed by a phone PWA. + +On iPhone, use Safari → Share → **Add to Home Screen**. On Android, use Chrome → **Install app** / **Add to home screen**. Sign in online once and allow the initial sync to finish before testing offline use. + +## Update without losing data + +Keep `/mnt/user/appdata/calio` mapped to `/data` on every recreation. It holds the SQLite database, persistent sessions and backups; the image holds only application code. + +Before updating, create a consistent backup from the Unraid terminal: + +```sh +docker exec calio node server/backup.js /data/backups/before-update.sqlite +docker cp calio:/data/backups/before-update.sqlite ./calio-backup.sqlite +``` + +Use a new backup filename each time and copy it off the server. Do not copy only the live `calio.sqlite` file while Calio is writing: committed data can still be in its WAL sidecar. See the [README](../README.md#persistent-data-updates-and-backups) for restoration and device-cache considerations. + +After a successful main build, select **Check for Updates → Update** on Unraid's Docker page. Unraid pulls `latest` and recreates the container with the saved port, path and variable settings. The PWA offers its own **Update** prompt after reconnecting; queued offline edits must sync before accepting it. + +For a specific build, replace `:latest` in the repository field with its full commit SHA or published version tag. Database schema checks prevent an older app from opening a newer unsupported schema; a rollback across schema changes may need the matching database backup. + +References: [Unraid container management](https://docs.unraid.net/unraid-os/using-unraid-to/run-docker-containers/managing-and-customizing-containers/), [Forgejo container registry](https://forgejo.org/docs/v11.0/user/packages/container/), and [Study's reference pipeline](https://git.elijahkuntz.com/Elijah/Study/src/branch/main/.forgejo/workflows). diff --git a/index.html b/index.html new file mode 100644 index 0000000..af8ee42 --- /dev/null +++ b/index.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + + Calio · Everyday, in balance + + +
+ + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..738172f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2780 @@ +{ + "name": "calio", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "calio", + "version": "0.1.0", + "dependencies": { + "express": "^5.1.0", + "express-rate-limit": "^8.1.0", + "helmet": "^8.1.0", + "idb": "^8.0.3", + "lucide-react": "^0.468.0", + "matter-js": "^0.20.0", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "zod": "^4.1.12" + }, + "devDependencies": { + "@types/matter-js": "^0.20.2", + "@types/node": "^24.0.0", + "@types/react": "^19.2.0", + "@types/react-dom": "^19.2.0", + "@vitejs/plugin-react": "^5.0.0", + "fake-indexeddb": "^6.2.6", + "typescript": "^5.9.3", + "vite": "^7.1.12" + }, + "engines": { + "node": ">=24.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.10.tgz", + "integrity": "sha512-EMCx3AGZ3WfAl6ht7AyQoPm2Lh+BGYEMdc4Q6Hf7uSCDOZFuLq44qNwL+iaim8VlyYhRAo4X43+weadK8ZB4Yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz", + "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.10.tgz", + "integrity": "sha512-B3lYAs2nkKskbgQ1nfy8Ma9ao9Q1rntTAQHrzzyDuj+TSO+X3le6PfWwqDvodsb+OumE10eMFfuMCTQSQ5iuIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.8", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.9", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^22.20 || ^24.12 || >=25" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz", + "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.64.12.tgz", + "integrity": "sha512-Z8lz+5UOiCJLonjeqwJlhUtHA/Sr6R1AidkccQxdWF0nigNzP81aLoU+udgOaGfL5s1uzFXzcux/pCwGAMu0lw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.64.12.tgz", + "integrity": "sha512-+tKxNa2psFmiTb0KfXlXs4Yj7vkEhzAvZ0DrQ5+0gWHQJM10jSleQ3l1FIVm5uvD53YM8lHfM4mgCLDDN9f1Gg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.64.12.tgz", + "integrity": "sha512-iiripdfvyRBugV55/Dk7GplNXQtN/PG85OcKeveU1z2UkTg0MofbBF1qk//qgPWiqJbVvQcXAVCfE56oDGO4EQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.64.12.tgz", + "integrity": "sha512-BmATib8swSMAagWNIfDZMnb+k34RXR4bbGOUfZgK8lLlniuMyVoSDDXCOGkdhtUmBXL4aygDh7bhjQ+TmhTvIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.64.12.tgz", + "integrity": "sha512-GzrO0CiUq8vcAI/hYJuIcp6wNm3T3YhOpumYtf9Z3Fz+cfN1VESCVfy7EPcM3/m2K8l+Gn2U+4XtNZjwhUXctQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.64.12.tgz", + "integrity": "sha512-Dpta6gigm4o6SYioXtTkZBlGLA/Sl6OpzgLqY+51uafJE2blPejAtR1w82CVLPN+F9cvo1+/em92x/zcOgY0uQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.64.12.tgz", + "integrity": "sha512-YpeDwQ5uFaogRvytNC8RK0keDO65kI5wNEhGSs+4GiJc3KHhxj4j5cnQh2nCu9ybJj6RP0/ycB6bkN0yFJ9I+w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.64.12.tgz", + "integrity": "sha512-LQrB3/sImIr1ycrlEyaApOLH1rAy8JV4/dH4eoK817aWATdcs4fESXz53/w72NwDnwPM5zEUpoL7socH4ZDnwA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.64.12.tgz", + "integrity": "sha512-iAF2iYu9S4SBfNsb4k0ewNBjO83WxHEltIuKQBGMzEKFgrYfmJn+gatBDXR2t/0zJN0UW0kzR4rfvQ1UHzkZ1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.64.12.tgz", + "integrity": "sha512-0MQdRtdbirJCXPIVeW/hd/LXLR8Qz96pc+2EBptuuV5q/zSGOzND7SZt8gBTE58NC9cUG/8UxcUXQiKRZ2WzzA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.64.12.tgz", + "integrity": "sha512-yGDEwn0AGnrY/KCz2oY8R9KKNiQnTcwNuCWXeSXF0VLxXzlqoCgaS5QHsf1lbQvKWwPuN2Czkjk1wXRCBONTOQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.64.12.tgz", + "integrity": "sha512-AjlbD0efZEhHaJ3bsNjxSFDoguNq6VZvC+FKGJGBCA+ZN7BrZq2TuuSWFa6AI8IpOeuvhp2LoYcP7jiZwmtU0Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.64.12.tgz", + "integrity": "sha512-sDW0CiPoUCEEUV25uBG5sJ2gKe75DJqLpj91m1eK1vKffywyY7v4i6q1450ZuR6QW4NArXg7JpbMGgKU8di3HQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.64.12.tgz", + "integrity": "sha512-VTQYUhMjl8kv999VuYqScgv7P9cR9KuxI/6bkUsEa3bsswqG0+otFjuLZmJ1U+ffEP4IAz0jxOeV0DX6NRBhjg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.64.12.tgz", + "integrity": "sha512-ppsKwpSjNrzJ8hge3Z3uiCcoRgAAQk2tU7auy3MFF348ffWRldFPnWIT/a/enK7huijlTfnwn4DYpDoapEb45A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.64.12.tgz", + "integrity": "sha512-Gc3cVRC1trFH+GFWWTsJz6YuD4u75fzr/q99jqQGimonN/zvN6Wecck5WGzllOHj+XYXHcq0Ibor0tanGjfI6A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.64.12.tgz", + "integrity": "sha512-pjmDTFStvwFE3shTeUDvSDiSp8/qAf5bQXejcEUDDavWz4jEhTIpCdpS06G0PEwSCSNK0Lngjz2v9l4hk3Z74A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.64.12.tgz", + "integrity": "sha512-mkbjxPqpR91u1JD7xY4aLZhr/Mqka4/RqGcG4WNGgN/lC1o7TzyCyqJoSJXp9qVVxMwpJGFlEF1VlERb+Ghw1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.64.12.tgz", + "integrity": "sha512-vIeut2LkuVc3gcsawLJPahNAzvzBcFRhu2O+yVb//BuQKz7PIItMF0piXRbN/lIDO3d68TSDd368Vg6YwgTybw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.64.12.tgz", + "integrity": "sha512-3Sx+D3r9oPkTdNUcPrIRM2Am+vzEV6VGWoImHG4ZVK2jJeOW+eDjLeTm6nvu/z/m0fiX2YmGLXIypblc336MXg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.64.12.tgz", + "integrity": "sha512-Nn2xh0teFnl71EiiUrKvECWcdGXtWF8q0uGclYwXGVw6QClGAcME0/bJSGdK+xIvd6MLEKYmjkTUvCBV+7m5Kw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.64.12.tgz", + "integrity": "sha512-n1/0H9TS+kBa4xp6n9aV7yiynBNfmerjkj2nAMIfY0ZHv1zShWRXnsAuAPAH0sfEK4ZSMK+z24q2RjAPFLCN1w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.64.12.tgz", + "integrity": "sha512-AdlDbQpsLfGlsHr1NfLZFtdnvxCKNp9TwlYVYExs8JJLWjLafUQEKJk0r9zUbmU57mw9nglMEvzqPHuLWYmaKw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.64.12.tgz", + "integrity": "sha512-u5SSUJBHod51UamjkigSr+JPre6xMy5vaWTTV2K0SnFG4RuKyYpf66dTSLFKX2cwaldpwyBurXPUCxq8riQMEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.64.12.tgz", + "integrity": "sha512-j5rXD4R/4DM5+V991AA9xOnG2Rwu2g3p5TPgu1Eu7apju0NUrLl+Bn/KpWc6wYJtlXqzwz1r+LNV1JeBU4VGvw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/matter-js": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@types/matter-js/-/matter-js-0.20.2.tgz", + "integrity": "sha512-3PPKy3QxvZ89h9+wdBV2488I1JLVs7DEpIkPvgO8JC1mUdiVSO37ZIvVctOTD7hIq8OAL2gJ3ugGSuUip6DhCw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.19.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz", + "integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" + } + }, + "node_modules/@types/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.3.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.2.0.tgz", + "integrity": "sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.29.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-rc.3", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.18.0" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.30", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.30.tgz", + "integrity": "sha512-YJs6Pz17RMNv8HoyKREtCY38E3BV1nPkWVmIb+XN1uHC1Vqt3KZCH/uJH9ZKRoiKb/icZ6tvehyee6RZNbFfRA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/body-parser": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", + "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^2.0.0", + "debug": "^4.4.3", + "http-errors": "^2.0.1", + "iconv-lite": "^0.7.2", + "on-finished": "^2.4.1", + "qs": "^6.15.2", + "raw-body": "^3.0.2", + "type-is": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/browserslist": { + "version": "4.29.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.4.tgz", + "integrity": "sha512-2TcbbiwXEq+N0kD36tykpCfyyQigUXmuwNQbnPp4Xk4PX9JOqVIKjJlIDjpH7uY6tmRGoAd+apeT1p60T8wsdA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.11.29", + "caniuse-lite": "^1.0.30001816", + "electron-to-chromium": "^1.5.459", + "node-releases": "^2.0.59", + "update-browserslist-db": "^1.3.4" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001817", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001817.tgz", + "integrity": "sha512-uZ1JG80BwhtMalIAGPxPfmNhHyd/B/nTdr3hITWlRamSyAdUStP1Gop01e7SD5q6J90ixJvWDbvmiFVfDgn4bw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/content-disposition": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-2.0.1.tgz", + "integrity": "sha512-e+H0ZXHSWYrENhQzw1LPuP4oF5MzVKmDU6d3hxlvaPEYLLg62MxtQNPRx4SYSuYJSBUgnQIG4HIN2tEtNv7Dog==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.462", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.462.tgz", + "integrity": "sha512-9qpCBlXPy5v7n1Q7WTO5rW2StI4WNQhl96HpgXRZLPlNoXAD0LbsQUflovQYAO44Yia073ISusqohncvGSMbGA==", + "dev": true, + "license": "ISC" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.3.0.tgz", + "integrity": "sha512-qCqy1xSoaugxOD4IVHb1ZWdkvCF2W3aE2okKouWj8VwJ+ztskSiXoBnCSJqfKT+cVPJhuJqe9YLbY425+Zh00g==", + "license": "MIT", + "peer": true, + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.3.0", + "content-disposition": "^2.0.1", + "content-type": "^2.0.0", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.8", + "qs": "^6.16.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.1.0", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-rate-limit": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.7.1.tgz", + "integrity": "sha512-2FXbqkygil3mZiXzEtM0IjE/UBmBNot0J1GEVrJT4JbrvwOSoEtqtO+wHbiMQELWe1eNvHoYRg2dkjOid+6JkA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "ip-address": "^10.2.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, + "node_modules/fake-indexeddb": { + "version": "6.2.6", + "resolved": "https://registry.npmjs.org/fake-indexeddb/-/fake-indexeddb-6.2.6.tgz", + "integrity": "sha512-ihhmr0KoET51jT8R4YhbUYuLLvr1qqO6INISygtN16i8loR8kAxtAUr4+EKHTSMjL+lggaAn4OC7DRqzrNgnuQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/helmet": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/helmet/-/helmet-8.3.0.tgz", + "integrity": "sha512-Qgpiaws3Sm30Av8Eah6sjMCZZwjlBu+E68rhpCWBshY1lb09HtLwj5GviX0OyQIn+ulUS0iX0AxN5n3tLZzz1w==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/EvanHahn" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/idb": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/idb/-/idb-8.0.4.tgz", + "integrity": "sha512-jd0ITCrN+Zah4J7R/Z2jnR3W7A4BXDAjmo62MwWuSjxCiueUAf7X5rbodEdidWzeknwXHmLpdZkoiiCppNi30Q==", + "license": "ISC" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "10.7.4", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.4.tgz", + "integrity": "sha512-DWBMKyeM25D70nrIiTkgQth59/G+naKOTep6huF9j+GmeK3DMD60Zvxg5d5qQnz+38AHgou6ean2LECX+lrKDg==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lucide-react": { + "version": "0.468.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.468.0.tgz", + "integrity": "sha512-6koYRhnM2N0GGZIdXzSeiNwguv1gt/FAjZOiPl76roBi3xKEXa4WmfpxgQwTTL4KipXjefrnf3oV4IsYhi4JFA==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/matter-js": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/matter-js/-/matter-js-0.20.0.tgz", + "integrity": "sha512-iC9fYR7zVT3HppNnsFsp9XOoQdQN2tUyfaKg4CHLH8bN+j6GT4Gw7IH2rP0tflAebrHFw730RR3DkVSZRX8hwA==", + "license": "MIT" + }, + "node_modules/media-typer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.1.tgz", + "integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.1.0.tgz", + "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==", + "license": "MIT", + "dependencies": { + "content-type": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/node-releases": { + "version": "2.0.59", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.59.tgz", + "integrity": "sha512-5qr2okC4ItAI0hG5SaV0HoYMpnM/Y6+Oqr7AmPYy/2uEoGvS+GbSKLeRxSS1uAdu59yz0ouzcuXievSgg///WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.31.tgz", + "integrity": "sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz", + "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/qs": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.1.tgz", + "integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==", + "license": "BSD-3-Clause", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/react": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", + "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz", + "integrity": "sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" + }, + "peerDependencies": { + "react": "^19.3.1" + } + }, + "node_modules/react-refresh": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz", + "integrity": "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.64.12", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.64.12.tgz", + "integrity": "sha512-GhAu8ZglZ61VWSX/ZW3K/qkazgURBIQL0/Yy51QsS8DPyebR5Cf/Z2PANJFpTU0aVZ9byJcyqR6xvBbkXhdGYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.64.12", + "@rollup/rollup-android-arm64": "4.64.12", + "@rollup/rollup-darwin-arm64": "4.64.12", + "@rollup/rollup-darwin-x64": "4.64.12", + "@rollup/rollup-freebsd-arm64": "4.64.12", + "@rollup/rollup-freebsd-x64": "4.64.12", + "@rollup/rollup-linux-arm-gnueabihf": "4.64.12", + "@rollup/rollup-linux-arm-musleabihf": "4.64.12", + "@rollup/rollup-linux-arm64-gnu": "4.64.12", + "@rollup/rollup-linux-arm64-musl": "4.64.12", + "@rollup/rollup-linux-loong64-gnu": "4.64.12", + "@rollup/rollup-linux-loong64-musl": "4.64.12", + "@rollup/rollup-linux-ppc64-gnu": "4.64.12", + "@rollup/rollup-linux-ppc64-musl": "4.64.12", + "@rollup/rollup-linux-riscv64-gnu": "4.64.12", + "@rollup/rollup-linux-riscv64-musl": "4.64.12", + "@rollup/rollup-linux-s390x-gnu": "4.64.12", + "@rollup/rollup-linux-x64-gnu": "4.64.12", + "@rollup/rollup-linux-x64-musl": "4.64.12", + "@rollup/rollup-openbsd-x64": "4.64.12", + "@rollup/rollup-openharmony-arm64": "4.64.12", + "@rollup/rollup-win32-arm64-msvc": "4.64.12", + "@rollup/rollup-win32-ia32-msvc": "4.64.12", + "@rollup/rollup-win32-x64-gnu": "4.64.12", + "@rollup/rollup-win32-x64-msvc": "4.64.12", + "fsevents": "~2.3.2" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", + "license": "MIT", + "dependencies": { + "content-type": "^2.0.0", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "dev": true, + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vite": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.7.tgz", + "integrity": "sha512-AHEzTORMbi7/7aXp7w7KZ5+DCUdSeLsJz0grY8xHpc9DHdYb0vQu6DqJfm2tOw3gDExNgPgnJTXxM6syYFHaCA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "esbuild": "^0.27.0 || ^0.28.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..24ef64e --- /dev/null +++ b/package.json @@ -0,0 +1,38 @@ +{ + "name": "calio", + "version": "0.1.0", + "private": true, + "type": "module", + "engines": { + "node": ">=24.0.0" + }, + "scripts": { + "dev": "vite --host 127.0.0.1", + "dev:server": "node --watch server/index.js", + "build": "tsc -b && vite build && node scripts/build-sw.js", + "start": "node server/index.js", + "test": "node --test tests/*.test.js", + "password": "node scripts/password.js" + }, + "dependencies": { + "express": "^5.1.0", + "express-rate-limit": "^8.1.0", + "helmet": "^8.1.0", + "idb": "^8.0.3", + "lucide-react": "^0.468.0", + "matter-js": "^0.20.0", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "zod": "^4.1.12" + }, + "devDependencies": { + "@types/matter-js": "^0.20.2", + "@types/node": "^24.0.0", + "@types/react": "^19.2.0", + "@types/react-dom": "^19.2.0", + "@vitejs/plugin-react": "^5.0.0", + "fake-indexeddb": "^6.2.6", + "typescript": "^5.9.3", + "vite": "^7.1.12" + } +} diff --git a/public/icon.svg b/public/icon.svg new file mode 100644 index 0000000..05d3a40 --- /dev/null +++ b/public/icon.svg @@ -0,0 +1 @@ + diff --git a/public/icons/apple-touch-icon.png b/public/icons/apple-touch-icon.png new file mode 100644 index 0000000..2ba6633 Binary files /dev/null and b/public/icons/apple-touch-icon.png differ diff --git a/public/icons/icon-192.png b/public/icons/icon-192.png new file mode 100644 index 0000000..0f5a716 Binary files /dev/null and b/public/icons/icon-192.png differ diff --git a/public/icons/icon-512.png b/public/icons/icon-512.png new file mode 100644 index 0000000..74a09e8 Binary files /dev/null and b/public/icons/icon-512.png differ diff --git a/public/icons/maskable-512.png b/public/icons/maskable-512.png new file mode 100644 index 0000000..74a09e8 Binary files /dev/null and b/public/icons/maskable-512.png differ diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest new file mode 100644 index 0000000..19670c7 --- /dev/null +++ b/public/manifest.webmanifest @@ -0,0 +1,31 @@ +{ + "id": "/", + "name": "Calio", + "short_name": "Calio", + "description": "Everyday, in balance. Your personal nutrition journal.", + "start_url": "/", + "scope": "/", + "display": "standalone", + "background_color": "#f5f5f8", + "theme_color": "#8391ed", + "icons": [ + { + "src": "/icons/icon-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/icons/icon-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/icons/maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/scripts/build-sw.js b/scripts/build-sw.js new file mode 100644 index 0000000..5950c10 --- /dev/null +++ b/scripts/build-sw.js @@ -0,0 +1,29 @@ +import { readdirSync, readFileSync, writeFileSync } from "node:fs"; +import { createHash } from "node:crypto"; +const assets = readdirSync("dist/assets").map((name) => "/assets/" + name); +const shell = [ + "/", + "/index.html", + "/icon.svg", + "/manifest.webmanifest", + "/icons/apple-touch-icon.png", + "/icons/icon-192.png", + "/icons/icon-512.png", + "/icons/maskable-512.png", + ...assets, +]; +const digest = createHash("sha256"); +for (const path of shell) + digest.update(readFileSync(path === "/" ? "dist/index.html" : "dist" + path)); +const hash = digest.digest("hex").slice(0, 12); +writeFileSync( + "dist/sw.js", + `const CACHE='calio-${hash}';const SHELL=${JSON.stringify(shell)}; +self.addEventListener('install',event=>event.waitUntil(caches.open(CACHE).then(cache=>cache.addAll(SHELL)))); +self.addEventListener('message',event=>{if(event.data==='ACTIVATE')self.skipWaiting()}); +self.addEventListener('activate',event=>event.waitUntil(caches.keys().then(keys=>Promise.all(keys.filter(key=>key.startsWith('calio-')&&key!==CACHE).map(key=>caches.delete(key)))).then(()=>self.clients.claim()))); +self.addEventListener('fetch',event=>{const url=new URL(event.request.url);if(event.request.method!=='GET'||url.origin!==self.location.origin||url.pathname.startsWith('/api/'))return; +if(event.request.mode==='navigate'){event.respondWith(caches.open(CACHE).then(cache=>cache.match('/index.html')).then(cached=>cached||fetch(event.request)));return;} +if(SHELL.includes(url.pathname))event.respondWith(caches.open(CACHE).then(cache=>cache.match(event.request)).then(cached=>cached||fetch(event.request))); +});`, +); diff --git a/scripts/container-smoke.js b/scripts/container-smoke.js new file mode 100644 index 0000000..138da23 --- /dev/null +++ b/scripts/container-smoke.js @@ -0,0 +1,157 @@ +import { execFileSync, spawnSync } from "node:child_process"; +import assert from "node:assert/strict"; +import { randomBytes } from "node:crypto"; +import { emptyNutrients } from "../shared/domain.js"; +const image = process.argv[2] || "calio:local"; +const unraid = process.argv.includes("--unraid"); +const suffix = randomBytes(4).toString("hex"); +const name = "calio-smoke-" + suffix; +const volume = name + "-data"; +const password = randomBytes(24).toString("hex"); +const docker = (args, input) => + execFileSync("docker", args, { + encoding: "utf8", + input, + stdio: [input === undefined ? "ignore" : "pipe", "pipe", "pipe"], + }).trim(); +async function start() { + docker([ + "run", + "-d", + "--name", + name, + ...(unraid ? ["--user", "99:100"] : []), + ...(unraid + ? ["--mount", `type=volume,source=${volume},target=/data,volume-nocopy`] + : ["-v", volume + ":/data"]), + "--read-only", + "--tmpfs", + "/tmp", + "--cap-drop", + "ALL", + "--security-opt", + "no-new-privileges:true", + "-e", + "APP_ORIGIN=http://localhost:3000", + "-e", + "COOKIE_SECURE=false", + "-e", + "CALIO_USERNAME=smoke", + "-e", + "CALIO_PASSWORD=" + password, + image, + ]); + let lastError; + for (let i = 0; i < 50; i++) { + try { + if ((await request("/api/health")).status === 200) return; + } catch (error) { + lastError = error; + if ( + docker(["inspect", "--format", "{{.State.Running}}", name]) === "false" + ) + break; + } + await new Promise((resolve) => setTimeout(resolve, 200)); + } + const logs = spawnSync("docker", ["logs", name], { encoding: "utf8" }); + throw new Error( + "Container failed to start: " + + logs.stdout + + logs.stderr + + "\n" + + (lastError?.message || "") + + "\n" + + docker(["inspect", "--format", "{{json .State}}", name]), + ); +} +// In-container probes work on socket-mounted Forgejo runners without published ports. +const request = async (path, body, cookie) => { + const probe = `let input=''; for await (const chunk of process.stdin) input+=chunk; + const {path,body,cookie}=JSON.parse(input); + const response=await fetch('http://127.0.0.1:3000'+path,{ + method:body===undefined?'GET':'POST', + headers:{'Content-Type':'application/json',Origin:'http://localhost:3000','X-Calio-Request':'1',Cookie:cookie||''}, + body:body===undefined?undefined:JSON.stringify(body) + }); + console.log(JSON.stringify({status:response.status,cookie:response.headers.get('set-cookie'),body:await response.text()}));`; + const result = JSON.parse( + docker( + ["exec", "-i", name, "node", "--input-type=module", "-e", probe], + JSON.stringify({ path, body, cookie }), + ), + ); + return { + status: result.status, + headers: new Headers(result.cookie ? { "set-cookie": result.cookie } : {}), + text: async () => result.body, + json: async () => JSON.parse(result.body), + }; +}; +try { + if (unraid) { + docker(["volume", "create", volume]); + // Only initialize the unique, disposable test volume, as on Unraid appdata. + docker([ + "run", + "--rm", + "--user", + "0:0", + "-v", + volume + ":/data", + "--entrypoint", + "sh", + image, + "-c", + "chown 99:100 /data", + ]); + } + await start(); + assert.equal((await request("/api/records")).status, 401); + const login = await request("/api/login", { username: "smoke", password }); + assert.equal(login.status, 200); + const cookie = login.headers.get("set-cookie").split(";")[0]; + const record = { + id: "persistence-test", + type: "food", + updatedAt: new Date().toISOString(), + deleted: false, + data: { + name: "Test food", + serving: "1 serving", + nutrients: emptyNutrients(), + }, + }; + assert.equal( + (await request("/api/sync", { records: [record] }, cookie)).status, + 200, + ); + for (const path of [ + "/", + "/sw.js", + "/manifest.webmanifest", + "/icons/apple-touch-icon.png", + ]) + assert.equal((await request(path)).status, 200, path); + const html = await (await request("/")).text(); + const asset = html.match(/src="(\/assets\/[^\"]+)"/)[1]; + assert.equal((await request(asset)).status, 200); + assert.equal(docker(["exec", name, "id", "-u"]), unraid ? "99" : "1000"); + if (unraid) assert.equal(docker(["exec", name, "id", "-g"]), "100"); + docker(["rm", "-f", name]); + await start(); + // Session and journal both survive a full container replacement, as during an update. + const response = await request("/api/records", undefined, cookie); + assert.equal(response.status, 200); + assert.deepEqual((await response.json()).records, [record]); + console.log( + `PASS (${unraid ? "Unraid 99:100" : "default 1000"}): non-root container, production assets, authentication, read-only root, persistent volume and sessions after container recreation.`, + ); +} finally { + try { + docker(["rm", "-f", name]); + } catch {} + try { + docker(["volume", "rm", volume]); + } catch {} +} diff --git a/scripts/generate-icons.ps1 b/scripts/generate-icons.ps1 new file mode 100644 index 0000000..a5bd3f0 --- /dev/null +++ b/scripts/generate-icons.ps1 @@ -0,0 +1,22 @@ +Add-Type -AssemblyName System.Drawing +$iconRoot = Join-Path $PSScriptRoot '../public/icons' +New-Item -ItemType Directory -Force -Path $iconRoot | Out-Null +foreach ($iconSpec in @(@('icon-192.png',192), @('icon-512.png',512), @('maskable-512.png',512), @('apple-touch-icon.png',180))) { + $iconSize = [int]$iconSpec[1] + $bitmap = New-Object System.Drawing.Bitmap($iconSize,$iconSize) + $graphics = [System.Drawing.Graphics]::FromImage($bitmap) + $graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias + $graphics.ScaleTransform($iconSize / 192.0, $iconSize / 192.0) + $graphics.Clear([System.Drawing.ColorTranslator]::FromHtml('#8391ed')) + $cream = New-Object System.Drawing.SolidBrush([System.Drawing.ColorTranslator]::FromHtml('#f5f5ef')) + $ringPen = New-Object System.Drawing.Pen($cream,8) + $graphics.DrawEllipse($ringPen,48,54,96,96) + foreach ($point in @(@(72,112),@(95,122),@(118,112),@(96,99))) { $graphics.FillEllipse($cream,($point[0]-8),($point[1]-8),16,16) } + $leaf = New-Object System.Drawing.Drawing2D.GraphicsPath + $leaf.AddBezier(96,50,94,27,119,26,120,27) + $leaf.AddBezier(120,27,120,44,105,51,96,50) + $green = New-Object System.Drawing.SolidBrush([System.Drawing.ColorTranslator]::FromHtml('#cad1ff')) + $graphics.FillPath($green,$leaf) + $bitmap.Save((Join-Path $iconRoot $iconSpec[0]),[System.Drawing.Imaging.ImageFormat]::Png) + $graphics.Dispose(); $bitmap.Dispose(); $cream.Dispose(); $ringPen.Dispose(); $leaf.Dispose(); $green.Dispose() +} diff --git a/scripts/password.js b/scripts/password.js new file mode 100644 index 0000000..d5276d5 --- /dev/null +++ b/scripts/password.js @@ -0,0 +1,10 @@ +import { hashPassword } from "../server/auth.js"; +// Read from stdin so passwords never need to appear in shell arguments. +let input = ""; +for await (const chunk of process.stdin) input += chunk; +const password = input.trimEnd(); +if (password.length < 12) + throw new Error( + "Use at least 12 characters. Pipe the password through stdin.", + ); +console.log(hashPassword(password)); diff --git a/scripts/publish-image.js b/scripts/publish-image.js new file mode 100644 index 0000000..965562f --- /dev/null +++ b/scripts/publish-image.js @@ -0,0 +1,108 @@ +import { spawnSync, execFileSync } from "node:child_process"; +import { mkdtempSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import { pathToFileURL } from "node:url"; + +export function publicationPlan(env) { + if (!["push", "workflow_dispatch"].includes(env.CI_EVENT)) return null; + const repository = (env.REPOSITORY || "").toLowerCase(); + if (!/^[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*$/.test(repository)) + throw new Error("Invalid REPOSITORY"); + const sha = env.COMMIT_SHA || ""; + if (!/^[a-f0-9]{40}$/.test(sha)) + throw new Error("COMMIT_SHA must be a full Git commit ID"); + const image = "git.elijahkuntz.com/" + repository; + const tags = [sha]; + const ref = env.TARGET_REF || ""; + const latest = ref === "refs/heads/" + (env.MAIN_BRANCH || "main"); + const version = ref.startsWith("refs/tags/") + ? ref.slice("refs/tags/".length) + : ""; + if (/^v[\w][\w.-]{0,126}$/.test(version)) tags.push(version.toLowerCase()); + return { registry: "git.elijahkuntz.com", image, tags, latest, sha }; +} + +export function publishImage(env = process.env, dryRun = false) { + const plan = publicationPlan(env); + if (!plan) { + console.log("This event verifies the image without publishing."); + return; + } + if (dryRun) { + console.log( + JSON.stringify( + { ...plan, latestRequiresCurrentBranchHead: plan.latest }, + null, + 2, + ), + ); + return; + } + if (!env.FORGEJO_PAT) + throw new Error( + "Add FORGEJO_PAT with write:package permission under Calio Settings → Actions → Secrets, then rerun this workflow.", + ); + if (!env.REGISTRY_USERNAME) + throw new Error("REGISTRY_USERNAME must identify the token owner"); + const configDir = mkdtempSync(join(tmpdir(), "calio-registry-")); + const childEnv = { ...process.env, ...env, DOCKER_CONFIG: configDir }; + const sourceImage = env.SOURCE_IMAGE || "calio:ci"; + const docker = (args, input) => { + const result = spawnSync("docker", args, { + env: childEnv, + input, + stdio: [input === undefined ? "ignore" : "pipe", "inherit", "inherit"], + }); + if (result.error) throw result.error; + if (result.status !== 0) throw new Error(`docker ${args[0]} failed`); + }; + try { + docker( + [ + "login", + plan.registry, + "--username", + env.REGISTRY_USERNAME, + "--password-stdin", + ], + env.FORGEJO_PAT, + ); + for (const tag of plan.tags) { + const target = `${plan.image}:${tag}`; + docker(["tag", sourceImage, target]); + docker(["push", target]); + } + if (plan.latest) { + const head = execFileSync( + "git", + ["ls-remote", "origin", `refs/heads/${env.MAIN_BRANCH || "main"}`], + { encoding: "utf8" }, + ) + .trim() + .split(/\s+/)[0]; + if (head !== plan.sha) { + console.log( + "Main has a newer commit; published the commit tag and left latest unchanged.", + ); + return; + } + docker(["tag", sourceImage, `${plan.image}:latest`]); + docker(["push", `${plan.image}:latest`]); + } + } finally { + rmSync(configDir, { recursive: true, force: true }); + } +} + +if ( + process.argv[1] && + import.meta.url === pathToFileURL(process.argv[1]).href +) { + try { + publishImage(process.env, process.argv.includes("--dry-run")); + } catch (error) { + console.error(error.message); + process.exitCode = 1; + } +} diff --git a/server/app.js b/server/app.js new file mode 100644 index 0000000..58070dd --- /dev/null +++ b/server/app.js @@ -0,0 +1,175 @@ +import express from "express"; +import helmet from "helmet"; +import { rateLimit } from "express-rate-limit"; +import { randomBytes, timingSafeEqual, createHash } from "node:crypto"; +import { resolve, join } from "node:path"; +import { existsSync } from "node:fs"; +import { z } from "zod"; +import { recordSchema } from "../shared/domain.js"; +import { checkPassword, tokenHash } from "./auth.js"; + +export function createApp({ + store, + username, + passwordHash, + origin, + secureCookies = true, + dist = resolve("dist"), +}) { + const app = express(); + app.disable("x-powered-by"); + app.use( + helmet({ + contentSecurityPolicy: { + directives: { + "script-src": ["'self'"], + "style-src": ["'self'", "'unsafe-inline'"], + "img-src": ["'self'", "data:"], + "connect-src": ["'self'"], + "object-src": ["'none'"], + "upgrade-insecure-requests": secureCookies ? [] : null, + }, + }, + strictTransportSecurity: secureCookies ? undefined : false, + }), + ); + app.use("/api", (_, res, next) => { + res.set("Cache-Control", "no-store"); + next(); + }); + app.use("/api", (req, res, next) => { + if ( + ["POST", "PUT", "PATCH", "DELETE"].includes(req.method) && + (req.get("X-Calio-Request") !== "1" || req.get("Origin") !== origin) + ) + return res.status(403).json({ error: "Request origin rejected" }); + next(); + }); + app.use(express.json({ limit: "2mb" })); + app.get("/api/health", (_, res) => res.json({ ok: true, version: "0.1.0" })); + const cookieName = secureCookies ? "__Host-calio" : "calio"; + const getToken = (req) => + req.headers.cookie + ?.split(";") + .map((v) => v.trim()) + .find((v) => v.startsWith(cookieName + "=")) + ?.slice(cookieName.length + 1) || ""; + const cookie = { + httpOnly: true, + secure: secureCookies, + sameSite: "strict", + path: "/", + maxAge: 30 * 86400000, + }; + const requireAuth = (req, res, next) => { + const session = store.db + .prepare("SELECT expires FROM sessions WHERE token_hash=?") + .get(tokenHash(getToken(req))); + if (!session || session.expires < Date.now()) + return res.status(401).json({ error: "Sign in to sync your journal" }); + next(); + }; + const loginLimiter = rateLimit({ + windowMs: 15 * 60000, + limit: 10, + standardHeaders: "draft-8", + legacyHeaders: false, + message: { error: "Too many sign-in attempts. Try again in 15 minutes." }, + }); + app.post("/api/login", loginLimiter, (req, res) => { + if ( + typeof req.body?.username !== "string" || + typeof req.body?.password !== "string" || + req.body.password.length > 1024 + ) + return res.status(400).json({ error: "Enter a username and password" }); + const digest = (value) => createHash("sha256").update(value).digest(); + const correctPassword = checkPassword(req.body.password, passwordHash); + if ( + !timingSafeEqual(digest(req.body.username), digest(username)) || + !correctPassword + ) + return res.status(401).json({ error: "Incorrect username or password" }); + const token = randomBytes(32).toString("hex"); + store.db.prepare("DELETE FROM sessions WHERE expires < ?").run(Date.now()); + store.db + .prepare("INSERT INTO sessions VALUES (?,?)") + .run(tokenHash(token), Date.now() + cookie.maxAge); + res.cookie(cookieName, token, cookie).json({ ok: true }); + }); + app.get("/api/session", requireAuth, (_, res) => + res.json({ authenticated: true }), + ); + app.post("/api/logout", (req, res) => { + store.db + .prepare("DELETE FROM sessions WHERE token_hash=?") + .run(tokenHash(getToken(req))); + res + .clearCookie(cookieName, { ...cookie, maxAge: undefined }) + .json({ ok: true }); + }); + app.get("/api/records", requireAuth, (_, res) => + res.json({ records: store.all(), serverTime: new Date().toISOString() }), + ); + app.post("/api/sync", requireAuth, (req, res) => { + const parsed = z + .object({ records: z.array(recordSchema).max(1000) }) + .strict() + .safeParse(req.body); + if (!parsed.success) + return res + .status(400) + .json({ + error: "Invalid journal data", + details: parsed.error.flatten(), + }); + if ( + parsed.data.records.some( + (record) => Date.parse(record.updatedAt) > Date.now() + 300000, + ) + ) + return res + .status(400) + .json({ + error: "Your device clock is ahead. Correct it before syncing.", + }); + try { + res.json({ + records: store.merge(parsed.data.records), + serverTime: new Date().toISOString(), + }); + } catch { + res + .status(409) + .json({ + error: "A record ID is already used for another kind of item", + }); + } + }); + app.use("/api", (_, res) => res.status(404).json({ error: "Not found" })); + if (existsSync(dist)) { + app.use( + express.static(dist, { + maxAge: 0, + setHeaders: (res, path) => { + if (path.includes(`${join("assets", "")}`)) + res.set("Cache-Control", "public, max-age=31536000, immutable"); + if (path.endsWith("sw.js") || path.endsWith("index.html")) + res.set("Cache-Control", "no-cache"); + }, + }), + ); + app.get("/{*path}", (_, res) => res.sendFile(join(dist, "index.html"))); + } + app.use((error, _req, res, _next) => + res + .status(error.status || 500) + .json({ + error: + error.status === 413 + ? "Request is too large" + : "Request could not be processed", + }), + ); + return app; +} diff --git a/server/auth.js b/server/auth.js new file mode 100644 index 0000000..987d006 --- /dev/null +++ b/server/auth.js @@ -0,0 +1,25 @@ +import { + scryptSync, + randomBytes, + timingSafeEqual, + createHash, +} from "node:crypto"; +export function hashPassword(password) { + const salt = randomBytes(16).toString("hex"); + return `scrypt:${salt}:${scryptSync(password, salt, 64).toString("hex")}`; +} +export function checkPassword(password, hash) { + const [method, salt, hex] = hash.split(":"); + if ( + method !== "scrypt" || + !/^[a-f0-9]{32}$/.test(salt) || + !/^[a-f0-9]{128}$/.test(hex) + ) + return false; + return timingSafeEqual( + scryptSync(password, salt, 64), + Buffer.from(hex, "hex"), + ); +} +export const tokenHash = (token) => + createHash("sha256").update(token).digest("hex"); diff --git a/server/backup.js b/server/backup.js new file mode 100644 index 0000000..6a1c66b --- /dev/null +++ b/server/backup.js @@ -0,0 +1,24 @@ +import { DatabaseSync } from "node:sqlite"; +import { mkdirSync, existsSync } from "node:fs"; +import { dirname, resolve } from "node:path"; +const source = resolve(process.env.DATA_DIR || "data", "calio.sqlite"); +if (!existsSync(source)) throw new Error("No Calio database found."); +const output = resolve( + process.argv[2] || + (process.env.DATA_DIR || "data") + + "/backups/calio-" + + new Date().toISOString().replaceAll(":", "-") + + ".sqlite", +); +if (output === source || existsSync(output)) + throw new Error( + "Choose a new backup path. Existing files are never overwritten.", + ); +mkdirSync(dirname(output), { recursive: true }); +const db = new DatabaseSync(source); +try { + db.prepare("VACUUM INTO ?").run(output); + console.log(output); +} finally { + db.close(); +} diff --git a/server/db.js b/server/db.js new file mode 100644 index 0000000..63b4e12 --- /dev/null +++ b/server/db.js @@ -0,0 +1,50 @@ +import { DatabaseSync } from "node:sqlite"; +import { compareRecords } from "../shared/domain.js"; + +export function openDatabase(filename) { + const db = new DatabaseSync(filename); + db.exec( + "PRAGMA journal_mode=WAL; PRAGMA busy_timeout=5000; PRAGMA foreign_keys=ON;", + ); + const version = db.prepare("PRAGMA user_version").get().user_version; + if (version > 1) { + db.close(); + throw new Error( + "Database was created by a newer Calio version. Refusing to downgrade.", + ); + } + if (version < 1) { + db.exec(`BEGIN IMMEDIATE; + CREATE TABLE records (id TEXT PRIMARY KEY, type TEXT NOT NULL, payload TEXT NOT NULL); + CREATE TABLE sessions (token_hash TEXT PRIMARY KEY, expires INTEGER NOT NULL); + PRAGMA user_version=1; + COMMIT;`); + } + const all = () => + db + .prepare("SELECT payload FROM records ORDER BY id") + .all() + .map((row) => JSON.parse(row.payload)); + const merge = (incoming) => { + db.exec("BEGIN IMMEDIATE"); + try { + for (const record of incoming) { + const row = db + .prepare("SELECT payload FROM records WHERE id=?") + .get(record.id); + if (row && JSON.parse(row.payload).type !== record.type) + throw new Error("Record type cannot change"); + if (!row || compareRecords(record, JSON.parse(row.payload)) > 0) + db.prepare( + "INSERT INTO records(id,type,payload) VALUES(?,?,?) ON CONFLICT(id) DO UPDATE SET payload=excluded.payload", + ).run(record.id, record.type, JSON.stringify(record)); + } + db.exec("COMMIT"); + } catch (error) { + db.exec("ROLLBACK"); + throw error; + } + return all(); + }; + return { db, all, merge, close: () => db.close() }; +} diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..737f2bc --- /dev/null +++ b/server/index.js @@ -0,0 +1,49 @@ +import { mkdirSync, readFileSync } from "node:fs"; +import { resolve } from "node:path"; +import { openDatabase } from "./db.js"; +import { createApp } from "./app.js"; +import { hashPassword } from "./auth.js"; +const secret = (name) => + process.env[name + "_FILE"] + ? readFileSync(process.env[name + "_FILE"], "utf8").trimEnd() + : process.env[name]; +const password = secret("CALIO_PASSWORD"); +const passwordHash = + secret("CALIO_PASSWORD_HASH") || (password && hashPassword(password)); +if (!passwordHash || !/^scrypt:[a-f0-9]{32}:[a-f0-9]{128}$/.test(passwordHash)) + throw new Error( + "Configure CALIO_PASSWORD_HASH[_FILE] or CALIO_PASSWORD[_FILE]. There are no default credentials.", + ); +if (password && password.length < 12) + throw new Error("CALIO_PASSWORD must be at least 12 characters."); +const origin = process.env.APP_ORIGIN || "http://localhost:3000"; +if (new URL(origin).origin !== origin) + throw new Error("APP_ORIGIN must be an origin without a trailing slash"); +const secureCookies = process.env.COOKIE_SECURE !== "false"; +if ( + !secureCookies && + !["localhost", "127.0.0.1"].includes(new URL(origin).hostname) +) + throw new Error( + "Insecure cookies are allowed only on localhost. Use HTTPS for deployment.", + ); +const dataDir = resolve(process.env.DATA_DIR || "data"); +mkdirSync(dataDir, { recursive: true }); +const store = openDatabase(resolve(dataDir, "calio.sqlite")); +const app = createApp({ + store, + username: process.env.CALIO_USERNAME || "calio", + passwordHash, + origin, + secureCookies, +}); +const server = app.listen(Number(process.env.PORT || 3000), "0.0.0.0", () => + console.log(`Calio listening at ${origin}`), +); +for (const signal of ["SIGTERM", "SIGINT"]) + process.on(signal, () => + server.close(() => { + store.close(); + process.exit(0); + }), + ); diff --git a/shared/bubble-physics.js b/shared/bubble-physics.js new file mode 100644 index 0000000..91e0f2f --- /dev/null +++ b/shared/bubble-physics.js @@ -0,0 +1,157 @@ +import Matter from "matter-js"; + +const { Bodies, Body, Composite, Engine, Sleeping } = Matter; +export const BUBBLE_RADIUS = 9.5; +export const DRAW_BUBBLE_RADIUS = 8.4; +export const VESSEL_RADIUS = 142; +const packedPositions = []; +for (let row = -9; row <= 9; row++) + for (let col = -9; col <= 9; col++) { + const x = 160 + (col + (row % 2) * 0.5) * 19.1; + const y = 160 + (row * 19.1 * Math.sqrt(3)) / 2; + if (Math.hypot(x - 160, y - 160) <= VESSEL_RADIUS - BUBBLE_RADIUS) + packedPositions.push({ x, y }); + } +packedPositions.sort( + (a, b) => b.y - a.y || Math.abs(a.x - 160) - Math.abs(b.x - 160), +); +export const MAX_BUBBLES = packedPositions.length; +export function bubbleCount(value, goal, enabled) { + const ratio = Math.max(0, Math.min(value / (enabled ? goal : 2500), 1)); + return ratio > 0 ? Math.max(1, Math.round(ratio * MAX_BUBBLES)) : 0; +} + +// Project Earth's gravity onto the screen, then account for portrait/landscape. +// Alpha is a compass heading and does not affect gravity. +export function screenGravity(beta, gamma, screenAngle = 0) { + const b = (beta * Math.PI) / 180; + const g = (gamma * Math.PI) / 180; + const angle = (screenAngle * Math.PI) / 180; + const x = Math.sin(g) * Math.cos(b); + const y = Math.sin(b); + if (Math.hypot(x, y) < 0.12) return { x: 0, y: 0.18 }; + return { + x: x * Math.cos(angle) + y * Math.sin(angle), + y: -x * Math.sin(angle) + y * Math.cos(angle), + }; +} + +export function createBubbleWorld(initialCount = 0, random = Math.random) { + const engine = Engine.create({ + enableSleeping: true, + positionIterations: 24, + velocityIterations: 8, + }); + engine.gravity.scale = 0.00035; + const balls = []; + let target = initialCount; + let spawnTime = 0; + const walls = Array.from({ length: 72 }, (_, i) => { + const angle = (i / 72) * Math.PI * 2; + const radius = VESSEL_RADIUS + 9; + return Bodies.rectangle( + 160 + Math.cos(angle) * radius, + 160 + Math.sin(angle) * radius, + (2 * Math.PI * radius) / 72 + 2, + 18, + { + isStatic: true, + angle: angle + Math.PI / 2, + friction: 0.05, + restitution: 0.2, + }, + ); + }); + Composite.add(engine.world, walls); + function add(x, y) { + const ball = Bodies.polygon(x, y, 24, BUBBLE_RADIUS, { + restitution: 0.34, + friction: 0.035, + frictionStatic: 0.15, + frictionAir: 0.018, + sleepThreshold: 45, + }); + ball.circleRadius = BUBBLE_RADIUS; + balls.push(ball); + Composite.add(engine.world, ball); + return ball; + } + function wake() { + for (const ball of balls) Sleeping.set(ball, false); + } + function seed(count) { + for (const ball of balls) Composite.remove(engine.world, ball); + balls.length = 0; + target = Math.min(MAX_BUBBLES, Math.max(0, count)); + for (let i = 0; i < target; i++) + add(packedPositions[i].x, packedPositions[i].y); + } + seed(initialCount); + function setTarget(count) { + target = Math.min(MAX_BUBBLES, Math.max(0, count)); + while (balls.length > target) Composite.remove(engine.world, balls.pop()); + wake(); + } + function gravity(x, y) { + if (Math.hypot(engine.gravity.x - x, engine.gravity.y - y) < 0.025) + return false; + engine.gravity.x = x; + engine.gravity.y = y; + wake(); + return true; + } + function step(delta = 1000 / 60) { + spawnTime += delta; + if (balls.length < target && spawnTime >= 45) { + spawnTime = 0; + // Each new bubble enters at the upper inside edge, then falls naturally. + const x = 160 + (random() - 0.5) * 55; + const y = + 160 - + Math.sqrt((VESSEL_RADIUS - BUBBLE_RADIUS - 2) ** 2 - (x - 160) ** 2); + const ball = add(x, y); + Body.setVelocity(ball, { x: (random() - 0.5) * 1.5, y: 0.6 }); + wake(); + } + Engine.update(engine, Math.min(delta, 1000 / 60)); + // Prevent rare tunnelling during fast rotation or a suspended-tab resume. + for (const ball of balls) { + const dx = ball.position.x - 160; + const dy = ball.position.y - 160; + const distance = Math.hypot(dx, dy); + const limit = VESSEL_RADIUS - DRAW_BUBBLE_RADIUS; + if (distance > VESSEL_RADIUS + BUBBLE_RADIUS) { + const nx = dx / distance; + const ny = dy / distance; + Body.setPosition(ball, { x: 160 + nx * limit, y: 160 + ny * limit }); + const outward = ball.velocity.x * nx + ball.velocity.y * ny; + if (outward > 0) + Body.setVelocity(ball, { + x: ball.velocity.x - outward * 1.3 * nx, + y: ball.velocity.y - outward * 1.3 * ny, + }); + } + } + } + function nudge() { + for (const ball of balls) { + Sleeping.set(ball, false); + Body.setVelocity(ball, { x: (random() - 0.5) * 7, y: -2 - random() * 4 }); + } + } + return { + engine, + balls, + step, + seed, + setTarget, + gravity, + nudge, + awake: () => + balls.length < target || balls.some((ball) => !ball.isSleeping), + dispose: () => { + Composite.clear(engine.world, false); + Engine.clear(engine); + }, + }; +} diff --git a/shared/domain.js b/shared/domain.js new file mode 100644 index 0000000..1932cfd --- /dev/null +++ b/shared/domain.js @@ -0,0 +1,143 @@ +import { z } from "zod"; + +export const metricKeys = [ + "calories", + "protein", + "carbs", + "fat", + "fiber", + "sugar", + "sodium", +]; +const amount = z.number().finite().min(0).max(100000); +export const nutrientsSchema = z + .object(Object.fromEntries(metricKeys.map((key) => [key, amount]))) + .strict(); +const date = z + .string() + .regex(/^\d{4}-\d{2}-\d{2}$/) + .refine((value) => { + const parsed = new Date(value + "T12:00:00Z"); + return ( + !Number.isNaN(+parsed) && parsed.toISOString().slice(0, 10) === value + ); + }, "Invalid date"); +const name = z.string().trim().min(1).max(160); +const food = z.object({ + name, + serving: z.string().trim().min(1).max(100), + nutrients: nutrientsSchema, +}); +const entry = food + .extend({ + date, + meal: z.enum(["Breakfast", "Lunch", "Dinner", "Snacks"]), + quantity: z.number().finite().positive().max(1000), + }) + .strict(); +const goal = z + .object({ + enabled: z.boolean(), + target: z.number().finite().positive().max(100000), + }) + .strict(); +const settings = z + .object({ + theme: z.enum(["system", "light", "dark"]), + accentColor: z + .string() + .regex(/^#[a-fA-F0-9]{6}$/) + .optional(), + unit: z.enum(["kg", "lb"]), + goals: z + .object(Object.fromEntries(metricKeys.map((key) => [key, goal]))) + .strict(), + exportFormat: z.enum(["markdown", "csv", "json"]), + exportDays: z.enum(["7", "30", "90", "all"]), + exportMetrics: z.array(z.enum(metricKeys)).max(7).optional(), + exportWeight: z.boolean().optional(), + }) + .strict(); +export const recordSchema = z + .object({ + id: z.string().regex(/^[\w-]{1,80}$/), + type: z.enum(["entry", "food", "plate", "weight", "settings"]), + updatedAt: z.string().datetime({ offset: false }), + deleted: z.boolean(), + data: z.unknown(), + }) + .strict() + .superRefine((record, ctx) => { + if (record.type === "settings" && record.id !== "settings") + ctx.addIssue({ + code: "custom", + message: "Settings must use the settings ID", + }); + if (record.type !== "settings" && record.id === "settings") + ctx.addIssue({ code: "custom", message: "Reserved settings ID" }); + const schema = { + entry, + food: food.strict(), + plate: z + .object({ + name, + items: z + .array( + food + .extend({ quantity: z.number().finite().positive().max(1000) }) + .strict(), + ) + .min(1) + .max(100), + }) + .strict(), + weight: z + .object({ + date, + valueKg: z.number().finite().positive().max(1000), + notes: z.string().max(500), + }) + .strict(), + settings, + }[record.type]; + const result = schema.safeParse(record.data); + if (!result.success) + for (const issue of result.error.issues) + ctx.addIssue({ + code: "custom", + message: issue.message, + path: ["data", ...issue.path], + }); + }); + +// The full payload breaks same-millisecond ties identically on every device. +export function compareRecords(a, b) { + const timestamp = Date.parse(a.updatedAt) - Date.parse(b.updatedAt); + if (timestamp) return timestamp; + const left = JSON.stringify([a.deleted, a.data]); + const right = JSON.stringify([b.deleted, b.data]); + return left === right ? 0 : left > right ? 1 : -1; +} +export function emptyNutrients() { + return Object.fromEntries(metricKeys.map((k) => [k, 0])); +} +export function totalNutrients(entries) { + const total = emptyNutrients(); + for (const item of entries) + for (const key of metricKeys) + total[key] += (item.nutrients[key] || 0) * (item.quantity ?? 1); + return total; +} +export const defaultSettings = { + theme: "system", + accentColor: "#8391ed", + unit: "lb", + exportFormat: "markdown", + exportDays: "30", + goals: Object.fromEntries( + metricKeys.map((key, i) => [ + key, + { enabled: i < 4, target: [2000, 120, 250, 65, 30, 50, 2300][i] }, + ]), + ), +}; diff --git a/shared/theme.js b/shared/theme.js new file mode 100644 index 0000000..85534de --- /dev/null +++ b/shared/theme.js @@ -0,0 +1,55 @@ +export const DEFAULT_ACCENT = "#8391ed"; +export const accentPresets = [ + { name: "Periwinkle", color: "#8391ed" }, + { name: "Sky", color: "#6daed9" }, + { name: "Lavender", color: "#b28adc" }, + { name: "Rose", color: "#d780a2" }, + { name: "Amber", color: "#d9a65d" }, + { name: "Sage", color: "#8ca37a" }, +]; +function rgb(hex) { + return [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16)); +} +export function mixColor(color, other, fraction) { + const first = rgb(color); + const second = rgb(other); + return ( + "#" + + first + .map((value, i) => + Math.round(value * (1 - fraction) + second[i] * fraction) + .toString(16) + .padStart(2, "0"), + ) + .join("") + ); +} +export function contrastText(color) { + const [r, g, b] = rgb(color).map((v) => { + const s = v / 255; + return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4; + }); + return r * 0.2126 + g * 0.7152 + b * 0.0722 > 0.179 ? "#000000" : "#ffffff"; +} +export function accentPalette(value, dark) { + const accent = /^#[a-fA-F0-9]{6}$/.test(value || "") ? value : DEFAULT_ACCENT; + const hover = mixColor(accent, dark ? "#ffffff" : "#000000", 0.12); + return { + "--accent": accent, + "--accent-dark": hover, + "--accent-soft": mixColor( + accent, + dark ? "#191a20" : "#ffffff", + dark ? 0.84 : 0.9, + ), + "--accent-text": mixColor( + accent, + dark ? "#ffffff" : "#000000", + dark ? 0.28 : 0.26, + ), + "--on-accent": contrastText(accent), + "--on-accent-hover": contrastText(hover), + "--orb-light": mixColor(accent, "#ffffff", dark ? 0.22 : 0.38), + "--orb-dark": mixColor(accent, "#000000", 0.04), + }; +} diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..7fdfea3 --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,1144 @@ +import { useCallback, useEffect, useMemo, useState } from "react"; +import { + Activity, + ArrowRight, + ArrowUpRight, + BookOpen, + Check, + ChevronLeft, + ChevronRight, + CircleHelp, + CloudOff, + Coffee, + Home, + Leaf, + LoaderCircle, + LockKeyhole, + Moon, + MoreHorizontal, + Pencil, + Plus, + Scale, + Search, + Settings2, + ShieldCheck, + Sparkles, + Sun, + Trash2, + Utensils, + WifiOff, + X, +} from "lucide-react"; +import { defaultSettings, totalNutrients } from "../shared/domain.js"; +import { accentPalette } from "../shared/theme.js"; +import { + deleteRecord, + initStore, + login, + sync, + useJournal, + useSyncStatus, +} from "./store"; +import { + meals, + metrics, + type Entry, + type Food, + type JournalRecord, + type Meal, + type Plate, + type Settings as SettingsData, + type Weight, +} from "./types"; +import { + dayDate, + displayDate, + number, + offsetDay, + recordsOf, + today, + weightValue, +} from "./utils"; +import { + CalorieOrb, + Empty, + FoodEditor, + Modal, + PlateEditor, + WeightEditor, +} from "./components"; +import { Trends } from "./Trends"; +import { Settings } from "./Settings"; + +type Page = "today" | "library" | "trends" | "settings"; +type Editor = + | { kind: "log"; meal: Meal; record?: JournalRecord } + | { kind: "food"; record?: JournalRecord } + | { kind: "plate"; record?: JournalRecord } + | { kind: "weight"; record?: JournalRecord } + | null; +type InstallEvent = Event & { prompt: () => Promise }; + +function SignIn({ + reauth, + onCancel, +}: { + reauth?: boolean; + onCancel?: () => void; +}) { + const [username, setUsername] = useState(""); + const [password, setPassword] = useState(""); + const [error, setError] = useState(""); + const [busy, setBusy] = useState(false); + return ( +
+
+
+ + calio +
+
+ A LITTLE CLARITY, EVERY DAY +

+ Good habits. +
A gentler space. +

+

+ Your food, your progress, your rhythm. +
A personal journal for everyday balance. +

+
+
+ + + + Room to grow. + +
+ EVERYDAY, IN BALANCE. +
+
+
+ + calio +
+
{ + e.preventDefault(); + setBusy(true); + setError(""); + try { + await login(username, password); + onCancel?.(); + } catch (err) { + setError((err as Error).message); + } finally { + setBusy(false); + } + }} + > + + + + YOUR PERSONAL SPACE +

{reauth ? "Welcome back." : "A fresh perspective."}

+

+ {reauth + ? "Sign in again to sync. Your local entries are safe." + : "Sign in to your Calio journal."} +

+ + + {error && ( +

+ {error} +

+ )} + + {reauth && ( + + )} +
+ + One account. Your own server. Just for you. +
+
+
+
+ ); +} +function Dashboard({ + records, + settings, + date, + setDate, + add, + edit, + remove, + openLibrary, + logWeight, +}: { + records: JournalRecord[]; + settings: SettingsData; + date: string; + setDate: (date: string) => void; + add: (meal: Meal) => void; + edit: (r: JournalRecord) => void; + remove: (r: JournalRecord) => void; + openLibrary: () => void; + logWeight: () => void; +}) { + const entries = recordsOf(records, "entry"); + const dayEntries = entries.filter((r) => r.data.date === date); + const totals = totalNutrients(dayEntries.map((r) => r.data)); + const weekStart = offsetDay(date, -((dayDate(date).getDay() + 6) % 7)); + const week = Array.from({ length: 7 }, (_, i) => { + const d = offsetDay(weekStart, i); + return { + date: d, + calories: totalNutrients( + entries.filter((r) => r.data.date === d).map((r) => r.data), + ).calories, + }; + }); + const tracked = metrics.filter( + (m) => m.key !== "calories" && settings.goals[m.key].enabled, + ); + const goal = settings.goals.calories; + const latestWeight = recordsOf(records, "weight").sort( + (a, b) => + b.data.date.localeCompare(a.data.date) || + b.updatedAt.localeCompare(a.updatedAt), + )[0]; + const mealIcons = { + Breakfast: Coffee, + Lunch: Sun, + Dinner: Moon, + Snacks: Sparkles, + }; + return ( + <> +
+
+ EVERYDAY, IN BALANCE +

+ {date === today() + ? "A little better, today" + : displayDate(date, { weekday: "long" })} + . +

+

+ {displayDate(date, { + weekday: "long", + month: "long", + day: "numeric", + year: "numeric", + })} +

+
+
+ + +
+
+
+
+
+
+ A SNAPSHOT OF YOUR DAY +

Daily balance

+
+ + + {goal.enabled + ? `${Math.round((totals.calories / goal.target) * 100)}% of goal` + : "Goal off"} + +
+
+ + {week.map((day) => ( + + ))} + +
+ +
+
+ {" "} + {number(totals.calories)} + eaten +
+ +
+ + {goal.enabled ? number(goal.target) : "—"} + daily goal +
+
+ {tracked.length > 0 ? ( +
+ {tracked.map((m) => { + const target = settings.goals[m.key].target; + return ( +
+ + + {m.label} + +
+ {number(totals[m.key], 1)} + + {" "} + / {number(target)} {m.unit} + +
+
+ +
+
+ ); + })} +
+ ) : ( +

+ Your day, with only the details you choose to track. +

+ )} +
+ + + {dayEntries.length + ? "A little awareness goes a long way." + : "A new day. A little room for possibility."} + +
+
+
+
+
+
+ SAVOR THE EVERYDAY +

On the menu

+
+ + {dayEntries.length}{" "} + {dayEntries.length === 1 ? "entry" : "entries"} + +
+ {meals.map((meal) => { + const rows = dayEntries.filter((r) => r.data.meal === meal); + const calories = totalNutrients(rows.map((r) => r.data)).calories; + const Icon = mealIcons[meal]; + return ( +
+
+ + + +

{meal}

+ {rows.length > 0 && ( + + {number(calories)} kcal + + )} + +
+ {rows.length ? ( + rows.map((r) => ( +
+ + + {number(r.data.nutrients.calories * r.data.quantity)} + kcal + + +
+ )) + ) : ( + + )} +
+ ); + })} +
+ +
+
+ +
+
+ A SMALL CHECK-IN +

+ {latestWeight + ? `${number(weightValue(latestWeight.data.valueKg, settings.unit), 1)} ${settings.unit}` + : "How are you feeling?"} +

+

+ {latestWeight + ? `Latest weigh-in · ${displayDate(latestWeight.data.date, { month: "short", day: "numeric" })}` + : "Log your weight. See the bigger picture."} +

+
+ +
+
+
+
+ ✳A little consistency. A lot of + possibility. +
+ + ); +} +function Library({ + foods, + plates, + newFood, + newPlate, + editFood, + editPlate, + log, + remove, +}: { + foods: JournalRecord[]; + plates: JournalRecord[]; + newFood: () => void; + newPlate: () => void; + editFood: (r: JournalRecord) => void; + editPlate: (r: JournalRecord) => void; + log: () => void; + remove: (r: JournalRecord) => void; +}) { + const [tab, setTab] = useState("foods"); + const [search, setSearch] = useState(""); + return ( + <> +
+
+ FAMILIAR FAVORITES +

+ Your everyday staples. +

+

A little less effort, every time you log.

+
+ +
+
+
+ + +
+ +
+ {(tab === "foods" ? foods : plates).length === 0 ? ( +
+ : + } + title={ + tab === "foods" + ? "Make room for your favorites" + : "Your usual, in one tap" + } + text={ + tab === "foods" + ? "Save a food once. Keep its serving size and nutrition ready for the next time." + : "Combine foods from your library into a plate you can log all at once." + } + action={ + + } + /> +
+ ) : ( +
+ {tab === "foods" + ? foods + .filter((r) => + r.data.name.toLowerCase().includes(search.toLowerCase()), + ) + .map((r, i) => ( +
+
+ +
+
+

{r.data.name}

+

{r.data.serving}

+ + {number(r.data.nutrients.calories)} kcal + +
+ P {number(r.data.nutrients.protein, 1)}g + C {number(r.data.nutrients.carbs, 1)}g + F {number(r.data.nutrients.fat, 1)}g +
+
+
+ + +
+
+ )) + : plates + .filter((r) => + r.data.name.toLowerCase().includes(search.toLowerCase()), + ) + .map((r) => { + const totals = totalNutrients(r.data.items); + return ( +
+
+ +
+
+

{r.data.name}

+

+ {r.data.items.map((item) => item.name).join(" + ")} +

+ + {number(totals.calories)} kcal + +
+ {r.data.items.length} foods + P {number(totals.protein, 1)}g +
+
+
+ + +
+
+ ); + })} + {(tab === "foods" ? foods : plates).filter((r) => + r.data.name.toLowerCase().includes(search.toLowerCase()), + ).length === 0 && ( +

No favorites match “{search}”.

+ )} +
+ )} +
+ + + Saved foods are a starting point. Your past entries keep their + original nutrition. + + +
+ + ); +} +export function App() { + const journal = useJournal(); + const status = useSyncStatus(); + const [ready, setReady] = useState(false); + const [fatal, setFatal] = useState(""); + const [page, setPage] = useState("today"); + const [date, setDate] = useState(today()); + const [editor, setEditor] = useState(null); + const [toast, setToast] = useState(""); + const [deleting, setDeleting] = useState(null); + const [reauth, setReauth] = useState(false); + const [installEvent, setInstallEvent] = useState(null); + const [waiting, setWaiting] = useState(null); + const settings = (recordsOf(journal.records, "settings")[0] + ?.data || defaultSettings) as SettingsData; + const foods = useMemo( + () => + recordsOf(journal.records, "food").sort((a, b) => + a.data.name.localeCompare(b.data.name), + ), + [journal.records], + ); + const plates = useMemo( + () => + recordsOf(journal.records, "plate").sort((a, b) => + a.data.name.localeCompare(b.data.name), + ), + [journal.records], + ); + const close = useCallback(() => setEditor(null), []); + const notify = useCallback((text: string) => setToast(text), []); + useEffect(() => { + initStore() + .then(() => { + setReady(true); + void sync(); + }) + .catch(() => + setFatal( + "Calio could not open device storage. Allow website storage or turn off private browsing, then reload.", + ), + ); + }, []); + useEffect(() => { + if (!toast) return; + const timer = setTimeout(() => setToast(""), 5500); + return () => clearTimeout(timer); + }, [toast]); + useEffect(() => { + window.scrollTo({ top: 0, behavior: "instant" }); + }, [page]); + useEffect(() => { + const media = matchMedia("(prefers-color-scheme: dark)"); + const apply = () => { + const dark = + settings.theme === "dark" || + (settings.theme === "system" && media.matches); + document.documentElement.dataset.theme = dark ? "dark" : "light"; + for (const [key, value] of Object.entries( + accentPalette(settings.accentColor, dark), + )) + document.documentElement.style.setProperty(key, value); + document + .querySelector('meta[name="theme-color"]') + ?.setAttribute("content", dark ? "#101114" : "#f5f5f8"); + }; + apply(); + media.addEventListener("change", apply); + return () => media.removeEventListener("change", apply); + }, [settings.theme, settings.accentColor]); + useEffect(() => { + const installListener = (event: Event) => { + event.preventDefault(); + setInstallEvent(event as InstallEvent); + }; + window.addEventListener("beforeinstallprompt", installListener); + if ("serviceWorker" in navigator && import.meta.env.PROD) { + navigator.serviceWorker + .register("/sw.js") + .then((registration) => { + if (registration.waiting) setWaiting(registration.waiting); + registration.addEventListener("updatefound", () => { + const worker = registration.installing; + worker?.addEventListener("statechange", () => { + if ( + worker.state === "installed" && + navigator.serviceWorker.controller + ) + setWaiting(worker); + }); + }); + }) + .catch(() => + notify( + "Offline app caching could not start. Check your browser storage settings.", + ), + ); + } + return () => + window.removeEventListener("beforeinstallprompt", installListener); + }, [notify]); + async function update() { + await sync(); + if (journal.outbox.length) { + notify("Sync your pending entries before updating."); + return; + } + navigator.serviceWorker.addEventListener( + "controllerchange", + () => location.reload(), + { once: true }, + ); + waiting?.postMessage("ACTIVATE"); + } + if (fatal) + return ( +
+ +

Device storage is unavailable

+

{fatal}

+
+ ); + if (!ready) + return ( +
+ Calio + +
+ ); + if (!journal.unlocked) return ; + const nav = [ + { key: "today", label: "Today", icon: Home }, + { key: "library", label: "My library", icon: BookOpen }, + { key: "trends", label: "Trends", icon: Activity }, + { key: "settings", label: "Settings", icon: Settings2 }, + ] as const; + const syncLabel = !status.online + ? "Offline · saved on device" + : status.needsLogin + ? "Sign in to sync" + : status.busy + ? "Syncing your journal" + : journal.outbox.length + ? `${journal.outbox.length} pending · saved on device` + : "All changes synced"; + return ( +
+ +
+
+ + Your journal / {nav.find((n) => n.key === page)?.label} + +
+ + calio +
+ + + E + +
+
+ {status.needsLogin && ( +
+ + + Your session expired. Local logging is still available. + + +
+ )} + {status.error && ( +
+ + Saved on this device. {status.error} + +
+ )} + {waiting && ( +
+ + A fresh version of Calio is ready. + +
+ )} + {page === "today" && ( + setEditor({ kind: "log", meal })} + edit={(record) => + setEditor({ kind: "log", meal: record.data.meal, record }) + } + remove={setDeleting} + openLibrary={() => setPage("library")} + logWeight={() => setEditor({ kind: "weight" })} + /> + )} + {page === "library" && ( + setEditor({ kind: "food" })} + newPlate={() => setEditor({ kind: "plate" })} + editFood={(record) => setEditor({ kind: "food", record })} + editPlate={(record) => setEditor({ kind: "plate", record })} + log={() => setEditor({ kind: "log", meal: "Snacks" })} + remove={setDeleting} + /> + )} + {page === "trends" && ( + setEditor({ kind: "weight" })} + editWeight={(record) => setEditor({ kind: "weight", record })} + remove={setDeleting} + /> + )} + {page === "settings" && ( + (journal.records, "settings")[0] + ?.updatedAt || "initial" + } + settings={settings} + records={journal.records} + pending={journal.outbox.length} + lastSync={journal.lastSync} + notify={notify} + install={ + installEvent + ? () => { + void installEvent.prompt(); + setInstallEvent(null); + } + : null + } + update={waiting ? () => void update() : null} + /> + )} +
+
+ + {editor?.kind === "log" && ( + + )} + {editor?.kind === "food" && ( + + )} + {editor?.kind === "plate" && ( + + )} + {editor?.kind === "weight" && ( + + )} + {deleting && ( + setDeleting(null)} + > +

+ {deleting.type === "food" || deleting.type === "plate" + ? "Past food entries will keep their original values." + : "This entry will no longer count toward your journal."} +

+
+ + +
+
+ )} + {reauth && setReauth(false)} />} + {toast && ( +
+ + {toast} + +
+ )} +
+ ); +} diff --git a/src/Settings.tsx b/src/Settings.tsx new file mode 100644 index 0000000..16b7a06 --- /dev/null +++ b/src/Settings.tsx @@ -0,0 +1,467 @@ +import { useState } from "react"; +import { + Download, + Check, + LogOut, + ShieldCheck, + Smartphone, + Cloud, + RefreshCw, + Sun, + Moon, + Monitor, + ArrowUpRight, +} from "lucide-react"; +import type { JournalRecord, Metric, Settings as SettingsData } from "./types"; +import { metrics } from "./types"; +import { downloadExport, offsetDay, today } from "./utils"; +import { logout, saveRecord, sync, useSyncStatus } from "./store"; +import { accentPresets, DEFAULT_ACCENT } from "../shared/theme.js"; + +export function Settings({ + settings, + records, + pending, + lastSync, + notify, + install, + update, +}: { + settings: SettingsData; + records: JournalRecord[]; + pending: number; + lastSync: string | null; + notify: (text: string) => void; + install: (() => void) | null; + update: (() => void) | null; +}) { + const [draft, setDraft] = useState(settings); + const [busy, setBusy] = useState(false); + const [format, setFormat] = useState(settings.exportFormat); + const [range, setRange] = useState(settings.exportDays); + const [start, setStart] = useState( + offsetDay( + today(), + 1 - Number(settings.exportDays === "all" ? 30 : settings.exportDays), + ), + ); + const [end, setEnd] = useState(today()); + const [selected, setSelected] = useState( + settings.exportMetrics || + metrics.filter((m) => settings.goals[m.key].enabled).map((m) => m.key), + ); + const [includeWeight, setIncludeWeight] = useState( + settings.exportWeight ?? true, + ); + const [error, setError] = useState(""); + const status = useSyncStatus(); + const effectiveStart = + range === "all" + ? records.reduce((value, r) => { + const date = (r.data as { date?: string }).date; + return date && date < value ? date : value; + }, today()) + : start; + const effectiveEnd = + range === "all" + ? records.reduce((value, r) => { + const date = !r.deleted && (r.data as { date?: string }).date; + return date && date > value ? date : value; + }, today()) + : end; + async function save(event: React.FormEvent) { + event.preventDefault(); + setBusy(true); + setError(""); + try { + await saveRecord( + "settings", + { + ...draft, + exportFormat: format, + exportDays: range, + exportMetrics: selected, + exportWeight: includeWeight, + }, + "settings", + ); + notify("Your preferences are saved"); + } catch { + setError("Could not save. Check that each goal is a positive number."); + } finally { + setBusy(false); + } + } + return ( + <> +
+
+ MAKE ROOM FOR YOU +

+ Your way. +

+

A journal that fits your everyday.

+
+
+
+
+
+
+ FOCUS ON WHAT MATTERS +

Daily goals

+
+ PERSONAL +
+

+ Choose what you track. Turning a goal off keeps your past nutrition + data. +

+
+ Track + Daily target +
+ {metrics.map((m) => ( +
+ + +
+ ))} +
+

Look & feel

+
+ {( + [ + { key: "light", icon: Sun }, + { key: "dark", icon: Moon }, + { key: "system", icon: Monitor }, + ] as const + ).map(({ key, icon: Icon }) => ( + + ))} +
+
+ ACCENT COLOR +
+ {accentPresets.map((preset) => ( + + ))} +
+ +
+
+ + +
+
+ {error && ( +

+ {error} +

+ )} + +
+
+
+
+
+ YOUR DATA, TO GO +

Export your journal

+
+ +
+

+ A clear, portable record for your own analysis or a conversation + with an LLM. +

+
+ + +
+ {range !== "all" && ( +
+ + +
+ )} + INCLUDE IN EXPORT +
+ {metrics.map((m) => ( + + ))} + +
+ +

+ Includes locally saved changes. No data is sent to an LLM. +

+
+
+
+
+ READY WHEN YOU ARE +

On your devices

+
+ +
+
+ +
+ + {pending + ? `${pending} change${pending === 1 ? "" : "s"} waiting to sync` + : "Your journal is saved"} + + + + {lastSync + ? `Last synced ${new Date(lastSync).toLocaleString()}` + : "Your first sync will prepare your offline journal."} + +
+
+ +

+ Your synced journal and new entries stay on this device for + offline use. Open Calio while online before heading out; sync + resumes when you return to the app. +

+ {install ? ( + + ) : ( +

+ + + On iPhone: open in Safari, tap Share, then{" "} + Add to Home Screen. On Android: use your + browser’s Install app menu. + +

+ )} + {update && ( + + )} +
+
+
+ + + Your space. Your data. + Calio 0.1.0 · A personal nutrition journal + +
+ +
+
+
+ + ); +} diff --git a/src/Trends.tsx b/src/Trends.tsx new file mode 100644 index 0000000..c55bcc3 --- /dev/null +++ b/src/Trends.tsx @@ -0,0 +1,370 @@ +import { useState } from "react"; +import { + ArrowDownRight, + ArrowUpRight, + ChevronLeft, + ChevronRight, + Plus, + Scale, + Trash2, + Pencil, + Activity, +} from "lucide-react"; +import type { Entry, JournalRecord, Settings, Weight, Metric } from "./types"; +import { metrics } from "./types"; +import { + displayDate, + number, + offsetDay, + recordsOf, + today, + weightValue, +} from "./utils"; +import { totalNutrients } from "../shared/domain.js"; +import { Empty } from "./components"; + +export function Trends({ + records, + settings, + logWeight, + editWeight, + remove, +}: { + records: JournalRecord[]; + settings: Settings; + logWeight: () => void; + editWeight: (r: JournalRecord) => void; + remove: (r: JournalRecord) => void; +}) { + const [period, setPeriod] = useState(7); + const [end, setEnd] = useState(today()); + const [metric, setMetric] = useState("calories"); + const start = offsetDay(end, 1 - period); + const entries = recordsOf(records, "entry"); + const allWeights = recordsOf(records, "weight").sort( + (a, b) => + a.data.date.localeCompare(b.data.date) || + a.updatedAt.localeCompare(b.updatedAt), + ); + const weights = allWeights.filter( + (r) => r.data.date >= start && r.data.date <= end, + ); + // One latest weigh-in per day for the trend; the journal retains every measurement. + const dailyWeights = [ + ...new Map(weights.map((r) => [r.data.date, r])).values(), + ]; + const days = Array.from({ length: period }, (_, i) => { + const date = offsetDay(start, i); + const logs = entries.filter((r) => r.data.date === date); + return { + date, + logged: logs.length > 0, + total: totalNutrients(logs.map((r) => r.data))[metric], + }; + }); + const loggedDays = days.filter((d) => d.logged); + const avg = loggedDays.length + ? loggedDays.reduce((sum, d) => sum + d.total, 0) / loggedDays.length + : 0; + const goal = settings.goals[metric]; + const maximum = + Math.max(...days.map((d) => d.total), goal.enabled ? goal.target : 1, 1) * + 1.12; + const chosen = metrics.find((m) => m.key === metric)!; + const values = dailyWeights.map((r) => + weightValue(r.data.valueKg, settings.unit), + ); + const minWeight = Math.min(...values) - 1; + const maxWeight = Math.max(...values) + 1; + const points = dailyWeights.map((r, i) => ({ + x: + 28 + + ((new Date(r.data.date).getTime() - new Date(start).getTime()) / + ((period - 1) * 86400000)) * + 544, + y: 170 - ((values[i] - minWeight) / (maxWeight - minWeight)) * 140, + })); + const delta = values.length > 1 ? values.at(-1)! - values[0] : null; + return ( + <> +
+
+ THE BIGGER PICTURE +

+ Your rhythms. +

+

Small moments. A little perspective.

+
+ +
+
+
+ {[7, 30, 90, 365].map((n) => ( + + ))} +
+
+ + + {displayDate(start, { month: "short", day: "numeric" })} –{" "} + {displayDate(end, { + month: "short", + day: "numeric", + year: "numeric", + })} + + +
+
+
+
+
+
+ DAILY INTAKE +

{chosen.label}

+
+ +
+
+ {number(avg)} {chosen.unit} / logged day +
+
+
+ {number(maximum)} + {number(maximum / 2)} + 0 +
+
+ {goal.enabled && ( +
+ Goal {number(goal.target)} +
+ )} + {days.map((d) => ( +
+
+ {period === 7 && ( + + {displayDate(d.date, { weekday: "short" }).slice(0, 1)} + + )} +
+ ))} +
+
+

+ {loggedDays.length} of {period} days logged · Empty days are + excluded from the average. +

+
+
+
+
+ YOUR JOURNEY +

Weight

+
+ +
+ {dailyWeights.length ? ( + <> +
+ {number(values.at(-1)!, 1)} {settings.unit} +
+
+ + + + + `${p.x},${p.y}`).join(" ")} + fill="none" + stroke="var(--accent)" + strokeWidth="3" + strokeLinejoin="round" + /> + {points.map((p, i) => ( + + + {dailyWeights[i].data.date}: {number(values[i], 1)}{" "} + {settings.unit} + + + ))} + + {displayDate(start, { month: "short", day: "numeric" })} + + + {displayDate(end, { month: "short", day: "numeric" })} + + +
+ {number(maxWeight, 1)} + {number(minWeight, 1)} +
+
+

+ {delta === null ? ( + "Log another day to see a change over time." + ) : ( + <> + {delta < 0 ? ( + + ) : ( + + )}{" "} + {number(Math.abs(delta), 1)} {settings.unit}{" "} + {delta < 0 ? "down" : "up"} in this period + + )} +

+ + ) : ( + } + title="A starting point, whenever you’re ready" + text="Your weigh-ins will become a simple picture of your progress." + action={ + + } + /> + )} +
+
+
+
+
+ ONE CHECK-IN AT A TIME +

Weight journal

+
+ {weights.length} in this period +
+ {weights.length === 0 ? ( +

No weigh-ins in this date range.

+ ) : ( + [...weights].reverse().map((r) => ( +
+
+ +
+
+ + {number(weightValue(r.data.valueKg, settings.unit), 1)}{" "} + {settings.unit} + + + {displayDate(r.data.date)} + {r.data.notes ? " · " + r.data.notes : ""} + +
+ + +
+ )) + )} +
+ + ); +} diff --git a/src/components.tsx b/src/components.tsx new file mode 100644 index 0000000..98d5956 --- /dev/null +++ b/src/components.tsx @@ -0,0 +1,775 @@ +import { useEffect, useRef, useState, type ReactNode } from "react"; +import { + X, + ArrowUpRight, + Plus, + Minus, + Leaf, + Smartphone, + RotateCcw, +} from "lucide-react"; +import { bubbleCount } from "../shared/bubble-physics.js"; +import { useBubblePhysics } from "./useBubblePhysics"; +import { + metrics, + type Entry, + type Food, + type JournalRecord, + type Meal, + type Nutrients, + type Plate, + type Settings, + type Weight, +} from "./types"; +import { emptyNutrients } from "../shared/domain.js"; +import { saveRecord, putRecords } from "./store"; +import { displayDate, number, today, weightValue } from "./utils"; + +export function Modal({ + title, + subtitle, + close, + children, +}: { + title: string; + subtitle?: string; + close: () => void; + children: ReactNode; +}) { + const ref = useRef(null); + useEffect(() => { + const dialog = ref.current!; + dialog.showModal(); + const listener = (event: Event) => { + event.preventDefault(); + close(); + }; + dialog.addEventListener("cancel", listener); + return () => { + dialog.removeEventListener("cancel", listener); + dialog.close(); + }; + }, [close]); + return ( + { + if (event.target === event.currentTarget) { + const r = event.currentTarget.getBoundingClientRect(); + if ( + event.clientX < r.left || + event.clientX > r.right || + event.clientY < r.top || + event.clientY > r.bottom + ) + close(); + } + }} + > +
+
+ A LITTLE EVERYDAY CARE +

{title}

+ {subtitle &&

{subtitle}

} +
+ +
+ {children} +
+ ); +} +export function CalorieOrb({ + value, + goal, + enabled, + small = false, + interactive = true, +}: { + value: number; + goal: number; + enabled: boolean; + small?: boolean; + interactive?: boolean; +}) { + const ratio = enabled ? Math.min(value / goal, 1) : Math.min(value / 2500, 1); + const physics = useBubblePhysics(bubbleCount(value, goal, enabled)); + const readout = ( + <> + + {enabled + ? value > goal + ? "OVER YOUR GOAL" + : "CALORIES REMAINING" + : "CALORIES LOGGED"} + + {number(enabled ? Math.abs(goal - value) : value)} + kcal + + ); + return ( +
+
goal ? " over" : "") + } + role="img" + aria-label={`${number(value)} calories${enabled ? ` of ${number(goal)} calorie goal` : ""}`} + > + +
+ {!small && ratio >= 0.85 && ( +
{readout}
+ )} + {interactive && !small && ( + <> +
+ + + +
+ {physics.motion === "denied" && ( +

+ Motion access was not granted. You can allow it in your browser’s + website settings. +

+ )} + {physics.motion === "unavailable" && ( +

+ No tilt data yet. Falling bubbles still work on this device. +

+ )} + + )} +
+ ); +} +export function Empty({ + icon = , + title, + text, + action, +}: { + icon?: ReactNode; + title: string; + text: string; + action?: ReactNode; +}) { + return ( +
+ {icon} +

{title}

+

{text}

+ {action} +
+ ); +} +export function NutrientFields({ + nutrients, + set, +}: { + nutrients: Nutrients; + set: (n: Nutrients) => void; +}) { + return ( +
+ {metrics.map((metric) => ( + + ))} +
+ ); +} + +export function FoodEditor({ + close, + date, + meal, + existing, + foods, + plates, + mode = "log", + notify, +}: { + close: () => void; + date: string; + meal: Meal; + existing?: JournalRecord; + foods: JournalRecord[]; + plates: JournalRecord[]; + mode?: "log" | "food"; + notify: (text: string) => void; +}) { + const initial = existing?.data; + const [tab, setTab] = useState<"manual" | "saved" | "plates">("manual"); + const [name, setName] = useState(initial?.name || ""); + const [serving, setServing] = useState(initial?.serving || "1 serving"); + const [nutrients, setNutrients] = useState( + initial?.nutrients || (emptyNutrients() as Nutrients), + ); + const [quantity, setQuantity] = useState( + existing?.type === "entry" ? (initial as Entry).quantity : 1, + ); + const [selectedMeal, setMeal] = useState( + existing?.type === "entry" ? (initial as Entry).meal : meal, + ); + const [selectedDate, setDate] = useState( + existing?.type === "entry" ? (initial as Entry).date : date, + ); + const [saveFood, setSaveFood] = useState(false); + const [search, setSearch] = useState(""); + const [error, setError] = useState(""); + const [busy, setBusy] = useState(false); + async function submit(event: React.FormEvent) { + event.preventDefault(); + setBusy(true); + setError(""); + try { + const food = { name: name.trim(), serving: serving.trim(), nutrients }; + const items: Parameters[0] = [ + { + type: mode === "food" ? "food" : "entry", + id: existing?.id, + data: + mode === "food" + ? food + : { ...food, date: selectedDate, meal: selectedMeal, quantity }, + }, + ]; + if (saveFood && mode === "log") items.push({ type: "food", data: food }); + await putRecords(items); + notify( + mode === "food" ? "Food saved to your library" : "Added to your day", + ); + close(); + } catch (err) { + setError( + err instanceof Error + ? err.message + : "Could not save. Please try again.", + ); + } finally { + setBusy(false); + } + } + async function addPlate(plate: Plate) { + setBusy(true); + setError(""); + try { + await putRecords( + plate.items.map((item) => ({ + type: "entry", + data: { ...item, date: selectedDate, meal: selectedMeal }, + })), + ); + notify(`${plate.name} added to your day`); + close(); + } catch { + setError("Could not save this plate. Please try again."); + } finally { + setBusy(false); + } + } + return ( + + {mode === "log" && !existing && ( +
+ {(["manual", "saved", "plates"] as const).map((value) => ( + + ))} +
+ )} + {mode === "log" && ( +
+ + +
+ )} + {tab !== "manual" ? ( +
+ setSearch(e.target.value)} + /> + {tab === "saved" + ? foods + .filter((r) => + r.data.name.toLowerCase().includes(search.toLowerCase()), + ) + .map((r) => ( + + )) + : plates + .filter((r) => + r.data.name.toLowerCase().includes(search.toLowerCase()), + ) + .map((r) => ( + + ))} + {(tab === "saved" ? foods : plates).length === 0 && ( + + )} +
+ ) : ( +
+ +
+ + {mode === "log" && ( + + )} +
+
+ Nutrition per serving + From your label or recipe +
+ + {mode === "log" && !existing && ( + + )} + {error && ( +

+ {error} +

+ )} + + + )} + {tab !== "manual" && error && ( +

+ {error} +

+ )} +
+ ); +} +export function PlateEditor({ + close, + foods, + existing, + notify, +}: { + close: () => void; + foods: JournalRecord[]; + existing?: JournalRecord; + notify: (text: string) => void; +}) { + const [name, setName] = useState(existing?.data.name || ""); + const [items, setItems] = useState( + existing?.data.items || [], + ); + const [error, setError] = useState(""); + const [busy, setBusy] = useState(false); + return ( + +
{ + e.preventDefault(); + setBusy(true); + try { + await saveRecord( + "plate", + { name: name.trim(), items }, + existing?.id, + ); + notify("Plate saved"); + close(); + } catch { + setError("Could not save this plate. Check its name and servings."); + } finally { + setBusy(false); + } + }} + > + + {items.map((item, i) => ( +
+ + {item.name} + {item.serving} + + + setItems( + items.map((v, n) => + n === i ? { ...v, quantity: +e.target.value } : v, + ), + ) + } + /> + +
+ ))} + + {foods.length === 0 && ( +

+ Save a food first, then combine your favorites here. +

+ )} + {error && ( +

+ {error} +

+ )} + +
+
+ ); +} +export function WeightEditor({ + close, + unit, + existing, + notify, +}: { + close: () => void; + unit: Settings["unit"]; + existing?: JournalRecord; + notify: (text: string) => void; +}) { + const [date, setDate] = useState(existing?.data.date || today()); + const [value, setValue] = useState( + existing ? +weightValue(existing.data.valueKg, unit).toFixed(2) : "", + ); + const [notes, setNotes] = useState(existing?.data.notes || ""); + const [error, setError] = useState(""); + const [busy, setBusy] = useState(false); + return ( + +
{ + e.preventDefault(); + setBusy(true); + try { + await saveRecord( + "weight", + { + date, + valueKg: unit === "lb" ? +value / 2.2046226218 : +value, + notes, + }, + existing?.id, + ); + notify("Weight logged"); + close(); + } catch { + setError("Could not save. Check the weight and date."); + } finally { + setBusy(false); + } + }} + > +
+ + +
+