Compare commits

1 Commits
Author SHA1 Message Date
rasmusq a3c4067a4c Merge pull request 'feature/builtin-themes' (#4) from feature/builtin-themes into master
Reviewed-on: #4
2025-12-14 19:49:13 +00:00
124 changed files with 5496 additions and 16796 deletions
-3
View File
@@ -24,6 +24,3 @@ vite.config.ts.timestamp-*
# Claude # Claude
.claude .claude
# Infisical
.infisical*
-8
View File
@@ -1,8 +0,0 @@
{
"version": "2",
"phaseApp": "wishlist",
"appId": "a4d85c7a-8df9-462b-9b91-5cb2957cdcd3",
"defaultEnv": "Production",
"envId": "496d0105-f2b4-424d-a1a1-a60602fc2252",
"monorepoSupport": false
}
-15
View File
@@ -1,15 +0,0 @@
# Ignore files for Prettier
build
.svelte-kit
dist
node_modules
# Ignore generated files
drizzle/meta
# Ignore lock files
bun.lock
package-lock.json
yarn.lock
pnpm-lock.yaml
-9
View File
@@ -1,9 +0,0 @@
{
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
+84
View File
@@ -0,0 +1,84 @@
# Coolify Deployment
## Prerequisites
- Coolify instance
- Git repository
## Database Setup
Choose one:
**Option A: Docker Compose (Recommended)**
- Database included in `docker-compose.coolify.yml`
- Skip to step 2
**Option B: Separate PostgreSQL Resource**
1. Create PostgreSQL database in Coolify
2. Note connection details
## Deploy
### Using Docker Compose (Recommended)
1. Create application in Coolify
2. Select Git repository
3. Configure:
- Build Pack: Docker Compose
- File: `./docker-compose.coolify.yml`
4. Assign domain to `app` service only (format: `http://yourdomain.com:3000`)
5. Set environment variables:
- `AUTH_SECRET` (generate with `openssl rand -base64 32`)
- `AUTH_URL` (your domain with https)
- `POSTGRES_DATA_PATH` (optional, for custom database storage location)
- `GOOGLE_CLIENT_ID` (optional)
- `GOOGLE_CLIENT_SECRET` (optional)
6. Deploy
### Using Dockerfile
1. Create application in Coolify
2. Select Git repository
3. Configure:
- Build Pack: Docker
- Port: `3000`
4. Add domain
5. Set environment variables:
- `DATABASE_URL`
- `AUTH_SECRET` (generate with `openssl rand -base64 32`)
- `AUTH_URL` (your domain with https)
- `GOOGLE_CLIENT_ID` (optional)
- `GOOGLE_CLIENT_SECRET` (optional)
6. Deploy
## After Deployment
Run migrations:
```bash
# In Coolify terminal or SSH
docker exec -it <container-name> bun run db:push
```
## Environment Variables
Required:
- `DATABASE_URL` - Connection string
- `AUTH_SECRET` - Random secret
- `AUTH_URL` - Your app URL
- `AUTH_TRUST_HOST` - `true`
Optional:
- `GOOGLE_CLIENT_ID`
- `GOOGLE_CLIENT_SECRET`
- `POSTGRES_DATA_PATH` - Custom path for PostgreSQL data (Docker Compose only)
- Example: `/mnt/storage/wishlist/postgres`
- If not set, uses a Docker named volume
- Path must exist with proper permissions before deployment
## Troubleshooting
**Container crashes:** Check logs in Coolify dashboard
**Database connection:** Verify `DATABASE_URL` format
**Auth issues:** Check `AUTH_URL` matches your domain
-35
View File
@@ -1,35 +0,0 @@
# Wishlist Production Deployment
Uses Phase for secrets management.
## Required Secrets
Ensure these exist in your Phase project under the `Production` environment:
- `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB` - Database credentials
- `AUTH_SECRET` - Auth.js secret (generate: `openssl rand -base64 32`)
- `AUTH_URL` - Public URL (e.g., `https://wish.rasmusq.com`)
- `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` - (Optional) Google OAuth
- `AUTHENTIK_CLIENT_ID`, `AUTHENTIK_CLIENT_SECRET`, `AUTHENTIK_ISSUER` - (Optional) Authentik OAuth
## Common Commands
```bash
# Deploy/rebuild
phase run docker compose -f docker-compose.prod.yml up -d --build
# View logs
docker compose -f docker-compose.prod.yml logs -f
# Restart
phase run docker compose -f docker-compose.prod.yml restart
# Stop
phase run docker compose -f docker-compose.prod.yml down
# Database migrations
phase run bun run db:migrate
# Development
phase run bun run dev
```
-3
View File
@@ -35,13 +35,11 @@ docker run -d \
## Environment Variables ## Environment Variables
Required: Required:
- `DATABASE_URL` - PostgreSQL connection string - `DATABASE_URL` - PostgreSQL connection string
- `NODE_ENV` - Set to `production` - `NODE_ENV` - Set to `production`
- `PORT` - Default `3000` - `PORT` - Default `3000`
Optional (Docker Compose): Optional (Docker Compose):
- `POSTGRES_USER` - Database user (default: `wishlistuser`) - `POSTGRES_USER` - Database user (default: `wishlistuser`)
- `POSTGRES_PASSWORD` - Database password (default: `wishlistpassword`) - `POSTGRES_PASSWORD` - Database password (default: `wishlistpassword`)
- `POSTGRES_DB` - Database name (default: `wishlist`) - `POSTGRES_DB` - Database name (default: `wishlist`)
@@ -63,7 +61,6 @@ docker exec -it wishlist-app bun run db:push
## Migrations ## Migrations
Production migrations: Production migrations:
```bash ```bash
docker exec -it wishlist-app bun run db:migrate docker exec -it wishlist-app bun run db:migrate
``` ```
+8 -11
View File
@@ -1,16 +1,13 @@
# Use Node.js official image # Use Bun's official image
FROM node:20-alpine AS base FROM oven/bun:1 AS base
WORKDIR /app WORKDIR /app
# Install pnpm
RUN npm install -g pnpm
# Install dependencies # Install dependencies
FROM base AS deps FROM base AS deps
COPY package.json pnpm-lock.yaml* ./ COPY package.json bun.lock* ./
COPY patches ./patches COPY patches ./patches
RUN pnpm install --frozen-lockfile RUN bun install --frozen-lockfile
RUN pnpm patch-package RUN bunx patch-package
# Build the application # Build the application
FROM base AS builder FROM base AS builder
@@ -18,7 +15,7 @@ COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
# Build the SvelteKit app # Build the SvelteKit app
RUN pnpm run build RUN bun run build
# Production image # Production image
FROM base AS runner FROM base AS runner
@@ -35,10 +32,10 @@ COPY --from=deps /app/node_modules ./node_modules
# Copy Drizzle files for migrations # Copy Drizzle files for migrations
COPY --from=builder /app/drizzle ./drizzle COPY --from=builder /app/drizzle ./drizzle
COPY --from=builder /app/drizzle.config.ts ./ COPY --from=builder /app/drizzle.config.ts ./
COPY --from=builder /app/src/lib/db ./src/lib/db COPY --from=builder /app/src/lib/server/schema.ts ./src/lib/server/schema.ts
# Expose the port # Expose the port
EXPOSE 3000 EXPOSE 3000
# Start the application # Start the application
CMD ["node", "./build/index.js"] CMD ["bun", "run", "./build/index.js"]
-3
View File
@@ -2,9 +2,6 @@
A wishlist application built with SvelteKit, Drizzle ORM, and PostgreSQL. A wishlist application built with SvelteKit, Drizzle ORM, and PostgreSQL.
![Dashboard](readme-assets/dashboard.png)
![Creating a wishlist](readme-assets/create.png)
## Prerequisites ## Prerequisites
- [Bun](https://bun.sh/) - [Bun](https://bun.sh/)
-5
View File
@@ -16,7 +16,6 @@ Visit `http://localhost:3000`
Choose one: Choose one:
**Local PostgreSQL:** **Local PostgreSQL:**
```bash ```bash
sudo apt install postgresql sudo apt install postgresql
sudo -u postgres createdb wishlist sudo -u postgres createdb wishlist
@@ -27,7 +26,6 @@ GRANT ALL PRIVILEGES ON DATABASE wishlist TO wishlistuser;
``` ```
**Docker PostgreSQL:** **Docker PostgreSQL:**
```bash ```bash
docker run --name wishlist-postgres \ docker run --name wishlist-postgres \
-e POSTGRES_DB=wishlist \ -e POSTGRES_DB=wishlist \
@@ -59,18 +57,15 @@ Visit `http://localhost:5173`
## Troubleshooting ## Troubleshooting
**Connection errors:** **Connection errors:**
- Check PostgreSQL is running: `sudo systemctl status postgresql` - Check PostgreSQL is running: `sudo systemctl status postgresql`
- Test connection: `psql "postgresql://user:pass@localhost:5432/wishlist"` - Test connection: `psql "postgresql://user:pass@localhost:5432/wishlist"`
**Port in use:** **Port in use:**
```bash ```bash
bun run dev -- --port 3000 bun run dev -- --port 3000
``` ```
**Schema changes:** **Schema changes:**
```bash ```bash
bun run db:push bun run db:push
``` ```
+632
View File
@@ -0,0 +1,632 @@
{
"lockfileVersion": 1,
"configVersion": 1,
"workspaces": {
"": {
"name": "wishlist-app",
"dependencies": {
"@auth/core": "^0.34.3",
"@auth/drizzle-adapter": "^1.11.1",
"@auth/sveltekit": "^1.11.1",
"@internationalized/date": "^3.10.0",
"@paralleldrive/cuid2": "^3.0.4",
"bcrypt": "^6.0.0",
"bits-ui": "^2.14.4",
"clsx": "^2.1.1",
"drizzle-orm": "^0.44.7",
"lucide-svelte": "^0.554.0",
"postgres": "^3.4.7",
"svelte-dnd-action": "^0.9.67",
"tailwind-merge": "^3.4.0",
"tailwind-variants": "^3.2.2",
},
"devDependencies": {
"@lucide/svelte": "^0.544.0",
"@sveltejs/adapter-auto": "^7.0.0",
"@sveltejs/adapter-node": "^5.4.0",
"@sveltejs/kit": "^2.48.5",
"@sveltejs/vite-plugin-svelte": "^6.2.1",
"@tailwindcss/vite": "^4.1.17",
"@types/bcrypt": "^6.0.0",
"drizzle-kit": "^0.31.7",
"patch-package": "^8.0.1",
"postinstall-postinstall": "^2.1.0",
"svelte": "^5.43.8",
"svelte-check": "^4.3.4",
"tailwindcss": "^4.1.17",
"tw-animate-css": "^1.4.0",
"typescript": "^5.9.3",
"vite": "^7.2.2",
},
},
},
"packages": {
"@auth/core": ["@auth/core@0.34.3", "", { "dependencies": { "@panva/hkdf": "^1.1.1", "@types/cookie": "0.6.0", "cookie": "0.6.0", "jose": "^5.1.3", "oauth4webapi": "^2.10.4", "preact": "10.11.3", "preact-render-to-string": "5.2.3" }, "peerDependencies": { "@simplewebauthn/browser": "^9.0.1", "@simplewebauthn/server": "^9.0.2", "nodemailer": "^7" }, "optionalPeers": ["@simplewebauthn/browser", "@simplewebauthn/server", "nodemailer"] }, "sha512-jMjY/S0doZnWYNV90x0jmU3B+UcrsfGYnukxYrRbj0CVvGI/MX3JbHsxSrx2d4mbnXaUsqJmAcDfoQWA6r0lOw=="],
"@auth/drizzle-adapter": ["@auth/drizzle-adapter@1.11.1", "", { "dependencies": { "@auth/core": "0.41.1" } }, "sha512-cQTvDZqsyF7RPhDm/B6SvqdVP9EzQhy3oM4Muu7fjjmSYFLbSR203E6dH631ZHSKDn2b4WZkfMnjPDzRsPSAeA=="],
"@auth/sveltekit": ["@auth/sveltekit@1.11.1", "", { "dependencies": { "@auth/core": "0.41.1", "set-cookie-parser": "^2.7.0" }, "peerDependencies": { "@simplewebauthn/browser": "^9.0.1", "@simplewebauthn/server": "^9.0.3", "@sveltejs/kit": "^1.0.0 || ^2.0.0", "nodemailer": "^7.0.7", "svelte": "^3.54.0 || ^4.0.0 || ^5.0.0-0" }, "optionalPeers": ["@simplewebauthn/browser", "@simplewebauthn/server", "nodemailer"] }, "sha512-cWNfXcKrNIVtJYOY1tq7H7m03j89Wg7xrTvOJALu18fZdYulzYCPIAdTw8XSEzOp6KyhOGo7tmW7VtzRNtr/8Q=="],
"@drizzle-team/brocli": ["@drizzle-team/brocli@0.10.2", "", {}, "sha512-z33Il7l5dKjUgGULTqBsQBQwckHh5AbIuxhdsIxDDiZAzBOrZO6q9ogcWC65kU382AfynTfgNumVcNIjuIua6w=="],
"@esbuild-kit/core-utils": ["@esbuild-kit/core-utils@3.3.2", "", { "dependencies": { "esbuild": "~0.18.20", "source-map-support": "^0.5.21" } }, "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ=="],
"@esbuild-kit/esm-loader": ["@esbuild-kit/esm-loader@2.6.5", "", { "dependencies": { "@esbuild-kit/core-utils": "^3.3.2", "get-tsconfig": "^4.7.0" } }, "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA=="],
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.25.12", "", { "os": "aix", "cpu": "ppc64" }, "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA=="],
"@esbuild/android-arm": ["@esbuild/android-arm@0.25.12", "", { "os": "android", "cpu": "arm" }, "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg=="],
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.25.12", "", { "os": "android", "cpu": "arm64" }, "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg=="],
"@esbuild/android-x64": ["@esbuild/android-x64@0.25.12", "", { "os": "android", "cpu": "x64" }, "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg=="],
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.25.12", "", { "os": "darwin", "cpu": "arm64" }, "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg=="],
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.25.12", "", { "os": "darwin", "cpu": "x64" }, "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA=="],
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.25.12", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg=="],
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.25.12", "", { "os": "freebsd", "cpu": "x64" }, "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ=="],
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.25.12", "", { "os": "linux", "cpu": "arm" }, "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw=="],
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.25.12", "", { "os": "linux", "cpu": "arm64" }, "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ=="],
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.25.12", "", { "os": "linux", "cpu": "ia32" }, "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA=="],
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.25.12", "", { "os": "linux", "cpu": "none" }, "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng=="],
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.25.12", "", { "os": "linux", "cpu": "none" }, "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw=="],
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.25.12", "", { "os": "linux", "cpu": "ppc64" }, "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA=="],
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.25.12", "", { "os": "linux", "cpu": "none" }, "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w=="],
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.25.12", "", { "os": "linux", "cpu": "s390x" }, "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg=="],
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.25.12", "", { "os": "linux", "cpu": "x64" }, "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw=="],
"@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.25.12", "", { "os": "none", "cpu": "arm64" }, "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg=="],
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.25.12", "", { "os": "none", "cpu": "x64" }, "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ=="],
"@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.25.12", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A=="],
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.25.12", "", { "os": "openbsd", "cpu": "x64" }, "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw=="],
"@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.25.12", "", { "os": "none", "cpu": "arm64" }, "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg=="],
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.25.12", "", { "os": "sunos", "cpu": "x64" }, "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w=="],
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.25.12", "", { "os": "win32", "cpu": "arm64" }, "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg=="],
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.25.12", "", { "os": "win32", "cpu": "ia32" }, "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ=="],
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.12", "", { "os": "win32", "cpu": "x64" }, "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA=="],
"@floating-ui/core": ["@floating-ui/core@1.7.3", "", { "dependencies": { "@floating-ui/utils": "^0.2.10" } }, "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w=="],
"@floating-ui/dom": ["@floating-ui/dom@1.7.4", "", { "dependencies": { "@floating-ui/core": "^1.7.3", "@floating-ui/utils": "^0.2.10" } }, "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA=="],
"@floating-ui/utils": ["@floating-ui/utils@0.2.10", "", {}, "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ=="],
"@internationalized/date": ["@internationalized/date@3.10.0", "", { "dependencies": { "@swc/helpers": "^0.5.0" } }, "sha512-oxDR/NTEJ1k+UFVQElaNIk65E/Z83HK1z1WI3lQyhTtnNg4R5oVXaPzK3jcpKG8UHKDVuDQHzn+wsxSz8RP3aw=="],
"@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
"@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="],
"@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],
"@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],
"@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
"@lucide/svelte": ["@lucide/svelte@0.544.0", "", { "peerDependencies": { "svelte": "^5" } }, "sha512-9f9O6uxng2pLB01sxNySHduJN3HTl5p0HDu4H26VR51vhZfiMzyOMe9Mhof3XAk4l813eTtl+/DYRvGyoRR+yw=="],
"@noble/hashes": ["@noble/hashes@2.0.1", "", {}, "sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw=="],
"@panva/hkdf": ["@panva/hkdf@1.2.1", "", {}, "sha512-6oclG6Y3PiDFcoyk8srjLfVKyMfVCKJ27JwNPViuXziFpmdz+MZnZN/aKY0JGXgYuO/VghU0jcOAZgWXZ1Dmrw=="],
"@paralleldrive/cuid2": ["@paralleldrive/cuid2@3.0.4", "", { "dependencies": { "@noble/hashes": "^2.0.1", "bignumber.js": "^9.3.1", "error-causes": "^3.0.2" }, "bin": { "cuid2": "bin/cuid2.js" } }, "sha512-sM6M2PWrByOEpN2QYAdulhEbSZmChwj0e52u4hpwB7u4PznFiNAavtE6m7O8tWUlzX+jT2eKKtc5/ZgX+IHrtg=="],
"@polka/url": ["@polka/url@1.0.0-next.29", "", {}, "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww=="],
"@rollup/plugin-commonjs": ["@rollup/plugin-commonjs@28.0.9", "", { "dependencies": { "@rollup/pluginutils": "^5.0.1", "commondir": "^1.0.1", "estree-walker": "^2.0.2", "fdir": "^6.2.0", "is-reference": "1.2.1", "magic-string": "^0.30.3", "picomatch": "^4.0.2" }, "peerDependencies": { "rollup": "^2.68.0||^3.0.0||^4.0.0" }, "optionalPeers": ["rollup"] }, "sha512-PIR4/OHZ79romx0BVVll/PkwWpJ7e5lsqFa3gFfcrFPWwLXLV39JVUzQV9RKjWerE7B845Hqjj9VYlQeieZ2dA=="],
"@rollup/plugin-json": ["@rollup/plugin-json@6.1.0", "", { "dependencies": { "@rollup/pluginutils": "^5.1.0" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "optionalPeers": ["rollup"] }, "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA=="],
"@rollup/plugin-node-resolve": ["@rollup/plugin-node-resolve@16.0.3", "", { "dependencies": { "@rollup/pluginutils": "^5.0.1", "@types/resolve": "1.20.2", "deepmerge": "^4.2.2", "is-module": "^1.0.0", "resolve": "^1.22.1" }, "peerDependencies": { "rollup": "^2.78.0||^3.0.0||^4.0.0" }, "optionalPeers": ["rollup"] }, "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg=="],
"@rollup/pluginutils": ["@rollup/pluginutils@5.3.0", "", { "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", "picomatch": "^4.0.2" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "optionalPeers": ["rollup"] }, "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q=="],
"@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.53.3", "", { "os": "android", "cpu": "arm" }, "sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w=="],
"@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.53.3", "", { "os": "android", "cpu": "arm64" }, "sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w=="],
"@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.53.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA=="],
"@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.53.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ=="],
"@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.53.3", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w=="],
"@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.53.3", "", { "os": "freebsd", "cpu": "x64" }, "sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q=="],
"@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.53.3", "", { "os": "linux", "cpu": "arm" }, "sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw=="],
"@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.53.3", "", { "os": "linux", "cpu": "arm" }, "sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg=="],
"@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.53.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w=="],
"@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.53.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A=="],
"@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.53.3", "", { "os": "linux", "cpu": "none" }, "sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g=="],
"@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.53.3", "", { "os": "linux", "cpu": "ppc64" }, "sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw=="],
"@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.53.3", "", { "os": "linux", "cpu": "none" }, "sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g=="],
"@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.53.3", "", { "os": "linux", "cpu": "none" }, "sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A=="],
"@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.53.3", "", { "os": "linux", "cpu": "s390x" }, "sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg=="],
"@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.53.3", "", { "os": "linux", "cpu": "x64" }, "sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w=="],
"@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.53.3", "", { "os": "linux", "cpu": "x64" }, "sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q=="],
"@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.53.3", "", { "os": "none", "cpu": "arm64" }, "sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw=="],
"@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.53.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw=="],
"@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.53.3", "", { "os": "win32", "cpu": "ia32" }, "sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA=="],
"@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.53.3", "", { "os": "win32", "cpu": "x64" }, "sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg=="],
"@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.53.3", "", { "os": "win32", "cpu": "x64" }, "sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ=="],
"@standard-schema/spec": ["@standard-schema/spec@1.0.0", "", {}, "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA=="],
"@sveltejs/acorn-typescript": ["@sveltejs/acorn-typescript@1.0.7", "", { "peerDependencies": { "acorn": "^8.9.0" } }, "sha512-znp1A/Y1Jj4l/Zy7PX5DZKBE0ZNY+5QBngiE21NJkfSTyzzC5iKNWOtwFXKtIrn7MXEFBck4jD95iBNkGjK92Q=="],
"@sveltejs/adapter-auto": ["@sveltejs/adapter-auto@7.0.0", "", { "peerDependencies": { "@sveltejs/kit": "^2.0.0" } }, "sha512-ImDWaErTOCkRS4Gt+5gZuymKFBobnhChXUZ9lhUZLahUgvA4OOvRzi3sahzYgbxGj5nkA6OV0GAW378+dl/gyw=="],
"@sveltejs/adapter-node": ["@sveltejs/adapter-node@5.4.0", "", { "dependencies": { "@rollup/plugin-commonjs": "^28.0.1", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.0", "rollup": "^4.9.5" }, "peerDependencies": { "@sveltejs/kit": "^2.4.0" } }, "sha512-NMsrwGVPEn+J73zH83Uhss/hYYZN6zT3u31R3IHAn3MiKC3h8fjmIAhLfTSOeNHr5wPYfjjMg8E+1gyFgyrEcQ=="],
"@sveltejs/kit": ["@sveltejs/kit@2.49.0", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "@sveltejs/acorn-typescript": "^1.0.5", "@types/cookie": "^0.6.0", "acorn": "^8.14.1", "cookie": "^0.6.0", "devalue": "^5.3.2", "esm-env": "^1.2.2", "kleur": "^4.1.5", "magic-string": "^0.30.5", "mrmime": "^2.0.0", "sade": "^1.8.1", "set-cookie-parser": "^2.6.0", "sirv": "^3.0.0" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0", "svelte": "^4.0.0 || ^5.0.0-next.0", "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0" }, "optionalPeers": ["@opentelemetry/api"], "bin": { "svelte-kit": "svelte-kit.js" } }, "sha512-oH8tXw7EZnie8FdOWYrF7Yn4IKrqTFHhXvl8YxXxbKwTMcD/5NNCryUSEXRk2ZR4ojnub0P8rNrsVGHXWqIDtA=="],
"@sveltejs/vite-plugin-svelte": ["@sveltejs/vite-plugin-svelte@6.2.1", "", { "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^5.0.0", "debug": "^4.4.1", "deepmerge": "^4.3.1", "magic-string": "^0.30.17", "vitefu": "^1.1.1" }, "peerDependencies": { "svelte": "^5.0.0", "vite": "^6.3.0 || ^7.0.0" } }, "sha512-YZs/OSKOQAQCnJvM/P+F1URotNnYNeU3P2s4oIpzm1uFaqUEqRxUB0g5ejMjEb5Gjb9/PiBI5Ktrq4rUUF8UVQ=="],
"@sveltejs/vite-plugin-svelte-inspector": ["@sveltejs/vite-plugin-svelte-inspector@5.0.1", "", { "dependencies": { "debug": "^4.4.1" }, "peerDependencies": { "@sveltejs/vite-plugin-svelte": "^6.0.0-next.0", "svelte": "^5.0.0", "vite": "^6.3.0 || ^7.0.0" } }, "sha512-ubWshlMk4bc8mkwWbg6vNvCeT7lGQojE3ijDh3QTR6Zr/R+GXxsGbyH4PExEPpiFmqPhYiVSVmHBjUcVc1JIrA=="],
"@swc/helpers": ["@swc/helpers@0.5.17", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A=="],
"@tailwindcss/node": ["@tailwindcss/node@4.1.17", "", { "dependencies": { "@jridgewell/remapping": "^2.3.4", "enhanced-resolve": "^5.18.3", "jiti": "^2.6.1", "lightningcss": "1.30.2", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.1.17" } }, "sha512-csIkHIgLb3JisEFQ0vxr2Y57GUNYh447C8xzwj89U/8fdW8LhProdxvnVH6U8M2Y73QKiTIH+LWbK3V2BBZsAg=="],
"@tailwindcss/oxide": ["@tailwindcss/oxide@4.1.17", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.1.17", "@tailwindcss/oxide-darwin-arm64": "4.1.17", "@tailwindcss/oxide-darwin-x64": "4.1.17", "@tailwindcss/oxide-freebsd-x64": "4.1.17", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.17", "@tailwindcss/oxide-linux-arm64-gnu": "4.1.17", "@tailwindcss/oxide-linux-arm64-musl": "4.1.17", "@tailwindcss/oxide-linux-x64-gnu": "4.1.17", "@tailwindcss/oxide-linux-x64-musl": "4.1.17", "@tailwindcss/oxide-wasm32-wasi": "4.1.17", "@tailwindcss/oxide-win32-arm64-msvc": "4.1.17", "@tailwindcss/oxide-win32-x64-msvc": "4.1.17" } }, "sha512-F0F7d01fmkQhsTjXezGBLdrl1KresJTcI3DB8EkScCldyKp3Msz4hub4uyYaVnk88BAS1g5DQjjF6F5qczheLA=="],
"@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.1.17", "", { "os": "android", "cpu": "arm64" }, "sha512-BMqpkJHgOZ5z78qqiGE6ZIRExyaHyuxjgrJ6eBO5+hfrfGkuya0lYfw8fRHG77gdTjWkNWEEm+qeG2cDMxArLQ=="],
"@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/oxide-darwin-arm64@4.1.17", "", { "os": "darwin", "cpu": "arm64" }, "sha512-EquyumkQweUBNk1zGEU/wfZo2qkp/nQKRZM8bUYO0J+Lums5+wl2CcG1f9BgAjn/u9pJzdYddHWBiFXJTcxmOg=="],
"@tailwindcss/oxide-darwin-x64": ["@tailwindcss/oxide-darwin-x64@4.1.17", "", { "os": "darwin", "cpu": "x64" }, "sha512-gdhEPLzke2Pog8s12oADwYu0IAw04Y2tlmgVzIN0+046ytcgx8uZmCzEg4VcQh+AHKiS7xaL8kGo/QTiNEGRog=="],
"@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/oxide-freebsd-x64@4.1.17", "", { "os": "freebsd", "cpu": "x64" }, "sha512-hxGS81KskMxML9DXsaXT1H0DyA+ZBIbyG/sSAjWNe2EDl7TkPOBI42GBV3u38itzGUOmFfCzk1iAjDXds8Oh0g=="],
"@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/oxide-linux-arm-gnueabihf@4.1.17", "", { "os": "linux", "cpu": "arm" }, "sha512-k7jWk5E3ldAdw0cNglhjSgv501u7yrMf8oeZ0cElhxU6Y2o7f8yqelOp3fhf7evjIS6ujTI3U8pKUXV2I4iXHQ=="],
"@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/oxide-linux-arm64-gnu@4.1.17", "", { "os": "linux", "cpu": "arm64" }, "sha512-HVDOm/mxK6+TbARwdW17WrgDYEGzmoYayrCgmLEw7FxTPLcp/glBisuyWkFz/jb7ZfiAXAXUACfyItn+nTgsdQ=="],
"@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/oxide-linux-arm64-musl@4.1.17", "", { "os": "linux", "cpu": "arm64" }, "sha512-HvZLfGr42i5anKtIeQzxdkw/wPqIbpeZqe7vd3V9vI3RQxe3xU1fLjss0TjyhxWcBaipk7NYwSrwTwK1hJARMg=="],
"@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/oxide-linux-x64-gnu@4.1.17", "", { "os": "linux", "cpu": "x64" }, "sha512-M3XZuORCGB7VPOEDH+nzpJ21XPvK5PyjlkSFkFziNHGLc5d6g3di2McAAblmaSUNl8IOmzYwLx9NsE7bplNkwQ=="],
"@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/oxide-linux-x64-musl@4.1.17", "", { "os": "linux", "cpu": "x64" }, "sha512-k7f+pf9eXLEey4pBlw+8dgfJHY4PZ5qOUFDyNf7SI6lHjQ9Zt7+NcscjpwdCEbYi6FI5c2KDTDWyf2iHcCSyyQ=="],
"@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/oxide-wasm32-wasi@4.1.17", "", { "dependencies": { "@emnapi/core": "^1.6.0", "@emnapi/runtime": "^1.6.0", "@emnapi/wasi-threads": "^1.1.0", "@napi-rs/wasm-runtime": "^1.0.7", "@tybys/wasm-util": "^0.10.1", "tslib": "^2.4.0" }, "cpu": "none" }, "sha512-cEytGqSSoy7zK4JRWiTCx43FsKP/zGr0CsuMawhH67ONlH+T79VteQeJQRO/X7L0juEUA8ZyuYikcRBf0vsxhg=="],
"@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/oxide-win32-arm64-msvc@4.1.17", "", { "os": "win32", "cpu": "arm64" }, "sha512-JU5AHr7gKbZlOGvMdb4722/0aYbU+tN6lv1kONx0JK2cGsh7g148zVWLM0IKR3NeKLv+L90chBVYcJ8uJWbC9A=="],
"@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/oxide-win32-x64-msvc@4.1.17", "", { "os": "win32", "cpu": "x64" }, "sha512-SKWM4waLuqx0IH+FMDUw6R66Hu4OuTALFgnleKbqhgGU30DY20NORZMZUKgLRjQXNN2TLzKvh48QXTig4h4bGw=="],
"@tailwindcss/vite": ["@tailwindcss/vite@4.1.17", "", { "dependencies": { "@tailwindcss/node": "4.1.17", "@tailwindcss/oxide": "4.1.17", "tailwindcss": "4.1.17" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7" } }, "sha512-4+9w8ZHOiGnpcGI6z1TVVfWaX/koK7fKeSYF3qlYg2xpBtbteP2ddBxiarL+HVgfSJGeK5RIxRQmKm4rTJJAwA=="],
"@types/bcrypt": ["@types/bcrypt@6.0.0", "", { "dependencies": { "@types/node": "*" } }, "sha512-/oJGukuH3D2+D+3H4JWLaAsJ/ji86dhRidzZ/Od7H/i8g+aCmvkeCc6Ni/f9uxGLSQVCRZkX2/lqEFG2BvWtlQ=="],
"@types/cookie": ["@types/cookie@0.6.0", "", {}, "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA=="],
"@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
"@types/node": ["@types/node@24.10.1", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ=="],
"@types/resolve": ["@types/resolve@1.20.2", "", {}, "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q=="],
"@yarnpkg/lockfile": ["@yarnpkg/lockfile@1.1.0", "", {}, "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ=="],
"acorn": ["acorn@8.15.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg=="],
"ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
"aria-query": ["aria-query@5.3.2", "", {}, "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw=="],
"axobject-query": ["axobject-query@4.1.0", "", {}, "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ=="],
"bcrypt": ["bcrypt@6.0.0", "", { "dependencies": { "node-addon-api": "^8.3.0", "node-gyp-build": "^4.8.4" } }, "sha512-cU8v/EGSrnH+HnxV2z0J7/blxH8gq7Xh2JFT6Aroax7UohdmiJJlxApMxtKfuI7z68NvvVcmR78k2LbT6efhRg=="],
"bignumber.js": ["bignumber.js@9.3.1", "", {}, "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ=="],
"bits-ui": ["bits-ui@2.14.4", "", { "dependencies": { "@floating-ui/core": "^1.7.1", "@floating-ui/dom": "^1.7.1", "esm-env": "^1.1.2", "runed": "^0.35.1", "svelte-toolbelt": "^0.10.6", "tabbable": "^6.2.0" }, "peerDependencies": { "@internationalized/date": "^3.8.1", "svelte": "^5.33.0" } }, "sha512-W6kenhnbd/YVvur+DKkaVJ6GldE53eLewur5AhUCqslYQ0vjZr8eWlOfwZnMiPB+PF5HMVqf61vXBvmyrAmPWg=="],
"braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="],
"buffer-from": ["buffer-from@1.1.2", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="],
"call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="],
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
"call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
"chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
"chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="],
"ci-info": ["ci-info@3.9.0", "", {}, "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ=="],
"clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
"color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
"color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
"commondir": ["commondir@1.0.1", "", {}, "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg=="],
"cookie": ["cookie@0.6.0", "", {}, "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw=="],
"cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
"deepmerge": ["deepmerge@4.3.1", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="],
"define-data-property": ["define-data-property@1.1.4", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" } }, "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A=="],
"dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="],
"detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],
"devalue": ["devalue@5.5.0", "", {}, "sha512-69sM5yrHfFLJt0AZ9QqZXGCPfJ7fQjvpln3Rq5+PS03LD32Ost1Q9N+eEnaQwGRIriKkMImXD56ocjQmfjbV3w=="],
"drizzle-kit": ["drizzle-kit@0.31.7", "", { "dependencies": { "@drizzle-team/brocli": "^0.10.2", "@esbuild-kit/esm-loader": "^2.5.5", "esbuild": "^0.25.4", "esbuild-register": "^3.5.0" }, "bin": { "drizzle-kit": "bin.cjs" } }, "sha512-hOzRGSdyKIU4FcTSFYGKdXEjFsncVwHZ43gY3WU5Bz9j5Iadp6Rh6hxLSQ1IWXpKLBKt/d5y1cpSPcV+FcoQ1A=="],
"drizzle-orm": ["drizzle-orm@0.44.7", "", { "peerDependencies": { "@aws-sdk/client-rds-data": ">=3", "@cloudflare/workers-types": ">=4", "@electric-sql/pglite": ">=0.2.0", "@libsql/client": ">=0.10.0", "@libsql/client-wasm": ">=0.10.0", "@neondatabase/serverless": ">=0.10.0", "@op-engineering/op-sqlite": ">=2", "@opentelemetry/api": "^1.4.1", "@planetscale/database": ">=1.13", "@prisma/client": "*", "@tidbcloud/serverless": "*", "@types/better-sqlite3": "*", "@types/pg": "*", "@types/sql.js": "*", "@upstash/redis": ">=1.34.7", "@vercel/postgres": ">=0.8.0", "@xata.io/client": "*", "better-sqlite3": ">=7", "bun-types": "*", "expo-sqlite": ">=14.0.0", "gel": ">=2", "knex": "*", "kysely": "*", "mysql2": ">=2", "pg": ">=8", "postgres": ">=3", "sql.js": ">=1", "sqlite3": ">=5" }, "optionalPeers": ["@aws-sdk/client-rds-data", "@cloudflare/workers-types", "@electric-sql/pglite", "@libsql/client", "@libsql/client-wasm", "@neondatabase/serverless", "@op-engineering/op-sqlite", "@opentelemetry/api", "@planetscale/database", "@prisma/client", "@tidbcloud/serverless", "@types/better-sqlite3", "@types/pg", "@types/sql.js", "@upstash/redis", "@vercel/postgres", "@xata.io/client", "better-sqlite3", "bun-types", "expo-sqlite", "gel", "knex", "kysely", "mysql2", "pg", "postgres", "sql.js", "sqlite3"] }, "sha512-quIpnYznjU9lHshEOAYLoZ9s3jweleHlZIAWR/jX9gAWNg/JhQ1wj0KGRf7/Zm+obRrYd9GjPVJg790QY9N5AQ=="],
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
"enhanced-resolve": ["enhanced-resolve@5.18.3", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" } }, "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww=="],
"error-causes": ["error-causes@3.0.2", "", {}, "sha512-i0B8zq1dHL6mM85FGoxaJnVtx6LD5nL2v0hlpGdntg5FOSyzQ46c9lmz5qx0xRS2+PWHGOHcYxGIBC5Le2dRMw=="],
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
"es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="],
"esbuild": ["esbuild@0.25.12", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.12", "@esbuild/android-arm": "0.25.12", "@esbuild/android-arm64": "0.25.12", "@esbuild/android-x64": "0.25.12", "@esbuild/darwin-arm64": "0.25.12", "@esbuild/darwin-x64": "0.25.12", "@esbuild/freebsd-arm64": "0.25.12", "@esbuild/freebsd-x64": "0.25.12", "@esbuild/linux-arm": "0.25.12", "@esbuild/linux-arm64": "0.25.12", "@esbuild/linux-ia32": "0.25.12", "@esbuild/linux-loong64": "0.25.12", "@esbuild/linux-mips64el": "0.25.12", "@esbuild/linux-ppc64": "0.25.12", "@esbuild/linux-riscv64": "0.25.12", "@esbuild/linux-s390x": "0.25.12", "@esbuild/linux-x64": "0.25.12", "@esbuild/netbsd-arm64": "0.25.12", "@esbuild/netbsd-x64": "0.25.12", "@esbuild/openbsd-arm64": "0.25.12", "@esbuild/openbsd-x64": "0.25.12", "@esbuild/openharmony-arm64": "0.25.12", "@esbuild/sunos-x64": "0.25.12", "@esbuild/win32-arm64": "0.25.12", "@esbuild/win32-ia32": "0.25.12", "@esbuild/win32-x64": "0.25.12" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg=="],
"esbuild-register": ["esbuild-register@3.6.0", "", { "dependencies": { "debug": "^4.3.4" }, "peerDependencies": { "esbuild": ">=0.12 <1" } }, "sha512-H2/S7Pm8a9CL1uhp9OvjwrBh5Pvx0H8qVOxNu8Wed9Y7qv56MPtq+GGM8RJpq6glYJn9Wspr8uw7l55uyinNeg=="],
"esm-env": ["esm-env@1.2.2", "", {}, "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA=="],
"esrap": ["esrap@2.1.3", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" } }, "sha512-T/Dhhv/QH+yYmiaLz9SA3PW+YyenlnRKDNdtlYJrSOBmNsH4nvPux+mTwx7p+wAedlJrGoZtXNI0a0MjQ2QkVg=="],
"estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="],
"fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
"fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="],
"find-yarn-workspace-root": ["find-yarn-workspace-root@2.0.0", "", { "dependencies": { "micromatch": "^4.0.2" } }, "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ=="],
"fs-extra": ["fs-extra@10.1.0", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ=="],
"fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "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" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
"get-tsconfig": ["get-tsconfig@4.13.0", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ=="],
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
"has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
"has-property-descriptors": ["has-property-descriptors@1.0.2", "", { "dependencies": { "es-define-property": "^1.0.0" } }, "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg=="],
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
"hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
"inline-style-parser": ["inline-style-parser@0.2.7", "", {}, "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA=="],
"is-core-module": ["is-core-module@2.16.1", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="],
"is-docker": ["is-docker@2.2.1", "", { "bin": { "is-docker": "cli.js" } }, "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="],
"is-module": ["is-module@1.0.0", "", {}, "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g=="],
"is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="],
"is-reference": ["is-reference@3.0.3", "", { "dependencies": { "@types/estree": "^1.0.6" } }, "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw=="],
"is-wsl": ["is-wsl@2.2.0", "", { "dependencies": { "is-docker": "^2.0.0" } }, "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww=="],
"isarray": ["isarray@2.0.5", "", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="],
"isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
"jiti": ["jiti@2.6.1", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ=="],
"jose": ["jose@5.10.0", "", {}, "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg=="],
"json-stable-stringify": ["json-stable-stringify@1.3.0", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", "isarray": "^2.0.5", "jsonify": "^0.0.1", "object-keys": "^1.1.1" } }, "sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg=="],
"jsonfile": ["jsonfile@6.2.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg=="],
"jsonify": ["jsonify@0.0.1", "", {}, "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg=="],
"klaw-sync": ["klaw-sync@6.0.0", "", { "dependencies": { "graceful-fs": "^4.1.11" } }, "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ=="],
"kleur": ["kleur@4.1.5", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="],
"lightningcss": ["lightningcss@1.30.2", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.30.2", "lightningcss-darwin-arm64": "1.30.2", "lightningcss-darwin-x64": "1.30.2", "lightningcss-freebsd-x64": "1.30.2", "lightningcss-linux-arm-gnueabihf": "1.30.2", "lightningcss-linux-arm64-gnu": "1.30.2", "lightningcss-linux-arm64-musl": "1.30.2", "lightningcss-linux-x64-gnu": "1.30.2", "lightningcss-linux-x64-musl": "1.30.2", "lightningcss-win32-arm64-msvc": "1.30.2", "lightningcss-win32-x64-msvc": "1.30.2" } }, "sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ=="],
"lightningcss-android-arm64": ["lightningcss-android-arm64@1.30.2", "", { "os": "android", "cpu": "arm64" }, "sha512-BH9sEdOCahSgmkVhBLeU7Hc9DWeZ1Eb6wNS6Da8igvUwAe0sqROHddIlvU06q3WyXVEOYDZ6ykBZQnjTbmo4+A=="],
"lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.30.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-ylTcDJBN3Hp21TdhRT5zBOIi73P6/W0qwvlFEk22fkdXchtNTOU4Qc37SkzV+EKYxLouZ6M4LG9NfZ1qkhhBWA=="],
"lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.30.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-oBZgKchomuDYxr7ilwLcyms6BCyLn0z8J0+ZZmfpjwg9fRVZIR5/GMXd7r9RH94iDhld3UmSjBM6nXWM2TfZTQ=="],
"lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.30.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-c2bH6xTrf4BDpK8MoGG4Bd6zAMZDAXS569UxCAGcA7IKbHNMlhGQ89eRmvpIUGfKWNVdbhSbkQaWhEoMGmGslA=="],
"lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.30.2", "", { "os": "linux", "cpu": "arm" }, "sha512-eVdpxh4wYcm0PofJIZVuYuLiqBIakQ9uFZmipf6LF/HRj5Bgm0eb3qL/mr1smyXIS1twwOxNWndd8z0E374hiA=="],
"lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.30.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-UK65WJAbwIJbiBFXpxrbTNArtfuznvxAJw4Q2ZGlU8kPeDIWEX1dg3rn2veBVUylA2Ezg89ktszWbaQnxD/e3A=="],
"lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.30.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA=="],
"lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.30.2", "", { "os": "linux", "cpu": "x64" }, "sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w=="],
"lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.30.2", "", { "os": "linux", "cpu": "x64" }, "sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA=="],
"lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.30.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ=="],
"lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.30.2", "", { "os": "win32", "cpu": "x64" }, "sha512-5g1yc73p+iAkid5phb4oVFMB45417DkRevRbt/El/gKXJk4jid+vPFF/AXbxn05Aky8PapwzZrdJShv5C0avjw=="],
"locate-character": ["locate-character@3.0.0", "", {}, "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA=="],
"lucide-svelte": ["lucide-svelte@0.554.0", "", { "peerDependencies": { "svelte": "^3 || ^4 || ^5.0.0-next.42" } }, "sha512-LLcpHi3SuKup0nVD1kKqo8FDZnjXJp48uST26GGh8Jcyrxqk5gmgpnvKmHsHox674UL3cPS1DCul/wFL7ybGqg=="],
"lz-string": ["lz-string@1.5.0", "", { "bin": { "lz-string": "bin/bin.js" } }, "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ=="],
"magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
"micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="],
"minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="],
"mri": ["mri@1.2.0", "", {}, "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA=="],
"mrmime": ["mrmime@2.0.1", "", {}, "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ=="],
"ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
"nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
"node-addon-api": ["node-addon-api@8.5.0", "", {}, "sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A=="],
"node-gyp-build": ["node-gyp-build@4.8.4", "", { "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", "node-gyp-build-test": "build-test.js" } }, "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ=="],
"oauth4webapi": ["oauth4webapi@2.17.0", "", {}, "sha512-lbC0Z7uzAFNFyzEYRIC+pkSVvDHJTbEW+dYlSBAlCYDe6RxUkJ26bClhk8ocBZip1wfI9uKTe0fm4Ib4RHn6uQ=="],
"object-keys": ["object-keys@1.1.1", "", {}, "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="],
"open": ["open@7.4.2", "", { "dependencies": { "is-docker": "^2.0.0", "is-wsl": "^2.1.1" } }, "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q=="],
"patch-package": ["patch-package@8.0.1", "", { "dependencies": { "@yarnpkg/lockfile": "^1.1.0", "chalk": "^4.1.2", "ci-info": "^3.7.0", "cross-spawn": "^7.0.3", "find-yarn-workspace-root": "^2.0.0", "fs-extra": "^10.0.0", "json-stable-stringify": "^1.0.2", "klaw-sync": "^6.0.0", "minimist": "^1.2.6", "open": "^7.4.2", "semver": "^7.5.3", "slash": "^2.0.0", "tmp": "^0.2.4", "yaml": "^2.2.2" }, "bin": { "patch-package": "index.js" } }, "sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw=="],
"path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
"path-parse": ["path-parse@1.0.7", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="],
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
"picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="],
"postcss": ["postcss@8.5.6", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg=="],
"postgres": ["postgres@3.4.7", "", {}, "sha512-Jtc2612XINuBjIl/QTWsV5UvE8UHuNblcO3vVADSrKsrc6RqGX6lOW1cEo3CM2v0XG4Nat8nI+YM7/f26VxXLw=="],
"postinstall-postinstall": ["postinstall-postinstall@2.1.0", "", {}, "sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ=="],
"preact": ["preact@10.11.3", "", {}, "sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg=="],
"preact-render-to-string": ["preact-render-to-string@5.2.3", "", { "dependencies": { "pretty-format": "^3.8.0" }, "peerDependencies": { "preact": ">=10" } }, "sha512-aPDxUn5o3GhWdtJtW0svRC2SS/l8D9MAgo2+AWml+BhDImb27ALf04Q2d+AHqUUOc6RdSXFIBVa2gxzgMKgtZA=="],
"pretty-format": ["pretty-format@3.8.0", "", {}, "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew=="],
"readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="],
"resolve": ["resolve@1.22.11", "", { "dependencies": { "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ=="],
"resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="],
"rollup": ["rollup@4.53.3", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.53.3", "@rollup/rollup-android-arm64": "4.53.3", "@rollup/rollup-darwin-arm64": "4.53.3", "@rollup/rollup-darwin-x64": "4.53.3", "@rollup/rollup-freebsd-arm64": "4.53.3", "@rollup/rollup-freebsd-x64": "4.53.3", "@rollup/rollup-linux-arm-gnueabihf": "4.53.3", "@rollup/rollup-linux-arm-musleabihf": "4.53.3", "@rollup/rollup-linux-arm64-gnu": "4.53.3", "@rollup/rollup-linux-arm64-musl": "4.53.3", "@rollup/rollup-linux-loong64-gnu": "4.53.3", "@rollup/rollup-linux-ppc64-gnu": "4.53.3", "@rollup/rollup-linux-riscv64-gnu": "4.53.3", "@rollup/rollup-linux-riscv64-musl": "4.53.3", "@rollup/rollup-linux-s390x-gnu": "4.53.3", "@rollup/rollup-linux-x64-gnu": "4.53.3", "@rollup/rollup-linux-x64-musl": "4.53.3", "@rollup/rollup-openharmony-arm64": "4.53.3", "@rollup/rollup-win32-arm64-msvc": "4.53.3", "@rollup/rollup-win32-ia32-msvc": "4.53.3", "@rollup/rollup-win32-x64-gnu": "4.53.3", "@rollup/rollup-win32-x64-msvc": "4.53.3", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA=="],
"runed": ["runed@0.35.1", "", { "dependencies": { "dequal": "^2.0.3", "esm-env": "^1.0.0", "lz-string": "^1.5.0" }, "peerDependencies": { "@sveltejs/kit": "^2.21.0", "svelte": "^5.7.0" }, "optionalPeers": ["@sveltejs/kit"] }, "sha512-2F4Q/FZzbeJTFdIS/PuOoPRSm92sA2LhzTnv6FXhCoENb3huf5+fDuNOg1LNvGOouy3u/225qxmuJvcV3IZK5Q=="],
"sade": ["sade@1.8.1", "", { "dependencies": { "mri": "^1.1.0" } }, "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A=="],
"semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="],
"set-cookie-parser": ["set-cookie-parser@2.7.2", "", {}, "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw=="],
"set-function-length": ["set-function-length@1.2.2", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" } }, "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg=="],
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
"shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
"sirv": ["sirv@3.0.2", "", { "dependencies": { "@polka/url": "^1.0.0-next.24", "mrmime": "^2.0.0", "totalist": "^3.0.0" } }, "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g=="],
"slash": ["slash@2.0.0", "", {}, "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A=="],
"source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
"source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
"source-map-support": ["source-map-support@0.5.21", "", { "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w=="],
"style-to-object": ["style-to-object@1.0.14", "", { "dependencies": { "inline-style-parser": "0.2.7" } }, "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw=="],
"supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
"supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="],
"svelte": ["svelte@5.43.14", "", { "dependencies": { "@jridgewell/remapping": "^2.3.4", "@jridgewell/sourcemap-codec": "^1.5.0", "@sveltejs/acorn-typescript": "^1.0.5", "@types/estree": "^1.0.5", "acorn": "^8.12.1", "aria-query": "^5.3.1", "axobject-query": "^4.1.0", "clsx": "^2.1.1", "esm-env": "^1.2.1", "esrap": "^2.1.0", "is-reference": "^3.0.3", "locate-character": "^3.0.0", "magic-string": "^0.30.11", "zimmerframe": "^1.1.2" } }, "sha512-pHeUrp1A5S6RGaXhJB7PtYjL1VVjbVrJ2EfuAoPu9/1LeoMaJa/pcdCsCSb0gS4eUHAHnhCbUDxORZyvGK6kOQ=="],
"svelte-check": ["svelte-check@4.3.4", "", { "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "chokidar": "^4.0.1", "fdir": "^6.2.0", "picocolors": "^1.0.0", "sade": "^1.7.4" }, "peerDependencies": { "svelte": "^4.0.0 || ^5.0.0-next.0", "typescript": ">=5.0.0" }, "bin": { "svelte-check": "bin/svelte-check" } }, "sha512-DVWvxhBrDsd+0hHWKfjP99lsSXASeOhHJYyuKOFYJcP7ThfSCKgjVarE8XfuMWpS5JV3AlDf+iK1YGGo2TACdw=="],
"svelte-dnd-action": ["svelte-dnd-action@0.9.67", "", { "peerDependencies": { "svelte": ">=3.23.0 || ^5.0.0-next.0" } }, "sha512-yEJQZ9SFy3O4mnOdtjwWyotRsWRktNf4W8k67zgiLiMtMNQnwCyJHBjkGMgZMDh8EGZ4gr88l+GebBWoHDwo+g=="],
"svelte-toolbelt": ["svelte-toolbelt@0.10.6", "", { "dependencies": { "clsx": "^2.1.1", "runed": "^0.35.1", "style-to-object": "^1.0.8" }, "peerDependencies": { "svelte": "^5.30.2" } }, "sha512-YWuX+RE+CnWYx09yseAe4ZVMM7e7GRFZM6OYWpBKOb++s+SQ8RBIMMe+Bs/CznBMc0QPLjr+vDBxTAkozXsFXQ=="],
"tabbable": ["tabbable@6.3.0", "", {}, "sha512-EIHvdY5bPLuWForiR/AN2Bxngzpuwn1is4asboytXtpTgsArc+WmSJKVLlhdh71u7jFcryDqB2A8lQvj78MkyQ=="],
"tailwind-merge": ["tailwind-merge@3.4.0", "", {}, "sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g=="],
"tailwind-variants": ["tailwind-variants@3.2.2", "", { "peerDependencies": { "tailwind-merge": ">=3.0.0", "tailwindcss": "*" }, "optionalPeers": ["tailwind-merge"] }, "sha512-Mi4kHeMTLvKlM98XPnK+7HoBPmf4gygdFmqQPaDivc3DpYS6aIY6KiG/PgThrGvii5YZJqRsPz0aPyhoFzmZgg=="],
"tailwindcss": ["tailwindcss@4.1.17", "", {}, "sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q=="],
"tapable": ["tapable@2.3.0", "", {}, "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg=="],
"tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="],
"tmp": ["tmp@0.2.5", "", {}, "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow=="],
"to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="],
"totalist": ["totalist@3.0.1", "", {}, "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ=="],
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
"tw-animate-css": ["tw-animate-css@1.4.0", "", {}, "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ=="],
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
"undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
"universalify": ["universalify@2.0.1", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="],
"vite": ["vite@7.2.4", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "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" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-NL8jTlbo0Tn4dUEXEsUg8KeyG/Lkmc4Fnzb8JXN/Ykm9G4HNImjtABMJgkQoVjOBN/j2WAwDTRytdqJbZsah7w=="],
"vitefu": ["vitefu@1.1.1", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0" }, "optionalPeers": ["vite"] }, "sha512-B/Fegf3i8zh0yFbpzZ21amWzHmuNlLlmJT6n7bu5e+pCHUKQIfXSYokrqOBGEMMe9UG2sostKQF9mml/vYaWJQ=="],
"which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
"yaml": ["yaml@2.8.1", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw=="],
"zimmerframe": ["zimmerframe@1.1.4", "", {}, "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ=="],
"@auth/drizzle-adapter/@auth/core": ["@auth/core@0.41.1", "", { "dependencies": { "@panva/hkdf": "^1.2.1", "jose": "^6.0.6", "oauth4webapi": "^3.3.0", "preact": "10.24.3", "preact-render-to-string": "6.5.11" }, "peerDependencies": { "@simplewebauthn/browser": "^9.0.1", "@simplewebauthn/server": "^9.0.2", "nodemailer": "^7.0.7" }, "optionalPeers": ["@simplewebauthn/browser", "@simplewebauthn/server", "nodemailer"] }, "sha512-t9cJ2zNYAdWMacGRMT6+r4xr1uybIdmYa49calBPeTqwgAFPV/88ac9TEvCR85pvATiSPt8VaNf+Gt24JIT/uw=="],
"@auth/sveltekit/@auth/core": ["@auth/core@0.41.1", "", { "dependencies": { "@panva/hkdf": "^1.2.1", "jose": "^6.0.6", "oauth4webapi": "^3.3.0", "preact": "10.24.3", "preact-render-to-string": "6.5.11" }, "peerDependencies": { "@simplewebauthn/browser": "^9.0.1", "@simplewebauthn/server": "^9.0.2", "nodemailer": "^7.0.7" }, "optionalPeers": ["@simplewebauthn/browser", "@simplewebauthn/server", "nodemailer"] }, "sha512-t9cJ2zNYAdWMacGRMT6+r4xr1uybIdmYa49calBPeTqwgAFPV/88ac9TEvCR85pvATiSPt8VaNf+Gt24JIT/uw=="],
"@esbuild-kit/core-utils/esbuild": ["esbuild@0.18.20", "", { "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA=="],
"@rollup/plugin-commonjs/is-reference": ["is-reference@1.2.1", "", { "dependencies": { "@types/estree": "*" } }, "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ=="],
"@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.7.1", "", { "dependencies": { "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" }, "bundled": true }, "sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg=="],
"@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.7.1", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA=="],
"@tailwindcss/oxide-wasm32-wasi/@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.1.0", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ=="],
"@tailwindcss/oxide-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.0.7", "", { "dependencies": { "@emnapi/core": "^1.5.0", "@emnapi/runtime": "^1.5.0", "@tybys/wasm-util": "^0.10.1" }, "bundled": true }, "sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw=="],
"@tailwindcss/oxide-wasm32-wasi/@tybys/wasm-util": ["@tybys/wasm-util@0.10.1", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="],
"@tailwindcss/oxide-wasm32-wasi/tslib": ["tslib@2.8.1", "", { "bundled": true }, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
"micromatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
"@auth/drizzle-adapter/@auth/core/jose": ["jose@6.1.2", "", {}, "sha512-MpcPtHLE5EmztuFIqB0vzHAWJPpmN1E6L4oo+kze56LIs3MyXIj9ZHMDxqOvkP38gBR7K1v3jqd4WU2+nrfONQ=="],
"@auth/drizzle-adapter/@auth/core/oauth4webapi": ["oauth4webapi@3.8.3", "", {}, "sha512-pQ5BsX3QRTgnt5HxgHwgunIRaDXBdkT23tf8dfzmtTIL2LTpdmxgbpbBm0VgFWAIDlezQvQCTgnVIUmHupXHxw=="],
"@auth/drizzle-adapter/@auth/core/preact": ["preact@10.24.3", "", {}, "sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA=="],
"@auth/drizzle-adapter/@auth/core/preact-render-to-string": ["preact-render-to-string@6.5.11", "", { "peerDependencies": { "preact": ">=10" } }, "sha512-ubnauqoGczeGISiOh6RjX0/cdaF8v/oDXIjO85XALCQjwQP+SB4RDXXtvZ6yTYSjG+PC1QRP2AhPgCEsM2EvUw=="],
"@auth/sveltekit/@auth/core/jose": ["jose@6.1.2", "", {}, "sha512-MpcPtHLE5EmztuFIqB0vzHAWJPpmN1E6L4oo+kze56LIs3MyXIj9ZHMDxqOvkP38gBR7K1v3jqd4WU2+nrfONQ=="],
"@auth/sveltekit/@auth/core/oauth4webapi": ["oauth4webapi@3.8.3", "", {}, "sha512-pQ5BsX3QRTgnt5HxgHwgunIRaDXBdkT23tf8dfzmtTIL2LTpdmxgbpbBm0VgFWAIDlezQvQCTgnVIUmHupXHxw=="],
"@auth/sveltekit/@auth/core/preact": ["preact@10.24.3", "", {}, "sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA=="],
"@auth/sveltekit/@auth/core/preact-render-to-string": ["preact-render-to-string@6.5.11", "", { "peerDependencies": { "preact": ">=10" } }, "sha512-ubnauqoGczeGISiOh6RjX0/cdaF8v/oDXIjO85XALCQjwQP+SB4RDXXtvZ6yTYSjG+PC1QRP2AhPgCEsM2EvUw=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/android-arm": ["@esbuild/android-arm@0.18.20", "", { "os": "android", "cpu": "arm" }, "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/android-arm64": ["@esbuild/android-arm64@0.18.20", "", { "os": "android", "cpu": "arm64" }, "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/android-x64": ["@esbuild/android-x64@0.18.20", "", { "os": "android", "cpu": "x64" }, "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.18.20", "", { "os": "darwin", "cpu": "arm64" }, "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.18.20", "", { "os": "darwin", "cpu": "x64" }, "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.18.20", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.18.20", "", { "os": "freebsd", "cpu": "x64" }, "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-arm": ["@esbuild/linux-arm@0.18.20", "", { "os": "linux", "cpu": "arm" }, "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.18.20", "", { "os": "linux", "cpu": "arm64" }, "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.18.20", "", { "os": "linux", "cpu": "ia32" }, "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.18.20", "", { "os": "linux", "cpu": "ppc64" }, "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.18.20", "", { "os": "linux", "cpu": "s390x" }, "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/linux-x64": ["@esbuild/linux-x64@0.18.20", "", { "os": "linux", "cpu": "x64" }, "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.18.20", "", { "os": "none", "cpu": "x64" }, "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.18.20", "", { "os": "openbsd", "cpu": "x64" }, "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.18.20", "", { "os": "sunos", "cpu": "x64" }, "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.18.20", "", { "os": "win32", "cpu": "arm64" }, "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.18.20", "", { "os": "win32", "cpu": "ia32" }, "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g=="],
"@esbuild-kit/core-utils/esbuild/@esbuild/win32-x64": ["@esbuild/win32-x64@0.18.20", "", { "os": "win32", "cpu": "x64" }, "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ=="],
}
}
+51
View File
@@ -0,0 +1,51 @@
# Coolify-optimized Docker Compose
# Includes both app and database - database is only exposed internally
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-wishlistuser}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-wishlistpassword}
POSTGRES_DB: ${POSTGRES_DB:-wishlist}
volumes:
- type: bind
source: ${POSTGRES_DATA_PATH}
target: /var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-wishlistuser} -d ${POSTGRES_DB:-wishlist}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# NOTE: No ports exposed - only accessible internally by app service
app:
build:
context: .
dockerfile: Dockerfile
environment:
# Coolify will inject these from Environment Variables
DATABASE_URL: postgresql://${POSTGRES_USER:-wishlistuser}:${POSTGRES_PASSWORD:-wishlistpassword}@db:5432/${POSTGRES_DB:-wishlist}
NODE_ENV: production
PORT: 3000
AUTH_SECRET: ${AUTH_SECRET}
AUTH_URL: ${AUTH_URL:-https://wish.rasmusq.com}
AUTH_TRUST_HOST: ${AUTH_TRUST_HOST:-true}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
depends_on:
db:
condition: service_healthy
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.wishlist.rule=Host(`wish.rasmusq.com`)
- traefik.http.routers.wishlist.entryPoints=https
- traefik.http.routers.wishlist.tls=true
- traefik.http.routers.wishlist.tls.certresolver=letsencrypt
- traefik.http.services.wishlist.loadbalancer.server.port=3000
# Forward headers for Auth.js behind reverse proxy
- traefik.http.middlewares.wishlist-headers.headers.customrequestheaders.X-Forwarded-Proto=https
- traefik.http.middlewares.wishlist-headers.headers.customrequestheaders.X-Forwarded-Host=wish.rasmusq.com
- traefik.http.routers.wishlist.middlewares=wishlist-headers
-21
View File
@@ -1,21 +0,0 @@
services:
database:
image: postgres:16-alpine
container_name: wishlist-postgres-test
restart: unless-stopped
ports:
- 5432:5432
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
interval: 10s
timeout: 5s
retries: 5
volumes:
db-data:
-62
View File
@@ -1,62 +0,0 @@
services:
database:
image: postgres:16-alpine
container_name: wishlist-postgres
restart: unless-stopped
pull_policy: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- /mnt/HC_Volume_102830676/wishlist:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
interval: 10s
timeout: 5s
retries: 5
networks:
- wishlist-net
app:
build:
context: .
dockerfile: Dockerfile
container_name: wishlist-app
restart: unless-stopped
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}
NODE_ENV: production
PORT: 3000
AUTH_SECRET: ${AUTH_SECRET}
AUTH_URL: ${AUTH_URL}
AUTH_TRUST_HOST: 'true'
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
AUTHENTIK_CLIENT_ID: ${AUTHENTIK_CLIENT_ID:-}
AUTHENTIK_CLIENT_SECRET: ${AUTHENTIK_CLIENT_SECRET:-}
AUTHENTIK_ISSUER: ${AUTHENTIK_ISSUER:-}
depends_on:
database:
condition: service_healthy
networks:
- wishlist-net
- traefik-net
labels:
- traefik.enable=true
- traefik.docker.network=traefik-net
# HTTPS router
- traefik.http.routers.wishlist.rule=Host(`wish.rasmusq.com`)
- traefik.http.routers.wishlist.entrypoints=websecure
- traefik.http.routers.wishlist.tls.certresolver=letsencrypt
# Forward headers for Auth.js
- traefik.http.routers.wishlist.middlewares=wishlist-headers
- traefik.http.middlewares.wishlist-headers.headers.customRequestHeaders.X-Forwarded-Proto=https
- traefik.http.middlewares.wishlist-headers.headers.customRequestHeaders.X-Forwarded-Host=wish.rasmusq.com
- traefik.http.services.wishlist.loadbalancer.server.port=3000
networks:
wishlist-net:
name: wishlist-net
traefik-net:
external: true
+41
View File
@@ -0,0 +1,41 @@
services:
db:
image: postgres:16-alpine
container_name: wishlist-db
environment:
POSTGRES_USER: wishlistuser
POSTGRES_PASSWORD: wishlistpassword
POSTGRES_DB: wishlist
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U wishlistuser -d wishlist"]
interval: 10s
timeout: 5s
retries: 5
app:
build:
context: .
dockerfile: Dockerfile
container_name: wishlist-app
environment:
DATABASE_URL: postgresql://wishlistuser:wishlistpassword@db:5432/wishlist
NODE_ENV: production
PORT: 3000
AUTH_SECRET: ${AUTH_SECRET:-change-me-in-production}
AUTH_URL: ${AUTH_URL:-http://localhost:3000}
AUTH_TRUST_HOST: true
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
ports:
- "3000:3000"
depends_on:
db:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data:
+1 -1
View File
@@ -1,7 +1,7 @@
import type { Config } from 'drizzle-kit'; import type { Config } from 'drizzle-kit';
export default { export default {
schema: './src/lib/db/schema.ts', schema: './src/lib/server/schema.ts',
out: './drizzle', out: './drizzle',
dialect: 'postgresql', dialect: 'postgresql',
dbCredentials: { dbCredentials: {
+9 -9
View File
@@ -1,12 +1,12 @@
import { relations } from 'drizzle-orm/relations'; import { relations } from "drizzle-orm/relations";
import { wishlists, items, user, savedWishlists, reservations, session, account } from './schema'; import { wishlists, items, user, savedWishlists, reservations, session, account } from "./schema";
export const itemsRelations = relations(items, ({one, many}) => ({ export const itemsRelations = relations(items, ({one, many}) => ({
wishlist: one(wishlists, { wishlist: one(wishlists, {
fields: [items.wishlistId], fields: [items.wishlistId],
references: [wishlists.id] references: [wishlists.id]
}), }),
reservations: many(reservations) reservations: many(reservations),
})); }));
export const wishlistsRelations = relations(wishlists, ({one, many}) => ({ export const wishlistsRelations = relations(wishlists, ({one, many}) => ({
@@ -15,14 +15,14 @@ export const wishlistsRelations = relations(wishlists, ({ one, many }) => ({
fields: [wishlists.userId], fields: [wishlists.userId],
references: [user.id] references: [user.id]
}), }),
savedWishlists: many(savedWishlists) savedWishlists: many(savedWishlists),
})); }));
export const userRelations = relations(user, ({many}) => ({ export const userRelations = relations(user, ({many}) => ({
wishlists: many(wishlists), wishlists: many(wishlists),
savedWishlists: many(savedWishlists), savedWishlists: many(savedWishlists),
sessions: many(session), sessions: many(session),
accounts: many(account) accounts: many(account),
})); }));
export const savedWishlistsRelations = relations(savedWishlists, ({one}) => ({ export const savedWishlistsRelations = relations(savedWishlists, ({one}) => ({
@@ -33,26 +33,26 @@ export const savedWishlistsRelations = relations(savedWishlists, ({ one }) => ({
wishlist: one(wishlists, { wishlist: one(wishlists, {
fields: [savedWishlists.wishlistId], fields: [savedWishlists.wishlistId],
references: [wishlists.id] references: [wishlists.id]
}) }),
})); }));
export const reservationsRelations = relations(reservations, ({one}) => ({ export const reservationsRelations = relations(reservations, ({one}) => ({
item: one(items, { item: one(items, {
fields: [reservations.itemId], fields: [reservations.itemId],
references: [items.id] references: [items.id]
}) }),
})); }));
export const sessionRelations = relations(session, ({one}) => ({ export const sessionRelations = relations(session, ({one}) => ({
user: one(user, { user: one(user, {
fields: [session.userId], fields: [session.userId],
references: [user.id] references: [user.id]
}) }),
})); }));
export const accountRelations = relations(account, ({one}) => ({ export const accountRelations = relations(account, ({one}) => ({
user: one(user, { user: one(user, {
fields: [account.userId], fields: [account.userId],
references: [user.id] references: [user.id]
}) }),
})); }));
+78 -126
View File
@@ -1,94 +1,74 @@
import { import { pgTable, foreignKey, text, numeric, boolean, timestamp, unique, primaryKey } from "drizzle-orm/pg-core"
pgTable, import { sql } from "drizzle-orm"
foreignKey,
text,
numeric,
boolean,
timestamp,
unique,
primaryKey
} from 'drizzle-orm/pg-core';
export const items = pgTable(
'items',
{ export const items = pgTable("items", {
id: text().primaryKey().notNull(), id: text().primaryKey().notNull(),
wishlistId: text('wishlist_id').notNull(), wishlistId: text("wishlist_id").notNull(),
title: text().notNull(), title: text().notNull(),
description: text(), description: text(),
link: text(), link: text(),
imageUrl: text('image_url'), imageUrl: text("image_url"),
price: numeric({ precision: 10, scale: 2 }), price: numeric({ precision: 10, scale: 2 }),
currency: text().default('DKK'), currency: text().default('DKK'),
color: text(), color: text(),
order: numeric().default('0').notNull(), order: numeric().default('0').notNull(),
isReserved: boolean('is_reserved').default(false).notNull(), isReserved: boolean("is_reserved").default(false).notNull(),
createdAt: timestamp('created_at', { mode: 'string' }).defaultNow().notNull(), createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
updatedAt: timestamp('updated_at', { mode: 'string' }).defaultNow().notNull() updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
}, }, (table) => [
(table) => [
foreignKey({ foreignKey({
columns: [table.wishlistId], columns: [table.wishlistId],
foreignColumns: [wishlists.id], foreignColumns: [wishlists.id],
name: 'items_wishlist_id_wishlists_id_fk' name: "items_wishlist_id_wishlists_id_fk"
}).onDelete('cascade') }).onDelete("cascade"),
] ]);
);
export const wishlists = pgTable( export const wishlists = pgTable("wishlists", {
'wishlists',
{
id: text().primaryKey().notNull(), id: text().primaryKey().notNull(),
userId: text('user_id'), userId: text("user_id"),
title: text().notNull(), title: text().notNull(),
description: text(), description: text(),
ownerToken: text('owner_token').notNull(), ownerToken: text("owner_token").notNull(),
publicToken: text('public_token').notNull(), publicToken: text("public_token").notNull(),
isFavorite: boolean('is_favorite').default(false).notNull(), isFavorite: boolean("is_favorite").default(false).notNull(),
color: text(), color: text(),
endDate: timestamp('end_date', { mode: 'string' }), endDate: timestamp("end_date", { mode: 'string' }),
createdAt: timestamp('created_at', { mode: 'string' }).defaultNow().notNull(), createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
updatedAt: timestamp('updated_at', { mode: 'string' }).defaultNow().notNull(), updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
theme: text().default('none') theme: text().default('none'),
}, }, (table) => [
(table) => [
foreignKey({ foreignKey({
columns: [table.userId], columns: [table.userId],
foreignColumns: [user.id], foreignColumns: [user.id],
name: 'wishlists_user_id_user_id_fk' name: "wishlists_user_id_user_id_fk"
}).onDelete('set null'), }).onDelete("set null"),
unique('wishlists_owner_token_unique').on(table.ownerToken), unique("wishlists_owner_token_unique").on(table.ownerToken),
unique('wishlists_public_token_unique').on(table.publicToken) unique("wishlists_public_token_unique").on(table.publicToken),
] ]);
);
export const savedWishlists = pgTable( export const savedWishlists = pgTable("saved_wishlists", {
'saved_wishlists',
{
id: text().primaryKey().notNull(), id: text().primaryKey().notNull(),
userId: text('user_id').notNull(), userId: text("user_id").notNull(),
wishlistId: text('wishlist_id').notNull(), wishlistId: text("wishlist_id").notNull(),
isFavorite: boolean('is_favorite').default(false).notNull(), isFavorite: boolean("is_favorite").default(false).notNull(),
createdAt: timestamp('created_at', { mode: 'string' }).defaultNow().notNull(), createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
ownerToken: text('owner_token') ownerToken: text("owner_token"),
}, }, (table) => [
(table) => [
foreignKey({ foreignKey({
columns: [table.userId], columns: [table.userId],
foreignColumns: [user.id], foreignColumns: [user.id],
name: 'saved_wishlists_user_id_user_id_fk' name: "saved_wishlists_user_id_user_id_fk"
}).onDelete('cascade'), }).onDelete("cascade"),
foreignKey({ foreignKey({
columns: [table.wishlistId], columns: [table.wishlistId],
foreignColumns: [wishlists.id], foreignColumns: [wishlists.id],
name: 'saved_wishlists_wishlist_id_wishlists_id_fk' name: "saved_wishlists_wishlist_id_wishlists_id_fk"
}).onDelete('cascade') }).onDelete("cascade"),
] ]);
);
export const user = pgTable( export const user = pgTable("user", {
'user',
{
id: text().primaryKey().notNull(), id: text().primaryKey().notNull(),
name: text(), name: text(),
email: text(), email: text(),
@@ -96,90 +76,62 @@ export const user = pgTable(
image: text(), image: text(),
password: text(), password: text(),
username: text(), username: text(),
dashboardTheme: text('dashboard_theme').default('none'), dashboardTheme: text("dashboard_theme").default('none'),
dashboardColor: text('dashboard_color'), }, (table) => [
lastLogin: timestamp('last_login', { mode: 'string' }), unique("user_email_unique").on(table.email),
createdAt: timestamp('created_at', { mode: 'string' }).defaultNow().notNull(), unique("user_username_unique").on(table.username),
updatedAt: timestamp('updated_at', { mode: 'string' }).defaultNow().notNull() ]);
},
(table) => [
unique('user_email_unique').on(table.email),
unique('user_username_unique').on(table.username)
]
);
export const reservations = pgTable( export const reservations = pgTable("reservations", {
'reservations',
{
id: text().primaryKey().notNull(), id: text().primaryKey().notNull(),
itemId: text('item_id').notNull(), itemId: text("item_id").notNull(),
reserverName: text('reserver_name'), reserverName: text("reserver_name"),
createdAt: timestamp('created_at', { mode: 'string' }).defaultNow().notNull() createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
}, }, (table) => [
(table) => [
foreignKey({ foreignKey({
columns: [table.itemId], columns: [table.itemId],
foreignColumns: [items.id], foreignColumns: [items.id],
name: 'reservations_item_id_items_id_fk' name: "reservations_item_id_items_id_fk"
}).onDelete('cascade') }).onDelete("cascade"),
] ]);
);
export const session = pgTable( export const session = pgTable("session", {
'session',
{
sessionToken: text().primaryKey().notNull(), sessionToken: text().primaryKey().notNull(),
userId: text().notNull(), userId: text().notNull(),
expires: timestamp({ mode: 'string' }).notNull() expires: timestamp({ mode: 'string' }).notNull(),
}, }, (table) => [
(table) => [
foreignKey({ foreignKey({
columns: [table.userId], columns: [table.userId],
foreignColumns: [user.id], foreignColumns: [user.id],
name: 'session_userId_user_id_fk' name: "session_userId_user_id_fk"
}).onDelete('cascade') }).onDelete("cascade"),
] ]);
);
export const verificationToken = pgTable( export const verificationToken = pgTable("verificationToken", {
'verificationToken',
{
identifier: text().notNull(), identifier: text().notNull(),
token: text().notNull(), token: text().notNull(),
expires: timestamp({ mode: 'string' }).notNull() expires: timestamp({ mode: 'string' }).notNull(),
}, }, (table) => [
(table) => [ primaryKey({ columns: [table.identifier, table.token], name: "verificationToken_identifier_token_pk"}),
primaryKey({ ]);
columns: [table.identifier, table.token],
name: 'verificationToken_identifier_token_pk'
})
]
);
export const account = pgTable( export const account = pgTable("account", {
'account',
{
userId: text().notNull(), userId: text().notNull(),
type: text().notNull(), type: text().notNull(),
provider: text().notNull(), provider: text().notNull(),
providerAccountId: text().notNull(), providerAccountId: text().notNull(),
refreshToken: text('refresh_token'), refreshToken: text("refresh_token"),
accessToken: text('access_token'), accessToken: text("access_token"),
expiresAt: numeric('expires_at'), expiresAt: numeric("expires_at"),
tokenType: text('token_type'), tokenType: text("token_type"),
scope: text(), scope: text(),
idToken: text('id_token'), idToken: text("id_token"),
sessionState: text('session_state') sessionState: text("session_state"),
}, }, (table) => [
(table) => [
foreignKey({ foreignKey({
columns: [table.userId], columns: [table.userId],
foreignColumns: [user.id], foreignColumns: [user.id],
name: 'account_userId_user_id_fk' name: "account_userId_user_id_fk"
}).onDelete('cascade'), }).onDelete("cascade"),
primaryKey({ primaryKey({ columns: [table.provider, table.providerAccountId], name: "account_provider_providerAccountId_pk"}),
columns: [table.provider, table.providerAccountId], ]);
name: 'account_provider_providerAccountId_pk'
})
]
);
-47
View File
@@ -1,47 +0,0 @@
import js from '@eslint/js';
import ts from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import svelteParser from 'svelte-eslint-parser';
/** @type {import('eslint').Linter.Config[]} */
export default [
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
},
rules: {
// Disable overly strict Svelte navigation rules
'svelte/no-navigation-without-resolve': 'off',
'svelte/no-navigation-without-base': 'off'
}
},
// Configuration for .svelte files
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
// Configuration for .svelte.ts files (Svelte runes in TypeScript)
{
files: ['**/*.svelte.ts'],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
];
+3 -13
View File
@@ -14,12 +14,9 @@
"db:generate": "drizzle-kit generate", "db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate", "db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push", "db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio", "db:studio": "drizzle-kit studio"
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.25.0",
"@lucide/svelte": "^0.544.0", "@lucide/svelte": "^0.544.0",
"@sveltejs/adapter-auto": "^7.0.0", "@sveltejs/adapter-auto": "^7.0.0",
"@sveltejs/adapter-node": "^5.4.0", "@sveltejs/adapter-node": "^5.4.0",
@@ -28,20 +25,13 @@
"@tailwindcss/vite": "^4.1.17", "@tailwindcss/vite": "^4.1.17",
"@types/bcrypt": "^6.0.0", "@types/bcrypt": "^6.0.0",
"drizzle-kit": "^0.31.7", "drizzle-kit": "^0.31.7",
"eslint": "^9.25.0",
"eslint-plugin-svelte": "^3.5.1",
"globals": "^16.0.0",
"patch-package": "^8.0.1", "patch-package": "^8.0.1",
"postinstall-postinstall": "^2.1.0", "postinstall-postinstall": "^2.1.0",
"prettier": "^3.5.3",
"prettier-plugin-svelte": "^3.3.3",
"svelte": "^5.43.8", "svelte": "^5.43.8",
"svelte-check": "^4.3.4", "svelte-check": "^4.3.4",
"svelte-eslint-parser": "^1.6.0",
"tailwindcss": "^4.1.17", "tailwindcss": "^4.1.17",
"tw-animate-css": "^1.4.0", "tw-animate-css": "^1.4.0",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"typescript-eslint": "^8.31.0",
"vite": "^7.2.2" "vite": "^7.2.2"
}, },
"dependencies": { "dependencies": {
@@ -54,10 +44,10 @@
"bits-ui": "^2.14.4", "bits-ui": "^2.14.4",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"drizzle-orm": "^0.44.7", "drizzle-orm": "^0.44.7",
"lucide-svelte": "^0.554.0",
"postgres": "^3.4.7", "postgres": "^3.4.7",
"svelte-dnd-action": "^0.9.67", "svelte-dnd-action": "^0.9.67",
"tailwind-merge": "^3.4.0", "tailwind-merge": "^3.4.0",
"tailwind-variants": "^3.2.2", "tailwind-variants": "^3.2.2"
"zod": "^3.23.8"
} }
} }
-3975
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 KiB

+2 -4
View File
@@ -1,6 +1,6 @@
@import 'tailwindcss'; @import "tailwindcss";
@import 'tw-animate-css'; @import "tw-animate-css";
@custom-variant dark (&:is(.dark *)); @custom-variant dark (&:is(.dark *));
@@ -13,7 +13,6 @@
} }
:root { :root {
color-scheme: light;
--radius: 0.625rem; --radius: 0.625rem;
--background: oklch(1 0 0); --background: oklch(1 0 0);
--foreground: oklch(0.129 0.042 264.695); --foreground: oklch(0.129 0.042 264.695);
@@ -49,7 +48,6 @@
} }
.dark { .dark {
color-scheme: dark;
--background: oklch(0.129 0.042 264.695); --background: oklch(0.129 0.042 264.695);
--foreground: oklch(0.984 0.003 247.858); --foreground: oklch(0.984 0.003 247.858);
--card: oklch(0.208 0.042 265.755); --card: oklch(0.208 0.042 265.755);
+1 -2
View File
@@ -6,8 +6,7 @@
<script> <script>
(function() { (function() {
const theme = localStorage.getItem('theme') || 'system'; const theme = localStorage.getItem('theme') || 'system';
const isDark = const isDark = theme === 'dark' ||
theme === 'dark' ||
(theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); (theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
if (isDark) { if (isDark) {
document.documentElement.classList.add('dark'); document.documentElement.classList.add('dark');
+7 -18
View File
@@ -4,25 +4,17 @@ import Credentials from '@auth/core/providers/credentials';
import Google from '@auth/core/providers/google'; import Google from '@auth/core/providers/google';
import type { OAuthConfig } from '@auth/core/providers'; import type { OAuthConfig } from '@auth/core/providers';
import { db } from '$lib/server/db'; import { db } from '$lib/server/db';
import { users } from '$lib/db/schema'; import { users } from '$lib/server/schema';
import { eq } from 'drizzle-orm'; import { eq } from 'drizzle-orm';
import bcrypt from 'bcrypt'; import bcrypt from 'bcrypt';
import { env } from '$env/dynamic/private'; import { env } from '$env/dynamic/private';
import type { SvelteKitAuthConfig } from '@auth/sveltekit'; import type { SvelteKitAuthConfig } from '@auth/sveltekit';
interface AuthentikProfile {
sub: string;
email: string;
name?: string;
preferred_username?: string;
picture?: string;
}
function Authentik(config: { function Authentik(config: {
clientId: string; clientId: string;
clientSecret: string; clientSecret: string;
issuer: string; issuer: string;
}): OAuthConfig<AuthentikProfile> { }): OAuthConfig<any> {
return { return {
id: 'authentik', id: 'authentik',
name: 'Authentik', name: 'Authentik',
@@ -89,7 +81,10 @@ const authConfig: SvelteKitAuthConfig = {
return null; return null;
} }
const isValidPassword = await bcrypt.compare(credentials.password as string, user.password); const isValidPassword = await bcrypt.compare(
credentials.password as string,
user.password
);
if (!isValidPassword) { if (!isValidPassword) {
return null; return null;
@@ -108,12 +103,6 @@ const authConfig: SvelteKitAuthConfig = {
signIn: '/signin' signIn: '/signin'
}, },
callbacks: { callbacks: {
async signIn({ user }) {
if (user?.id) {
await db.update(users).set({ lastLogin: new Date() }).where(eq(users.id, user.id));
}
return true;
},
async jwt({ token, user }) { async jwt({ token, user }) {
if (user) { if (user) {
token.id = user.id; token.id = user.id;
@@ -128,7 +117,7 @@ const authConfig: SvelteKitAuthConfig = {
} }
}, },
secret: env.AUTH_SECRET, secret: env.AUTH_SECRET,
trustHost: env.AUTH_TRUST_HOST === 'true' trustHost: true
}; };
export const { handle, signIn, signOut } = SvelteKitAuth(authConfig); export const { handle, signIn, signOut } = SvelteKitAuth(authConfig);
@@ -1,34 +1,27 @@
<script lang="ts"> <script lang="ts">
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import WishlistSection from '$lib/components/dashboard/WishlistSection.svelte'; import WishlistSection from '$lib/components/dashboard/WishlistSection.svelte';
import { import { getLocalWishlists, forgetLocalWishlist, toggleLocalFavorite, type LocalWishlist } from '$lib/utils/localWishlists';
getLocalWishlists,
forgetLocalWishlist,
toggleLocalFavorite,
type LocalWishlist
} from '$lib/utils/localWishlists';
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
import { Star } from '@lucide/svelte'; import { Star } from 'lucide-svelte';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
let { let {
isAuthenticated = false, isAuthenticated = false
fallbackColor = null,
fallbackTheme = null
}: { }: {
isAuthenticated?: boolean; isAuthenticated?: boolean;
fallbackColor?: string | null;
fallbackTheme?: string | null;
} = $props(); } = $props();
const t = $derived(languageStore.t); const t = $derived(languageStore.t);
let localWishlists = $state<LocalWishlist[]>([]); let localWishlists = $state<LocalWishlist[]>([]);
let enrichedWishlists = $state<Array<Record<string, unknown>>>([]); let enrichedWishlists = $state<any[]>([]);
// Load local wishlists on mount and fetch their data from server
onMount(async () => { onMount(async () => {
localWishlists = getLocalWishlists(); localWishlists = getLocalWishlists();
// Fetch full wishlist data for each local wishlist
const promises = localWishlists.map(async (local) => { const promises = localWishlists.map(async (local) => {
try { try {
const response = await fetch(`/api/wishlist/${local.ownerToken}`); const response = await fetch(`/api/wishlist/${local.ownerToken}`);
@@ -42,6 +35,7 @@
} catch (error) { } catch (error) {
console.error('Failed to fetch wishlist data:', error); console.error('Failed to fetch wishlist data:', error);
} }
// Fallback to local data if fetch fails
return { return {
id: local.ownerToken, id: local.ownerToken,
title: local.title, title: local.title,
@@ -106,37 +100,33 @@
// Description depends on authentication status // Description depends on authentication status
const sectionDescription = $derived(() => { const sectionDescription = $derived(() => {
if (isAuthenticated) { if (isAuthenticated) {
return ( return t.dashboard.localWishlistsAuthDescription || "Wishlists stored in your browser that haven't been claimed yet.";
t.dashboard.localWishlistsAuthDescription ||
"Wishlists stored in your browser that haven't been claimed yet."
);
} }
return ( return t.dashboard.localWishlistsDescription || "Wishlists stored in your browser. Sign in to save them permanently.";
t.dashboard.localWishlistsDescription ||
'Wishlists stored in your browser. Sign in to save them permanently.'
);
}); });
</script> </script>
<WishlistSection <WishlistSection
title={t.dashboard.localWishlists || 'Local Wishlists'} title={t.dashboard.localWishlists || "Local Wishlists"}
description={sectionDescription()} description={sectionDescription()}
items={transformedWishlists()} items={transformedWishlists()}
emptyMessage={t.dashboard.emptyLocalWishlists || 'No local wishlists yet'} emptyMessage={t.dashboard.emptyLocalWishlists || "No local wishlists yet"}
emptyActionLabel={t.dashboard.createLocalWishlist || 'Create local wishlist'} emptyActionLabel={t.dashboard.createLocalWishlist || "Create local wishlist"}
emptyActionHref="/" emptyActionHref="/"
showCreateButton={true} showCreateButton={true}
{fallbackColor}
{fallbackTheme}
> >
{#snippet actions(wishlist: Record<string, unknown>, unlocked: boolean)} {#snippet actions(wishlist, unlocked)}
<div class="flex gap-2 flex-wrap"> <div class="flex gap-2 flex-wrap">
<Button size="sm" variant="outline" onclick={() => handleToggleFavorite(wishlist.ownerToken as string)}> <Button
<Star class={wishlist.isFavorite ? 'fill-yellow-500 text-yellow-500' : ''} /> size="sm"
variant="outline"
onclick={() => handleToggleFavorite(wishlist.ownerToken)}
>
<Star class={wishlist.isFavorite ? "fill-yellow-500 text-yellow-500" : ""} />
</Button> </Button>
<Button <Button
size="sm" size="sm"
onclick={() => (window.location.href = `/wishlist/${wishlist.ownerToken as string}/edit`)} onclick={() => (window.location.href = `/wishlist/${wishlist.ownerToken}/edit`)}
> >
{t.dashboard.manage} {t.dashboard.manage}
</Button> </Button>
@@ -145,15 +135,19 @@
variant="outline" variant="outline"
onclick={() => { onclick={() => {
navigator.clipboard.writeText( navigator.clipboard.writeText(
`${window.location.origin}/wishlist/${wishlist.publicToken as string}` `${window.location.origin}/wishlist/${wishlist.publicToken}`
); );
}} }}
> >
{t.dashboard.copyLink} {t.dashboard.copyLink}
</Button> </Button>
{#if unlocked} {#if unlocked}
<Button size="sm" variant="destructive" onclick={() => handleForget(wishlist.ownerToken as string)}> <Button
{t.dashboard.forget || 'Forget'} size="sm"
variant="destructive"
onclick={() => handleForget(wishlist.ownerToken)}
>
{t.dashboard.forget || "Forget"}
</Button> </Button>
{/if} {/if}
</div> </div>
@@ -1,11 +1,6 @@
<script lang="ts"> <script lang="ts">
import { import { Button } from '$lib/components/ui/button';
Card, import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '$lib/components/ui/card';
CardContent,
CardDescription,
CardHeader,
CardTitle
} from '$lib/components/ui/card';
import type { Snippet } from 'svelte'; import type { Snippet } from 'svelte';
import { getCardStyle } from '$lib/utils/colors'; import { getCardStyle } from '$lib/utils/colors';
import ThemeCard from '$lib/components/themes/ThemeCard.svelte'; import ThemeCard from '$lib/components/themes/ThemeCard.svelte';
@@ -16,8 +11,6 @@
itemCount, itemCount,
color = null, color = null,
theme = null, theme = null,
fallbackColor = null,
fallbackTheme = null,
children children
}: { }: {
title: string; title: string;
@@ -25,18 +18,14 @@
itemCount: number; itemCount: number;
color?: string | null; color?: string | null;
theme?: string | null; theme?: string | null;
fallbackColor?: string | null;
fallbackTheme?: string | null;
children?: Snippet; children?: Snippet;
} = $props(); } = $props();
const finalColor = $derived(color || fallbackColor); const cardStyle = $derived(getCardStyle(color));
const finalTheme = $derived(theme || fallbackTheme);
const cardStyle = $derived(getCardStyle(color, fallbackColor));
</script> </script>
<Card style={cardStyle} class="h-full flex flex-col relative overflow-hidden"> <Card style={cardStyle} class="h-full flex flex-col relative overflow-hidden">
<ThemeCard themeName={finalTheme} color={finalColor} /> <ThemeCard themeName={theme} color={color} />
<CardHeader class="flex-shrink-0 relative z-10"> <CardHeader class="flex-shrink-0 relative z-10">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-1 sm:gap-2"> <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-1 sm:gap-2">
<CardTitle class="text-lg flex items-center gap-2 flex-1 min-w-0"> <CardTitle class="text-lg flex items-center gap-2 flex-1 min-w-0">
@@ -1,16 +1,9 @@
<script lang="ts"> <script lang="ts">
import { import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '$lib/components/ui/card';
Card, import { Button } from '$lib/components/ui/button';
CardContent,
CardDescription,
CardHeader,
CardTitle
} from '$lib/components/ui/card';
import EmptyState from '$lib/components/layout/EmptyState.svelte'; import EmptyState from '$lib/components/layout/EmptyState.svelte';
import type { Snippet } from 'svelte'; import type { Snippet } from 'svelte';
import { flip } from 'svelte/animate'; import { flip } from 'svelte/animate';
import { getCardStyle } from '$lib/utils/colors';
import ThemeCard from '$lib/components/themes/ThemeCard.svelte';
let { let {
title, title,
@@ -20,28 +13,22 @@
emptyDescription, emptyDescription,
emptyActionLabel, emptyActionLabel,
emptyActionHref, emptyActionHref,
fallbackColor = null,
fallbackTheme = null,
headerAction, headerAction,
searchBar, searchBar,
children children
}: { }: {
title: string; title: string;
description: string; description: string;
items: Array<Record<string, unknown>>; items: any[];
emptyMessage: string; emptyMessage: string;
emptyDescription?: string; emptyDescription?: string;
emptyActionLabel?: string; emptyActionLabel?: string;
emptyActionHref?: string; emptyActionHref?: string;
fallbackColor?: string | null;
fallbackTheme?: string | null;
headerAction?: Snippet; headerAction?: Snippet;
searchBar?: Snippet; searchBar?: Snippet;
children: Snippet<[Record<string, unknown>]>; children: Snippet<[any]>;
} = $props(); } = $props();
const cardStyle = $derived(getCardStyle(fallbackColor, null));
let scrollContainer: HTMLElement | null = null; let scrollContainer: HTMLElement | null = null;
function handleWheel(event: WheelEvent) { function handleWheel(event: WheelEvent) {
@@ -57,9 +44,8 @@
} }
</script> </script>
<Card style={cardStyle} class="relative overflow-hidden"> <Card>
<ThemeCard themeName={fallbackTheme} color={fallbackColor} showPattern={false} /> <CardHeader>
<CardHeader class="relative z-10">
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"> <div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div class="flex-1 min-w-0"> <div class="flex-1 min-w-0">
<CardTitle>{title}</CardTitle> <CardTitle>{title}</CardTitle>
@@ -77,7 +63,7 @@
</div> </div>
{/if} {/if}
</CardHeader> </CardHeader>
<CardContent class="relative z-10"> <CardContent>
{#if items && items.length > 0} {#if items && items.length > 0}
<div <div
bind:this={scrollContainer} bind:this={scrollContainer}
@@ -2,22 +2,14 @@
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import WishlistGrid from '$lib/components/dashboard/WishlistGrid.svelte'; import WishlistGrid from '$lib/components/dashboard/WishlistGrid.svelte';
import WishlistCard from '$lib/components/dashboard/WishlistCard.svelte'; import WishlistCard from '$lib/components/dashboard/WishlistCard.svelte';
import { enhance } from '$app/forms';
import { Star } from 'lucide-svelte';
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
import SearchBar from '$lib/components/ui/SearchBar.svelte'; import SearchBar from '$lib/components/ui/SearchBar.svelte';
import UnlockButton from '$lib/components/ui/UnlockButton.svelte'; import UnlockButton from '$lib/components/ui/UnlockButton.svelte';
import type { Snippet } from 'svelte'; import type { Snippet } from 'svelte';
interface WishlistItem { type WishlistItem = any; // You can make this more specific based on your types
id?: string;
wishlist?: Record<string, unknown>;
title?: string;
description?: string;
isFavorite?: boolean;
endDate?: string | Date;
createdAt?: string | Date;
items?: Array<{ title: string }>;
user?: { name?: string; username?: string };
}
let { let {
title, title,
@@ -29,8 +21,6 @@
emptyActionHref, emptyActionHref,
showCreateButton = false, showCreateButton = false,
hideIfEmpty = false, hideIfEmpty = false,
fallbackColor = null,
fallbackTheme = null,
actions actions
}: { }: {
title: string; title: string;
@@ -42,8 +32,6 @@
emptyActionHref?: string; emptyActionHref?: string;
showCreateButton?: boolean; showCreateButton?: boolean;
hideIfEmpty?: boolean; hideIfEmpty?: boolean;
fallbackColor?: string | null;
fallbackTheme?: string | null;
actions: Snippet<[WishlistItem, boolean]>; // item, unlocked actions: Snippet<[WishlistItem, boolean]>; // item, unlocked
} = $props(); } = $props();
@@ -56,7 +44,7 @@
const filteredItems = $derived(() => { const filteredItems = $derived(() => {
if (!searchQuery.trim()) return items; if (!searchQuery.trim()) return items;
return items.filter((item) => { return items.filter(item => {
const title = item.title || item.wishlist?.title || ''; const title = item.title || item.wishlist?.title || '';
const description = item.description || item.wishlist?.description || ''; const description = item.description || item.wishlist?.description || '';
const query = searchQuery.toLowerCase(); const query = searchQuery.toLowerCase();
@@ -97,20 +85,16 @@
function formatEndDate(date: Date | string | null): string | null { function formatEndDate(date: Date | string | null): string | null {
if (!date) return null; if (!date) return null;
const d = new Date(date); const d = new Date(date);
return d.toLocaleDateString(languageStore.t.date.format.short, { return d.toLocaleDateString(languageStore.t.date.format.short, { year: 'numeric', month: 'short', day: 'numeric' });
year: 'numeric',
month: 'short',
day: 'numeric'
});
} }
function getWishlistDescription(item: WishlistItem): string | null { function getWishlistDescription(item: any): string | null {
const wishlist = item.wishlist || item; const wishlist = item.wishlist || item;
if (!wishlist) return null; if (!wishlist) return null;
const lines: string[] = []; const lines: string[] = [];
const topItems = wishlist.items?.slice(0, 3).map((i: { title: string }) => i.title) || []; const topItems = wishlist.items?.slice(0, 3).map((i: any) => i.title) || [];
if (topItems.length > 0) { if (topItems.length > 0) {
lines.push(topItems.join(', ')); lines.push(topItems.join(', '));
} }
@@ -142,8 +126,6 @@
{emptyDescription} {emptyDescription}
{emptyActionLabel} {emptyActionLabel}
{emptyActionHref} {emptyActionHref}
{fallbackColor}
{fallbackTheme}
> >
{#snippet headerAction()} {#snippet headerAction()}
<div class="flex flex-col sm:flex-row gap-2"> <div class="flex flex-col sm:flex-row gap-2">
@@ -168,8 +150,6 @@
itemCount={wishlist.items?.length || 0} itemCount={wishlist.items?.length || 0}
color={wishlist.color} color={wishlist.color}
theme={wishlist.theme} theme={wishlist.theme}
{fallbackColor}
{fallbackTheme}
> >
{@render actions(item, unlocked)} {@render actions(item, unlocked)}
</WishlistCard> </WishlistCard>
@@ -3,35 +3,33 @@
import { ThemeToggle } from '$lib/components/ui/theme-toggle'; import { ThemeToggle } from '$lib/components/ui/theme-toggle';
import { LanguageToggle } from '$lib/components/ui/language-toggle'; import { LanguageToggle } from '$lib/components/ui/language-toggle';
import ThemePicker from '$lib/components/ui/theme-picker.svelte'; import ThemePicker from '$lib/components/ui/theme-picker.svelte';
import ColorPicker from '$lib/components/ui/ColorPicker.svelte';
import { signOut } from '@auth/sveltekit/client'; import { signOut } from '@auth/sveltekit/client';
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
import { enhance } from '$app/forms';
let { let {
userName, userName,
userEmail, userEmail,
dashboardTheme = 'none', dashboardTheme = 'none',
dashboardColor = null,
isAuthenticated = false, isAuthenticated = false,
onThemeUpdate, onThemeUpdate
onColorUpdate
}: { }: {
userName?: string | null; userName?: string | null;
userEmail?: string | null; userEmail?: string | null;
dashboardTheme?: string; dashboardTheme?: string;
dashboardColor?: string | null;
isAuthenticated?: boolean; isAuthenticated?: boolean;
onThemeUpdate?: (theme: string | null) => void; onThemeUpdate?: (theme: string | null) => void;
onColorUpdate?: (color: string | null) => void;
} = $props(); } = $props();
const t = $derived(languageStore.t); const t = $derived(languageStore.t);
async function handleThemeChange(theme: string) { async function handleThemeChange(theme: string) {
// Update theme immediately for instant visual feedback
if (onThemeUpdate) { if (onThemeUpdate) {
onThemeUpdate(theme); onThemeUpdate(theme);
} }
// Only submit to database for authenticated users
if (isAuthenticated) { if (isAuthenticated) {
const formData = new FormData(); const formData = new FormData();
formData.append('theme', theme); formData.append('theme', theme);
@@ -42,54 +40,25 @@
}); });
} }
} }
let localColor = $derived(dashboardColor);
async function handleColorChange() {
if (onColorUpdate) {
onColorUpdate(localColor);
}
if (isAuthenticated) {
const formData = new FormData();
if (localColor) {
formData.append('color', localColor);
}
await fetch('?/updateDashboardColor', {
method: 'POST',
body: formData
});
}
}
</script> </script>
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"> <div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div class="flex-1 min-w-0"> <div class="flex-1 min-w-0">
<h1 class="text-3xl font-bold">{t.nav.dashboard}</h1> <h1 class="text-3xl font-bold">{t.nav.dashboard}</h1>
{#if isAuthenticated} {#if isAuthenticated}
<p class="text-muted-foreground truncate"> <p class="text-muted-foreground truncate">{t.dashboard.welcomeBack}, {userName || userEmail}</p>
{t.dashboard.welcomeBack}, {userName || userEmail}
</p>
{:else} {:else}
<p class="text-muted-foreground"> <p class="text-muted-foreground">{t.dashboard.anonymousDashboard || "Your local wishlists"}</p>
{t.dashboard.anonymousDashboard || 'Your local wishlists'}
</p>
{/if} {/if}
</div> </div>
<div class="flex items-center gap-1 sm:gap-2 flex-shrink-0"> <div class="flex items-center gap-1 sm:gap-2 flex-shrink-0">
<ColorPicker bind:color={localColor} onchange={handleColorChange} size="sm" /> <ThemePicker value={dashboardTheme} onValueChange={handleThemeChange} />
<ThemePicker value={dashboardTheme} onValueChange={handleThemeChange} color={localColor} /> <LanguageToggle />
<LanguageToggle color={localColor} />
<ThemeToggle /> <ThemeToggle />
{#if isAuthenticated} {#if isAuthenticated}
<Button variant="outline" onclick={() => signOut({ callbackUrl: '/' })} <Button variant="outline" onclick={() => signOut({ callbackUrl: '/' })}>{t.auth.signOut}</Button>
>{t.auth.signOut}</Button
>
{:else} {:else}
<Button variant="outline" onclick={() => (window.location.href = '/signin')} <Button variant="outline" onclick={() => (window.location.href = '/signin')}>{t.auth.signIn}</Button>
>{t.auth.signIn}</Button
>
{/if} {/if}
</div> </div>
</div> </div>
+7 -17
View File
@@ -2,15 +2,15 @@
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import { ThemeToggle } from '$lib/components/ui/theme-toggle'; import { ThemeToggle } from '$lib/components/ui/theme-toggle';
import { LanguageToggle } from '$lib/components/ui/language-toggle'; import { LanguageToggle } from '$lib/components/ui/language-toggle';
import { LayoutDashboard } from '@lucide/svelte'; import { LayoutDashboard } from 'lucide-svelte';
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
let { let {
isAuthenticated = false, isAuthenticated = false,
color = null showDashboardLink = false
}: { }: {
isAuthenticated?: boolean; isAuthenticated?: boolean;
color?: string | null; showDashboardLink?: boolean;
} = $props(); } = $props();
const t = $derived(languageStore.t); const t = $derived(languageStore.t);
@@ -18,27 +18,17 @@
<nav class="flex items-center gap-1 sm:gap-2 mb-6 w-full"> <nav class="flex items-center gap-1 sm:gap-2 mb-6 w-full">
{#if isAuthenticated} {#if isAuthenticated}
<Button <Button variant="outline" size="sm" onclick={() => (window.location.href = '/dashboard')} class="px-2 sm:px-3">
variant="outline"
size="sm"
onclick={() => (window.location.href = '/dashboard')}
class="px-2 sm:px-3"
>
<LayoutDashboard class="w-4 h-4" /> <LayoutDashboard class="w-4 h-4" />
<span class="hidden sm:inline sm:ml-2">{t.nav.dashboard}</span> <span class="hidden sm:inline sm:ml-2">{t.nav.dashboard}</span>
</Button> </Button>
{:else} {:else}
<Button <Button variant="outline" size="sm" onclick={() => (window.location.href = '/signin')} class="px-2 sm:px-3">
variant="outline"
size="sm"
onclick={() => (window.location.href = '/signin')}
class="px-2 sm:px-3"
>
{t.auth.signIn} {t.auth.signIn}
</Button> </Button>
{/if} {/if}
<div class="ml-auto flex items-center gap-1 sm:gap-2"> <div class="ml-auto flex items-center gap-1 sm:gap-2">
<LanguageToggle {color} /> <LanguageToggle />
<ThemeToggle size="sm" {color} /> <ThemeToggle />
</div> </div>
</nav> </nav>
+1 -14
View File
@@ -1,8 +1,6 @@
<script lang="ts"> <script lang="ts">
import type { Snippet } from 'svelte'; import type { Snippet } from 'svelte';
import ThemeBackground from '$lib/components/themes/ThemeBackground.svelte'; import ThemeBackground from '$lib/components/themes/ThemeBackground.svelte';
import { hexToRgba } from '$lib/utils/colors';
import { themeStore } from '$lib/stores/theme.svelte';
let { let {
children, children,
@@ -15,20 +13,9 @@
theme?: string | null; theme?: string | null;
themeColor?: string | null; themeColor?: string | null;
} = $props(); } = $props();
const backgroundStyle = $derived.by(() => {
if (!themeColor) return '';
const isDark = themeStore.getResolvedTheme() === 'dark';
const tintedColor = hexToRgba(themeColor, 0.15);
return isDark
? `background: linear-gradient(${tintedColor}, ${tintedColor}), #000000;`
: `background-color: ${tintedColor};`;
});
</script> </script>
<div class="min-h-screen p-4 md:p-8 relative overflow-hidden" style={backgroundStyle}> <div class="min-h-screen p-4 md:p-8 relative overflow-hidden">
<ThemeBackground themeName={theme} color={themeColor} /> <ThemeBackground themeName={theme} color={themeColor} />
<div class="max-w-{maxWidth} mx-auto space-y-6 relative z-10"> <div class="max-w-{maxWidth} mx-auto space-y-6 relative z-10">
{@render children()} {@render children()}
@@ -1,24 +1,22 @@
<script lang="ts"> <script lang="ts">
import TopPattern from './svgs/TopPattern.svelte'; import TopPattern from './svgs/TopPattern.svelte';
import BottomPattern from './svgs/BottomPattern.svelte'; import BottomPattern from './svgs/BottomPattern.svelte';
import { getTheme, PATTERN_OPACITY } from '$lib/utils/themes'; import { getTheme, getPatternColor, PATTERN_OPACITY } from '$lib/utils/themes';
import { themeStore } from '$lib/stores/theme.svelte';
let { let {
themeName, themeName,
showTop = true, showTop = true,
showBottom = true showBottom = true,
color
}: { }: {
themeName?: string | null; themeName?: string | null;
showTop?: boolean; showTop?: boolean;
showBottom?: boolean; showBottom?: boolean;
color?: string;
} = $props(); } = $props();
const theme = $derived(getTheme(themeName)); const theme = $derived(getTheme(themeName));
const patternColor = $derived.by(() => { const patternColor = $derived(getPatternColor(color));
const isDark = themeStore.getResolvedTheme() === 'dark';
return isDark ? '#FFFFFF' : '#000000';
});
</script> </script>
{#if theme.pattern !== 'none'} {#if theme.pattern !== 'none'}
+6 -10
View File
@@ -1,23 +1,19 @@
<script lang="ts"> <script lang="ts">
import CardPattern from './svgs/CardPattern.svelte'; import CardPattern from './svgs/CardPattern.svelte';
import { getTheme, PATTERN_OPACITY } from '$lib/utils/themes'; import { getTheme, getPatternColor, PATTERN_OPACITY } from '$lib/utils/themes';
import { themeStore } from '$lib/stores/theme.svelte';
let { let {
themeName, themeName,
showPattern = true color
}: { }: {
themeName?: string | null; themeName?: string;
showPattern?: boolean; color?: string;
} = $props(); } = $props();
const theme = $derived(getTheme(themeName)); const theme = $derived(getTheme(themeName));
const patternColor = $derived.by(() => { const patternColor = $derived(getPatternColor(color));
const isDark = themeStore.getResolvedTheme() === 'dark';
return isDark ? '#FFFFFF' : '#000000';
});
</script> </script>
{#if showPattern && theme.pattern !== 'none'} {#if theme.pattern !== 'none'}
<CardPattern pattern={theme.pattern} color={patternColor} opacity={PATTERN_OPACITY} /> <CardPattern pattern={theme.pattern} color={patternColor} opacity={PATTERN_OPACITY} />
{/if} {/if}
@@ -16,15 +16,17 @@
{#if pattern !== 'none'} {#if pattern !== 'none'}
<div <div
class="fixed bottom-0 left-0 right-0 pointer-events-none overflow-hidden z-0" class="absolute bottom-0 left-0 right-0 pointer-events-none overflow-hidden"
style=" style="
mask-image: url({patternPath}); mask-image: url({patternPath});
-webkit-mask-image: url({patternPath});
mask-size: cover; mask-size: cover;
mask-repeat: no-repeat; -webkit-mask-size: cover;
mask-position: left bottom; mask-repeat: repeat;
-webkit-mask-repeat: repeat;
background-color: {color}; background-color: {color};
opacity: {opacity}; opacity: {opacity};
height: 100vh; height: 200px;
" "
/> />
{/if} {/if}
@@ -16,15 +16,18 @@
{#if pattern !== 'none'} {#if pattern !== 'none'}
<div <div
class="absolute bottom-0 top-0 right-0 pointer-events-none overflow-hidden rounded-b-lg" class="absolute bottom-0 right-0 pointer-events-none overflow-hidden rounded-b-lg"
style=" style="
mask-image: url({patternPath}); mask-image: url({patternPath});
-webkit-mask-image: url({patternPath});
mask-size: cover; mask-size: cover;
mask-repeat: no-repeat; -webkit-mask-size: cover;
mask-position: right bottom; mask-repeat: repeat;
-webkit-mask-repeat: repeat;
background-color: {color}; background-color: {color};
opacity: {opacity}; opacity: {opacity};
width: 100%; width: 200px;
height: 200px;
" "
/> />
{/if} {/if}
@@ -16,15 +16,17 @@
{#if pattern !== 'none'} {#if pattern !== 'none'}
<div <div
class="fixed top-0 right-0 left-0 pointer-events-none z-0" class="absolute top-0 left-0 right-0 pointer-events-none overflow-hidden"
style=" style="
mask-image: url({patternPath}); mask-image: url({patternPath});
-webkit-mask-image: url({patternPath});
mask-size: cover; mask-size: cover;
mask-repeat: no-repeat; -webkit-mask-size: cover;
mask-position: right top; mask-repeat: repeat;
-webkit-mask-repeat: repeat;
background-color: {color}; background-color: {color};
opacity: {opacity}; opacity: {opacity};
height: 100vh; height: 200px;
" "
/> />
{/if} {/if}
+11 -10
View File
@@ -1,6 +1,5 @@
<script lang="ts"> <script lang="ts">
import { X, Pencil } from '@lucide/svelte'; import { X, Pencil } from 'lucide-svelte';
import IconButton from './IconButton.svelte';
let { let {
color = $bindable(null), color = $bindable(null),
@@ -19,7 +18,7 @@
}; };
const iconSizeClasses = { const iconSizeClasses = {
sm: 'w-4 h-4', sm: 'w-3 h-3',
md: 'w-4 h-4', md: 'w-4 h-4',
lg: 'w-5 h-5' lg: 'w-5 h-5'
}; };
@@ -40,18 +39,20 @@
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
{#if color} {#if color}
<IconButton onclick={clearColor} {color} {size} aria-label="Clear color" rounded="md"> <button
type="button"
onclick={clearColor}
class="{buttonSize} flex items-center justify-center rounded-full border border-input hover:bg-accent transition-colors"
aria-label="Clear color"
>
<X class={iconSize} /> <X class={iconSize} />
</IconButton> </button>
{/if} {/if}
<label <label
class="{buttonSize} flex items-center justify-center rounded-md border border-input hover:opacity-90 transition-opacity cursor-pointer relative overflow-hidden" class="{buttonSize} flex items-center justify-center rounded-full border border-input hover:opacity-90 transition-opacity cursor-pointer relative overflow-hidden"
style={color ? `background-color: ${color};` : ''} style={color ? `background-color: ${color};` : ''}
> >
<Pencil <Pencil class="{iconSize} relative z-10 pointer-events-none" style={color ? 'color: white; filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));' : ''} />
class="{iconSize} relative z-10 pointer-events-none"
style={color ? 'color: white; filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));' : ''}
/>
<input <input
type="color" type="color"
value={color || '#ffffff'} value={color || '#ffffff'}
-132
View File
@@ -1,132 +0,0 @@
<script lang="ts">
import { scale } from 'svelte/transition';
import { cubicOut } from 'svelte/easing';
import type { Snippet } from 'svelte';
import IconButton from './IconButton.svelte';
let {
items,
selectedValue,
onSelect,
color,
showCheckmark = true,
icon,
ariaLabel
}: {
items: Array<{ value: string; label: string }>;
selectedValue: string;
onSelect: (value: string) => void;
color?: string | null;
showCheckmark?: boolean;
icon: Snippet;
ariaLabel: string;
} = $props();
let showMenu = $state(false);
const menuClasses = $derived(
color
? 'absolute left-0 sm:right-0 sm:left-auto mt-2 w-40 rounded-md border shadow-lg z-50 backdrop-blur-md'
: 'absolute left-0 sm:right-0 sm:left-auto mt-2 w-40 rounded-md border shadow-lg z-50 backdrop-blur-md border-slate-200 dark:border-slate-800 bg-white/90 dark:bg-slate-950/90'
);
const menuStyle = $derived(
color
? `border-color: ${color}; background-color: ${color}20; backdrop-filter: blur(12px);`
: ''
);
function getItemStyle(itemValue: string): string {
if (!color) return '';
return selectedValue === itemValue ? `background-color: ${color}20;` : '';
}
function toggleMenu() {
showMenu = !showMenu;
}
function handleSelect(value: string) {
onSelect(value);
showMenu = false;
}
function handleClickOutside(event: MouseEvent) {
const target = event.target as HTMLElement;
if (!target.closest('.dropdown-menu')) {
showMenu = false;
}
}
function handleMouseEnter(e: MouseEvent) {
if (color) {
(e.currentTarget as HTMLElement).style.backgroundColor = `${color}15`;
}
}
function handleMouseLeave(e: MouseEvent, itemValue: string) {
if (color) {
(e.currentTarget as HTMLElement).style.backgroundColor =
selectedValue === itemValue ? `${color}20` : 'transparent';
}
}
$effect(() => {
if (showMenu) {
document.addEventListener('click', handleClickOutside);
return () => document.removeEventListener('click', handleClickOutside);
}
});
</script>
<div class="relative dropdown-menu">
<IconButton
size="sm"
rounded="md"
onclick={toggleMenu}
aria-label={ariaLabel}
class={color ? 'hover-themed' : ''}
style={color ? `--hover-bg: ${color}20;` : ''}
>
{@render icon()}
</IconButton>
{#if showMenu}
<div
class={menuClasses}
style={menuStyle}
transition:scale={{ duration: 150, start: 0.95, opacity: 0, easing: cubicOut }}
>
<div class="py-1">
{#each items as item (item.value)}
<button
type="button"
class="w-full text-left px-4 py-2 text-sm transition-colors"
class:hover:bg-slate-100={!color}
class:dark:hover:bg-slate-900={!color}
class:font-bold={selectedValue === item.value}
class:bg-slate-100={selectedValue === item.value && !color}
class:dark:bg-slate-900={selectedValue === item.value && !color}
class:flex={showCheckmark}
class:items-center={showCheckmark}
class:justify-between={showCheckmark}
style={getItemStyle(item.value)}
onmouseenter={handleMouseEnter}
onmouseleave={(e) => handleMouseLeave(e, item.value)}
onclick={() => handleSelect(item.value)}
>
<span>{item.label}</span>
{#if showCheckmark && selectedValue === item.value}
<span class="ml-2"></span>
{/if}
</button>
{/each}
</div>
</div>
{/if}
</div>
<style>
:global(.hover-themed:hover) {
background-color: var(--hover-bg) !important;
}
</style>
-35
View File
@@ -1,35 +0,0 @@
<script lang="ts">
import { Label } from '$lib/components/ui/label';
import type { Snippet } from 'svelte';
interface Props {
id: string;
label: string;
required?: boolean;
children: Snippet;
class?: string;
description?: string;
}
let {
id,
label,
required = false,
children,
class: className = '',
description
}: Props = $props();
</script>
<div class="space-y-2 {className}">
<Label for={id}>
{label}
{#if required}
<span class="text-muted-foreground">(required)</span>
{/if}
</Label>
{#if description}
<p class="text-sm text-muted-foreground">{description}</p>
{/if}
{@render children()}
</div>
-53
View File
@@ -1,53 +0,0 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import type { HTMLButtonAttributes } from 'svelte/elements';
interface Props extends HTMLButtonAttributes {
color?: string | null;
rounded?: 'full' | 'md' | 'lg';
size?: 'sm' | 'md' | 'lg';
children: Snippet;
}
let {
color = null,
rounded = 'full',
size = 'md',
class: className = '',
children,
...restProps
}: Props = $props();
const sizeClasses = {
sm: 'w-8 h-8',
md: 'w-10 h-10',
lg: 'w-12 h-12'
};
const roundedClasses = {
full: 'rounded-full',
md: 'rounded-md',
lg: 'rounded-lg'
};
const baseClasses =
'flex items-center justify-center border border-input transition-colors backdrop-blur';
const sizeClass = sizeClasses[size];
const roundedClass = roundedClasses[rounded];
</script>
<button
type="button"
class="{baseClasses} {sizeClass} {roundedClass} {className} backdrop-blur-sm"
class:hover:bg-accent={!color}
style={color ? `--hover-bg: ${color}20;` : ''}
{...restProps}
>
{@render children()}
</button>
<style>
button[style*='--hover-bg']:hover {
background-color: var(--hover-bg);
}
</style>
+5 -1
View File
@@ -11,4 +11,8 @@
} = $props(); } = $props();
</script> </script>
<Input type="search" {placeholder} bind:value /> <Input
type="search"
{placeholder}
bind:value
/>
-54
View File
@@ -1,54 +0,0 @@
<script lang="ts">
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '$lib/components/ui/card';
import ThemeCard from '$lib/components/themes/ThemeCard.svelte';
import { getCardStyle } from '$lib/utils/colors';
interface Props {
color?: string | null;
fallbackColor?: string | null;
theme?: string | null;
showPattern?: boolean;
title?: string;
description?: string;
children?: import('svelte').Snippet;
class?: string;
padding?: 'none' | 'normal' | 'large';
}
let {
color = null,
fallbackColor = null,
theme = null,
showPattern = false,
title,
description,
children,
class: className = '',
padding = 'normal'
}: Props = $props();
const cardStyle = $derived(getCardStyle(color, fallbackColor));
const paddingClasses = {
none: 'p-0',
normal: 'p-6',
large: 'p-12'
};
</script>
<Card style={cardStyle} class="relative overflow-hidden {className}">
<ThemeCard themeName={theme} {color} {showPattern} />
{#if title}
<CardHeader class="relative z-10">
<CardTitle>{title}</CardTitle>
{#if description}
<CardDescription>{description}</CardDescription>
{/if}
</CardHeader>
{/if}
<CardContent class="{paddingClasses[padding]} relative z-10">
{@render children?.()}
</CardContent>
</Card>
+5 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import { Lock, LockOpen } from '@lucide/svelte'; import { Lock, LockOpen } from 'lucide-svelte';
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
let { let {
@@ -16,7 +16,10 @@
} }
</script> </script>
<Button onclick={handleClick} variant={unlocked ? 'default' : 'outline'}> <Button
onclick={handleClick}
variant={unlocked ? "default" : "outline"}
>
{#if unlocked} {#if unlocked}
<Lock class="mr-2 h-4 w-4" /> <Lock class="mr-2 h-4 w-4" />
{t.wishlist.lockDeletion} {t.wishlist.lockDeletion}
+4 -2
View File
@@ -7,12 +7,14 @@
base: 'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*="size-"])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0', base: 'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*="size-"])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0',
variants: { variants: {
variant: { variant: {
default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90', default:
'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
destructive: destructive:
'bg-destructive shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white', 'bg-destructive shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white',
outline: outline:
'bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border', 'bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border',
secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80', secondary:
'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50', ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
link: 'text-primary underline-offset-4 hover:underline' link: 'text-primary underline-offset-4 hover:underline'
}, },
@@ -3,7 +3,7 @@
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements';
type Props = HTMLAttributes<HTMLDivElement> & { type Props = HTMLAttributes<HTMLDivElement> & {
children?: import('svelte').Snippet; children?: any;
}; };
let { class: className, children, ...restProps }: Props = $props(); let { class: className, children, ...restProps }: Props = $props();
@@ -3,7 +3,7 @@
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements';
type Props = HTMLAttributes<HTMLParagraphElement> & { type Props = HTMLAttributes<HTMLParagraphElement> & {
children?: import('svelte').Snippet; children?: any;
}; };
let { class: className, children, ...restProps }: Props = $props(); let { class: className, children, ...restProps }: Props = $props();
@@ -3,7 +3,7 @@
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements';
type Props = HTMLAttributes<HTMLDivElement> & { type Props = HTMLAttributes<HTMLDivElement> & {
children?: import('svelte').Snippet; children?: any;
}; };
let { class: className, children, ...restProps }: Props = $props(); let { class: className, children, ...restProps }: Props = $props();
+1 -1
View File
@@ -3,7 +3,7 @@
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements';
type Props = HTMLAttributes<HTMLHeadingElement> & { type Props = HTMLAttributes<HTMLHeadingElement> & {
children?: import('svelte').Snippet; children?: any;
}; };
let { class: className, children, ...restProps }: Props = $props(); let { class: className, children, ...restProps }: Props = $props();
+5 -2
View File
@@ -3,12 +3,15 @@
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements';
type Props = HTMLAttributes<HTMLDivElement> & { type Props = HTMLAttributes<HTMLDivElement> & {
children?: import('svelte').Snippet; children?: any;
}; };
let { class: className, children, ...restProps }: Props = $props(); let { class: className, children, ...restProps }: Props = $props();
</script> </script>
<div class={cn('rounded-xl border bg-card text-card-foreground shadow', className)} {...restProps}> <div
class={cn('rounded-xl border bg-card text-card-foreground shadow', className)}
{...restProps}
>
{@render children?.()} {@render children?.()}
</div> </div>
+1 -1
View File
@@ -10,7 +10,7 @@
</script> </script>
<input <input
{type} type={type}
class={cn( class={cn(
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', 'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
className className
+1 -1
View File
@@ -3,7 +3,7 @@
import type { HTMLLabelAttributes } from 'svelte/elements'; import type { HTMLLabelAttributes } from 'svelte/elements';
type Props = HTMLLabelAttributes & { type Props = HTMLLabelAttributes & {
children?: import('svelte').Snippet; children?: any;
}; };
let { class: className, children, ...restProps }: Props = $props(); let { class: className, children, ...restProps }: Props = $props();
@@ -1,32 +1,58 @@
<script lang="ts"> <script lang="ts">
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
import { languages } from '$lib/i18n/translations'; import { languages } from '$lib/i18n/translations';
import Dropdown from '$lib/components/ui/Dropdown.svelte'; import { Button } from '$lib/components/ui/button';
import { Languages } from '@lucide/svelte'; import { Languages } from 'lucide-svelte';
let { color }: { color?: string | null } = $props(); let showMenu = $state(false);
const languageItems = $derived( function toggleMenu() {
languages.map((lang) => ({ showMenu = !showMenu;
value: lang.code,
label: lang.name
}))
);
function setLanguage(code: string) {
languageStore.setLanguage(code as 'en' | 'da');
} }
function setLanguage(code: 'en' | 'da') {
languageStore.setLanguage(code);
showMenu = false;
}
function handleClickOutside(event: MouseEvent) {
const target = event.target as HTMLElement;
if (!target.closest('.language-toggle-menu')) {
showMenu = false;
}
}
$effect(() => {
if (showMenu) {
document.addEventListener('click', handleClickOutside);
return () => document.removeEventListener('click', handleClickOutside);
}
});
</script> </script>
<Dropdown <div class="relative language-toggle-menu">
items={languageItems} <Button variant="outline" size="icon" onclick={toggleMenu} aria-label="Toggle language">
selectedValue={languageStore.current}
onSelect={setLanguage}
{color}
showCheckmark={false}
ariaLabel="Toggle language"
>
{#snippet icon()}
<Languages class="h-[1.2rem] w-[1.2rem]" /> <Languages class="h-[1.2rem] w-[1.2rem]" />
{/snippet} </Button>
</Dropdown>
{#if showMenu}
<div
class="absolute left-0 sm:right-0 sm:left-auto mt-2 w-40 rounded-md border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-950 shadow-lg z-50"
>
<div class="py-1">
{#each languages as lang}
<button
type="button"
class="w-full text-left px-4 py-2 text-sm hover:bg-slate-100 dark:hover:bg-slate-900 transition-colors"
class:font-bold={languageStore.current === lang.code}
class:bg-slate-100={languageStore.current === lang.code}
class:dark:bg-slate-900={languageStore.current === lang.code}
onclick={() => setLanguage(lang.code)}
>
{lang.name}
</button>
{/each}
</div>
</div>
{/if}
</div>
-6
View File
@@ -1,6 +0,0 @@
import Root from './select.svelte';
export {
Root,
Root as Select
};
@@ -1,22 +0,0 @@
<script lang="ts">
import { cn } from '$lib/utils';
import type { HTMLSelectAttributes } from 'svelte/elements';
type Props = HTMLSelectAttributes & {
value?: string;
children?: import('svelte').Snippet;
};
let { class: className, value = $bindable(''), children, ...restProps }: Props = $props();
</script>
<select
class={cn(
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
className
)}
bind:value
{...restProps}
>
{@render children?.()}
</select>
+55 -22
View File
@@ -1,35 +1,68 @@
<script lang="ts"> <script lang="ts">
import Dropdown from '$lib/components/ui/Dropdown.svelte'; import { Button } from '$lib/components/ui/button';
import { Palette } from '@lucide/svelte'; import { Palette } from 'lucide-svelte';
import { AVAILABLE_THEMES } from '$lib/utils/themes'; import { AVAILABLE_THEMES } from '$lib/utils/themes';
let { let {
value = 'none', value = 'none',
onValueChange, onValueChange
color
}: { }: {
value?: string; value?: string;
onValueChange: (theme: string) => void; onValueChange: (theme: string) => void;
color?: string | null;
} = $props(); } = $props();
const themeItems = $derived( let showMenu = $state(false);
Object.entries(AVAILABLE_THEMES).map(([key, theme]) => ({
value: key, function toggleMenu() {
label: theme.name showMenu = !showMenu;
})) }
);
function handleSelect(themeName: string) {
onValueChange(themeName);
showMenu = false;
}
function handleClickOutside(event: MouseEvent) {
const target = event.target as HTMLElement;
if (!target.closest('.theme-picker-menu')) {
showMenu = false;
}
}
$effect(() => {
if (showMenu) {
document.addEventListener('click', handleClickOutside);
return () => document.removeEventListener('click', handleClickOutside);
}
});
</script> </script>
<Dropdown <div class="relative theme-picker-menu">
items={themeItems} <Button variant="outline" size="icon" onclick={toggleMenu} aria-label="Select theme pattern">
selectedValue={value}
onSelect={onValueChange}
{color}
showCheckmark={true}
ariaLabel="Select theme pattern"
>
{#snippet icon()}
<Palette class="h-[1.2rem] w-[1.2rem]" /> <Palette class="h-[1.2rem] w-[1.2rem]" />
{/snippet} </Button>
</Dropdown>
{#if showMenu}
<div
class="absolute left-0 sm:right-0 sm:left-auto mt-2 w-40 rounded-md border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-950 shadow-lg z-50"
>
<div class="py-1">
{#each Object.entries(AVAILABLE_THEMES) as [key, theme]}
<button
type="button"
class="w-full text-left px-4 py-2 text-sm hover:bg-slate-100 dark:hover:bg-slate-900 transition-colors flex items-center justify-between"
class:font-bold={value === key}
class:bg-slate-100={value === key}
class:dark:bg-slate-900={value === key}
onclick={() => handleSelect(key)}
>
<span>{theme.name}</span>
{#if value === key}
<span class="ml-2"></span>
{/if}
</button>
{/each}
</div>
</div>
{/if}
</div>
@@ -1,22 +1,14 @@
<script lang="ts"> <script lang="ts">
import { themeStore } from '$lib/stores/theme.svelte'; import { themeStore } from '$lib/stores/theme.svelte';
import { Sun, Moon, Monitor } from '@lucide/svelte'; import { Button } from '$lib/components/ui/button';
import IconButton from '../IconButton.svelte'; import { Sun, Moon, Monitor } from 'lucide-svelte';
let {
color = $bindable(null),
size = 'sm'
}: {
color: string | null;
size?: 'sm' | 'md' | 'lg';
} = $props();
function toggle() { function toggle() {
themeStore.toggle(); themeStore.toggle();
} }
</script> </script>
<IconButton onclick={toggle} {size} {color} rounded="md"> <Button onclick={toggle} variant="ghost" size="icon" class="rounded-full">
{#if themeStore.current === 'light'} {#if themeStore.current === 'light'}
<Sun size={20} /> <Sun size={20} />
<span class="sr-only">Light mode (click for dark)</span> <span class="sr-only">Light mode (click for dark)</span>
@@ -27,4 +19,4 @@
<Monitor size={20} /> <Monitor size={20} />
<span class="sr-only">System mode (click for light)</span> <span class="sr-only">System mode (click for light)</span>
{/if} {/if}
</IconButton> </Button>
@@ -0,0 +1,143 @@
<script lang="ts">
import { Button } from '$lib/components/ui/button';
import { Input } from '$lib/components/ui/input';
import { Label } from '$lib/components/ui/label';
import { Textarea } from '$lib/components/ui/textarea';
import { Card, CardContent, CardHeader, CardTitle } from '$lib/components/ui/card';
import ImageSelector from './ImageSelector.svelte';
import ColorPicker from '$lib/components/ui/ColorPicker.svelte';
import { enhance } from '$app/forms';
import { languageStore } from '$lib/stores/language.svelte';
interface Props {
onSuccess?: () => void;
}
let { onSuccess }: Props = $props();
const t = $derived(languageStore.t);
const currencies = ['DKK', 'EUR', 'USD', 'SEK', 'NOK', 'GBP'];
let linkUrl = $state('');
let imageUrl = $state('');
let color = $state<string | null>(null);
let scrapedImages = $state<string[]>([]);
let isLoadingImages = $state(false);
async function handleLinkChange(event: Event) {
const input = event.target as HTMLInputElement;
linkUrl = input.value;
if (linkUrl && linkUrl.startsWith('http')) {
isLoadingImages = true;
scrapedImages = [];
try {
const response = await fetch('/api/scrape-images', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url: linkUrl })
});
if (response.ok) {
const data = await response.json();
scrapedImages = data.images || [];
}
} catch (error) {
console.error('Failed to scrape images:', error);
} finally {
isLoadingImages = false;
}
}
}
</script>
<Card>
<CardHeader>
<CardTitle>{t.form.addNewWish}</CardTitle>
</CardHeader>
<CardContent>
<form
method="POST"
action="?/addItem"
use:enhance={() => {
return async ({ update }) => {
await update({ reset: false });
onSuccess?.();
};
}}
class="space-y-4"
>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="space-y-2 md:col-span-2">
<Label for="title">{t.form.wishName} ({t.form.required})</Label>
<Input id="title" name="title" required placeholder="e.g., Blue Headphones" />
</div>
<div class="space-y-2 md:col-span-2">
<Label for="description">{t.form.description}</Label>
<Textarea
id="description"
name="description"
placeholder="Add details about the item..."
rows={3}
/>
</div>
<div class="space-y-2 md:col-span-2">
<Label for="link">{t.form.link}</Label>
<Input
id="link"
name="link"
type="url"
placeholder="https://..."
bind:value={linkUrl}
oninput={handleLinkChange}
/>
</div>
<div class="space-y-2 md:col-span-2">
<Label for="imageUrl">{t.form.imageUrl}</Label>
<Input
id="imageUrl"
name="imageUrl"
type="url"
placeholder="https://..."
bind:value={imageUrl}
/>
<ImageSelector images={scrapedImages} bind:selectedImage={imageUrl} isLoading={isLoadingImages} />
</div>
<div class="space-y-2">
<Label for="price">{t.form.price}</Label>
<Input id="price" name="price" type="number" step="0.01" placeholder="0.00" />
</div>
<div class="space-y-2 md:col-span-2">
<Label for="currency">{t.form.currency}</Label>
<select
id="currency"
name="currency"
class="flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm"
>
{#each currencies as curr}
<option value={curr} selected={curr === 'DKK'}>{curr}</option>
{/each}
</select>
</div>
<div class="md:col-span-2">
<div class="flex items-center justify-between">
<Label for="color">{t.form.cardColor}</Label>
<ColorPicker bind:color={color} />
</div>
<input type="hidden" name="color" value={color || ''} />
</div>
</div>
<Button type="submit" class="w-full md:w-auto">{t.wishlist.addWish}</Button>
</form>
</CardContent>
</Card>
@@ -25,7 +25,11 @@
{#if isAuthenticated} {#if isAuthenticated}
<div class="mb-6"> <div class="mb-6">
{#if isOwner} {#if isOwner}
<Button disabled variant="outline" class="w-full md:w-auto opacity-60 cursor-not-allowed"> <Button
disabled
variant="outline"
class="w-full md:w-auto opacity-60 cursor-not-allowed"
>
{t.wishlist.youOwnThis} {t.wishlist.youOwnThis}
</Button> </Button>
<p class="text-sm text-muted-foreground mt-2"> <p class="text-sm text-muted-foreground mt-2">
@@ -34,15 +38,19 @@
{:else} {:else}
<form <form
method="POST" method="POST"
action={hasClaimed ? '?/unclaimWishlist' : '?/claimWishlist'} action={hasClaimed ? "?/unclaimWishlist" : "?/claimWishlist"}
use:enhance={() => { use:enhance={() => {
return async ({ update }) => { return async ({ update }) => {
await update({ reset: false }); await update({ reset: false });
}; };
}} }}
> >
<Button type="submit" variant={hasClaimed ? 'outline' : 'default'} class="w-full md:w-auto"> <Button
{hasClaimed ? 'Unclaim Wishlist' : 'Claim Wishlist'} type="submit"
variant={hasClaimed ? "outline" : "default"}
class="w-full md:w-auto"
>
{hasClaimed ? "Unclaim Wishlist" : "Claim Wishlist"}
</Button> </Button>
</form> </form>
<p class="text-sm text-muted-foreground mt-2"> <p class="text-sm text-muted-foreground mt-2">
@@ -52,9 +60,7 @@
Claim this wishlist to add it to your dashboard for easy access. Claim this wishlist to add it to your dashboard for easy access.
{#if isLocal} {#if isLocal}
<br /> <br />
<span class="text-xs" <span class="text-xs">It will remain in your local wishlists and also appear in your claimed wishlists.</span>
>It will remain in your local wishlists and also appear in your claimed wishlists.</span
>
{/if} {/if}
{/if} {/if}
</p> </p>
@@ -27,13 +27,17 @@
return; return;
} }
return async ({ result }) => { return async ({ result }) => {
if (result.type === 'success') { if (result.type === "success") {
window.location.href = '/dashboard'; window.location.href = "/dashboard";
} }
}; };
}} }}
> >
<Button type="submit" variant="destructive" class="w-full md:w-auto"> <Button
type="submit"
variant="destructive"
class="w-full md:w-auto"
>
{t.wishlist.deleteWishlist} {t.wishlist.deleteWishlist}
</Button> </Button>
</form> </form>
@@ -0,0 +1,179 @@
<script lang="ts">
import { Button } from '$lib/components/ui/button';
import { Input } from '$lib/components/ui/input';
import { Label } from '$lib/components/ui/label';
import { Textarea } from '$lib/components/ui/textarea';
import { Card, CardContent, CardHeader, CardTitle } from '$lib/components/ui/card';
import ImageSelector from './ImageSelector.svelte';
import ColorPicker from '$lib/components/ui/ColorPicker.svelte';
import { enhance } from '$app/forms';
import type { Item } from '$lib/server/schema';
import { languageStore } from '$lib/stores/language.svelte';
interface Props {
item: Item;
onSuccess?: () => void;
onCancel?: () => void;
onColorChange?: (itemId: string, color: string) => void;
currentPosition?: number;
totalItems?: number;
onPositionChange?: (newPosition: number) => void;
}
let { item, onSuccess, onCancel, onColorChange, currentPosition = 1, totalItems = 1, onPositionChange }: Props = $props();
const t = $derived(languageStore.t);
const currencies = ['DKK', 'EUR', 'USD', 'SEK', 'NOK', 'GBP'];
let linkUrl = $state(item.link || '');
let imageUrl = $state(item.imageUrl || '');
let color = $state<string | null>(item.color);
let scrapedImages = $state<string[]>([]);
let isLoadingImages = $state(false);
async function handleLinkChange(event: Event) {
const input = event.target as HTMLInputElement;
linkUrl = input.value;
if (linkUrl && linkUrl.startsWith('http')) {
isLoadingImages = true;
scrapedImages = [];
try {
const response = await fetch('/api/scrape-images', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url: linkUrl })
});
if (response.ok) {
const data = await response.json();
scrapedImages = data.images || [];
}
} catch (error) {
console.error('Failed to scrape images:', error);
} finally {
isLoadingImages = false;
}
}
}
</script>
<Card>
<CardHeader>
<CardTitle>{t.wishlist.editWish}</CardTitle>
</CardHeader>
<CardContent>
<form
method="POST"
action="?/updateItem"
use:enhance={() => {
return async ({ update }) => {
await update({ reset: false });
onSuccess?.();
};
}}
class="space-y-4"
>
<input type="hidden" name="itemId" value={item.id} />
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="space-y-2 md:col-span-2">
<Label for="title">{t.form.wishName} ({t.form.required})</Label>
<Input id="title" name="title" required value={item.title} placeholder="e.g., Blue Headphones" />
</div>
<div class="space-y-2 md:col-span-2">
<Label for="description">{t.form.description}</Label>
<Textarea
id="description"
name="description"
value={item.description || ''}
placeholder="Add details about the item..."
rows={3}
/>
</div>
<div class="space-y-2 md:col-span-2">
<Label for="link">{t.form.link}</Label>
<Input
id="link"
name="link"
type="url"
placeholder="https://..."
bind:value={linkUrl}
oninput={handleLinkChange}
/>
</div>
<div class="space-y-2 md:col-span-2">
<Label for="imageUrl">{t.form.imageUrl}</Label>
<Input
id="imageUrl"
name="imageUrl"
type="url"
placeholder="https://..."
bind:value={imageUrl}
/>
<ImageSelector images={scrapedImages} bind:selectedImage={imageUrl} isLoading={isLoadingImages} />
</div>
<div class="space-y-2">
<Label for="price">{t.form.price}</Label>
<Input id="price" name="price" type="number" step="0.01" value={item.price || ''} placeholder="0.00" />
</div>
<div class="space-y-2 md:col-span-2">
<Label for="currency">{t.form.currency}</Label>
<select
id="currency"
name="currency"
class="flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm"
>
{#each currencies as curr}
<option value={curr} selected={item.currency === curr}>{curr}</option>
{/each}
</select>
</div>
<div class="md:col-span-2">
<div class="flex items-center justify-between">
<Label for="color">{t.form.cardColor}</Label>
<ColorPicker bind:color={color} onchange={() => onColorChange?.(item.id, color || '')} />
</div>
<input type="hidden" name="color" value={color || ''} />
</div>
<div class="space-y-2 md:col-span-2">
<Label for="position">{t.form.position}</Label>
<Input
id="position"
type="number"
min="1"
max={totalItems}
value={currentPosition}
onchange={(e) => {
const newPos = parseInt((e.target as HTMLInputElement).value);
if (newPos >= 1 && newPos <= totalItems) {
onPositionChange?.(newPos);
}
}}
placeholder="1"
/>
<p class="text-sm text-muted-foreground">
Choose where this item appears in your wishlist (1 = top, {totalItems} = bottom)
</p>
</div>
</div>
<div class="flex gap-2">
<Button type="submit" class="flex-1 md:flex-none">{t.form.saveChanges}</Button>
{#if onCancel}
<Button type="button" variant="outline" class="flex-1 md:flex-none" onclick={onCancel}>{t.form.cancel}</Button>
{/if}
</div>
</form>
</CardContent>
</Card>
@@ -1,31 +1,28 @@
<script lang="ts"> <script lang="ts">
import { Button } from '$lib/components/ui/button'; import { Button } from "$lib/components/ui/button";
import { Card, CardContent } from '$lib/components/ui/card'; import { Card, CardContent } from "$lib/components/ui/card";
import WishlistItem from '$lib/components/wishlist/WishlistItem.svelte'; import WishlistItem from "$lib/components/wishlist/WishlistItem.svelte";
import EmptyState from '$lib/components/layout/EmptyState.svelte'; import EmptyState from "$lib/components/layout/EmptyState.svelte";
import type { Item } from '$lib/server/schema'; import type { Item } from "$lib/server/schema";
import { enhance } from '$app/forms'; import { enhance } from "$app/forms";
import { flip } from 'svelte/animate'; import { flip } from "svelte/animate";
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
import ThemeCard from '$lib/components/themes/ThemeCard.svelte';
import { getCardStyle } from '$lib/utils/colors';
let { let {
items = $bindable([]), items = $bindable([]),
rearranging, rearranging,
onStartEditing, onStartEditing,
theme = null, onReorder,
wishlistColor = null theme = null
}: { }: {
items: Item[]; items: Item[];
rearranging: boolean; rearranging: boolean;
onStartEditing: (item: Item) => void; onStartEditing: (item: Item) => void;
onReorder: (items: Item[]) => Promise<void>;
theme?: string | null; theme?: string | null;
wishlistColor?: string | null;
} = $props(); } = $props();
const t = $derived(languageStore.t); const t = $derived(languageStore.t);
const cardStyle = $derived(getCardStyle(wishlistColor));
</script> </script>
<div class="space-y-4"> <div class="space-y-4">
@@ -33,7 +30,7 @@
<div class="space-y-4"> <div class="space-y-4">
{#each items as item (item.id)} {#each items as item (item.id)}
<div animate:flip={{ duration: 300 }}> <div animate:flip={{ duration: 300 }}>
<WishlistItem {item} {theme} {wishlistColor} showDragHandle={false}> <WishlistItem {item} {theme} showDragHandle={false}>
<div class="flex gap-2"> <div class="flex gap-2">
<Button <Button
type="button" type="button"
@@ -44,9 +41,21 @@
{t.wishlist.edit} {t.wishlist.edit}
</Button> </Button>
{#if rearranging} {#if rearranging}
<form method="POST" action="?/deleteItem" use:enhance> <form
<input type="hidden" name="itemId" value={item.id} /> method="POST"
<Button type="submit" variant="destructive" size="sm"> action="?/deleteItem"
use:enhance
>
<input
type="hidden"
name="itemId"
value={item.id}
/>
<Button
type="submit"
variant="destructive"
size="sm"
>
{t.form.delete} {t.form.delete}
</Button> </Button>
</form> </form>
@@ -57,10 +66,11 @@
{/each} {/each}
</div> </div>
{:else} {:else}
<Card style={cardStyle} class="relative overflow-hidden"> <Card>
<ThemeCard themeName={theme} color={wishlistColor} showPattern={false} /> <CardContent class="p-12">
<CardContent class="p-12 relative z-10"> <EmptyState
<EmptyState message={t.wishlist.noWishes + '. ' + t.wishlist.addFirstWish + '!'} /> message={t.wishlist.noWishes + ". " + t.wishlist.addFirstWish + "!"}
/>
</CardContent> </CardContent>
</Card> </Card>
{/if} {/if}
@@ -18,7 +18,7 @@
<div class="mt-2"> <div class="mt-2">
<Label class="text-sm">Or select from scraped images:</Label> <Label class="text-sm">Or select from scraped images:</Label>
<div class="grid grid-cols-3 md:grid-cols-5 gap-2 mt-2"> <div class="grid grid-cols-3 md:grid-cols-5 gap-2 mt-2">
{#each images as imgUrl (imgUrl)} {#each images as imgUrl}
<button <button
type="button" type="button"
onclick={() => (selectedImage = imgUrl)} onclick={() => (selectedImage = imgUrl)}
-241
View File
@@ -1,241 +0,0 @@
<script lang="ts">
import { Button } from '$lib/components/ui/button';
import { Input } from '$lib/components/ui/input';
import { Label } from '$lib/components/ui/label';
import { Textarea } from '$lib/components/ui/textarea';
import { Select } from '$lib/components/ui/select';
import ThemedCard from '$lib/components/ui/ThemedCard.svelte';
import ImageSelector from './ImageSelector.svelte';
import ColorPicker from '$lib/components/ui/ColorPicker.svelte';
import { enhance } from '$app/forms';
import type { Item } from '$lib/db/schema';
import { languageStore } from '$lib/stores/language.svelte';
import { CURRENCIES } from '$lib/utils/currency';
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher<{
success: void;
cancel: void;
colorChange: { itemId: string; color: string };
positionChange: { itemId: string; newPosition: number };
}>();
interface Props {
item?: Item | null;
mode: 'add' | 'edit';
itemCount?: number;
wishlistColor?: string | null;
wishlistTheme?: string | null;
}
let {
item = null,
mode,
itemCount = 1,
wishlistColor = null,
wishlistTheme = null
}: Props = $props();
const isEdit = mode === 'edit' && item !== null;
const t = $derived(languageStore.t);
// Form state - initialized from item if editing
let linkUrl = $state(item?.link || '');
let imageUrl = $state(item?.imageUrl || '');
let color = $state<string | null>(item?.color || null);
let position = $state(item?.order ? Number(item.order) + 1 : 1);
let scrapedImages = $state<string[]>([]);
let isLoadingImages = $state(false);
let debounceTimer: ReturnType<typeof setTimeout> | null = null;
// Form action based on mode
const formAction = isEdit ? '?/updateItem' : '?/addItem';
const submitLabel = isEdit ? t.form.saveChanges : t.wishlist.addWish;
const titleLabel = isEdit ? t.wishlist.editWish : t.form.addNewWish;
async function scrapeImages(url: string) {
if (!url || !url.startsWith('http')) return;
isLoadingImages = true;
scrapedImages = [];
try {
const response = await fetch('/api/scrape-images', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url })
});
if (response.ok) {
const data = await response.json();
scrapedImages = data.images || [];
}
} catch (error) {
console.error('Failed to scrape images:', error);
} finally {
isLoadingImages = false;
}
}
function handleLinkInput(event: Event) {
const input = event.target as HTMLInputElement;
linkUrl = input.value;
// Clear existing timer
if (debounceTimer) {
clearTimeout(debounceTimer);
}
// Set new timer to scrape after user stops typing for 500ms
debounceTimer = setTimeout(() => {
scrapeImages(linkUrl);
}, 500);
}
function handleColorChange() {
if (isEdit && item) {
dispatch('colorChange', { itemId: item.id, color: color || '' });
}
}
function handlePositionChange() {
if (isEdit && item) {
dispatch('positionChange', { itemId: item.id, newPosition: position });
}
}
// Auto-load images when form opens with existing URL
$effect(() => {
if (linkUrl && linkUrl.startsWith('http')) {
scrapeImages(linkUrl);
}
});
</script>
<ThemedCard theme={wishlistTheme} color={wishlistColor} title={titleLabel}>
<form
method="POST"
action={formAction}
use:enhance={() => {
return async ({ update }) => {
await update({ reset: false });
dispatch('success');
};
}}
class="space-y-4"
>
{#if isEdit && item}
<input type="hidden" name="itemId" value={item.id} />
{/if}
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="space-y-2 md:col-span-2">
<Label for="title">{t.form.wishName} ({t.form.required})</Label>
<Input
id="title"
name="title"
required
value={item?.title || ''}
placeholder="e.g., Blue Headphones"
/>
</div>
<div class="space-y-2 md:col-span-2">
<Label for="description">{t.form.description}</Label>
<Textarea
id="description"
name="description"
value={item?.description || ''}
placeholder="Add details about the item..."
rows={3}
/>
</div>
<div class="space-y-2 md:col-span-2">
<Label for="link">{t.form.link}</Label>
<Input
id="link"
name="link"
type="url"
placeholder="https://..."
bind:value={linkUrl}
oninput={handleLinkInput}
/>
</div>
<div class="space-y-2 md:col-span-2">
<Label for="imageUrl">{t.form.imageUrl}</Label>
<Input
id="imageUrl"
name="imageUrl"
type="url"
placeholder="https://..."
bind:value={imageUrl}
/>
<ImageSelector
images={scrapedImages}
bind:selectedImage={imageUrl}
isLoading={isLoadingImages}
/>
</div>
<div class="space-y-2">
<Label for="price">{t.form.price}</Label>
<Input
id="price"
name="price"
type="number"
step="0.01"
value={item?.price || ''}
placeholder="0.00"
/>
</div>
<div class="space-y-2 md:col-span-2">
<Label for="currency">{t.form.currency}</Label>
<Select id="currency" name="currency" value={item?.currency || 'DKK'}>
{#each CURRENCIES as curr (curr)}
<option value={curr}>{curr}</option>
{/each}
</Select>
</div>
<div class="md:col-span-2">
<div class="flex items-center justify-between">
<Label for="color">{t.form.cardColor}</Label>
<ColorPicker bind:color onchange={handleColorChange} />
</div>
<input type="hidden" name="color" value={color || ''} />
</div>
{#if isEdit}
<div class="space-y-2 md:col-span-2">
<Label for="position">{t.form.position}</Label>
<Input
id="position"
name="position"
type="number"
min="1"
max={itemCount}
bind:value={position}
onchange={handlePositionChange}
placeholder="1"
/>
<p class="text-sm text-muted-foreground">
Choose where this item appears in your wishlist (1 = top, {itemCount} = bottom)
</p>
</div>
{/if}
</div>
<div class="flex gap-2">
<Button type="submit" class="flex-1 md:flex-none">{submitLabel}</Button>
{#if isEdit}
<Button type="button" variant="outline" class="flex-1 md:flex-none" onclick={() => dispatch('cancel')}>
{t.form.cancel}
</Button>
{/if}
</div>
</form>
</ThemedCard>
@@ -39,20 +39,20 @@
{#if canCancel()} {#if canCancel()}
{#if showCancelConfirmation} {#if showCancelConfirmation}
<div class="flex flex-col gap-2 items-start"> <div class="flex flex-col gap-2 items-start">
<p class="text-sm text-muted-foreground">Cancel this reservation?</p> <p class="text-sm text-muted-foreground">
Cancel this reservation?
</p>
<div class="flex gap-2"> <div class="flex gap-2">
<form <form method="POST" action="?/unreserve" use:enhance={() => {
method="POST"
action="?/unreserve"
use:enhance={() => {
return async ({ update }) => { return async ({ update }) => {
showCancelConfirmation = false; showCancelConfirmation = false;
await update(); await update();
}; };
}} }}>
>
<input type="hidden" name="itemId" value={itemId} /> <input type="hidden" name="itemId" value={itemId} />
<Button type="submit" variant="destructive" size="sm">Yes, Cancel</Button> <Button type="submit" variant="destructive" size="sm">
Yes, Cancel
</Button>
</form> </form>
<Button <Button
type="button" type="button"
@@ -76,7 +76,9 @@
{:else} {:else}
<form method="POST" action="?/unreserve" use:enhance> <form method="POST" action="?/unreserve" use:enhance>
<input type="hidden" name="itemId" value={itemId} /> <input type="hidden" name="itemId" value={itemId} />
<Button type="submit" variant="outline" size="sm">Cancel Reservation</Button> <Button type="submit" variant="outline" size="sm">
Cancel Reservation
</Button>
</form> </form>
{/if} {/if}
{/if} {/if}
@@ -4,18 +4,15 @@
import { Label } from '$lib/components/ui/label'; import { Label } from '$lib/components/ui/label';
import { Card, CardContent } from '$lib/components/ui/card'; import { Card, CardContent } from '$lib/components/ui/card';
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
import { getCardStyle } from '$lib/utils/colors';
interface Props { interface Props {
publicUrl: string; publicUrl: string;
ownerUrl?: string; ownerUrl?: string;
wishlistColor?: string | null;
} }
let { publicUrl, ownerUrl, wishlistColor = null }: Props = $props(); let { publicUrl, ownerUrl }: Props = $props();
const t = $derived(languageStore.t); const t = $derived(languageStore.t);
const cardStyle = $derived(getCardStyle(null, wishlistColor));
let copiedPublic = $state(false); let copiedPublic = $state(false);
let copiedOwner = $state(false); let copiedOwner = $state(false);
@@ -23,9 +20,7 @@
const publicLink = $derived( const publicLink = $derived(
typeof window !== 'undefined' ? `${window.location.origin}${publicUrl}` : '' typeof window !== 'undefined' ? `${window.location.origin}${publicUrl}` : ''
); );
const ownerLink = $derived( const ownerLink = $derived(ownerUrl && typeof window !== 'undefined' ? `${window.location.origin}${ownerUrl}` : '');
ownerUrl && typeof window !== 'undefined' ? `${window.location.origin}${ownerUrl}` : ''
);
async function copyToClipboard(text: string, type: 'public' | 'owner') { async function copyToClipboard(text: string, type: 'public' | 'owner') {
await navigator.clipboard.writeText(text); await navigator.clipboard.writeText(text);
@@ -39,7 +34,7 @@
} }
</script> </script>
<Card style={cardStyle}> <Card>
<CardContent class="space-y-4 pt-6"> <CardContent class="space-y-4 pt-6">
<div class="space-y-2"> <div class="space-y-2">
<Label>{t.wishlist.shareViewOnly}</Label> <Label>{t.wishlist.shareViewOnly}</Label>
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { Button } from '$lib/components/ui/button'; import { Button } from "$lib/components/ui/button";
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
let { let {
@@ -16,7 +16,10 @@
</script> </script>
<div class="flex flex-col md:flex-row gap-4"> <div class="flex flex-col md:flex-row gap-4">
<Button onclick={onToggleAddForm} class="w-full md:w-auto"> <Button
onclick={onToggleAddForm}
class="w-full md:w-auto"
>
{showAddForm ? t.form.cancel : t.wishlist.addWish} {showAddForm ? t.form.cancel : t.wishlist.addWish}
</Button> </Button>
</div> </div>
@@ -1,15 +1,13 @@
<script lang="ts"> <script lang="ts">
import { Card, CardContent } from '$lib/components/ui/card'; import { Card, CardContent } from "$lib/components/ui/card";
import { Input } from '$lib/components/ui/input'; import { Input } from "$lib/components/ui/input";
import { Label } from '$lib/components/ui/label'; import { Label } from "$lib/components/ui/label";
import { Textarea } from '$lib/components/ui/textarea'; import { Textarea } from "$lib/components/ui/textarea";
import { Pencil, Check, X } from '@lucide/svelte'; import { Pencil, Check, X } from "lucide-svelte";
import ColorPicker from '$lib/components/ui/ColorPicker.svelte'; import ColorPicker from "$lib/components/ui/ColorPicker.svelte";
import ThemePicker from '$lib/components/ui/theme-picker.svelte'; import ThemePicker from "$lib/components/ui/theme-picker.svelte";
import IconButton from '$lib/components/ui/IconButton.svelte'; import type { Wishlist } from "$lib/server/schema";
import type { Wishlist } from '$lib/db/schema';
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
import { getCardStyle } from '$lib/utils/colors';
let { let {
wishlist, wishlist,
@@ -32,15 +30,15 @@
let editingTitle = $state(false); let editingTitle = $state(false);
let editingDescription = $state(false); let editingDescription = $state(false);
let wishlistTitle = $state(wishlist.title); let wishlistTitle = $state(wishlist.title);
let wishlistDescription = $state(wishlist.description || ''); let wishlistDescription = $state(wishlist.description || "");
let wishlistColor = $state<string | null>(wishlist.color); let wishlistColor = $state<string | null>(wishlist.color);
let wishlistTheme = $state<string>(wishlist.theme || 'none'); let wishlistTheme = $state<string>(wishlist.theme || 'none');
let wishlistEndDate = $state<string | null>( let wishlistEndDate = $state<string | null>(
wishlist.endDate ? new Date(wishlist.endDate).toISOString().split('T')[0] : null wishlist.endDate
? new Date(wishlist.endDate).toISOString().split("T")[0]
: null,
); );
const cardStyle = $derived(getCardStyle(null, wishlistColor));
async function saveTitle() { async function saveTitle() {
if (!wishlistTitle.trim()) { if (!wishlistTitle.trim()) {
wishlistTitle = wishlist.title; wishlistTitle = wishlist.title;
@@ -62,7 +60,7 @@
if (success) { if (success) {
editingDescription = false; editingDescription = false;
} else { } else {
wishlistDescription = wishlist.description || ''; wishlistDescription = wishlist.description || "";
editingDescription = false; editingDescription = false;
} }
} }
@@ -79,6 +77,7 @@
} }
</script> </script>
<!-- Title Header -->
<div class="flex items-center justify-between gap-4 mb-6"> <div class="flex items-center justify-between gap-4 mb-6">
<div class="flex items-center gap-2 flex-1 min-w-0"> <div class="flex items-center gap-2 flex-1 min-w-0">
{#if editingTitle} {#if editingTitle}
@@ -86,9 +85,9 @@
bind:value={wishlistTitle} bind:value={wishlistTitle}
class="text-3xl font-bold h-auto py-0 leading-[2.25rem]" class="text-3xl font-bold h-auto py-0 leading-[2.25rem]"
onkeydown={(e) => { onkeydown={(e) => {
if (e.key === 'Enter') { if (e.key === "Enter") {
saveTitle(); saveTitle();
} else if (e.key === 'Escape') { } else if (e.key === "Escape") {
wishlistTitle = wishlist.title; wishlistTitle = wishlist.title;
editingTitle = false; editingTitle = false;
} }
@@ -98,7 +97,8 @@
{:else} {:else}
<h1 class="text-3xl font-bold leading-[2.25rem]">{wishlistTitle}</h1> <h1 class="text-3xl font-bold leading-[2.25rem]">{wishlistTitle}</h1>
{/if} {/if}
<IconButton <button
type="button"
onclick={() => { onclick={() => {
if (editingTitle) { if (editingTitle) {
saveTitle(); saveTitle();
@@ -106,17 +106,15 @@
editingTitle = true; editingTitle = true;
} }
}} }}
color={wishlistColor} class="shrink-0 w-8 h-8 flex items-center justify-center rounded-full border border-input hover:bg-accent transition-colors"
size="sm" aria-label={editingTitle ? "Save title" : "Edit title"}
class="shrink-0"
aria-label={editingTitle ? 'Save title' : 'Edit title'}
> >
{#if editingTitle} {#if editingTitle}
<Check class="w-4 h-4" /> <Check class="w-4 h-4" />
{:else} {:else}
<Pencil class="w-4 h-4" /> <Pencil class="w-4 h-4" />
{/if} {/if}
</IconButton> </button>
</div> </div>
<div class="flex items-center gap-2 shrink-0"> <div class="flex items-center gap-2 shrink-0">
<ThemePicker <ThemePicker
@@ -127,22 +125,23 @@
// Force reactivity by updating the wishlist object // Force reactivity by updating the wishlist object
wishlist.theme = theme; wishlist.theme = theme;
}} }}
color={wishlistColor}
/> />
<ColorPicker <ColorPicker
bind:color={wishlistColor} bind:color={wishlistColor}
onchange={() => onColorUpdate(wishlistColor)} onchange={() => onColorUpdate(wishlistColor)}
size="sm"
/> />
</div> </div>
</div> </div>
<Card style={cardStyle}> <!-- Settings Card -->
<Card>
<CardContent class="pt-6 space-y-4"> <CardContent class="pt-6 space-y-4">
<!-- Description -->
<div class="space-y-2"> <div class="space-y-2">
<div class="flex items-center justify-between gap-2"> <div class="flex items-center justify-between gap-2">
<Label for="wishlist-description">{t.form.descriptionOptional}</Label> <Label for="wishlist-description">{t.form.descriptionOptional}</Label>
<IconButton <button
type="button"
onclick={() => { onclick={() => {
if (editingDescription) { if (editingDescription) {
saveDescription(); saveDescription();
@@ -150,17 +149,15 @@
editingDescription = true; editingDescription = true;
} }
}} }}
color={wishlistColor} class="flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-full border border-input hover:bg-accent transition-colors"
size="sm" aria-label={editingDescription ? "Save description" : "Edit description"}
class="flex-shrink-0"
aria-label={editingDescription ? 'Save description' : 'Edit description'}
> >
{#if editingDescription} {#if editingDescription}
<Check class="w-4 h-4" /> <Check class="w-4 h-4" />
{:else} {:else}
<Pencil class="w-4 h-4" /> <Pencil class="w-4 h-4" />
{/if} {/if}
</IconButton> </button>
</div> </div>
{#if editingDescription} {#if editingDescription}
<Textarea <Textarea
@@ -169,40 +166,38 @@
class="w-full" class="w-full"
rows={3} rows={3}
onkeydown={(e) => { onkeydown={(e) => {
if (e.key === 'Escape') { if (e.key === "Escape") {
wishlistDescription = wishlist.description || ''; wishlistDescription = wishlist.description || "";
editingDescription = false; editingDescription = false;
} }
}} }}
autofocus autofocus
/> />
{:else} {:else}
<div <div class="w-full py-2 px-3 rounded-md border border-input bg-transparent text-sm min-h-[80px]">
class="w-full py-2 px-3 rounded-md border border-input bg-transparent text-sm min-h-[80px]"
>
{wishlistDescription || t.form.noDescription} {wishlistDescription || t.form.noDescription}
</div> </div>
{/if} {/if}
</div> </div>
<!-- End Date -->
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-4"> <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-4">
<Label for="wishlist-end-date">{t.form.endDateOptional}</Label> <Label for="wishlist-end-date">{t.form.endDateOptional}</Label>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
{#if wishlistEndDate} {#if wishlistEndDate}
<IconButton <button
type="button"
onclick={clearEndDate} onclick={clearEndDate}
color={wishlistColor} class="flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-full border border-input hover:bg-accent transition-colors"
size="sm"
class="flex-shrink-0"
aria-label="Clear end date" aria-label="Clear end date"
> >
<X class="w-4 h-4" /> <X class="w-4 h-4" />
</IconButton> </button>
{/if} {/if}
<Input <Input
id="wishlist-end-date" id="wishlist-end-date"
type="date" type="date"
value={wishlistEndDate || ''} value={wishlistEndDate || ""}
onchange={handleEndDateChange} onchange={handleEndDateChange}
class="w-full sm:w-auto" class="w-full sm:w-auto"
/> />
+46 -19
View File
@@ -1,18 +1,18 @@
<script lang="ts"> <script lang="ts">
import ThemedCard from '$lib/components/ui/ThemedCard.svelte'; import { Card, CardContent } from "$lib/components/ui/card";
import type { Item } from '$lib/db/schema'; import type { Item } from "$lib/server/schema";
import { GripVertical, ExternalLink } from '@lucide/svelte'; import { GripVertical, ExternalLink } from "lucide-svelte";
import { Button } from '$lib/components/ui/button'; import { getCardStyle } from '$lib/utils/colors';
import { Button } from "$lib/components/ui/button";
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
import { formatPrice } from '$lib/utils/currency'; import ThemeCard from '$lib/components/themes/ThemeCard.svelte';
interface Props { interface Props {
item: Item; item: Item;
showImage?: boolean; showImage?: boolean;
children?: import('svelte').Snippet; children?: any;
showDragHandle?: boolean; showDragHandle?: boolean;
theme?: string | null; theme?: string | null;
wishlistColor?: string | null;
} }
let { let {
@@ -20,14 +20,43 @@
showImage = true, showImage = true,
children, children,
showDragHandle = false, showDragHandle = false,
theme = null, theme = null
wishlistColor = null
}: Props = $props(); }: Props = $props();
const t = $derived(languageStore.t); const t = $derived(languageStore.t);
const currencySymbols: Record<string, string> = {
DKK: "kr",
EUR: "€",
USD: "$",
SEK: "kr",
NOK: "kr",
GBP: "£",
};
function formatPrice(
price: string | null,
currency: string | null,
): string {
if (!price) return "";
const symbol = currency ? currencySymbols[currency] || currency : "kr";
const amount = parseFloat(price).toFixed(2);
// For Danish, Swedish, Norwegian kroner, put symbol after the amount
if (currency && ["DKK", "SEK", "NOK"].includes(currency)) {
return `${amount} ${symbol}`;
}
// For other currencies, put symbol before
return `${symbol}${amount}`;
}
const cardStyle = $derived(getCardStyle(item.color));
</script> </script>
<ThemedCard color={item.color} fallbackColor={wishlistColor} theme={theme}> <Card style={cardStyle} class="relative overflow-hidden">
<ThemeCard themeName={theme} color={item.color} />
<CardContent class="p-6 relative z-10">
<div class="flex gap-4"> <div class="flex gap-4">
{#if showDragHandle} {#if showDragHandle}
<div <div
@@ -47,7 +76,7 @@
src="/api/image-proxy?url={encodeURIComponent(item.imageUrl)}" src="/api/image-proxy?url={encodeURIComponent(item.imageUrl)}"
alt={item.title} alt={item.title}
class="w-full md:w-32 h-32 object-cover rounded-lg" class="w-full md:w-32 h-32 object-cover rounded-lg"
onerror={(e: Event) => ((e.currentTarget as HTMLImageElement).src = item.imageUrl)} onerror={(e) => e.currentTarget.src = item.imageUrl}
/> />
{/if} {/if}
@@ -57,17 +86,14 @@
</div> </div>
{#if item.description} {#if item.description}
<p <p class="text-muted-foreground break-words whitespace-pre-wrap" style="overflow-wrap: anywhere;">{item.description}</p>
class="text-muted-foreground break-words whitespace-pre-wrap"
style="overflow-wrap: anywhere;"
>
{item.description}
</p>
{/if} {/if}
<div class="flex flex-wrap gap-2 items-center text-sm mt-2"> <div class="flex flex-wrap gap-2 items-center text-sm mt-2">
{#if item.price} {#if item.price}
<span class="font-medium">{formatPrice(item.price, item.currency)}</span> <span class="font-medium"
>{formatPrice(item.price, item.currency)}</span
>
{/if} {/if}
</div> </div>
@@ -93,4 +119,5 @@
</div> </div>
</div> </div>
</div> </div>
</ThemedCard> </CardContent>
</Card>
-193
View File
@@ -1,193 +0,0 @@
import { pgTable, text, timestamp, numeric, boolean, primaryKey } from 'drizzle-orm/pg-core';
import { relations } from 'drizzle-orm';
import { createId } from '@paralleldrive/cuid2';
import type { AdapterAccountType } from '@auth/core/adapters';
export const users = pgTable('user', {
id: text('id')
.primaryKey()
.$defaultFn(() => createId()),
name: text('name'),
email: text('email').unique(),
emailVerified: timestamp('emailVerified', { mode: 'date' }),
image: text('image'),
password: text('password').notNull(),
username: text('username').unique(),
dashboardTheme: text('dashboard_theme').default('none'),
dashboardColor: text('dashboard_color'),
lastLogin: timestamp('last_login', { mode: 'date' }),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull()
});
export const accounts = pgTable(
'account',
{
userId: text('userId')
.notNull()
.references(() => users.id, { onDelete: 'cascade' }),
type: text('type').$type<AdapterAccountType>().notNull(),
provider: text('provider').notNull(),
providerAccountId: text('providerAccountId').notNull(),
refresh_token: text('refresh_token'),
access_token: text('access_token'),
expires_at: numeric('expires_at'),
token_type: text('token_type'),
scope: text('scope'),
id_token: text('id_token'),
session_state: text('session_state')
},
(account) => ({
compoundKey: primaryKey({
columns: [account.provider, account.providerAccountId]
})
})
);
export const sessions = pgTable('session', {
sessionToken: text('sessionToken').primaryKey(),
userId: text('userId')
.notNull()
.references(() => users.id, { onDelete: 'cascade' }),
expires: timestamp('expires', { mode: 'date' }).notNull()
});
export const verificationTokens = pgTable(
'verificationToken',
{
identifier: text('identifier').notNull(),
token: text('token').notNull(),
expires: timestamp('expires', { mode: 'date' }).notNull()
},
(verificationToken) => ({
compositePk: primaryKey({
columns: [verificationToken.identifier, verificationToken.token]
})
})
);
export const wishlists = pgTable('wishlists', {
id: text('id')
.primaryKey()
.$defaultFn(() => createId()),
userId: text('user_id').references(() => users.id, { onDelete: 'set null' }),
title: text('title').notNull(),
description: text('description'),
ownerToken: text('owner_token').notNull().unique(),
publicToken: text('public_token').notNull().unique(),
isFavorite: boolean('is_favorite').default(false).notNull(),
color: text('color'),
theme: text('theme').default('none'),
endDate: timestamp('end_date', { mode: 'date' }),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull()
});
export const wishlistsRelations = relations(wishlists, ({ one, many }) => ({
user: one(users, {
fields: [wishlists.userId],
references: [users.id]
}),
items: many(items),
savedBy: many(savedWishlists)
}));
export const items = pgTable('items', {
id: text('id')
.primaryKey()
.$defaultFn(() => createId()),
wishlistId: text('wishlist_id')
.notNull()
.references(() => wishlists.id, { onDelete: 'cascade' }),
title: text('title').notNull(),
description: text('description'),
link: text('link'),
imageUrl: text('image_url'),
price: numeric('price', { precision: 10, scale: 2 }),
currency: text('currency').default('DKK'),
color: text('color'),
order: numeric('order').notNull().default('0'),
isReserved: boolean('is_reserved').default(false).notNull(),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull()
});
export const itemsRelations = relations(items, ({ one, many }) => ({
wishlist: one(wishlists, {
fields: [items.wishlistId],
references: [wishlists.id]
}),
reservations: many(reservations)
}));
export const reservations = pgTable('reservations', {
id: text('id')
.primaryKey()
.$defaultFn(() => createId()),
itemId: text('item_id')
.notNull()
.references(() => items.id, { onDelete: 'cascade' }),
userId: text('user_id').references(() => users.id, { onDelete: 'set null' }),
reserverName: text('reserver_name'),
createdAt: timestamp('created_at').defaultNow().notNull()
});
export const reservationsRelations = relations(reservations, ({ one }) => ({
item: one(items, {
fields: [reservations.itemId],
references: [items.id]
}),
user: one(users, {
fields: [reservations.userId],
references: [users.id]
})
}));
export const savedWishlists = pgTable('saved_wishlists', {
id: text('id')
.primaryKey()
.$defaultFn(() => createId()),
userId: text('user_id')
.notNull()
.references(() => users.id, { onDelete: 'cascade' }),
wishlistId: text('wishlist_id')
.notNull()
.references(() => wishlists.id, { onDelete: 'cascade' }),
ownerToken: text('owner_token'), // Stores the owner token if user has edit access (claimed via edit link)
isFavorite: boolean('is_favorite').default(false).notNull(),
createdAt: timestamp('created_at').defaultNow().notNull()
});
export const savedWishlistsRelations = relations(savedWishlists, ({ one }) => ({
user: one(users, {
fields: [savedWishlists.userId],
references: [users.id]
}),
wishlist: one(wishlists, {
fields: [savedWishlists.wishlistId],
references: [wishlists.id]
})
}));
export const usersRelations = relations(users, ({ many }) => ({
wishlists: many(wishlists),
savedWishlists: many(savedWishlists),
reservations: many(reservations)
}));
export type User = typeof users.$inferSelect;
export type NewUser = typeof users.$inferInsert;
export type Account = typeof accounts.$inferSelect;
export type NewAccount = typeof accounts.$inferInsert;
export type Session = typeof sessions.$inferSelect;
export type NewSession = typeof sessions.$inferInsert;
export type VerificationToken = typeof verificationTokens.$inferSelect;
export type NewVerificationToken = typeof verificationTokens.$inferInsert;
export type Wishlist = typeof wishlists.$inferSelect;
export type NewWishlist = typeof wishlists.$inferInsert;
export type Item = typeof items.$inferSelect;
export type NewItem = typeof items.$inferInsert;
export type Reservation = typeof reservations.$inferSelect;
export type NewReservation = typeof reservations.$inferInsert;
export type SavedWishlist = typeof savedWishlists.$inferSelect;
export type NewSavedWishlist = typeof savedWishlists.$inferInsert;
+4 -8
View File
@@ -25,11 +25,9 @@ export const da: Translation = {
emptyWishlists: 'Du har ikke oprettet nogen ønskelister endnu.', emptyWishlists: 'Du har ikke oprettet nogen ønskelister endnu.',
emptyWishlistsAction: 'Opret Din Første Ønskeliste', emptyWishlistsAction: 'Opret Din Første Ønskeliste',
emptyClaimedWishlists: 'Du har ikke taget ejerskab af nogen ønskelister endnu.', emptyClaimedWishlists: 'Du har ikke taget ejerskab af nogen ønskelister endnu.',
emptyClaimedWishlistsDescription: emptyClaimedWishlistsDescription: 'Når nogen deler et redigeringslink med dig, kan du tage ejerskab af det for at administrere det fra dit dashboard.',
'Når nogen deler et redigeringslink med dig, kan du tage ejerskab af det for at administrere det fra dit dashboard.',
emptySavedWishlists: 'Du har ikke gemt nogen ønskelister endnu.', emptySavedWishlists: 'Du har ikke gemt nogen ønskelister endnu.',
emptySavedWishlistsDescription: emptySavedWishlistsDescription: 'Når du ser en andens ønskeliste, kan du gemme den for nemt at finde den senere.',
'Når du ser en andens ønskeliste, kan du gemme den for nemt at finde den senere.',
by: 'af', by: 'af',
ends: 'Slutter', ends: 'Slutter',
welcomeBack: 'Velkommen tilbage', welcomeBack: 'Velkommen tilbage',
@@ -65,11 +63,9 @@ export const da: Translation = {
alreadyInDashboard: 'Denne ønskeliste er allerede it dit dashboard.', alreadyInDashboard: 'Denne ønskeliste er allerede it dit dashboard.',
alreadyClaimed: 'Denne ønskeliste er allerede i dit dashboard som en ejet ønskeliste.', alreadyClaimed: 'Denne ønskeliste er allerede i dit dashboard som en ejet ønskeliste.',
claimDescription: 'Tag ejerskab af denne ønskeliste for at tilføje den til dit dashboard', claimDescription: 'Tag ejerskab af denne ønskeliste for at tilføje den til dit dashboard',
claimedDescription: claimedDescription: 'Du har taget ejerskab af denne ønskeliste og kan tilgå den fra dit dashboard',
'Du har taget ejerskab af denne ønskeliste og kan tilgå den fra dit dashboard',
deleteWishlist: 'Slet Ønskeliste', deleteWishlist: 'Slet Ønskeliste',
deleteConfirm: deleteConfirm: 'Er du sikker på, at du vil slette denne ønskeliste? Denne handling kan ikke fortrydes.',
'Er du sikker på, at du vil slette denne ønskeliste? Denne handling kan ikke fortrydes.',
lockDeletion: 'Lås Sletning', lockDeletion: 'Lås Sletning',
unlockDeletion: 'Lås Op for Sletning', unlockDeletion: 'Lås Op for Sletning',
shareViewOnly: 'Del med venner (afslører reservationer)', shareViewOnly: 'Del med venner (afslører reservationer)',
+2 -4
View File
@@ -22,11 +22,9 @@ export const en = {
emptyWishlists: "You haven't created any wishlists yet.", emptyWishlists: "You haven't created any wishlists yet.",
emptyWishlistsAction: 'Create Your First Wishlist', emptyWishlistsAction: 'Create Your First Wishlist',
emptyClaimedWishlists: "You haven't claimed any wishlists yet.", emptyClaimedWishlists: "You haven't claimed any wishlists yet.",
emptyClaimedWishlistsDescription: emptyClaimedWishlistsDescription: "When someone shares an edit link with you, you can claim it to manage it from your dashboard.",
'When someone shares an edit link with you, you can claim it to manage it from your dashboard.',
emptySavedWishlists: "You haven't saved any wishlists yet.", emptySavedWishlists: "You haven't saved any wishlists yet.",
emptySavedWishlistsDescription: emptySavedWishlistsDescription: "When viewing someone's wishlist, you can save it to easily find it later.",
"When viewing someone's wishlist, you can save it to easily find it later.",
by: 'by', by: 'by',
ends: 'Ends', ends: 'Ends',
welcomeBack: 'Welcome back', welcomeBack: 'Welcome back',
+1
View File
@@ -0,0 +1 @@
+1 -1
View File
@@ -1,7 +1,7 @@
import { drizzle } from 'drizzle-orm/postgres-js'; import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres'; import postgres from 'postgres';
import { env } from '$env/dynamic/private'; import { env } from '$env/dynamic/private';
import * as schema from '$lib/db/schema'; import * as schema from './schema';
const client = postgres(env.DATABASE_URL!); const client = postgres(env.DATABASE_URL!);
export const db = drizzle(client, { schema }); export const db = drizzle(client, { schema });
+175
View File
@@ -0,0 +1,175 @@
import { pgTable, text, timestamp, numeric, boolean, primaryKey } from 'drizzle-orm/pg-core';
import { relations } from 'drizzle-orm';
import { createId } from '@paralleldrive/cuid2';
import type { AdapterAccountType } from '@auth/core/adapters';
export const users = pgTable('user', {
id: text('id')
.primaryKey()
.$defaultFn(() => createId()),
name: text('name'),
email: text('email').unique(),
emailVerified: timestamp('emailVerified', { mode: 'date' }),
image: text('image'),
password: text('password'),
username: text('username').unique(),
dashboardTheme: text('dashboard_theme').default('none')
});
export const accounts = pgTable(
'account',
{
userId: text('userId')
.notNull()
.references(() => users.id, { onDelete: 'cascade' }),
type: text('type').$type<AdapterAccountType>().notNull(),
provider: text('provider').notNull(),
providerAccountId: text('providerAccountId').notNull(),
refresh_token: text('refresh_token'),
access_token: text('access_token'),
expires_at: numeric('expires_at'),
token_type: text('token_type'),
scope: text('scope'),
id_token: text('id_token'),
session_state: text('session_state')
},
(account) => ({
compoundKey: primaryKey({
columns: [account.provider, account.providerAccountId]
})
})
);
export const sessions = pgTable('session', {
sessionToken: text('sessionToken').primaryKey(),
userId: text('userId')
.notNull()
.references(() => users.id, { onDelete: 'cascade' }),
expires: timestamp('expires', { mode: 'date' }).notNull()
});
export const verificationTokens = pgTable(
'verificationToken',
{
identifier: text('identifier').notNull(),
token: text('token').notNull(),
expires: timestamp('expires', { mode: 'date' }).notNull()
},
(verificationToken) => ({
compositePk: primaryKey({
columns: [verificationToken.identifier, verificationToken.token]
})
})
);
export const wishlists = pgTable('wishlists', {
id: text('id').primaryKey().$defaultFn(() => createId()),
userId: text('user_id').references(() => users.id, { onDelete: 'set null' }),
title: text('title').notNull(),
description: text('description'),
ownerToken: text('owner_token').notNull().unique(),
publicToken: text('public_token').notNull().unique(),
isFavorite: boolean('is_favorite').default(false).notNull(),
color: text('color'),
theme: text('theme').default('none'),
endDate: timestamp('end_date', { mode: 'date' }),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull()
});
export const wishlistsRelations = relations(wishlists, ({ one, many }) => ({
user: one(users, {
fields: [wishlists.userId],
references: [users.id]
}),
items: many(items),
savedBy: many(savedWishlists)
}));
export const items = pgTable('items', {
id: text('id').primaryKey().$defaultFn(() => createId()),
wishlistId: text('wishlist_id')
.notNull()
.references(() => wishlists.id, { onDelete: 'cascade' }),
title: text('title').notNull(),
description: text('description'),
link: text('link'),
imageUrl: text('image_url'),
price: numeric('price', { precision: 10, scale: 2 }),
currency: text('currency').default('DKK'),
color: text('color'),
order: numeric('order').notNull().default('0'),
isReserved: boolean('is_reserved').default(false).notNull(),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull()
});
export const itemsRelations = relations(items, ({ one, many }) => ({
wishlist: one(wishlists, {
fields: [items.wishlistId],
references: [wishlists.id]
}),
reservations: many(reservations)
}));
export const reservations = pgTable('reservations', {
id: text('id').primaryKey().$defaultFn(() => createId()),
itemId: text('item_id')
.notNull()
.references(() => items.id, { onDelete: 'cascade' }),
userId: text('user_id').references(() => users.id, { onDelete: 'set null' }),
reserverName: text('reserver_name'),
createdAt: timestamp('created_at').defaultNow().notNull()
});
export const reservationsRelations = relations(reservations, ({ one }) => ({
item: one(items, {
fields: [reservations.itemId],
references: [items.id]
}),
user: one(users, {
fields: [reservations.userId],
references: [users.id]
})
}));
export const savedWishlists = pgTable('saved_wishlists', {
id: text('id').primaryKey().$defaultFn(() => createId()),
userId: text('user_id')
.notNull()
.references(() => users.id, { onDelete: 'cascade' }),
wishlistId: text('wishlist_id')
.notNull()
.references(() => wishlists.id, { onDelete: 'cascade' }),
ownerToken: text('owner_token'), // Stores the owner token if user has edit access (claimed via edit link)
isFavorite: boolean('is_favorite').default(false).notNull(),
createdAt: timestamp('created_at').defaultNow().notNull()
});
export const savedWishlistsRelations = relations(savedWishlists, ({ one }) => ({
user: one(users, {
fields: [savedWishlists.userId],
references: [users.id]
}),
wishlist: one(wishlists, {
fields: [savedWishlists.wishlistId],
references: [wishlists.id]
})
}));
export const usersRelations = relations(users, ({ many }) => ({
wishlists: many(wishlists),
savedWishlists: many(savedWishlists),
reservations: many(reservations)
}));
export type User = typeof users.$inferSelect;
export type NewUser = typeof users.$inferInsert;
export type Wishlist = typeof wishlists.$inferSelect;
export type NewWishlist = typeof wishlists.$inferInsert;
export type Item = typeof items.$inferSelect;
export type NewItem = typeof items.$inferInsert;
export type Reservation = typeof reservations.$inferSelect;
export type NewReservation = typeof reservations.$inferInsert;
export type SavedWishlist = typeof savedWishlists.$inferSelect;
export type NewSavedWishlist = typeof savedWishlists.$inferInsert;
-132
View File
@@ -1,132 +0,0 @@
export function sanitizeString(
input: string | null | undefined,
maxLength: number = 1000
): string | null {
if (input === null || input === undefined) {
return null;
}
const trimmed = input.trim();
if (trimmed.length > maxLength) {
throw new Error(`Input exceeds maximum length of ${maxLength}`);
}
return trimmed;
}
export function sanitizeUrl(url: string | null | undefined): string | null {
if (!url) {
return null;
}
return url.trim();
}
export function sanitizeText(
input: string | null | undefined,
maxLength: number = 10000
): string | null {
if (input === null || input === undefined) {
return null;
}
const trimmed = input.trim();
if (trimmed.length > maxLength) {
throw new Error(`Text exceeds maximum length of ${maxLength}`);
}
return trimmed;
}
export function sanitizePrice(price: string | null | undefined): number | null {
if (!price) {
return null;
}
const parsed = parseFloat(price.trim());
if (isNaN(parsed)) {
throw new Error('Invalid price format');
}
if (parsed < 0) {
throw new Error('Price cannot be negative');
}
return parsed;
}
export function sanitizeColor(color: string | null | undefined): string | null {
if (!color) {
return null;
}
return color.trim();
}
export function sanitizeCurrency(currency: string | null | undefined): string {
if (!currency) {
return 'DKK';
}
return currency.trim().toUpperCase();
}
export function sanitizeUsername(username: string): string {
const trimmed = username.trim().toLowerCase();
if (trimmed.length < 3 || trimmed.length > 50) {
throw new Error('Username must be between 3 and 50 characters');
}
return trimmed;
}
export function sanitizeId(id: string | null | undefined): string {
if (!id) {
throw new Error('ID is required');
}
const trimmed = id.trim();
if (trimmed.length === 0 || trimmed.length > 100) {
throw new Error('Invalid ID');
}
return trimmed;
}
export function sanitizeToken(token: string | null | undefined): string {
if (!token) {
throw new Error('Token is required');
}
const trimmed = token.trim();
if (trimmed.length === 0 || trimmed.length > 100) {
throw new Error('Invalid token');
}
return trimmed;
}
// Zod schemas for type-safe form validation
import { z } from 'zod';
import { CURRENCIES } from '$lib/utils/currency';
export const currencySchema = z.enum(CURRENCIES);
export const itemSchema = z.object({
title: z.string().min(1, 'Title is required').max(255),
description: z.preprocess(val => (val === '' ? null : val), z.string().max(2000).optional().nullable()),
link: z.preprocess(val => (val === '' ? null : val), z.string().url('Invalid URL').optional().nullable()),
imageUrl: z.preprocess(val => (val === '' ? null : val), z.string().url('Invalid image URL').optional().nullable()),
price: z.coerce.number().nonnegative().optional().nullable(),
currency: currencySchema.default('DKK'),
color: z.preprocess(val => (val === '' ? null : val), z.string().optional().nullable()),
order: z.coerce.number().int().nonnegative().optional()
});
export const updateItemSchema = itemSchema.extend({
itemId: z.string().min(1, 'Item ID is required')
});
export const wishlistSchema = z.object({
title: z.string().min(1, 'Title is required').max(255),
description: z.string().max(2000).optional().nullable(),
color: z.string().optional().nullable(),
theme: z.string().optional().nullable().transform((val) => val || 'none'),
endDate: z.coerce.date().optional().nullable()
});
export const reorderSchema = z.array(
z.object({
id: z.string(),
order: z.number().int().nonnegative()
})
);
export type ItemFormData = z.infer<typeof itemSchema>;
export type UpdateItemFormData = z.infer<typeof updateItemSchema>;
export type WishlistFormData = z.infer<typeof wishlistSchema>;
+1 -1
View File
@@ -48,7 +48,7 @@ export const languageStore = new LanguageStore();
// Helper function to get nested translation value // Helper function to get nested translation value
export function t(path: string): string { export function t(path: string): string {
const keys = path.split('.'); const keys = path.split('.');
let value: unknown = languageStore.t; let value: any = languageStore.t;
for (const key of keys) { for (const key of keys) {
if (value && typeof value === 'object' && key in value) { if (value && typeof value === 'object' && key in value) {
+6 -6
View File
@@ -5,7 +5,6 @@ type ResolvedTheme = 'light' | 'dark';
class ThemeStore { class ThemeStore {
current = $state<Theme>('system'); current = $state<Theme>('system');
resolved = $state<ResolvedTheme>('light');
constructor() { constructor() {
if (browser) { if (browser) {
@@ -25,12 +24,9 @@ class ThemeStore {
private applyTheme() { private applyTheme() {
if (!browser) return; if (!browser) return;
const isDark = const isDark = this.current === 'dark' ||
this.current === 'dark' ||
(this.current === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); (this.current === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
this.resolved = isDark ? 'dark' : 'light';
if (isDark) { if (isDark) {
document.documentElement.classList.add('dark'); document.documentElement.classList.add('dark');
} else { } else {
@@ -39,7 +35,11 @@ class ThemeStore {
} }
getResolvedTheme(): ResolvedTheme { getResolvedTheme(): ResolvedTheme {
return this.resolved; if (!browser) return 'light';
const isDark = this.current === 'dark' ||
(this.current === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
return isDark ? 'dark' : 'light';
} }
toggle() { toggle() {
+4 -4
View File
@@ -1,13 +1,13 @@
import { clsx, type ClassValue } from 'clsx'; import { clsx, type ClassValue } from "clsx";
import { twMerge } from 'tailwind-merge'; import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) { export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs)); return twMerge(clsx(inputs));
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
export type WithoutChild<T> = T extends { child?: any } ? Omit<T, 'child'> : T; export type WithoutChild<T> = T extends { child?: any } ? Omit<T, "child"> : T;
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
export type WithoutChildren<T> = T extends { children?: any } ? Omit<T, 'children'> : T; export type WithoutChildren<T> = T extends { children?: any } ? Omit<T, "children"> : T;
export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>; export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & { ref?: U | null }; export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & { ref?: U | null };
+3 -5
View File
@@ -11,10 +11,8 @@ export function hexToRgba(hex: string, alpha: number): string {
/** /**
* Generate card style string with color, transparency, and blur * Generate card style string with color, transparency, and blur
*/ */
export function getCardStyle(color: string | null, fallbackColor?: string | null): string { export function getCardStyle(color: string | null): string {
const activeColor = color || fallbackColor; if (!color) return '';
if (!activeColor) return '';
const opacity = color ? 0.2 : 0.15; return `background-color: ${hexToRgba(color, 0.2)} !important; backdrop-filter: blur(10px) !important; -webkit-backdrop-filter: blur(10px) !important;`;
return `background-color: ${hexToRgba(activeColor, opacity)} !important; backdrop-filter: blur(10px) !important; -webkit-backdrop-filter: blur(10px) !important;`;
} }
-41
View File
@@ -1,41 +0,0 @@
/**
* Currency utilities for formatting and displaying prices
*/
export const CURRENCIES = ['DKK', 'EUR', 'USD', 'SEK', 'NOK', 'GBP'] as const;
export type Currency = (typeof CURRENCIES)[number];
export const currencySymbols: Record<Currency, string> = {
DKK: 'kr',
EUR: '€',
USD: '$',
SEK: 'kr',
NOK: 'kr',
GBP: '£'
};
/**
* Check if a currency symbol should be placed after the amount
*/
export function isPostfixCurrency(currency: Currency): boolean {
return ['DKK', 'SEK', 'NOK'].includes(currency);
}
/**
* Format a price with the appropriate currency symbol
*/
export function formatPrice(price: string | number | null, currency: Currency | null): string {
if (!price) return '';
const symbol = currency ? currencySymbols[currency] || currency : 'kr';
const amount = typeof price === 'string' ? parseFloat(price).toFixed(2) : price.toFixed(2);
// For Danish, Swedish, Norwegian kroner, put symbol after the amount
if (currency && isPostfixCurrency(currency)) {
return `${amount} ${symbol}`;
}
// For other currencies, put symbol before
return `${symbol}${amount}`;
}
+8 -5
View File
@@ -36,7 +36,8 @@ export function addLocalWishlist(wishlist: LocalWishlist): void {
try { try {
const wishlists = getLocalWishlists(); const wishlists = getLocalWishlists();
const exists = wishlists.some((w) => w.ownerToken === wishlist.ownerToken); // Check if already exists
const exists = wishlists.some(w => w.ownerToken === wishlist.ownerToken);
if (exists) return; if (exists) return;
wishlists.push(wishlist); wishlists.push(wishlist);
@@ -54,7 +55,7 @@ export function forgetLocalWishlist(ownerToken: string): void {
try { try {
const wishlists = getLocalWishlists(); const wishlists = getLocalWishlists();
const filtered = wishlists.filter((w) => w.ownerToken !== ownerToken); const filtered = wishlists.filter(w => w.ownerToken !== ownerToken);
localStorage.setItem(LOCAL_WISHLISTS_KEY, JSON.stringify(filtered)); localStorage.setItem(LOCAL_WISHLISTS_KEY, JSON.stringify(filtered));
} catch (error) { } catch (error) {
console.error('Failed to forget local wishlist:', error); console.error('Failed to forget local wishlist:', error);
@@ -79,7 +80,7 @@ export function clearLocalWishlists(): void {
*/ */
export function isLocalWishlist(ownerToken: string): boolean { export function isLocalWishlist(ownerToken: string): boolean {
const wishlists = getLocalWishlists(); const wishlists = getLocalWishlists();
return wishlists.some((w) => w.ownerToken === ownerToken); return wishlists.some(w => w.ownerToken === ownerToken);
} }
/** /**
@@ -90,8 +91,10 @@ export function toggleLocalFavorite(ownerToken: string): void {
try { try {
const wishlists = getLocalWishlists(); const wishlists = getLocalWishlists();
const updated = wishlists.map((w) => const updated = wishlists.map(w =>
w.ownerToken === ownerToken ? { ...w, isFavorite: !w.isFavorite } : w w.ownerToken === ownerToken
? { ...w, isFavorite: !w.isFavorite }
: w
); );
localStorage.setItem(LOCAL_WISHLISTS_KEY, JSON.stringify(updated)); localStorage.setItem(LOCAL_WISHLISTS_KEY, JSON.stringify(updated));
} catch (error) { } catch (error) {
+11 -3
View File
@@ -1,6 +1,6 @@
import { themeStore } from '$lib/stores/theme.svelte'; import { themeStore } from '$lib/stores/theme.svelte';
export type ThemePattern = 'snow' | 'none'; export type ThemePattern = 'waves' | 'geometric' | 'dots' | 'none';
export interface Theme { export interface Theme {
name: string; name: string;
@@ -13,8 +13,16 @@ export const AVAILABLE_THEMES: Record<string, Theme> = {
pattern: 'none' pattern: 'none'
}, },
waves: { waves: {
name: 'Snow', name: 'Waves',
pattern: 'snow' pattern: 'waves'
},
geometric: {
name: 'Geometric',
pattern: 'geometric'
},
dots: {
name: 'Dots',
pattern: 'dots'
} }
}; };
+14 -14
View File
@@ -7,12 +7,12 @@ type UpdateField = {
}; };
async function updateWishlist(field: UpdateField): Promise<boolean> { async function updateWishlist(field: UpdateField): Promise<boolean> {
const response = await fetch('?/updateWishlist', { const response = await fetch("?/updateWishlist", {
method: 'POST', method: "POST",
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' "Content-Type": "application/x-www-form-urlencoded",
}, },
body: new URLSearchParams(field) body: new URLSearchParams(field),
}); });
if (!response.ok) { if (!response.ok) {
@@ -27,34 +27,34 @@ export async function updateTitle(title: string): Promise<boolean> {
} }
export async function updateDescription(description: string | null): Promise<boolean> { export async function updateDescription(description: string | null): Promise<boolean> {
return updateWishlist({ description: description || '' }); return updateWishlist({ description: description || "" });
} }
export async function updateColor(color: string | null): Promise<boolean> { export async function updateColor(color: string | null): Promise<boolean> {
return updateWishlist({ color: color || '' }); return updateWishlist({ color: color || "" });
} }
export async function updateEndDate(endDate: string | null): Promise<boolean> { export async function updateEndDate(endDate: string | null): Promise<boolean> {
return updateWishlist({ endDate: endDate || '' }); return updateWishlist({ endDate: endDate || "" });
} }
export async function updateTheme(theme: string | null): Promise<boolean> { export async function updateTheme(theme: string | null): Promise<boolean> {
return updateWishlist({ theme: theme || 'none' }); return updateWishlist({ theme: theme || "none" });
} }
export async function reorderItems(items: Array<{ id: string; order: number }>): Promise<boolean> { export async function reorderItems(items: Array<{ id: string; order: number }>): Promise<boolean> {
const response = await fetch('?/reorderItems', { const response = await fetch("?/reorderItems", {
method: 'POST', method: "POST",
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' "Content-Type": "application/x-www-form-urlencoded",
}, },
body: new URLSearchParams({ body: new URLSearchParams({
items: JSON.stringify(items) items: JSON.stringify(items),
}) }),
}); });
if (!response.ok) { if (!response.ok) {
console.error('Failed to update item order'); console.error("Failed to update item order");
return false; return false;
} }
return true; return true;
+1 -42
View File
@@ -1,9 +1,4 @@
import type { PageServerLoad, Actions } from './$types'; import type { PageServerLoad } from './$types';
import { db } from '$lib/server/db';
import { wishlists } from '$lib/db/schema';
import { createId } from '@paralleldrive/cuid2';
import { fail } from '@sveltejs/kit';
import { wishlistSchema } from '$lib/server/validation';
export const load: PageServerLoad = async (event) => { export const load: PageServerLoad = async (event) => {
const session = await event.locals.auth(); const session = await event.locals.auth();
@@ -11,39 +6,3 @@ export const load: PageServerLoad = async (event) => {
session session
}; };
}; };
export const actions: Actions = {
createWishlist: async ({ request, locals }) => {
const formData = await request.formData();
const rawData = Object.fromEntries(formData);
const result = wishlistSchema.safeParse(rawData);
if (!result.success) {
return fail(400, { success: false, error: result.error.errors.map(e => e.message).join(', ') });
}
const session = await locals.auth();
const userId = session?.user?.id || null;
const ownerToken = createId();
const publicToken = createId();
const [wishlist] = await db
.insert(wishlists)
.values({
...result.data,
ownerToken,
publicToken,
userId
})
.returning();
return {
success: true,
ownerToken,
publicToken,
title: wishlist.title,
createdAt: wishlist.createdAt
};
}
};
+39 -40
View File
@@ -3,23 +3,16 @@
import { Input } from '$lib/components/ui/input'; import { Input } from '$lib/components/ui/input';
import { Label } from '$lib/components/ui/label'; import { Label } from '$lib/components/ui/label';
import { Textarea } from '$lib/components/ui/textarea'; import { Textarea } from '$lib/components/ui/textarea';
import { import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '$lib/components/ui/card';
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle
} from '$lib/components/ui/card';
import { ThemeToggle } from '$lib/components/ui/theme-toggle'; import { ThemeToggle } from '$lib/components/ui/theme-toggle';
import { LanguageToggle } from '$lib/components/ui/language-toggle'; import { LanguageToggle } from '$lib/components/ui/language-toggle';
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import ColorPicker from '$lib/components/ui/ColorPicker.svelte'; import ColorPicker from '$lib/components/ui/ColorPicker.svelte';
import type { PageData, ActionData } from './$types'; import type { PageData } from './$types';
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
import { addLocalWishlist } from '$lib/utils/localWishlists'; import { addLocalWishlist } from '$lib/utils/localWishlists';
import { enhance } from '$app/forms';
let { data, form }: { data: PageData; form: ActionData } = $props(); let { data }: { data: PageData } = $props();
const t = $derived(languageStore.t); const t = $derived(languageStore.t);
@@ -27,6 +20,40 @@
let description = $state(''); let description = $state('');
let color = $state<string | null>(null); let color = $state<string | null>(null);
let isCreating = $state(false); let isCreating = $state(false);
async function createWishlist() {
if (!title.trim()) return;
isCreating = true;
try {
const response = await fetch('/api/wishlists', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ title, description, color })
});
if (response.ok) {
const result = await response.json();
const { ownerToken, publicToken, title: wishlistTitle, createdAt } = result;
// If user is not authenticated, save to localStorage
if (!data.session?.user) {
addLocalWishlist({
ownerToken,
publicToken,
title: wishlistTitle,
createdAt
});
}
goto(`/wishlist/${ownerToken}/edit`);
}
} catch (error) {
console.error('Failed to create wishlist:', error);
} finally {
isCreating = false;
}
}
</script> </script>
<div class="min-h-screen flex items-center justify-center p-4"> <div class="min-h-screen flex items-center justify-center p-4">
@@ -50,37 +77,11 @@
</div> </div>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<form <form onsubmit={(e) => { e.preventDefault(); createWishlist(); }} class="space-y-4">
method="POST"
action="?/createWishlist"
use:enhance={() => {
isCreating = true;
return async ({ result, update }) => {
if (result.type === 'success' && result.data) {
const data = result.data as { ownerToken: string; publicToken: string; title: string; createdAt: string };
// If user is not authenticated, save to localStorage
if (!data?.session?.user) {
addLocalWishlist({
ownerToken: data.ownerToken,
publicToken: data.publicToken,
title: data.title,
createdAt: new Date(data.createdAt)
});
}
goto(`/wishlist/${data.ownerToken}/edit`);
} else {
await update();
isCreating = false;
}
};
}}
class="space-y-4"
>
<div class="space-y-2"> <div class="space-y-2">
<Label for="title">{t.form.wishlistTitle}</Label> <Label for="title">{t.form.wishlistTitle}</Label>
<Input <Input
id="title" id="title"
name="title"
bind:value={title} bind:value={title}
placeholder={t.form.wishlistTitlePlaceholder} placeholder={t.form.wishlistTitlePlaceholder}
required required
@@ -90,7 +91,6 @@
<Label for="description">{t.form.descriptionOptional}</Label> <Label for="description">{t.form.descriptionOptional}</Label>
<Textarea <Textarea
id="description" id="description"
name="description"
bind:value={description} bind:value={description}
placeholder={t.form.descriptionPlaceholder} placeholder={t.form.descriptionPlaceholder}
rows={3} rows={3}
@@ -99,9 +99,8 @@
<div class="space-y-2"> <div class="space-y-2">
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<Label for="color">{t.form.wishlistColor}</Label> <Label for="color">{t.form.wishlistColor}</Label>
<ColorPicker bind:color size="sm" /> <ColorPicker bind:color={color} size="sm" />
</div> </div>
<input type="hidden" name="color" value={color || ''} />
</div> </div>
<Button type="submit" class="w-full" disabled={isCreating || !title.trim()}> <Button type="submit" class="w-full" disabled={isCreating || !title.trim()}>
{isCreating ? t.wishlist.creating : t.wishlist.createWishlist} {isCreating ? t.wishlist.creating : t.wishlist.createWishlist}
+2 -22
View File
@@ -1,21 +1,5 @@
import type { RequestHandler } from './$types'; import type { RequestHandler } from './$types';
function isValidImageUrl(url: string): boolean {
try {
const parsedUrl = new URL(url);
if (!['http:', 'https:'].includes(parsedUrl.protocol)) {
return false;
}
const hostname = parsedUrl.hostname.toLowerCase();
if (hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '::1') {
return false;
}
return true;
} catch {
return false;
}
}
export const GET: RequestHandler = async ({ url }) => { export const GET: RequestHandler = async ({ url }) => {
const imageUrl = url.searchParams.get('url'); const imageUrl = url.searchParams.get('url');
@@ -23,19 +7,15 @@ export const GET: RequestHandler = async ({ url }) => {
return new Response('Image URL is required', { status: 400 }); return new Response('Image URL is required', { status: 400 });
} }
if (!isValidImageUrl(imageUrl)) {
return new Response('Invalid image URL', { status: 400 });
}
try { try {
// Fetch the image with proper headers to avoid blocking // Fetch the image with proper headers to avoid blocking
const response = await fetch(imageUrl, { const response = await fetch(imageUrl, {
headers: { headers: {
'User-Agent': 'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
Accept: 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8', 'Accept': 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.9', 'Accept-Language': 'en-US,en;q=0.9',
Referer: new URL(imageUrl).origin, 'Referer': new URL(imageUrl).origin,
'Sec-Fetch-Dest': 'image', 'Sec-Fetch-Dest': 'image',
'Sec-Fetch-Mode': 'no-cors', 'Sec-Fetch-Mode': 'no-cors',
'Sec-Fetch-Site': 'cross-site' 'Sec-Fetch-Site': 'cross-site'
+39 -161
View File
@@ -1,22 +1,6 @@
import { json } from '@sveltejs/kit'; import { json } from '@sveltejs/kit';
import type { RequestHandler } from './$types'; import type { RequestHandler } from './$types';
function isValidUrl(urlString: string): boolean {
try {
const url = new URL(urlString);
if (!['http:', 'https:'].includes(url.protocol)) {
return false;
}
const hostname = url.hostname.toLowerCase();
if (hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '::1') {
return false;
}
return true;
} catch {
return false;
}
}
export const POST: RequestHandler = async ({ request }) => { export const POST: RequestHandler = async ({ request }) => {
const { url } = await request.json(); const { url } = await request.json();
@@ -24,21 +8,14 @@ export const POST: RequestHandler = async ({ request }) => {
return json({ error: 'URL is required' }, { status: 400 }); return json({ error: 'URL is required' }, { status: 400 });
} }
if (!isValidUrl(url)) {
return json({ error: 'Invalid URL' }, { status: 400 });
}
try { try {
const response = await fetch(url, { const response = await fetch(url, {
headers: { headers: {
'User-Agent': 'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
Accept: 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.9', 'Accept-Language': 'en-US,en;q=0.9',
'Accept-Encoding': 'gzip, deflate, br', 'Referer': 'https://www.google.com/'
'Cache-Control': 'no-cache',
Pragma: 'no-cache'
} }
}); });
@@ -51,6 +28,13 @@ export const POST: RequestHandler = async ({ request }) => {
const origin = baseUrl.origin; const origin = baseUrl.origin;
const imageUrls: string[] = []; const imageUrls: string[] = [];
// Match various image source patterns
const imgRegex = /<img[^>]+src=["']([^"'>]+)["']/gi;
const srcsetRegex = /<img[^>]+srcset=["']([^"'>]+)["']/gi;
const dataSrcRegex = /<img[^>]+data-src=["']([^"'>]+)["']/gi;
const ogImageRegex = /<meta[^>]+property=["']og:image["'][^>]+content=["']([^"'>]+)["']/gi;
const twitterImageRegex = /<meta[^>]+name=["']twitter:image["'][^>]+content=["']([^"'>]+)["']/gi;
const jsonLdRegex = /"image"\s*:\s*"([^"]+)"/gi;
function toAbsoluteUrl(imgUrl: string): string { function toAbsoluteUrl(imgUrl: string): string {
if (imgUrl.startsWith('http')) { if (imgUrl.startsWith('http')) {
@@ -65,179 +49,73 @@ export const POST: RequestHandler = async ({ request }) => {
return `${origin}/${imgUrl}`; return `${origin}/${imgUrl}`;
} }
function isLikelyProductImage(url: string): boolean {
const lower = url.toLowerCase();
const badPatterns = [
'logo',
'icon',
'sprite',
'favicon',
'banner',
'footer',
'header',
'background',
'pattern',
'placeholder',
'thumbnail-small',
'btn',
'button',
'menu',
'nav',
'navigation',
'social',
'instagram',
'facebook',
'twitter',
'linkedin',
'pinterest'
];
if (badPatterns.some((pattern) => lower.includes(pattern))) {
return false;
}
if (url.endsWith('.svg')) {
return false;
}
if (lower.includes('data:image')) {
return false;
}
if (lower.includes('loading') || lower.includes('spinner') || lower.includes('skeleton')) {
return false;
}
return true;
}
let match; let match;
// Priority 1: OpenGraph and Twitter meta tags (main product image) // Priority 1: OpenGraph and Twitter meta tags (usually the best product images)
const ogImageRegex = /<meta[^>]+property=["']og:image["'][^>]+content=["']([^"'>]+)["']/gi;
const twitterImageRegex =
/<meta[^>]+name=["']twitter:image["'][^>]+content=["']([^"'>]+)["']/gi;
while ((match = ogImageRegex.exec(html)) !== null) { while ((match = ogImageRegex.exec(html)) !== null) {
const url = toAbsoluteUrl(match[1]); imageUrls.push(toAbsoluteUrl(match[1]));
if (isLikelyProductImage(url) && !imageUrls.includes(url)) {
imageUrls.push(url);
}
} }
while ((match = twitterImageRegex.exec(html)) !== null) { while ((match = twitterImageRegex.exec(html)) !== null) {
const url = toAbsoluteUrl(match[1]); const url = toAbsoluteUrl(match[1]);
if (isLikelyProductImage(url) && !imageUrls.includes(url)) { if (!imageUrls.includes(url)) {
imageUrls.push(url); imageUrls.push(url);
} }
} }
// Priority 2: Look for JSON-LD structured data (very common in modern e-commerce) // Priority 2: JSON-LD structured data (common for e-commerce)
const jsonLdRegex =
/<script[^>]*type=["']application\/ld\+json["'][^>]*>([\s\S]*?)<\/script>/gi;
while ((match = jsonLdRegex.exec(html)) !== null) { while ((match = jsonLdRegex.exec(html)) !== null) {
try {
const jsonStr = match[1];
const jsonData = JSON.parse(jsonStr);
function extractImages(obj: unknown, results: Set<string>) {
if (!obj || typeof obj !== 'object') return;
if (Array.isArray(obj)) {
obj.forEach((item: unknown) => extractImages(item, results));
} else {
const record = obj as Record<string, unknown>;
for (const key in record) {
if (key === 'image' || key === 'thumbnail' || key === 'url') {
const val = record[key];
if (typeof val === 'string') {
const url = toAbsoluteUrl(val);
if (isLikelyProductImage(url)) {
results.add(url);
}
}
if (Array.isArray(val)) {
val.forEach((item: unknown) => {
if (typeof item === 'string') {
const url = toAbsoluteUrl(item);
if (isLikelyProductImage(url)) {
results.add(url);
}
}
});
}
} else if (typeof record[key] === 'object') {
extractImages(record[key], results);
}
}
}
}
const jsonImages = new Set<string>();
extractImages(jsonData, jsonImages);
jsonImages.forEach((img) => {
if (!imageUrls.includes(img)) {
imageUrls.push(img);
}
});
} catch {
// JSON parsing failed, continue
}
}
// Priority 3: Look for data-image attributes (common in React/SPA)
const dataImageRegex = /<[^>]+data-image=["']([^"'>]+)["']/gi;
while ((match = dataImageRegex.exec(html)) !== null) {
const url = toAbsoluteUrl(match[1]); const url = toAbsoluteUrl(match[1]);
if (isLikelyProductImage(url) && !imageUrls.includes(url)) { if (!imageUrls.includes(url)) {
imageUrls.push(url);
}
}
// Priority 3: data-src attributes (lazy loaded images)
while ((match = dataSrcRegex.exec(html)) !== null) {
const url = toAbsoluteUrl(match[1]);
if (!imageUrls.includes(url)) {
imageUrls.push(url); imageUrls.push(url);
} }
} }
// Priority 4: srcset attributes (responsive images) // Priority 4: srcset attributes (responsive images)
const srcsetRegex = /<img[^>]+srcset=["']([^"'>]+)["']/gi;
while ((match = srcsetRegex.exec(html)) !== null) { while ((match = srcsetRegex.exec(html)) !== null) {
const srcsetValue = match[1]; const srcsetValue = match[1];
// srcset can have multiple URLs with sizes, extract them
const srcsetUrls = srcsetValue.split(',').map((s) => { const srcsetUrls = srcsetValue.split(',').map((s) => {
const parts = s.trim().split(/\s+/); const parts = s.trim().split(/\s+/);
return parts[0]; return parts[0]; // Get the URL part before size descriptor
}); });
for (const srcsetUrl of srcsetUrls) { for (const srcsetUrl of srcsetUrls) {
const url = toAbsoluteUrl(srcsetUrl); const url = toAbsoluteUrl(srcsetUrl);
if (isLikelyProductImage(url) && !imageUrls.includes(url)) { if (!imageUrls.includes(url)) {
imageUrls.push(url); imageUrls.push(url);
} }
} }
} }
// Priority 5: data-src attributes (lazy loaded) // Priority 5: Regular img src attributes
const dataSrcRegex = /<img[^>]+data-src=["']([^"'>]+)["']/gi;
while ((match = dataSrcRegex.exec(html)) !== null) {
const url = toAbsoluteUrl(match[1]);
if (isLikelyProductImage(url) && !imageUrls.includes(url)) {
imageUrls.push(url);
}
}
// Priority 6: Regular img src attributes
const imgRegex = /<img[^>]+src=["']([^"'>]+)["']/gi;
while ((match = imgRegex.exec(html)) !== null) { while ((match = imgRegex.exec(html)) !== null) {
const url = toAbsoluteUrl(match[1]); const url = toAbsoluteUrl(match[1]);
if (isLikelyProductImage(url) && !imageUrls.includes(url)) { if (!imageUrls.includes(url)) {
imageUrls.push(url); imageUrls.push(url);
} }
} }
// Priority 7: Background images in style attributes (common in some e-commerce) const filteredImages = imageUrls.filter(
const bgImageRegex = /background(-image)?:\s*url\(["']?([^"')]*)["']?/gi; (url) =>
while ((match = bgImageRegex.exec(html)) !== null) { !url.toLowerCase().includes('logo') &&
const url = toAbsoluteUrl(match[1]); !url.toLowerCase().includes('icon') &&
if (isLikelyProductImage(url) && !imageUrls.includes(url) && !url.startsWith('data:')) { !url.toLowerCase().includes('sprite') &&
imageUrls.push(url); !url.toLowerCase().includes('favicon') &&
} !url.endsWith('.svg') &&
} url.length < 1000 && // Increased limit for modern CDN URLs
!url.includes('data:image') // Skip data URLs
);
// Final filtering: remove very long URLs and duplicates return json({ images: filteredImages.slice(0, 30) });
const finalImages = [...new Set(imageUrls)].filter((url) => { } catch (error) {
return url.length < 2000 && isLikelyProductImage(url);
});
return json({ images: finalImages.slice(0, 30) });
} catch {
return json({ error: 'Failed to scrape images' }, { status: 500 }); return json({ error: 'Failed to scrape images' }, { status: 500 });
} }
}; };
+5 -2
View File
@@ -1,7 +1,7 @@
import { json } from '@sveltejs/kit'; import { json } from '@sveltejs/kit';
import type { RequestHandler } from './$types'; import type { RequestHandler } from './$types';
import { db } from '$lib/server/db'; import { db } from '$lib/server/db';
import { wishlists } from '$lib/db/schema'; import { wishlists } from '$lib/server/schema';
import { eq, or } from 'drizzle-orm'; import { eq, or } from 'drizzle-orm';
export const GET: RequestHandler = async ({ params }) => { export const GET: RequestHandler = async ({ params }) => {
@@ -9,7 +9,10 @@ export const GET: RequestHandler = async ({ params }) => {
// Find wishlist by either ownerToken or publicToken // Find wishlist by either ownerToken or publicToken
const wishlist = await db.query.wishlists.findFirst({ const wishlist = await db.query.wishlists.findFirst({
where: or(eq(wishlists.ownerToken, token), eq(wishlists.publicToken, token)), where: or(
eq(wishlists.ownerToken, token),
eq(wishlists.publicToken, token)
),
with: { with: {
items: { items: {
orderBy: (items, { asc }) => [asc(items.order)] orderBy: (items, { asc }) => [asc(items.order)]
+39
View File
@@ -0,0 +1,39 @@
import { json } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
import { db } from '$lib/server/db';
import { wishlists } from '$lib/server/schema';
import { createId } from '@paralleldrive/cuid2';
export const POST: RequestHandler = async ({ request, locals }) => {
const { title, description, color } = await request.json();
if (!title?.trim()) {
return json({ error: 'Title is required' }, { status: 400 });
}
const session = await locals.auth();
const userId = session?.user?.id || null;
const ownerToken = createId();
const publicToken = createId();
const [wishlist] = await db
.insert(wishlists)
.values({
title: title.trim(),
description: description?.trim() || null,
color: color?.trim() || null,
ownerToken,
publicToken,
userId
})
.returning();
return json({
ownerToken,
publicToken,
id: wishlist.id,
title: wishlist.title,
createdAt: wishlist.createdAt
});
};
+20 -39
View File
@@ -1,7 +1,7 @@
import { redirect } from '@sveltejs/kit'; import { redirect } from '@sveltejs/kit';
import type { PageServerLoad, Actions } from './$types'; import type { PageServerLoad, Actions } from './$types';
import { db } from '$lib/server/db'; import { db } from '$lib/server/db';
import { wishlists, savedWishlists, users } from '$lib/db/schema'; import { wishlists, savedWishlists, users } from '$lib/server/schema';
import { eq, and } from 'drizzle-orm'; import { eq, and } from 'drizzle-orm';
export const load: PageServerLoad = async (event) => { export const load: PageServerLoad = async (event) => {
@@ -50,17 +50,15 @@ export const load: PageServerLoad = async (event) => {
// Map saved wishlists to include ownerToken from savedWishlists table (not from wishlist) // Map saved wishlists to include ownerToken from savedWishlists table (not from wishlist)
// This ensures users only see ownerToken if they claimed via edit link // This ensures users only see ownerToken if they claimed via edit link
const savedWithAccess = saved.map((s) => ({ const savedWithAccess = saved.map(s => ({
...s, ...s,
wishlist: s.wishlist wishlist: s.wishlist ? {
? {
...s.wishlist, ...s.wishlist,
// Override ownerToken: use the one stored in savedWishlists (which is null for public saves) // Override ownerToken: use the one stored in savedWishlists (which is null for public saves)
ownerToken: s.ownerToken, ownerToken: s.ownerToken,
// Keep publicToken as-is for viewing // Keep publicToken as-is for viewing
publicToken: s.wishlist.publicToken publicToken: s.wishlist.publicToken
} } : null
: null
})); }));
return { return {
@@ -86,9 +84,8 @@ export const actions: Actions = {
return { success: false, error: 'Wishlist ID is required' }; return { success: false, error: 'Wishlist ID is required' };
} }
await db await db.update(wishlists)
.update(wishlists) .set({ isFavorite: !isFavorite })
.set({ isFavorite: !isFavorite, updatedAt: new Date() })
.where(eq(wishlists.id, wishlistId)); .where(eq(wishlists.id, wishlistId));
return { success: true }; return { success: true };
@@ -108,8 +105,7 @@ export const actions: Actions = {
return { success: false, error: 'Saved wishlist ID is required' }; return { success: false, error: 'Saved wishlist ID is required' };
} }
await db await db.update(savedWishlists)
.update(savedWishlists)
.set({ isFavorite: !isFavorite }) .set({ isFavorite: !isFavorite })
.where(eq(savedWishlists.id, savedWishlistId)); .where(eq(savedWishlists.id, savedWishlistId));
@@ -129,11 +125,11 @@ export const actions: Actions = {
return { success: false, error: 'Saved wishlist ID is required' }; return { success: false, error: 'Saved wishlist ID is required' };
} }
await db await db.delete(savedWishlists)
.delete(savedWishlists) .where(and(
.where( eq(savedWishlists.id, savedWishlistId),
and(eq(savedWishlists.id, savedWishlistId), eq(savedWishlists.userId, session.user.id)) eq(savedWishlists.userId, session.user.id)
); ));
return { success: true }; return { success: true };
}, },
@@ -151,9 +147,12 @@ export const actions: Actions = {
return { success: false, error: 'Wishlist ID is required' }; return { success: false, error: 'Wishlist ID is required' };
} }
await db // Verify the user owns this wishlist
.delete(wishlists) await db.delete(wishlists)
.where(and(eq(wishlists.id, wishlistId), eq(wishlists.userId, session.user.id))); .where(and(
eq(wishlists.id, wishlistId),
eq(wishlists.userId, session.user.id)
));
return { success: true }; return { success: true };
}, },
@@ -171,26 +170,8 @@ export const actions: Actions = {
return { success: false, error: 'Theme is required' }; return { success: false, error: 'Theme is required' };
} }
await db await db.update(users)
.update(users) .set({ dashboardTheme: theme })
.set({ dashboardTheme: theme, updatedAt: new Date() })
.where(eq(users.id, session.user.id));
return { success: true };
},
updateDashboardColor: async ({ request, locals }) => {
const session = await locals.auth();
if (!session?.user?.id) {
throw redirect(303, '/signin');
}
const formData = await request.formData();
const color = formData.get('color') as string | null;
await db
.update(users)
.set({ dashboardColor: color, updatedAt: new Date() })
.where(eq(users.id, session.user.id)); .where(eq(users.id, session.user.id));
return { success: true }; return { success: true };
+32 -83
View File
@@ -6,15 +6,17 @@
import WishlistSection from '$lib/components/dashboard/WishlistSection.svelte'; import WishlistSection from '$lib/components/dashboard/WishlistSection.svelte';
import LocalWishlistsSection from '$lib/components/dashboard/LocalWishlistsSection.svelte'; import LocalWishlistsSection from '$lib/components/dashboard/LocalWishlistsSection.svelte';
import { enhance } from '$app/forms'; import { enhance } from '$app/forms';
import { Star } from '@lucide/svelte'; import { Star } from 'lucide-svelte';
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
let { data }: { data: PageData } = $props(); let { data }: { data: PageData } = $props();
// For anonymous users, get theme from localStorage
function getInitialTheme() { function getInitialTheme() {
if (data.isAuthenticated) { if (data.isAuthenticated) {
return data.user?.dashboardTheme || 'none'; return data.user?.dashboardTheme || 'none';
} else { } else {
// Anonymous user - get from localStorage
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
return localStorage.getItem('dashboardTheme') || 'none'; return localStorage.getItem('dashboardTheme') || 'none';
} }
@@ -22,20 +24,9 @@
} }
} }
function getInitialColor() {
if (data.isAuthenticated) {
return data.user?.dashboardColor || null;
} else {
if (typeof window !== 'undefined') {
return localStorage.getItem('dashboardColor') || null;
}
return null;
}
}
let currentTheme = $state(getInitialTheme()); let currentTheme = $state(getInitialTheme());
let currentColor = $state(getInitialColor());
// Save to localStorage when theme changes for anonymous users
function handleThemeUpdate(theme: string | null) { function handleThemeUpdate(theme: string | null) {
currentTheme = theme || 'none'; currentTheme = theme || 'none';
@@ -44,26 +35,16 @@
} }
} }
function handleColorUpdate(color: string | null) {
currentColor = color;
if (!data.isAuthenticated && typeof window !== 'undefined') {
if (color) {
localStorage.setItem('dashboardColor', color);
} else {
localStorage.removeItem('dashboardColor');
}
}
}
const t = $derived(languageStore.t); const t = $derived(languageStore.t);
// Only owned wishlists for "My Wishlists"
const myWishlists = $derived(() => data.wishlists || []); const myWishlists = $derived(() => data.wishlists || []);
// Claimed wishlists (those with ownerToken, meaning they were claimed via edit link)
const claimedWishlists = $derived(() => { const claimedWishlists = $derived(() => {
return (data.savedWishlists || []) return (data.savedWishlists || [])
.filter((saved) => saved.wishlist?.ownerToken) .filter(saved => saved.wishlist?.ownerToken)
.map((saved) => ({ .map(saved => ({
...saved.wishlist, ...saved.wishlist,
isFavorite: saved.isFavorite, isFavorite: saved.isFavorite,
isClaimed: true, isClaimed: true,
@@ -71,23 +52,26 @@
})); }));
}); });
// Saved wishlists are those WITHOUT ownerToken (saved from public view only)
const savedWishlists = $derived(() => { const savedWishlists = $derived(() => {
return (data.savedWishlists || []).filter((saved) => !saved.wishlist?.ownerToken); return (data.savedWishlists || []).filter(saved => !saved.wishlist?.ownerToken);
}); });
</script> </script>
<PageContainer theme={currentTheme} themeColor={currentColor}> <PageContainer theme={currentTheme} themeColor={null}>
<DashboardHeader <DashboardHeader
userName={data.user?.name} userName={data.user?.name}
userEmail={data.user?.email} userEmail={data.user?.email}
dashboardTheme={currentTheme} dashboardTheme={currentTheme}
dashboardColor={currentColor}
isAuthenticated={data.isAuthenticated} isAuthenticated={data.isAuthenticated}
onThemeUpdate={handleThemeUpdate} onThemeUpdate={handleThemeUpdate}
onColorUpdate={handleColorUpdate}
/> />
<!-- Local Wishlists Section (for anonymous and authenticated users) -->
<LocalWishlistsSection isAuthenticated={data.isAuthenticated} />
{#if data.isAuthenticated} {#if data.isAuthenticated}
<!-- My Wishlists Section -->
<WishlistSection <WishlistSection
title={t.dashboard.myWishlists} title={t.dashboard.myWishlists}
description={t.dashboard.myWishlistsDescription} description={t.dashboard.myWishlistsDescription}
@@ -96,24 +80,18 @@
emptyActionLabel={t.dashboard.emptyWishlistsAction} emptyActionLabel={t.dashboard.emptyWishlistsAction}
emptyActionHref="/" emptyActionHref="/"
showCreateButton={true} showCreateButton={true}
fallbackColor={currentColor}
fallbackTheme={currentTheme}
> >
{#snippet actions(wishlist, unlocked)} {#snippet actions(wishlist, unlocked)}
<div class="flex gap-2 flex-wrap"> <div class="flex gap-2 flex-wrap">
<form <form method="POST" action="?/toggleFavorite" use:enhance={() => {
method="POST"
action="?/toggleFavorite"
use:enhance={() => {
return async ({ update }) => { return async ({ update }) => {
await update({ reset: false }); await update({ reset: false });
}; };
}} }}>
>
<input type="hidden" name="wishlistId" value={wishlist.id} /> <input type="hidden" name="wishlistId" value={wishlist.id} />
<input type="hidden" name="isFavorite" value={wishlist.isFavorite} /> <input type="hidden" name="isFavorite" value={wishlist.isFavorite} />
<Button type="submit" size="sm" variant="outline"> <Button type="submit" size="sm" variant="outline">
<Star class={wishlist.isFavorite ? 'fill-yellow-500 text-yellow-500' : ''} /> <Star class={wishlist.isFavorite ? "fill-yellow-500 text-yellow-500" : ""} />
</Button> </Button>
</form> </form>
<Button <Button
@@ -134,15 +112,11 @@
{t.dashboard.copyLink} {t.dashboard.copyLink}
</Button> </Button>
{#if unlocked} {#if unlocked}
<form <form method="POST" action="?/deleteWishlist" use:enhance={() => {
method="POST"
action="?/deleteWishlist"
use:enhance={() => {
return async ({ update }) => { return async ({ update }) => {
await update({ reset: false }); await update({ reset: false });
}; };
}} }}>
>
<input type="hidden" name="wishlistId" value={wishlist.id} /> <input type="hidden" name="wishlistId" value={wishlist.id} />
<Button type="submit" size="sm" variant="destructive"> <Button type="submit" size="sm" variant="destructive">
{t.dashboard.delete} {t.dashboard.delete}
@@ -153,12 +127,7 @@
{/snippet} {/snippet}
</WishlistSection> </WishlistSection>
<LocalWishlistsSection <!-- Claimed Wishlists Section -->
isAuthenticated={data.isAuthenticated}
fallbackColor={currentColor}
fallbackTheme={currentTheme}
/>
<WishlistSection <WishlistSection
title={t.dashboard.claimedWishlists} title={t.dashboard.claimedWishlists}
description={t.dashboard.claimedWishlistsDescription} description={t.dashboard.claimedWishlistsDescription}
@@ -166,24 +135,18 @@
emptyMessage={t.dashboard.emptyClaimedWishlists} emptyMessage={t.dashboard.emptyClaimedWishlists}
emptyDescription={t.dashboard.emptyClaimedWishlistsDescription} emptyDescription={t.dashboard.emptyClaimedWishlistsDescription}
hideIfEmpty={true} hideIfEmpty={true}
fallbackColor={currentColor}
fallbackTheme={currentTheme}
> >
{#snippet actions(wishlist, unlocked)} {#snippet actions(wishlist, unlocked)}
<div class="flex gap-2 flex-wrap"> <div class="flex gap-2 flex-wrap">
<form <form method="POST" action="?/toggleSavedFavorite" use:enhance={() => {
method="POST"
action="?/toggleSavedFavorite"
use:enhance={() => {
return async ({ update }) => { return async ({ update }) => {
await update({ reset: false }); await update({ reset: false });
}; };
}} }}>
>
<input type="hidden" name="savedWishlistId" value={wishlist.savedId} /> <input type="hidden" name="savedWishlistId" value={wishlist.savedId} />
<input type="hidden" name="isFavorite" value={wishlist.isFavorite} /> <input type="hidden" name="isFavorite" value={wishlist.isFavorite} />
<Button type="submit" size="sm" variant="outline"> <Button type="submit" size="sm" variant="outline">
<Star class={wishlist.isFavorite ? 'fill-yellow-500 text-yellow-500' : ''} /> <Star class={wishlist.isFavorite ? "fill-yellow-500 text-yellow-500" : ""} />
</Button> </Button>
</form> </form>
<Button <Button
@@ -204,15 +167,11 @@
{t.dashboard.copyLink} {t.dashboard.copyLink}
</Button> </Button>
{#if unlocked} {#if unlocked}
<form <form method="POST" action="?/unsaveWishlist" use:enhance={() => {
method="POST"
action="?/unsaveWishlist"
use:enhance={() => {
return async ({ update }) => { return async ({ update }) => {
await update({ reset: false }); await update({ reset: false });
}; };
}} }}>
>
<input type="hidden" name="savedWishlistId" value={wishlist.savedId} /> <input type="hidden" name="savedWishlistId" value={wishlist.savedId} />
<Button type="submit" size="sm" variant="destructive"> <Button type="submit" size="sm" variant="destructive">
{t.dashboard.unclaim} {t.dashboard.unclaim}
@@ -223,31 +182,25 @@
{/snippet} {/snippet}
</WishlistSection> </WishlistSection>
<!-- Saved Wishlists Section -->
<WishlistSection <WishlistSection
title={t.dashboard.savedWishlists} title={t.dashboard.savedWishlists}
description={t.dashboard.savedWishlistsDescription} description={t.dashboard.savedWishlistsDescription}
items={savedWishlists()} items={savedWishlists()}
emptyMessage={t.dashboard.emptySavedWishlists} emptyMessage={t.dashboard.emptySavedWishlists}
emptyDescription={t.dashboard.emptySavedWishlistsDescription} emptyDescription={t.dashboard.emptySavedWishlistsDescription}
fallbackColor={currentColor}
fallbackTheme={currentTheme}
hideIfEmpty={true}
> >
{#snippet actions(saved, unlocked)} {#snippet actions(saved, unlocked)}
<div class="flex gap-2 flex-wrap"> <div class="flex gap-2 flex-wrap">
<form <form method="POST" action="?/toggleSavedFavorite" use:enhance={() => {
method="POST"
action="?/toggleSavedFavorite"
use:enhance={() => {
return async ({ update }) => { return async ({ update }) => {
await update({ reset: false }); await update({ reset: false });
}; };
}} }}>
>
<input type="hidden" name="savedWishlistId" value={saved.id} /> <input type="hidden" name="savedWishlistId" value={saved.id} />
<input type="hidden" name="isFavorite" value={saved.isFavorite} /> <input type="hidden" name="isFavorite" value={saved.isFavorite} />
<Button type="submit" size="sm" variant="outline"> <Button type="submit" size="sm" variant="outline">
<Star class={saved.isFavorite ? 'fill-yellow-500 text-yellow-500' : ''} /> <Star class={saved.isFavorite ? "fill-yellow-500 text-yellow-500" : ""} />
</Button> </Button>
</form> </form>
<Button <Button
@@ -257,15 +210,11 @@
{t.dashboard.viewWishlist} {t.dashboard.viewWishlist}
</Button> </Button>
{#if unlocked} {#if unlocked}
<form <form method="POST" action="?/unsaveWishlist" use:enhance={() => {
method="POST"
action="?/unsaveWishlist"
use:enhance={() => {
return async ({ update }) => { return async ({ update }) => {
await update({ reset: false }); await update({ reset: false });
}; };
}} }}>
>
<input type="hidden" name="savedWishlistId" value={saved.id} /> <input type="hidden" name="savedWishlistId" value={saved.id} />
<Button type="submit" size="sm" variant="destructive"> <Button type="submit" size="sm" variant="destructive">
{t.dashboard.unsave} {t.dashboard.unsave}
+4 -14
View File
@@ -1,12 +1,6 @@
<script lang="ts"> <script lang="ts">
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import { import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '$lib/components/ui/card';
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle
} from '$lib/components/ui/card';
import { Input } from '$lib/components/ui/input'; import { Input } from '$lib/components/ui/input';
import { Label } from '$lib/components/ui/label'; import { Label } from '$lib/components/ui/label';
import { ThemeToggle } from '$lib/components/ui/theme-toggle'; import { ThemeToggle } from '$lib/components/ui/theme-toggle';
@@ -55,17 +49,13 @@
</CardHeader> </CardHeader>
<CardContent class="space-y-4"> <CardContent class="space-y-4">
{#if data.registered} {#if data.registered}
<div <div class="bg-green-50 border border-green-200 text-green-700 dark:bg-green-950 dark:border-green-800 dark:text-green-300 px-4 py-3 rounded">
class="bg-green-50 border border-green-200 text-green-700 dark:bg-green-950 dark:border-green-800 dark:text-green-300 px-4 py-3 rounded"
>
Account created successfully! Please sign in. Account created successfully! Please sign in.
</div> </div>
{/if} {/if}
{#if data.error} {#if data.error}
<div <div class="bg-red-50 border border-red-200 text-red-700 dark:bg-red-950 dark:border-red-800 dark:text-red-300 px-4 py-3 rounded">
class="bg-red-50 border border-red-200 text-red-700 dark:bg-red-950 dark:border-red-800 dark:text-red-300 px-4 py-3 rounded"
>
Invalid username or password Invalid username or password
</div> </div>
{/if} {/if}
@@ -96,7 +86,7 @@
</div> </div>
</div> </div>
{#each data.oauthProviders as provider (provider.id)} {#each data.oauthProviders as provider}
<Button <Button
type="button" type="button"
variant="outline" variant="outline"
+11 -19
View File
@@ -1,11 +1,10 @@
import { fail, redirect } from '@sveltejs/kit'; import { fail, redirect } from '@sveltejs/kit';
import type { Actions, PageServerLoad } from './$types'; import type { Actions, PageServerLoad } from './$types';
import { db } from '$lib/server/db'; import { db } from '$lib/server/db';
import { users, type NewUser } from '$lib/db/schema'; import { users } from '$lib/server/schema';
import { eq } from 'drizzle-orm'; import { eq } from 'drizzle-orm';
import bcrypt from 'bcrypt'; import bcrypt from 'bcrypt';
import { env } from '$env/dynamic/private'; import { env } from '$env/dynamic/private';
import { sanitizeString, sanitizeUsername } from '$lib/server/validation';
export const load: PageServerLoad = async () => { export const load: PageServerLoad = async () => {
// Determine which OAuth providers are available // Determine which OAuth providers are available
@@ -32,18 +31,12 @@ export const actions: Actions = {
const password = formData.get('password') as string; const password = formData.get('password') as string;
const confirmPassword = formData.get('confirmPassword') as string; const confirmPassword = formData.get('confirmPassword') as string;
let sanitizedUsername: string; if (!name?.trim()) {
let sanitizedName: string | null; return fail(400, { error: 'Name is required', name, username });
try {
sanitizedName = sanitizeString(name, 100);
sanitizedUsername = sanitizeUsername(username);
} catch {
return fail(400, { error: 'Invalid input', name, username });
} }
if (!sanitizedName) { if (!username?.trim()) {
return fail(400, { error: 'Name is required', name, username }); return fail(400, { error: 'Username is required', name, username });
} }
if (!password || password.length < 8) { if (!password || password.length < 8) {
@@ -55,21 +48,20 @@ export const actions: Actions = {
} }
const existingUser = await db.query.users.findFirst({ const existingUser = await db.query.users.findFirst({
where: eq(users.username, sanitizedUsername) where: eq(users.username, username.trim().toLowerCase())
}); });
if (existingUser) { if (existingUser) {
return fail(400, { error: 'Username already taken', name, username }); return fail(400, { error: 'Username already taken', name, username });
} }
const hashedPassword = await bcrypt.hash(password, 14); const hashedPassword = await bcrypt.hash(password, 10);
const newUser: NewUser = { await db.insert(users).values({
name: sanitizedName, name: name.trim(),
username: sanitizedUsername, username: username.trim().toLowerCase(),
password: hashedPassword password: hashedPassword
}; });
await db.insert(users).values(newUser);
throw redirect(303, '/signin?registered=true'); throw redirect(303, '/signin?registered=true');
} }
+4 -18
View File
@@ -1,12 +1,6 @@
<script lang="ts"> <script lang="ts">
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import { import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '$lib/components/ui/card';
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle
} from '$lib/components/ui/card';
import { Input } from '$lib/components/ui/input'; import { Input } from '$lib/components/ui/input';
import { Label } from '$lib/components/ui/label'; import { Label } from '$lib/components/ui/label';
import { ThemeToggle } from '$lib/components/ui/theme-toggle'; import { ThemeToggle } from '$lib/components/ui/theme-toggle';
@@ -32,9 +26,7 @@
</CardHeader> </CardHeader>
<CardContent class="space-y-4"> <CardContent class="space-y-4">
{#if form?.error} {#if form?.error}
<div <div class="bg-red-50 border border-red-200 text-red-700 dark:bg-red-950 dark:border-red-800 dark:text-red-300 px-4 py-3 rounded">
class="bg-red-50 border border-red-200 text-red-700 dark:bg-red-950 dark:border-red-800 dark:text-red-300 px-4 py-3 rounded"
>
{form.error} {form.error}
</div> </div>
{/if} {/if}
@@ -57,13 +49,7 @@
<div class="space-y-2"> <div class="space-y-2">
<Label for="confirmPassword">{t.form.confirmPassword}</Label> <Label for="confirmPassword">{t.form.confirmPassword}</Label>
<Input <Input id="confirmPassword" name="confirmPassword" type="password" required minlength={8} />
id="confirmPassword"
name="confirmPassword"
type="password"
required
minlength={8}
/>
</div> </div>
<Button type="submit" class="w-full">{t.auth.signUp}</Button> <Button type="submit" class="w-full">{t.auth.signUp}</Button>
@@ -79,7 +65,7 @@
</div> </div>
</div> </div>
{#each data.oauthProviders as provider (provider.id)} {#each data.oauthProviders as provider}
<Button <Button
type="button" type="button"
variant="outline" variant="outline"
+17 -9
View File
@@ -1,7 +1,7 @@
import { error } from '@sveltejs/kit'; import { error } from '@sveltejs/kit';
import type { PageServerLoad, Actions } from './$types'; import type { PageServerLoad, Actions } from './$types';
import { db } from '$lib/server/db'; import { db } from '$lib/server/db';
import { wishlists, items, reservations, savedWishlists, type NewSavedWishlist } from '$lib/db/schema'; import { wishlists, items, reservations, savedWishlists } from '$lib/server/schema';
import { eq, and } from 'drizzle-orm'; import { eq, and } from 'drizzle-orm';
export const load: PageServerLoad = async ({ params, locals }) => { export const load: PageServerLoad = async ({ params, locals }) => {
@@ -34,7 +34,7 @@ export const load: PageServerLoad = async ({ params, locals }) => {
) )
}); });
isSaved = !!saved; isSaved = !!saved;
isClaimed = !!saved?.ownerToken; isClaimed = !!saved?.ownerToken; // User has claimed if ownerToken exists in savedWishlists
savedWishlistId = saved?.id || null; savedWishlistId = saved?.id || null;
} }
@@ -75,7 +75,10 @@ export const actions: Actions = {
reserverName: reserverName?.trim() || null reserverName: reserverName?.trim() || null
}); });
await tx.update(items).set({ isReserved: true }).where(eq(items.id, itemId)); await tx
.update(items)
.set({ isReserved: true })
.where(eq(items.id, itemId));
}); });
return { success: true }; return { success: true };
@@ -111,13 +114,16 @@ export const actions: Actions = {
await db.transaction(async (tx) => { await db.transaction(async (tx) => {
await tx.delete(reservations).where(eq(reservations.itemId, itemId)); await tx.delete(reservations).where(eq(reservations.itemId, itemId));
await tx.update(items).set({ isReserved: false }).where(eq(items.id, itemId)); await tx
.update(items)
.set({ isReserved: false })
.where(eq(items.id, itemId));
}); });
return { success: true }; return { success: true };
}, },
saveWishlist: async ({ request, locals }) => { saveWishlist: async ({ request, locals, params }) => {
const session = await locals.auth(); const session = await locals.auth();
if (!session?.user?.id) { if (!session?.user?.id) {
@@ -143,12 +149,11 @@ export const actions: Actions = {
} }
// Save without ownerToken - user is accessing via public link, so no edit access // Save without ownerToken - user is accessing via public link, so no edit access
const newSavedWishlist: NewSavedWishlist = { await db.insert(savedWishlists).values({
userId: session.user.id, userId: session.user.id,
wishlistId, wishlistId,
ownerToken: null // Explicitly set to null - no edit access from reservation view ownerToken: null // Explicitly set to null - no edit access from reservation view
}; });
await db.insert(savedWishlists).values(newSavedWishlist);
return { success: true }; return { success: true };
}, },
@@ -170,7 +175,10 @@ export const actions: Actions = {
await db await db
.delete(savedWishlists) .delete(savedWishlists)
.where( .where(
and(eq(savedWishlists.id, savedWishlistId), eq(savedWishlists.userId, session.user.id)) and(
eq(savedWishlists.id, savedWishlistId),
eq(savedWishlists.userId, session.user.id)
)
); );
return { success: true }; return { success: true };
+53 -39
View File
@@ -3,20 +3,22 @@
Card, Card,
CardContent, CardContent,
CardDescription, CardDescription,
CardTitle CardHeader,
} from '$lib/components/ui/card'; CardTitle,
import { Button } from '$lib/components/ui/button'; } from "$lib/components/ui/card";
import type { PageData } from './$types'; import { Button } from "$lib/components/ui/button";
import WishlistItem from '$lib/components/wishlist/WishlistItem.svelte'; import { Input } from "$lib/components/ui/input";
import ReservationButton from '$lib/components/wishlist/ReservationButton.svelte'; import { Label } from "$lib/components/ui/label";
import PageContainer from '$lib/components/layout/PageContainer.svelte'; import type { PageData } from "./$types";
import Navigation from '$lib/components/layout/Navigation.svelte'; import WishlistItem from "$lib/components/wishlist/WishlistItem.svelte";
import EmptyState from '$lib/components/layout/EmptyState.svelte'; import ReservationButton from "$lib/components/wishlist/ReservationButton.svelte";
import { enhance } from '$app/forms'; import PageContainer from "$lib/components/layout/PageContainer.svelte";
import { getCardStyle } from '$lib/utils/colors'; import Navigation from "$lib/components/layout/Navigation.svelte";
import EmptyState from "$lib/components/layout/EmptyState.svelte";
import { enhance } from "$app/forms";
import { getCardStyle } from "$lib/utils/colors";
import { languageStore } from '$lib/stores/language.svelte'; import { languageStore } from '$lib/stores/language.svelte';
import SearchBar from '$lib/components/ui/SearchBar.svelte'; import SearchBar from "$lib/components/ui/SearchBar.svelte";
import ThemeCard from '$lib/components/themes/ThemeCard.svelte';
let { data }: { data: PageData } = $props(); let { data }: { data: PageData } = $props();
@@ -26,8 +28,7 @@
const headerCardStyle = $derived(getCardStyle(data.wishlist.color)); const headerCardStyle = $derived(getCardStyle(data.wishlist.color));
const filteredItems = $derived( const filteredItems = $derived(
data.wishlist.items?.filter( data.wishlist.items?.filter(item =>
(item) =>
item.title.toLowerCase().includes(searchQuery.toLowerCase()) || item.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
item.description?.toLowerCase().includes(searchQuery.toLowerCase()) item.description?.toLowerCase().includes(searchQuery.toLowerCase())
) || [] ) || []
@@ -38,40 +39,49 @@
<Navigation <Navigation
isAuthenticated={data.isAuthenticated} isAuthenticated={data.isAuthenticated}
showDashboardLink={true} showDashboardLink={true}
color={data.wishlist.color}
/> />
<!-- Header -->
<Card style={headerCardStyle}> <Card style={headerCardStyle}>
<CardContent class="pt-6"> <CardContent class="pt-6">
<div class="flex flex-wrap items-start justify-between gap-4"> <div class="flex flex-wrap items-start justify-between gap-4">
<div class="flex-1"> <div class="flex-1">
<CardTitle class="text-3xl">{data.wishlist.title}</CardTitle> <CardTitle class="text-3xl">{data.wishlist.title}</CardTitle>
{#if data.wishlist.description} {#if data.wishlist.description}
<CardDescription class="text-base">{data.wishlist.description}</CardDescription> <CardDescription class="text-base"
>{data.wishlist.description}</CardDescription
>
{/if} {/if}
</div> </div>
{#if data.isAuthenticated} {#if data.isAuthenticated}
{#if data.isClaimed} {#if data.isClaimed}
<Button variant="outline" size="sm" disabled> <!-- User has claimed this wishlist - show claimed status -->
<Button
variant="outline"
size="sm"
disabled
>
{t.wishlist.youClaimedThis} {t.wishlist.youClaimedThis}
</Button> </Button>
{:else if data.isSaved} {:else if data.isSaved}
<!-- User has saved but not claimed - show unsave button -->
<form method="POST" action="?/unsaveWishlist" use:enhance> <form method="POST" action="?/unsaveWishlist" use:enhance>
<input type="hidden" name="savedWishlistId" value={data.savedWishlistId} /> <input
type="hidden"
name="savedWishlistId"
value={data.savedWishlistId}
/>
<Button type="submit" variant="outline" size="sm"> <Button type="submit" variant="outline" size="sm">
{t.wishlist.unsaveWishlist} {t.wishlist.unsaveWishlist}
</Button> </Button>
</form> </form>
{:else} {:else}
<form <!-- Not saved - show save button -->
method="POST" <form method="POST" action="?/saveWishlist" use:enhance={() => {
action="?/saveWishlist"
use:enhance={() => {
return async ({ update }) => { return async ({ update }) => {
await update({ reset: false }); await update({ reset: false });
}; };
}} }}>
>
<input type="hidden" name="wishlistId" value={data.wishlist.id} /> <input type="hidden" name="wishlistId" value={data.wishlist.id} />
<Button type="submit" variant="outline" size="sm"> <Button type="submit" variant="outline" size="sm">
{t.wishlist.saveWishlist} {t.wishlist.saveWishlist}
@@ -79,7 +89,11 @@
</form> </form>
{/if} {/if}
{:else} {:else}
<Button variant="outline" size="sm" onclick={() => (window.location.href = '/signin')}> <Button
variant="outline"
size="sm"
onclick={() => (window.location.href = "/signin")}
>
{t.wishlist.signInToSave} {t.wishlist.signInToSave}
</Button> </Button>
{/if} {/if}
@@ -87,14 +101,16 @@
</CardContent> </CardContent>
</Card> </Card>
<!-- Search Bar -->
{#if data.wishlist.items && data.wishlist.items.length > 0} {#if data.wishlist.items && data.wishlist.items.length > 0}
<SearchBar bind:value={searchQuery} /> <SearchBar bind:value={searchQuery} />
{/if} {/if}
<!-- Items List -->
<div class="space-y-4"> <div class="space-y-4">
{#if filteredItems.length > 0} {#if filteredItems.length > 0}
{#each filteredItems as item (item.id)} {#each filteredItems as item}
<WishlistItem {item} theme={data.wishlist.theme} wishlistColor={data.wishlist.color}> <WishlistItem {item} theme={data.wishlist.theme}>
<ReservationButton <ReservationButton
itemId={item.id} itemId={item.id}
isReserved={item.isReserved} isReserved={item.isReserved}
@@ -105,21 +121,19 @@
</WishlistItem> </WishlistItem>
{/each} {/each}
{:else if data.wishlist.items && data.wishlist.items.length > 0} {:else if data.wishlist.items && data.wishlist.items.length > 0}
<Card style={headerCardStyle} class="relative overflow-hidden"> <Card>
<ThemeCard themeName={data.wishlist.theme} color={data.wishlist.color} /> <CardContent class="p-12">
<CardContent class="p-12 relative z-10"> <EmptyState
<EmptyState message="No wishes match your search." /> message="No wishes match your search."
/>
</CardContent> </CardContent>
</Card> </Card>
{:else} {:else}
<Card style={headerCardStyle} class="relative overflow-hidden"> <Card>
<ThemeCard <CardContent class="p-12">
themeName={data.wishlist.theme} <EmptyState
color={data.wishlist.color} message={t.wishlist.emptyWishes}
showPattern={false}
/> />
<CardContent class="p-12 relative z-10">
<EmptyState message={t.wishlist.emptyWishes} />
</CardContent> </CardContent>
</Card> </Card>
{/if} {/if}
@@ -1,9 +1,8 @@
import { error, fail } from '@sveltejs/kit'; import { error } from '@sveltejs/kit';
import type { PageServerLoad, Actions } from './$types'; import type { PageServerLoad, Actions } from './$types';
import { db } from '$lib/server/db'; import { db } from '$lib/server/db';
import { wishlists, items, savedWishlists, type NewItem, type NewSavedWishlist } from '$lib/db/schema'; import { wishlists, items, savedWishlists } from '$lib/server/schema';
import { eq, and } from 'drizzle-orm'; import { eq, and } from 'drizzle-orm';
import { itemSchema, updateItemSchema, wishlistSchema, reorderSchema } from '$lib/server/validation';
export const load: PageServerLoad = async ({ params, locals }) => { export const load: PageServerLoad = async ({ params, locals }) => {
const wishlist = await db.query.wishlists.findFirst({ const wishlist = await db.query.wishlists.findFirst({
@@ -49,45 +48,67 @@ export const load: PageServerLoad = async ({ params, locals }) => {
export const actions: Actions = { export const actions: Actions = {
addItem: async ({ params, request }) => { addItem: async ({ params, request }) => {
const formData = await request.formData(); const formData = await request.formData();
const rawData = Object.fromEntries(formData); const title = formData.get('title') as string;
const description = formData.get('description') as string;
const link = formData.get('link') as string;
const imageUrl = formData.get('imageUrl') as string;
const price = formData.get('price') as string;
const currency = formData.get('currency') as string;
const color = formData.get('color') as string;
const result = itemSchema.safeParse(rawData); if (!title?.trim()) {
if (!result.success) { return { success: false, error: 'Title is required' };
return fail(400, { success: false, error: result.error.errors.map(e => e.message).join(', ') });
} }
const wishlist = await db.query.wishlists.findFirst({ const wishlist = await db.query.wishlists.findFirst({
where: eq(wishlists.ownerToken, params.token), where: eq(wishlists.ownerToken, params.token),
with: { items: true } with: {
items: true
}
}); });
if (!wishlist) { if (!wishlist) {
throw error(404, 'Wishlist not found'); throw error(404, 'Wishlist not found');
} }
// Get the max order value and add 1
const maxOrder = wishlist.items.reduce((max, item) => { const maxOrder = wishlist.items.reduce((max, item) => {
const order = Number(item.order) || 0; const order = Number(item.order) || 0;
return order > max ? order : max; return order > max ? order : max;
}, 0); }, 0);
const newItem: NewItem = { await db.insert(items).values({
wishlistId: wishlist.id, wishlistId: wishlist.id,
...result.data, title: title.trim(),
price: result.data.price?.toString() || null, description: description?.trim() || null,
link: link?.trim() || null,
imageUrl: imageUrl?.trim() || null,
price: price ? price.trim() : null,
currency: currency?.trim() || 'DKK',
color: color?.trim() || null,
order: String(maxOrder + 1) order: String(maxOrder + 1)
}; });
await db.insert(items).values(newItem);
return { success: true }; return { success: true };
}, },
updateItem: async ({ params, request }) => { updateItem: async ({ params, request }) => {
const formData = await request.formData(); const formData = await request.formData();
const rawData = Object.fromEntries(formData); const itemId = formData.get('itemId') as string;
const title = formData.get('title') as string;
const description = formData.get('description') as string;
const link = formData.get('link') as string;
const imageUrl = formData.get('imageUrl') as string;
const price = formData.get('price') as string;
const currency = formData.get('currency') as string;
const color = formData.get('color') as string;
const result = updateItemSchema.safeParse(rawData); if (!itemId) {
if (!result.success) { return { success: false, error: 'Item ID is required' };
return fail(400, { success: false, error: result.error.errors.map(e => e.message).join(', ') }); }
if (!title?.trim()) {
return { success: false, error: 'Title is required' };
} }
const wishlist = await db.query.wishlists.findFirst({ const wishlist = await db.query.wishlists.findFirst({
@@ -98,12 +119,15 @@ export const actions: Actions = {
throw error(404, 'Wishlist not found'); throw error(404, 'Wishlist not found');
} }
const { itemId, ...data } = result.data; await db.update(items)
await db
.update(items)
.set({ .set({
...data, title: title.trim(),
price: data.price?.toString() || null, description: description?.trim() || null,
link: link?.trim() || null,
imageUrl: imageUrl?.trim() || null,
price: price ? price.trim() : null,
currency: currency?.trim() || 'DKK',
color: color?.trim() || null,
updatedAt: new Date() updatedAt: new Date()
}) })
.where(eq(items.id, itemId)); .where(eq(items.id, itemId));
@@ -136,6 +160,10 @@ export const actions: Actions = {
const formData = await request.formData(); const formData = await request.formData();
const itemsJson = formData.get('items') as string; const itemsJson = formData.get('items') as string;
if (!itemsJson) {
return { success: false, error: 'Items data is required' };
}
const wishlist = await db.query.wishlists.findFirst({ const wishlist = await db.query.wishlists.findFirst({
where: eq(wishlists.ownerToken, params.token) where: eq(wishlists.ownerToken, params.token)
}); });
@@ -144,14 +172,10 @@ export const actions: Actions = {
throw error(404, 'Wishlist not found'); throw error(404, 'Wishlist not found');
} }
const result = reorderSchema.safeParse(JSON.parse(itemsJson || '[]')); const updates = JSON.parse(itemsJson) as Array<{ id: string; order: number }>;
if (!result.success) {
return fail(400, { success: false, error: 'Invalid reorder data' });
}
for (const update of result.data) { for (const update of updates) {
await db await db.update(items)
.update(items)
.set({ order: String(update.order), updatedAt: new Date() }) .set({ order: String(update.order), updatedAt: new Date() })
.where(eq(items.id, update.id)); .where(eq(items.id, update.id));
} }
@@ -175,15 +199,11 @@ export const actions: Actions = {
updateWishlist: async ({ params, request }) => { updateWishlist: async ({ params, request }) => {
const formData = await request.formData(); const formData = await request.formData();
const rawData = Object.fromEntries(formData); const color = formData.get('color');
const title = formData.get('title');
// Only validate fields that are present const description = formData.get('description');
const partialSchema = wishlistSchema.partial(); const endDate = formData.get('endDate');
const result = partialSchema.safeParse(rawData); const theme = formData.get('theme');
if (!result.success) {
return fail(400, { success: false, error: result.error.errors.map(e => e.message).join(', ') });
}
const wishlist = await db.query.wishlists.findFirst({ const wishlist = await db.query.wishlists.findFirst({
where: eq(wishlists.ownerToken, params.token) where: eq(wishlists.ownerToken, params.token)
@@ -193,12 +213,37 @@ export const actions: Actions = {
throw error(404, 'Wishlist not found'); throw error(404, 'Wishlist not found');
} }
await db const updates: any = {
.update(wishlists)
.set({
...result.data,
updatedAt: new Date() updatedAt: new Date()
}) };
if (color !== null) {
updates.color = color?.toString().trim() || null;
}
if (title !== null) {
const titleStr = title?.toString().trim();
if (!titleStr) {
return { success: false, error: 'Title is required' };
}
updates.title = titleStr;
}
if (description !== null) {
updates.description = description?.toString().trim() || null;
}
if (endDate !== null) {
const endDateStr = endDate?.toString().trim();
updates.endDate = endDateStr ? new Date(endDateStr) : null;
}
if (theme !== null) {
updates.theme = theme?.toString().trim() || 'none';
}
await db.update(wishlists)
.set(updates)
.where(eq(wishlists.id, wishlist.id)); .where(eq(wishlists.id, wishlist.id));
return { success: true }; return { success: true };
@@ -232,13 +277,12 @@ export const actions: Actions = {
} }
// Store the ownerToken - user is accessing via edit link, so they get edit access // Store the ownerToken - user is accessing via edit link, so they get edit access
const newSavedWishlist: NewSavedWishlist = { await db.insert(savedWishlists).values({
userId: session.user.id, userId: session.user.id,
wishlistId: wishlist.id, wishlistId: wishlist.id,
ownerToken: wishlist.ownerToken, // Store ownerToken to grant edit access ownerToken: wishlist.ownerToken, // Store ownerToken to grant edit access
isFavorite: false isFavorite: false
}; });
await db.insert(savedWishlists).values(newSavedWishlist);
return { success: true, message: 'Wishlist claimed successfully' }; return { success: true, message: 'Wishlist claimed successfully' };
}, },
@@ -258,10 +302,11 @@ export const actions: Actions = {
throw error(404, 'Wishlist not found'); throw error(404, 'Wishlist not found');
} }
await db await db.delete(savedWishlists).where(
.delete(savedWishlists) and(
.where( eq(savedWishlists.userId, session.user.id),
and(eq(savedWishlists.userId, session.user.id), eq(savedWishlists.wishlistId, wishlist.id)) eq(savedWishlists.wishlistId, wishlist.id)
)
); );
return { success: true, message: 'Wishlist unclaimed' }; return { success: true, message: 'Wishlist unclaimed' };
+46 -52
View File
@@ -1,17 +1,18 @@
<script lang="ts"> <script lang="ts">
import type { PageData } from './$types'; import type { PageData } from "./$types";
import ItemForm from '$lib/components/wishlist/ItemForm.svelte'; import AddItemForm from "$lib/components/wishlist/AddItemForm.svelte";
import ShareLinks from '$lib/components/wishlist/ShareLinks.svelte'; import EditItemForm from "$lib/components/wishlist/EditItemForm.svelte";
import PageContainer from '$lib/components/layout/PageContainer.svelte'; import ShareLinks from "$lib/components/wishlist/ShareLinks.svelte";
import Navigation from '$lib/components/layout/Navigation.svelte'; import PageContainer from "$lib/components/layout/PageContainer.svelte";
import WishlistHeader from '$lib/components/wishlist/WishlistHeader.svelte'; import Navigation from "$lib/components/layout/Navigation.svelte";
import WishlistActionButtons from '$lib/components/wishlist/WishlistActionButtons.svelte'; import WishlistHeader from "$lib/components/wishlist/WishlistHeader.svelte";
import EditableItemsList from '$lib/components/wishlist/EditableItemsList.svelte'; import WishlistActionButtons from "$lib/components/wishlist/WishlistActionButtons.svelte";
import ClaimWishlistSection from '$lib/components/wishlist/ClaimWishlistSection.svelte'; import EditableItemsList from "$lib/components/wishlist/EditableItemsList.svelte";
import DangerZone from '$lib/components/wishlist/DangerZone.svelte'; import ClaimWishlistSection from "$lib/components/wishlist/ClaimWishlistSection.svelte";
import type { Item } from '$lib/server/schema'; import DangerZone from "$lib/components/wishlist/DangerZone.svelte";
import SearchBar from '$lib/components/ui/SearchBar.svelte'; import type { Item } from "$lib/server/schema";
import * as wishlistUpdates from '$lib/utils/wishlistUpdates'; import SearchBar from "$lib/components/ui/SearchBar.svelte";
import * as wishlistUpdates from "$lib/utils/wishlistUpdates";
let { data }: { data: PageData } = $props(); let { data }: { data: PageData } = $props();
@@ -20,21 +21,21 @@
let editingItem = $state<Item | null>(null); let editingItem = $state<Item | null>(null);
let addFormElement = $state<HTMLElement | null>(null); let addFormElement = $state<HTMLElement | null>(null);
let editFormElement = $state<HTMLElement | null>(null); let editFormElement = $state<HTMLElement | null>(null);
let searchQuery = $state(''); let searchQuery = $state("");
let currentTheme = $state(data.wishlist.theme || 'none'); let currentTheme = $state(data.wishlist.theme || 'none');
let currentColor = $state(data.wishlist.color);
let items = $state<Item[]>([]); let items = $state<Item[]>([]);
$effect.pre(() => { $effect.pre(() => {
const sorted = [...data.wishlist.items].sort((a, b) => Number(a.order) - Number(b.order)); const sorted = [...data.wishlist.items].sort(
(a, b) => Number(a.order) - Number(b.order),
);
items = sorted; items = sorted;
}); });
let filteredItems = $derived( let filteredItems = $derived(
searchQuery.trim() searchQuery.trim()
? items.filter( ? items.filter(item =>
(item) =>
item.title.toLowerCase().includes(searchQuery.toLowerCase()) || item.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
item.description?.toLowerCase().includes(searchQuery.toLowerCase()) item.description?.toLowerCase().includes(searchQuery.toLowerCase())
) )
@@ -54,14 +55,16 @@
showAddForm = false; showAddForm = false;
setTimeout(() => { setTimeout(() => {
editFormElement?.scrollIntoView({ editFormElement?.scrollIntoView({
behavior: 'smooth', behavior: "smooth",
block: 'center' block: "center",
}); });
}, 100); }, 100);
} }
function handleColorChange(itemId: string, newColor: string) { function handleColorChange(itemId: string, newColor: string) {
items = items.map((item) => (item.id === itemId ? { ...item, color: newColor } : item)); items = items.map((item) =>
item.id === itemId ? { ...item, color: newColor } : item,
);
} }
function cancelEditing() { function cancelEditing() {
@@ -71,7 +74,7 @@
async function handleReorder(items: Item[]) { async function handleReorder(items: Item[]) {
const updates = items.map((item, index) => ({ const updates = items.map((item, index) => ({
id: item.id, id: item.id,
order: index order: index,
})); }));
await wishlistUpdates.reorderItems(updates); await wishlistUpdates.reorderItems(updates);
} }
@@ -81,15 +84,17 @@
if (showAddForm) { if (showAddForm) {
setTimeout(() => { setTimeout(() => {
addFormElement?.scrollIntoView({ addFormElement?.scrollIntoView({
behavior: 'smooth', behavior: "smooth",
block: 'center' block: "center",
}); });
}, 100); }, 100);
} }
} }
async function handlePositionChange(itemId: string, newPosition: number) { async function handlePositionChange(newPosition: number) {
const currentIndex = items.findIndex((item) => item.id === itemId); if (!editingItem) return;
const currentIndex = items.findIndex(item => item.id === editingItem.id);
if (currentIndex === -1) return; if (currentIndex === -1) return;
const newIndex = newPosition - 1; // Convert to 0-based index const newIndex = newPosition - 1; // Convert to 0-based index
@@ -106,25 +111,19 @@
currentTheme = theme || 'none'; currentTheme = theme || 'none';
await wishlistUpdates.updateTheme(theme); await wishlistUpdates.updateTheme(theme);
} }
async function handleColorUpdate(color: string | null) {
currentColor = color;
await wishlistUpdates.updateColor(color);
}
</script> </script>
<PageContainer maxWidth="4xl" theme={currentTheme} themeColor={currentColor}> <PageContainer maxWidth="4xl" theme={currentTheme} themeColor={data.wishlist.color}>
<Navigation <Navigation
isAuthenticated={data.isAuthenticated} isAuthenticated={data.isAuthenticated}
showDashboardLink={true} showDashboardLink={true}
color={currentColor}
/> />
<WishlistHeader <WishlistHeader
wishlist={data.wishlist} wishlist={data.wishlist}
onTitleUpdate={wishlistUpdates.updateTitle} onTitleUpdate={wishlistUpdates.updateTitle}
onDescriptionUpdate={wishlistUpdates.updateDescription} onDescriptionUpdate={wishlistUpdates.updateDescription}
onColorUpdate={handleColorUpdate} onColorUpdate={wishlistUpdates.updateColor}
onEndDateUpdate={wishlistUpdates.updateEndDate} onEndDateUpdate={wishlistUpdates.updateEndDate}
onThemeUpdate={handleThemeUpdate} onThemeUpdate={handleThemeUpdate}
/> />
@@ -132,7 +131,6 @@
<ShareLinks <ShareLinks
publicUrl={data.publicUrl} publicUrl={data.publicUrl}
ownerUrl="/wishlist/{data.wishlist.ownerToken}/edit" ownerUrl="/wishlist/{data.wishlist.ownerToken}/edit"
wishlistColor={currentColor}
/> />
<ClaimWishlistSection <ClaimWishlistSection
@@ -142,31 +140,28 @@
ownerToken={data.wishlist.ownerToken} ownerToken={data.wishlist.ownerToken}
/> />
<WishlistActionButtons bind:rearranging {showAddForm} onToggleAddForm={handleToggleAddForm} /> <WishlistActionButtons
bind:rearranging={rearranging}
showAddForm={showAddForm}
onToggleAddForm={handleToggleAddForm}
/>
{#if showAddForm} {#if showAddForm}
<div bind:this={addFormElement}> <div bind:this={addFormElement}>
<ItemForm <AddItemForm onSuccess={handleItemAdded} />
mode="add"
on:success={handleItemAdded}
wishlistColor={currentColor}
wishlistTheme={currentTheme}
/>
</div> </div>
{/if} {/if}
{#if editingItem} {#if editingItem}
<div bind:this={editFormElement}> <div bind:this={editFormElement}>
<ItemForm <EditItemForm
mode="edit"
item={editingItem} item={editingItem}
itemCount={items.length} onSuccess={handleItemUpdated}
on:success={handleItemUpdated} onCancel={cancelEditing}
on:cancel={cancelEditing} onColorChange={handleColorChange}
on:colorChange={(e) => handleColorChange(e.detail.itemId, e.detail.color)} currentPosition={items.findIndex(item => item.id === editingItem.id) + 1}
on:positionChange={(e) => handlePositionChange(e.detail.itemId, e.detail.newPosition)} totalItems={items.length}
wishlistColor={currentColor} onPositionChange={handlePositionChange}
wishlistTheme={currentTheme}
/> />
</div> </div>
{/if} {/if}
@@ -181,7 +176,6 @@
onStartEditing={startEditing} onStartEditing={startEditing}
onReorder={handleReorder} onReorder={handleReorder}
theme={currentTheme} theme={currentTheme}
wishlistColor={currentColor}
/> />
<DangerZone bind:unlocked={rearranging} /> <DangerZone bind:unlocked={rearranging} />

Some files were not shown because too many files have changed in this diff Show More