diff --git a/.reference/.gitignore b/.reference/.gitignore new file mode 100644 index 0000000000..0ca39c007c --- /dev/null +++ b/.reference/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist +.DS_Store diff --git a/.reference/README.md b/.reference/README.md new file mode 100644 index 0000000000..b3005f6893 --- /dev/null +++ b/.reference/README.md @@ -0,0 +1,92 @@ +# effect-http-ws-cli (PoC) + +Minimal PoC using Effect v4 beta with a single unified program: + +- `effect/unstable/cli` as the app entrypoint +- `effect/unstable/http` (`HttpServer`, `HttpRouter`, `HttpServerRequest`, `HttpServerResponse`) for server/runtime logic +- `@effect/platform-node` to host the server on Node.js +- HTTP + WebSocket message routing based on `effect/Schema` validation +- static asset serving from local filesystem (`public/` by default) + +The repo now uses a Bun workspace: + +- `server/` contains the Effect HTTP + WebSocket backend +- `web/` remains the Vite + React frontend package + +## Run + +```bash +bun install +bun run web:build +bun run start -- --port 8787 --host 127.0.0.1 --assets public --db todo.sqlite +``` + +Then open `http://127.0.0.1:8787`. + +## Frontend + +React + Vite client lives in `web/` and is built into `public/` so it is served by the static router. + +```bash +bun run web:build +``` + +For local development without building the frontend: + +```bash +bun run dev +``` + +That starts the backend, starts Vite on `http://127.0.0.1:5173`, and redirects frontend page requests there. In dev, Vite proxies `/api/*`, `/ws`, and `/health` back to the backend server. + +If you want to run the processes separately, start `bun run web:dev` and launch the backend with `FRONTEND_DEV_ORIGIN=http://127.0.0.1:5173`. + +The UI now demonstrates a typed realtime todo workflow: + +- load todo snapshot on page load (`listTodos`) +- subscribe to todo updates (`subscribeTodos`) +- mutate todos via RPC (`renameTodo`, `completeTodo`, `archiveTodo`) + +### Config Sources + +Config is resolved from both CLI flags and `effect/Config`: + +- CLI flags: `--host`, `--port`, `--assets`, `--db`, `--request-logging`, `--frontend-dev-origin` +- Env via `effect/Config`: `HOST`, `PORT`, `ASSETS_DIR`, `DB_FILENAME`, `REQUEST_LOGGING`, `FRONTEND_DEV_ORIGIN` + +Precedence: + +1. CLI flags +2. `effect/Config` (environment) +3. hard defaults (`127.0.0.1`, `8787`, `public`, `todo.sqlite`) + +### SQL Persistence + +- Uses `effect/unstable/sql` + `SqlSchema` for typed SQL request/result decoding. +- Uses `@effect/sql-sqlite-node` as the Node runtime SQL client. +- Database schema is managed by `effect/unstable/sql/Migrator` via `server/src/migrations.ts` with statically imported migration files. + +## API + +- `GET /health` +- `POST /api/dispatch` +- `GET /ws` (WebSocket RPC) +- `GET *` (static files) + +### Message schema + +Incoming messages are validated with `Schema`: + +- `{ "kind": "echo", "text": string }` +- `{ "kind": "sum", "left": number, "right": number }` +- `{ "kind": "time" }` + +Both HTTP and WebSocket dispatch use the same schema-driven router. + +## Verify + +```bash +bun run test +bun run test:web +bun run lint +``` diff --git a/.reference/bun.lock b/.reference/bun.lock new file mode 100644 index 0000000000..a26ce1648f --- /dev/null +++ b/.reference/bun.lock @@ -0,0 +1,638 @@ +{ + "lockfileVersion": 1, + "configVersion": 0, + "workspaces": { + "": { + "name": "effect-http-ws-cli", + }, + "server": { + "name": "@effect-http-ws-cli/server", + "version": "0.1.0", + "dependencies": { + "@effect/platform-node": "catalog:", + "@effect/sql-sqlite-node": "catalog:", + "effect": "catalog:", + }, + "devDependencies": { + "@effect/vitest": "catalog:", + "@types/node": "^24.10.0", + "typescript": "catalog:", + "vitest": "catalog:", + }, + }, + "web": { + "name": "@effect-http-ws-cli/web", + "version": "0.1.0", + "dependencies": { + "@effect-http-ws-cli/server": "workspace:*", + "@effect/atom-react": "catalog:", + "@tanstack/react-router": "^1.166.2", + "effect": "catalog:", + "react": "^19.2.0", + "react-dom": "^19.2.0", + }, + "devDependencies": { + "@tanstack/router-plugin": "^1.166.2", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "@vitest/browser-playwright": "^4.0.18", + "playwright": "^1.58.2", + "typescript": "catalog:", + "vite": "^7.2.0", + "vitest": "catalog:", + "vitest-browser-react": "^2.0.5", + }, + }, + }, + "catalog": { + "@effect/atom-react": "4.0.0-beta.27", + "@effect/platform-node": "4.0.0-beta.27", + "@effect/sql-sqlite-node": "4.0.0-beta.27", + "@effect/vitest": "4.0.0-beta.27", + "effect": "4.0.0-beta.27", + "typescript": "6.0.0-beta", + "vitest": "^4.0.18", + }, + "packages": { + "@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="], + + "@babel/compat-data": ["@babel/compat-data@7.29.0", "", {}, "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg=="], + + "@babel/core": ["@babel/core@7.29.0", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", "@babel/helper-compilation-targets": "^7.28.6", "@babel/helper-module-transforms": "^7.28.6", "@babel/helpers": "^7.28.6", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA=="], + + "@babel/generator": ["@babel/generator@7.29.1", "", { "dependencies": { "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw=="], + + "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.28.6", "", { "dependencies": { "@babel/compat-data": "^7.28.6", "@babel/helper-validator-option": "^7.27.1", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA=="], + + "@babel/helper-globals": ["@babel/helper-globals@7.28.0", "", {}, "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw=="], + + "@babel/helper-module-imports": ["@babel/helper-module-imports@7.28.6", "", { "dependencies": { "@babel/traverse": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw=="], + + "@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.28.6", "", { "dependencies": { "@babel/helper-module-imports": "^7.28.6", "@babel/helper-validator-identifier": "^7.28.5", "@babel/traverse": "^7.28.6" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA=="], + + "@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.28.6", "", {}, "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug=="], + + "@babel/helper-string-parser": ["@babel/helper-string-parser@7.27.1", "", {}, "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="], + + "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.28.5", "", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="], + + "@babel/helper-validator-option": ["@babel/helper-validator-option@7.27.1", "", {}, "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg=="], + + "@babel/helpers": ["@babel/helpers@7.28.6", "", { "dependencies": { "@babel/template": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw=="], + + "@babel/parser": ["@babel/parser@7.29.0", "", { "dependencies": { "@babel/types": "^7.29.0" }, "bin": "./bin/babel-parser.js" }, "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww=="], + + "@babel/plugin-syntax-jsx": ["@babel/plugin-syntax-jsx@7.28.6", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.28.6" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w=="], + + "@babel/plugin-syntax-typescript": ["@babel/plugin-syntax-typescript@7.28.6", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.28.6" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A=="], + + "@babel/plugin-transform-react-jsx-self": ["@babel/plugin-transform-react-jsx-self@7.27.1", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw=="], + + "@babel/plugin-transform-react-jsx-source": ["@babel/plugin-transform-react-jsx-source@7.27.1", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw=="], + + "@babel/template": ["@babel/template@7.28.6", "", { "dependencies": { "@babel/code-frame": "^7.28.6", "@babel/parser": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ=="], + + "@babel/traverse": ["@babel/traverse@7.29.0", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", "@babel/helper-globals": "^7.28.0", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/types": "^7.29.0", "debug": "^4.3.1" } }, "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA=="], + + "@babel/types": ["@babel/types@7.29.0", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A=="], + + "@effect-http-ws-cli/server": ["@effect-http-ws-cli/server@workspace:server"], + + "@effect-http-ws-cli/web": ["@effect-http-ws-cli/web@workspace:web"], + + "@effect/atom-react": ["@effect/atom-react@4.0.0-beta.27", "", { "peerDependencies": { "effect": "^4.0.0-beta.27", "react": "^19.2.4", "scheduler": "*" } }, "sha512-miq9lG74I9ypFdDTUIYWQR2OomxDweYM4Fv/h/Md0eXVrk+c/KAkgK0YT5pn3x5plZUHSuSuBEC36185/zpFPA=="], + + "@effect/platform-node": ["@effect/platform-node@4.0.0-beta.27", "", { "dependencies": { "@effect/platform-node-shared": "^4.0.0-beta.27", "mime": "^4.1.0", "undici": "^7.20.0" }, "peerDependencies": { "effect": "^4.0.0-beta.27", "ioredis": "^5.7.0" } }, "sha512-UPZMtFVnDIM5nb6A2pEPo229VnfgMdvl/9sGiQaYRB9qEVHerk0elxcoWOb2szoivBYePYFOsPKIWpR6jCldtQ=="], + + "@effect/platform-node-shared": ["@effect/platform-node-shared@4.0.0-beta.27", "", { "dependencies": { "@types/ws": "^8.18.1", "ws": "^8.19.0" }, "peerDependencies": { "effect": "^4.0.0-beta.27" } }, "sha512-prRa5MIWGAvq2g6FgVP5RFfPwI+DvcXCaEZetvPMK70wdkTR1+jKQqJ9QDKWNIP+2d4llE/cF21SvcpBJWq0gw=="], + + "@effect/sql-sqlite-node": ["@effect/sql-sqlite-node@4.0.0-beta.27", "", { "dependencies": { "better-sqlite3": "^12.6.2" }, "peerDependencies": { "effect": "^4.0.0-beta.27" } }, "sha512-GhTe2gIob7wuQ7OYHM+FtjPhYhf0oFtImPWwaXdQ14kxCSQVFuHY+ll45p2bxTAInnrnDip+Q+UC6xpNnvI3Cw=="], + + "@effect/vitest": ["@effect/vitest@4.0.0-beta.27", "", { "peerDependencies": { "effect": "^4.0.0-beta.27", "vitest": "^3.0.0 || ^4.0.0" } }, "sha512-l9LIQK2yqOF3h47CmlT2VfYWtfHLd+ZuMzma+w0OjxmPsR6bzYMA33ft4gljJ/lEQnXvGHxiTpnZySALCfv+pA=="], + + "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.27.3", "", { "os": "aix", "cpu": "ppc64" }, "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg=="], + + "@esbuild/android-arm": ["@esbuild/android-arm@0.27.3", "", { "os": "android", "cpu": "arm" }, "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA=="], + + "@esbuild/android-arm64": ["@esbuild/android-arm64@0.27.3", "", { "os": "android", "cpu": "arm64" }, "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg=="], + + "@esbuild/android-x64": ["@esbuild/android-x64@0.27.3", "", { "os": "android", "cpu": "x64" }, "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ=="], + + "@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.27.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg=="], + + "@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.27.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg=="], + + "@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.27.3", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w=="], + + "@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.27.3", "", { "os": "freebsd", "cpu": "x64" }, "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA=="], + + "@esbuild/linux-arm": ["@esbuild/linux-arm@0.27.3", "", { "os": "linux", "cpu": "arm" }, "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw=="], + + "@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.27.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg=="], + + "@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.27.3", "", { "os": "linux", "cpu": "ia32" }, "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg=="], + + "@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.27.3", "", { "os": "linux", "cpu": "none" }, "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA=="], + + "@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.27.3", "", { "os": "linux", "cpu": "none" }, "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw=="], + + "@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.27.3", "", { "os": "linux", "cpu": "ppc64" }, "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA=="], + + "@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.27.3", "", { "os": "linux", "cpu": "none" }, "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ=="], + + "@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.27.3", "", { "os": "linux", "cpu": "s390x" }, "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw=="], + + "@esbuild/linux-x64": ["@esbuild/linux-x64@0.27.3", "", { "os": "linux", "cpu": "x64" }, "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA=="], + + "@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.27.3", "", { "os": "none", "cpu": "arm64" }, "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA=="], + + "@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.27.3", "", { "os": "none", "cpu": "x64" }, "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA=="], + + "@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.27.3", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw=="], + + "@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.27.3", "", { "os": "openbsd", "cpu": "x64" }, "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ=="], + + "@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.27.3", "", { "os": "none", "cpu": "arm64" }, "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g=="], + + "@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.27.3", "", { "os": "sunos", "cpu": "x64" }, "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA=="], + + "@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.27.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA=="], + + "@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.27.3", "", { "os": "win32", "cpu": "ia32" }, "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q=="], + + "@esbuild/win32-x64": ["@esbuild/win32-x64@0.27.3", "", { "os": "win32", "cpu": "x64" }, "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA=="], + + "@ioredis/commands": ["@ioredis/commands@1.5.1", "", {}, "sha512-JH8ZL/ywcJyR9MmJ5BNqZllXNZQqQbnVZOqpPQqE1vHiFgAw4NHbvE0FOduNU8IX9babitBT46571OnPTT0Zcw=="], + + "@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=="], + + "@msgpackr-extract/msgpackr-extract-darwin-arm64": ["@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw=="], + + "@msgpackr-extract/msgpackr-extract-darwin-x64": ["@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw=="], + + "@msgpackr-extract/msgpackr-extract-linux-arm": ["@msgpackr-extract/msgpackr-extract-linux-arm@3.0.3", "", { "os": "linux", "cpu": "arm" }, "sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw=="], + + "@msgpackr-extract/msgpackr-extract-linux-arm64": ["@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg=="], + + "@msgpackr-extract/msgpackr-extract-linux-x64": ["@msgpackr-extract/msgpackr-extract-linux-x64@3.0.3", "", { "os": "linux", "cpu": "x64" }, "sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg=="], + + "@msgpackr-extract/msgpackr-extract-win32-x64": ["@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3", "", { "os": "win32", "cpu": "x64" }, "sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ=="], + + "@polka/url": ["@polka/url@1.0.0-next.29", "", {}, "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww=="], + + "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-rc.3", "", {}, "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q=="], + + "@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.59.0", "", { "os": "android", "cpu": "arm" }, "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg=="], + + "@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.59.0", "", { "os": "android", "cpu": "arm64" }, "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q=="], + + "@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.59.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg=="], + + "@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.59.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w=="], + + "@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.59.0", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA=="], + + "@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.59.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg=="], + + "@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.59.0", "", { "os": "linux", "cpu": "arm" }, "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw=="], + + "@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.59.0", "", { "os": "linux", "cpu": "arm" }, "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA=="], + + "@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.59.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA=="], + + "@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.59.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA=="], + + "@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg=="], + + "@rollup/rollup-linux-loong64-musl": ["@rollup/rollup-linux-loong64-musl@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q=="], + + "@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.59.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA=="], + + "@rollup/rollup-linux-ppc64-musl": ["@rollup/rollup-linux-ppc64-musl@4.59.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA=="], + + "@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg=="], + + "@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.59.0", "", { "os": "linux", "cpu": "none" }, "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg=="], + + "@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.59.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w=="], + + "@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.59.0", "", { "os": "linux", "cpu": "x64" }, "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg=="], + + "@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.59.0", "", { "os": "linux", "cpu": "x64" }, "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg=="], + + "@rollup/rollup-openbsd-x64": ["@rollup/rollup-openbsd-x64@4.59.0", "", { "os": "openbsd", "cpu": "x64" }, "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ=="], + + "@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.59.0", "", { "os": "none", "cpu": "arm64" }, "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA=="], + + "@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.59.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A=="], + + "@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.59.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA=="], + + "@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.59.0", "", { "os": "win32", "cpu": "x64" }, "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA=="], + + "@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.59.0", "", { "os": "win32", "cpu": "x64" }, "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA=="], + + "@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="], + + "@tanstack/history": ["@tanstack/history@1.161.4", "", {}, "sha512-Kp/WSt411ZWYvgXy6uiv5RmhHrz9cAml05AQPrtdAp7eUqvIDbMGPnML25OKbzR3RJ1q4wgENxDTvlGPa9+Mww=="], + + "@tanstack/react-router": ["@tanstack/react-router@1.166.2", "", { "dependencies": { "@tanstack/history": "1.161.4", "@tanstack/react-store": "^0.9.1", "@tanstack/router-core": "1.166.2", "isbot": "^5.1.22", "tiny-invariant": "^1.3.3", "tiny-warning": "^1.0.3" }, "peerDependencies": { "react": ">=18.0.0 || >=19.0.0", "react-dom": ">=18.0.0 || >=19.0.0" } }, "sha512-pKhUtrvVLlhjWhsHkJSuIzh1J4LcP+8ErbIqRLORX9Js8dUFMKoT0+8oFpi+P8QRpuhm/7rzjYiWfcyTsqQZtA=="], + + "@tanstack/react-store": ["@tanstack/react-store@0.9.1", "", { "dependencies": { "@tanstack/store": "0.9.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-YzJLnRvy5lIEFTLWBAZmcOjK3+2AepnBv/sr6NZmiqJvq7zTQggyK99Gw8fqYdMdHPQWXjz0epFKJXC+9V2xDA=="], + + "@tanstack/router-core": ["@tanstack/router-core@1.166.2", "", { "dependencies": { "@tanstack/history": "1.161.4", "@tanstack/store": "^0.9.1", "cookie-es": "^2.0.0", "seroval": "^1.4.2", "seroval-plugins": "^1.4.2", "tiny-invariant": "^1.3.3", "tiny-warning": "^1.0.3" } }, "sha512-zn3NhENOAX9ToQiX077UV2OH3aJKOvV2ZMNZZxZ3gDG3i3WqL8NfWfEgetEAfMN37/Mnt90PpotYgf7IyuoKqQ=="], + + "@tanstack/router-generator": ["@tanstack/router-generator@1.166.2", "", { "dependencies": { "@tanstack/router-core": "1.166.2", "@tanstack/router-utils": "1.161.4", "@tanstack/virtual-file-routes": "1.161.4", "prettier": "^3.5.0", "recast": "^0.23.11", "source-map": "^0.7.4", "tsx": "^4.19.2", "zod": "^3.24.2" } }, "sha512-wbvdyP1PKKQKk4aVlGeK9S5uDy8zodTr3tEZ2gRKNavJLusXbEWqtoo42JxHFFNB6dtguehFMt8PyZPAtkgWwQ=="], + + "@tanstack/router-plugin": ["@tanstack/router-plugin@1.166.2", "", { "dependencies": { "@babel/core": "^7.28.5", "@babel/plugin-syntax-jsx": "^7.27.1", "@babel/plugin-syntax-typescript": "^7.27.1", "@babel/template": "^7.27.2", "@babel/traverse": "^7.28.5", "@babel/types": "^7.28.5", "@tanstack/router-core": "1.166.2", "@tanstack/router-generator": "1.166.2", "@tanstack/router-utils": "1.161.4", "@tanstack/virtual-file-routes": "1.161.4", "chokidar": "^3.6.0", "unplugin": "^2.1.2", "zod": "^3.24.2" }, "peerDependencies": { "@rsbuild/core": ">=1.0.2", "@tanstack/react-router": "^1.166.2", "vite": ">=5.0.0 || >=6.0.0 || >=7.0.0", "vite-plugin-solid": "^2.11.10", "webpack": ">=5.92.0" }, "optionalPeers": ["@rsbuild/core", "@tanstack/react-router", "vite", "vite-plugin-solid", "webpack"] }, "sha512-TnyV/7//Vp5fR49mmNbOWHGz9IJTm1lqVxzPdtpzg7D5PjkW2HFmLFLtWwpJgz2R7AJJWR4Ge5kIPmC+fVZ6eQ=="], + + "@tanstack/router-utils": ["@tanstack/router-utils@1.161.4", "", { "dependencies": { "@babel/core": "^7.28.5", "@babel/generator": "^7.28.5", "@babel/parser": "^7.28.5", "@babel/types": "^7.28.5", "ansis": "^4.1.0", "babel-dead-code-elimination": "^1.0.12", "diff": "^8.0.2", "pathe": "^2.0.3", "tinyglobby": "^0.2.15" } }, "sha512-r8TpjyIZoqrXXaf2DDyjd44gjGBoyE+/oEaaH68yLI9ySPO1gUWmQENZ1MZnmBnpUGN24NOZxdjDLc8npK0SAw=="], + + "@tanstack/store": ["@tanstack/store@0.9.1", "", {}, "sha512-+qcNkOy0N1qSGsP7omVCW0SDrXtaDcycPqBDE726yryiA5eTDFpjBReaYjghVJwNf1pcPMyzIwTGlYjCSQR0Fg=="], + + "@tanstack/virtual-file-routes": ["@tanstack/virtual-file-routes@1.161.4", "", {}, "sha512-42WoRePf8v690qG8yGRe/YOh+oHni9vUaUUfoqlS91U2scd3a5rkLtVsc6b7z60w3RogH0I00vdrC5AaeiZ18w=="], + + "@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="], + + "@types/babel__generator": ["@types/babel__generator@7.27.0", "", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg=="], + + "@types/babel__template": ["@types/babel__template@7.4.4", "", { "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A=="], + + "@types/babel__traverse": ["@types/babel__traverse@7.28.0", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="], + + "@types/chai": ["@types/chai@5.2.3", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="], + + "@types/deep-eql": ["@types/deep-eql@4.0.2", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="], + + "@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], + + "@types/node": ["@types/node@24.11.0", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-fPxQqz4VTgPI/IQ+lj9r0h+fDR66bzoeMGHp8ASee+32OSGIkeASsoZuJixsQoVef1QJbeubcPBxKk22QVoWdw=="], + + "@types/react": ["@types/react@19.2.14", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w=="], + + "@types/react-dom": ["@types/react-dom@19.2.3", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="], + + "@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="], + + "@vitejs/plugin-react": ["@vitejs/plugin-react@5.1.4", "", { "dependencies": { "@babel/core": "^7.29.0", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", "@rolldown/pluginutils": "1.0.0-rc.3", "@types/babel__core": "^7.20.5", "react-refresh": "^0.18.0" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "sha512-VIcFLdRi/VYRU8OL/puL7QXMYafHmqOnwTZY50U1JPlCNj30PxCMx65c494b1K9be9hX83KVt0+gTEwTWLqToA=="], + + "@vitest/browser": ["@vitest/browser@4.0.18", "", { "dependencies": { "@vitest/mocker": "4.0.18", "@vitest/utils": "4.0.18", "magic-string": "^0.30.21", "pixelmatch": "7.1.0", "pngjs": "^7.0.0", "sirv": "^3.0.2", "tinyrainbow": "^3.0.3", "ws": "^8.18.3" }, "peerDependencies": { "vitest": "4.0.18" } }, "sha512-gVQqh7paBz3gC+ZdcCmNSWJMk70IUjDeVqi+5m5vYpEHsIwRgw3Y545jljtajhkekIpIp5Gg8oK7bctgY0E2Ng=="], + + "@vitest/browser-playwright": ["@vitest/browser-playwright@4.0.18", "", { "dependencies": { "@vitest/browser": "4.0.18", "@vitest/mocker": "4.0.18", "tinyrainbow": "^3.0.3" }, "peerDependencies": { "playwright": "*", "vitest": "4.0.18" } }, "sha512-gfajTHVCiwpxRj1qh0Sh/5bbGLG4F/ZH/V9xvFVoFddpITfMta9YGow0W6ZpTTORv2vdJuz9TnrNSmjKvpOf4g=="], + + "@vitest/expect": ["@vitest/expect@4.0.18", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "@types/chai": "^5.2.2", "@vitest/spy": "4.0.18", "@vitest/utils": "4.0.18", "chai": "^6.2.1", "tinyrainbow": "^3.0.3" } }, "sha512-8sCWUyckXXYvx4opfzVY03EOiYVxyNrHS5QxX3DAIi5dpJAAkyJezHCP77VMX4HKA2LDT/Jpfo8i2r5BE3GnQQ=="], + + "@vitest/mocker": ["@vitest/mocker@4.0.18", "", { "dependencies": { "@vitest/spy": "4.0.18", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0-0" }, "optionalPeers": ["msw"] }, "sha512-HhVd0MDnzzsgevnOWCBj5Otnzobjy5wLBe4EdeeFGv8luMsGcYqDuFRMcttKWZA5vVO8RFjexVovXvAM4JoJDQ=="], + + "@vitest/pretty-format": ["@vitest/pretty-format@4.0.18", "", { "dependencies": { "tinyrainbow": "^3.0.3" } }, "sha512-P24GK3GulZWC5tz87ux0m8OADrQIUVDPIjjj65vBXYG17ZeU3qD7r+MNZ1RNv4l8CGU2vtTRqixrOi9fYk/yKw=="], + + "@vitest/runner": ["@vitest/runner@4.0.18", "", { "dependencies": { "@vitest/utils": "4.0.18", "pathe": "^2.0.3" } }, "sha512-rpk9y12PGa22Jg6g5M3UVVnTS7+zycIGk9ZNGN+m6tZHKQb7jrP7/77WfZy13Y/EUDd52NDsLRQhYKtv7XfPQw=="], + + "@vitest/snapshot": ["@vitest/snapshot@4.0.18", "", { "dependencies": { "@vitest/pretty-format": "4.0.18", "magic-string": "^0.30.21", "pathe": "^2.0.3" } }, "sha512-PCiV0rcl7jKQjbgYqjtakly6T1uwv/5BQ9SwBLekVg/EaYeQFPiXcgrC2Y7vDMA8dM1SUEAEV82kgSQIlXNMvA=="], + + "@vitest/spy": ["@vitest/spy@4.0.18", "", {}, "sha512-cbQt3PTSD7P2OARdVW3qWER5EGq7PHlvE+QfzSC0lbwO+xnt7+XH06ZzFjFRgzUX//JmpxrCu92VdwvEPlWSNw=="], + + "@vitest/utils": ["@vitest/utils@4.0.18", "", { "dependencies": { "@vitest/pretty-format": "4.0.18", "tinyrainbow": "^3.0.3" } }, "sha512-msMRKLMVLWygpK3u2Hybgi4MNjcYJvwTb0Ru09+fOyCXIgT5raYP041DRRdiJiI3k/2U6SEbAETB3YtBrUkCFA=="], + + "acorn": ["acorn@8.16.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="], + + "ansis": ["ansis@4.2.0", "", {}, "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig=="], + + "anymatch": ["anymatch@3.1.3", "", { "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw=="], + + "assertion-error": ["assertion-error@2.0.1", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="], + + "ast-types": ["ast-types@0.16.1", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg=="], + + "babel-dead-code-elimination": ["babel-dead-code-elimination@1.0.12", "", { "dependencies": { "@babel/core": "^7.23.7", "@babel/parser": "^7.23.6", "@babel/traverse": "^7.23.7", "@babel/types": "^7.23.6" } }, "sha512-GERT7L2TiYcYDtYk1IpD+ASAYXjKbLTDPhBtYj7X1NuRMDTMtAx9kyBenub1Ev41lo91OHCKdmP+egTDmfQ7Ig=="], + + "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], + + "baseline-browser-mapping": ["baseline-browser-mapping@2.10.0", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA=="], + + "better-sqlite3": ["better-sqlite3@12.6.2", "", { "dependencies": { "bindings": "^1.5.0", "prebuild-install": "^7.1.1" } }, "sha512-8VYKM3MjCa9WcaSAI3hzwhmyHVlH8tiGFwf0RlTsZPWJ1I5MkzjiudCo4KC4DxOaL/53A5B1sI/IbldNFDbsKA=="], + + "binary-extensions": ["binary-extensions@2.3.0", "", {}, "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="], + + "bindings": ["bindings@1.5.0", "", { "dependencies": { "file-uri-to-path": "1.0.0" } }, "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ=="], + + "bl": ["bl@4.1.0", "", { "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="], + + "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], + + "browserslist": ["browserslist@4.28.1", "", { "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", "electron-to-chromium": "^1.5.263", "node-releases": "^2.0.27", "update-browserslist-db": "^1.2.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA=="], + + "buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="], + + "caniuse-lite": ["caniuse-lite@1.0.30001776", "", {}, "sha512-sg01JDPzZ9jGshqKSckOQthXnYwOEP50jeVFhaSFbZcOy05TiuuaffDOfcwtCisJ9kNQuLBFibYywv2Bgm9osw=="], + + "chai": ["chai@6.2.2", "", {}, "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg=="], + + "chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="], + + "chownr": ["chownr@1.1.4", "", {}, "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="], + + "cluster-key-slot": ["cluster-key-slot@1.1.2", "", {}, "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA=="], + + "convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="], + + "cookie-es": ["cookie-es@2.0.0", "", {}, "sha512-RAj4E421UYRgqokKUmotqAwuplYw15qtdXfY+hGzgCJ/MBjCVZcSoHK/kH9kocfjRjcDME7IiDWR/1WX1TM2Pg=="], + + "csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="], + + "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], + + "decompress-response": ["decompress-response@6.0.0", "", { "dependencies": { "mimic-response": "^3.1.0" } }, "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ=="], + + "deep-extend": ["deep-extend@0.6.0", "", {}, "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="], + + "denque": ["denque@2.1.0", "", {}, "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw=="], + + "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + + "diff": ["diff@8.0.3", "", {}, "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ=="], + + "effect": ["effect@4.0.0-beta.27", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "fast-check": "^4.5.3", "find-my-way-ts": "^0.1.6", "ini": "^6.0.0", "kubernetes-types": "^1.30.0", "msgpackr": "^1.11.8", "multipasta": "^0.2.7", "toml": "^3.0.0", "uuid": "^13.0.0", "yaml": "^2.8.2" } }, "sha512-bNQEF3vaVGF8jAJ+HW1A4DaxVNmujgEu89sO+VNW1AvUYtPGMtKPTBU15K9inu1rG+hkxNFFRlVvLAJsdaE2mg=="], + + "electron-to-chromium": ["electron-to-chromium@1.5.307", "", {}, "sha512-5z3uFKBWjiNR44nFcYdkcXjKMbg5KXNdciu7mhTPo9tB7NbqSNP2sSnGR+fqknZSCwKkBN+oxiiajWs4dT6ORg=="], + + "end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="], + + "es-module-lexer": ["es-module-lexer@1.7.0", "", {}, "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA=="], + + "esbuild": ["esbuild@0.27.3", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.27.3", "@esbuild/android-arm": "0.27.3", "@esbuild/android-arm64": "0.27.3", "@esbuild/android-x64": "0.27.3", "@esbuild/darwin-arm64": "0.27.3", "@esbuild/darwin-x64": "0.27.3", "@esbuild/freebsd-arm64": "0.27.3", "@esbuild/freebsd-x64": "0.27.3", "@esbuild/linux-arm": "0.27.3", "@esbuild/linux-arm64": "0.27.3", "@esbuild/linux-ia32": "0.27.3", "@esbuild/linux-loong64": "0.27.3", "@esbuild/linux-mips64el": "0.27.3", "@esbuild/linux-ppc64": "0.27.3", "@esbuild/linux-riscv64": "0.27.3", "@esbuild/linux-s390x": "0.27.3", "@esbuild/linux-x64": "0.27.3", "@esbuild/netbsd-arm64": "0.27.3", "@esbuild/netbsd-x64": "0.27.3", "@esbuild/openbsd-arm64": "0.27.3", "@esbuild/openbsd-x64": "0.27.3", "@esbuild/openharmony-arm64": "0.27.3", "@esbuild/sunos-x64": "0.27.3", "@esbuild/win32-arm64": "0.27.3", "@esbuild/win32-ia32": "0.27.3", "@esbuild/win32-x64": "0.27.3" }, "bin": "bin/esbuild" }, "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg=="], + + "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], + + "esprima": ["esprima@4.0.1", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="], + + "estree-walker": ["estree-walker@3.0.3", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="], + + "expand-template": ["expand-template@2.0.3", "", {}, "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="], + + "expect-type": ["expect-type@1.3.0", "", {}, "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA=="], + + "fast-check": ["fast-check@4.5.3", "", { "dependencies": { "pure-rand": "^7.0.0" } }, "sha512-IE9csY7lnhxBnA8g/WI5eg/hygA6MGWJMSNfFRrBlXUciADEhS1EDB0SIsMSvzubzIlOBbVITSsypCsW717poA=="], + + "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" } }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], + + "file-uri-to-path": ["file-uri-to-path@1.0.0", "", {}, "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="], + + "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], + + "find-my-way-ts": ["find-my-way-ts@0.1.6", "", {}, "sha512-a85L9ZoXtNAey3Y6Z+eBWW658kO/MwR7zIafkIUPUMf3isZG0NCs2pjW2wtjxAKuJPxMAsHUIP4ZPGv0o5gyTA=="], + + "fs-constants": ["fs-constants@1.0.0", "", {}, "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="], + + "fsevents": ["fsevents@2.3.2", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="], + + "gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="], + + "get-tsconfig": ["get-tsconfig@4.13.6", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw=="], + + "github-from-package": ["github-from-package@0.0.0", "", {}, "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="], + + "glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], + + "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], + + "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], + + "ini": ["ini@6.0.0", "", {}, "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ=="], + + "ioredis": ["ioredis@5.10.0", "", { "dependencies": { "@ioredis/commands": "1.5.1", "cluster-key-slot": "^1.1.0", "debug": "^4.3.4", "denque": "^2.1.0", "lodash.defaults": "^4.2.0", "lodash.isarguments": "^3.1.0", "redis-errors": "^1.2.0", "redis-parser": "^3.0.0", "standard-as-callback": "^2.1.0" } }, "sha512-HVBe9OFuqs+Z6n64q09PQvP1/R4Bm+30PAyyD4wIEqssh3v9L21QjCVk4kRLucMBcDokJTcLjsGeVRlq/nH6DA=="], + + "is-binary-path": ["is-binary-path@2.1.0", "", { "dependencies": { "binary-extensions": "^2.0.0" } }, "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw=="], + + "is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="], + + "is-glob": ["is-glob@4.0.3", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="], + + "is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="], + + "isbot": ["isbot@5.1.35", "", {}, "sha512-waFfC72ZNfwLLuJ2iLaoVaqcNo+CAaLR7xCpAn0Y5WfGzkNHv7ZN39Vbi1y+kb+Zs46XHOX3tZNExroFUPX+Kg=="], + + "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="], + + "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], + + "kubernetes-types": ["kubernetes-types@1.30.0", "", {}, "sha512-Dew1okvhM/SQcIa2rcgujNndZwU8VnSapDgdxlYoB84ZlpAD43U6KLAFqYo17ykSFGHNPrg0qry0bP+GJd9v7Q=="], + + "lodash.defaults": ["lodash.defaults@4.2.0", "", {}, "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ=="], + + "lodash.isarguments": ["lodash.isarguments@3.1.0", "", {}, "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg=="], + + "lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], + + "magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], + + "mime": ["mime@4.1.0", "", { "bin": "bin/cli.js" }, "sha512-X5ju04+cAzsojXKes0B/S4tcYtFAJ6tTMuSPBEn9CPGlrWr8Fiw7qYeLT0XyH80HSoAoqWCaz+MWKh22P7G1cw=="], + + "mimic-response": ["mimic-response@3.1.0", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="], + + "minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="], + + "mkdirp-classic": ["mkdirp-classic@0.5.3", "", {}, "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="], + + "mrmime": ["mrmime@2.0.1", "", {}, "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ=="], + + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + + "msgpackr": ["msgpackr@1.11.8", "", { "optionalDependencies": { "msgpackr-extract": "^3.0.2" } }, "sha512-bC4UGzHhVvgDNS7kn9tV8fAucIYUBuGojcaLiz7v+P63Lmtm0Xeji8B/8tYKddALXxJLpwIeBmUN3u64C4YkRA=="], + + "msgpackr-extract": ["msgpackr-extract@3.0.3", "", { "dependencies": { "node-gyp-build-optional-packages": "5.2.2" }, "optionalDependencies": { "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.3", "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.3", "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.3", "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.3", "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.3", "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3" }, "bin": { "download-msgpackr-prebuilds": "bin/download-prebuilds.js" } }, "sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA=="], + + "multipasta": ["multipasta@0.2.7", "", {}, "sha512-KPA58d68KgGil15oDqXjkUBEBYc00XvbPj5/X+dyzeo/lWm9Nc25pQRlf1D+gv4OpK7NM0J1odrbu9JNNGvynA=="], + + "nanoid": ["nanoid@3.3.11", "", { "bin": "bin/nanoid.cjs" }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="], + + "napi-build-utils": ["napi-build-utils@2.0.0", "", {}, "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA=="], + + "node-abi": ["node-abi@3.87.0", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-+CGM1L1CgmtheLcBuleyYOn7NWPVu0s0EJH2C4puxgEZb9h8QpR9G2dBfZJOAUhi7VQxuBPMd0hiISWcTyiYyQ=="], + + "node-gyp-build-optional-packages": ["node-gyp-build-optional-packages@5.2.2", "", { "dependencies": { "detect-libc": "^2.0.1" }, "bin": { "node-gyp-build-optional-packages": "bin.js", "node-gyp-build-optional-packages-optional": "optional.js", "node-gyp-build-optional-packages-test": "build-test.js" } }, "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw=="], + + "node-releases": ["node-releases@2.0.36", "", {}, "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA=="], + + "normalize-path": ["normalize-path@3.0.0", "", {}, "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="], + + "obug": ["obug@2.1.1", "", {}, "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ=="], + + "once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="], + + "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], + + "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], + + "picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="], + + "pixelmatch": ["pixelmatch@7.1.0", "", { "dependencies": { "pngjs": "^7.0.0" }, "bin": { "pixelmatch": "bin/pixelmatch" } }, "sha512-1wrVzJ2STrpmONHKBy228LM1b84msXDUoAzVEl0R8Mz4Ce6EPr+IVtxm8+yvrqLYMHswREkjYFaMxnyGnaY3Ng=="], + + "playwright": ["playwright@1.58.2", "", { "dependencies": { "playwright-core": "1.58.2" }, "optionalDependencies": { "fsevents": "2.3.2" }, "bin": { "playwright": "cli.js" } }, "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A=="], + + "playwright-core": ["playwright-core@1.58.2", "", { "bin": { "playwright-core": "cli.js" } }, "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg=="], + + "pngjs": ["pngjs@7.0.0", "", {}, "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow=="], + + "postcss": ["postcss@8.5.8", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg=="], + + "prebuild-install": ["prebuild-install@7.1.3", "", { "dependencies": { "detect-libc": "^2.0.0", "expand-template": "^2.0.3", "github-from-package": "0.0.0", "minimist": "^1.2.3", "mkdirp-classic": "^0.5.3", "napi-build-utils": "^2.0.0", "node-abi": "^3.3.0", "pump": "^3.0.0", "rc": "^1.2.7", "simple-get": "^4.0.0", "tar-fs": "^2.0.0", "tunnel-agent": "^0.6.0" }, "bin": { "prebuild-install": "bin.js" } }, "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug=="], + + "prettier": ["prettier@3.8.1", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg=="], + + "pump": ["pump@3.0.4", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA=="], + + "pure-rand": ["pure-rand@7.0.1", "", {}, "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ=="], + + "rc": ["rc@1.2.8", "", { "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, "bin": { "rc": "./cli.js" } }, "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw=="], + + "react": ["react@19.2.4", "", {}, "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ=="], + + "react-dom": ["react-dom@19.2.4", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.4" } }, "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ=="], + + "react-refresh": ["react-refresh@0.18.0", "", {}, "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw=="], + + "readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="], + + "readdirp": ["readdirp@3.6.0", "", { "dependencies": { "picomatch": "^2.2.1" } }, "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA=="], + + "recast": ["recast@0.23.11", "", { "dependencies": { "ast-types": "^0.16.1", "esprima": "~4.0.0", "source-map": "~0.6.1", "tiny-invariant": "^1.3.3", "tslib": "^2.0.1" } }, "sha512-YTUo+Flmw4ZXiWfQKGcwwc11KnoRAYgzAE2E7mXKCjSviTKShtxBsN6YUUBB2gtaBzKzeKunxhUwNHQuRryhWA=="], + + "redis-errors": ["redis-errors@1.2.0", "", {}, "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w=="], + + "redis-parser": ["redis-parser@3.0.0", "", { "dependencies": { "redis-errors": "^1.0.0" } }, "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A=="], + + "resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="], + + "rollup": ["rollup@4.59.0", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.59.0", "@rollup/rollup-android-arm64": "4.59.0", "@rollup/rollup-darwin-arm64": "4.59.0", "@rollup/rollup-darwin-x64": "4.59.0", "@rollup/rollup-freebsd-arm64": "4.59.0", "@rollup/rollup-freebsd-x64": "4.59.0", "@rollup/rollup-linux-arm-gnueabihf": "4.59.0", "@rollup/rollup-linux-arm-musleabihf": "4.59.0", "@rollup/rollup-linux-arm64-gnu": "4.59.0", "@rollup/rollup-linux-arm64-musl": "4.59.0", "@rollup/rollup-linux-loong64-gnu": "4.59.0", "@rollup/rollup-linux-loong64-musl": "4.59.0", "@rollup/rollup-linux-ppc64-gnu": "4.59.0", "@rollup/rollup-linux-ppc64-musl": "4.59.0", "@rollup/rollup-linux-riscv64-gnu": "4.59.0", "@rollup/rollup-linux-riscv64-musl": "4.59.0", "@rollup/rollup-linux-s390x-gnu": "4.59.0", "@rollup/rollup-linux-x64-gnu": "4.59.0", "@rollup/rollup-linux-x64-musl": "4.59.0", "@rollup/rollup-openbsd-x64": "4.59.0", "@rollup/rollup-openharmony-arm64": "4.59.0", "@rollup/rollup-win32-arm64-msvc": "4.59.0", "@rollup/rollup-win32-ia32-msvc": "4.59.0", "@rollup/rollup-win32-x64-gnu": "4.59.0", "@rollup/rollup-win32-x64-msvc": "4.59.0", "fsevents": "~2.3.2" }, "bin": "dist/bin/rollup" }, "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg=="], + + "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], + + "scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="], + + "semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], + + "seroval": ["seroval@1.5.0", "", {}, "sha512-OE4cvmJ1uSPrKorFIH9/w/Qwuvi/IMcGbv5RKgcJ/zjA/IohDLU6SVaxFN9FwajbP7nsX0dQqMDes1whk3y+yw=="], + + "seroval-plugins": ["seroval-plugins@1.5.0", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-EAHqADIQondwRZIdeW2I636zgsODzoBDwb3PT/+7TLDWyw1Dy/Xv7iGUIEXXav7usHDE9HVhOU61irI3EnyyHA=="], + + "siginfo": ["siginfo@2.0.0", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="], + + "simple-concat": ["simple-concat@1.0.1", "", {}, "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="], + + "simple-get": ["simple-get@4.0.1", "", { "dependencies": { "decompress-response": "^6.0.0", "once": "^1.3.1", "simple-concat": "^1.0.0" } }, "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA=="], + + "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=="], + + "source-map": ["source-map@0.7.6", "", {}, "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ=="], + + "source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], + + "stackback": ["stackback@0.0.2", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="], + + "standard-as-callback": ["standard-as-callback@2.1.0", "", {}, "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A=="], + + "std-env": ["std-env@3.10.0", "", {}, "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg=="], + + "string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="], + + "strip-json-comments": ["strip-json-comments@2.0.1", "", {}, "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ=="], + + "tar-fs": ["tar-fs@2.1.4", "", { "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^2.1.4" } }, "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ=="], + + "tar-stream": ["tar-stream@2.2.0", "", { "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" } }, "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ=="], + + "tiny-invariant": ["tiny-invariant@1.3.3", "", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="], + + "tiny-warning": ["tiny-warning@1.0.3", "", {}, "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="], + + "tinybench": ["tinybench@2.9.0", "", {}, "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg=="], + + "tinyexec": ["tinyexec@1.0.2", "", {}, "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg=="], + + "tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="], + + "tinyrainbow": ["tinyrainbow@3.0.3", "", {}, "sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q=="], + + "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], + + "toml": ["toml@3.0.0", "", {}, "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w=="], + + "totalist": ["totalist@3.0.1", "", {}, "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ=="], + + "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + + "tsx": ["tsx@4.21.0", "", { "dependencies": { "esbuild": "~0.27.0", "get-tsconfig": "^4.7.5" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "bin": "dist/cli.mjs" }, "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw=="], + + "tunnel-agent": ["tunnel-agent@0.6.0", "", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w=="], + + "typescript": ["typescript@6.0.0-beta", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CldZdztDpQRLM1HC6WDQjQkQN5Ub5zRau737a1diGh3lPmb9oRsaWHk1y5iqK0o7+1bNJ0oXfEGRkAogFZBL+Q=="], + + "undici": ["undici@7.22.0", "", {}, "sha512-RqslV2Us5BrllB+JeiZnK4peryVTndy9Dnqq62S3yYRRTj0tFQCwEniUy2167skdGOy3vqRzEvl1Dm4sV2ReDg=="], + + "undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], + + "unplugin": ["unplugin@2.3.11", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "acorn": "^8.15.0", "picomatch": "^4.0.3", "webpack-virtual-modules": "^0.6.2" } }, "sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww=="], + + "update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="], + + "use-sync-external-store": ["use-sync-external-store@1.6.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w=="], + + "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], + + "uuid": ["uuid@13.0.0", "", { "bin": "dist-node/bin/uuid" }, "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w=="], + + "vite": ["vite@7.3.1", "", { "dependencies": { "esbuild": "^0.27.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": ["jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser"], "bin": "bin/vite.js" }, "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA=="], + + "vitest": ["vitest@4.0.18", "", { "dependencies": { "@vitest/expect": "4.0.18", "@vitest/mocker": "4.0.18", "@vitest/pretty-format": "4.0.18", "@vitest/runner": "4.0.18", "@vitest/snapshot": "4.0.18", "@vitest/spy": "4.0.18", "@vitest/utils": "4.0.18", "es-module-lexer": "^1.7.0", "expect-type": "^1.2.2", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^3.10.0", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.0.3", "vite": "^6.0.0 || ^7.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.0.18", "@vitest/browser-preview": "4.0.18", "@vitest/browser-webdriverio": "4.0.18", "@vitest/ui": "4.0.18", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/ui", "happy-dom", "jsdom"], "bin": "vitest.mjs" }, "sha512-hOQuK7h0FGKgBAas7v0mSAsnvrIgAvWmRFjmzpJ7SwFHH3g1k2u37JtYwOwmEKhK6ZO3v9ggDBBm0La1LCK4uQ=="], + + "vitest-browser-react": ["vitest-browser-react@2.0.5", "", { "peerDependencies": { "@types/react": "^18.0.0 || ^19.0.0", "@types/react-dom": "^18.0.0 || ^19.0.0", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0", "vitest": "^4.0.0" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-YODQX8mHTJCyKNVYTWJrLEYrUtw+QfLl78owgvuE7C5ydgmGBq6v5s4jK2w6wdPhIZsN9PpV1rQbmAevWJjO9g=="], + + "webpack-virtual-modules": ["webpack-virtual-modules@0.6.2", "", {}, "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ=="], + + "why-is-node-running": ["why-is-node-running@2.3.0", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": "cli.js" }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="], + + "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], + + "ws": ["ws@8.19.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg=="], + + "yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="], + + "yaml": ["yaml@2.8.2", "", { "bin": "bin.mjs" }, "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A=="], + + "zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], + + "@types/ws/@types/node": ["@types/node@22.19.13", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-akNQMv0wW5uyRpD2v2IEyRSZiR+BeGuoB6L310EgGObO44HSMNT8z1xzio28V8qOrgYaopIDNA18YgdXd+qTiw=="], + + "anymatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + + "chokidar/fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + + "node-abi/semver": ["semver@7.7.4", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="], + + "rc/ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="], + + "readdirp/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + + "recast/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], + + "rollup/fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + + "tsx/fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + + "vite/fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + + "@types/ws/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + } +} diff --git a/.reference/package.json b/.reference/package.json new file mode 100644 index 0000000000..aa28f7063c --- /dev/null +++ b/.reference/package.json @@ -0,0 +1,30 @@ +{ + "name": "effect-http-ws-cli", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "bun@1.3.9", + "workspaces": { + "packages": ["server", "web"], + "catalog": { + "@effect/platform-node": "4.0.0-beta.27", + "@effect/sql-sqlite-node": "4.0.0-beta.27", + "@effect/atom-react": "4.0.0-beta.27", + "@effect/vitest": "4.0.0-beta.27", + "effect": "4.0.0-beta.27", + "typescript": "6.0.0-beta", + "vitest": "^4.0.18" + } + }, + "scripts": { + "dev": "node scripts/dev.mjs", + "start": "node server/src/bin.ts", + "web:dev": "bun run --filter @effect-http-ws-cli/web dev", + "web:build": "bun run --filter @effect-http-ws-cli/web build", + "web:preview": "bun run --filter @effect-http-ws-cli/web preview", + "test": "bun run --filter @effect-http-ws-cli/server test", + "test:web": "bun run --filter @effect-http-ws-cli/web test", + "test:all": "bun run --sequential --workspaces test", + "lint": "bun run --sequential --workspaces lint" + } +} diff --git a/.reference/public/assets/index-Bz7MwgeQ.css b/.reference/public/assets/index-Bz7MwgeQ.css new file mode 100644 index 0000000000..84a2e8f9ca --- /dev/null +++ b/.reference/public/assets/index-Bz7MwgeQ.css @@ -0,0 +1 @@ +:root{--paper: #f3f0e8;--ink: #13222c;--ink-soft: #345264;--accent: #dc4f18;--accent-soft: #f8bb68;--panel: #fffdf6;--line: #162f3f22;--shadow: 0 16px 40px #0f1e291f}*{box-sizing:border-box}body{margin:0;min-height:100vh;font-family:IBM Plex Sans,Segoe UI,sans-serif;color:var(--ink);background:radial-gradient(circle at 10% 10%,#f7cf9a 0%,transparent 36%),radial-gradient(circle at 92% 88%,#95c7d2 0%,transparent 32%),linear-gradient(165deg,#ece8dc 0%,var(--paper) 48%,#e9dfcf 100%)}.shell{width:min(1100px,100% - 2rem);margin:1.5rem auto;padding:1.5rem;border:1px solid var(--line);border-radius:20px;background:color-mix(in oklab,var(--paper),white 35%);box-shadow:var(--shadow)}.hero{position:relative;overflow:hidden;padding:1.5rem;border-radius:16px;border:1px solid var(--line);background:linear-gradient(140deg,#fff9ed,#f7efe0 65%,#f2e7d4)}.hero:after{content:"";position:absolute;width:220px;height:220px;right:-60px;top:-90px;border-radius:999px;background:linear-gradient(180deg,var(--accent-soft),transparent 70%);pointer-events:none}.eyebrow{margin:0;font-size:.72rem;letter-spacing:.22em;text-transform:uppercase;color:var(--ink-soft)}h1,h2{font-family:Archivo Black,Impact,sans-serif;letter-spacing:.02em;margin:0}h1{margin-top:.35rem;font-size:clamp(1.5rem,4vw,2.35rem)}h2{font-size:1.1rem}.lead{margin:.6rem 0 0;color:var(--ink-soft);max-width:68ch}.panel{border:1px solid var(--line);border-radius:14px;padding:1rem;background:var(--panel);margin-top:1rem}.status-panel{margin-top:0;background:linear-gradient(140deg,#fbf7ee,#f1e8d7)}.status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}.status-item{border:1px solid var(--line);border-radius:10px;padding:.55rem .7rem;display:flex;justify-content:space-between;align-items:baseline;gap:.75rem;background:#fff}.status-label{color:var(--ink-soft);font-size:.82rem}.status-subscription-connected{border-color:#24704755;background:#f1fbf5}.status-subscription-connecting{border-color:#8d6a1b55;background:#fff8eb}.status-subscription-idle{border-color:var(--line)}.status-mutation-busy{border-color:#6b3b2e55;background:#fff3ef}.todo-header{display:flex;justify-content:space-between;align-items:baseline;gap:1rem}.meta{display:flex;gap:.75rem;color:var(--ink-soft);font-size:.86rem}.todo-list{margin:.8rem 0 0;padding:0;list-style:none;display:grid;gap:.6rem}.event-list{margin:.8rem 0 0;padding:0;list-style:none;display:grid;gap:.5rem;max-height:260px;overflow:auto}.event-item{border:1px solid var(--line);border-radius:10px;background:#fff;padding:.55rem .65rem}.event-top{display:flex;justify-content:space-between;gap:.6rem;color:var(--ink-soft);font-size:.8rem}.event-body{margin-top:.2rem;display:flex;justify-content:space-between;gap:.75rem;font-size:.9rem}.event-body small{color:var(--ink-soft);white-space:nowrap}.todo-item{display:flex;gap:.8rem;align-items:center;border:1px solid var(--line);border-radius:10px;background:#fff;padding:.65rem}.todo-main{flex:1}.todo-main input{width:100%;margin:0;border:1px solid var(--line);background:#fff;border-radius:8px;padding:.42rem .55rem;color:var(--ink);font:inherit;font-weight:600}.todo-main small{display:block;margin-top:.3rem;color:var(--ink-soft)}.todo-actions{display:flex;gap:.45rem}button{border:1px solid #0f243233;border-radius:8px;background:linear-gradient(160deg,#fff,#f4efe3);color:var(--ink);padding:.4rem .6rem;font:inherit;font-size:.85rem;font-weight:700;cursor:pointer;transition:transform .12s ease,box-shadow .12s ease}button:hover{transform:translateY(-1px);box-shadow:0 8px 18px #0f20321a}.todo-item.is-completed .todo-main input{text-decoration:line-through;color:var(--ink-soft)}.todo-item.is-archived{opacity:.64}.footer{margin-top:1rem;display:flex;gap:1rem;align-items:center;font-size:.88rem;color:var(--ink-soft)}.error{color:var(--accent);font-weight:700}@media(max-width:880px){.shell{width:min(1100px,100% - 1rem);padding:1rem}.todo-item{flex-direction:column;align-items:stretch}.todo-actions{justify-content:flex-end}.status-grid{grid-template-columns:1fr}} diff --git a/.reference/public/assets/index-CuY7i06l.js b/.reference/public/assets/index-CuY7i06l.js new file mode 100644 index 0000000000..bf47d4171a --- /dev/null +++ b/.reference/public/assets/index-CuY7i06l.js @@ -0,0 +1,35 @@ +(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function s(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(u){if(u.ep)return;u.ep=!0;const o=s(u);fetch(u.href,o)}})();function KR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zm={exports:{}},au={};var O1;function PR(){if(O1)return au;O1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(i,u,o){var d=null;if(o!==void 0&&(d=""+o),u.key!==void 0&&(d=""+u.key),"key"in u){o={};for(var h in u)h!=="key"&&(o[h]=u[h])}else o=u;return u=o.ref,{$$typeof:e,type:i,key:d,ref:u!==void 0?u:null,props:o}}return au.Fragment=n,au.jsx=s,au.jsxs=s,au}var R1;function XR(){return R1||(R1=1,Zm.exports=PR()),Zm.exports}var ee=XR(),Wm={exports:{}},ye={};var A1;function QR(){if(A1)return ye;A1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),v=Symbol.iterator;function _(w){return w===null||typeof w!="object"?null:(w=v&&w[v]||w["@@iterator"],typeof w=="function"?w:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,j={};function B(w,G,re){this.props=w,this.context=G,this.refs=j,this.updater=re||x}B.prototype.isReactComponent={},B.prototype.setState=function(w,G){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,G,"setState")},B.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function M(){}M.prototype=B.prototype;function I(w,G,re){this.props=w,this.context=G,this.refs=j,this.updater=re||x}var z=I.prototype=new M;z.constructor=I,T(z,B.prototype),z.isPureReactComponent=!0;var W=Array.isArray;function H(){}var V={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function te(w,G,re){var ae=re.ref;return{$$typeof:e,type:w,key:G,ref:ae!==void 0?ae:null,props:re}}function fe(w,G){return te(w.type,G,w.props)}function oe(w){return typeof w=="object"&&w!==null&&w.$$typeof===e}function ie(w){var G={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(re){return G[re]})}var A=/\/+/g;function Q(w,G){return typeof w=="object"&&w!==null&&w.key!=null?ie(""+w.key):G.toString(36)}function Z(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(H,H):(w.status="pending",w.then(function(G){w.status==="pending"&&(w.status="fulfilled",w.value=G)},function(G){w.status==="pending"&&(w.status="rejected",w.reason=G)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function O(w,G,re,ae,he){var xe=typeof w;(xe==="undefined"||xe==="boolean")&&(w=null);var Ne=!1;if(w===null)Ne=!0;else switch(xe){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(w.$$typeof){case e:case n:Ne=!0;break;case y:return Ne=w._init,O(Ne(w._payload),G,re,ae,he)}}if(Ne)return he=he(w),Ne=ae===""?"."+Q(w,0):ae,W(he)?(re="",Ne!=null&&(re=Ne.replace(A,"$&/")+"/"),O(he,G,re,"",function(Ur){return Ur})):he!=null&&(oe(he)&&(he=fe(he,re+(he.key==null||w&&w.key===he.key?"":(""+he.key).replace(A,"$&/")+"/")+Ne)),G.push(he)),1;Ne=0;var pt=ae===""?".":ae+":";if(W(w))for(var Ze=0;Ze>>1,se=O[ce];if(0>>1;ceu(re,ne))aeu(he,re)?(O[ce]=he,O[ae]=ne,ce=ae):(O[ce]=re,O[G]=ne,ce=G);else if(aeu(he,ne))O[ce]=he,O[ae]=ne,ce=ae;else break e}}return N}function u(O,N){var ne=O.sortIndex-N.sortIndex;return ne!==0?ne:O.id-N.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var d=Date,h=d.now();e.unstable_now=function(){return d.now()-h}}var p=[],m=[],y=1,S=null,v=3,_=!1,x=!1,T=!1,j=!1,B=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function z(O){for(var N=s(m);N!==null;){if(N.callback===null)i(m);else if(N.startTime<=O)i(m),N.sortIndex=N.expirationTime,n(p,N);else break;N=s(m)}}function W(O){if(T=!1,z(O),!x)if(s(p)!==null)x=!0,H||(H=!0,ie());else{var N=s(m);N!==null&&Z(W,N.startTime-O)}}var H=!1,V=-1,Y=5,te=-1;function fe(){return j?!0:!(e.unstable_now()-teO&&fe());){var ce=S.callback;if(typeof ce=="function"){S.callback=null,v=S.priorityLevel;var se=ce(S.expirationTime<=O);if(O=e.unstable_now(),typeof se=="function"){S.callback=se,z(O),N=!0;break t}S===s(p)&&i(p),z(O)}else i(p);S=s(p)}if(S!==null)N=!0;else{var w=s(m);w!==null&&Z(W,w.startTime-O),N=!1}}break e}finally{S=null,v=ne,_=!1}N=void 0}}finally{N?ie():H=!1}}}var ie;if(typeof I=="function")ie=function(){I(oe)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,Q=A.port2;A.port1.onmessage=oe,ie=function(){Q.postMessage(null)}}else ie=function(){B(oe,0)};function Z(O,N){V=B(function(){O(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125ce?(O.sortIndex=ne,n(m,O),s(p)===null&&O===s(m)&&(T?(M(V),V=-1):T=!0,Z(W,ne-ce))):(O.sortIndex=se,n(p,O),x||_||(x=!0,H||(H=!0,ie()))),O},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(O){var N=v;return function(){var ne=v;v=N;try{return O.apply(this,arguments)}finally{v=ne}}}})(np)),np}var k1;function Cx(){return k1||(k1=1,tp.exports=JR()),tp.exports}var rp={exports:{}},Jt={};var U1;function ZR(){if(U1)return Jt;U1=1;var e=Ju();function n(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),rp.exports=ZR(),rp.exports}var N1;function WR(){if(N1)return iu;N1=1;var e=Cx(),n=Ju(),s=kx();function i(t){var r="https://react.dev/errors/"+t;if(1se||(t.current=ce[se],ce[se]=null,se--)}function re(t,r){se++,ce[se]=t.current,t.current=r}var ae=w(null),he=w(null),xe=w(null),Ne=w(null);function pt(t,r){switch(re(xe,r),re(he,t),re(ae,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Xb(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Xb(r),t=Qb(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}G(ae),re(ae,t)}function Ze(){G(ae),G(he),G(xe)}function Ur(t){t.memoizedState!==null&&re(Ne,t);var r=ae.current,a=Qb(r,t.type);r!==a&&(re(he,t),re(ae,a))}function zr(t){he.current===t&&(G(ae),G(he)),Ne.current===t&&(G(Ne),tu._currentValue=ne)}var ps,oc;function mr(t){if(ps===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);ps=r&&r[1]||"",oc=-1)":-1l||E[c]!==L[l]){var K=` +`+E[c].replace(" at new "," at ");return t.displayName&&K.includes("")&&(K=K.replace("",t.displayName)),K}while(1<=c&&0<=l);break}}}finally{fc=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?mr(a):""}function bl(t,r){switch(t.tag){case 26:case 27:case 5:return mr(t.type);case 16:return mr("Lazy");case 13:return t.child!==r&&r!==null?mr("Suspense Fallback"):mr("Suspense");case 19:return mr("SuspenseList");case 0:case 15:return Wa(t.type,!1);case 11:return Wa(t.type.render,!1);case 1:return Wa(t.type,!0);case 31:return mr("Activity");default:return""}}function Nr(t){try{var r="",a=null;do r+=bl(t,a),a=t,t=t.return;while(t);return r}catch(c){return` +Error generating stack: `+c.message+` +`+c.stack}}var ca=Object.prototype.hasOwnProperty,tr=e.unstable_scheduleCallback,dc=e.unstable_cancelCallback,qd=e.unstable_shouldYield,_l=e.unstable_requestPaint,rn=e.unstable_now,xl=e.unstable_getCurrentPriorityLevel,Fe=e.unstable_ImmediatePriority,_t=e.unstable_UserBlockingPriority,Qt=e.unstable_NormalPriority,El=e.unstable_LowPriority,My=e.unstable_IdlePriority,M2=e.log,C2=e.unstable_setDisableYieldValue,hc=null,bn=null;function gs(t){if(typeof M2=="function"&&C2(t),bn&&typeof bn.setStrictMode=="function")try{bn.setStrictMode(hc,t)}catch{}}var _n=Math.clz32?Math.clz32:z2,k2=Math.log,U2=Math.LN2;function z2(t){return t>>>=0,t===0?32:31-(k2(t)/U2|0)|0}var wl=256,Tl=262144,Ol=4194304;function ua(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Rl(t,r,a){var c=t.pendingLanes;if(c===0)return 0;var l=0,f=t.suspendedLanes,g=t.pingedLanes;t=t.warmLanes;var b=c&134217727;return b!==0?(c=b&~f,c!==0?l=ua(c):(g&=b,g!==0?l=ua(g):a||(a=b&~t,a!==0&&(l=ua(a))))):(b=c&~f,b!==0?l=ua(b):g!==0?l=ua(g):a||(a=c&~t,a!==0&&(l=ua(a)))),l===0?0:r!==0&&r!==l&&(r&f)===0&&(f=l&-l,a=r&-r,f>=a||f===32&&(a&4194048)!==0)?r:l}function mc(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function N2(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Cy(){var t=Ol;return Ol<<=1,(Ol&62914560)===0&&(Ol=4194304),t}function $d(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function pc(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function D2(t,r,a,c,l,f){var g=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var b=t.entanglements,E=t.expirationTimes,L=t.hiddenUpdates;for(a=g&~a;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var H2=/[\n"\\]/g;function Nn(t){return t.replace(H2,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Fd(t,r,a,c,l,f,g,b){t.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?t.type=g:t.removeAttribute("type"),r!=null?g==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+zn(r)):t.value!==""+zn(r)&&(t.value=""+zn(r)):g!=="submit"&&g!=="reset"||t.removeAttribute("value"),r!=null?Kd(t,g,zn(r)):a!=null?Kd(t,g,zn(a)):c!=null&&t.removeAttribute("value"),l==null&&f!=null&&(t.defaultChecked=!!f),l!=null&&(t.checked=l&&typeof l!="function"&&typeof l!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.name=""+zn(b):t.removeAttribute("name")}function Iy(t,r,a,c,l,f,g,b){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.type=f),r!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||r!=null)){Gd(t);return}a=a!=null?""+zn(a):"",r=r!=null?""+zn(r):a,b||r===t.value||(t.value=r),t.defaultValue=r}c=c??l,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=b?t.checked:!!c,t.defaultChecked=!!c,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.name=g),Gd(t)}function Kd(t,r,a){r==="number"&&Cl(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function ai(t,r,a,c){if(t=t.options,r){r={};for(var l=0;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zd=!1;if(jr)try{var vc={};Object.defineProperty(vc,"passive",{get:function(){Zd=!0}}),window.addEventListener("test",vc,vc),window.removeEventListener("test",vc,vc)}catch{Zd=!1}var Ss=null,Wd=null,Ul=null;function Qy(){if(Ul)return Ul;var t,r=Wd,a=r.length,c,l="value"in Ss?Ss.value:Ss.textContent,f=l.length;for(t=0;t=xc),nS=" ",rS=!1;function sS(t,r){switch(t){case"keyup":return pO.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aS(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var li=!1;function yO(t,r){switch(t){case"compositionend":return aS(r);case"keypress":return r.which!==32?null:(rS=!0,nS);case"textInput":return t=r.data,t===nS&&rS?null:t;default:return null}}function SO(t,r){if(li)return t==="compositionend"||!sh&&sS(t,r)?(t=Qy(),Ul=Wd=Ss=null,li=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:a,offset:r-t};t=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=hS(a)}}function pS(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?pS(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function gS(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Cl(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Cl(t.document)}return r}function ch(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var OO=jr&&"documentMode"in document&&11>=document.documentMode,oi=null,uh=null,Oc=null,lh=!1;function yS(t,r,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;lh||oi==null||oi!==Cl(c)||(c=oi,"selectionStart"in c&&ch(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Oc&&Tc(Oc,c)||(Oc=c,c=Oo(uh,"onSelect"),0>=g,l-=g,pr=1<<32-_n(r)+l|a<be?(Me=me,me=null):Me=me.sibling;var Le=q(k,me,D[be],X);if(Le===null){me===null&&(me=Me);break}t&&me&&Le.alternate===null&&r(k,me),R=f(Le,R,be),De===null?pe=Le:De.sibling=Le,De=Le,me=Me}if(be===D.length)return a(k,me),Ue&&qr(k,be),pe;if(me===null){for(;bebe?(Me=me,me=null):Me=me.sibling;var $s=q(k,me,Le.value,X);if($s===null){me===null&&(me=Me);break}t&&me&&$s.alternate===null&&r(k,me),R=f($s,R,be),De===null?pe=$s:De.sibling=$s,De=$s,me=Me}if(Le.done)return a(k,me),Ue&&qr(k,be),pe;if(me===null){for(;!Le.done;be++,Le=D.next())Le=J(k,Le.value,X),Le!==null&&(R=f(Le,R,be),De===null?pe=Le:De.sibling=Le,De=Le);return Ue&&qr(k,be),pe}for(me=c(me);!Le.done;be++,Le=D.next())Le=F(me,k,be,Le.value,X),Le!==null&&(t&&Le.alternate!==null&&me.delete(Le.key===null?be:Le.key),R=f(Le,R,be),De===null?pe=Le:De.sibling=Le,De=Le);return t&&me.forEach(function(FR){return r(k,FR)}),Ue&&qr(k,be),pe}function Ge(k,R,D,X){if(typeof D=="object"&&D!==null&&D.type===T&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case _:e:{for(var pe=D.key;R!==null;){if(R.key===pe){if(pe=D.type,pe===T){if(R.tag===7){a(k,R.sibling),X=l(R,D.props.children),X.return=k,k=X;break e}}else if(R.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===Y&&va(pe)===R.type){a(k,R.sibling),X=l(R,D.props),Uc(X,D),X.return=k,k=X;break e}a(k,R);break}else r(k,R);R=R.sibling}D.type===T?(X=ma(D.props.children,k.mode,X,D.key),X.return=k,k=X):(X=Vl(D.type,D.key,D.props,null,k.mode,X),Uc(X,D),X.return=k,k=X)}return g(k);case x:e:{for(pe=D.key;R!==null;){if(R.key===pe)if(R.tag===4&&R.stateNode.containerInfo===D.containerInfo&&R.stateNode.implementation===D.implementation){a(k,R.sibling),X=l(R,D.children||[]),X.return=k,k=X;break e}else{a(k,R);break}else r(k,R);R=R.sibling}X=gh(D,k.mode,X),X.return=k,k=X}return g(k);case Y:return D=va(D),Ge(k,R,D,X)}if(Z(D))return de(k,R,D,X);if(ie(D)){if(pe=ie(D),typeof pe!="function")throw Error(i(150));return D=pe.call(D),ge(k,R,D,X)}if(typeof D.then=="function")return Ge(k,R,Xl(D),X);if(D.$$typeof===I)return Ge(k,R,Gl(k,D),X);Ql(k,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,R!==null&&R.tag===6?(a(k,R.sibling),X=l(R,D),X.return=k,k=X):(a(k,R),X=ph(D,k.mode,X),X.return=k,k=X),g(k)):a(k,R)}return function(k,R,D,X){try{kc=0;var pe=Ge(k,R,D,X);return _i=null,pe}catch(me){if(me===bi||me===Kl)throw me;var De=En(29,me,null,k.mode);return De.lanes=X,De.return=k,De}}}var _a=$S(!0),HS=$S(!1),Es=!1;function Ah(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mh(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ws(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ts(t,r,a){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(je&2)!==0){var l=c.pending;return l===null?r.next=r:(r.next=l.next,l.next=r),c.pending=r,r=Hl(t),wS(t,null,a),r}return $l(t,c,r,a),Hl(t)}function zc(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var c=r.lanes;c&=t.pendingLanes,a|=c,r.lanes=a,Uy(t,a)}}function Ch(t,r){var a=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var l=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var g={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?l=f=g:f=f.next=g,a=a.next}while(a!==null);f===null?l=f=r:f=f.next=r}else l=f=r;a={baseState:c.baseState,firstBaseUpdate:l,lastBaseUpdate:f,shared:c.shared,callbacks:c.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var kh=!1;function Nc(){if(kh){var t=vi;if(t!==null)throw t}}function Dc(t,r,a,c){kh=!1;var l=t.updateQueue;Es=!1;var f=l.firstBaseUpdate,g=l.lastBaseUpdate,b=l.shared.pending;if(b!==null){l.shared.pending=null;var E=b,L=E.next;E.next=null,g===null?f=L:g.next=L,g=E;var K=t.alternate;K!==null&&(K=K.updateQueue,b=K.lastBaseUpdate,b!==g&&(b===null?K.firstBaseUpdate=L:b.next=L,K.lastBaseUpdate=E))}if(f!==null){var J=l.baseState;g=0,K=L=E=null,b=f;do{var q=b.lane&-536870913,F=q!==b.lane;if(F?(Ae&q)===q:(c&q)===q){q!==0&&q===Si&&(kh=!0),K!==null&&(K=K.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var de=t,ge=b;q=r;var Ge=a;switch(ge.tag){case 1:if(de=ge.payload,typeof de=="function"){J=de.call(Ge,J,q);break e}J=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=ge.payload,q=typeof de=="function"?de.call(Ge,J,q):de,q==null)break e;J=S({},J,q);break e;case 2:Es=!0}}q=b.callback,q!==null&&(t.flags|=64,F&&(t.flags|=8192),F=l.callbacks,F===null?l.callbacks=[q]:F.push(q))}else F={lane:q,tag:b.tag,payload:b.payload,callback:b.callback,next:null},K===null?(L=K=F,E=J):K=K.next=F,g|=q;if(b=b.next,b===null){if(b=l.shared.pending,b===null)break;F=b,b=F.next,F.next=null,l.lastBaseUpdate=F,l.shared.pending=null}}while(!0);K===null&&(E=J),l.baseState=E,l.firstBaseUpdate=L,l.lastBaseUpdate=K,f===null&&(l.shared.lanes=0),Cs|=g,t.lanes=g,t.memoizedState=J}}function VS(t,r){if(typeof t!="function")throw Error(i(191,t));t.call(r)}function IS(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;tf?f:8;var g=O.T,b={};O.T=b,Qh(t,!1,r,a);try{var E=l(),L=O.S;if(L!==null&&L(b,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var K=DO(E,c);Bc(t,r,K,An(t))}else Bc(t,r,c,An(t))}catch(J){Bc(t,r,{then:function(){},status:"rejected",reason:J},An())}finally{N.p=f,g!==null&&b.types!==null&&(g.types=b.types),O.T=g}}function HO(){}function Ph(t,r,a,c){if(t.tag!==5)throw Error(i(476));var l=_v(t).queue;bv(t,l,r,ne,a===null?HO:function(){return xv(t),a(c)})}function _v(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:ne},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function xv(t){var r=_v(t);r.next===null&&(r=t.alternate.memoizedState),Bc(t,r.next.queue,{},An())}function Xh(){return Gt(tu)}function Ev(){return yt().memoizedState}function wv(){return yt().memoizedState}function VO(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=An();t=ws(a);var c=Ts(r,t,a);c!==null&&(hn(c,r,a),zc(c,r,a)),r={cache:wh()},t.payload=r;return}r=r.return}}function IO(t,r,a){var c=An();a={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},io(t)?Ov(r,a):(a=hh(t,r,a,c),a!==null&&(hn(a,t,c),Rv(a,r,c)))}function Tv(t,r,a){var c=An();Bc(t,r,a,c)}function Bc(t,r,a,c){var l={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(io(t))Ov(r,l);else{var f=t.alternate;if(t.lanes===0&&(f===null||f.lanes===0)&&(f=r.lastRenderedReducer,f!==null))try{var g=r.lastRenderedState,b=f(g,a);if(l.hasEagerState=!0,l.eagerState=b,xn(b,g))return $l(t,r,l,0),Ke===null&&ql(),!1}catch{}if(a=hh(t,r,l,c),a!==null)return hn(a,t,c),Rv(a,r,c),!0}return!1}function Qh(t,r,a,c){if(c={lane:2,revertLane:Am(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},io(t)){if(r)throw Error(i(479))}else r=hh(t,a,c,2),r!==null&&hn(r,t,2)}function io(t){var r=t.alternate;return t===Se||r!==null&&r===Se}function Ov(t,r){Ei=Wl=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Rv(t,r,a){if((a&4194048)!==0){var c=r.lanes;c&=t.pendingLanes,a|=c,r.lanes=a,Uy(t,a)}}var qc={readContext:Gt,use:no,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};qc.useEffectEvent=dt;var Av={readContext:Gt,use:no,useCallback:function(t,r){return sn().memoizedState=[t,r===void 0?null:r],t},useContext:Gt,useEffect:fv,useImperativeHandle:function(t,r,a){a=a!=null?a.concat([t]):null,so(4194308,4,pv.bind(null,r,t),a)},useLayoutEffect:function(t,r){return so(4194308,4,t,r)},useInsertionEffect:function(t,r){so(4,2,t,r)},useMemo:function(t,r){var a=sn();r=r===void 0?null:r;var c=t();if(xa){gs(!0);try{t()}finally{gs(!1)}}return a.memoizedState=[c,r],c},useReducer:function(t,r,a){var c=sn();if(a!==void 0){var l=a(r);if(xa){gs(!0);try{a(r)}finally{gs(!1)}}}else l=r;return c.memoizedState=c.baseState=l,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:l},c.queue=t,t=t.dispatch=IO.bind(null,Se,t),[c.memoizedState,t]},useRef:function(t){var r=sn();return t={current:t},r.memoizedState=t},useState:function(t){t=Ih(t);var r=t.queue,a=Tv.bind(null,Se,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:Fh,useDeferredValue:function(t,r){var a=sn();return Kh(a,t,r)},useTransition:function(){var t=Ih(!1);return t=bv.bind(null,Se,t.queue,!0,!1),sn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var c=Se,l=sn();if(Ue){if(a===void 0)throw Error(i(407));a=a()}else{if(a=r(),Ke===null)throw Error(i(349));(Ae&127)!==0||XS(c,r,a)}l.memoizedState=a;var f={value:a,getSnapshot:r};return l.queue=f,fv(JS.bind(null,c,f,t),[t]),c.flags|=2048,Ti(9,{destroy:void 0},QS.bind(null,c,f,a,r),null),a},useId:function(){var t=sn(),r=Ke.identifierPrefix;if(Ue){var a=gr,c=pr;a=(c&~(1<<32-_n(c)-1)).toString(32)+a,r="_"+r+"R_"+a,a=eo++,0<\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof c.is=="string"?g.createElement("select",{is:c.is}):g.createElement("select"),c.multiple?f.multiple=!0:c.size&&(f.size=c.size);break;default:f=typeof c.is=="string"?g.createElement(l,{is:c.is}):g.createElement(l)}}f[It]=r,f[cn]=c;e:for(g=r.child;g!==null;){if(g.tag===5||g.tag===6)f.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===r)break e;for(;g.sibling===null;){if(g.return===null||g.return===r)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}r.stateNode=f;e:switch(Kt(f,l,c),l){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Gr(r)}}return nt(r),om(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==c&&Gr(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(i(166));if(t=xe.current,gi(r)){if(t=r.stateNode,a=r.memoizedProps,c=null,l=Yt,l!==null)switch(l.tag){case 27:case 5:c=l.memoizedProps}t[It]=r,t=!!(t.nodeValue===a||c!==null&&c.suppressHydrationWarning===!0||Kb(t.nodeValue,a)),t||_s(r,!0)}else t=Ro(t).createTextNode(c),t[It]=r,r.stateNode=t}return nt(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(c=gi(r),a!==null){if(t===null){if(!c)throw Error(i(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(557));t[It]=r}else pa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nt(r),t=!1}else a=bh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(Tn(r),r):(Tn(r),null);if((r.flags&128)!==0)throw Error(i(558))}return nt(r),null;case 13:if(c=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(l=gi(r),c!==null&&c.dehydrated!==null){if(t===null){if(!l)throw Error(i(318));if(l=r.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));l[It]=r}else pa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nt(r),l=!1}else l=bh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),l=!0;if(!l)return r.flags&256?(Tn(r),r):(Tn(r),null)}return Tn(r),(r.flags&128)!==0?(r.lanes=a,r):(a=c!==null,t=t!==null&&t.memoizedState!==null,a&&(c=r.child,l=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(l=c.alternate.memoizedState.cachePool.pool),f=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(f=c.memoizedState.cachePool.pool),f!==l&&(c.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),fo(r,r.updateQueue),nt(r),null);case 4:return Ze(),t===null&&Um(r.stateNode.containerInfo),nt(r),null;case 10:return Hr(r.type),nt(r),null;case 19:if(G(gt),c=r.memoizedState,c===null)return nt(r),null;if(l=(r.flags&128)!==0,f=c.rendering,f===null)if(l)Hc(c,!1);else{if(ht!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(f=Zl(t),f!==null){for(r.flags|=128,Hc(c,!1),t=f.updateQueue,r.updateQueue=t,fo(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)TS(a,t),a=a.sibling;return re(gt,gt.current&1|2),Ue&&qr(r,c.treeForkCount),r.child}t=t.sibling}c.tail!==null&&rn()>yo&&(r.flags|=128,l=!0,Hc(c,!1),r.lanes=4194304)}else{if(!l)if(t=Zl(f),t!==null){if(r.flags|=128,l=!0,t=t.updateQueue,r.updateQueue=t,fo(r,t),Hc(c,!0),c.tail===null&&c.tailMode==="hidden"&&!f.alternate&&!Ue)return nt(r),null}else 2*rn()-c.renderingStartTime>yo&&a!==536870912&&(r.flags|=128,l=!0,Hc(c,!1),r.lanes=4194304);c.isBackwards?(f.sibling=r.child,r.child=f):(t=c.last,t!==null?t.sibling=f:r.child=f,c.last=f)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=rn(),t.sibling=null,a=gt.current,re(gt,l?a&1|2:a&1),Ue&&qr(r,c.treeForkCount),t):(nt(r),null);case 22:case 23:return Tn(r),zh(),c=r.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(a&536870912)!==0&&(r.flags&128)===0&&(nt(r),r.subtreeFlags&6&&(r.flags|=8192)):nt(r),a=r.updateQueue,a!==null&&fo(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==a&&(r.flags|=2048),t!==null&&G(Sa),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Hr(xt),nt(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function PO(t,r){switch(Sh(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Hr(xt),Ze(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return zr(r),null;case 31:if(r.memoizedState!==null){if(Tn(r),r.alternate===null)throw Error(i(340));pa()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(Tn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(i(340));pa()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return G(gt),null;case 4:return Ze(),null;case 10:return Hr(r.type),null;case 22:case 23:return Tn(r),zh(),t!==null&&G(Sa),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Hr(xt),null;case 25:return null;default:return null}}function Zv(t,r){switch(Sh(r),r.tag){case 3:Hr(xt),Ze();break;case 26:case 27:case 5:zr(r);break;case 4:Ze();break;case 31:r.memoizedState!==null&&Tn(r);break;case 13:Tn(r);break;case 19:G(gt);break;case 10:Hr(r.type);break;case 22:case 23:Tn(r),zh(),t!==null&&G(Sa);break;case 24:Hr(xt)}}function Vc(t,r){try{var a=r.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var l=c.next;a=l;do{if((a.tag&t)===t){c=void 0;var f=a.create,g=a.inst;c=f(),g.destroy=c}a=a.next}while(a!==l)}}catch(b){He(r,r.return,b)}}function As(t,r,a){try{var c=r.updateQueue,l=c!==null?c.lastEffect:null;if(l!==null){var f=l.next;c=f;do{if((c.tag&t)===t){var g=c.inst,b=g.destroy;if(b!==void 0){g.destroy=void 0,l=r;var E=a,L=b;try{L()}catch(K){He(l,E,K)}}}c=c.next}while(c!==f)}}catch(K){He(r,r.return,K)}}function Wv(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{IS(r,a)}catch(c){He(t,t.return,c)}}}function eb(t,r,a){a.props=Ea(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(c){He(t,r,c)}}function Ic(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof a=="function"?t.refCleanup=a(c):a.current=c}}catch(l){He(t,r,l)}}function yr(t,r){var a=t.ref,c=t.refCleanup;if(a!==null)if(typeof c=="function")try{c()}catch(l){He(t,r,l)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(l){He(t,r,l)}else a.current=null}function tb(t){var r=t.type,a=t.memoizedProps,c=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&c.focus();break e;case"img":a.src?c.src=a.src:a.srcSet&&(c.srcset=a.srcSet)}}catch(l){He(t,t.return,l)}}function fm(t,r,a){try{var c=t.stateNode;gR(c,t.type,a,r),c[cn]=r}catch(l){He(t,t.return,l)}}function nb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ds(t.type)||t.tag===4}function dm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||nb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ds(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function hm(t,r,a){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=Lr));else if(c!==4&&(c===27&&Ds(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(hm(t,r,a),t=t.sibling;t!==null;)hm(t,r,a),t=t.sibling}function ho(t,r,a){var c=t.tag;if(c===5||c===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(c!==4&&(c===27&&Ds(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(ho(t,r,a),t=t.sibling;t!==null;)ho(t,r,a),t=t.sibling}function rb(t){var r=t.stateNode,a=t.memoizedProps;try{for(var c=t.type,l=r.attributes;l.length;)r.removeAttributeNode(l[0]);Kt(r,c,a),r[It]=t,r[cn]=a}catch(f){He(t,t.return,f)}}var Fr=!1,Tt=!1,mm=!1,sb=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function XO(t,r){if(t=t.containerInfo,Dm=No,t=gS(t),ch(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var c=a.getSelection&&a.getSelection();if(c&&c.rangeCount!==0){a=c.anchorNode;var l=c.anchorOffset,f=c.focusNode;c=c.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var g=0,b=-1,E=-1,L=0,K=0,J=t,q=null;t:for(;;){for(var F;J!==a||l!==0&&J.nodeType!==3||(b=g+l),J!==f||c!==0&&J.nodeType!==3||(E=g+c),J.nodeType===3&&(g+=J.nodeValue.length),(F=J.firstChild)!==null;)q=J,J=F;for(;;){if(J===t)break t;if(q===a&&++L===l&&(b=g),q===f&&++K===c&&(E=g),(F=J.nextSibling)!==null)break;J=q,q=J.parentNode}J=F}a=b===-1||E===-1?null:{start:b,end:E}}else a=null}a=a||{start:0,end:0}}else a=null;for(Lm={focusedElem:t,selectionRange:a},No=!1,Nt=r;Nt!==null;)if(r=Nt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Nt=t;else for(;Nt!==null;){switch(r=Nt,f=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a title"))),Kt(f,c,a),f[It]=t,zt(f),c=f;break e;case"link":var g=o1("link","href",l).get(c+(a.href||""));if(g){for(var b=0;bGe&&(g=Ge,Ge=ge,ge=g);var k=mS(b,ge),R=mS(b,Ge);if(k&&R&&(F.rangeCount!==1||F.anchorNode!==k.node||F.anchorOffset!==k.offset||F.focusNode!==R.node||F.focusOffset!==R.offset)){var D=J.createRange();D.setStart(k.node,k.offset),F.removeAllRanges(),ge>Ge?(F.addRange(D),F.extend(R.node,R.offset)):(D.setEnd(R.node,R.offset),F.addRange(D))}}}}for(J=[],F=b;F=F.parentNode;)F.nodeType===1&&J.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;ba?32:a,O.T=null,a=_m,_m=null;var f=Us,g=Jr;if(At=0,Ci=Us=null,Jr=0,(je&6)!==0)throw Error(i(331));var b=je;if(je|=4,pb(f.current),db(f,f.current,g,a),je=b,Xc(0,!1),bn&&typeof bn.onPostCommitFiberRoot=="function")try{bn.onPostCommitFiberRoot(hc,f)}catch{}return!0}finally{N.p=l,O.T=c,zb(t,r)}}function Db(t,r,a){r=Ln(a,r),r=em(t.stateNode,r,2),t=Ts(t,r,2),t!==null&&(pc(t,2),Sr(t))}function He(t,r,a){if(t.tag===3)Db(t,t,a);else for(;r!==null;){if(r.tag===3){Db(r,t,a);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ks===null||!ks.has(c))){t=Ln(a,t),a=Lv(2),c=Ts(r,a,2),c!==null&&(jv(a,c,r,t),pc(c,2),Sr(c));break}}r=r.return}}function Tm(t,r,a){var c=t.pingCache;if(c===null){c=t.pingCache=new ZO;var l=new Set;c.set(r,l)}else l=c.get(r),l===void 0&&(l=new Set,c.set(r,l));l.has(a)||(ym=!0,l.add(a),t=rR.bind(null,t,r,a),r.then(t,t))}function rR(t,r,a){var c=t.pingCache;c!==null&&c.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Ke===t&&(Ae&a)===a&&(ht===4||ht===3&&(Ae&62914560)===Ae&&300>rn()-go?(je&2)===0&&ki(t,0):Sm|=a,Mi===Ae&&(Mi=0)),Sr(t)}function Lb(t,r){r===0&&(r=Cy()),t=ha(t,r),t!==null&&(pc(t,r),Sr(t))}function sR(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),Lb(t,a)}function aR(t,r){var a=0;switch(t.tag){case 31:case 13:var c=t.stateNode,l=t.memoizedState;l!==null&&(a=l.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(r),Lb(t,a)}function iR(t,r){return tr(t,r)}var Eo=null,zi=null,Om=!1,wo=!1,Rm=!1,Ns=0;function Sr(t){t!==zi&&t.next===null&&(zi===null?Eo=zi=t:zi=zi.next=t),wo=!0,Om||(Om=!0,uR())}function Xc(t,r){if(!Rm&&wo){Rm=!0;do for(var a=!1,c=Eo;c!==null;){if(t!==0){var l=c.pendingLanes;if(l===0)var f=0;else{var g=c.suspendedLanes,b=c.pingedLanes;f=(1<<31-_n(42|t)+1)-1,f&=l&~(g&~b),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,$b(c,f))}else f=Ae,f=Rl(c,c===Ke?f:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(f&3)===0||mc(c,f)||(a=!0,$b(c,f));c=c.next}while(a);Rm=!1}}function cR(){jb()}function jb(){wo=Om=!1;var t=0;Ns!==0&&SR()&&(t=Ns);for(var r=rn(),a=null,c=Eo;c!==null;){var l=c.next,f=Bb(c,r);f===0?(c.next=null,a===null?Eo=l:a.next=l,l===null&&(zi=a)):(a=c,(t!==0||(f&3)!==0)&&(wo=!0)),c=l}At!==0&&At!==5||Xc(t),Ns!==0&&(Ns=0)}function Bb(t,r){for(var a=t.suspendedLanes,c=t.pingedLanes,l=t.expirationTimes,f=t.pendingLanes&-62914561;0b)break;var K=E.transferSize,J=E.initiatorType;K&&Pb(J)&&(E=E.responseEnd,g+=K*(E"u"?null:document;function i1(t,r,a){var c=Ni;if(c&&typeof r=="string"&&r){var l=Nn(r);l='link[rel="'+t+'"][href="'+l+'"]',typeof a=="string"&&(l+='[crossorigin="'+a+'"]'),a1.has(l)||(a1.add(l),t={rel:t,crossOrigin:a,href:r},c.querySelector(l)===null&&(r=c.createElement("link"),Kt(r,"link",t),zt(r),c.head.appendChild(r)))}}function RR(t){Zr.D(t),i1("dns-prefetch",t,null)}function AR(t,r){Zr.C(t,r),i1("preconnect",t,r)}function MR(t,r,a){Zr.L(t,r,a);var c=Ni;if(c&&t&&r){var l='link[rel="preload"][as="'+Nn(r)+'"]';r==="image"&&a&&a.imageSrcSet?(l+='[imagesrcset="'+Nn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(l+='[imagesizes="'+Nn(a.imageSizes)+'"]')):l+='[href="'+Nn(t)+'"]';var f=l;switch(r){case"style":f=Di(t);break;case"script":f=Li(t)}Vn.has(f)||(t=S({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Vn.set(f,t),c.querySelector(l)!==null||r==="style"&&c.querySelector(Wc(f))||r==="script"&&c.querySelector(eu(f))||(r=c.createElement("link"),Kt(r,"link",t),zt(r),c.head.appendChild(r)))}}function CR(t,r){Zr.m(t,r);var a=Ni;if(a&&t){var c=r&&typeof r.as=="string"?r.as:"script",l='link[rel="modulepreload"][as="'+Nn(c)+'"][href="'+Nn(t)+'"]',f=l;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Li(t)}if(!Vn.has(f)&&(t=S({rel:"modulepreload",href:t},r),Vn.set(f,t),a.querySelector(l)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(eu(f)))return}c=a.createElement("link"),Kt(c,"link",t),zt(c),a.head.appendChild(c)}}}function kR(t,r,a){Zr.S(t,r,a);var c=Ni;if(c&&t){var l=ri(c).hoistableStyles,f=Di(t);r=r||"default";var g=l.get(f);if(!g){var b={loading:0,preload:null};if(g=c.querySelector(Wc(f)))b.loading=5;else{t=S({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Vn.get(f))&&Im(t,a);var E=g=c.createElement("link");zt(E),Kt(E,"link",t),E._p=new Promise(function(L,K){E.onload=L,E.onerror=K}),E.addEventListener("load",function(){b.loading|=1}),E.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Mo(g,r,c)}g={type:"stylesheet",instance:g,count:1,state:b},l.set(f,g)}}}function UR(t,r){Zr.X(t,r);var a=Ni;if(a&&t){var c=ri(a).hoistableScripts,l=Li(t),f=c.get(l);f||(f=a.querySelector(eu(l)),f||(t=S({src:t,async:!0},r),(r=Vn.get(l))&&Ym(t,r),f=a.createElement("script"),zt(f),Kt(f,"link",t),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},c.set(l,f))}}function zR(t,r){Zr.M(t,r);var a=Ni;if(a&&t){var c=ri(a).hoistableScripts,l=Li(t),f=c.get(l);f||(f=a.querySelector(eu(l)),f||(t=S({src:t,async:!0,type:"module"},r),(r=Vn.get(l))&&Ym(t,r),f=a.createElement("script"),zt(f),Kt(f,"link",t),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},c.set(l,f))}}function c1(t,r,a,c){var l=(l=xe.current)?Ao(l):null;if(!l)throw Error(i(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=Di(a.href),a=ri(l).hoistableStyles,c=a.get(r),c||(c={type:"style",instance:null,count:0,state:null},a.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Di(a.href);var f=ri(l).hoistableStyles,g=f.get(t);if(g||(l=l.ownerDocument||l,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(t,g),(f=l.querySelector(Wc(t)))&&!f._p&&(g.instance=f,g.state.loading=5),Vn.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Vn.set(t,a),f||NR(l,t,a,g.state))),r&&c===null)throw Error(i(528,""));return g}if(r&&c!==null)throw Error(i(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Li(a),a=ri(l).hoistableScripts,c=a.get(r),c||(c={type:"script",instance:null,count:0,state:null},a.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,t))}}function Di(t){return'href="'+Nn(t)+'"'}function Wc(t){return'link[rel="stylesheet"]['+t+"]"}function u1(t){return S({},t,{"data-precedence":t.precedence,precedence:null})}function NR(t,r,a,c){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=t.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Kt(r,"link",a),zt(r),t.head.appendChild(r))}function Li(t){return'[src="'+Nn(t)+'"]'}function eu(t){return"script[async]"+t}function l1(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var c=t.querySelector('style[data-href~="'+Nn(a.href)+'"]');if(c)return r.instance=c,zt(c),c;var l=S({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),zt(c),Kt(c,"style",l),Mo(c,a.precedence,t),r.instance=c;case"stylesheet":l=Di(a.href);var f=t.querySelector(Wc(l));if(f)return r.state.loading|=4,r.instance=f,zt(f),f;c=u1(a),(l=Vn.get(l))&&Im(c,l),f=(t.ownerDocument||t).createElement("link"),zt(f);var g=f;return g._p=new Promise(function(b,E){g.onload=b,g.onerror=E}),Kt(f,"link",c),r.state.loading|=4,Mo(f,a.precedence,t),r.instance=f;case"script":return f=Li(a.src),(l=t.querySelector(eu(f)))?(r.instance=l,zt(l),l):(c=a,(l=Vn.get(f))&&(c=S({},a),Ym(c,l)),t=t.ownerDocument||t,l=t.createElement("script"),zt(l),Kt(l,"link",c),t.head.appendChild(l),r.instance=l);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,Mo(c,a.precedence,t));return r.instance}function Mo(t,r,a){for(var c=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=c.length?c[c.length-1]:null,f=l,g=0;g title"):null)}function DR(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function d1(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function LR(t,r,a,c){if(a.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var l=Di(c.href),f=r.querySelector(Wc(l));if(f){r=f._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=ko.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=f,zt(f);return}f=r.ownerDocument||r,c=u1(c),(l=Vn.get(l))&&Im(c,l),f=f.createElement("link"),zt(f);var g=f;g._p=new Promise(function(b,E){g.onload=b,g.onerror=E}),Kt(f,"link",c),a.instance=f}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=ko.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var Gm=0;function jR(t,r){return t.stylesheets&&t.count===0&&zo(t,t.stylesheets),0Gm?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(l)}}:null}function ko(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zo(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Uo=null;function zo(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Uo=new Map,r.forEach(BR,t),Uo=null,ko.call(t))}function BR(t,r){if(!(r.state.loading&4)){var a=Uo.get(t);if(a)var c=a.get(null);else{a=new Map,Uo.set(t,a);for(var l=t.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),ep.exports=WR(),ep.exports}var tA=eA();const bt=(e,n)=>{switch(n.length){case 0:return e;case 1:return n[0](e);case 2:return n[1](n[0](e));case 3:return n[2](n[1](n[0](e)));case 4:return n[3](n[2](n[1](n[0](e))));case 5:return n[4](n[3](n[2](n[1](n[0](e)))));case 6:return n[5](n[4](n[3](n[2](n[1](n[0](e))))));case 7:return n[6](n[5](n[4](n[3](n[2](n[1](n[0](e)))))));case 8:return n[7](n[6](n[5](n[4](n[3](n[2](n[1](n[0](e))))))));case 9:return n[8](n[7](n[6](n[5](n[4](n[3](n[2](n[1](n[0](e)))))))));default:{let s=e;for(let i=0,u=n.length;in(s,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(s,i){return arguments.length>=2?n(s,i):function(u){return n(u,s)}};case 3:return function(s,i,u){return arguments.length>=3?n(s,i,u):function(o){return n(o,s,i)}};default:return function(){if(arguments.length>=e)return n.apply(this,arguments);const s=arguments;return function(i){return n(i,...s)}}}},_e=e=>e,us=e=>()=>e,Pf=us(!0),Ux=us(!1),jg=us(void 0),cc=jg;function rA(e,...n){return bt(e,n)}function zx(e,n,s,i,u,o,d,h,p){switch(arguments.length){case 1:return e;case 2:return function(){return n(e.apply(this,arguments))};case 3:return function(){return s(n(e.apply(this,arguments)))};case 4:return function(){return i(s(n(e.apply(this,arguments))))};case 5:return function(){return u(i(s(n(e.apply(this,arguments)))))};case 6:return function(){return o(u(i(s(n(e.apply(this,arguments))))))};case 7:return function(){return d(o(u(i(s(n(e.apply(this,arguments)))))))};case 8:return function(){return h(d(o(u(i(s(n(e.apply(this,arguments))))))))};case 9:return function(){return p(h(d(o(u(i(s(n(e.apply(this,arguments)))))))))}}}function ra(e){const n=new WeakMap;return s=>{if(n.has(s))return n.get(s);const i=e(s);return n.set(s,i),i}}const Bp=e=>{const n=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return n;e instanceof Error&&n.delete("stack");const s=Object.getPrototypeOf(e);let i=s;for(;i!==null&&i!==Object.prototype;){const u=Reflect.ownKeys(i);for(let o=0;olA(e)&&n in e);function oA(e){return Be(e,Symbol.iterator)||Xf(e)}const tn="~effect/interfaces/Hash",Je=e=>{switch(typeof e){case"number":return Bg(e);case"bigint":return Mt(e.toString(10));case"boolean":return Mt(String(e));case"symbol":return Mt(String(e));case"string":return Mt(e);case"undefined":return Mt("undefined");case"function":case"object":{if(e===null)return Mt("null");if(e instanceof Date)return Mt(e.toISOString());if(e instanceof RegExp)return Mt(e.toString());{if(qp.has(e))return $p(e);if(ap.has(e))return ap.get(e);const n=pA(e,()=>fA(e)?e[tn]():typeof e=="function"?$p(e):Array.isArray(e)?Dx(e):e instanceof Map?hA(e):e instanceof Set?mA(e):qg(e));return ap.set(e,n),n}}default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},$p=e=>(sp.has(e)||sp.set(e,Bg(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),sp.get(e)),Xn=P(2,(e,n)=>e*53^n),Jf=e=>e&3221225471|e>>>1&1073741824,fA=e=>Be(e,tn),Bg=e=>{if(e!==e)return Mt("NaN");if(e===1/0)return Mt("Infinity");if(e===-1/0)return Mt("-Infinity");let n=e|0;for(n!==e&&(n^=e*4294967295);e>4294967295;)n^=e/=4294967295;return Jf(n)},Mt=e=>{let n=5381,s=e.length;for(;s;)n=n*33^e.charCodeAt(--s);return Jf(n)},dA=(e,n)=>{let s=12289;for(const i of n)s^=Xn(Je(i),Je(e[i]));return Jf(s)},qg=e=>dA(e,Bp(e)),$g=(e,n)=>s=>{let i=e;for(const u of s)i^=n(u);return Jf(i)},Dx=$g(6151,Je),hA=$g(Mt("Map"),([e,n])=>Xn(Je(e),Je(n))),mA=$g(Mt("Set"),Je),sp=new WeakMap,ap=new WeakMap,ip=new WeakSet;function pA(e,n){if(ip.has(e))return Mt("[Circular]");ip.add(e);const s=n();return ip.delete(e),s}const nn="~effect/interfaces/Equal";function $t(){return arguments.length===1?e=>La(e,arguments[0]):La(arguments[0],arguments[1])}function La(e,n){if(e===n)return!0;if(e==null||n==null)return!1;const s=typeof e;return s!==typeof n?!1:s==="number"&&e!==e&&n!==n?!0:s!=="object"&&s!=="function"||qp.has(e)||qp.has(n)?!1:SA(e,n,yA)}function gA(e,n,s){const i=cp.has(e),u=up.has(n);if(i&&u)return!0;if(i||u)return!1;cp.add(e),up.add(n);const o=s();return cp.delete(e),up.delete(n),o}const cp=new WeakSet,up=new WeakSet;function yA(e,n){if(Je(e)!==Je(n))return!1;if(e instanceof Date)return n instanceof Date?e.toISOString()===n.toISOString():!1;if(e instanceof RegExp)return n instanceof RegExp?e.toString()===n.toString():!1;const s=L1(e),i=L1(n);if(s!==i)return!1;const u=s&&i;return typeof e=="function"&&!u?!1:gA(e,n,()=>u?e[nn](n):Array.isArray(e)?!Array.isArray(n)||e.length!==n.length?!1:vA(e,n):e instanceof Map?!(n instanceof Map)||e.size!==n.size?!1:xA(e,n):e instanceof Set?!(n instanceof Set)||e.size!==n.size?!1:wA(e,n):bA(e,n))}function SA(e,n,s){let i=Ho.get(e);if(!i)i=new WeakMap,Ho.set(e,i);else if(i.has(n))return i.get(n);const u=s(e,n);i.set(n,u);let o=Ho.get(n);return o||(o=new WeakMap,Ho.set(n,o)),o.set(e,u),u}const Ho=new WeakMap;function vA(e,n){for(let s=0;sBe(e,nn),TA=()=>$t,Zf=Symbol.for("~effect/Inspectable/redactable"),OA=e=>Be(e,Zf);function Wf(e){return OA(e)?Lx(e):e}function Lx(e){return e[Zf](globalThis[Su]?.services??RA)}const Su="~effect/Fiber/currentFiber",RA={"~effect/ServiceMap":{},mapUnsafe:new Map,pipe(){return bt(this,arguments)}};function Rt(e,n){const s=n?.space??0,i=new WeakSet,u=s?typeof s=="number"?" ".repeat(s):s:"",o=m=>u.repeat(m),d=(m,y)=>{const S=m?.constructor;return S&&S!==Object.prototype.constructor&&S.name?`${S.name}(${y})`:y},h=m=>{try{return Reflect.ownKeys(m)}catch{return["[ownKeys threw]"]}};function p(m,y=0){if(Array.isArray(m)){if(i.has(m))return j1;if(i.add(m),!u||m.length<=1)return`[${m.map(v=>p(v,y)).join(",")}]`;const S=m.map(v=>p(v,y+1)).join(`, +`+o(y+1));return`[ +${o(y+1)}${S} +${o(y)}]`}if(m instanceof Date)return MA(m);if(!n?.ignoreToString&&Be(m,"toString")&&typeof m.toString=="function"&&m.toString!==Object.prototype.toString&&m.toString!==Array.prototype.toString){const S=CA(m);return m instanceof Error&&m.cause?`${S} (cause: ${p(m.cause,y)})`:S}if(typeof m=="string")return JSON.stringify(m);if(typeof m=="number"||m==null||typeof m=="boolean"||typeof m=="symbol")return String(m);if(typeof m=="bigint")return String(m)+"n";if(typeof m=="object"||typeof m=="function"){if(i.has(m))return j1;if(i.add(m),Zf in m)return Rt(Lx(m));if(Symbol.iterator in m)return`${m.constructor.name}(${p(Array.from(m),y)})`;const S=h(m);if(!u||S.length<=1){const _=`{${S.map(x=>`${ff(x)}:${p(m[x],y)}`).join(",")}}`;return d(m,_)}const v=`{ +${S.map(_=>`${o(y+1)}${ff(_)}: ${p(m[_],y+1)}`).join(`, +`)} +${o(y)}}`;return d(m,v)}return String(m)}return p(e,0)}const j1="[Circular]";function ff(e){return typeof e=="string"?JSON.stringify(e):String(e)}function AA(e){return e.map(n=>`[${ff(n)}]`).join("")}function MA(e){try{return e.toISOString()}catch{return"Invalid Date"}}function CA(e){try{const n=e.toString();return typeof n=="string"?n:String(n)}catch{return"[toString threw]"}}function jx(e,n){let s=[];const i=JSON.stringify(e,(u,o)=>typeof o=="object"&&o!==null?s.includes(o)?void 0:s.push(o)&&Wf(o):o,n?.space);return s=void 0,i}const Ws=Symbol.for("nodejs.util.inspect.custom"),Fa=e=>{try{if(Be(e,"toJSON")&&Qf(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(Fa)}catch{return"[toJSON threw]"}return Wf(e)},kA=(e,n=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?UA(e,n):String(e)}catch{return String(e)}},UA=(e,n)=>{let s=[];const i=JSON.stringify(e,(u,o)=>typeof o=="object"&&o!==null?s.includes(o)?void 0:s.push(o)&&Wf(o):o,n);return s=void 0,i},B1={toJSON(){return Fa(this)},[Ws](){return this.toJSON()},toString(){return Rt(this.toJSON())}};class ed{called=!1;self;constructor(n){this.self=n}next(n){return this.called?{value:n,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new ed(this.self)}}const Pi="~effect/Effect/internal",Bx={[Pi]:e=>e()},zA={[Pi]:e=>e()},NA=Bx[Pi](()=>new Error().stack)?.includes(Pi)===!0,Wt=NA?Bx[Pi]:zA[Pi],ls="~effect/Effect",ku="~effect/Exit",DA={_A:_e,_E:_e,_R:_e},qx=`${ls}/identifier`,we=`${ls}/args`,Ht=`${ls}/evaluate`,kn=`${ls}/successCont`,_r=`${ls}/failureCont`,ja=`${ls}/ensureCont`,Aa=Symbol.for("effect/Effect/Yield"),Ar={pipe(){return bt(this,arguments)},toJSON(){return{...this}},toString(){return Rt(this.toJSON(),{ignoreToString:!0,space:2})},[Ws](){return this.toJSON()}},td={[Symbol.iterator](){return new ed(this)}},LA={...td,pipe(){return bt(this,arguments)}},jA={[ls]:DA,...Ar,[Symbol.iterator](){return new ed(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[qx],...we in this?{args:this[we]}:void 0}}},Xt=e=>Be(e,ls),$x=e=>Be(e,ku),Xo="~effect/Cause",Qo="~effect/Cause/Reason",nd=e=>Be(e,Xo),BA=e=>Be(e,Qo);class Ka{[Xo];reasons;constructor(n){this[Xo]=Xo,this.reasons=n}pipe(){return bt(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map(n=>n.toJSON())}}toString(){return`Cause(${Rt(this.reasons)})`}[Ws](){return this.toJSON()}[nn](n){return nd(n)&&this.reasons.length===n.reasons.length&&this.reasons.every((s,i)=>$t(s,n.reasons[i]))}[tn](){return Dx(this.reasons)}}const q1=new WeakMap;class Hg{[Qo];annotations;_tag;constructor(n,s,i){if(this[Qo]=Qo,this._tag=n,s!==rd&&typeof i=="object"&&i!==null&&s.size>0){const u=q1.get(i);u&&(s=new Map([...u,...s])),q1.set(i,s)}this.annotations=s}annotate(n,s){if(n.mapUnsafe.size===0)return this;const i=new Map(this.annotations);n.mapUnsafe.forEach((o,d)=>{s?.overwrite!==!0&&i.has(d)||i.set(d,o)});const u=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return u.annotations=i,u}pipe(){return bt(this,arguments)}toString(){return Rt(this)}[Ws](){return this.toString()}}const rd=new Map;class Hx extends Hg{error;constructor(n,s=rd){super("Fail",s,n),this.error=n}toString(){return`Fail(${Rt(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[nn](n){return Yg(n)&&$t(this.error,n.error)&&$t(this.annotations,n.annotations)}[tn](){return Xn(Mt(this._tag))(Xn(Je(this.error))(Je(this.annotations)))}}const sd=e=>new Ka(e),qA=new Ka([]),Vg=e=>new Ka([new Hx(e)]);class Ig extends Hg{defect;constructor(n,s=rd){super("Die",s,n),this.defect=n}toString(){return`Die(${Rt(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[nn](n){return HA(n)&&$t(this.defect,n.defect)&&$t(this.annotations,n.annotations)}[tn](){return Xn(Mt(this._tag))(Xn(Je(this.defect))(Je(this.annotations)))}}const $A=e=>new Ka([new Ig(e)]),Hp=P(e=>nd(e[0]),(e,n,s)=>n.mapUnsafe.size===0?e:new Ka(e.reasons.map(i=>i.annotate(n,s)))),Yg=e=>e._tag==="Fail",HA=e=>e._tag==="Die",Gg=e=>e._tag==="Interrupt";function VA(e){return Xi("Effect.evaluate: Not implemented")}const Zu=e=>({...jA,[qx]:e.op,[Ht]:e[Ht]??VA,[kn]:e[kn],[_r]:e[_r],[ja]:e[ja]}),or=e=>{const n=Zu(e);return function(){const s=Object.create(n);return s[we]=e.single===!1?arguments:arguments[0],s}},Vx=e=>{const n={...Zu(e),[ku]:ku,_tag:e.op,get[e.prop](){return this[we]},toString(){return`${e.op}(${Rt(this[we])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[we]}},[nn](s){return $x(s)&&s._tag===this._tag&&$t(this[we],s[we])},[tn](){return Xn(Mt(e.op),Je(this[we]))}};return function(s){const i=Object.create(n);return i[we]=s,i}},et=Vx({op:"Success",prop:"value",[Ht](e){const n=e.getCont(kn);return n?n[kn](this[we],e,this):e.yieldWith(this)}}),ad={key:"effect/Cause/StackTrace"},IA={key:"effect/Cause/InterruptorStackTrace"},Jn=Vx({op:"Failure",prop:"cause",[Ht](e){let n=this[we],s=!1;e.currentStackFrame&&(n=Hp(n,{mapUnsafe:new Map([[ad.key,e.currentStackFrame]])}),s=!0);let i=e.getCont(_r);for(;e.interruptible&&e._interruptedCause&&i;)i=e.getCont(_r);return i?i[_r](n,e,s?void 0:this):e.yieldWith(s?this:Jn(n))}}),Mr=e=>Jn(Vg(e)),Xi=e=>Jn($A(e)),Ve=or({op:"WithFiber",[Ht](e){return this[we](e)}}),YA=(function(){class e extends globalThis.Error{asEffect(){return Mr(this)}}return Object.assign(e.prototype,LA),e})(),Ix=(function(){const e=Symbol.for("effect/Data/Error/plainArgs");return class extends YA{constructor(s){super(s?.message,s?.cause?{cause:s.cause}:void 0),s&&(Object.assign(this,s),Object.defineProperty(this,e,{value:s,enumerable:!1}))}toJSON(){return{...this[e],...this}}}})(),Yx=e=>{class n extends Ix{_tag=e}return n.prototype.name=e,n},$1="~effect/Cause/NoSuchElementError";let Gx=class extends Yx("NoSuchElementError"){[$1]=$1;constructor(n){super({message:n})}};const Uu="~effect/Cause/Done",GA=e=>Be(e,Uu),Fx={[Uu]:Uu,_tag:"Done",value:void 0},Fg=e=>e===void 0?Fx:{[Uu]:Uu,_tag:"Done",value:e},FA=Mr(Fx),KA=e=>e===void 0?FA:Mr(Fg(e)),PA=e=>(n,s)=>n===s||e(n,s),XA=(e,n)=>e===n,QA=()=>XA;function JA(e){return PA((n,s)=>{if(n.length!==s.length)return!1;for(let i=0;ie.length>0,Px="~effect/data/Option",Xx={[Px]:{_A:e=>e},...Ar,...td},ZA=Object.assign(Object.create(Xx),{_tag:"Some",_op:"Some",[nn](e){return Qx(e)&&Zx(e)&&$t(this.value,e.value)},[tn](){return Xn(Je(this._tag))(Je(this.value))},toString(){return`some(${Rt(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:Fa(this.value)}},asEffect(){return et(this.value)}}),WA=Je("None"),eM=Object.assign(Object.create(Xx),{_tag:"None",_op:"None",[nn](e){return Qx(e)&&Jx(e)},[tn](){return WA},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}},asEffect(){return Mr(new Gx)}}),Qx=e=>Be(e,Px),Jx=e=>e._tag==="None",Zx=e=>e._tag==="Some",tM=Object.create(eM),nM=e=>{const n=Object.create(ZA);return n.value=e,n},Wx="~effect/data/Result",eE={[Wx]:{_A:e=>e,_E:e=>e},...Ar,...td},rM=Object.assign(Object.create(eE),{_tag:"Success",_op:"Success",[nn](e){return tE(e)&&rE(e)&&$t(this.success,e.success)},[tn](){return Xn(Je(this._tag))(Je(this.success))},toString(){return`success(${Rt(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:Fa(this.success)}},asEffect(){return et(this.success)}}),sM=Object.assign(Object.create(eE),{_tag:"Failure",_op:"Failure",[nn](e){return tE(e)&&nE(e)&&$t(this.failure,e.failure)},[tn](){return Xn(Je(this._tag))(Je(this.failure))},toString(){return`failure(${Rt(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:Fa(this.failure)}},asEffect(){return Mr(this.failure)}}),tE=e=>Be(e,Wx),nE=e=>e._tag==="Failure",rE=e=>e._tag==="Success",aM=e=>{const n=Object.create(sM);return n.failure=e,n},iM=e=>{const n=Object.create(rM);return n.success=e,n};function Kg(e){return(n,s)=>n===s?0:e(n,s)}const cM=Kg((e,n)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(n)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(n)?1:eKg((s,i)=>e(n(s),n(i)))),lM=e=>P(2,(n,s)=>e(n,s)===1),oM=e=>P(2,(n,s)=>n===s||e(n,s)<1?n:s),Ct=()=>tM,Te=nM,os=Jx,df=Zx,fM=P(2,(e,{onNone:n,onSome:s})=>os(e)?n():s(e.value)),dM=e=>e==null?Ct():Te(e),hM=P(2,(e,n)=>{if(df(e))return e.value;throw n()}),Pg=P(2,(e,n)=>os(e)?Ct():Te(n(e.value))),sE=P(2,(e,n)=>os(e)?Ct():n(e.value)),mM=P(2,(e,n)=>os(e)?Ct():dM(n(e.value))),pM=P(2,(e,n)=>os(e)?Ct():n(e.value)?Te(e.value):Ct()),fs=iM,ur=aM,ct=nE,gM=rE,yM={[Symbol.iterator](){return SM}},SM={next(){return{done:!0,value:void 0}}},vM=()=>yM,bM=P(2,(e,n)=>Object.hasOwn(e,n)),_M=e=>Object.keys(e),xM=e=>P(2,(n,s)=>{for(const i of _M(n))if(!bM(s,i)||!e(n[i],s[i]))return!1;return!0}),EM=e=>{const n=xM(e);return(s,i)=>n(s,i)&&n(i,s)},H1=globalThis.Array,Tr=e=>H1.isArray(e)?e:H1.from(e),aE=P(2,(e,n)=>[...e,n]),iE=P(2,(e,n)=>Tr(e).concat(Tr(n))),Vp=Kx,zu=Kx;function wM(e,n){return e<0||e>=n.length}const TM=P(2,(e,n)=>{const s=Math.floor(n);if(wM(s,e))throw new Error(`Index out of bounds: ${s}`);return e[s]}),OM=TM(0),RM=e=>e[e.length-1],AM=e=>e.slice(1),MM=P(3,(e,n,s)=>{const i=Tr(e),u=Tr(n);return zu(i)?zu(u)?UM(s)(iE(i,u)):i:u}),CM=P(2,(e,n)=>MM(e,n,TA())),Ip=()=>[],kM=e=>[e],UM=P(2,(e,n)=>{const s=Tr(e);if(zu(s)){const i=[OM(s)],u=AM(s);for(const o of u)i.every(d=>!n(o,d))&&i.push(o);return i}return[]}),Yp="~effect/time/Duration",zM=BigInt(0),NM=BigInt(1e3),DM=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Wu=e=>{if(cE(e))return e;if(of(e))return Gp(e);if(aA(e))return lp(e);if(Array.isArray(e)&&e.length===2&&e.every(of))return Number.isNaN(e[0])||Number.isNaN(e[1])?Xg:e[0]===-1/0||e[1]===-1/0?$M:e[0]===1/0||e[1]===1/0?qM:lp(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));if(Xf(e)){const n=DM.exec(e);if(n){const[s,i,u]=n,o=Number(i);switch(u){case"nano":case"nanos":return lp(BigInt(i));case"micro":case"micros":return HM(BigInt(i));case"milli":case"millis":return Gp(o);case"second":case"seconds":return VM(o);case"minute":case"minutes":return IM(o);case"hour":case"hours":return YM(o);case"day":case"days":return GM(o);case"week":case"weeks":return FM(o)}}}throw new Error(`Invalid Input: ${e}`)},V1={_tag:"Millis",millis:0},LM={_tag:"Infinity"},jM={_tag:"NegativeInfinity"},BM={[Yp]:Yp,[tn](){return qg(this.value)},[nn](e){return cE(e)&&JM(this,e)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[Ws](){return this.toJSON()},pipe(){return bt(this,arguments)}},fr=e=>{const n=Object.create(BM);return of(e)?isNaN(e)||e===0||Object.is(e,-0)?n.value=V1:Number.isFinite(e)?Number.isInteger(e)?n.value={_tag:"Millis",millis:e}:n.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))}:n.value=e>0?LM:jM:e===zM?n.value=V1:n.value={_tag:"Nanos",nanos:e},n},cE=e=>Be(e,Yp),uE=e=>e.value._tag!=="Infinity"&&e.value._tag!=="NegativeInfinity",Xg=fr(0),qM=fr(1/0),$M=fr(-1/0),lp=e=>fr(e),HM=e=>fr(e*NM),Gp=e=>fr(e),VM=e=>fr(e*1e3),IM=e=>fr(e*6e4),YM=e=>fr(e*36e5),GM=e=>fr(e*864e5),FM=e=>fr(e*6048e5),Qg=e=>KM(e,{onMillis:_e,onNanos:n=>Number(n)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),I1=e=>{switch(e.value._tag){case"Infinity":case"NegativeInfinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return e.value.nanos;case"Millis":return BigInt(Math.round(e.value.millis*1e6))}},KM=P(2,(e,n)=>{switch(e.value._tag){case"Millis":return n.onMillis(e.value.millis);case"Nanos":return n.onNanos(e.value.nanos);case"Infinity":return n.onInfinity();case"NegativeInfinity":return(n.onNegativeInfinity??n.onInfinity)()}}),lE=P(3,(e,n,s)=>e.value._tag==="Infinity"||e.value._tag==="NegativeInfinity"||n.value._tag==="Infinity"||n.value._tag==="NegativeInfinity"?s.onInfinity(e,n):e.value._tag==="Millis"?n.value._tag==="Millis"?s.onMillis(e.value.millis,n.value.millis):s.onNanos(I1(e),n.value.nanos):s.onNanos(e.value.nanos,I1(n))),PM=Kg((e,n)=>lE(e,n,{onMillis:(s,i)=>si?1:0,onNanos:(s,i)=>si?1:0,onInfinity:(s,i)=>s.value._tag===i.value._tag?0:s.value._tag==="Infinity"?1:s.value._tag==="NegativeInfinity"||i.value._tag==="Infinity"?-1:1})),XM=(e,n)=>lE(e,n,{onMillis:(s,i)=>s===i,onNanos:(s,i)=>s===i,onInfinity:(s,i)=>s.value._tag===i.value._tag}),QM=oM(PM),JM=P(2,(e,n)=>XM(e,n)),ZM=e=>n=>!ct(e(n)),WM=e=>n=>n.has(e)?fs(n):ur(n),eC=P(2,(e,n)=>s=>{const i=e(s);return ct(i)?i:n(i.success)}),oE=P(2,(e,n)=>s=>{const i=e(s);if(ct(i))return ur(s);const u=n(i.success);return ct(u)?ur(s):u}),tC="~effect/ServiceMap/Service",Sn=function(){const e=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=e;function s(){}const i=s;return Object.setPrototypeOf(i,nC),Object.defineProperty(i,"stack",{get(){return n.stack}}),arguments.length>0?(i.key=arguments[0],arguments[1]?.defaultValue&&(i[hf]=hf,i.defaultValue=arguments[1].defaultValue),i):function(u,o){return i.key=u,o?.make&&(i.make=o.make),i}},nC={[tC]:{_Service:e=>e,_Identifier:e=>e},...Ar,...td,toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},asEffect(){return(this.asEffect=us(Ve(n=>et(Kn(n.services,this)))))()},of(e){return e},serviceMap(e){return Qi(this,e)},use(e){return Ve(n=>e(Kn(n.services,this)))},useSync(e){return Ve(n=>et(e(Kn(n.services,this))))}},hf="~effect/ServiceMap/Reference",fE="~effect/ServiceMap",ir=e=>{const n=Object.create(rC);return n.mapUnsafe=e,n},rC={...Ar,[fE]:{_Services:e=>e},toJSON(){return{_id:"ServiceMap",services:Array.from(this.mapUnsafe).map(([e,n])=>({key:e,value:n}))}},[nn](e){if(!dE(e)||this.mapUnsafe.size!==e.mapUnsafe.size)return!1;for(const n of this.mapUnsafe.keys())if(!e.mapUnsafe.has(n)||!$t(this.mapUnsafe.get(n),e.mapUnsafe.get(n)))return!1;return!0},[tn](){return Bg(this.mapUnsafe.size)}},dE=e=>Be(e,fE),sC=e=>Be(e,hf),Qn=()=>aC,aC=ir(new Map),Qi=(e,n)=>ir(new Map([[e.key,n]])),ds=P(3,(e,n,s)=>{const i=new Map(e.mapUnsafe);return i.set(n.key,s),ir(i)}),iC=P(3,(e,n,s)=>e.mapUnsafe.has(n.key)?e.mapUnsafe.get(n.key):sC(n)?Jg(n):s()),id=P(2,(e,n)=>{if(!e.mapUnsafe.has(n.key)){if(hf in n)return Jg(n);throw uC(n)}return e.mapUnsafe.get(n.key)}),Kn=id,cC=(e,n)=>e.mapUnsafe.has(n.key)?e.mapUnsafe.get(n.key):Jg(n),op="~effect/ServiceMap/defaultValue",Jg=e=>op in e?e[op]:e[op]=e.defaultValue(),uC=e=>{const n=new Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(e.stack){const s=e.stack.split(` +`);if(s.length>2){const i=s[2].match(/at (.*)/);i&&(n.message=n.message+` (defined at ${i[1]})`)}}if(n.stack){const s=n.stack.split(` +`);s.splice(1,3),n.stack=s.join(` +`)}return n},Ba=P(2,(e,n)=>{if(e.mapUnsafe.size===0)return n;if(n.mapUnsafe.size===0)return e;const s=new Map(e.mapUnsafe);return n.mapUnsafe.forEach((i,u)=>s.set(u,i)),ir(s)}),lC=(...e)=>{const n=new Map;for(let s=0;s{n.set(u,i)});return ir(n)},ft=Sn,Ji=ft("effect/Scheduler",{defaultValue:()=>new Nu}),oC="setImmediate"in globalThis?e=>{const n=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(n)}:e=>{const n=setTimeout(e,0);return()=>clearTimeout(n)};class fC{buckets=[];scheduleTask(n,s){const i=this.buckets,u=i.length;let o,d=0;for(;ds);d++)o=i[d];o&&o[0]===s?o[1].push(n):d===u?i.push([s,[n]]):i.splice(d,0,[s,[n]])}drain(){const n=this.buckets;return this.buckets=[],n}}class Nu{tasks=new fC;running=void 0;executionMode;setImmediate;constructor(n="async",s=oC){this.executionMode=n,this.setImmediate=s}scheduleTask(n,s){this.tasks.scheduleTask(n,s),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){const n=this.tasks.drain();for(let s=0;s=n.maxOpsBeforeYield}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}}const dC=ft("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),hE="effect/Tracer/ParentSpan";class hC extends Sn()(hE){}const mC=e=>e,Fp=ft("effect/Tracer/DisablePropagation",{defaultValue:Ux}),pC=ft("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),gC=ft("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),mE="effect/Tracer",yC=ft(mE,{defaultValue:()=>mC({span:e=>new SC(e)})});class SC{_tag="Span";spanId;traceId="native";sampled;name;parent;annotations;links;startTime;kind;status;attributes;events=[];constructor(n){this.name=n.name,this.parent=n.parent,this.annotations=n.annotations,this.links=n.links,this.startTime=n.startTime,this.kind=n.kind,this.sampled=n.sampled,this.status={_tag:"Started",startTime:n.startTime},this.attributes=new Map,this.traceId=n.parent?.traceId??Y1(32),this.spanId=Y1(16)}end(n,s){this.status={_tag:"Ended",endTime:n,exit:s,startTime:this.status.startTime}}attribute(n,s){this.attributes.set(n,s)}event(n,s,i){this.events.push([n,s,i??{}])}addLinks(n){this.links.push(...n)}}const Y1=(function(){const e="abcdef0123456789",n=e.length;return function(s){let i="";for(let u=0;u"unbounded"}),pE=ft("effect/References/CurrentStackFrame",{defaultValue:jg}),bC=ft("effect/References/TracerEnabled",{defaultValue:Pf}),gE=ft("effect/References/TracerTimingEnabled",{defaultValue:Pf}),_C=ft("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),xC=ft("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),Zg=ft("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),EC=ft("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),wC=ft("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"}),TC=ft("effect/References/CurrentLogSpans",{defaultValue:()=>[]}),OC="effect/observability/Metric/FiberRuntimeMetricsKey",RC=e=>{if(e?.captureStackTrace===!1)return e;if(e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!="boolean")return e;const n=Error.stackTraceLimit;Error.stackTraceLimit=3;const s=new Error;return Error.stackTraceLimit=n,{...e,captureStackTrace:MC(()=>s.stack)}},AC=e=>n=>{let s;return()=>{if(s!==void 0)return s;const i=n();if(!i)return;const u=i.split(` +`);if(u[e]!==void 0)return s=u[e].trim(),s}},MC=AC(3),CC="dev";let yE=class extends Hg{fiberId;constructor(n,s=rd){super("Interrupt",s,"Interrupted"),this.fiberId=n}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[nn](n){return Gg(n)&&this.fiberId===n.fiberId&&this.annotations===n.annotations}[tn](){return Xn(Mt(`${this._tag}:${this.fiberId}`))($p(this.annotations))}};const kC=e=>new yE(e),el=e=>new Ka([new yE(e)]),UC=e=>{const n=e.reasons.find(Yg);return n?fs(n):ur(e)},Pa=e=>{for(let n=0;ne.reasons.some(Gg),Wg=e=>{let n;for(let s=0;s{const n=Wg(e);return ct(n)?DC:n.success},DC=new Set,LC=e=>e.reasons.every(Gg),jC=P(2,(e,n)=>{if(e.reasons.length===0)return n;if(n.reasons.length===0)return e;const s=new Ka(CM(e.reasons,n.reasons));return $t(e,s)?e:s}),BC=e=>{const n={Fail:[],Die:[],Interrupt:[]};for(let s=0;s{const n=BC(e);return n.Fail.length>0?n.Fail[0].error:n.Die.length>0?n.Die[0].defect:n.Interrupt.length>0?new globalThis.Error("All fibers interrupted without error"):new globalThis.Error("Empty cause")},qC=e=>{const n=[],s=[];if(e.reasons.length===0)return n;const i=Error.stackTraceLimit;Error.stackTraceLimit=1;for(const u of e.reasons){if(u._tag==="Interrupt"){s.push(u);continue}n.push(Kp(u._tag==="Die"?u.defect:u.error,u.annotations))}if(n.length===0){const u=new Error("The fiber was interrupted by:");u.name="InterruptCause",u.stack=IC(u,s);const o=new globalThis.Error("All fibers interrupted without error",{cause:u});o.name="InterruptError",o.stack=`${o.name}: ${o.message}`,n.push(Kp(o,s[0].annotations))}return Error.stackTraceLimit=i,n},Kp=(e,n)=>{const s=typeof e;let i;if(e&&s==="object"){if(i=new globalThis.Error($C(e),{cause:e.cause?Kp(e.cause):void 0}),typeof e.name=="string"&&(i.name=e.name),typeof e.stack=="string")i.stack=VC(e.stack,i,n);else{const u=`${i.name}: ${i.message}`;i.stack=n?vE(u,n):u}for(const u of Object.keys(e))u in i||(i[u]=e[u])}else i=new globalThis.Error(e?s==="string"?e:jx(e):`Unknown error: ${e}`);return i},$C=e=>{if(typeof e.message=="string")return e.message;if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return jx(e)},HC=/\((.*)\)/g,VC=(e,n,s)=>{const i=`${n.name}: ${n.message}`,u=(e.startsWith(i)?e.slice(i.length):e).split(` +`),o=[i];for(let d=1;d{const s=n?.get(ad.key);return s&&(e=`${e} +${bE(s)}`),e},IC=(e,n)=>{const s=[`${e.name}: ${e.message}`];for(const i of n){const u=i.fiberId!==void 0?`#${i.fiberId}`:"unknown",o=i.annotations.get(IA.key);s.push(` at fiber (${u})`),o&&s.push(bE(o))}return s.join(` +`)},bE=e=>{const n=[];let s=e,i=0;for(;s&&i<10;){const u=s.stack();if(u){const o=u.matchAll(HC);let d=!1;for(const[,h]of o)d=!0,n.push(` at ${s.name} (${h})`);d||n.push(` at ${s.name} (${u.replace(/^at /,"")})`)}else n.push(` at ${s.name}`);s=s.parent,i++}return n.join(` +`)},e0=e=>qC(e).map(n=>n.cause?`${n.stack} { +${_E(n.cause," ")} +}`:n.stack).join(` +`),_E=(e,n)=>{const s=e.stack.split(` +`);let i=`${n}[cause]: ${s[0]}`;for(let u=1,o=s.length;uglobalThis[Su];class EE{constructor(n,s=!0){this[Pp]=YC,this.setServices(n),this.id=++GC.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=s,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0}[Pp];id;interruptible;currentOpCount;currentLoopCount;_stack;_observers;_exit;_currentExit;_children;_interruptedCause;_yielded;services;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;getRef(n){return cC(this.services,n)}addObserver(n){return this._exit?(n(this._exit),cc):(this._observers.push(n),()=>{const s=this._observers.indexOf(n);s>=0&&this._observers.splice(s,1)})}interruptUnsafe(n,s){if(this._exit)return;let i=el(n);this.currentStackFrame&&(i=Hp(i,Qi(ad,this.currentStackFrame))),s&&(i=Hp(i,s)),this._interruptedCause=this._interruptedCause?jC(this._interruptedCause,i):i,this.interruptible&&this.evaluate(en(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(n){if(this.runtimeMetrics?.recordFiberStart(this.services),this._exit)return;if(this._yielded!==void 0){const i=this._yielded;this._yielded=void 0,i()}const s=this.runLoop(n);if(s!==Aa){this._exit=s,this.runtimeMetrics?.recordFiberEnd(this.services,this._exit);for(let i=0;id)}if(u=this.currentTracerContext?this.currentTracerContext(u,this):u[Ht](this),o!==this.currentLoopCount)return Aa;if(u===Aa){const d=this._yielded;return ku in d?(this._yielded=void 0,d):Aa}}}catch(d){return Be(u,Ht)?this.runLoop(Xi(d)):Xi(`Fiber.runLoop: Not a valid effect: ${String(u)}`)}finally{globalThis[Su]=s}}getCont(n){for(;;){const s=this._stack.pop();if(!s)return;const i=s[ja]&&s[ja](this);if(i)return i[n]=i,i;if(s[n])return s}}yieldWith(n){return this._yielded=n,Aa}children(){return this._children??=new Set}pipe(){return bt(this,arguments)}setServices(n){this.services=n,this.currentScheduler=this.getRef(Ji),this.currentSpan=n.mapUnsafe.get(hE),this.currentLogLevel=this.getRef(EC),this.minimumLogLevel=this.getRef(wC),this.currentStackFrame=n.mapUnsafe.get(pE.key),this.maxOpsBeforeYield=this.getRef(dC),this.runtimeMetrics=n.mapUnsafe.get(OC);const s=n.mapUnsafe.get(mE);this.currentTracerContext=s?s.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}}const cd=e=>{if(!e.currentStackFrame)return;const n=new Map;return n.set(ad.key,e.currentStackFrame),ir(n)},FC=e=>{const n=e;return n._exit?ve(n._exit):an(s=>n._exit?s(ve(n._exit)):lt(e.addObserver(i=>s(ve(i)))))},wE=e=>an(n=>{const s=e[Symbol.iterator](),i=[];let u;function o(){let d=s.next();for(;!d.done;){if(d.value._exit){i.push(d.value._exit),d=s.next();continue}u=d.value.addObserver(h=>{i.push(h),o()});return}n(ve(i))}return o(),lt(()=>u?.())}),KC=e=>{const n=e;return n._exit?n._exit:an(s=>n._exit?s(n._exit):lt(e.addObserver(s)))},PC=e=>an(n=>{const s=Array.from(e);if(s.length===0)return n(ve(Ip()));const i=new Array(s.length),u=Ip();let o=0,d=!1;for(let h=0;h{if(o++,p._tag==="Failure")return d=!0,u.forEach(m=>m()),n(p);i[h]=p.value,o===s.length&&n(ve(i))}))}),t0=e=>Ve(n=>XC(e,n.id)),XC=P(e=>Be(e[0],Pp),(e,n,s)=>Ve(i=>{let u=cd(i);return u=u&&s?Ba(u,s):u??s,e.interruptUnsafe(n,u),ld(FC(e))})),mf=e=>Ve(n=>{const s=cd(n);for(const i of e)i.interruptUnsafe(n.id,s);return ld(wE(e))}),ve=et,en=Jn,ud=Mr,lt=or({op:"Sync",[Ht](e){const n=this[we](),s=e.getCont(kn);return s?s[kn](n,e):e.yieldWith(et(n))}}),ot=or({op:"Suspend",[Ht](e){return this[we]()}}),QC=or({op:"Yield",[Ht](e){let n=!1;return e.currentScheduler.scheduleTask(()=>{n||e.evaluate(Or)},this[we]??0),e.yieldWith(()=>{n=!0})}}),n0=QC(0),JC=e=>ve(Te(e)),r0=ve(Ct()),s0=e=>Xi(e),TE=e=>ot(()=>ud(Wt(e))),kt=ve(void 0),ZC=e=>OE(function(n,s){Wt(()=>e(s)).then(i=>n(ve(i)),i=>n(s0(i)))},e.length!==0),WC=e=>Ve(n=>e(n.id)),OE=or({op:"Async",single:!1,[Ht](e){const n=Wt(()=>this[we][0].bind(e.currentScheduler));let s=!1,i=!1;const u=this[we][1]?new AbortController:void 0,o=n(d=>{s||(s=!0,i?e.evaluate(d):i=d)},u?.signal);return i!==!1?i:(i=!0,e._yielded=()=>{s=!0},u===void 0&&o===void 0||e._stack.push(e3(()=>(s=!0,u?.abort(),o??Or))),Aa)}}),e3=or({op:"AsyncFinalizer",[ja](e){e.interruptible&&(e.interruptible=!1,e._stack.push(gd))},[_r](e,n){return zC(e)?qe(this[we](),()=>en(e)):en(e)}}),an=e=>OE(e,e.length>=2),t3=an(cc),n3=(...e)=>ot(()=>Du(e.length===1?e[0]():e[1].call(e[0].self))),RE=(e,...n)=>{const s=n.length===0?function(){return ot(()=>Du(e.apply(this,arguments)))}:function(){let i=ot(()=>Du(e.apply(this,arguments)));for(let u=0;uObject.defineProperty(n,"length",{value:e,configurable:!0}),r3=(e,...n)=>AE(e.length,n.length===0?function(){return G1(()=>e.apply(this,arguments))}:function(){let s=G1(()=>e.apply(this,arguments));for(const i of n)s=i(s);return s}),G1=e=>{try{const n=e();let s;for(;;){const i=n.next(s);if(i.done)return ve(i.value);const o=i.value.asEffect(),d=o;if(d&&d._tag==="Success"){s=d.value;continue}else{if(d&&d._tag==="Failure")return o;{let h=!0;return ot(()=>h?(h=!1,qe(o,p=>Du(n,p))):ot(()=>Du(e())))}}}}catch(n){return s0(n)}},Du=or({op:"Iterator",single:!1,[kn](e,n){const s=this[we][0];for(;;){const i=s.next(e);if(i.done)return ve(i.value);const u=i.value.asEffect();if(Pt(u)){if(u._tag==="Failure")return u}else return n._stack.push(this),u;e=u.value}},[Ht](e){return this[kn](this[we][1],e)}}),tl=P(2,(e,n)=>{const s=ve(n);return qe(e,i=>s)}),ME=e=>Bt(e,Te),Xa=P(2,(e,n)=>qe(e,s=>Xt(n)?n:Wt(()=>n(s)))),CE=P(2,(e,n)=>qe(e,s=>tl(Xt(n)?n:Wt(()=>n(s)),s))),ld=e=>qe(e,n=>Or),s3=(e,n)=>Ve(s=>an(i=>{let u=!1;const o=new Set,d=p=>{u=!0,i(o.size===0?p:qe(pd(mf(o)),()=>p))};let h=0;for(const p of e){if(u)break;const m=h++,y=sl(s,p,!0,!0,!1);o.add(y),y.addObserver(S=>{o.delete(y);const v=!u;d(S),v&&n?.onWinner&&n.onWinner({fiber:y,index:m,parentFiber:s})})}return mf(o)})),kE=P(e=>Xt(e[1]),(e,n,s)=>s3([e,n],s)),qe=P(2,(e,n)=>{const s=Object.create(a3);return s[we]=e,s[kn]=n.length!==1?i=>n(i):n,s}),a3=Zu({op:"OnSuccess",[Ht](e){return e._stack.push(this),this[we]}}),Pt=e=>ku in e,i3=P(2,(e,n)=>Pt(e)?e._tag==="Success"?n(e.value):e:qe(e,n)),c3=e=>qe(e,_e),Bt=P(2,(e,n)=>qe(e,s=>ve(Wt(()=>n(s))))),u3=P(2,(e,n)=>Pt(e)?m3(e,n):Bt(e,n)),l3=P(2,(e,n)=>Pt(e)?p3(e,n):C3(e,n)),o3=P(2,(e,n)=>Pt(e)?g3(e,n):k3(e,n)),f3=P(2,(e,n)=>{if(Pt(e)){if(e._tag==="Success")return e;const s=Pa(e.cause);return ct(s)?e:n(s.success)}return dd(e,n)}),UE=e=>Jn(el(e)),a0=e=>e._tag==="Success",d3=e=>e._tag==="Failure",h3=e=>e._tag==="Failure"?fs(e.cause):ur(e),Or=et(void 0),m3=P(2,(e,n)=>e._tag==="Success"?et(n(e.value)):e),p3=P(2,(e,n)=>{if(e._tag==="Success")return e;const s=Pa(e.cause);return ct(s)?e:Mr(n(s.success))}),g3=P(2,(e,n)=>{if(e._tag==="Success")return et(n.onSuccess(e.value));const s=Pa(e.cause);return ct(s)?e:Mr(n.onFailure(s.success))}),y3=P(2,(e,n)=>a0(e)?n:e),S3=e=>{const n=[];for(const s of e)s._tag==="Failure"&&n.push(...s.cause.reasons);return n.length===0?Or:Jn(sd(n))},v3=e=>a0(e)?Te(e.value):Ct(),od=P(2,(e,n)=>Ve(s=>{const i=s.services,u=n(i);return i===u?e:(s.setServices(u),f0(e,()=>{s.setServices(i)}))})),zE=P(3,(e,n,s)=>od(e,i=>{const u=id(i,n),o=s(u);return u===o?i:ds(i,n,o)})),b3=()=>_3,_3=Ve(e=>ve(e.services)),x3=e=>Ve(n=>e(n.services)),fd=P(2,(e,n)=>Pt(e)?e:od(e,Ba(n))),nl=function(){return arguments.length===1?P(2,(e,n)=>F1(e,arguments[0],n)):P(3,(e,n,s)=>F1(e,n,s)).apply(this,arguments)},F1=(e,n,s)=>od(e,i=>i.mapUnsafe.get(n.key)===s?i:ds(i,n,s)),E3=P(e=>Xt(e[1]),(e,n,s)=>w3(e,n,(i,u)=>[i,u],s)),w3=P(e=>Xt(e[1]),(e,n,s,i)=>i?.concurrent?Bt(Z3([e,n],{concurrency:2}),([u,o])=>Wt(()=>s(u,o))):qe(e,u=>Bt(n,o=>Wt(()=>s(u,o))))),T3=P(2,(e,n)=>qe(n,s=>s?ME(e):r0)),O3=P(e=>Xt(e[0]),(e,n)=>d0({while:Pf,body:us(n?.disableYield?e:qe(e,s=>n0)),step:cc})),rl=P(2,(e,n)=>{const s=Object.create(R3);return s[we]=e,s[_r]=n.length!==1?i=>n(i):n,s}),R3=Zu({op:"OnFailure",[Ht](e){return e._stack.push(this),this[we]}}),NE=P(3,(e,n,s)=>rl(e,i=>{const u=n(i);return ct(u)?en(u.failure):Wt(()=>s(u.success,i))})),dd=P(2,(e,n)=>NE(e,Pa,s=>n(s))),A3=P(2,(e,n)=>rl(e,s=>Xa(Wt(()=>n(s)),en(s)))),M3=P(e=>Xt(e[0]),(e,n,s,i)=>rl(e,u=>{const o=Pa(u);if(ct(o))return en(o.failure);const d=n(o.success);return ct(d)?i?Wt(()=>i(d.failure)):en(u):Wt(()=>s(d.success))})),C3=P(2,(e,n)=>dd(e,s=>TE(()=>n(s)))),k3=P(2,(e,n)=>i0(e,{onFailure:s=>TE(()=>n.onFailure(s)),onSuccess:s=>lt(()=>n.onSuccess(s))})),U3=e=>dd(e,s0),z3=P(e=>Xt(e[0]),(e,n)=>{if(!n?.log)return i0(e,{onFailure:i=>kt,onSuccess:i=>kt});const s=QE(n.log===!0?void 0:n.log);return hd(e,{onFailure(i){const u=UC(i);return ct(u)?en(u.failure):s(i)},onSuccess:i=>kt})}),fp=e=>L3(e,{onFailure:ur,onSuccess:fs}),hd=P(2,(e,n)=>{const s=Object.create(N3);return s[we]=e,s[kn]=n.onSuccess.length!==1?i=>n.onSuccess(i):n.onSuccess,s[_r]=n.onFailure.length!==1?i=>n.onFailure(i):n.onFailure,s}),N3=Zu({op:"OnSuccessAndFailure",[Ht](e){return e._stack.push(this),this[we]}}),i0=P(2,(e,n)=>hd(e,{onFailure:s=>{const i=s.reasons.find(Yg);return i?Wt(()=>n.onFailure(i.error)):en(s)},onSuccess:n.onSuccess})),D3=P(2,(e,n)=>i0(e,{onFailure:s=>lt(()=>n.onFailure(s)),onSuccess:s=>lt(()=>n.onSuccess(s))})),L3=P(2,(e,n)=>{if(Pt(e)){if(e._tag==="Success")return et(n.onSuccess(e.value));const s=Pa(e.cause);return ct(s)?e:et(n.onFailure(s.success))}return D3(e,n)}),c0=e=>Pt(e)?et(e):j3(e),j3=or({op:"Exit",[Ht](e){return e._stack.push(this),this[we]},[kn](e,n,s){return ve(s??et(e))},[_r](e,n,s){return ve(s??Jn(e))}}),B3=P(2,(e,n)=>Xa(h0(n),e)),DE=P(2,(e,n)=>kE(e,qe(h0(n.duration),n.onTimeout))),q3=P(2,(e,n)=>DE(e,{duration:n,onTimeout:()=>ud(new Ek)})),K1="~effect/Scope",P1="~effect/Scope/Closeable",md=Sn("effect/Scope"),LE=(e,n)=>ot(()=>jE(e,n)??kt),jE=(e,n)=>{if(e.state._tag==="Closed")return;const s={_tag:"Closed",exit:n};if(e.state._tag==="Empty"){e.state=s;return}const{finalizers:i}=e.state;if(e.state=s,i.size!==0)return i.size===1?i.values().next().value(n):$3(e,i,n)},$3=RE(function*(e,n,s){let i=[];const u=[],o=Array.from(n.values()),d=xE();for(let h=o.length-1;h>=0;h--){const p=o[h];e.strategy==="sequential"?i.push(yield*c0(p(s))):u.push(sl(d,p(s),!0,!0,"inherit"))}return u.length>0&&(i=yield*wE(u)),yield*S3(i)}),H3=(e,n)=>{const s=l0(n);if(e.state._tag==="Closed")return s.state=e.state,s;const i={};return Lu(e,i,u=>LE(s,u)),Lu(s,i,u=>lt(()=>u0(e,i))),s},Zi=(e,n)=>ot(()=>e.state._tag==="Closed"?n(e.state.exit):(Lu(e,{},n),kt)),V3=(e,n)=>Zi(e,us(n)),Lu=(e,n,s)=>{e.state._tag==="Empty"?e.state={_tag:"Open",finalizers:new Map([[n,s]])}:e.state._tag==="Open"&&e.state.finalizers.set(n,s)},u0=(e,n)=>{e.state._tag==="Open"&&e.state.finalizers.delete(n)},l0=(e="sequential")=>({[P1]:P1,[K1]:K1,strategy:e,state:I3}),I3={_tag:"Empty"},o0=md.asEffect(),Y3=nl(md),BE=e=>ot(()=>{const n=l0();return sa(e(n),s=>ot(()=>jE(n,s)??kt))}),G3=(e,n)=>pd(qe(o0,s=>CE(e,i=>Zi(s,u=>Wt(()=>n(i,u)))))),f0=or({op:"OnExit",single:!1,[Ht](e){return e._stack.push(this),this[we][0]},[ja](e){e.interruptible&&this[we][2]!==!0&&(e._stack.push(gd),e.interruptible=!1)},[kn](e,n,s){s??=et(e);const i=this[we][1](s);return i?qe(i,u=>s):s},[_r](e,n,s){s??=Jn(e);const i=this[we][1](s);return i?qe(i,u=>s):s}}),sa=P(2,f0),qE=P(2,(e,n)=>sa(e,s=>n)),F3=P(3,(e,n,s)=>sa(e,i=>{const u=n(i);return ct(u)?kt:s(u.success,i)})),K3=P(2,(e,n)=>F3(e,h3,n)),P3=P(3,(e,n,s)=>sa(e,i=>{if(i._tag!=="Failure")return kt;const u=n(i.cause);return ct(u)?kt:s(u.success,i.cause)})),X3=P(2,(e,n)=>P3(Wg,n)(e)),Q3=Ve(e=>en(el(e.id))),pd=e=>Ve(n=>(n.interruptible&&(n.interruptible=!1,n._stack.push(gd)),e)),$E=or({op:"SetInterruptible",[ja](e){if(e.interruptible=this[we],e._interruptedCause&&e.interruptible)return()=>en(e._interruptedCause)}}),gd=$E(!0),J3=$E(!1),HE=e=>Ve(n=>n.interruptible?e:(n.interruptible=!0,n._stack.push(J3),n._interruptedCause?en(n._interruptedCause):e)),Xp=e=>Ve(n=>n.interruptible?(n.interruptible=!1,n._stack.push(gd),e(HE)):e(_e)),Z3=(e,n)=>oA(e)?n?.mode==="result"?Ma(e,fp,n):Ma(e,_e,n):n?.discard?n.mode==="result"?Ma(Object.values(e),fp,n):Ma(Object.values(e),_e,n):ot(()=>{const s={};return tl(Ma(Object.entries(e),([i,u])=>Bt(n?.mode==="result"?fp(u):u,o=>{s[i]=o}),{discard:!0,concurrency:n?.concurrency}),s)}),d0=or({op:"While",[kn](e,n){return this[we].step(e),this[we].while()?(n._stack.push(this),this[we].body()):Or},[Ht](e){return this[we].while()?(e._stack.push(this),this[we].body()):Or}}),Ma=P(e=>typeof e[1]=="function",(e,n,s)=>Ve(i=>{const u=s?.concurrency==="inherit"?i.getRef(vC):s?.concurrency??1,o=u==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,u);if(o===1)return W3(e,n,s);const d=Tr(e);let h=d.length;if(h===0)return s?.discard?kt:ve([]);const p=s?.discard?void 0:new Array(h);let m=0;const y=cd(i);return an(S=>{const v=new Set,_=[];let x=!1,T=0,j=0,B=!1,M=!1;function I(){for(B=!0;T{if(!M){if(v.delete(H),V._tag==="Failure")if(!x)x=!0,h=m,_.push(...V.cause.reasons),v.forEach(Y=>Y.interruptUnsafe(i.id,y));else for(const Y of V.cause.reasons)Y._tag!=="Interrupt"&&_.push(Y);else p!==void 0&&(p[z]=V.value);j++,T--,j===h?S(_.length>0?Jn(sd(_)):ve(p)):!B&&!x&&TV.interruptUnsafe(i.id,y))}}B=!1}return I(),ot(()=>(M=!0,m=h,mf(v)))})})),W3=(e,n,s)=>ot(()=>{const i=s?.discard?void 0:[],u=e[Symbol.iterator]();let o=u.next(),d=0;return tl(d0({while:()=>!o.done,body:()=>n(o.value,d++),step:h=>{i&&i.push(h),o=u.next()}}),i)}),sl=(e,n,s=!1,i=!1,u=!1)=>{const o=u==="inherit"?e.interruptible:!u,d=new EE(e.services,o);return s?d.evaluate(n):e.currentScheduler.scheduleTask(()=>d.evaluate(n),0),!i&&!d._exit&&(e.children().add(d),d.addObserver(()=>e._children.delete(d))),d},ek=P(e=>Xt(e[0]),(e,n)=>Ve(s=>ve(sl(s,e,n?.startImmediately,!0,n?.uninterruptible)))),VE=P(e=>Xt(e[0]),(e,n,s)=>Ve(i=>{const u=sl(i,e,s?.startImmediately,!0,s?.uninterruptible);if(!u._exit)if(n.state._tag!=="Closed"){const o={};Lu(n,o,()=>WC(h=>h===u.id?kt:t0(u))),u.addObserver(()=>u0(n,o))}else u.interruptUnsafe(i.id,cd(i));return ve(u)})),tk=P(e=>Xt(e[0]),(e,n)=>qe(o0,s=>VE(e,s,n))),al=e=>(n,s)=>{const i=s?.scheduler||!e.mapUnsafe.has(Ji.key)&&new Nu,u=new EE(i?ds(e,Ji,i):e,s?.uninterruptible!==!0);if(u.evaluate(n),u._exit)return u;if(s?.signal)if(s.signal.aborted)u.interruptUnsafe();else{const o=()=>u.interruptUnsafe();s.signal.addEventListener("abort",o,{once:!0}),u.addObserver(()=>s.signal.removeEventListener("abort",o))}return u},nk=P(2,(e,n)=>{if(e._exit)return e;if(n.state._tag==="Closed")return e.interruptUnsafe(e.id),e;const s={};return Lu(n,s,()=>t0(e)),e.addObserver(()=>u0(n,s)),e}),rk=al(Qn()),sk=e=>{const n=al(e);return(s,i)=>{const u=n(s,i);return i?.onExit&&u.addObserver(i.onExit),o=>u.interruptUnsafe(o)}},ak=e=>{const n=al(e);return(s,i)=>{const u=n(s,i);return new Promise(o=>{u.addObserver(d=>o(d))})}},ik=ak(Qn()),IE=e=>{const n=al(e);return s=>{if(Pt(s))return s;const i=new Nu("sync"),u=n(s,{scheduler:i});return i.flush(),u._exit??Xi(u)}},ck=IE(Qn()),YE=e=>{const n=IE(e);return s=>{const i=n(s);if(i._tag==="Failure")throw SE(i.cause);return i.value}},uk=YE(Qn());class lk{waiters=new Set;taken=0;permits;constructor(n){this.permits=n}get free(){return this.permits-this.taken}take=n=>{const s=ot(()=>this.free{if(this.free>=n)return i(s);const u=()=>{this.free{this.waiters.delete(u)})}):(this.taken+=n,ve(n)));return s};updateTakenUnsafe(n,s){return this.taken=s(this.taken),this.waiters.size>0&&n.currentScheduler.scheduleTask(()=>{const i=this.waiters.values();let u=i.next();for(;u.done===!1&&this.free>0;)u.value(),u=i.next()},0),ve(this.free)}updateTaken(n){return Ve(s=>this.updateTakenUnsafe(s,n))}resize=n=>ld(Ve(s=>(this.permits=n,this.free<0?kt:this.updateTakenUnsafe(s,i=>i))));release=n=>this.updateTaken(s=>s-n);releaseAll=this.updateTaken(n=>0);withPermits=n=>s=>Xp(i=>qe(i(this.take(n)),u=>f0(i(s),()=>this.release(u),!0)));withPermit=this.withPermits(1);withPermitsIfAvailable=n=>s=>Xp(i=>ot(()=>this.freenew lk(e),X1=ve(!0),Q1=ve(!1);class fk{waiters=[];scheduled=!1;isOpen;constructor(n){this.isOpen=n}scheduleUnsafe(n){return this.scheduled||this.waiters.length===0||(this.scheduled=!0,n.currentScheduler.scheduleTask(this.flushWaiters,0)),X1}flushWaiters=()=>{this.scheduled=!1;const n=this.waiters;this.waiters=[];for(let s=0;sthis.isOpen?Q1:(this.isOpen=!0,this.scheduleUnsafe(n)));release=Ve(n=>this.open?Q1:this.scheduleUnsafe(n));openUnsafe(){return this.isOpen?!1:(this.isOpen=!0,this.flushWaiters(),!0)}await=an(n=>this.isOpen?n(kt):(this.waiters.push(n),lt(()=>{const s=this.waiters.indexOf(n);s!==-1&&this.waiters.splice(s,1)})));closeUnsafe(){return this.isOpen?(this.isOpen=!1,!0):!1}close=lt(()=>this.closeUnsafe());whenOpen=n=>Xa(this.await,n)}const dk=e=>new fk(e??!1),Qp=BigInt(0),hk={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:Qp,endTime:Qp,exit:Or},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},mk=e=>Object.assign(Object.create(hk),e),GE=e=>{if(e)return Kn(e.annotations,Fp)?e._tag==="Span"?GE(e.parent):void 0:e},FE=(e,n,s)=>{const i=!e.getRef(bC)||s?.annotations&&Kn(s.annotations,Fp),u=s?.parent??(s?.root?void 0:GE(e.currentSpan));let o;if(i)o=mk({name:n,parent:u,annotations:ds(s?.annotations??Qn(),Fp,!0)});else{const d=e.getRef(yC),h=e.getRef(uc),p=e.getRef(gE),m=e.getRef(_C),y=e.getRef(xC),S=s?.level??e.getRef(pC),v=s?.links!==void 0?[...y,...s.links]:y.slice();o=d.span({name:n,parent:u,annotations:s?.annotations??Qn(),links:v,startTime:p?h.currentTimeNanosUnsafe():0n,kind:s?.kind??"internal",root:s?.root??s?.parent===void 0,sampled:s?.sampled??(u?.sampled===!1?!1:!PE(e.getRef(gC),S))});for(const[_,x]of Object.entries(m))o.attribute(_,x);if(s?.attributes!==void 0)for(const[_,x]of Object.entries(s.attributes))o.attribute(_,x)}return o},pk=(e,n)=>pd(Ve(s=>{const i=id(s.services,md),u=FE(s,e,n??{}),o=s.getRef(uc),d=s.getRef(gE);return tl(Zi(i,h=>yk(u,h,o,d)),u)})),gk=(e,n)=>(n=typeof n=="function"?n:jg,zE(pE,s=>({name:e,stack:n,parent:s}))),yk=(e,n,s,i)=>lt(()=>{e.status._tag!=="Ended"&&e.end(i?s.currentTimeNanosUnsafe():Qp,n)}),Sk=(e,...n)=>{const s=n.length===1?void 0:n[0],i=n[n.length-1];return Ve(u=>{const o=FE(u,e,s),d=u.getRef(uc);return sa(Wt(()=>i(o)),h=>lt(()=>{o.status._tag!=="Ended"&&o.end(d.currentTimeNanosUnsafe(),h)}))})},J1=nl(hC),vk=function(){const e=Xt(arguments[0]),n=e?arguments[1]:arguments[0];let s=e?arguments[2]:arguments[1],i=_e;return n._tag==="Span"&&(s=RC(s),i=gk(n.name,s?.captureStackTrace)),e?J1(i(arguments[0]),n):u=>J1(i(u),n)},uc=ft("effect/Clock",{defaultValue:()=>new _k}),bk=2**31-1;class _k{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=lt(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return xk()}currentTimeNanos=lt(()=>this.currentTimeNanosUnsafe());sleep(n){const s=Qg(n);return s<=0?n0:an(i=>{if(s>bk)return;const u=setTimeout(()=>i(kt),s);return lt(()=>clearTimeout(u))})}}const Z1=(function(){const e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now>"u")return()=>BigInt(Date.now())*e;if(typeof performance.timeOrigin=="number"&&performance.timeOrigin===0)return()=>BigInt(Math.round(performance.now()*1e6));const n=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6));return()=>n+BigInt(Math.round(performance.now()*1e6))})(),xk=(function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return Z1;const n=Z1()-e.bigint();return()=>n+e.bigint()})(),KE=e=>Ve(n=>e(n.getRef(uc))),h0=e=>KE(n=>n.sleep(Wu(e))),W1="~effect/Cause/TimeoutError";class Ek extends Yx("TimeoutError"){[W1]=W1;constructor(n){super({message:n})}}const wk=ft("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),Tk=e=>{switch(e){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 5e4;case"Error":return 4e4;case"Warn":return 3e4;case"Info":return 2e4;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},Ok=uM(cM,Tk),PE=lM(Ok),Rk=ft("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([Dk,Lk])}),Ak=ft("effect/Logger/LogToStderr",{defaultValue:Ux}),Mk="~effect/Logger",Ck={[Mk]:{_Message:_e,_Output:_e},pipe(){return bt(this,arguments)}},XE=e=>{const n=Object.create(Ck);return n.log=e,n},kk=e=>e.replace(/[\s="]/g,"_"),Uk=(e,n)=>`${kk(e[0])}=${n-e[1]}ms`,QE=e=>(...n)=>{let s;for(let i=0,u=n.length;i{const u=e??i.currentLogLevel;if(PE(i.minimumLogLevel,u))return kt;const o=i.getRef(uc),d=i.getRef(Rk);if(d.size>0){const h=new Date(o.currentTimeMillisUnsafe());for(const p of d)p.log({cause:s,fiber:i,date:h,logLevel:u,message:n})}return kt})},zk=e=>`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`,Nk=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;Nk&&process.stdout.isTTY;const Dk=XE(({cause:e,date:n,fiber:s,logLevel:i,message:u})=>{const o=Array.isArray(u)?u.slice():[u];e.reasons.length>0&&o.unshift(e0(e));const d=n.getTime(),h=s.getRef(TC);let p="";for(const v of h)p+=` ${Uk(v,d)}`;const m=s.getRef(Zg);Object.keys(m).length>0&&o.push(m);const y=s.getRef(wk);(s.getRef(Ak)?y.error:y.log)(`[${zk(n)}] ${i.toUpperCase()} (#${s.id})${p}:`,...o)}),Lk=XE(({cause:e,fiber:n,logLevel:s,message:i})=>{const u=n.getRef(uc),o=n.getRef(Zg),d=n.currentSpan;if(d===void 0||d._tag==="ExternalSpan")return;const h={};for(const[p,m]of Object.entries(o))h[p]=m;h["effect.fiberId"]=n.id,h["effect.logLevel"]=s.toUpperCase(),e.reasons.length>0&&(h["effect.cause"]=e0(e)),d.event(kA(Array.isArray(i)&&i.length===1?i[0]:i),u.currentTimeNanosUnsafe(),h)}),jk=nd,Bk=BA,Jp=sd,qk=Vg,$k=el,Zp=e=>new Hx(e),Wp=e=>new Ig(e),eg=kC,Hk=LC,JE=SE,xr=Pa,Vk=NC,Ik=Wg,dp=e0,yd=Gx,m0=GA,aa=KA,ZE=$x,vu=et,rs=Jn,WE=Mr,Yk=Xi,Gk=UE,Fk=Or,ew=a0,tw=d3,Kk=v3,Pk="~effect/Deferred",Xk={[Pk]:{_A:_e,_E:_e},pipe(){return bt(this,arguments)}},Sd=()=>{const e=Object.create(Xk);return e.resumes=void 0,e.effect=void 0,e},vd=e=>an(n=>e.effect?n(e.effect):(e.resumes??=[],e.resumes.push(n),lt(()=>{const s=e.resumes.indexOf(n);e.resumes.splice(s,1)}))),Qk=P(2,(e,n)=>lt(()=>bu(e,n))),p0=Qk,Jk=P(2,(e,n)=>p0(e,Jn(n))),Zk=P(2,(e,n)=>Jk(e,el(n))),bu=(e,n)=>{if(e.effect)return!1;if(e.effect=n,e.resumes){for(let s=0;sXp(s=>qe(c0(s(e)),i=>p0(n,i)))),Wi=md,g0=l0,ju=Y3,nw=Zi,Bu=V3,pf=H3,il=LE,e4="~effect/Layer",e_="~effect/Layer/MemoMap",t4={[e4]:{_ROut:_e,_E:_e,_RIn:_e},pipe(){return bt(this,arguments)}},rw=e=>{const n=Object.create(t4);return n.build=e,n},y0=e=>rw((n,s)=>{const i=pf(s);return sa(e(n,i),u=>u._tag==="Failure"?il(i,u):kt)}),n4=e=>{const n=y0((s,i)=>s.getOrElseMemoize(n,i,e));return n};class r4{get[e_](){return e_}map=new Map;getOrElseMemoize(n,s,i){if(this.map.has(n)){const h=this.map.get(n);return h.observers++,Xa(Zi(s,p=>h.finalizer(p)),h.effect)}const u=g0(),o=Sd(),d={observers:1,effect:vd(o),finalizer:h=>ot(()=>(d.observers--,d.observers===0?(this.map.delete(n),il(u,h)):kt))};return this.map.set(n,d),Zi(s,d.finalizer).pipe(qe(()=>i(this,u)),sa(h=>(d.effect=h,p0(o,h))))}}const S0=()=>new r4;class tg extends Sn()("effect/Layer/CurrentMemoMap"){static getOrCreate=iC(this,S0)}const gf=P(3,(e,n,s)=>nl(Bt(e.build(n,s),ds(tg,n)),tg,n)),s4=P(2,(e,n)=>Ve(s=>gf(e,tg.getOrCreate(s.services),n))),sw=function(){return arguments.length===1?e=>t_(Qi(arguments[0],e)):t_(Qi(arguments[0],arguments[1]))},t_=e=>rw(us(ve(e))),bd=function(){return arguments.length===1?e=>n_(arguments[0],e):n_(arguments[0],arguments[1])},n_=(e,n)=>ng(Bt(n,s=>Qi(e,s))),ng=e=>n4((n,s)=>ju(e,s)),aw=(e,n,s)=>{const i=pf(s,"parallel");return Ma(e,u=>u.build(n,pf(i,"sequential")),{concurrency:e.length}).pipe(Bt(u=>lC(...u)))},a4=(...e)=>y0((n,s)=>aw(e,n,s)),iw=(e,n,s)=>y0((i,u)=>qe(Array.isArray(n)?aw(n,i,u):n.build(i,u),o=>e.build(i,u).pipe(fd(o),Bt(d=>s(d,o))))),_u=P(2,(e,n)=>iw(e,n,_e)),hp=P(2,(e,n)=>iw(e,n,(s,i)=>Ba(i,s))),i4=class extends Kf{constructor(n){super(),n&&Object.assign(this,n)}},yf=P(2,(e,n)=>NE(e,u4,s=>n(s))),Sf=e=>e.reasons.some(c4),c4=e=>e._tag==="Fail"&&m0(e.error),cw=oE(xr,e=>m0(e)?fs(e):ur(e)),u4=oE(xr,e=>m0(e)?fs(e.value):ur(e)),l4=e=>{const n=cw(e);return ct(n)?rs(n.failure):vu(n.success.value)},uw=P(2,(e,n)=>hd(e,{onSuccess:n.onSuccess,onFailure:s=>{const i=cw(s);return ct(i)?n.onFailure(i.failure):n.onDone(i.success.value)}})),lw="~effect/Schedule",r_=ft("effect/Schedule/CurrentMetadata",{defaultValue:us({input:void 0,output:void 0,duration:Xg,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),o4={[lw]:{_Out:_e,_In:_e,_Env:_e},pipe(){return bt(this,arguments)}},f4=e=>Be(e,lw),_d=e=>{const n=Object.create(o4);return n.step=e,n},v0=()=>{let e=0,n,s;return(i,u)=>{s===void 0&&(s=i);const o=i-s,d=n===void 0?0:i-n;return n=i,{input:u,attempt:++e,start:s,now:i,elapsed:o,elapsedSincePrevious:d}}},ow=e=>_d(Bt(e,n=>{const s=v0();return(i,u)=>n(s(i,u))})),qu=e=>rl(e.step,n=>ve(()=>en(n))),d4=e=>KE(n=>Bt(qu(e),s=>{const i=v0();return u=>ot(()=>{const o=n.currentTimeMillisUnsafe();return qe(s(o,u),([d,h])=>{const p=i(o,u);return p.output=d,p.duration=h,tl(h0(h),p)})})})),h4=P(2,(e,n)=>m4(e,n,(s,i)=>[s,i])),m4=P(3,(e,n,s)=>_d(Bt(E3(qu(e),qu(n)),([i,u])=>(o,d)=>uw(i(o,d),{onSuccess:h=>u(o,d).pipe(Bt(p=>[s(h[0],p[0]),QM(h[1],p[1])]),yf(p=>ve([s(h[0],p),h[1]]))),onFailure:en,onDone:h=>u(o,d).pipe(Bt(p=>[s(h,p[0]),p[1]]),yf(p=>aa(s(h,p))))})))),p4=(e,n=2)=>{const s=Qg(Wu(e));return ow(ve(i=>{const u=Gp(s*Math.pow(n,i.attempt-1));return ve([u,u])}))},g4=e=>_d(Bt(qu(e),n=>(s,i)=>uw(n(s,i),{onSuccess:u=>ve([i,u[1]]),onFailure:en,onDone:()=>aa(i)}))),fw=e=>{const n=Wu(e);return ow(ve(s=>ve([s.attempt-1,n])))},mp=P(2,(e,n)=>_d(Bt(qu(e),s=>{const i=v0();return(u,o)=>qe(s(u,o),d=>{const[h,p]=d,m=n({...i(u,o),output:h,duration:p});return qe(Xt(m)?m:ve(m),y=>y?ve(d):aa(h))})}))),y4=fw(Xg),S4=(e,n,s)=>BE(i=>qe(s?.local?gf(n,S0(),i):s4(n,i),u=>fd(e,u))),v4=P(e=>Xt(e[0]),(e,n,s)=>dE(n)?fd(e,n):S4(e,Array.isArray(n)?a4(...n):n,s)),b4=P(3,(e,n,s)=>qe(d4(n),i=>{let u=r_.defaultValue(),o;const d=dd(ot(()=>nl(e,r_,u)),h=>(o=h,qe(i(h),p=>(u=p,d))));return yf(d,h=>Wt(()=>s(o,h)))})),_4=P(2,(e,n)=>{const s=typeof n=="function"?n(_e):f4(n)?n:E4(n);return b4(e,s,ud)}),x4=g4(y4),E4=e=>{let n=e.schedule??x4;return e.while&&(n=mp(n,({input:s})=>{const i=e.while(s);return Xt(i)?i:ve(i)})),e.until&&(n=mp(n,({input:s})=>{const i=e.until(s);return Xt(i)?Bt(i,u=>!u):ve(!i)})),e.times!==void 0&&(n=mp(n,({attempt:s})=>ve(s<=e.times))),n},w4=ls,ss=e=>typeof e=="object"&&e!==null&&w4 in e,dw=Ma,hw=d0,T4=ZC,Ee=ve,b0=r0,O4=JC,dr=ot,Ut=lt,rt=kt,$u=an,pu=t3,vf=n3,ke=ud,cl=en,bf=Ve,Xe=qe,R4=c3,_0=Xa,_f=CE,Ua=c0,Un=Bt,mw=ld,as=rl,A4=M3,Jo=U3,M4=A3,C4=_4,k4=z3,U4=q3,z4=DE,N4=B3,pw=kE,D4=T3,x0=hd,qa=b3,xd=x3,gw=v4,Yi=fd,L4=od,yw=nl,j4=o0,Sw=BE,E0=G3,B4=qE,rg=K3,w0=sa,Hu=Q3,T0=HE,O0=X3,q4=pd,xu=O3,$4=pk,H4=Sk,s_=vk,Eu=VE,R0=tk,V4=ek,I4=rk,$a=al,Y4=sk,G4=ik,xf=uk,F4=YE,K4=ck,cr=RE,P4=QE("Error"),X4=P(e=>Xt(e[0]),(e,...n)=>zE(e,Zg,s=>{const i={...s};return n.length===1?Object.assign(i,n[0]):i[n[0]]=n[1],i})),vw=u3,ul=l3,Vu=o3,Ii=i3,Q4=f3,A0=r3,J4=KC,Z4=PC,W4=t0,eU=mf,Ef=xE,bw=nk,M0=dk,tU=Symbol.for("effect/MutableList/Empty"),_w=()=>({head:void 0,tail:void 0,length:0}),a_=()=>({array:[],mutable:!0,offset:0,next:void 0}),Er=(e,n)=>{e.tail?e.tail.mutable||(e.tail.next=a_(),e.tail=e.tail.next):e.head=e.tail=a_(),e.tail.array.push(n),e.length++},nU=(e,n)=>rU(e,Tr(n),!Array.isArray(n)),rU=(e,n,s=!1)=>{const i={array:n,mutable:s,offset:0,next:void 0};return e.head?e.tail=e.tail.next=i:e.head=e.tail=i,e.length+=n.length,n.length},wu=e=>{e.head=e.tail=void 0,e.length=0},C0=(e,n)=>{if(n<=0||!e.head)return[];if(n=Math.min(n,e.length),n===e.length&&e.head?.offset===0&&!e.head.next){const o=e.head.array;return wu(e),o}const s=new Array(n);let i=0,u=e.head;for(;u;){for(;u.offsetC0(e,e.length),Iu=e=>{if(!e.head)return tU;const n=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:wu(e)),n},aU=(e,n)=>{const s=[];let i=e.head;for(;i;){for(let u=i.offset;uaU(e,s=>s!==n),i_="~effect/MutableRef",cU={[i_]:i_,...Ar,toJSON(){return{_id:"MutableRef",current:Fa(this.current)}}},uU=e=>{const n=Object.create(cU);return n.current=e,n},lU=P(2,(e,n)=>(e.current=n,e)),oU="~effect/PubSub/Subscription",fU=P(2,(e,n)=>dr(()=>e.shutdownFlag.current?Hu:e.pubsub.publish(n)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),Ee(!0)):e.strategy.handleSurplus(e.pubsub,e.subscribers,[n],e.shutdownFlag))),dU=e=>E0(Ut(()=>gU(e.pubsub,e.subscribers,e.strategy)),hU),hU=e=>q4(bf(n=>(lU(e.shutdownFlag,!0),dw(sU(e.pollers),s=>Zk(s,n.id),{discard:!0,concurrency:"unbounded"}).pipe(_f(()=>Ut(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),D4(e.shutdownHook.open),mw)))),mU=e=>dr(function n(s){if(e.shutdownFlag.current)return Hu;let i=e.pollers.length===0?e.subscription.pollUpTo(Number.POSITIVE_INFINITY):[];return s&&(i=s.concat(i)),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),e.replayWindow.remaining>0?Ee(e.replayWindow.takeAll().concat(i)):Vp(i)?Ee(i):Xe(pU(e),u=>n([u]))}),pU=e=>{const n=Sd();let s=e.subscribers.get(e.subscription);return s||(s=new Set,e.subscribers.set(e.subscription,s)),s.add(e.pollers),Er(e.pollers,n),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),O0(vd(n),()=>(iU(e.pollers,n),rt))},gU=(e,n,s)=>new yU(e,n,e.subscribe(),_w(),M0(!1),uU(!1),s,e.replayWindow());class yU{[oU]={_A:_e};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;constructor(n,s,i,u,o,d,h,p){this.pubsub=n,this.subscribers=s,this.subscription=i,this.pollers=u,this.shutdownHook=o,this.shutdownFlag=d,this.strategy=h,this.replayWindow=p}pipe(){return bt(this,arguments)}}const SU="~effect/Queue",vU="~effect/Queue/Enqueue",bU="~effect/Queue/Dequeue",pp={_A:_e,_E:_e},_U={[SU]:pp,[vU]:pp,[bU]:pp,...Ar,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:TU(this)}}},k0=e=>Ve(n=>{const s=Object.create(_U);return s.scheduler=n.currentScheduler,s.capacity=e?.capacity??Number.POSITIVE_INFINITY,s.strategy=e?.strategy??"suspend",s.messages=_w(),s.scheduleRunning=!1,s.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},ve(s)}),sg=e=>k0({capacity:e}),Vo=(e,n)=>ot(()=>{if(e.state._tag!=="Open")return wf;if(e.messages.length>=e.capacity)switch(e.strategy){case"dropping":return wf;case"suspend":return e.capacity<=0&&e.state.takers.size>0?(Er(e.messages,n),z0(e),Zo):MU(e,n);case"sliding":return Iu(e.messages),Er(e.messages,n),Zo}return Er(e.messages,n),Tf(e),Zo}),xw=(e,n)=>e.state._tag!=="Open"?!1:e.messages.length>=e.capacity?e.strategy==="sliding"?(Iu(e.messages),Er(e.messages,n),!0):e.capacity<=0&&e.state.takers.size>0?(Er(e.messages,n),z0(e),!0):!1:(Er(e.messages,n),Tf(e),!0),xU=(e,n)=>ot(()=>{if(e.state._tag!=="Open")return ve(Tr(n));const s=EU(e,n);return s.length===0?et([]):e.strategy==="dropping"?ve(s):CU(e,s)}),EU=(e,n)=>{if(e.state._tag!=="Open")return Tr(n);if(e.capacity===Number.POSITIVE_INFINITY||e.strategy==="sliding")return nU(e.messages,n),e.strategy==="sliding"&&C0(e.messages,e.messages.length-e.capacity),Tf(e),[];const s=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(s===0)return Tr(n);const i=[];let u=0;for(const o of n)ult(()=>U0(e,n))),U0=(e,n)=>{if(e.state._tag!=="Open")return!1;const s=Jn(n),i=y3(s,OU);return e.state.offers.size===0&&e.messages.length===0?(N0(e,i),!0):(e.state={...e.state,_tag:"Closing",exit:i},!0)},c_=e=>ts(e,Vg(Fg())),ag=e=>lt(()=>{if(e.state._tag==="Done")return!0;wu(e.messages);const n=e.state.offers;if(N0(e,e.state._tag==="Open"?RU:e.state.exit),n.size>0){for(const s of n)s._tag==="Single"?s.resume(wf):s.resume(et(s.remaining.slice(s.offset)));n.clear()}return!0}),Ew=e=>ww(e,1,Number.POSITIVE_INFINITY),ww=(e,n,s)=>ot(()=>AU(e,n,s)??Xa(Tw(e),ww(e,1,s))),ig=e=>ot(()=>wU(e)??Xa(Tw(e),ig(e))),wU=e=>{if(e.state._tag==="Done")return e.state.exit;if(e.messages.length>0){const n=Iu(e.messages);return Gi(e),et(n)}else if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Gi(e),e.capacity=0;const n=Iu(e.messages);return Gi(e),et(n)}},TU=e=>e.state._tag==="Done"?0:e.messages.length,wf=et(!1),Zo=et(!0),OU=Mr(Fg()),RU=UE(),z0=e=>{if(e.scheduleRunning=!1,!(e.state._tag==="Done"||e.state.takers.size===0)){for(const n of e.state.takers)if(e.state.takers.delete(n),n(Or),e.messages.length===0)break}},Tf=e=>{e.scheduleRunning||e.state._tag==="Done"||e.state.takers.size===0||(e.scheduleRunning=!0,e.scheduler.scheduleTask(()=>z0(e),0))},AU=(e,n,s)=>{if(e.state._tag==="Done")return e.state.exit;if(s<=0||n<=0)return et([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Gi(e),e.capacity=0;const i=[Iu(e.messages)];return Gi(e),et(i)}if(n=Math.min(n,e.capacity||1),n<=e.messages.length){const i=C0(e.messages,s);return Gi(e),et(i)}},MU=(e,n)=>an(s=>{if(e.state._tag!=="Open")return s(wf);const i={_tag:"Single",message:n,resume:s};return e.state.offers.add(i),lt(()=>{e.state._tag==="Open"&&e.state.offers.delete(i)})}),CU=(e,n)=>an(s=>{if(e.state._tag!=="Open")return s(et(n));const i={_tag:"Array",remaining:n,offset:0,resume:s};return e.state.offers.add(i),lt(()=>{e.state._tag==="Open"&&e.state.offers.delete(i)})}),Gi=e=>{if(e.state._tag==="Done")return Sf(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag==="Closing"&&e.messages.length===0?(N0(e,e.state.exit),Sf(e.state.exit.cause)):!1;let n=e.capacity-e.messages.length;for(const s of e.state.offers){if(n===0)break;if(s._tag==="Single")Er(e.messages,s.message),n--,s.resume(Zo),e.state.offers.delete(s);else{for(;s.offsetan(n=>e.state._tag==="Done"?n(e.state.exit):(e.state.takers.add(n),lt(()=>{e.state._tag!=="Done"&&e.state.takers.delete(n)}))),N0=(e,n)=>{if(e.state._tag==="Done")return;const s=e.state;e.state={_tag:"Done",exit:n};for(const i of s.takers)i(n);s.takers.clear();for(const i of s.awaiters)i(n);s.awaiters.clear()},u_="~effect/collections/MutableHashMap",kU={[u_]:u_,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${Rt(Array.from(this))})`},toJSON(){return{_id:"MutableHashMap",values:Fa(Array.from(this))}},[Ws](){return this.toJSON()},pipe(){return bt(this,arguments)}},l_=()=>{const e=Object.create(kU);return e.backing=new Map,e.buckets=new Map,e},o_=P(2,(e,n)=>{if(e.backing.has(n))return Te(e.backing.get(n));if(D0(n))return Ct();const s=ll.get(e);if(s!==void 0)return e.backing.has(s)?Te(e.backing.get(s)):Ct();const i=Je(n),u=e.buckets.get(i);return u===void 0?Ct():UU(e,u,n)}),ll=new WeakMap,D0=e=>typeof e!="object"&&typeof e!="function",UU=(e,n,s)=>{for(let i=0,u=n.length;i{if(e.backing.has(n)||D0(n))return e.backing.set(n,s),e;let i=ll.get(e);if(i!==void 0&&e.backing.has(i))return e.backing.set(i,s),e;const u=Je(n),o=e.buckets.get(u);return o===void 0?(e.buckets.set(u,[n]),e.backing.set(n,s),e):(i=zU(o,n),i===void 0&&(o.push(n),i=n),e.backing.set(i,s),e)}),zU=(e,n)=>{for(let s=0,i=e.length;s{if(D0(n))return e.backing.delete(n),e;const s=ll.get(e)??n,i=Je(s),u=e.buckets.get(i);if(u===void 0)return e;for(let o=0,d=u.length;oBe(e,Ow),LU={[Ow]:{_Env:_e,_InErr:_e,_InElem:_e,_OutErr:_e,_OutElem:_e},pipe(){return bt(this,arguments)}},Qa=e=>{const n=Object.create(LU);return n.transform=(s,i)=>as(e(s,i),u=>Ee(cl(u))),n},j0=(e,n)=>Qa((s,i)=>Xe(hs(e)(s,i),u=>n(u,i))),B0=e=>Qa((n,s)=>e),Rw=e=>Qa(cr(function*(n,s){const i=pf(s),u=d=>il(i,l4(d)),o=yield*rg(e(n,s,i),u);return rg(o,u)})),hs=e=>e.transform,jU=(e,n,s)=>k0({capacity:s?.bufferSize,strategy:s?.strategy}).pipe(_f(i=>Bu(e,ag(i))),_f(i=>Eu(ju(n(i),e),e))),BU=(e,n)=>Qa((s,i)=>Un(jU(i,e,n),Ew)),qU=B0(Ee(aa())),$U=e=>B0(Ee(Ew(e))),HU=e=>B0(Ee(O0(mU(e),()=>aa()))),VU=e=>Aw(Un(dU(e),HU)),IU=P(2,(e,n)=>j0(e,s=>Ut(()=>{let i=0;return Un(s,u=>n(u,i++))}))),YU=e=>e===void 0||e!=="unbounded"&&e<=1,GU=P(e=>DU(e[0]),(e,n,s)=>YU(s?.concurrency)?FU(e,n):KU(e,n,s)),FU=(e,n)=>Qa((s,i)=>{let u=0;return Un(hs(e)(s,i),Xe(o=>n(o,u++)))}),KU=(e,n,s)=>Rw(cr(function*(i,u,o){let d=0;const h=yield*hs(e)(i,u),p=s.concurrency==="unbounded"?Number.MAX_SAFE_INTEGER:s.concurrency,m=yield*sg(0);yield*Bu(o,ag(m));const y=$a(yield*qa()),S=bw(o);if(s.unordered){const v=L0(p),_=us(v.release(1)),x=x0({onFailure:T=>Xe(ts(m,T),_),onSuccess:T=>Xe(Vo(m,T),_)});yield*v.take(1).pipe(Xe(()=>h),Xe(T=>(S(y(x(n(T,d++)))),rt)),xu({disableYield:!0}),as(T=>v.withPermits(p-1)(ts(m,T))),Eu(o))}else{const v=yield*sg(p-2);yield*Bu(o,ag(m)),yield*ig(v).pipe(R4,Xe(T=>Vo(m,T)),xu({disableYield:!0}),as(T=>ts(m,T)),Eu(o));let _;const x=T=>{T._tag!=="Success"&&(_=T.cause,U0(m,T.cause))};yield*h.pipe(Xe(T=>{if(_)return cl(_);const j=y(n(T,d++));return S(j),j.addObserver(x),Vo(v,J4(j))}),xu({disableYield:!0}),as(T=>Vo(v,rs(T)).pipe(_0(ts(v,T)))),Eu(o))}return ig(m)})),PU=e=>j0(e,n=>{let s,i=0;const u=dr(function o(){if(s===void 0)return Xe(n,h=>{switch(h.length){case 0:return o();case 1:return Ee(h[0]);default:return s=h,Ee(h[i++])}});const d=s[i++];return i>=s.length&&(s=void 0,i=0),Ee(d)});return Ee(u)}),XU=P(2,(e,n)=>j0(e,s=>Ee(Xe(s,function i(u){const o=[];for(let d=0;dQa((n,s)=>{let i;return Ee(dr(()=>i||e.pipe(ju(s),Xe(u=>hs(u)(n,s)),Xe(u=>i=u))))}),QU=P(2,(e,n)=>Rw((s,i,u)=>nw(u,n).pipe(_0(hs(e)(s,i))))),JU=P(2,(e,n)=>QU(e,s=>n)),ZU=(e,n,s)=>dr(()=>{const i=g0(),u=hs(e)(aa(),i);return yf(Xe(u,n),Ee).pipe(w0(o=>il(i,o)))}),WU=P(2,(e,n)=>Qa((s,i)=>Un(Yi(hs(e)(s,i),n),Yi(n)))),ez=P(2,(e,n)=>ZU(e,s=>xu(Xe(s,n),{disableYield:!0}))),tz=cr(function*(e){const n=L0(1),s=yield*qa(),i=Kn(s,Wi);return(yield*hs(e)(aa(),i)).pipe(Yi(s),n.withPermits(1))},as(e=>Ee(cl(e)))),nz=(e,n)=>hs(e)(aa(),n);function cg(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function rz(e){return n=>cg(n)?.[e]}const sz=rz("identifier"),q0=ra(e=>{const n=sz(e);return typeof n=="string"?n:e.getExpected(q0)});function cu(e,n,s){return n==="__proto__"?Object.defineProperty(e,n,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[n]=s,e}const az=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),Wo=new WeakMap,Mw="~effect/data/Redacted",iz=e=>Be(e,Mw),d_=(e,n)=>{const s=Object.create(cz);return Wo.set(s,e),s},cz={[Mw]:{_A:e=>e},label:void 0,...Ar,toJSON(){return this.toString()},toString(){return``},[tn](){return Je(Wo.get(this))},[nn](e){return iz(e)&&$t(Wo.get(this),Wo.get(e))}},ug="~effect/SchemaIssue/Issue";function uz(e){return Be(e,ug)}let Cr=class{[ug]=ug;toString(){return yz(this)}},lz=class extends Cr{_tag="Filter";actual;filter;issue;constructor(n,s,i){super(),this.actual=n,this.filter=s,this.issue=i}};class oz extends Cr{_tag="Encoding";ast;actual;issue;constructor(n,s,i){super(),this.ast=n,this.actual=s,this.issue=i}}class Lt extends Cr{_tag="Pointer";path;issue;constructor(n,s){super(),this.path=n,this.issue=s}}class ef extends Cr{_tag="MissingKey";annotations;constructor(n){super(),this.annotations=n}}class Cw extends Cr{_tag="UnexpectedKey";ast;actual;constructor(n,s){super(),this.ast=n,this.actual=s}}class mt extends Cr{_tag="Composite";ast;actual;issues;constructor(n,s,i){super(),this.ast=n,this.actual=s,this.issues=i}}class kr extends Cr{_tag="InvalidType";ast;actual;constructor(n,s){super(),this.ast=n,this.actual=s}}class tf extends Cr{_tag="InvalidValue";actual;annotations;constructor(n,s){super(),this.actual=n,this.annotations=s}}class fz extends Cr{_tag="AnyOf";ast;actual;issues;constructor(n,s,i){super(),this.ast=n,this.actual=s,this.issues=i}}class dz extends Cr{_tag="OneOf";ast;actual;successes;constructor(n,s,i){super(),this.ast=n,this.actual=s,this.successes=i}}function hz(e,n){if(uz(n))return n;if(n!==void 0)return typeof n=="boolean"?n?void 0:new tf(Te(e)):typeof n=="string"?new tf(Te(e),{message:n}):new Lt(n.path,new tf(Te(e),{message:n.message}))}const mz=e=>{const n=Yu(e);if(n!==void 0)return n;switch(e._tag){case"InvalidType":return lg(q0(e.ast),h_(e.actual));case"InvalidValue":return`Invalid data ${h_(e.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${Rt(e.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${Rt(e.actual)}`}},pz=e=>Yu(e.issue)??Yu(e);function lg(e,n){return`Expected ${e}, got ${n}`}function $i(e,n,s,i){switch(e._tag){case"Filter":{const u=i(e);return u!==void 0?[{path:n,message:u}]:e.issue._tag==="InvalidValue"?[{path:n,message:lg(kw(e.filter),Rt(e.actual))}]:$i(e.issue,n,s,i)}case"Encoding":return $i(e.issue,n,s,i);case"Pointer":return $i(e.issue,[...n,...e.path],s,i);case"Composite":return e.issues.flatMap(u=>$i(u,n,s,i));case"AnyOf":{const u=Yu(e);if(e.issues.length===0){if(u!==void 0)return[{path:n,message:u}];const o=lg(q0(e.ast),Rt(e.actual));return[{path:n,message:o}]}return e.issues.flatMap(o=>$i(o,n,s,i))}default:return[{path:n,message:s(e)}]}}function kw(e){const n=e.annotations?.expected;if(typeof n=="string")return n;switch(e._tag){case"Filter":return"";case"FilterGroup":return e.checks.map(s=>kw(s)).join(" & ")}}function gz(){return e=>$i(e,[],mz,pz).map(Sz).join(` +`)}const yz=gz();function Sz(e){let n=e.message;if(e.path&&e.path.length>0){const s=AA(e.path);n+=` + at ${s}`}return n}function Yu(e){switch(e._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return uu(e.ast.annotations);case"InvalidValue":case"Forbidden":return uu(e.annotations);case"MissingKey":return uu(e.annotations,"messageMissingKey");case"UnexpectedKey":return uu(e.ast.annotations,"messageUnexpectedKey");case"Filter":return uu(e.filter.annotations);case"Encoding":return Yu(e.issue)}}function uu(e,n="message"){const s=e?.[n];if(typeof s=="string")return s}function h_(e){return os(e)?"no value provided":Rt(e.value)}class ec extends Kf{run;constructor(n){super(),this.run=n}map(n){return new ec((s,i)=>this.run(s,i).pipe(vw(Pg(n))))}compose(n){return m_(this)?n:m_(n)?this:new ec((s,i)=>this.run(s,i).pipe(Ii(u=>n.run(u,i))))}}const Uw=new ec(Ee);function m_(e){return e.run===Uw.run}function tc(){return Uw}function pn(e){return vz(Pg(e))}function vz(e){return new ec(n=>Ee(e(n)))}function bz(){return pn(globalThis.String)}function zw(){return pn(globalThis.Number)}const og="~effect/SchemaTransformation/Transformation";class gn{[og]=og;_tag="Transformation";decode;encode;constructor(n,s){this.decode=n,this.encode=s}flip(){return new gn(this.encode,this.decode)}compose(n){return new gn(this.decode.compose(n.decode),n.encode.compose(this.encode))}}function _z(e){return Be(e,og)}const Nw=e=>_z(e)?e:new gn(e.decode,e.encode);function Ed(e){return new gn(pn(e.decode),pn(e.encode))}const xz=new gn(tc(),tc());function $0(){return xz}const Dw=new gn(zw(),bz()),Lw=e=>Ed({decode:n=>{const s=new Error(n.message);return typeof n.name=="string"&&n.name!=="Error"&&(s.name=n.name),typeof n.stack=="string"&&(s.stack=n.stack),s},encode:n=>{const s={name:n.name,message:n.message};return e?.includeStack&&typeof n.stack=="string"&&(s.stack=n.stack),s}});function Ja(e){return n=>n._tag===e}const jw=Ja("Declaration"),Ez=Ja("Never"),Of=Ja("Literal"),wz=Ja("UniqueSymbol"),Tz=Ja("Arrays"),Oz=Ja("Objects"),Rz=Ja("Union");let Vt=class{to;transformation;constructor(n,s){this.to=n,this.transformation=s}};const Az={};class nc{isOptional;isMutable;defaultValue;annotations;constructor(n,s,i=void 0,u=void 0){this.isOptional=n,this.isMutable=s,this.defaultValue=i,this.annotations=u}}const p_="~effect/Schema";class vn{[p_]=p_;annotations;checks;encoding;context;constructor(n=void 0,s=void 0,i=void 0,u=void 0){this.annotations=n,this.checks=s,this.encoding=i,this.context=u}toString(){return`<${this._tag}>`}}class ol extends vn{_tag="Declaration";typeParameters;run;constructor(n,s,i,u,o,d){super(i,u,o,d),this.typeParameters=n,this.run=s}getParser(){const n=this.run(this.typeParameters);return(s,i)=>os(s)?b0:vw(n(s.value,this,i),Te)}recur(n){const s=rc(this.typeParameters,n);return s===this.typeParameters?this:new ol(s,this.run,this.annotations,this.checks,void 0,this.context)}getExpected(){const n=this.annotations?.expected;return typeof n=="string"?n:""}}class Mz extends vn{_tag="Null";getParser(){return Od(this,null)}getExpected(){return"null"}}const Bw=new Mz;let Cz=class extends vn{_tag="Undefined";getParser(){return Od(this,void 0)}toCodecJson(){return qt(this,[qw])}getExpected(){return"undefined"}};const qw=new Vt(Bw,new gn(pn(()=>{}),pn(()=>null))),kz=new Cz;let Uz=class extends vn{_tag="Void";getParser(){return Od(this,void 0)}toCodecJson(){return qt(this,[qw])}getExpected(){return"void"}};const zz=new Uz;let Nz=class extends vn{_tag="Never";getParser(){return Za(this,uA)}getExpected(){return"never"}};const Dz=new Nz;let Lz=class extends vn{_tag="Any";getParser(){return Za(this,Nx)}getExpected(){return"any"}};const jz=new Lz;let Bz=class extends vn{_tag="Unknown";getParser(){return Za(this,Nx)}getExpected(){return"unknown"}};const H0=new Bz;let Tu=class extends vn{_tag="Literal";literal;constructor(n,s,i,u,o){if(super(s,i,u,o),typeof n=="number"&&!globalThis.Number.isFinite(n))throw new Error(`A numeric literal must be finite, got ${Rt(n)}`);this.literal=n}getParser(){return Od(this,this.literal)}toCodecJson(){return typeof this.literal=="bigint"?g_(this):this}toCodecStringTree(){return typeof this.literal=="string"?this:g_(this)}getExpected(){return typeof this.literal=="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function g_(e){const n=globalThis.String(e.literal);return qt(e,[new Vt(new Tu(n),new gn(pn(()=>e.literal),pn(()=>n)))])}let qz=class extends vn{_tag="String";getParser(){return Za(this,Xf)}getExpected(){return"string"}};const $w=new qz;let $z=class extends vn{_tag="Number";getParser(){return Za(this,of)}toCodecJson(){return this.checks&&(gu(this.checks,"isFinite")||gu(this.checks,"isInt"))?this:qt(this,[Kz])}toCodecStringTree(){return this.checks&&(gu(this.checks,"isFinite")||gu(this.checks,"isInt"))?qt(this,[sN]):qt(this,[aN])}getExpected(){return"number"}};function gu(e,n){return e.some(s=>{switch(s._tag){case"Filter":return s.annotations?.meta?._tag===n;case"FilterGroup":return gu(s.checks,n)}})}const Hw=new $z;let Hz=class extends vn{_tag="Boolean";getParser(){return Za(this,sA)}getExpected(){return"boolean"}};const Vz=new Hz;class wd extends vn{_tag="Arrays";isMutable;elements;rest;constructor(n,s,i,u,o,d,h){super(u,o,d,h),this.isMutable=n,this.elements=s,this.rest=i;const p=s.findIndex(ns);if(p!==-1&&(s.slice(p+1).some(m=>!ns(m))||i.length>1))throw new Error("A required element cannot follow an optional element. ts(1257)");if(i.length>1&&i.slice(1).some(ns))throw new Error("An optional element cannot follow a rest element. ts(1266)")}getParser(n){const s=this,i=s.elements.map(d=>({ast:d,parser:n(d)})),u=s.rest.map(d=>({ast:d,parser:n(d)})),o=i.length;return A0(function*(d,h){if(d._tag==="None")return d;const p=d.value;if(!Array.isArray(p))return yield*ke(new kr(s,d));const m=[];let y;const S=h.errors==="all";let v=0;for(;v0){const[x,...T]=u,j=x.ast.context?.annotations;for(;v<_-T.length;v++){const B=x.parser(Te(p[v]),h),M=Pt(B)?B:yield*Ua(B);if(M._tag==="Failure"){const I=xr(M.cause);if(ct(I))return yield*M;const z=new Lt([v],I.success);if(S)y?y.push(z):y=[z];else return yield*ke(new mt(s,d,[z]))}else if(M.value._tag==="Some")m[v]=M.value.value;else{const I=new Lt([v],new ef(j));if(S)y?y.push(I):y=[I];else return yield*ke(new mt(s,d,[I]))}}for(let B=0;Bi.test(u))}case"Symbol":return Object.getOwnPropertySymbols(e);case"Number":return Object.keys(e).filter(i=>Iz.test(i));case"Union":return[...new Set(s.types.flatMap(i=>Vw(e,i)))];default:return[]}}class Iw{name;type;constructor(n,s){this.name=n,this.type=s}}class Yz{parameter;type;merge;constructor(n,s,i){if(this.parameter=n,this.type=s,this.merge=i,ns(s)&&!tT(s))throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class I0 extends vn{_tag="Objects";propertySignatures;indexSignatures;constructor(n,s,i,u,o,d){super(i,u,o,d),this.propertySignatures=n,this.indexSignatures=s;const h=n.map(p=>p.name).filter((p,m,y)=>y.indexOf(p)!==m);if(h.length>0)throw new Error(`Duplicate identifiers: ${JSON.stringify(h)}. ts(2300)`)}getParser(n){const s=this,i=[],u=new Set,o=[],d=s.propertySignatures.length;for(const p of s.propertySignatures)i.push(p.name),u.add(p.name),o.push({ps:p,parser:n(p.type),name:p.name,type:p.type});const h=s.indexSignatures.length;return s.propertySignatures.length===0&&s.indexSignatures.length===0?Za(s,cA):A0(function*(p,m){if(p._tag==="None")return p;const y=p.value;if(!(typeof y=="object"&&y!==null&&!Array.isArray(y)))return yield*ke(new kr(s,p));const S={};let v;const _=m.errors==="all",x=m.onExcessProperty==="error",T=m.onExcessProperty==="preserve";let j;if(s.indexSignatures.length===0&&(x||T)){j=Reflect.ownKeys(y);for(let B=0;B0)for(let B=0;B{const d=n(o.type);return d===o.type?o:new Iw(o.name,d)}),u=rc(this.indexSignatures,o=>{const d=n(o.parameter),h=n(o.type),p=s?o.merge?.flip():o.merge;return d===o.parameter&&h===o.type&&p===o.merge?o:new Yz(d,h,p)});return i===this.propertySignatures&&u===this.indexSignatures?this:new I0(i,u,this.annotations,this.checks,void 0,this.context)}flip(n){return this.rebuild(n,!0)}recur(n){return this.rebuild(n,!1)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?"object | array":"object"}}function Y0(e,n,s){return new I0(Reflect.ownKeys(e).map(i=>new Iw(i,e[i].ast)),[],s,n)}function Yw(e){return e.ast}function G0(e,n,s){return new fl(e.map(Yw),n,void 0,s)}function Gw(e){switch(e._tag){case"Null":return["null"];case"Undefined":case"Void":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return e.propertySignatures.length||e.indexSignatures.length?["object"]:["object","array"];case"Enum":return Array.from(new Set(e.enums.map(([,n])=>typeof n)));case"Literal":return[typeof e.literal];case"Union":return Array.from(new Set(e.types.flatMap(Gw)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function F0(e){switch(e._tag){default:return[];case"Declaration":{const n=e.annotations?.["~sentinels"];return Array.isArray(n)?n:[]}case"Objects":return e.propertySignatures.flatMap(n=>{const s=n.type;if(!ns(s)){if(Of(s))return[{key:n.name,literal:s.literal}];if(wz(s))return[{key:n.name,literal:s.symbol}]}return[]});case"Arrays":return e.elements.flatMap((n,s)=>Of(n)&&!ns(n)?[{key:s,literal:n.literal}]:[]);case"Suspend":return F0(e.thunk())}}const y_=new WeakMap;function Gz(e){let n=y_.get(e);if(n)return n;n={};for(const s of e){const i=Ps(s);if(Ez(i))continue;const u=Gw(i),o=F0(i);n.byType??={};for(const d of u)(n.byType[d]??=[]).push(s);if(o.length>0){n.bySentinel??=new Map;for(const{key:d,literal:h}of o){let p=n.bySentinel.get(d);p||n.bySentinel.set(d,p=new Map);let m=p.get(h);m||p.set(h,m=[]),m.push(s)}}else{n.otherwise??={};for(const d of u)(n.otherwise[d]??=[]).push(s)}}return y_.set(e,n),n}function S_(e){return n=>{const s=Ps(n);return s._tag==="Literal"?s.literal===e:s._tag==="UniqueSymbol"?s.symbol===e:!0}}function Fz(e,n){const s=Gz(n),i=e===null?"null":Array.isArray(e)?"array":typeof e;if(s.bySentinel){const u=s.otherwise?.[i]??[];if(i==="object"||i==="array"){for(const[o,d]of s.bySentinel)if(Object.hasOwn(e,o)){const h=d.get(e[o]);if(h)return[...h,...u].filter(S_(e))}}return u}return(s.byType?.[i]??[]).filter(S_(e))}let fl=class Fw extends vn{_tag="Union";types;mode;constructor(n,s,i,u,o,d){super(i,u,o,d),this.types=n,this.mode=s}getParser(n){const s=this;return A0(function*(i,u){if(i._tag==="None")return i;const o=i.value,d=s.mode==="oneOf",h=Fz(o,s.types);let p;const m={out:void 0,successes:[]};for(let y=0;y{const o=Ps(u);switch(o._tag){case"Arrays":{const d=o.elements.filter(Of);if(d.length>0)return`${v_(o.isMutable)}[ ${d.map(h=>n(h)+b_(h.context?.isOptional)).join(", ")}, ... ]`;break}case"Objects":{const d=o.propertySignatures.filter(h=>Of(h.type));if(d.length>0)return`{ ${d.map(h=>`${v_(h.type.context?.isMutable)}${ff(h.name)}${b_(h.type.context?.isOptional)}: ${n(h.type)}`).join(", ")}, ... }`;break}}return n(o)});return Array.from(new Set(i)).join(" | ")}};const Kw=new fl([new Tu("Infinity"),new Tu("-Infinity"),new Tu("NaN")],"anyOf"),Kz=new Vt(new fl([Hw,Kw],"anyOf"),new gn(zw(),pn(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function v_(e){return e?"":"readonly "}function b_(e){return e?"?":""}class Rf extends Kf{_tag="Filter";run;annotations;aborted;constructor(n,s=void 0,i=!1){super(),this.run=n,this.annotations=s,this.aborted=i}annotate(n){return new Rf(this.run,{...this.annotations,...n},this.aborted)}abort(){return new Rf(this.run,this.annotations,!0)}and(n,s){return new Af([this,n],s)}}class Af extends Kf{_tag="FilterGroup";checks;annotations;constructor(n,s=void 0){super(),this.checks=n,this.annotations=s}annotate(n){return new Af(this.checks,{...this.annotations,...n})}and(n,s){return new Af([this,n],s)}}function Pw(e,n,s=!1){return new Rf((i,u,o)=>hz(i,e(i,u,o)),n,s)}function Pz(e,n){const s=e.source;return Pw(i=>e.test(i),{expected:`a string matching the RegExp ${s}`,meta:{_tag:"isPattern",regExp:e},toArbitraryConstraint:{string:{patterns:[e.source]}},...n})}function Td(e,n){const s=Object.getOwnPropertyDescriptors(e);return n(s),Object.create(Object.getPrototypeOf(e),s)}function qt(e,n){return e.encoding===n?e:Td(e,s=>{s.encoding.value=n})}function K0(e,n){return e.context===n?e:Td(e,s=>{s.context.value=n})}function Xw(e,n){if(e.checks){const s=e.checks[e.checks.length-1];return Qw(e,aE(e.checks.slice(0,-1),s.annotate(n)))}return Td(e,s=>{s.annotations.value={...s.annotations.value,...n}})}function Qw(e,n){return e.checks===n?e:Td(e,s=>{s.checks.value=n})}function P0(e,n){return Qw(e,e.checks?[...e.checks,...n]:n)}function Jw(e,n){const s=e,i=s[s.length-1],u=n(i.to);return u!==i.to?aE(e.slice(0,e.length-1),new Vt(u,i.transformation)):e}function Xz(e){return n=>n.encoding?qt(n,Jw(n.encoding,e)):n}function Qz(e,n,s){const i=new Vt(e,n);return qt(s,s.encoding?[...s.encoding,i]:[i])}function rc(e,n){let s=!1;const i=new Array(e.length);for(let u=0;u{if(os(pM(o,iA))){const d=n(o);return ss(d)?d:Ee(d)}else return Ee(o)}),tc()),i=[new Vt(H0,s)],u=e.context?new nc(e.context.isOptional,e.context.isMutable,i,e.context.annotations):new nc(!1,!1,i);return K0(e,u)}function Zz(e,n,s){return Qz(e,s,n)}function ns(e){return e.context?.isOptional??!1}const Mf=ra(e=>{if(e.encoding)return Mf(qt(e,void 0));const n=e;return n.recur?.(Mf)??n}),Ps=ra(e=>Mf(za(e)));function Wz(e,n){const s=n,i=s.length,u=s[i-1],o=[new Vt(za(qt(e,void 0)),s[0].transformation.flip())];for(let h=1;h{if(e.encoding)return Wz(e,e.encoding);const n=e;return n.flip?.(za)??n.recur?.(za)??n});function tT(e){switch(e._tag){case"Undefined":return!0;case"Union":return e.types.some(tT);default:return!1}}function nT(e,n){return e.encodedParts.map(s=>tN(s,rT(s),n)).join("")}const eN=ra(e=>new globalThis.RegExp(`^${nT(e,!0)}$`));function rT(e){switch(e._tag){case"Literal":return az(globalThis.String(e.literal));case"String":return nN;case"Number":return V0;case"BigInt":return iN;case"TemplateLiteral":return nT(e,!1);case"Union":return e.types.map(rT).join("|")}}function tN(e,n,s){if(Rz(e)){if(!s)return`(?:${n})`}else if(!s)return n;return`(${n})`}function Od(e,n){const s=O4(n);return i=>i._tag==="None"?b0:i.value===n?s:ke(new kr(e,i))}function Za(e,n){return s=>s._tag==="None"?b0:n(s.value)?Ee(s):ke(new kr(e,s))}function sT(e){function n(s){return s.encoding?qt(s,Jw(s.encoding,n)):e(s)}return ra(n)}const aT=sT(e=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(aT)}}),nN="[\\s\\S]*?",__=new globalThis.RegExp(`^${V0}$`);function rN(e){return Pz(__,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:__},...e})}const iT=P0($w,[rN()]),sN=new Vt(iT,Dw),aN=new Vt(new fl([iT,Kw],"anyOf"),Dw),iN="-?\\d+";function fg(e,n,s,i,u){for(let o=0;os(i[u])))}}const lN=new ol([],()=>(e,n)=>uN(e)?Ee(e):ke(new kr(n,Te(e))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new Vt(H0,$0())}),oN=new Vt(Bw,new gn(tc(),pn(()=>null))),fN=new Vt(lN,$0()),dl=e=>e,yu=ra(e=>{switch(e._tag){case"Declaration":{const n=e.annotations?.[cT];if(Qf(n)){const s=n(e.typeParameters),i=yu(s.to);return qt(e,i===s.to?[s]:[new Vt(i,s.transformation)])}return e}case"Objects":case"Arrays":return e.recur(n=>{const s=n.context?.defaultValue;return s?qt(yu(n),s):yu(n)});case"Suspend":return e.recur(yu);default:return e}});function uT(e){const n=yu(Mf(e.ast)),s=X0(n);return(i,u)=>s(i,u?.parseOptions)}function lT(e){const n=uT(e);return(s,i)=>Kk(K4(n(s,i)))}function dN(e){const n=uT(e);return(s,i)=>xf(ul(n(s,i),u=>new Error(u.toString(),{cause:u})))}function Ha(e){return X0(e.ast)}function hN(e){return gN(Ha(e))}const mN=hN;function pN(e){return X0(za(e.ast))}function X0(e){const n=nf(e);return(s,i)=>Ii(n(Te(s),i??Az),u=>u._tag==="None"?ke(new tf(u)):Ee(u.value))}function gN(e){return(n,s)=>xf(ul(e(n,s),i=>new Error(i.toString(),{cause:i})))}const nf=ra(e=>{let n;if(!e.context&&!e.encoding&&!e.checks)return(i,u)=>(n??=e.getParser(nf),n(i,cg(e)?.parseOptions??u));const s=Tz(e)||Oz(e)||jw(e)&&e.typeParameters.length>0;return(i,u)=>{u=cg(e)?.parseOptions??u;const o=e.encoding;let d;if(o){const p=o,m=p.length;for(let y=m-1;y>=0;y--){const S=p[y],v=S.to,_=nf(v);if(d=d?Ii(d,x=>_(x,u)):_(i,u),S.transformation._tag==="Transformation"){const x=S.transformation.decode;d=Ii(d,T=>x.run(T,u))}else d=S.transformation.decode(d,u)}d=ul(d,y=>new oz(e,i,y))}n??=e.getParser(nf);let h=d?Ii(d,p=>n(p,u)):n(i,u);if(e.checks){const p=e.checks;u?.errors==="all"&&s&&df(i)&&(h=Q4(h,m=>{const y=[];fg(p.filter(v=>v.annotations?.[cN]),i.value,y,e,u);const S=Vp(y)?m._tag==="Composite"&&m.ast===e?new mt(e,m.actual,[...m.issues,...y]):new mt(e,i,[m,...y]):m;return ke(S)})),h=Ii(h,m=>{if(df(m)){const y=m.value,S=[];if(fg(p,y,S,e,u),Vp(S))return ke(new mt(e,m,S))}return Ee(m)})}return h}}),dg="~effect/Schema/Schema",yN={[dg]:dg,pipe(){return bt(this,arguments)},annotate(e){return this.rebuild(Xw(this.ast,e))},annotateKey(e){return this.rebuild(Zw(this.ast,e))},check(...e){return this.rebuild(P0(this.ast,e))}};function Q0(e,n){const s=Object.create(yN);return n&&Object.assign(s,n),s.ast=e,s.rebuild=i=>Q0(i,n),s.makeUnsafe=dN(s),s.makeOption=lT(s),s}const Hi=sT(e=>{const n=SN(e);return n!==e&&ns(e)?Ww(n):n});function SN(e){switch(e._tag){case"Declaration":{const n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(Qf(n)){const s=jw(e)?e.typeParameters.map(o=>Q0(Ps(o))):[],i=n(s),u=Hi(i.to);return qt(e,u===i.to?[i]:[new Vt(u,i.transformation)])}return qt(e,[oN])}case"Unknown":case"ObjectKeyword":return qt(e,[fN]);case"Undefined":case"Void":case"Literal":case"Number":return e.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":{if(e.propertySignatures.some(n=>typeof n.name!="string"))throw new globalThis.Error("Objects property names must be strings",{cause:e});return e.recur(Hi)}case"Union":{const n=vN(e.types);return n!==e.types?new fl(n,e.mode,e.annotations,e.checks,e.encoding,e.context).recur(Hi):e.recur(Hi)}case"Arrays":case"Suspend":return e.recur(Hi)}return e}const vN=_N(bN);function bN(e){switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function _N(e){return n=>{const s=new Map;for(let o=0;o{o=Ps(o),d=Ps(d);const h=e(o),p=e(d);return h!==p?h-p:s.get(o)-s.get(d)});return i.some((o,d)=>o!==n[d])?i:n}}const Ou=dg;function Rd(){return(e,n,s)=>st(new ol(e.map(Yw),i=>n(i.map(u=>st(u))),s))}function oT(e,n){return Rd()([],()=>(s,i)=>e(s)?Ee(s):ke(new kr(i,Te(s))),n)}const x_="~effect/Schema/SchemaError";class fT{[x_]=x_;_tag="SchemaError";name="SchemaError";issue;constructor(n){this.issue=n}get message(){return this.issue.toString()}toString(){return`SchemaError(${this.message})`}}function E_(e){const n=Ha(e);return(s,i)=>ul(n(s,i),u=>new fT(u))}const xN=mN;function EN(e){const n=pN(e);return(s,i)=>ul(n(s,i),u=>new fT(u))}const wN=EN,st=Q0;function J0(e){return Be(e,Ou)&&e[Ou]===Ou}const hg=dl(e=>st(eT(e.ast),{schema:e})),lc=dl(e=>hg(hT(e)));function Fn(e){const n=st(new Tu(e),{literal:e,transform(s){return n.pipe(Cf(Fn(s),{decode:pn(()=>s),encode:pn(()=>e)}))}});return n}const w_=st(Dz),T_=st(jz),TN=st(H0),ON=st(kz),vt=st($w),cs=st(Hw),ea=st(Vz),mg=st(zz);function Z0(e,n){return st(e,{fields:n,mapFields(s,i){const u=s(this.fields);return Z0(Y0(u,i?.unsafePreserveChecks?this.ast.checks:void 0),u)}})}function Qe(e){return Z0(Y0(e,void 0),e)}const pg=dl(e=>st(new wd(!1,[],[e.ast]),{schema:e})),RN=dl(e=>st(new wd(!1,[e.ast],[e.ast]),{schema:e}));function dT(e,n){return st(e,{members:n,mapMembers(s,i){const u=s(this.members);return dT(G0(u,this.ast.mode,i?.unsafePreserveChecks?this.ast.checks:void 0),u)}})}function lr(e,n){return dT(G0(e,"anyOf",void 0),e)}function W0(e){const n=e.map(Fn);return st(G0(n,"anyOf",void 0),{literals:e,members:n,mapMembers(s){return lr(s(this.members))},pick(s){return W0(s)},transform(s){return lr(n.map((i,u)=>i.transform(s[u])))}})}const hT=dl(e=>lr([e,ON]));function Cf(e,n){return s=>st(Zz(s.ast,e.ast,n?Nw(n):$0()),{from:s,to:e})}function AN(e){return n=>st(Jz(n.ast,e),{schema:n})}function Zn(e){return Fn(e).pipe(AN(()=>Te(e)))}function MN(e,n){return oT(s=>s instanceof e,n)}function hl(){return(e,n)=>new Vt(e.ast,Nw(n))}const CN=Pw;function kN(e){return CN(n=>globalThis.Number.isFinite(n),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...e})}function O_(e,n){const s=Rd()([e,n],([i,u])=>(o,d,h)=>{if(!Bk(o))return ke(new kr(d,Te(o)));switch(o._tag){case"Fail":return Vu(Ha(i)(o.error,h),{onSuccess:Zp,onFailure:p=>new mt(d,Te(o),[new Lt(["error"],p)])});case"Die":return Vu(Ha(u)(o.defect,h),{onSuccess:Wp,onFailure:p=>new mt(d,Te(o),[new Lt(["defect"],p)])});case"Interrupt":return Ee(o)}},{typeConstructor:{_tag:"effect/Cause/Failure"},generation:{runtime:"Schema.CauseReason(?, ?)",Type:"Cause.Failure",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause.Failure",toCodec:([i,u])=>hl()(lr([Qe({_tag:Fn("Fail"),error:i}),Qe({_tag:Fn("Die"),defect:u}),Qe({_tag:Fn("Interrupt"),fiberId:hT(NN)})]),Ed({decode:o=>{switch(o._tag){case"Fail":return Zp(o.error);case"Die":return Wp(o.defect);case"Interrupt":return eg(o.fiberId)}},encode:_e})),toArbitrary:([i,u])=>mT(i,u),toEquivalence:([i,u])=>pT(i,u),toFormatter:([i,u])=>gT(i,u)});return st(s.ast,{error:e,defect:n})}function mT(e,n){return(s,i)=>s.oneof(i?.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},s.constant(eg()),s.integer({min:1}).map(eg),e.map(u=>Zp(u)),n.map(u=>Wp(u)))}function pT(e,n){return(s,i)=>{if(s._tag!==i._tag)return!1;switch(s._tag){case"Fail":return e(s.error,i.error);case"Die":return n(s.defect,i.defect);case"Interrupt":return s.fiberId===i.fiberId}}}function gT(e,n){return s=>{switch(s._tag){case"Fail":return`Fail(${e(s.error)})`;case"Die":return`Die(${n(s.defect)})`;case"Interrupt":return"Interrupt"}}}function R_(e,n){const s=Rd()([e,n],([i,u])=>{const o=pg(O_(i,u));return(d,h,p)=>jk(d)?Vu(Ha(o)(d.reasons,p),{onSuccess:Jp,onFailure:m=>new mt(h,Te(d),[new Lt(["failures"],m)])}):ke(new kr(h,Te(d)))},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([i,u])=>hl()(pg(O_(i,u)),Ed({decode:Jp,encode:({reasons:o})=>o})),toArbitrary:([i,u])=>yT(i,u),toEquivalence:([i,u])=>ST(i,u),toFormatter:([i,u])=>vT(i,u)});return st(s.ast,{error:e,defect:n})}function yT(e,n){return(s,i)=>s.array(mT(e,n)(s,i)).map(Jp)}function ST(e,n){const s=JA(pT(e,n));return(i,u)=>s(i.reasons,u.reasons)}function vT(e,n){const s=gT(e,n);return i=>`Cause([${i.reasons.map(s).join(", ")}])`}const bT=Qe({message:vt,name:hg(vt),stack:hg(vt)}),UN=MN(globalThis.Error,{typeConstructor:{_tag:"Error"},generation:{runtime:"Schema.Error",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>hl()(bT,Lw()),toArbitrary:()=>e=>e.string().map(n=>new globalThis.Error(n))}),A_=new gn(tc(),pn(e=>{try{return JSON.parse(JSON.stringify(e))}catch{return Rt(e)}})),hr=lr([bT.pipe(Cf(UN,Lw())),T_.pipe(Cf(TN.annotate({toCodecJson:()=>hl()(T_,A_),toArbitrary:()=>e=>e.json()}),A_))]);function zN(e,n,s){const i=Rd()([e,n,s],([u,o,d])=>{const h=R_(o,d);return(p,m,y)=>{if(!ZE(p))return ke(new kr(m,Te(p)));switch(p._tag){case"Success":return Vu(Ha(u)(p.value,y),{onSuccess:vu,onFailure:S=>new mt(m,Te(p),[new Lt(["value"],S)])});case"Failure":return Vu(Ha(h)(p.cause,y),{onSuccess:rs,onFailure:S=>new mt(m,Te(p),[new Lt(["cause"],S)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([u,o,d])=>hl()(lr([Qe({_tag:Fn("Success"),value:u}),Qe({_tag:Fn("Failure"),cause:R_(o,d)})]),Ed({decode:h=>h._tag==="Success"?vu(h.value):rs(h.cause),encode:h=>ew(h)?{_tag:"Success",value:h.value}:{_tag:"Failure",cause:h.cause}})),toArbitrary:([u,o,d])=>(h,p)=>h.oneof(p?.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},u.map(m=>vu(m)),yT(o,d)(h,p).map(m=>rs(m))),toEquivalence:([u,o,d])=>{const h=ST(o,d);return(p,m)=>{if(p._tag!==m._tag)return!1;switch(p._tag){case"Success":return u(p.value,m.value);case"Failure":return h(p.cause,m.cause)}}},toFormatter:([u,o,d])=>{const h=vT(o,d);return p=>{switch(p._tag){case"Success":return`Exit.Success(${u(p.value)})`;case"Failure":return`Exit.Failure(${h(p.cause)})`}}}});return st(i.ast,{value:e,error:n,defect:s})}const NN=cs.check(kN()),DN=globalThis.Symbol.for("immer-draftable");function ey(e,n,s,i){const u=jN(s,n,i),o=_T(n);return class extends e{constructor(...[d,h]){const p=d??{};if(h?.disableValidation)super(p,h);else{const m=s.makeUnsafe(p,h);super({...p,...m},{...h,disableValidation:!0})}}toString(){return`${n}(${Rt({...this})})`}static[Ou]=Ou;get[o](){return o}static[DN]=!0;static identifier=n;static fields=s.fields;static get ast(){return u(this).ast}static pipe(){return bt(this,arguments)}static rebuild(d){return u(this).rebuild(d)}static makeUnsafe(d,h){return new this(d,h)}static makeOption(d,h){return lT(u(this))(d,h)}static annotate(d){return this.rebuild(Xw(this.ast,d))}static annotateKey(d){return this.rebuild(Zw(this.ast,d))}static check(...d){return this.rebuild(P0(this.ast,d))}static extend(d){return(h,p)=>{const m={...s.fields,...h};return ey(this,d,Z0(Y0(m,s.ast.checks,{identifier:d}),m),p)}}static mapFields(d,h){return s.mapFields(d,h)}}}function LN(e){return new gn(pn(n=>new e(n)),tc())}function _T(e){return`~effect/Schema/Class/${e}`}function jN(e,n,s){let i;return u=>{if(i===void 0){const o=LN(u),d=st(new ol([e.ast],()=>(h,p)=>h instanceof u||Be(h,_T(n))?Ee(h):ke(new kr(p,Te(h))),{identifier:n,[cT]:([h])=>new Vt(h,o),toCodec:([h])=>new Vt(h.ast,o),toArbitrary:([h])=>()=>h.map(p=>new u(p)),toFormatter:([h])=>p=>`${u.identifier}(${h(p)})`,"~sentinels":F0(e.ast),...s}));i=e.pipe(Cf(d,o))}return i}}function xT(e){return J0(e)}const BN=e=>(n,s)=>{const i=xT(n)?n:Qe(n);return ey(i4,e,i,s)},Wn=e=>(n,s)=>{const i=xT(n)?n:Qe(n);return ey(Ix,e,i,s)};function gp(e){return st(Hi(e.ast))}const qN="~effect/Stream",$N={_R:_e,_E:_e,_A:_e},HN={[qN]:$N,pipe(){return bt(this,arguments)}},VN=e=>{const n=Object.create(HN);return n.channel=e,n},IN="~effect/Stream",kf=e=>Be(e,IN),ms=VN,ET=e=>e.channel,YN=(e,n)=>ms(BU(e,n)),GN=ms(qU),wT=e=>ms($U(e)),FN=e=>ms(VU(e)),ty=e=>ms(Aw(Un(e,ET))),KN=P(e=>kf(e[0]),(e,n,s)=>e.channel.pipe(PU,GU(n,s),IU(kM),ms)),PN=P(2,(e,n)=>ms(XU(ET(e),n))),XN=P(2,(e,n)=>ms(JU(e.channel,n))),QN=P(2,(e,n)=>ms(WU(e.channel,n))),JN=P(2,(e,n)=>ez(e.channel,n)),ZN=e=>tz(e.channel),WN="~effect/SubscriptionRef",Uf=e=>typeof e=="object"&&e!=null&&WN in e,M_=e=>FN(e.pubsub),e6=e=>e.backing.ref.current,t6=e=>Ut(()=>e6(e)),C_=P(2,(e,n)=>e.semaphore.withPermit(dr(()=>(e.backing.ref.current=n,mw(fU(e.pubsub,n)))))),n6="~effect/reactivity/AsyncResult",Ad={[n6]:{E:_e,A:_e},pipe(){return bt(this,arguments)},[nn](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case"Initial":return!0;case"Success":return $t(this.value,e.value);case"Failure":return $t(this.cause,e.cause)}},[tn](){const e=Mt(`${this._tag}:${this.waiting}`);return this._tag==="Initial"?e:Xn(e)(this._tag==="Success"?Je(this.value):Je(this.cause))}},TT=(e,n)=>e._tag==="Success"?Ia(e.value):ml(e.cause,{previous:n}),ny=e=>e._tag==="None"?Va(!0):Md(e.value),k_=e=>e._tag==="Initial",r6=e=>e._tag!=="Initial",Va=(e=!1)=>{const n=Object.create(Ad);return n._tag="Initial",n.waiting=e,n},zf=e=>e._tag==="Success",Ia=(e,n)=>{const s=Object.create(Ad);return s._tag="Success",s.value=e,s.waiting=n?.waiting??!1,s.timestamp=n?.timestamp??Date.now(),s},gg=e=>e._tag==="Failure",s6=(e,n)=>{const s=Object.create(Ad);return s._tag="Failure",s.cause=e,s.previousSuccess=n?.previousSuccess??Ct(),s.waiting=n?.waiting??!1,s},ml=(e,n)=>s6(e,{previousSuccess:sE(n.previous,s=>zf(s)?Te(s):gg(s)?s.previousSuccess:Ct()),waiting:n.waiting}),a6=(e,n)=>ml(qk(e),n),Md=(e,n)=>{if(e.waiting)return n?.touch?i6(e):e;const s=Object.assign(Object.create(Ad),e);return s.waiting=!0,s},i6=e=>zf(e)?Ia(e.value,{waiting:e.waiting}):e,rf=(e,n)=>e._tag==="Failure"?ml(e.cause,{previous:n,waiting:e.waiting}):e,OT=e=>e._tag==="Success"?Te(e.value):e._tag==="Failure"?Pg(e.previousSuccess,n=>n.value):Ct(),RT=e=>hM(OT(e),()=>new yd("AsyncResult.getOrThrow: no value found")),Nf=e=>{switch(e._tag){case"Success":return vu(e.value);case"Failure":return rs(e.cause);default:return WE(new yd)}},Ru="~effect/reactivity/AtomRegistry",c6=e=>Be(e,Ru),AT=e=>new f6(e?.initialValues,e?.scheduleTask,e?.timeoutResolution,e?.defaultIdleTTL),yg=Sn(Ru),u6=P(e=>c6(e[0]),(e,n,s)=>{const i=s?.suspendOnWaiting??!1;return $u(u=>{const o=e.get(n);if(o._tag!=="Initial"&&!(i&&o.waiting))return u(Nf(o));const d=e.subscribe(n,h=>{h._tag!=="Initial"&&!(i&&h.waiting)&&(u(Nf(h)),d())});return Ut(d)})}),l6={immediate:!0},o6=e=>{e()},Sg="~effect-atom/atom/Atom/Serializable",lu=e=>Sg in e?e[Sg].key:e;class f6{[Ru];timeoutResolution;defaultIdleTTL;scheduler;schedulerAsync;onNodeAdded;onNodeRemoved;constructor(n,s,i,u){if(this[Ru]=Ru,this.scheduler=new Nu("sync",s),this.schedulerAsync=new Nu("async",s),this.defaultIdleTTL=u,i===void 0&&u!==void 0?this.timeoutResolution=Math.round(u/2):this.timeoutResolution=i??1e3,n!==void 0)for(const[o,d]of n)this.ensureNode(o).setValue(d)}nodes=new Map;preloadedSerializable=new Map;timeoutBuckets=new Map;nodeTimeoutBucket=new Map;disposed=!1;getNodes(){return this.nodes}get(n){return this.ensureNode(n).value()}set(n,s){n.write(this.ensureNode(n).writeContext,s)}setSerializable(n,s){this.preloadedSerializable.set(n,s)}modify(n,s){const i=this.ensureNode(n),u=s(i.value());return n.write(i.writeContext,u[1]),u[0]}update(n,s){const i=this.ensureNode(n);n.write(i.writeContext,s(i.value()))}refresh=n=>{n.refresh!==void 0?n.refresh(this.refresh):this.invalidateAtom(n)};subscribe(n,s,i){const u=this.ensureNode(n);i?.immediate&&s(u.value());const o=u.subscribe(function(){s(u._value)});return()=>{o(),u.canBeRemoved&&this.scheduleNodeRemoval(u)}}mount(n){return this.subscribe(n,cc,l6)}atomHasTtl(n){return!n.keepAlive&&n.idleTTL!==0&&(n.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(n){const s=lu(n);let i=this.nodes.get(s);if(i===void 0?(i=this.createNode(n),this.nodes.set(s,i),this.onNodeAdded?.(i)):this.atomHasTtl(n)&&this.removeNodeTimeout(i),typeof s=="string"&&this.preloadedSerializable.has(s)){const u=this.preloadedSerializable.get(s);this.preloadedSerializable.delete(s);const o=n[Sg].decode(u);i.setValue(o)}return i}createNode(n){if(this.disposed)throw new Error(`Cannot access Atom ${n}: registry is disposed`);return n.keepAlive||this.scheduleAtomRemoval(n),new d6(this,n)}invalidateAtom=n=>{this.ensureNode(n).invalidate()};scheduleAtomRemoval(n){this.schedulerAsync.scheduleTask(()=>{const s=this.nodes.get(lu(n));s!==void 0&&s.canBeRemoved&&this.removeNode(s)},0)}scheduleNodeRemoval(n){this.schedulerAsync.scheduleTask(()=>{n.canBeRemoved&&this.removeNode(n)},0)}removeNode(n){this.atomHasTtl(n.atom)?this.setNodeTimeout(n):(this.nodes.delete(lu(n.atom)),n.remove(),this.onNodeRemoved?.(n))}setNodeTimeout(n){if(this.nodeTimeoutBucket.has(n))return;let s=n.atom.idleTTL??this.defaultIdleTTL;if(this.#e!==null&&(s-=this.#e,s<=0)){this.nodes.delete(lu(n.atom)),n.remove(),this.onNodeRemoved?.(n);return}const i=Math.ceil(s/this.timeoutResolution)*this.timeoutResolution,u=Date.now()+i,o=u-u%this.timeoutResolution+this.timeoutResolution;let d=this.timeoutBuckets.get(o);d===void 0&&(d=[new Set,setTimeout(()=>this.sweepBucket(o),o-Date.now())],this.timeoutBuckets.set(o,d)),d[0].add(n),this.nodeTimeoutBucket.set(n,o)}removeNodeTimeout(n){const s=this.nodeTimeoutBucket.get(n);if(s===void 0)return;this.nodeTimeoutBucket.delete(n),this.scheduleNodeRemoval(n);const[i,u]=this.timeoutBuckets.get(s);i.delete(n),i.size===0&&(clearTimeout(u),this.timeoutBuckets.delete(s))}#e=null;sweepBucket(n){const s=this.timeoutBuckets.get(n)[0];this.timeoutBuckets.delete(n),s.forEach(i=>{this.nodeTimeoutBucket.delete(i),i.canBeRemoved&&(this.nodes.delete(lu(i.atom)),this.onNodeRemoved?.(i),this.#e=i.atom.idleTTL??this.defaultIdleTTL,i.remove(),this.#e=null)})}reset(){this.timeoutBuckets.forEach(([,n])=>clearTimeout(n)),this.timeoutBuckets.clear(),this.nodeTimeoutBucket.clear(),this.nodes.forEach(n=>{n.remove(),this.onNodeRemoved?.(n)}),this.nodes.clear()}dispose(){this.disposed=!0,this.reset()}}const ar={alive:1,initialized:2,waitingForValue:4},In={uninitialized:ar.alive|ar.waitingForValue,stale:ar.alive|ar.initialized|ar.waitingForValue,valid:ar.alive|ar.initialized,removed:0};class d6{constructor(n,s){this.registry=n,this.atom=s,this.writeContext=new g6(n,this)}registry;atom;state=In.uninitialized;lifetime;writeContext;parents=[];previousParents;children=[];listeners=new Set;skipInvalidation=!1;currentState(){switch(this.state){case In.uninitialized:return"uninitialized";case In.stale:return"stale";case In.valid:return"valid";default:return"removed"}}get canBeRemoved(){return!this.atom.keepAlive&&this.listeners.size===0&&this.children.length===0&&this.state!==0}_value=void 0;value(){if((this.state&ar.waitingForValue)!==0){this.lifetime=p6(this);const n=this.atom.read(this.lifetime);if((this.state&ar.waitingForValue)!==0&&this.setValue(n),this.previousParents){const s=this.previousParents;this.previousParents=void 0;for(let i=0;i0&&(Ot.phase===Ys.collect?Ot.notify.add(this):this.notify()))}addParent(n){if(this.parents.push(n),this.previousParents!==void 0){const s=this.previousParents.indexOf(n);s!==-1&&(this.previousParents[s]=this.previousParents[this.previousParents.length-1],this.previousParents.pop()===void 0&&(this.previousParents=void 0))}n.children.indexOf(this)===-1&&(n.children.push(this),n.skipInvalidation&&(n.skipInvalidation=!1))}removeChild(n){const s=this.children.indexOf(n);s!==-1&&(this.children[s]=this.children[this.children.length-1],this.children.pop())}invalidate(){this.state===In.valid&&(this.state=In.stale,this.disposeLifetime()),Ot.phase===Ys.collect?Ot.stale.push(this):this.atom.lazy&&this.listeners.size===0&&!h6(this.children)?(this.invalidateChildren(),this.skipInvalidation=!0):this.value()}invalidateChildren(){if(this.children.length===0)return;const n=this.children;this.children=[];for(let s=0;sthis.listeners.delete(n)}}function h6(e){if(e.length===0)return!1;let n=e,s,i=0;for(;n!==void 0;){for(let u=0,o=n.length;u0)return!0;d.children.length>0&&(s===void 0?s=[d.children]:s.push(d.children))}n=s?.[i++]}return!1}const m6={get registry(){return this.node.registry},addFinalizer(e){if(this.disposed)return e();this.finalizers??=[],this.finalizers.push(e)},get(e){if(this.disposed)return this.node.registry.get(e);const n=this.node.registry.ensureNode(e);return this.node.addParent(n),n.value()},result(e,n){if(this.disposed||this.isFn)return this.resultOnce(e,n);const s=this.get(e);if(n?.suspendOnWaiting&&s.waiting)return pu;switch(s._tag){case"Initial":return pu;case"Failure":return rs(s.cause);case"Success":return Ee(s.value)}},resultOnce(e,n){return $u(s=>{const i=this.once(e);if(i._tag!=="Initial"&&!(n?.suspendOnWaiting&&i.waiting))return s(Nf(i));const u=this.node.registry.subscribe(e,o=>{o._tag==="Initial"||n?.suspendOnWaiting&&o.waiting||(u(),s(Nf(o)))},{immediate:!1});return Ut(u)})},setResult(e,n){return this.disposed?pu:(this.node.registry.set(e,n),this.resultOnce(e,{suspendOnWaiting:!0}))},some(e){if(this.disposed||this.isFn)return this.someOnce(e);const n=this.get(e);return n._tag==="None"?pu:Ee(n.value)},someOnce(e){return $u(n=>{const s=this.once(e);if(df(s))return n(Ee(s.value));const i=this.node.registry.subscribe(e,u=>{os(u)||(i(),n(Ee(u.value)))},{immediate:!1});return Ut(i)})},once(e){return this.node.registry.get(e)},self(){return this.disposed?Ct():this.node.valueOption()},refresh(e){this.disposed||this.node.registry.refresh(e)},refreshSelf(){this.disposed||this.node.invalidate()},mount(e){this.disposed||this.addFinalizer(this.node.registry.mount(e))},subscribe(e,n,s){this.disposed||this.addFinalizer(this.node.registry.subscribe(e,n,s))},setSelf(e){this.disposed||this.node.setValue(e)},set(e,n){this.disposed||this.node.registry.set(e,n)},stream(e,n){return this.disposed?GN:YN(s=>Ut(()=>{this.subscribe(e,i=>xw(s,i),{immediate:!n?.withoutInitialValue})}))},streamResult(e,n){return this.stream(e,n).pipe(PN(r6),KN(s=>s._tag==="Success"?Ee(s.value):cl(s.cause)))},dispose(){if(this.disposed=!0,this.finalizers===void 0)return;const e=this.finalizers;this.finalizers=void 0;for(let n=e.length-1;n>=0;n--)e[n]()}},p6=e=>{function n(s){if(n.disposed)return e.registry.get(s);if(n.isFn)return e.registry.get(s);const i=e.registry.ensureNode(s),u=i.value();return e.addParent(i),u}return Object.setPrototypeOf(n,m6),n.isFn=!1,n.disposed=!1,n.finalizers=void 0,n.node=e,n};class g6{constructor(n,s){this.registry=n,this.node=s}registry;node;get(n){return this.registry.get(n)}set(n,s){return this.registry.set(n,s)}setSelf(n){return this.node.setValue(n)}refreshSelf(){return this.node.invalidate()}}const Ys={disabled:0,collect:1,commit:2},Ot={phase:Ys.disabled,depth:0,stale:[],notify:new Set};function y6(e){Ot.phase=Ys.collect,Ot.depth++;try{if(e(),Ot.depth===1){for(let n=0;n{const e=new Map,n=p=>{Sp(p,m=>{const y=e.get(m);y!==void 0&&y.forEach(S=>S())})},s=p=>xd(m=>{const y=m.mapUnsafe.get(U_.key);return y?Sp(p,S=>{y.add(S)}):n(p),rt}),i=(p,m)=>_f(m,s(p)),u=(p,m)=>{const y=[];return Sp(p,S=>{y.push(S);let v=e.get(S);v===void 0&&(v=new Set,e.set(S,v)),v.add(m)}),()=>{for(let S=0;Svf(function*(){const y=yield*qa(),S=Kn(y,Wi),v=yield*k0(),_=zx($a(y),bw(S));let x=!1,T=!1;const j=I=>{I._tag==="Failure"?U0(v,I.cause):xw(v,I.value),T?(T=!1,_(m).addObserver(j)):x=!1};function B(){if(x){T=!0;return}x=!0,_(m).addObserver(j)}const M=u(p,B);return yield*Bu(S,Ut(M)),B(),v}),d=(p,m)=>o(p,m).pipe(Un(wT),ty),h=p=>dr(()=>{const m=new Set;return p.pipe(yw(U_,m),w0(y=>Ut(()=>{m.forEach(S=>{const v=e.get(S);v!==void 0&&v.forEach(_=>_())})})))});return pl.of({mutation:i,query:o,stream:d,invalidateUnsafe:n,invalidate:s,registerUnsafe:u,withBatch:h})});class U_ extends Sn()("effect/reactivity/Reactivity/PendingInvalidation"){}const CT=P(2,(e,n)=>pl.use(s=>s.mutation(n,e))),v6=e=>pl.use(n=>n.invalidate(e)),yp=bd(pl)(S6);function z_(e){switch(typeof e){case"string":case"number":case"bigint":case"boolean":return String(e);default:return Je(e)}}const Sp=(e,n)=>{if(Array.isArray(e)){for(let s=0;s{const s=Wu(n),i=uE(s);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!i,idleTTL:i?Qg(s):void 0})}),Gu=kT(0),ry={[vg]:vg,...Ar,toJSON(){return{_id:"Atom",keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}}},b6={...ry,atom(e,n){const s=UT(e,n);return Xs(i=>{const u=i.self(),o=i(this);return o._tag!=="Success"?rf(o,u):s(i,o.value)})},fn(e,n){return arguments.length===0?(s,i)=>N_(this,s,i):N_(this,e,n)},pull(e,n){const s=Gu(sy(0)),i=Xs(u=>{const o=u.self(),d=u(this);return d._tag!=="Success"?rf(d,o):Df(u,k6(u,s,e,n),Va(!0),d.value)});return U6(s,i)},subscriptionRef(e){return A6(Gu(Xs(n=>{const s=n.self(),i=n(this);if(i._tag!=="Success")return rf(i,s);const u=typeof e=="function"?e(n):e;return Uf(u)?u:Df(n,u,Va(!0),i.value)})),(n,s)=>{const i=RT(n(this));return R6(n,s,i)})}},N_=(e,n,s)=>{const[i,u,o]=C6(s?.reactivityKeys?(d,h)=>{const p=n(d,h);return ss(p)?CT(p,s.reactivityKeys):XN(p,v6(s.reactivityKeys))}:n,s);return gl(d=>{d.get(o);const h=d.self(),p=d.get(e);return p._tag!=="Success"?rf(p,h):i(d,p.value)},u)},_6={...ry,[bg]:bg},x6=e=>bg in e,Xs=(e,n)=>{const s=Object.create(ry);return s.keepAlive=!1,s.lazy=!0,s.read=e,s.refresh=n,s},gl=(e,n,s)=>{const i=Object.create(_6);return i.keepAlive=!1,i.lazy=!0,i.read=e,i.write=n,i.refresh=s,i};function E6(e,n){e.setSelf(n)}const yl=(e,n)=>{const s=UT(e,n);return vg in s?s:Xs(s)},UT=(e,n)=>{if(typeof e=="function"&&!ss(e)&&!kf(e)){const s=e;return function(i,u){const o=s(i);switch(typeof o){case"function":case"object":return o===null?o:zT in o?_g(i,o,n,u):w6 in o?D_(i,o,n,u):o;default:return o}}}else{if(ss(e))return function(s,i){return _g(s,e,n,i)};if(kf(e))return function(s,i){return D_(s,e,n,i)}}return sy(e)},zT="~effect/Effect",w6="~effect/Stream",sy=e=>gl(function(n){return e},E6),_g=(e,n,s,i)=>{const u=s?.initialValue!==void 0?Ia(s.initialValue):Va();return Df(e,n,u,i,s?.uninterruptible)};function Df(e,n,s,i=Qn(),u=!1){const o=e.self(),d=g0();e.addFinalizer(()=>{$a(i)(il(d,Fk))});const h=new Map(i.mapUnsafe);h.set(Wi.key,d),h.set(yg.key,e.registry),h.set(Ji.key,e.registry.scheduler);let p,m=!1;const y=ay(ir(h),n,function(S){p=TT(S,o),m&&e.setSelf(p)},u);return m=!0,y!==void 0&&e.addFinalizer(y),p!==void 0?p:o._tag==="Some"?ny(o):Md(s)}function ay(e,n,s,i=!1){if(ZE(n)){s(n);return}const u=$a(e),o=Kn(e,Ji),d=u(n);"flush"in o&&o.flush();const h=d.pollUnsafe();if(h){s(h);return}const p=d.addObserver(s);function m(){p(),i||d.interruptUnsafe()}return m}const T6=e=>{let n=yp;function s(u){const o=Object.create(b6);o.keepAlive=!1,o.lazy=!0,o.refresh=void 0,o.factory=s;const d=DT(Xs(typeof u=="function"?h=>hp(u(h),n):()=>hp(u,n)));return o.layer=d,o.read=function(p){const m=p(d),y=Xe(j4,S=>gf(m,e.memoMap,S));return _g(p,y,{uninterruptible:!0})},o}s.memoMap=e.memoMap,s.addGlobalLayer=u=>{n=hp(n,_u(u,yp))};const i=Gu(yl(xd(u=>gf(yp,e.memoMap,Kn(u,Wi))).pipe(Un(Kn(pl)))));return s.withReactivity=u=>o=>z6(o,d=>{const h=RT(d(i));return d.addFinalizer(h.registerUnsafe(u,()=>{d.refresh(o)})),d.subscribe(o,p=>d.setSelf(p)),d.once(o)}),s},O6=S0(),NT=T6({memoMap:O6});NT.withReactivity;const D_=(e,n,s,i)=>{const u=s?.initialValue!==void 0?Ia(s.initialValue):Va();return iy(e,n,u,i)};function iy(e,n,s,i=Qn()){const u=e.self();i=ds(i,yg,e.registry);const o=Sw(p=>Xe(nz(n.channel,p),m=>hw({while:Pf,body:()=>m,step(y){e.setSelf(Ia(RM(y),{waiting:!0}))}}))).pipe(as(p=>(Sf(p)?rA(e.self(),sE(OT),fM({onNone:()=>e.setSelf(a6(new yd,{previous:e.self()})),onSome:m=>e.setSelf(Ia(m))})):e.setSelf(ml(p,{previous:e.self()})),rt))),d=new Map(i.mapUnsafe);d.set(yg.key,e.registry),d.set(Ji.key,e.registry.scheduler);const h=ay(ir(d),o,cc,!1);return h!==void 0&&e.addFinalizer(h),u._tag==="Some"?ny(u):Md(s)}const R6=(e,n,s=Qn())=>Uf(n)?(e.addFinalizer(M_(n).pipe(JN(i=>{for(let u=0;u{function s(i,u){const o=i.get(e);Uf(o)?xf(C_(o,u)):zf(o)&&xf(C_(o.value,u))}return gl(i=>{const u=i(e);return Uf(u)||zf(u)?n(i,u):u},s)},M6=Symbol.for("effect/reactivity/atom/Atom/Reset"),vp=Symbol.for("effect/reactivity/atom/Atom/Interrupt");function C6(e,n){const s=Gu(sy([0,void 0])),i=n?.initialValue!==void 0?Ia(n.initialValue):Va(),u=n?.concurrent?Gu(Xs(h=>{const p=new Set;return h.addFinalizer(()=>p.forEach(m=>m.interruptUnsafe())),p})):void 0;function o(h,p){const m=u?h(u):void 0;h.isFn=!0;const[y,S]=h.get(s);if(y===0)return i;if(S===vp)return ml($k(),{previous:h.self()});let v=e(S,h);return zT in v?(m&&(v=Xe(V4(v,{startImmediately:!0}),x=>(m.add(x),x.addObserver(()=>m.delete(x)),Un(Z4(m),T=>T[0])))),Df(h,v,i,p,!1)):iy(h,v,i,p)}function d(h,p){N6(()=>{p===M6?h.set(s,[0,void 0]):p===vp?h.set(s,[h.get(s)[0]+1,vp]):h.set(s,[h.get(s)[0]+1,p]),h.refreshSelf()})}return[o,d,s]}const k6=(e,n,s,i)=>Xe(ZN(typeof s=="function"?s(e):s),u=>{const d=Ef().services;let h=Ip();const p=x0(u,{onFailure(y){return Sf(y)?zu(h)?Ee({done:!0,items:h}):ke(new yd("Atom.pull: no items")):cl(y)},onSuccess(y){let S;return i?.disableAccumulation?S=y:(S=iE(h,y),h=S),Ee({done:!1,items:S})}}),m=new Set;return e.addFinalizer(()=>{for(const y of m)y()}),e.once(n),e.subscribe(n,()=>{e.setSelf(ny(e.self()));let y;y=ay(d,p,S=>{y&&m.delete(y);const v=TT(S,e.self()),_=m.size>0;e.setSelf(_?Md(v):v)}),y&&m.add(y)}),p}),U6=(e,n)=>gl(n.read,function(s,i){s.set(e,s.get(e)+1)}),L_=typeof WeakRef>"u"||typeof FinalizationRegistry>"u"?e=>{const n=l_();return function(s){const i=o_(n,s);if(i._tag==="Some")return i.value;const u=e(s);return f_(n,s,u),u}}:e=>{const n=l_(),s=new FinalizationRegistry(i=>{NU(n,i)});return function(i){const u=o_(n,i).pipe(mM(d=>d.deref()));if(u._tag==="Some")return u.value;const o=e(i);return f_(n,i,new WeakRef(o)),s.register(o,i),o}},DT=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),Cd=P(2,(e,n)=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,label:[n,new Error().stack?.split(` +`)[5]??""]})),z6=P(2,(e,n)=>x6(e)?gl(s=>n(s,e),function(s,i){s.set(e,i)},e.refresh??function(s){s(e)}):Xs(s=>n(s,e),e.refresh??function(s){s(e)})),N6=y6,j_="~effect-atom/atom/Atom/ServerValue",D6=P(2,(e,n)=>j_ in e?e[j_](s=>n.get(s)):n.get(e));var bp=Cx();function LT(e){const n=bp.unstable_scheduleCallback(bp.unstable_LowPriority,e);return()=>bp.unstable_cancelCallback(n)}const kd=le.createContext(AT({scheduleTask:LT,defaultIdleTTL:400})),L6=e=>{const n=le.useRef(null);return n.current===null&&(n.current={registry:AT({scheduleTask:e.scheduleTask??LT,initialValues:e.initialValues,timeoutResolution:e.timeoutResolution,defaultIdleTTL:e.defaultIdleTTL})}),le.useEffect(()=>(n.current?.timeout!==void 0&&clearTimeout(n.current.timeout),()=>{n.current.timeout=setTimeout(()=>{n.current?.registry.dispose(),n.current=null},500)}),[n]),le.createElement(kd.Provider,{value:n.current.registry},e?.children)},B_=new WeakMap;function j6(e,n){let s=B_.get(e);s===void 0&&(s=new WeakMap,B_.set(e,s));const i=s.get(n);if(i!==void 0)return i;const u={subscribe(o){return e.subscribe(n,o)},snapshot(){return e.get(n)},getServerSnapshot(){return D6(n,e)}};return s.set(n,u),u}function B6(e,n){const s=j6(e,n);return le.useSyncExternalStore(s.subscribe,s.snapshot,s.getServerSnapshot)}const ta=(e,n)=>{const s=le.useContext(kd);return B6(s,e)};function jT(e,n){le.useEffect(()=>e.mount(n),[n,e])}function q6(e,n,s){return s?.mode==="promise"||s?.mode==="promiseExit"?le.useCallback(i=>{e.set(n,i);const u=G4(u6(e,n,{suspendOnWaiting:!0}));return s.mode==="promise"?u.then($6):u},[e,n,s.mode]):le.useCallback(i=>{e.set(n,typeof i=="function"?i(e.get(n)):i)},[e,n])}const $6=e=>{if(ew(e))return e.value;throw JE(e.cause)},Wr=(e,n)=>{const s=le.useContext(kd);return jT(s,e),q6(s,e,n)},H6=e=>{const n=le.useContext(kd);return jT(n,e),le.useCallback(()=>{n.refresh(e)},[n,e])};var it=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(it||{});function BT({update:e,notify:n,unwatched:s}){return{link:i,unlink:u,propagate:o,checkDirty:d,shallowPropagate:h};function i(m,y,S){const v=y.depsTail;if(v!==void 0&&v.dep===m)return;const _=v!==void 0?v.nextDep:y.deps;if(_!==void 0&&_.dep===m){_.version=S,y.depsTail=_;return}const x=m.subsTail;if(x!==void 0&&x.version===S&&x.sub===y)return;const T=y.depsTail=m.subsTail={version:S,dep:m,sub:y,prevDep:v,nextDep:_,prevSub:x,nextSub:void 0};_!==void 0&&(_.prevDep=T),v!==void 0?v.nextDep=T:y.deps=T,x!==void 0?x.nextSub=T:m.subs=T}function u(m,y=m.sub){const S=m.dep,v=m.prevDep,_=m.nextDep,x=m.nextSub,T=m.prevSub;return _!==void 0?_.prevDep=v:y.depsTail=v,v!==void 0?v.nextDep=_:y.deps=_,x!==void 0?x.prevSub=T:S.subsTail=T,T!==void 0?T.nextSub=x:(S.subs=x)===void 0&&s(S),_}function o(m){let y=m.nextSub,S;e:do{const v=m.sub;let _=v.flags;if(_&60?_&12?_&4?!(_&48)&&p(m,v)?(v.flags=_|40,_&=1):_=0:v.flags=_&-9|32:_=0:v.flags=_|32,_&2&&n(v),_&1){const x=v.subs;if(x!==void 0){const T=(m=x).nextSub;T!==void 0&&(S={value:y,prev:S},y=T);continue}}if((m=y)!==void 0){y=m.nextSub;continue}for(;S!==void 0;)if(m=S.value,S=S.prev,m!==void 0){y=m.nextSub;continue e}break}while(!0)}function d(m,y){let S,v=0,_=!1;e:do{const x=m.dep,T=x.flags;if(y.flags&16)_=!0;else if((T&17)===17){if(e(x)){const j=x.subs;j.nextSub!==void 0&&h(j),_=!0}}else if((T&33)===33){(m.nextSub!==void 0||m.prevSub!==void 0)&&(S={value:m,prev:S}),m=x.deps,y=x,++v;continue}if(!_){const j=m.nextDep;if(j!==void 0){m=j;continue}}for(;v--;){const j=y.subs,B=j.nextSub!==void 0;if(B?(m=S.value,S=S.prev):m=j,_){if(e(y)){B&&h(j),y=m.sub;continue}_=!1}else y.flags&=-33;y=m.sub;const M=m.nextDep;if(M!==void 0){m=M;continue e}}return _}while(!0)}function h(m){do{const y=m.sub,S=y.flags;(S&48)===32&&(y.flags=S|16,(S&6)===2&&n(y))}while((m=m.nextSub)!==void 0)}function p(m,y){let S=y.depsTail;for(;S!==void 0;){if(S===m)return!0;S=S.prevDep}return!1}}let cy=0,Oa=0,Au=0;const es=[],{link:rB,unlink:qT,propagate:sB,checkDirty:V6,shallowPropagate:aB}=BT({update(e){return e.depsTail!==void 0?F6(e):K6(e)},notify(e){let n=Au,s=n;do if(es[n++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Au=n;s<--n;){const i=es[s];es[s++]=es[n],es[n]=i}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Ud(e)):Q6.call(e)}});function I6(){return cy}function Y6(){++cy}function G6(){--cy||X6()}function F6(e){e.depsTail=void 0,e.flags=5;try{const n=e.value;return n!==(e.value=e.getter(n))}finally{e.flags&=-5,Ud(e)}}function K6(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function P6(e){const n=e.flags;if(n&16||n&32&&V6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Ud(e)}}else e.flags=2}function X6(){try{for(;Oa0)){for(;Io{u.get(),h.current?d.next?.(u._snapshot):h.current=!0});return{unsubscribe:()=>{p.stop()}}},_update(o){const d=vr,h=Object.is;vr=u,++sf,u.depsTail=void 0,s&&(u.flags=it.Mutable|it.RecursedCheck);try{const p=u._snapshot,m=typeof o=="function"?o(p):o===void 0&&s?i(p):o;return p===void 0||!h(p,m)?(u._snapshot=m,!0):!1}finally{vr=d,s&&(u.flags&=~it.RecursedCheck),Lf(u)}}};return s?(u.flags=it.Mutable|it.Dirty,u.get=function(){const o=u.flags;if(o&it.Dirty||o&it.Pending&&$T(u.deps,u)){if(u._update()){const d=u.subs;d!==void 0&&$_(d)}}else o&it.Pending&&(u.flags=o&~it.Pending);return vr!==void 0&&q_(u,vr,sf),u._snapshot}):u.set=function(o){if(u._update(o)){const d=u.subs;d!==void 0&&(Z6(d),$_(d),HT())}},u}function W6(e){const n=()=>{const i=vr;vr=s,++sf,s.depsTail=void 0,s.flags=it.Watching|it.RecursedCheck;try{return e()}finally{vr=i,s.flags&=~it.RecursedCheck,Lf(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:it.Watching|it.RecursedCheck,notify(){const i=this.flags;i&it.Dirty||i&it.Pending&&$T(this.deps,this)?n():this.flags=it.Watching},stop(){this.flags=it.None,this.depsTail=void 0,Lf(this)}};return n(),s}class eD{constructor(n){this.atom=VT(n)}setState(n){this.atom.set(n)}get state(){return this.atom.get()}get(){return this.state}subscribe(n){return this.atom.subscribe(uy(n))}}class tD{constructor(n){this.atom=VT(n)}get state(){return this.atom.get()}get(){return this.state}subscribe(n){return this.atom.subscribe(uy(n))}}function nD(e){return typeof e=="function"?new tD(e):new eD(e)}function rD(e){try{Y6(),e()}finally{G6(),HT()}}const Qs="__TSR_index",H_="popstate",V_="beforeunload";function sD(e){let n=e.getLocation();const s=new Set,i=d=>{n=e.getLocation(),s.forEach(h=>h({location:n,action:d}))},u=d=>{e.notifyOnIndexChange??!0?i(d):n=e.getLocation()},o=async({task:d,navigateOpts:h,...p})=>{if(h?.ignoreBlocker??!1){d();return}const y=e.getBlockers?.()??[],S=p.type==="PUSH"||p.type==="REPLACE";if(typeof document<"u"&&y.length&&S)for(const v of y){const _=jf(p.path,p.state);if(await v.blockerFn({currentLocation:n,nextLocation:_,action:p.type})){e.onBlocked?.();return}}d()};return{get location(){return n},get length(){return e.getLength()},subscribers:s,subscribe:d=>(s.add(d),()=>{s.delete(d)}),push:(d,h,p)=>{const m=n.state[Qs];h=I_(m+1,h),o({task:()=>{e.pushState(d,h),i({type:"PUSH"})},navigateOpts:p,type:"PUSH",path:d,state:h})},replace:(d,h,p)=>{const m=n.state[Qs];h=I_(m,h),o({task:()=>{e.replaceState(d,h),i({type:"REPLACE"})},navigateOpts:p,type:"REPLACE",path:d,state:h})},go:(d,h)=>{o({task:()=>{e.go(d),u({type:"GO",index:d})},navigateOpts:h,type:"GO"})},back:d=>{o({task:()=>{e.back(d?.ignoreBlocker??!1),u({type:"BACK"})},navigateOpts:d,type:"BACK"})},forward:d=>{o({task:()=>{e.forward(d?.ignoreBlocker??!1),u({type:"FORWARD"})},navigateOpts:d,type:"FORWARD"})},canGoBack:()=>n.state[Qs]!==0,createHref:d=>e.createHref(d),block:d=>{if(!e.setBlockers)return()=>{};const h=e.getBlockers?.()??[];return e.setBlockers([...h,d]),()=>{const p=e.getBlockers?.()??[];e.setBlockers?.(p.filter(m=>m!==d))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:i}}function I_(e,n){n||(n={});const s=ly();return{...n,key:s,__TSR_key:s,[Qs]:e}}function IT(e){const n=typeof document<"u"?window:void 0,s=n.history.pushState,i=n.history.replaceState;let u=[];const o=()=>u,d=Y=>u=Y,h=(Y=>Y),p=(()=>jf(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!n.history.state?.__TSR_key&&!n.history.state?.key){const Y=ly();n.history.replaceState({[Qs]:0,key:Y,__TSR_key:Y},"")}let m=p(),y,S=!1,v=!1,_=!1,x=!1;const T=()=>m;let j,B;const M=()=>{j&&(V._ignoreSubscribers=!0,(j.isPush?n.history.pushState:n.history.replaceState)(j.state,"",j.href),V._ignoreSubscribers=!1,j=void 0,B=void 0,y=void 0)},I=(Y,te,fe)=>{const oe=h(te);B||(y=m),m=jf(te,fe),j={href:oe,state:fe,isPush:j?.isPush||Y==="push"},B||(B=Promise.resolve().then(()=>M()))},z=Y=>{m=p(),V.notify({type:Y})},W=async()=>{if(v){v=!1;return}const Y=p(),te=Y.state[Qs]-m.state[Qs],fe=te===1,oe=te===-1,ie=!fe&&!oe||S;S=!1;const A=ie?"GO":oe?"BACK":"FORWARD",Q=ie?{type:"GO",index:te}:{type:oe?"BACK":"FORWARD"};if(_)_=!1;else{const Z=o();if(typeof document<"u"&&Z.length){for(const O of Z)if(await O.blockerFn({currentLocation:m,nextLocation:Y,action:A})){v=!0,n.history.go(1),V.notify(Q);return}}}m=p(),V.notify(Q)},H=Y=>{if(x){x=!1;return}let te=!1;const fe=o();if(typeof document<"u"&&fe.length)for(const oe of fe){const ie=oe.enableBeforeUnload??!0;if(ie===!0){te=!0;break}if(typeof ie=="function"&&ie()===!0){te=!0;break}}if(te)return Y.preventDefault(),Y.returnValue=""},V=sD({getLocation:T,getLength:()=>n.history.length,pushState:(Y,te)=>I("push",Y,te),replaceState:(Y,te)=>I("replace",Y,te),back:Y=>(Y&&(_=!0),x=!0,n.history.back()),forward:Y=>{Y&&(_=!0),x=!0,n.history.forward()},go:Y=>{S=!0,n.history.go(Y)},createHref:Y=>h(Y),flush:M,destroy:()=>{n.history.pushState=s,n.history.replaceState=i,n.removeEventListener(V_,H,{capture:!0}),n.removeEventListener(H_,W)},onBlocked:()=>{y&&m!==y&&(m=y)},getBlockers:o,setBlockers:d,notifyOnIndexChange:!1});return n.addEventListener(V_,H,{capture:!0}),n.addEventListener(H_,W),n.history.pushState=function(...Y){const te=s.apply(n.history,Y);return V._ignoreSubscribers||z("PUSH"),te},n.history.replaceState=function(...Y){const te=i.apply(n.history,Y);return V._ignoreSubscribers||z("REPLACE"),te},V}function aD(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function jf(e,n){const s=aD(e),i=s.indexOf("#"),u=s.indexOf("?"),o=ly();return{href:s,pathname:s.substring(0,i>0?u>0?Math.min(i,u):i:u>0?u:s.length),hash:i>-1?s.substring(i):"",search:u>-1?s.slice(u,i===-1?void 0:i):"",state:n||{[Qs]:0,key:o,__TSR_key:o}}}function ly(){return(Math.random()+1).toString(36).substring(7)}const iD=!1;function Mu(e){let n;return rD(()=>{n=e()}),n}function Fu(e){return e[e.length-1]}function cD(e){return typeof e=="function"}function Gs(e,n){return cD(e)?e(n):e}const uD=Object.prototype.hasOwnProperty,Y_=Object.prototype.propertyIsEnumerable;function Mn(e,n,s=0){if(e===n)return e;if(s>500)return n;const i=n,u=K_(e)&&K_(i);if(!u&&!(Bf(e)&&Bf(i)))return i;const o=u?e:G_(e);if(!o)return i;const d=u?i:G_(i);if(!d)return i;const h=o.length,p=d.length,m=u?new Array(p):{};let y=0;for(let S=0;S"u")return!0;const s=n.prototype;return!(!F_(s)||!s.hasOwnProperty("isPrototypeOf"))}function F_(e){return Object.prototype.toString.call(e)==="[object Object]"}function K_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Na(e,n,s){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let i=0,u=e.length;iu||!Na(e[d],n[d],s)))return!1;return u===o}return!1}function sc(e){let n,s;const i=new Promise((u,o)=>{n=u,s=o});return i.status="pending",i.resolve=u=>{i.status="resolved",i.value=u,n(u),e?.(u)},i.reject=u=>{i.status="rejected",s(u)},i}function Ku(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function lD(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function P_(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return lD(n)}const oD=["http:","https:","mailto:","tel:"];function qf(e,n){if(!e)return!1;try{const s=new URL(e);return!n.has(s.protocol)}catch{return!1}}function ou(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let s=0,i="",u;for(;(u=n.exec(e))!==null;)i+=P_(e.slice(s,u.index))+u[0],s=n.lastIndex;i=i+P_(s?e.slice(s):e);let o=!1;return i.startsWith("//")&&(o=!0,i="/"+i.replace(/^\/+/,"")),{path:i,handledProtocolRelativeURL:o}}function fD(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var dD="Invariant failed";function na(e,n){if(!e)throw new Error(dD)}function $f(e){const n=new Map;let s,i;const u=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,i&&(i.next=o,o.prev=i)):(o.next.prev=void 0,s=o.next,o.next=void 0,i&&(o.prev=i,i.next=o)),i=o)};return{get(o){const d=n.get(o);if(d)return u(d),d.value},set(o,d){if(n.size>=e&&s){const p=s;n.delete(p.key),p.next&&(s=p.next,p.next.prev=void 0),p===i&&(i=void 0)}const h=n.get(o);if(h)h.value=d,u(h);else{const p={key:o,value:d,prev:i};i&&(i.next=p),i=p,s||(s=p),n.set(o,p)}},clear(){n.clear(),s=void 0,i=void 0}}}const ac=0,Ya=1,Ga=2,Pu=3,Ca=4,YT=5;function hD(e){const n=e.indexOf("{");if(n===-1)return null;const s=e.indexOf("}",n);return s===-1||n+1>=e.length?null:[n,s]}function oy(e,n,s=new Uint16Array(6)){const i=e.indexOf("/",n),u=i===-1?e.length:i,o=e.substring(n,u);if(!o||!o.includes("$"))return s[0]=ac,s[1]=n,s[2]=n,s[3]=u,s[4]=u,s[5]=u,s;if(o==="$"){const h=e.length;return s[0]=Ga,s[1]=n,s[2]=n,s[3]=h,s[4]=h,s[5]=h,s}if(o.charCodeAt(0)===36)return s[0]=Ya,s[1]=n,s[2]=n+1,s[3]=u,s[4]=u,s[5]=u,s;const d=hD(o);if(d){const[h,p]=d,m=o.charCodeAt(h+1);if(m===45){if(h+2!Y.skipOnParamError&&Y.caseSensitive===z&&Y.prefix===W&&Y.suffix===H);if(V)x=V;else{const Y=xp(Ya,s.fullPath??s.from,z,W,H);x=Y,Y.depth=o,Y.parent=u,u.dynamic??=[],u.dynamic.push(Y)}break}case Pu:{const M=p.substring(T,_[1]),I=p.substring(_[4],j),z=y&&!!(M||I),W=M?z?M:M.toLowerCase():void 0,H=I?z?I:I.toLowerCase():void 0,V=!S&&u.optional?.find(Y=>!Y.skipOnParamError&&Y.caseSensitive===z&&Y.prefix===W&&Y.suffix===H);if(V)x=V;else{const Y=xp(Pu,s.fullPath??s.from,z,W,H);x=Y,Y.parent=u,Y.depth=o,u.optional??=[],u.optional.push(Y)}break}case Ga:{const M=p.substring(T,_[1]),I=p.substring(_[4],j),z=y&&!!(M||I),W=M?z?M:M.toLowerCase():void 0,H=I?z?I:I.toLowerCase():void 0,V=xp(Ga,s.fullPath??s.from,z,W,H);x=V,V.parent=u,V.depth=o,u.wildcard??=[],u.wildcard.push(V)}}u=x}if(S&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const _=ka(s.fullPath??s.from);_.kind=YT,_.parent=u,o++,_.depth=o,u.pathless??=[],u.pathless.push(_),u=_}const v=(s.path||!s.children)&&!s.isRoot;if(v&&p.endsWith("/")){const _=ka(s.fullPath??s.from);_.kind=Ca,_.parent=u,o++,_.depth=o,u.index=_,u=_}u.parse=s.options?.params?.parse??null,u.skipOnParamError=S,u.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,v&&!u.route&&(u.route=s,u.fullPath=s.fullPath??s.from)}if(s.children)for(const p of s.children)zd(e,n,p,h,u,o,d)}function _p(e,n){if(e.skipOnParamError&&!n.skipOnParamError)return-1;if(!e.skipOnParamError&&n.skipOnParamError)return 1;if(e.skipOnParamError&&n.skipOnParamError&&(e.parsingPriority||n.parsingPriority))return n.parsingPriority-e.parsingPriority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function Is(e){if(e.pathless)for(const n of e.pathless)Is(n);if(e.static)for(const n of e.static.values())Is(n);if(e.staticInsensitive)for(const n of e.staticInsensitive.values())Is(n);if(e.dynamic?.length){e.dynamic.sort(_p);for(const n of e.dynamic)Is(n)}if(e.optional?.length){e.optional.sort(_p);for(const n of e.optional)Is(n)}if(e.wildcard?.length){e.wildcard.sort(_p);for(const n of e.wildcard)Is(n)}}function ka(e){return{kind:ac,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function xp(e,n,s,i,u){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:s,prefix:i,suffix:u}}function mD(e,n){const s=ka("/"),i=new Uint16Array(6);for(const u of e)zd(!1,i,u,1,s,0);Is(s),n.masksTree=s,n.flatCache=$f(1e3)}function pD(e,n){e||="/";const s=n.flatCache.get(e);if(s)return s;const i=fy(e,n.masksTree);return n.flatCache.set(e,i),i}function gD(e,n,s,i,u){e||="/",i||="/";const o=n?`case\0${e}`:e;let d=u.singleCache.get(o);if(!d){d=ka("/");const h=new Uint16Array(6);zd(n,h,{from:e},1,d,0),u.singleCache.set(o,d)}return fy(i,d,s)}function yD(e,n,s=!1){const i=s?e:`nofuzz\0${e}`,u=n.matchCache.get(i);if(u!==void 0)return u;e||="/";let o;try{o=fy(e,n.segmentTree,s)}catch(d){if(d instanceof URIError)o=null;else throw d}return o&&(o.branch=bD(o.route)),n.matchCache.set(i,o),o}function SD(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function vD(e,n=!1,s){const i=ka(e.fullPath),u=new Uint16Array(6),o={},d={};let h=0;return zd(n,u,e,1,i,0,m=>{if(s?.(m,h),na(!(m.id in o),`Duplicate routes found with id: ${String(m.id)}`),o[m.id]=m,h!==0&&m.path){const y=SD(m.fullPath);(!d[y]||m.fullPath.endsWith("/"))&&(d[y]=m)}h++}),Is(i),{processedTree:{segmentTree:i,singleCache:$f(1e3),matchCache:$f(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:d}}function fy(e,n,s=!1){const i=e.split("/"),u=xD(e,i,n,s);if(!u)return null;const[o]=GT(e,i,u);return{route:u.node.route,rawParams:o,parsedParams:u.parsedParams}}function GT(e,n,s){const i=_D(s.node);let u=null;const o={};let d=s.extract?.part??0,h=s.extract?.node??0,p=s.extract?.path??0,m=s.extract?.segment??0;for(;h=0;oe--){const ie=v.optional[oe];h.push({node:ie,index:_,skipped:te,depth:fe,statics:j,dynamics:B,optionals:M,extract:I,rawParams:z,parsedParams:W})}if(!H)for(let oe=v.optional.length-1;oe>=0;oe--){const ie=v.optional[oe],{prefix:A,suffix:Q}=ie;if(A||Q){const Z=ie.caseSensitive?V:Y??=V.toLowerCase();if(A&&!Z.startsWith(A)||Q&&!Z.endsWith(Q))continue}h.push({node:ie,index:_+1,skipped:x,depth:fe,statics:j,dynamics:B,optionals:M+1,extract:I,rawParams:z,parsedParams:W})}}if(!H&&v.dynamic&&V)for(let te=v.dynamic.length-1;te>=0;te--){const fe=v.dynamic[te],{prefix:oe,suffix:ie}=fe;if(oe||ie){const A=fe.caseSensitive?V:Y??=V.toLowerCase();if(oe&&!A.startsWith(oe)||ie&&!A.endsWith(ie))continue}h.push({node:fe,index:_+1,skipped:x,depth:T+1,statics:j,dynamics:B+1,optionals:M,extract:I,rawParams:z,parsedParams:W})}if(!H&&v.staticInsensitive){const te=v.staticInsensitive.get(Y??=V.toLowerCase());te&&h.push({node:te,index:_+1,skipped:x,depth:T+1,statics:j+1,dynamics:B,optionals:M,extract:I,rawParams:z,parsedParams:W})}if(!H&&v.static){const te=v.static.get(V);te&&h.push({node:te,index:_+1,skipped:x,depth:T+1,statics:j+1,dynamics:B,optionals:M,extract:I,rawParams:z,parsedParams:W})}if(v.pathless){const te=T+1;for(let fe=v.pathless.length-1;fe>=0;fe--){const oe=v.pathless[fe];h.push({node:oe,index:_,skipped:x,depth:te,statics:j,dynamics:B,optionals:M,extract:I,rawParams:z,parsedParams:W})}}}if(y&&p)return fu(p,y)?y:p;if(y)return y;if(p)return p;if(i&&m){let S=m.index;for(let _=0;_e.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===Ca)>(e.node.kind===Ca)||n.node.kind===Ca==(e.node.kind===Ca)&&n.depth>e.depth))):!0}function af(e){return dy(e.filter(n=>n!==void 0).join("/"))}function dy(e){return e.replace(/\/{2,}/g,"/")}function FT(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Js(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function KT(e){return Js(FT(e))}function Hf(e,n){return e?.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function ED(e,n,s){return Hf(e,s)===Hf(n,s)}function wD({base:e,to:n,trailingSlash:s="never",cache:i}){const u=n.startsWith("/"),o=!u&&n===".";let d;if(i){d=u?n:o?e:e+"\0"+n;const S=i.get(d);if(S)return S}let h;if(o)h=e.split("/");else if(u)h=n.split("/");else{for(h=e.split("/");h.length>1&&Fu(h)==="";)h.pop();const S=n.split("/");for(let v=0,_=S.length;v<_;v++){const x=S[v];x===""?v?v===_-1&&h.push(x):h=[x]:x===".."?h.pop():x==="."||h.push(x)}}h.length>1&&(Fu(h)===""?s==="never"&&h.pop():s==="always"&&h.push(""));let p,m="";for(let S=0;S0&&(m+="/");const v=h[S];if(!v)continue;p=oy(v,0,p);const _=p[0];if(_===ac){m+=v;continue}const x=p[5],T=v.substring(0,p[1]),j=v.substring(p[4],x),B=v.substring(p[2],p[3]);_===Ya?m+=T||j?`${T}{$${B}}${j}`:`$${B}`:_===Ga?m+=T||j?`${T}{$}${j}`:"$":m+=`${T}{-$${B}}${j}`}m=dy(m);const y=m||"/";return d&&i&&i.set(d,y),y}function TD(e){const n=new Map(e.map(u=>[encodeURIComponent(u),u])),s=Array.from(n.keys()).map(u=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),i=new RegExp(s,"g");return u=>u.replace(i,o=>n.get(o)??o)}function wp(e,n,s){const i=n[e];return typeof i!="string"?i:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(i)?i:i.split("/").map(u=>Q_(u,s)).join("/"):Q_(i,s)}function X_({path:e,params:n,decoder:s,...i}){let u=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:u};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:u};const d=e.length;let h=0,p,m="";for(;h{let s;return(...i)=>{s||(s=setTimeout(()=>{e(...i),s=null},n))}};function AD(){const e=OD();if(!e)return null;const n=e.getItem(wg);let s=n?JSON.parse(n):{};return{state:s,set:i=>{s=Gs(i,s)||s;try{e.setItem(wg,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Yo=AD(),MD=e=>e.state.__TSR_key||e.href;function CD(e){const n=[];let s;for(;s=e.parentNode;)n.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${n.reverse().join(" > ")}`.toLowerCase()}let Vf=!1;function kD({storageKey:e,key:n,behavior:s,shouldScrollRestoration:i,scrollToTopSelectors:u,location:o}){let d;try{d=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(m){console.error(m);return}const h=n||window.history.state?.__TSR_key,p=d[h];Vf=!0;e:{if(i&&p&&Object.keys(p).length>0){for(const S in p){const v=p[S];if(S==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:s});else if(S){const _=document.querySelector(S);_&&(_.scrollLeft=v.scrollX,_.scrollTop=v.scrollY)}}break e}const m=(o??window.location).hash.split("#",2)[1];if(m){const S=window.history.state?.__hashScrollIntoViewOptions??!0;if(S){const v=document.getElementById(m);v&&v.scrollIntoView(S)}break e}const y={top:0,left:0,behavior:s};if(window.scrollTo(y),u)for(const S of u){if(S==="window")continue;const v=typeof S=="function"?S():document.querySelector(S);v&&v.scrollTo(y)}}Vf=!1}function UD(e,n){if(!Yo||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Yo))return;e.isScrollRestorationSetup=!0,Vf=!1;const i=e.options.getScrollRestorationKey||MD;window.history.scrollRestoration="manual";const u=o=>{if(Vf||!e.isScrollRestoring)return;let d="";if(o.target===document||o.target===window)d="window";else{const p=o.target.getAttribute("data-scroll-restoration-id");p?d=`[data-scroll-restoration-id="${p}"]`:d=CD(o.target)}const h=i(e.state.location);Yo.set(p=>{const m=p[h]||={},y=m[d]||={};if(d==="window")y.scrollX=window.scrollX||0,y.scrollY=window.scrollY||0;else if(d){const S=document.querySelector(d);S&&(y.scrollX=S.scrollLeft||0,y.scrollY=S.scrollTop||0)}return p})};typeof document<"u"&&document.addEventListener("scroll",RD(u,100),!0),e.subscribe("onRendered",o=>{const d=i(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(kD({storageKey:wg,key:d,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Yo.set(h=>(h[d]||={},h)))})}function zD(e){if(typeof document<"u"&&document.querySelector){const n=e.state.location.state.__hashScrollIntoViewOptions??!0;if(n&&e.state.location.hash!==""){const s=document.getElementById(e.state.location.hash);s&&s.scrollIntoView(n)}}}function ND(e,n=String){const s=new URLSearchParams;for(const i in e){const u=e[i];u!==void 0&&s.set(i,n(u))}return s.toString()}function Tp(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function DD(e){const n=new URLSearchParams(e),s={};for(const[i,u]of n.entries()){const o=s[i];o==null?s[i]=Tp(u):Array.isArray(o)?o.push(Tp(u)):s[i]=[o,Tp(u)]}return s}const LD=BD(JSON.parse),jD=qD(JSON.stringify,JSON.parse);function BD(e){return n=>{n[0]==="?"&&(n=n.substring(1));const s=DD(n);for(const i in s){const u=s[i];if(typeof u=="string")try{s[i]=e(u)}catch{}}return s}}function qD(e,n){const s=typeof n=="function";function i(u){if(typeof u=="object"&&u!==null)try{return e(u)}catch{}else if(s&&typeof u=="string")try{return n(u),e(u)}catch{}return u}return u=>{const o=ND(u,i);return o?`?${o}`:""}}const Gn="__root__";function $D(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:n});if(s.options=e,e.throw)throw s;return s}function Cn(e){return e instanceof Response&&!!e.options}const Tg=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Nd=(e,n)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===n)),Fi=(e,n,s=!0)=>{const i={...e.router.options.context??{}},u=s?n:n-1;for(let o=0;o<=u;o++){const d=e.matches[o];if(!d)continue;const h=e.router.getMatch(d.id);h&&Object.assign(i,h.__routeContext,h.__beforeLoadContext)}return i},J_=(e,n)=>{if(!e.matches.length)return;const s=n.routeId,i=e.matches.findIndex(d=>d.routeId===e.router.routeTree.id),u=i>=0?i:0;let o=s?e.matches.findIndex(d=>d.routeId===s):e.firstBadMatchIndex??e.matches.length-1;o<0&&(o=u);for(let d=o;d>=0;d--){const h=e.matches[d];if(e.router.looseRoutesById[h.routeId].options.notFoundComponent)return d}return s?o:u},Fs=(e,n,s)=>{if(!(!Cn(s)&&!mn(s)))throw Cn(s)&&s.redirectHandled&&!s.options.reloadDocument||(n&&(n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.loaderPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0,n._nonReactive.error=s,e.updateMatch(n.id,i=>({...i,status:Cn(s)?"redirected":i.status==="pending"?"success":i.status,context:Fi(e,n.index),isFetching:!1,error:s})),mn(s)&&!s.routeId&&(s.routeId=n.routeId),n._nonReactive.loadPromise?.resolve()),Cn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},PT=(e,n)=>!!e.router.getMatch(n)._nonReactive.dehydrated,du=(e,n,s,i)=>{const{id:u,routeId:o}=e.matches[n],d=e.router.looseRoutesById[o];if(s instanceof Promise)throw s;s.routerCode=i,e.firstBadMatchIndex??=n,Fs(e,e.router.getMatch(u),s);try{d.options.onError?.(s)}catch(h){s=h,Fs(e,e.router.getMatch(u),s)}e.updateMatch(u,h=>(h._nonReactive.beforeLoadPromise?.resolve(),h._nonReactive.beforeLoadPromise=void 0,h._nonReactive.loadPromise?.resolve(),{...h,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Cn(s)&&!mn(s)&&(e.serialError??=s)},XT=(e,n,s,i)=>{if(i._nonReactive.pendingTimeout!==void 0)return;const u=s.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Nd(e,n)&&(s.options.loader||s.options.beforeLoad||JT(s))&&typeof u=="number"&&u!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent))){const d=setTimeout(()=>{Tg(e)},u);i._nonReactive.pendingTimeout=d}},HD=(e,n,s)=>{const i=e.router.getMatch(n);if(!i._nonReactive.beforeLoadPromise&&!i._nonReactive.loaderPromise)return;XT(e,n,s,i);const u=()=>{const o=e.router.getMatch(n);o.preload&&(o.status==="redirected"||o.status==="notFound")&&Fs(e,o,o.error)};return i._nonReactive.beforeLoadPromise?i._nonReactive.beforeLoadPromise.then(u):u()},VD=(e,n,s,i)=>{const u=e.router.getMatch(n),o=u._nonReactive.loadPromise;u._nonReactive.loadPromise=sc(()=>{o?.resolve()});const{paramsError:d,searchError:h}=u;d&&du(e,s,d,"PARSE_PARAMS"),h&&du(e,s,h,"VALIDATE_SEARCH"),XT(e,n,i,u);const p=new AbortController;let m=!1;const y=()=>{m||(m=!0,e.updateMatch(n,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:p})))},S=()=>{u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,e.updateMatch(n,z=>({...z,isFetching:!1}))};if(!i.options.beforeLoad){Mu(()=>{y(),S()});return}u._nonReactive.beforeLoadPromise=sc();const v={...Fi(e,s,!1),...u.__routeContext},{search:_,params:x,cause:T}=u,j=Nd(e,n),B={search:_,abortController:p,params:x,preload:j,context:v,location:e.location,navigate:z=>e.router.navigate({...z,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":T,matches:e.matches,routeId:i.id,...e.router.options.additionalContext},M=z=>{if(z===void 0){Mu(()=>{y(),S()});return}(Cn(z)||mn(z))&&(y(),du(e,s,z,"BEFORE_LOAD")),Mu(()=>{y(),e.updateMatch(n,W=>({...W,__beforeLoadContext:z})),S()})};let I;try{if(I=i.options.beforeLoad(B),Ku(I))return y(),I.catch(z=>{du(e,s,z,"BEFORE_LOAD")}).then(M)}catch(z){y(),du(e,s,z,"BEFORE_LOAD")}M(I)},ID=(e,n)=>{const{id:s,routeId:i}=e.matches[n],u=e.router.looseRoutesById[i],o=()=>h(),d=()=>VD(e,s,n,u),h=()=>{if(PT(e,s))return;const p=HD(e,s,u);return Ku(p)?p.then(d):d()};return o()},YD=(e,n,s)=>{const i=e.router.getMatch(n);if(!i||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const u={ssr:e.router.options.ssr,matches:e.matches,match:i,params:i.params,loaderData:i.loaderData};return Promise.all([s.options.head?.(u),s.options.scripts?.(u),s.options.headers?.(u)]).then(([o,d,h])=>{const p=o?.meta,m=o?.links,y=o?.scripts,S=o?.styles;return{meta:p,links:m,headScripts:y,headers:h,scripts:d,styles:S}})},QT=(e,n,s,i,u)=>{const o=n[i-1],{params:d,loaderDeps:h,abortController:p,cause:m}=e.router.getMatch(s),y=Fi(e,i),S=Nd(e,s);return{params:d,deps:h,preload:!!S,parentMatchPromise:o,abortController:p,context:y,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:S?"preload":m,route:u,...e.router.options.additionalContext}},Z_=async(e,n,s,i,u)=>{try{const o=e.router.getMatch(s);try{(!(iD??e.router.isServer)||o.ssr===!0)&&If(u);const d=u.options.loader?.(QT(e,n,s,i,u)),h=u.options.loader&&Ku(d);if((h||u._lazyPromise||u._componentsPromise||u.options.head||u.options.scripts||u.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(s,y=>({...y,isFetching:"loader"})),u.options.loader){const y=h?await d:d;Fs(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,S=>({...S,loaderData:y}))}u._lazyPromise&&await u._lazyPromise;const m=o._nonReactive.minPendingPromise;m&&await m,u._componentsPromise&&await u._componentsPromise,e.updateMatch(s,y=>({...y,error:void 0,context:Fi(e,i),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let h=d;if(h?.name==="AbortError"){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:Fi(e,i)}));return}const p=o._nonReactive.minPendingPromise;p&&await p,mn(d)&&await u.options.notFoundComponent?.preload?.(),Fs(e,e.router.getMatch(s),d);try{u.options.onError?.(d)}catch(m){h=m,Fs(e,e.router.getMatch(s),m)}e.updateMatch(s,m=>({...m,error:h,context:Fi(e,i),status:"error",isFetching:!1}))}}catch(o){const d=e.router.getMatch(s);d&&(d._nonReactive.loaderPromise=void 0),Fs(e,d,o)}},GD=async(e,n,s)=>{async function i(S,v,_,x){const T=Date.now()-v.updatedAt,j=S?x.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:x.options.staleTime??e.router.options.defaultStaleTime??0,B=x.options.shouldReload,M=typeof B=="function"?B(QT(e,n,u,s,x)):B,{status:I,invalid:z}=_;d=I==="success"&&(z||(M??T>j)),S&&x.options.preload===!1||(d&&!e.sync?(h=!0,(async()=>{try{await Z_(e,n,u,s,x);const W=e.router.getMatch(u);W._nonReactive.loaderPromise?.resolve(),W._nonReactive.loadPromise?.resolve(),W._nonReactive.loaderPromise=void 0}catch(W){Cn(W)&&await e.router.navigate(W.options)}})()):(I!=="success"||d&&e.sync)&&await Z_(e,n,u,s,x))}const{id:u,routeId:o}=e.matches[s];let d=!1,h=!1;const p=e.router.looseRoutesById[o];if(!PT(e,u)){const S=e.router.getMatch(u),v=Nd(e,u);if(S._nonReactive.loaderPromise){if(S.status==="success"&&!e.sync&&!S.preload)return S;await S._nonReactive.loaderPromise;const _=e.router.getMatch(u),x=_._nonReactive.error||_.error;x&&Fs(e,_,x),_.status==="pending"&&await i(v,S,_,p)}else{const _=v&&!e.router.state.matches.some(T=>T.id===u),x=e.router.getMatch(u);x._nonReactive.loaderPromise=sc(),_!==x.preload&&e.updateMatch(u,T=>({...T,preload:_})),await i(v,S,x,p)}}const m=e.router.getMatch(u);h||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve()),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,h||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const y=h?m.isFetching:!1;return y!==m.isFetching||m.invalid!==!1?(e.updateMatch(u,S=>({...S,isFetching:y,invalid:!1})),e.router.getMatch(u)):m};async function W_(e){const n=e,s=[];n.router.state.matches.some(v=>v._forcePending)&&Tg(n);let i;for(let v=0;v({...B,...j?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:m},isFetching:!1})),y=v,await If(x)}else if(!n.preload){const v=n.matches[0];v.globalNotFound||n.router.getMatch(v.id)?.globalNotFound&&n.updateMatch(v.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(n.serialError&&n.firstBadMatchIndex!==void 0){const v=n.router.looseRoutesById[n.matches[n.firstBadMatchIndex].routeId];await If(v)}for(let v=0;v<=y;v++){const _=n.matches[v],{id:x,routeId:T}=_,j=n.router.looseRoutesById[T];try{const B=YD(n,x,j);if(B){const M=await B;n.updateMatch(x,I=>({...I,...M}))}}catch(B){console.error(`Error executing head for route ${T}:`,B)}}const S=Tg(n);if(Ku(S)&&await S,m)throw m;if(n.serialError&&!n.preload&&!n.onReady)throw n.serialError;return n.matches}async function If(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(n=>{const{id:s,...i}=n.options;Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const n=()=>{const s=[];for(const i of ZT){const u=e.options[i]?.preload;u&&s.push(u())}if(s.length)return Promise.all(s).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(n):n()}return e._componentsPromise}function JT(e){for(const n of ZT)if(e.options[n]?.preload)return!0;return!1}const ZT=["component","errorComponent","pendingComponent","notFoundComponent"];function FD(e){return{input:({url:n})=>{for(const s of e)n=Og(s,n);return n},output:({url:n})=>{for(let s=e.length-1;s>=0;s--)n=WT(e[s],n);return n}}}function KD(e){const n=KT(e.basepath),s=`/${n}`,i=`${s}/`,u=e.caseSensitive?s:s.toLowerCase(),o=e.caseSensitive?i:i.toLowerCase();return{input:({url:d})=>{const h=e.caseSensitive?d.pathname:d.pathname.toLowerCase();return h===u?d.pathname="/":h.startsWith(o)&&(d.pathname=d.pathname.slice(s.length)),d},output:({url:d})=>(d.pathname=af(["/",n,d.pathname]),d)}}function Og(e,n){const s=e?.input?.({url:n});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return n}function WT(e,n){const s=e?.output?.({url:n});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return n}function Da(e){const n=e.resolvedLocation,s=e.location,i=n?.pathname!==s.pathname,u=n?.href!==s.href,o=n?.hash!==s.hash;return{fromLocation:n,toLocation:s,pathChanged:i,hrefChanged:u,hashChanged:o}}function PD(e){const n=e.filter(s=>s.status!=="redirected");return n.length===e.length?e:n}class XD{constructor(n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=s=>s(),this.update=s=>{const i=this.options,u=this.basepath??i?.basepath??"/",o=this.basepath===void 0,d=i?.rewrite;if(this.options={...i,...s},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=TD(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=IT()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let v;this.resolvePathCache=$f(1e3),v=this.buildRouteTree(),this.setRoutes(v)}!this.__store&&this.latestLocation&&(this.__store=nD(JD(this.latestLocation)),UD(this));let h=!1;const p=this.options.basepath??"/",m=this.options.rewrite;if(o||u!==p||d!==m){this.basepath=p;const v=[],_=KT(p);_&&_!=="/"&&v.push(KD({basepath:p})),m&&v.push(m),this.rewrite=v.length===0?void 0:v.length===1?v[0]:FD(v),this.history&&this.updateLatestLocation(),h=!0}h&&this.__store&&this.__store.setState(v=>({...v,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=vD(this.routeTree,this.options.caseSensitive,(i,u)=>{i.init({originalIndex:u})});return this.options.routeMasks&&mD(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,i)=>{const u={eventType:s,fn:i};return this.subscribers.add(u),()=>{this.subscribers.delete(u)}},this.emit=s=>{this.subscribers.forEach(i=>{i.eventType===s.type&&i.fn(s)})},this.parseLocation=(s,i)=>{const u=({pathname:p,search:m,hash:y,href:S,state:v})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(p)){const M=this.options.parseSearch(m),I=this.options.stringifySearch(M);return{href:p+I+y,publicHref:S,pathname:ou(p).path,external:!1,searchStr:I,search:Mn(i?.search,M),hash:ou(y.slice(1)).path,state:Mn(i?.state,v)}}const _=new URL(S,this.origin),x=Og(this.rewrite,_),T=this.options.parseSearch(x.search),j=this.options.stringifySearch(T);return x.search=j,{href:x.href.replace(x.origin,""),publicHref:S,pathname:ou(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:j,search:Mn(i?.search,T),hash:ou(x.hash.slice(1)).path,state:Mn(i?.state,v)}},o=u(s),{__tempLocation:d,__tempKey:h}=o.state;if(d&&(!h||h===this.tempLocationKey)){const p=u(d);return p.state.key=o.state.key,p.state.__TSR_key=o.state.__TSR_key,delete p.state.__tempLocation,{...p,maskedLocation:o}}return o},this.resolvePathWithBase=(s,i)=>wD({base:s,to:dy(i),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,i,u)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:i},u):this.matchRoutesInternal(s,i),this.getMatchedRoutes=s=>ZD({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const i=this.getMatch(s);i&&(i.abortController.abort(),clearTimeout(i._nonReactive.pendingTimeout),i._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const s=this.state.matches.filter(o=>o.status==="pending"),i=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...s,...i]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=s=>{const i=(o={})=>{const d=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,h=this.matchRoutesLightweight(d);o.from;const p=o.unsafeRelative==="path"?d.pathname:o.from??h.fullPath,m=this.resolvePathWithBase(p,"."),y=h.search,S={...h.params},v=o.to?this.resolvePathWithBase(m,`${o.to}`):this.resolvePathWithBase(m,"."),_=o.params===!1||o.params===null?{}:(o.params??!0)===!0?S:Object.assign(S,Gs(o.params,S)),x=this.getMatchedRoutes(v);let T=x.matchedRoutes;if((!x.foundRoute||x.foundRoute.path!=="/"&&x.routeParams["**"])&&this.options.notFoundRoute&&(T=[...T,this.options.notFoundRoute]),Object.keys(_).length>0)for(const oe of T){const ie=oe.options.params?.stringify??oe.options.stringifyParams;if(ie)try{Object.assign(_,ie(_))}catch{}}const B=s.leaveParams?v:ou(X_({path:v,params:_,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let M=y;if(s._includeValidateSearch&&this.options.search?.strict){const oe={};T.forEach(ie=>{if(ie.options.validateSearch)try{Object.assign(oe,cf(ie.options.validateSearch,{...oe,...M}))}catch{}}),M=oe}M=WD({search:M,dest:o,destRoutes:T,_includeValidateSearch:s._includeValidateSearch}),M=Mn(y,M);const I=this.options.stringifySearch(M),z=o.hash===!0?d.hash:o.hash?Gs(o.hash,d.hash):void 0,W=z?`#${z}`:"";let H=o.state===!0?d.state:o.state?Gs(o.state,d.state):{};H=Mn(d.state,H);const V=`${B}${I}${W}`;let Y,te,fe=!1;if(this.rewrite){const oe=new URL(V,this.origin),ie=WT(this.rewrite,oe);Y=oe.href.replace(oe.origin,""),ie.origin!==this.origin?(te=ie.href,fe=!0):te=ie.pathname+ie.search+ie.hash}else Y=fD(V),te=Y;return{publicHref:te,href:Y,pathname:B,search:M,searchStr:I,state:H,hash:z??"",external:fe,unmaskOnReload:o.unmaskOnReload}},u=(o={},d)=>{const h=i(o);let p=d?i(d):void 0;if(!p){const m={};if(this.options.routeMasks){const y=pD(h.pathname,this.processedTree);if(y){Object.assign(m,y.rawParams);const{from:S,params:v,..._}=y.route,x=v===!1||v===null?{}:(v??!0)===!0?m:Object.assign(m,Gs(v,m));d={from:s.from,..._,params:x},p=i(d)}}}return p&&(h.maskedLocation=p),h};return s.mask?u(s,{from:s.from,...s.mask}):u(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:i,...u})=>{const o=()=>{const p=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];p.forEach(y=>{u.state[y]=this.latestLocation.state[y]});const m=Na(u.state,this.latestLocation.state);return p.forEach(y=>{delete u.state[y]}),m},d=Js(this.latestLocation.href)===Js(u.href),h=this.commitLocationPromise;if(this.commitLocationPromise=sc(()=>{h?.resolve()}),d&&o())this.load();else{let{maskedLocation:p,hashScrollIntoView:m,...y}=u;p&&(y={...p,state:{...p.state,__tempKey:void 0,__tempLocation:{...y,search:y.searchStr,state:{...y.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(y.unmaskOnReload??this.options.unmaskOnReload??!1)&&(y.state.__tempKey=this.tempLocationKey)),y.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,this.history[u.replace?"replace":"push"](y.publicHref,y.state,{ignoreBlocker:i})}return this.resetNextScroll=u.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:i,hashScrollIntoView:u,viewTransition:o,ignoreBlocker:d,href:h,...p}={})=>{if(h){const S=this.history.location.state.__TSR_index,v=jf(h,{__TSR_index:s?S:S+1}),_=new URL(v.pathname,this.origin),x=Og(this.rewrite,_);p.to=x.pathname,p.search=this.options.parseSearch(v.search),p.hash=v.hash.slice(1)}const m=this.buildLocation({...p,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const y=this.commitLocation({...m,viewTransition:o,replace:s,resetScroll:i,hashScrollIntoView:u,ignoreBlocker:d});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:s,reloadDocument:i,href:u,publicHref:o,...d})=>{let h=!1;if(u)try{new URL(`${u}`),h=!0}catch{}if(h&&!i&&(i=!0),i){if(s!==void 0||!u){const m=this.buildLocation({to:s,...d});u=u??m.publicHref,o=o??m.publicHref}const p=!h&&o?o:u;if(qf(p,this.protocolAllowlist))return Promise.resolve();if(!d.ignoreBlocker){const y=this.history.getBlockers?.()??[];for(const S of y)if(S?.blockerFn&&await S.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return d.replace?window.location.replace(p):window.location.href=p,Promise.resolve()}return this.buildAndCommitLocation({...d,href:u,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation);this.__store.setState(i=>({...i,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:s,cachedMatches:i.cachedMatches.filter(u=>!s.some(o=>o.id===u.id))}))},this.load=async s=>{let i,u,o;for(o=new Promise(h=>{this.startTransition(async()=>{try{this.beforeLoad();const p=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Da({resolvedLocation:m,location:p})}),this.emit({type:"onBeforeLoad",...Da({resolvedLocation:m,location:p})}),await W_({router:this,sync:s?.sync,matches:this.state.pendingMatches,location:p,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let y=[],S=[],v=[],_=[];Mu(()=>{this.__store.setState(x=>{const T=x.matches,j=x.pendingMatches||x.matches;return y=T.filter(B=>!j.some(M=>M.id===B.id)),S=T.filter(B=>!j.some(M=>M.routeId===B.routeId)),v=j.filter(B=>!T.some(M=>M.routeId===B.routeId)),_=j.filter(B=>T.some(M=>M.routeId===B.routeId)),{...x,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...y.filter(B=>B.status!=="error"&&B.status!=="notFound"&&B.status!=="redirected")]}}),this.clearExpiredCache()}),[[S,"onLeave"],[v,"onEnter"],[_,"onStay"]].forEach(([x,T])=>{x.forEach(j=>{this.looseRoutesById[j.routeId].options[T]?.(j)})})})})}})}catch(p){Cn(p)?(i=p,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):mn(p)&&(u=p),this.__store.setState(m=>({...m,statusCode:i?i.status:u?404:m.matches.some(y=>y.status==="error")?500:200,redirect:i}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),h()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.__store.state.matches.some(h=>h.status==="error")&&(d=500),d!==void 0&&this.__store.setState(h=>({...h,statusCode:d}))},this.startViewTransition=s=>{const i=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,i&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let u;if(typeof i=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,d=this.state.resolvedLocation,h=typeof i.types=="function"?i.types(Da({resolvedLocation:d,location:o})):i.types;if(h===!1){s();return}u={update:s,types:h}}else u=s;document.startViewTransition(u)}else s()},this.updateMatch=(s,i)=>{this.startTransition(()=>{const u=this.state.pendingMatches?.some(o=>o.id===s)?"pendingMatches":this.state.matches.some(o=>o.id===s)?"matches":this.state.cachedMatches.some(o=>o.id===s)?"cachedMatches":"";u&&(u==="cachedMatches"?this.__store.setState(o=>({...o,cachedMatches:PD(o.cachedMatches.map(d=>d.id===s?i(d):d))})):this.__store.setState(o=>({...o,[u]:o[u]?.map(d=>d.id===s?i(d):d)})))})},this.getMatch=s=>{const i=u=>u.id===s;return this.state.cachedMatches.find(i)??this.state.pendingMatches?.find(i)??this.state.matches.find(i)},this.invalidate=s=>{const i=u=>s?.filter?.(u)??!0?{...u,invalid:!0,...s?.forcePending||u.status==="error"||u.status==="notFound"?{status:"pending",error:void 0}:void 0}:u;return this.__store.setState(u=>({...u,matches:u.matches.map(i),cachedMatches:u.cachedMatches.map(i),pendingMatches:u.pendingMatches?.map(i)})),this.shouldViewTransition=!1,this.load({sync:s?.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const i=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const u=s.options._builtLocation??this.buildLocation(s.options),o=this.getParsedLocationHref(u);s.options.href=o,s.headers.set("Location",o)}else if(i)try{const u=new URL(i);if(this.origin&&u.origin===this.origin){const o=u.pathname+u.search+u.hash;s.options.href=o,s.headers.set("Location",o)}}catch{}if(s.options.href&&!s.options._builtLocation&&qf(s.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const i=s?.filter;i!==void 0?this.__store.setState(u=>({...u,cachedMatches:u.cachedMatches.filter(o=>!i(o))})):this.__store.setState(u=>({...u,cachedMatches:[]}))},this.clearExpiredCache=()=>{const s=i=>{const u=this.looseRoutesById[i.routeId];if(!u.options.loader)return!0;const o=(i.preload?u.options.preloadGcTime??this.options.defaultPreloadGcTime:u.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:Date.now()-i.updatedAt>=o};this.clearCache({filter:s})},this.loadRouteChunk=If,this.preloadRoute=async s=>{const i=s._builtLocation??this.buildLocation(s);let u=this.matchRoutes(i,{throwOnError:!0,preload:!0,dest:s});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(h=>h.id)),d=new Set([...o,...this.state.cachedMatches.map(h=>h.id)]);Mu(()=>{u.forEach(h=>{d.has(h.id)||this.__store.setState(p=>({...p,cachedMatches:[...p.cachedMatches,h]}))})});try{return u=await W_({router:this,matches:u,location:i,preload:!0,updateMatch:(h,p)=>{o.has(h)?u=u.map(m=>m.id===h?p(m):m):this.updateMatch(h,p)}}),u}catch(h){if(Cn(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:i});mn(h)||console.error(h);return}},this.matchRoute=(s,i)=>{const u={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},o=this.buildLocation(u);if(i?.pending&&this.state.status!=="pending")return!1;const h=(i?.pending===void 0?!this.state.isLoading:i.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,p=gD(o.pathname,i?.caseSensitive??!1,i?.fuzzy??!1,h.pathname,this.processedTree);return!p||s.params&&!Na(p.rawParams,s.params,{partial:!0})?!1:i?.includeSearch??!0?Na(h.search,o.search,{partial:!0})?p.rawParams:!1:p.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(s=>s.status==="notFound"||s.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...n,caseSensitive:n.caseSensitive??!1,notFoundMode:n.notFoundMode??"fuzzy",stringifySearch:n.stringifySearch??jD,parseSearch:n.parseSearch??LD,protocolAllowlist:n.protocolAllowlist??oD}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:n,routesByPath:s,processedTree:i}){this.routesById=n,this.routesByPath=s,this.processedTree=i;const u=this.options.notFoundRoute;u&&(u.init({originalIndex:99999999999}),this.routesById[u.id]=u)}get looseRoutesById(){return this.routesById}getParentContext(n){return n?.id?n.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(n,s){const i=this.getMatchedRoutes(n.pathname),{foundRoute:u,routeParams:o,parsedParams:d}=i;let{matchedRoutes:h}=i,p=!1;(u?u.path!=="/"&&o["**"]:Js(n.pathname))&&(this.options.notFoundRoute?h=[...h,this.options.notFoundRoute]:p=!0);const m=p?tL(this.options.notFoundMode,h):void 0,y=new Array(h.length),S=new Map(this.state.matches.map(v=>[v.routeId,v]));for(let v=0;vthis.navigate({...z,_fromLocation:n}),buildLocation:this.buildLocation,cause:_.cause,abortController:_.abortController,preload:!!_.preload,matches:y,routeId:x.id};_.__routeContext=x.options.context(I)??void 0}_.context={...M,..._.__routeContext,..._.__beforeLoadContext}}}return y}matchRoutesLightweight(n){const{matchedRoutes:s,routeParams:i,parsedParams:u}=this.getMatchedRoutes(n.pathname),o=Fu(s),d={...n.search};for(const y of s)try{Object.assign(d,cf(y.options.validateSearch,d))}catch{}const h=Fu(this.state.matches),p=h&&h.routeId===o.id&&n.pathname===this.state.location.pathname;let m;if(p)m=h.params;else{const y={...i};for(const S of s)try{ex(S,i,u??{},y)}catch{}m=y}return{matchedRoutes:s,fullPath:o.fullPath,search:d,params:m}}}class Yf extends Error{}class QD extends Error{}function JD(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function cf(e,n){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(n);if(s instanceof Promise)throw new Yf("Async validation not supported");if(s.issues)throw new Yf(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(n):typeof e=="function"?e(n):{}}function ZD({pathname:e,routesById:n,processedTree:s}){const i={},u=Js(e);let o,d;const h=yD(u,s,!0);return h&&(o=h.route,Object.assign(i,h.rawParams),d=Object.assign({},h.parsedParams)),{matchedRoutes:h?.branch||[n[Gn]],routeParams:i,foundRoute:o,parsedParams:d}}function WD({search:e,dest:n,destRoutes:s,_includeValidateSearch:i}){return eL(s)(e,n,i??!1)}function eL(e){const n={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const u of e){if("search"in u.options)u.options.search?.middlewares&&n.middlewares.push(...u.options.search.middlewares);else if(u.options.preSearchFilters||u.options.postSearchFilters){const o=({search:d,next:h})=>{let p=d;"preSearchFilters"in u.options&&u.options.preSearchFilters&&(p=u.options.preSearchFilters.reduce((y,S)=>S(y),d));const m=h(p);return"postSearchFilters"in u.options&&u.options.postSearchFilters?u.options.postSearchFilters.reduce((y,S)=>S(y),m):m};n.middlewares.push(o)}if(u.options.validateSearch){const o=({search:d,next:h})=>{const p=h(d);if(!n._includeValidateSearch)return p;try{return{...p,...cf(u.options.validateSearch,p)??void 0}}catch{return p}};n.middlewares.push(o)}}const s=({search:u})=>{const o=n.dest;return o.search?o.search===!0?u:Gs(o.search,u):{}};n.middlewares.push(s);const i=(u,o,d)=>{if(u>=d.length)return o;const h=d[u];return h({search:o,next:m=>i(u+1,m,d)})};return function(o,d,h){return n.dest=d,n._includeValidateSearch=h,i(0,o,n.middlewares)}}function tL(e,n){if(e!=="root")for(let s=n.length-1;s>=0;s--){const i=n[s];if(i.children)return i.id}return Gn}function ex(e,n,s,i){const u=e.options.params?.parse??e.options.parseParams;if(u)if(e.options.skipRouteOnParseError)for(const o in n)o in s&&(i[o]=s[o]);else{const o=u(i);Object.assign(i,o)}}const nL="Error preloading route! โ˜๏ธ";class e2{constructor(n){if(this.init=s=>{this.originalIndex=s.originalIndex;const i=this.options,u=!i?.path&&!i?.id;this.parentRoute=this.options.getParentRoute?.(),u?this._path=Gn:this.parentRoute||na(!1);let o=u?Gn:i?.path;o&&o!=="/"&&(o=FT(o));const d=i?.id||o;let h=u?Gn:af([this.parentRoute.id===Gn?"":this.parentRoute.id,d]);o===Gn&&(o="/"),h!==Gn&&(h=af(["/",h]));const p=h===Gn?"/":af([this.parentRoute.fullPath,o]);this._path=o,this._id=h,this._fullPath=p,this._to=Js(p)},this.addChildren=s=>this._addFileChildren(s),this._addFileChildren=s=>(Array.isArray(s)&&(this.children=s),typeof s=="object"&&s!==null&&(this.children=Object.values(s)),this),this._addFileTypes=()=>this,this.updateLoader=s=>(Object.assign(this.options,s),this),this.update=s=>(Object.assign(this.options,s),this),this.lazy=s=>(this.lazyFn=s,this),this.redirect=s=>$D({from:this.fullPath,...s}),this.options=n||{},this.isRoot=!n?.getParentRoute,n?.id&&n?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class rL extends e2{constructor(n){super(n)}}const Go=typeof window<"u"?le.useLayoutEffect:le.useEffect;function Op(e){const n=le.useRef({value:e,prev:null}),s=n.current.value;return e!==s&&(n.current={value:e,prev:s}),n.current.prev}function sL(e,n,s={},i={}){le.useEffect(()=>{if(!e.current||i.disabled||typeof IntersectionObserver!="function")return;const u=new IntersectionObserver(([o])=>{n(o)},s);return u.observe(e.current),()=>{u.disconnect()}},[n,s,i.disabled,e])}function aL(e){const n=le.useRef(null);return le.useImperativeHandle(e,()=>n.current,[]),n}function hy(e){const n=e.errorComponent??my;return ee.jsx(iL,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:i})=>s?le.createElement(n,{error:s,reset:i}):e.children})}class iL extends le.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(n){return{resetKey:n.getResetKey()}}static getDerivedStateFromError(n){return{error:n}}reset(){this.setState({error:null})}componentDidUpdate(n,s){s.error&&s.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(n,s){this.props.onCatch&&this.props.onCatch(n,s)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function my({error:e}){const[n,s]=le.useState(!1);return ee.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[ee.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[ee.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),ee.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(i=>!i),children:n?"Hide Error":"Show Error"})]}),ee.jsx("div",{style:{height:".25rem"}}),n?ee.jsx("div",{children:ee.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?ee.jsx("code",{children:e.message}):null})}):null]})}function cL({children:e,fallback:n=null}){return t2()?ee.jsx(Cu.Fragment,{children:e}):ee.jsx(Cu.Fragment,{children:n})}function t2(){return Cu.useSyncExternalStore(uL,()=>!0,()=>!1)}function uL(){return()=>{}}var Rp={exports:{}},Ap={},Mp={exports:{}},Cp={};var tx;function lL(){if(tx)return Cp;tx=1;var e=Ju();function n(S,v){return S===v&&(S!==0||1/S===1/v)||S!==S&&v!==v}var s=typeof Object.is=="function"?Object.is:n,i=e.useState,u=e.useEffect,o=e.useLayoutEffect,d=e.useDebugValue;function h(S,v){var _=v(),x=i({inst:{value:_,getSnapshot:v}}),T=x[0].inst,j=x[1];return o(function(){T.value=_,T.getSnapshot=v,p(T)&&j({inst:T})},[S,_,v]),u(function(){return p(T)&&j({inst:T}),S(function(){p(T)&&j({inst:T})})},[S]),d(_),_}function p(S){var v=S.getSnapshot;S=S.value;try{var _=v();return!s(S,_)}catch{return!0}}function m(S,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:h;return Cp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,Cp}var nx;function oL(){return nx||(nx=1,Mp.exports=lL()),Mp.exports}var rx;function fL(){if(rx)return Ap;rx=1;var e=Ju(),n=oL();function s(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var i=typeof Object.is=="function"?Object.is:s,u=n.useSyncExternalStore,o=e.useRef,d=e.useEffect,h=e.useMemo,p=e.useDebugValue;return Ap.useSyncExternalStoreWithSelector=function(m,y,S,v,_){var x=o(null);if(x.current===null){var T={hasValue:!1,value:null};x.current=T}else T=x.current;x=h(function(){function B(H){if(!M){if(M=!0,I=H,H=v(H),_!==void 0&&T.hasValue){var V=T.value;if(_(V,H))return z=V}return z=H}if(V=z,i(I,H))return V;var Y=v(H);return _!==void 0&&_(V,Y)?(I=H,V):(I=H,z=Y)}var M=!1,I,z,W=S===void 0?null:S;return[function(){return B(y())},W===null?void 0:function(){return B(W())}]},[y,S,v,_]);var j=u(m,x[0],x[1]);return d(function(){T.hasValue=!0,T.value=j},[j]),p(j),j},Ap}var sx;function dL(){return sx||(sx=1,Rp.exports=fL()),Rp.exports}var hL=dL();function mL(e,n){return e===n}function pL(e,n,s=mL){const i=le.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:h}=e.subscribe(d);return h},[e]),u=le.useCallback(()=>e?.get(),[e]);return hL.useSyncExternalStoreWithSelector(i,u,u,n,s)}const n2=le.createContext(null);function er(e){const n=le.useContext(n2);return e?.warn,n}function Pn(e){const n=er({warn:e?.router===void 0}),s=e?.router||n,i=le.useRef(void 0);return pL(s.__store,u=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const o=Mn(i.current,e.select(u));return i.current=o,o}return e.select(u)}return u})}const Dd=le.createContext(void 0),gL=le.createContext(void 0);function Rr(e){const n=le.useContext(e.from?gL:Dd);return Pn({select:i=>{const u=i.matches.find(o=>e.from?e.from===o.routeId:o.id===n);if(na(!((e.shouldThrow??!0)&&!u),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),u!==void 0)return e.select?e.select(u):u},structuralSharing:e.structuralSharing})}function py(e){return Rr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function gy(e){const{select:n,...s}=e;return Rr({...s,select:i=>n?n(i.loaderDeps):i.loaderDeps})}function yy(e){return Rr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const s=e.strict===!1?n.params:n._strictParams;return e.select?e.select(s):s}})}function Sy(e){return Rr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function vy(e){const n=er();return le.useCallback(s=>n.navigate({...s,from:s.from??e?.from}),[e?.from,n])}var yL=kx();function SL(e,n){const s=er(),i=aL(n),{activeProps:u,inactiveProps:o,activeOptions:d,to:h,preload:p,preloadDelay:m,hashScrollIntoView:y,replace:S,startTransition:v,resetScroll:_,viewTransition:x,children:T,target:j,disabled:B,style:M,className:I,onClick:z,onBlur:W,onFocus:H,onMouseEnter:V,onMouseLeave:Y,onTouchStart:te,ignoreBlocker:fe,params:oe,search:ie,hash:A,state:Q,mask:Z,reloadDocument:O,unsafeRelative:N,from:ne,_fromLocation:ce,...se}=e,w=t2(),G=Pn({select:Fe=>{const _t=Fe.matches[Fe.matches.length-1];return{search:_t?.search,hash:Fe.location.hash,path:_t?.pathname}},structuralSharing:!0}),re=e.from,ae=le.useMemo(()=>({...e,from:re}),[s,G,re,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),he=le.useMemo(()=>s.buildLocation({...ae}),[s,ae]),xe=he.maskedLocation?he.maskedLocation.publicHref:he.publicHref,Ne=he.maskedLocation?he.maskedLocation.external:he.external,pt=le.useMemo(()=>wL(xe,Ne,s.history,B),[B,Ne,xe,s.history]),Ze=le.useMemo(()=>{if(pt?.external)return qf(pt.href,s.protocolAllowlist)?void 0:pt.href;if(!TL(h)&&!(typeof h!="string"||h.indexOf(":")===-1))try{return new URL(h),qf(h,s.protocolAllowlist)?void 0:h}catch{}},[h,pt,s.protocolAllowlist]),Ur=Pn({select:Fe=>{if(Ze)return!1;if(d?.exact){if(!ED(Fe.location.pathname,he.pathname,s.basepath))return!1}else{const _t=Hf(Fe.location.pathname,s.basepath),Qt=Hf(he.pathname,s.basepath);if(!(_t.startsWith(Qt)&&(_t.length===Qt.length||_t[Qt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!Na(Fe.location.search,he.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?w&&Fe.location.hash===he.hash:!0}}),zr=Ur?Gs(u,{})??vL:kp,ps=Ur?kp:Gs(o,{})??kp,oc=[I,zr.className,ps.className].filter(Boolean).join(" "),mr=(M||zr.style||ps.style)&&{...M,...zr.style,...ps.style},[fc,Wa]=le.useState(!1),bl=le.useRef(!1),Nr=e.reloadDocument||Ze?!1:p??s.options.defaultPreload,ca=m??s.options.defaultPreloadDelay??0,tr=le.useCallback(()=>{s.preloadRoute({...ae,_builtLocation:he}).catch(Fe=>{console.warn(Fe),console.warn(nL)})},[s,ae,he]),dc=le.useCallback(Fe=>{Fe?.isIntersecting&&tr()},[tr]);sL(i,dc,EL,{disabled:!!B||Nr!=="viewport"}),le.useEffect(()=>{bl.current||!B&&Nr==="render"&&(tr(),bl.current=!0)},[B,tr,Nr]);const qd=Fe=>{const _t=Fe.currentTarget.getAttribute("target"),Qt=j!==void 0?j:_t;if(!B&&!OL(Fe)&&!Fe.defaultPrevented&&(!Qt||Qt==="_self")&&Fe.button===0){Fe.preventDefault(),yL.flushSync(()=>{Wa(!0)});const El=s.subscribe("onResolved",()=>{El(),Wa(!1)});s.navigate({...ae,replace:S,resetScroll:_,hashScrollIntoView:y,startTransition:v,viewTransition:x,ignoreBlocker:fe})}};if(Ze)return{...se,ref:i,href:Ze,...T&&{children:T},...j&&{target:j},...B&&{disabled:B},...M&&{style:M},...I&&{className:I},...z&&{onClick:z},...W&&{onBlur:W},...H&&{onFocus:H},...V&&{onMouseEnter:V},...Y&&{onMouseLeave:Y},...te&&{onTouchStart:te}};const _l=Fe=>{if(B||Nr!=="intent")return;if(!ca){tr();return}const _t=Fe.currentTarget;if(hu.has(_t))return;const Qt=setTimeout(()=>{hu.delete(_t),tr()},ca);hu.set(_t,Qt)},rn=Fe=>{B||Nr!=="intent"||tr()},xl=Fe=>{if(B||!Nr||!ca)return;const _t=Fe.currentTarget,Qt=hu.get(_t);Qt&&(clearTimeout(Qt),hu.delete(_t))};return{...se,...zr,...ps,href:pt?.href,ref:i,onClick:Bi([z,qd]),onBlur:Bi([W,xl]),onFocus:Bi([H,_l]),onMouseEnter:Bi([V,_l]),onMouseLeave:Bi([Y,xl]),onTouchStart:Bi([te,rn]),disabled:!!B,target:j,...mr&&{style:mr},...oc&&{className:oc},...B&&bL,...Ur&&_L,...w&&fc&&xL}}const kp={},vL={className:"active"},bL={role:"link","aria-disabled":!0},_L={"data-status":"active","aria-current":"page"},xL={"data-transitioning":"transitioning"},hu=new WeakMap,EL={rootMargin:"100px"},Bi=e=>n=>{for(const s of e)if(s){if(n.defaultPrevented)return;s(n)}};function wL(e,n,s,i){if(!i)return n?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function TL(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}const r2=le.forwardRef((e,n)=>{const{_asChild:s,...i}=e,{type:u,...o}=SL(i,n),d=typeof i.children=="function"?i.children({isActive:o["data-status"]==="active"}):i.children;if(!s){const{disabled:h,...p}=o;return le.createElement("a",p,d)}return le.createElement(s,o,d)});function OL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let RL=class extends e2{constructor(n){super(n),this.useMatch=s=>Rr({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>Rr({...s,from:this.id,select:i=>s?.select?s.select(i.context):i.context}),this.useSearch=s=>Sy({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>yy({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>gy({...s,from:this.id}),this.useLoaderData=s=>py({...s,from:this.id}),this.useNavigate=()=>vy({from:this.fullPath}),this.Link=Cu.forwardRef((s,i)=>ee.jsx(r2,{ref:i,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}};function AL(e){return new RL(e)}class ML extends rL{constructor(n){super(n),this.useMatch=s=>Rr({select:s?.select,from:this.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>Rr({...s,from:this.id,select:i=>s?.select?s.select(i.context):i.context}),this.useSearch=s=>Sy({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useParams=s=>yy({select:s?.select,structuralSharing:s?.structuralSharing,from:this.id}),this.useLoaderDeps=s=>gy({...s,from:this.id}),this.useLoaderData=s=>py({...s,from:this.id}),this.useNavigate=()=>vy({from:this.fullPath}),this.Link=Cu.forwardRef((s,i)=>ee.jsx(r2,{ref:i,from:this.fullPath,...s})),this.$$typeof=Symbol.for("react.memo")}}function CL(e){return new ML(e)}function Rg(e){return typeof e=="object"?new ax(e,{silent:!0}).createRoute(e):new ax(e,{silent:!0}).createRoute}class ax{constructor(n,s){this.path=n,this.createRoute=i=>{const u=AL(i);return u.isRoot=!1,u},this.silent=s?.silent}}class ix{constructor(n){this.useMatch=s=>Rr({select:s?.select,from:this.options.id,structuralSharing:s?.structuralSharing}),this.useRouteContext=s=>Rr({from:this.options.id,select:i=>s?.select?s.select(i.context):i.context}),this.useSearch=s=>Sy({select:s?.select,structuralSharing:s?.structuralSharing,from:this.options.id}),this.useParams=s=>yy({select:s?.select,structuralSharing:s?.structuralSharing,from:this.options.id}),this.useLoaderDeps=s=>gy({...s,from:this.options.id}),this.useLoaderData=s=>py({...s,from:this.options.id}),this.useNavigate=()=>{const s=er();return vy({from:s.routesById[this.options.id].fullPath})},this.options=n,this.$$typeof=Symbol.for("react.memo")}}function cx(e){return typeof e=="object"?new ix(e):n=>new ix({id:e,...n})}function kL(){const e=er(),n=le.useRef({router:e,mounted:!1}),[s,i]=le.useState(!1),{hasPendingMatches:u,isLoading:o}=Pn({select:S=>({isLoading:S.isLoading,hasPendingMatches:S.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),d=Op(o),h=o||s||u,p=Op(h),m=o||u,y=Op(m);return e.startTransition=S=>{i(!0),le.startTransition(()=>{S(),i(!1)})},le.useEffect(()=>{const S=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Js(e.latestLocation.publicHref)!==Js(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{S()}},[e,e.history]),Go(()=>{if(typeof window<"u"&&e.ssr||n.current.router===e&&n.current.mounted)return;n.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),Go(()=>{d&&!o&&e.emit({type:"onLoad",...Da(e.state)})},[d,e,o]),Go(()=>{y&&!m&&e.emit({type:"onBeforeRouteMount",...Da(e.state)})},[m,y,e]),Go(()=>{if(p&&!h){const S=Da(e.state);e.emit({type:"onResolved",...S}),e.__store.setState(v=>({...v,status:"idle",resolvedLocation:v.location})),S.hrefChanged&&zD(e)}},[h,p,e]),null}function UL(e){const n=Pn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return ee.jsx(hy,{getResetKey:()=>n,onCatch:(s,i)=>{if(mn(s))e.onCatch?.(s,i);else throw s},errorComponent:({error:s})=>{if(mn(s))return e.fallback?.(s);throw s},children:e.children})}function zL(){return ee.jsx("p",{children:"Not Found"})}function Vi(e){return ee.jsx(ee.Fragment,{children:e.children})}function s2(e,n,s){return n.options.notFoundComponent?ee.jsx(n.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?ee.jsx(e.options.defaultNotFoundComponent,{...s}):ee.jsx(zL,{})}function NL(){return er().isScrollRestoring,null}const a2=le.memo(function({matchId:n}){const s=er(),i=Pn({select:T=>{const j=T.matches.findIndex(M=>M.id===n),B=T.matches[j];return na(B),{routeId:B.routeId,ssr:B.ssr,_displayPending:B._displayPending,resetKey:T.loadedAt,parentRouteId:T.matches[j-1]?.routeId}},structuralSharing:!0}),u=s.routesById[i.routeId],o=u.options.pendingComponent??s.options.defaultPendingComponent,d=o?ee.jsx(o,{}):null,h=u.options.errorComponent??s.options.defaultErrorComponent,p=u.options.onCatch??s.options.defaultOnCatch,m=u.isRoot?u.options.notFoundComponent??s.options.notFoundRoute?.options.component:u.options.notFoundComponent,y=i.ssr===!1||i.ssr==="data-only",S=(!u.isRoot||u.options.wrapInSuspense||y)&&(u.options.wrapInSuspense??o??(u.options.errorComponent?.preload||y))?le.Suspense:Vi,v=h?hy:Vi,_=m?UL:Vi,x=u.isRoot?u.options.shellComponent??Vi:Vi;return ee.jsxs(x,{children:[ee.jsx(Dd.Provider,{value:n,children:ee.jsx(S,{fallback:d,children:ee.jsx(v,{getResetKey:()=>i.resetKey,errorComponent:h||my,onCatch:(T,j)=>{if(mn(T))throw T;p?.(T,j)},children:ee.jsx(_,{fallback:T=>{if(!m||T.routeId&&T.routeId!==i.routeId||!T.routeId&&!u.isRoot)throw T;return le.createElement(m,T)},children:y||i._displayPending?ee.jsx(cL,{fallback:d,children:ee.jsx(ux,{matchId:n})}):ee.jsx(ux,{matchId:n})})})})}),i.parentRouteId===Gn&&s.options.scrollRestoration?ee.jsxs(ee.Fragment,{children:[ee.jsx(DL,{}),ee.jsx(NL,{})]}):null]})});function DL(){const e=er(),n=le.useRef(void 0);return ee.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(n.current===void 0||n.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Da(e.state)}),n.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ux=le.memo(function({matchId:n}){const s=er(),{match:i,key:u,routeId:o}=Pn({select:p=>{const m=p.matches.find(x=>x.id===n),y=m.routeId,v=(s.routesById[y].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:y,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:v?JSON.stringify(v):void 0,routeId:y,match:{id:m.id,status:m.status,error:m.error,invalid:m.invalid,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),d=s.routesById[o],h=le.useMemo(()=>{const p=d.options.component??s.options.defaultComponent;return p?ee.jsx(p,{},u):ee.jsx(i2,{})},[u,d.options.component,s.options.defaultComponent]);if(i._displayPending)throw s.getMatch(i.id)?._nonReactive.displayPendingPromise;if(i._forcePending)throw s.getMatch(i.id)?._nonReactive.minPendingPromise;if(i.status==="pending"){const p=d.options.pendingMinMs??s.options.defaultPendingMinMs;if(p){const m=s.getMatch(i.id);if(m&&!m._nonReactive.minPendingPromise){const y=sc();m._nonReactive.minPendingPromise=y,setTimeout(()=>{y.resolve(),m._nonReactive.minPendingPromise=void 0},p)}}throw s.getMatch(i.id)?._nonReactive.loadPromise}if(i.status==="notFound")return na(mn(i.error)),s2(s,d,i.error);if(i.status==="redirected")throw na(Cn(i.error)),s.getMatch(i.id)?._nonReactive.loadPromise;if(i.status==="error")throw i.error;return h}),i2=le.memo(function(){const n=er(),s=le.useContext(Dd),i=Pn({select:m=>m.matches.find(y=>y.id===s)?.routeId}),u=n.routesById[i],o=Pn({select:m=>{const S=m.matches.find(v=>v.id===s);return na(S),S.globalNotFound}}),d=Pn({select:m=>{const y=m.matches,S=y.findIndex(v=>v.id===s);return y[S+1]?.id}}),h=n.options.defaultPendingComponent?ee.jsx(n.options.defaultPendingComponent,{}):null;if(o)return s2(n,u,void 0);if(!d)return null;const p=ee.jsx(a2,{matchId:d});return i===Gn?ee.jsx(le.Suspense,{fallback:h,children:p}):p});function LL(){const e=er(),s=e.routesById[Gn].options.pendingComponent??e.options.defaultPendingComponent,i=s?ee.jsx(s,{}):null,u=typeof document<"u"&&e.ssr?Vi:le.Suspense,o=ee.jsxs(u,{fallback:i,children:[ee.jsx(kL,{}),ee.jsx(jL,{})]});return e.options.InnerWrap?ee.jsx(e.options.InnerWrap,{children:o}):o}function jL(){const e=er(),n=Pn({select:u=>u.matches[0]?.id}),s=Pn({select:u=>u.loadedAt}),i=n?ee.jsx(a2,{matchId:n}):null;return ee.jsx(Dd.Provider,{value:n,children:e.options.disableGlobalCatchBoundary?i:ee.jsx(hy,{getResetKey:()=>s,errorComponent:my,onCatch:void 0,children:i})})}const BL=e=>new qL(e);class qL extends XD{constructor(n){super(n)}}typeof globalThis<"u"?(globalThis.createFileRoute=Rg,globalThis.createLazyFileRoute=cx):typeof window<"u"&&(window.createFileRoute=Rg,window.createLazyFileRoute=cx);function $L({router:e,children:n,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const i=ee.jsx(n2.Provider,{value:e,children:n});return e.options.Wrap?ee.jsx(e.options.Wrap,{children:i}):i}function HL({router:e,...n}){return ee.jsx($L,{router:e,...n,children:ee.jsx(LL,{})})}const c2=CL({component:i2}),lx=Symbol.for("~effect/http/Headers"),Xu=Object.create(null);Object.defineProperties(Xu,{[lx]:{value:lx},[Zf]:{value(e){return YL(this,Kn(e,GL))}},toJSON:{value(){return Wf(this)}},[nn]:{value(e){return IL(this,e)}},[tn]:{value(){return qg(this)}},toString:{value:B1.toString},[Ws]:{value:B1[Ws]}});const VL=e=>Object.assign(Object.create(Xu),e),IL=EM(QA()),by=Object.create(Xu),u2=e=>{if(e===void 0)return by;if(Symbol.iterator in e){const s=Object.create(Xu);for(const[i,u]of e)s[i.toLowerCase()]=u;return s}const n=Object.create(Xu);for(const[s,i]of Object.entries(e))Array.isArray(i)?n[s.toLowerCase()]=i.join(", "):i!==void 0&&(n[s.toLowerCase()]=i);return n},ox=P(2,(e,n)=>{const s=VL(e);return Object.assign(s,n),s}),YL=P(2,(e,n)=>{const s={...e},i=u=>{if(typeof u=="string"){const o=u.toLowerCase();o in e&&(s[o]=d_(e[o]))}else for(const o in e)u.test(o)&&(s[o]=d_(e[o]))};if(Array.isArray(n))for(let u=0;u["authorization","cookie","set-cookie","x-api-key"]}),FL="~effect/http/HttpClientError";class _y extends Wn(FL)({_tag:Zn("HttpError"),kind:W0(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:lc(hr)}){static fromHttpClientError(n){return new _y({_tag:"HttpError",kind:n.reason._tag,cause:n.reason})}}const Ag="~effect/FiberSet",KL=e=>Be(e,Ag),PL={[Ag]:Ag,[Symbol.iterator](){return this.state._tag==="Closed"?vM():this.state.backing[Symbol.iterator]()},...Ar,toJSON(){return{_id:"FiberMap",state:this.state}}},XL=(e,n)=>{const s=Object.create(PL);return s.state={_tag:"Open",backing:e},s.deferred=n,s},QL=()=>E0(Ut(()=>XL(new Set,Sd())),e=>dr(()=>{const n=e.state;if(n._tag==="Closed")return rt;e.state={_tag:"Closed"};const s=n.backing;return eU(s).pipe(Wk(e.deferred))})),l2=-1,JL=ZM(eC(Ik,WM(l2))),ZL=P(e=>KL(e[0]),(e,n,s)=>{if(e.state._tag==="Closed"){n.interruptUnsafe(l2);return}else if(e.state.backing.has(n))return;e.state.backing.add(n),n.addObserver(i=>{e.state._tag!=="Closed"&&(e.state.backing.delete(n),tw(i)&&(s?.propagateInterruption===!0?!JL(i.cause):!Hk(i.cause))&&bu(e.deferred,i))})}),WL=(function(){let e;return()=>(e===void 0&&(e=I4(Hu)),e)})(),e8=e=>()=>Un(qa(),n=>{const s=$a(n);return(i,u)=>{if(e.state._tag==="Closed")return WL();const o=s(i,u);return ZL(e,o),o}}),fx=e=>vd(e.deferred),dx="~effect/socket/Socket",xy=Sn("effect/socket/Socket"),t8="~effect/socket/Socket/CloseEvent",n8=e=>Be(e,t8),uf="~effect/socket/Socket/SocketError",r8=e=>Be(e,uf);class o2 extends Wn("effect/socket/Socket/SocketReadError")({_tag:Zn("SocketReadError"),cause:hr}){message="An error occurred during Read"}class s8 extends Wn("effect/socket/Socket/SocketWriteError")({_tag:Zn("SocketWriteError"),cause:hr}){message="An error occurred during Write"}class Gf extends Wn("effect/socket/Socket/SocketOpenError")({_tag:Zn("SocketOpenError"),kind:W0(["Unknown","Timeout"]),cause:hr}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class Ff extends Wn("effect/socket/Socket/SocketCloseError")({_tag:Zn("SocketCloseError"),code:cs,closeReason:lc(vt)}){static filterClean(n){return function(s){return Ki.is(s)&&s.reason._tag==="SocketCloseError"&&n(s.reason.code)?fs(s.reason):ur(s)}}get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}}const f2=lr([o2,s8,Gf,Ff]);class Ki extends Wn(uf)({_tag:Zn("SocketError"),reason:f2}){constructor(n){"cause"in n.reason?super({...n,cause:n.reason.cause}):super(n)}[uf]=uf;static is(n){return r8(n)}}const a8=e=>e!==1e3&&e!==1006;class i8 extends Sn()("~effect/socket/Socket/WebSocket"){}class d2 extends Sn()("@effect/platform/Socket/WebSocketConstructor"){}const c8=sw(d2)((e,n)=>new globalThis.WebSocket(e,n)),u8=(e,n)=>l8(E0((typeof e=="string"?Ee(e):e).pipe(Xe(s=>Un(d2.asEffect(),i=>i(s,n?.protocols)))),s=>Ut(()=>s.close(1e3))),n),l8=(e,n)=>bf(s=>{let i;const u=M0(!1),o=s.services,d=n?.closeCodeIsError??a8,h=(v,_)=>Sw(cr(function*(x){const T=yield*QL().pipe(ju(x)),j=yield*ju(e,x),B=yield*yw(e8(T)(),i8,j);let M=!1;function I(H){if(H.data instanceof Blob){const Y=Xe(T4(()=>H.data.arrayBuffer()),te=>{const fe=v(new Uint8Array(te));return ss(fe)?fe:rt});return B(Y)}const V=v(H.data);ss(V)&&B(V)}function z(H){j.removeEventListener("message",I),j.removeEventListener("close",W),bu(T.deferred,ke(new Ki({reason:M?new o2({cause:H}):new Gf({kind:"Unknown",cause:H})})))}function W(H){j.removeEventListener("message",I),j.removeEventListener("error",z),bu(T.deferred,ke(new Ki({reason:new Ff({code:H.code,closeReason:H.reason})})))}if(j.addEventListener("close",W,{once:!0}),j.addEventListener("error",z,{once:!0}),j.addEventListener("message",I),j.readyState!==1){const H=Sd();j.addEventListener("open",()=>{M=!0,bu(H,rt)},{once:!0}),yield*vd(H).pipe(z4({duration:n?.openTimeout??1e4,onTimeout:()=>ke(new Ki({reason:new Gf({kind:"Timeout",cause:new Error('timeout waiting for "open"')})}))}),pw(fx(T)))}return M=!0,i=j,u.openUnsafe(),_?.onOpen&&(yield*_.onOpen),yield*A4(fx(T),Ff.filterClean(H=>!d(H)),()=>rt)})).pipe(L4(x=>Ba(o,x)),B4(Ut(()=>{u.closeUnsafe(),i=void 0}))),p=new TextEncoder,m=(v,_)=>h(x=>typeof x=="string"?v(p.encode(x)):x instanceof Uint8Array?v(x):v(new Uint8Array(x)),_),S=Ee(v=>u.whenOpen(Ut(()=>{const _=i;n8(v)?_.close(v.code,v.reason):_.send(v)})));return Ee(xy.of({[dx]:dx,run:m,runRaw:h,writer:S}))}),o8=zx(u8,bd(xy));class h2 extends Sn()("effect/workers/Transferable/Collector"){}const f8=()=>{let e=[];const n=u=>{e.push(...u)},s=()=>e,i=()=>{const u=e;return e=[],u};return h2.of({addAllUnsafe:n,addAll:u=>Ut(()=>n(u)),readUnsafe:s,read:Ut(s),clearUnsafe:i,clear:Ut(i)})};class d8 extends Wn("effect/workers/WorkerError/WorkerSpawnError")({_tag:Zn("WorkerSpawnError"),message:vt,cause:lc(hr)}){}class h8 extends Wn("effect/workers/WorkerError/WorkerSendError")({_tag:Zn("WorkerSendError"),message:vt,cause:lc(hr)}){}class m8 extends Wn("effect/workers/WorkerError/WorkerReceiveError")({_tag:Zn("WorkerReceiveError"),message:vt,cause:lc(hr)}){}class p8 extends Wn("effect/workers/WorkerError/WorkerUnknownError")({_tag:Zn("WorkerUnknownError"),message:vt,cause:lc(hr)}){}const g8=lr([d8,h8,m8,p8]),y8="~effect/interfaces/PrimaryKey",Mg="~effect/rpc/RpcSchema/StreamSchema";function Ey(e){return Be(e,Mg)}function m2(e){return Ey(e)?{success:e.success,error:e.error}:void 0}const S8=oT(kf);function v8(e,n){return st(S8.ast,{[Mg]:Mg,success:e,error:n})}const hx="~effect/rpc/Rpc",b8={[hx]:hx,pipe(){return bt(this,arguments)},setSuccess(e){return Hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return Hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return Hs({_tag:this._tag,payloadSchema:J0(e)?e:Qe(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return Hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},prefix(e){return Hs({_tag:`${e}${this._tag}`,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},annotate(e,n){return Hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:ds(this.annotations,e,n)})},annotateMerge(e){return Hs({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:Ba(this.annotations,e)})}},Hs=e=>{function n(){}return Object.setPrototypeOf(n,b8),Object.assign(n,e),n.key=`effect/rpc/Rpc/${e._tag}`,n},ia=(e,n)=>{const s=n?.success??mg,i=n?.error??w_,u=n?.defect??hr;let o;return n?.primaryKey?o=class extends BN(`effect/rpc/Rpc/${e}`)(n.payload){[y8](){return n.primaryKey(this)}}:o=J0(n?.payload)?n?.payload:n?.payload?Qe(n?.payload):mg,Hs({_tag:e,payloadSchema:o,successSchema:n?.stream?v8(s,i):s,errorSchema:n?.stream?w_:i,defectSchema:u,annotations:Qn(),middlewares:new Set})},Up=new WeakMap,_8=e=>{if(Up.has(e))return Up.get(e);const n=e,s=new Set([n.errorSchema]),i=m2(n.successSchema);i&&s.add(i.error);for(const o of n.middlewares)s.add(o.error);const u=zN(i?mg:n.successSchema,lr([...s]),n.defectSchema);return Up.set(e,u),u},x8="~effect/rpc/Rpc/Wrapper",E8=e=>x8 in e,zp="~effect/rpc/RpcClientError";class Cg extends Wn("effect/rpc/RpcClientError/RpcClientDefect")({_tag:Zn("RpcClientDefect"),message:vt,cause:hr}){}class mx extends Wn(zp)({_tag:Zn("RpcClientError"),reason:lr([g8,f2,_y,Cg])}){[zp]=zp;get message(){return`${this.reason._tag}: ${this.reason.message}`}}const Fo=e=>typeof e=="bigint"?e:BigInt(e),w8={_tag:"Ping"};var kg;try{kg=new TextDecoder}catch{}var ue,wr,C=0,We={},ze,Ks,Yn=0,br=0,jt,is,yn=[],Ce,px={useRecords:!1,mapsAsObjects:!0};class p2{}const g2=new p2;g2.name="MessagePack 0xC1";var Zs=!1,y2=2,T8;try{new Function("")}catch{y2=1/0}class Qu{constructor(n){n&&(n.useRecords===!1&&n.mapsAsObjects===void 0&&(n.mapsAsObjects=!0),n.sequential&&n.trusted!==!1&&(n.trusted=!0,!n.structures&&n.useRecords!=!1&&(n.structures=[],n.maxSharedStructures||(n.maxSharedStructures=0))),n.structures?n.structures.sharedLength=n.structures.length:n.getStructures&&((n.structures=[]).uninitialized=!0,n.structures.sharedLength=0),n.int64AsNumber&&(n.int64AsType="number")),Object.assign(this,n)}unpack(n,s){if(ue)return E2(()=>(zg(),this?this.unpack(n,s):Qu.prototype.unpack.call(px,n,s)));!n.buffer&&n.constructor===ArrayBuffer&&(n=typeof Buffer<"u"?Buffer.from(n):new Uint8Array(n)),typeof s=="object"?(wr=s.end||n.length,C=s.start||0):(C=0,wr=s>-1?s:n.length),br=0,Ks=null,jt=null,ue=n;try{Ce=n.dataView||(n.dataView=new DataView(n.buffer,n.byteOffset,n.byteLength))}catch(i){throw ue=null,n instanceof Uint8Array?i:new Error("Source must be a Uint8Array or Buffer but was a "+(n&&typeof n=="object"?n.constructor.name:typeof n))}if(this instanceof Qu){if(We=this,this.structures)return ze=this.structures,Ko(s);(!ze||ze.length>0)&&(ze=[])}else We=px,(!ze||ze.length>0)&&(ze=[]);return Ko(s)}unpackMultiple(n,s){let i,u=0;try{Zs=!0;let o=n.length,d=this?this.unpack(n,o):Ld.unpack(n,o);if(s){if(s(d,u,C)===!1)return;for(;Ci.slice(0)));for(let i=0,u=n.length;i=32&&(o.highByte=i-32>>5))}n.sharedLength=n.length;for(let i in s||[])if(i>=0){let u=n[i],o=s[i];o&&(u&&((n.restoreStructures||(n.restoreStructures=[]))[i]=u),n[i]=o)}return this.structures=n}decode(n,s){return this.unpack(n,s)}}function Ko(e){try{if(!We.trusted&&!Zs){let s=ze.sharedLength||0;s=32&&T8||(n=St()),jt&&(C=jt.postBundlePosition,jt=null),Zs&&(ze.restoreStructures=null),C==wr)ze&&ze.restoreStructures&&gx(),ze=null,ue=null,is&&(is=null);else{if(C>wr)throw new Error("Unexpected end of MessagePack data");if(!Zs){let s;try{s=JSON.stringify(n,(i,u)=>typeof u=="bigint"?`${u}n`:u).slice(0,100)}catch(i){s="(JSON view not available "+i+")"}throw new Error("Data read, but end of buffer not reached "+s)}}return n}catch(n){throw ze&&ze.restoreStructures&&gx(),zg(),(n instanceof RangeError||n.message.startsWith("Unexpected end of buffer")||C>wr)&&(n.incomplete=!0),n}}function gx(){for(let e in ze.restoreStructures)ze[e]=ze.restoreStructures[e];ze.restoreStructures=null}function St(){let e=ue[C++];if(e<160)if(e<128){if(e<64)return e;{let n=ze[e&63]||We.getStructures&&S2()[e&63];return n?(n.read||(n.read=wy(n,e&63)),n.read()):e}}else if(e<144)if(e-=128,We.mapsAsObjects){let n={};for(let s=0;s=C)return Ks.slice(C-Yn,(C+=n)-Yn);if(br==0&&wr<140){let s=n<16?Ty(n):v2(n);if(s!=null)return s}return Ug(n)}else{let n;switch(e){case 192:return null;case 193:return jt?(n=St(),n>0?jt[1].slice(jt.position1,jt.position1+=n):jt[0].slice(jt.position0,jt.position0-=n)):g2;case 194:return!1;case 195:return!0;case 196:if(n=ue[C++],n===void 0)throw new Error("Unexpected end of buffer");return Np(n);case 197:return n=Ce.getUint16(C),C+=2,Np(n);case 198:return n=Ce.getUint32(C),C+=4,Np(n);case 199:return Ra(ue[C++]);case 200:return n=Ce.getUint16(C),C+=2,Ra(n);case 201:return n=Ce.getUint32(C),C+=4,Ra(n);case 202:if(n=Ce.getFloat32(C),We.useFloat32>2){let s=Oy[(ue[C]&127)<<1|ue[C+1]>>7];return C+=4,(s*n+(n>0?.5:-.5)>>0)/s}return C+=4,n;case 203:return n=Ce.getFloat64(C),C+=8,n;case 204:return ue[C++];case 205:return n=Ce.getUint16(C),C+=2,n;case 206:return n=Ce.getUint32(C),C+=4,n;case 207:return We.int64AsType==="number"?(n=Ce.getUint32(C)*4294967296,n+=Ce.getUint32(C+4)):We.int64AsType==="string"?n=Ce.getBigUint64(C).toString():We.int64AsType==="auto"?(n=Ce.getBigUint64(C),n<=BigInt(2)<=BigInt(-2)<=C?Ks.slice(C-Yn,(C+=n)-Yn):R8(n);case 218:return n=Ce.getUint16(C),C+=2,br>=C?Ks.slice(C-Yn,(C+=n)-Yn):A8(n);case 219:return n=Ce.getUint32(C),C+=4,br>=C?Ks.slice(C-Yn,(C+=n)-Yn):M8(n);case 220:return n=Ce.getUint16(C),C+=2,Sx(n);case 221:return n=Ce.getUint32(C),C+=4,Sx(n);case 222:return n=Ce.getUint16(C),C+=2,vx(n);case 223:return n=Ce.getUint32(C),C+=4,vx(n);default:if(e>=224)return e-256;if(e===void 0){let s=new Error("Unexpected end of MessagePack data");throw s.incomplete=!0,s}throw new Error("Unknown MessagePack token "+e)}}}const O8=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function wy(e,n){function s(){if(s.count++>y2){let u=e.read=new Function("r","return function(){return "+(We.freezeData?"Object.freeze":"")+"({"+e.map(o=>o==="__proto__"?"__proto_:r()":O8.test(o)?o+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"})}")(St);return e.highByte===0&&(e.read=yx(n,e.read)),u()}let i={};for(let u=0,o=e.length;ufunction(){let s=ue[C++];if(s===0)return n();let i=e<32?-(e+(s<<5)):e+(s<<5),u=ze[i]||S2()[i];if(!u)throw new Error("Record id is not defined for "+i);return u.read||(u.read=wy(u,e)),u.read()};function S2(){let e=E2(()=>(ue=null,We.getStructures()));return ze=We._mergeStructures(e,ze)}var Ug=Sl,R8=Sl,A8=Sl,M8=Sl;function Sl(e){let n;if(e<16&&(n=Ty(e)))return n;if(e>64&&kg)return kg.decode(ue.subarray(C,C+=e));const s=C+e,i=[];for(n="";C65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p)}else i.push(u);i.length>=4096&&(n+=Dt.apply(String,i),i.length=0)}return i.length>0&&(n+=Dt.apply(String,i)),n}function Sx(e){let n=new Array(e);for(let s=0;s0){C=n;return}s[i]=u}return Dt.apply(String,s)}function Ty(e){if(e<4)if(e<2){if(e===0)return"";{let n=ue[C++];if((n&128)>1){C-=1;return}return Dt(n)}}else{let n=ue[C++],s=ue[C++];if((n&128)>0||(s&128)>0){C-=2;return}if(e<3)return Dt(n,s);let i=ue[C++];if((i&128)>0){C-=3;return}return Dt(n,s,i)}else{let n=ue[C++],s=ue[C++],i=ue[C++],u=ue[C++];if((n&128)>0||(s&128)>0||(i&128)>0||(u&128)>0){C-=4;return}if(e<6){if(e===4)return Dt(n,s,i,u);{let o=ue[C++];if((o&128)>0){C-=5;return}return Dt(n,s,i,u,o)}}else if(e<8){let o=ue[C++],d=ue[C++];if((o&128)>0||(d&128)>0){C-=6;return}if(e<7)return Dt(n,s,i,u,o,d);let h=ue[C++];if((h&128)>0){C-=7;return}return Dt(n,s,i,u,o,d,h)}else{let o=ue[C++],d=ue[C++],h=ue[C++],p=ue[C++];if((o&128)>0||(d&128)>0||(h&128)>0||(p&128)>0){C-=8;return}if(e<10){if(e===8)return Dt(n,s,i,u,o,d,h,p);{let m=ue[C++];if((m&128)>0){C-=9;return}return Dt(n,s,i,u,o,d,h,p,m)}}else if(e<12){let m=ue[C++],y=ue[C++];if((m&128)>0||(y&128)>0){C-=10;return}if(e<11)return Dt(n,s,i,u,o,d,h,p,m,y);let S=ue[C++];if((S&128)>0){C-=11;return}return Dt(n,s,i,u,o,d,h,p,m,y,S)}else{let m=ue[C++],y=ue[C++],S=ue[C++],v=ue[C++];if((m&128)>0||(y&128)>0||(S&128)>0||(v&128)>0){C-=12;return}if(e<14){if(e===12)return Dt(n,s,i,u,o,d,h,p,m,y,S,v);{let _=ue[C++];if((_&128)>0){C-=13;return}return Dt(n,s,i,u,o,d,h,p,m,y,S,v,_)}}else{let _=ue[C++],x=ue[C++];if((_&128)>0||(x&128)>0){C-=14;return}if(e<15)return Dt(n,s,i,u,o,d,h,p,m,y,S,v,_,x);let T=ue[C++];if((T&128)>0){C-=15;return}return Dt(n,s,i,u,o,d,h,p,m,y,S,v,_,x,T)}}}}}function bx(){let e=ue[C++],n;if(e<192)n=e-160;else switch(e){case 217:n=ue[C++];break;case 218:n=Ce.getUint16(C),C+=2;break;case 219:n=Ce.getUint32(C),C+=4;break;default:throw new Error("Expected string")}return Sl(n)}function Np(e){return We.copyBuffers?Uint8Array.prototype.slice.call(ue,C,C+=e):ue.subarray(C,C+=e)}function Ra(e){let n=ue[C++];if(yn[n]){let s;return yn[n](ue.subarray(C,s=C+=e),i=>{C=i;try{return St()}finally{C=s}})}else throw new Error("Unknown extension type "+n)}var _x=new Array(4096);function b2(){let e=ue[C++];if(e>=160&&e<192){if(e=e-160,br>=C)return Ks.slice(C-Yn,(C+=e)-Yn);if(!(br==0&&wr<180))return Ug(e)}else return C--,_2(St());let n=(e<<5^(e>1?Ce.getUint16(C):e>0?ue[C]:0))&4095,s=_x[n],i=C,u=C+e-3,o,d=0;if(s&&s.bytes==e){for(;i["string","number","boolean","bigint"].includes(typeof n)))return e.flat().toString();throw new Error(`Invalid property type for record: ${typeof e}`)}const xx=(e,n)=>{let s=St().map(_2),i=e;n!==void 0&&(e=e<32?-((n<<5)+e):(n<<5)+e,s.highByte=n);let u=ze[e];return u&&(u.isShared||Zs)&&((ze.restoreStructures||(ze.restoreStructures=[]))[e]=u),ze[e]=s,s.read=wy(s,i),s.read()};yn[0]=()=>{};yn[0].noBuffer=!0;yn[66]=e=>{let n=e.byteLength%8||8,s=BigInt(e[0]&128?e[0]-256:e[0]);for(let i=1;i{let h=d-o;if(h<=40){let S=i.getBigUint64(o);for(let v=o+8;v>4<<3),m=u(o,p),y=u(p,d);return m<{let e=St();if(!Ex[e[0]]){let n=Error(e[1],{cause:e[2]});return n.name=e[0],n}return Ex[e[0]](e[1],{cause:e[2]})};yn[105]=e=>{if(We.structuredClone===!1)throw new Error("Structured clone extension is disabled");let n=Ce.getUint32(C-4);is||(is=new Map);let s=ue[C],i;s>=144&&s<160||s==220||s==221?i=[]:s>=128&&s<144||s==222||s==223?i=new Map:(s>=199&&s<=201||s>=212&&s<=216)&&ue[C+1]===115?i=new Set:i={};let u={target:i};is.set(n,u);let o=St();if(u.used)Object.assign(i,o);else return u.target=o;if(i instanceof Map)for(let[d,h]of o.entries())i.set(d,h);if(i instanceof Set)for(let d of Array.from(o))i.add(d);return i};yn[112]=e=>{if(We.structuredClone===!1)throw new Error("Structured clone extension is disabled");let n=Ce.getUint32(C-4),s=is.get(n);return s.used=!0,s.target};yn[115]=()=>new Set(St());const x2=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(e=>e+"Array");let C8=typeof globalThis=="object"?globalThis:window;yn[116]=e=>{let n=e[0],s=Uint8Array.prototype.slice.call(e,1).buffer,i=x2[n];if(!i){if(n===16)return s;if(n===17)return new DataView(s);throw new Error("Could not find typed array for code "+n)}return new C8[i](s)};yn[120]=()=>{let e=St();return new RegExp(e[0],e[1])};const k8=[];yn[98]=e=>{let n=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],s=C;return C+=n-e.length,jt=k8,jt=[bx(),bx()],jt.position0=0,jt.position1=0,jt.postBundlePosition=C,C=s,St()};yn[255]=e=>e.length==4?new Date((e[0]*16777216+(e[1]<<16)+(e[2]<<8)+e[3])*1e3):e.length==8?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+((e[3]&3)*4294967296+e[4]*16777216+(e[5]<<16)+(e[6]<<8)+e[7])*1e3):e.length==12?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+((e[4]&128?-281474976710656:0)+e[6]*1099511627776+e[7]*4294967296+e[8]*16777216+(e[9]<<16)+(e[10]<<8)+e[11])*1e3):new Date("invalid");function E2(e){let n=wr,s=C,i=Yn,u=br,o=Ks,d=is,h=jt,p=new Uint8Array(ue.slice(0,wr)),m=ze,y=ze.slice(0,ze.length),S=We,v=Zs,_=e();return wr=n,C=s,Yn=i,br=u,Ks=o,is=d,jt=h,ue=p,Zs=v,ze=m,ze.splice(0,ze.length,...y),We=S,Ce=new DataView(ue.buffer,ue.byteOffset,ue.byteLength),_}function zg(){ue=null,is=null,ze=null}const Oy=new Array(147);for(let e=0;e<256;e++)Oy[e]=+("1e"+Math.floor(45.15-e*.30103));var Ld=new Qu({useRecords:!1});Ld.unpack;Ld.unpackMultiple;Ld.unpack;let U8=new Float32Array(1);new Uint8Array(U8.buffer,0,4);let lf;try{lf=new TextEncoder}catch{}let Ng,Dg;const ic=typeof Buffer<"u",Po=ic?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,w2=ic?Buffer:Uint8Array,wx=ic?4294967296:2144337920;let $,mu,Pe,U=0,Zt,ut=null,z8;const N8=21760,D8=/[\u0080-\uFFFF]/,qi=Symbol("record-id");class L8 extends Qu{constructor(n){super(n),this.offset=0;let s,i,u,o,d=w2.prototype.utf8Write?function(A,Q){return $.utf8Write(A,Q,$.byteLength-Q)}:lf&&lf.encodeInto?function(A,Q){return lf.encodeInto(A,$.subarray(Q)).written}:!1,h=this;n||(n={});let p=n&&n.sequential,m=n.structures||n.saveStructures,y=n.maxSharedStructures;if(y==null&&(y=m?32:0),y>8160)throw new Error("Maximum maxSharedStructure is 8160");n.structuredClone&&n.moreTypes==null&&(this.moreTypes=!0);let S=n.maxOwnStructures;S==null&&(S=m?32:64),!this.structures&&n.useRecords!=!1&&(this.structures=[]);let v=y>32||S+y>64,_=y+64,x=y+S+64;if(x>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let T=[],j=0,B=0;this.pack=this.encode=function(A,Q){if($||($=new Po(8192),Pe=$.dataView||($.dataView=new DataView($.buffer,0,8192)),U=0),Zt=$.length-10,Zt-U<2048?($=new Po($.length),Pe=$.dataView||($.dataView=new DataView($.buffer,0,$.length)),Zt=$.length-10,U=0):U=U+7&2147483640,s=U,Q&H8&&(U+=Q&255),o=h.structuredClone?new Map:null,h.bundleStrings&&typeof A!="string"?(ut=[],ut.size=1/0):ut=null,u=h.structures,u){u.uninitialized&&(u=h._mergeStructures(h.getStructures()));let O=u.sharedLength||0;if(O>y)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+u.sharedLength);if(!u.transitions){u.transitions=Object.create(null);for(let N=0;NA instanceof N)?ie(A.toJSON?A.toJSON():A):z(A):z(A);let O=ut;if(ut&&Ox(s,z,0),o&&o.idsToInsert){let N=o.idsToInsert.sort((w,G)=>w.offset>G.offset?1:-1),ne=N.length,ce=-1;for(;O&&ne>0;){let w=N[--ne].offset+s;wO.position+s?ce>=0&&(ce+=6):(ce>=0&&(Pe.setUint32(O.position+s,Pe.getUint32(O.position+s)+ce),ce=-1),O=O.previous,ne++)}ce>=0&&O&&Pe.setUint32(O.position+s,Pe.getUint32(O.position+s)+ce),U+=N.length*6,U>Zt&&te(U),h.offset=U;let se=j8($.subarray(s,U),N);return o=null,se}return h.offset=U,Q&q8?($.start=s,$.end=U,$):$.subarray(s,U)}catch(O){throw Z=O,O}finally{if(u&&(M(),i&&h.saveStructures)){let O=u.sharedLength||0,N=$.subarray(s,U),ne=B8(u,h);if(!Z)return h.saveStructures(ne,ne.isCompatible)===!1?h.pack(A,Q):(h.lastNamedStructuresLength=O,$.length>1073741824&&($=null),N)}$.length>1073741824&&($=null),Q&$8&&(U=s)}};const M=()=>{B<10&&B++;let A=u.sharedLength||0;if(u.length>A&&!p&&(u.length=A),j>1e4)u.transitions=null,B=0,j=0,T.length>0&&(T=[]);else if(T.length>0&&!p){for(let Q=0,Z=T.length;Q{var Q=A.length;Q<16?$[U++]=144|Q:Q<65536?($[U++]=220,$[U++]=Q>>8,$[U++]=Q&255):($[U++]=221,Pe.setUint32(U,Q),U+=4);for(let Z=0;Z{U>Zt&&($=te(U));var Q=typeof A,Z;if(Q==="string"){let O=A.length;if(ut&&O>=4&&O<4096){if((ut.size+=O)>N8){let se,w=(ut[0]?ut[0].length*3+ut[1].length:0)+10;U+w>Zt&&($=te(U+w));let G;ut.position?(G=ut,$[U]=200,U+=3,$[U++]=98,se=U-s,U+=4,Ox(s,z,0),Pe.setUint16(se+s-3,U-s-se)):($[U++]=214,$[U++]=98,se=U-s,U+=4),ut=["",""],ut.previous=G,ut.size=0,ut.position=se}let ce=D8.test(A);ut[ce?0:1]+=A,$[U++]=193,z(ce?-O:O);return}let N;O<32?N=1:O<256?N=2:O<65536?N=3:N=5;let ne=O*3;if(U+ne>Zt&&($=te(U+ne)),O<64||!d){let ce,se,w,G=U+N;for(ce=0;ce>6|192,$[G++]=se&63|128):(se&64512)===55296&&((w=A.charCodeAt(ce+1))&64512)===56320?(se=65536+((se&1023)<<10)+(w&1023),ce++,$[G++]=se>>18|240,$[G++]=se>>12&63|128,$[G++]=se>>6&63|128,$[G++]=se&63|128):($[G++]=se>>12|224,$[G++]=se>>6&63|128,$[G++]=se&63|128);Z=G-U-N}else Z=d(A,U+N);Z<32?$[U++]=160|Z:Z<256?(N<2&&$.copyWithin(U+2,U+1,U+1+Z),$[U++]=217,$[U++]=Z):Z<65536?(N<3&&$.copyWithin(U+3,U+2,U+2+Z),$[U++]=218,$[U++]=Z>>8,$[U++]=Z&255):(N<5&&$.copyWithin(U+5,U+3,U+3+Z),$[U++]=219,Pe.setUint32(U,Z),U+=4),U+=Z}else if(Q==="number")if(A>>>0===A)A<32||A<128&&this.useRecords===!1||A<64&&!this.randomAccessStructure?$[U++]=A:A<256?($[U++]=204,$[U++]=A):A<65536?($[U++]=205,$[U++]=A>>8,$[U++]=A&255):($[U++]=206,Pe.setUint32(U,A),U+=4);else if(A>>0===A)A>=-32?$[U++]=256+A:A>=-128?($[U++]=208,$[U++]=A+256):A>=-32768?($[U++]=209,Pe.setInt16(U,A),U+=2):($[U++]=210,Pe.setInt32(U,A),U+=4);else{let O;if((O=this.useFloat32)>0&&A<4294967296&&A>=-2147483648){$[U++]=202,Pe.setFloat32(U,A);let N;if(O<4||(N=A*Oy[($[U]&127)<<1|$[U+1]>>7])>>0===N){U+=4;return}else U--}$[U++]=203,Pe.setFloat64(U,A),U+=8}else if(Q==="object"||Q==="function")if(!A)$[U++]=192;else{if(o){let N=o.get(A);if(N){if(!N.id){let ne=o.idsToInsert||(o.idsToInsert=[]);N.id=ne.push(N)}$[U++]=214,$[U++]=112,Pe.setUint32(U,N.id),U+=4;return}else o.set(A,{offset:U-s})}let O=A.constructor;if(O===Object)Y(A);else if(O===Array)I(A);else if(O===Map)if(this.mapAsEmptyObject)$[U++]=128;else{Z=A.size,Z<16?$[U++]=128|Z:Z<65536?($[U++]=222,$[U++]=Z>>8,$[U++]=Z&255):($[U++]=223,Pe.setUint32(U,Z),U+=4);for(let[N,ne]of A)z(N),z(ne)}else{for(let N=0,ne=Ng.length;N($=w,w=null,U+=he,U>Zt&&te(U),{target:$,targetView:Pe,position:U-he}),z)}finally{w&&($=w,Pe=G,U=re,Zt=$.length-10)}ae&&(ae.length+U>Zt&&te(ae.length+U),U=Tx(ae,$,U,se.type));return}}if(Array.isArray(A))I(A);else{if(A.toJSON){const N=A.toJSON();if(N!==A)return z(N)}if(Q==="function")return z(this.writeFunction&&this.writeFunction(A));Y(A)}}}else if(Q==="boolean")$[U++]=A?195:194;else if(Q==="bigint"){if(A<9223372036854776e3&&A>=-9223372036854776e3)$[U++]=211,Pe.setBigInt64(U,A);else if(A<18446744073709552e3&&A>0)$[U++]=207,Pe.setBigUint64(U,A);else if(this.largeBigIntToFloat)$[U++]=203,Pe.setFloat64(U,Number(A));else{if(this.largeBigIntToString)return z(A.toString());if(this.useBigIntExtension||this.moreTypes){let O=A<0?BigInt(-1):BigInt(0),N;if(A>>BigInt(65536)===O){let ne=BigInt(18446744073709552e3)-BigInt(1),ce=[];for(;ce.push(A&ne),A>>BigInt(63)!==O;)A>>=BigInt(64);N=new Uint8Array(new BigUint64Array(ce).buffer),N.reverse()}else{let ne=A<0,ce=(ne?~A:A).toString(16);if(ce.length%2?ce="0"+ce:parseInt(ce.charAt(0),16)>=8&&(ce="00"+ce),ic)N=Buffer.from(ce,"hex");else{N=new Uint8Array(ce.length/2);for(let se=0;seZt&&te(N.length+U),U=Tx(N,$,U,66);return}else throw new RangeError(A+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string")}U+=8}else if(Q==="undefined")this.encodeUndefinedAsNil?$[U++]=192:($[U++]=212,$[U++]=0,$[U++]=0);else throw new Error("Unknown type: "+Q)},W=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?A=>{let Q;if(this.skipValues){Q=[];for(let N in A)(typeof A.hasOwnProperty!="function"||A.hasOwnProperty(N))&&!this.skipValues.includes(A[N])&&Q.push(N)}else Q=Object.keys(A);let Z=Q.length;Z<16?$[U++]=128|Z:Z<65536?($[U++]=222,$[U++]=Z>>8,$[U++]=Z&255):($[U++]=223,Pe.setUint32(U,Z),U+=4);let O;if(this.coercibleKeyAsNumber)for(let N=0;N{$[U++]=222;let Q=U-s;U+=2;let Z=0;for(let O in A)(typeof A.hasOwnProperty!="function"||A.hasOwnProperty(O))&&(z(O),z(A[O]),Z++);if(Z>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');$[Q+++s]=Z>>8,$[Q+s]=Z&255},H=this.useRecords===!1?W:n.progressiveRecords&&!v?A=>{let Q,Z=u.transitions||(u.transitions=Object.create(null)),O=U++-s,N;for(let ne in A)if(typeof A.hasOwnProperty!="function"||A.hasOwnProperty(ne)){if(Q=Z[ne],Q)Z=Q;else{let ce=Object.keys(A),se=Z;Z=u.transitions;let w=0;for(let G=0,re=ce.length;G{let Q,Z=u.transitions||(u.transitions=Object.create(null)),O=0;for(let ne in A)(typeof A.hasOwnProperty!="function"||A.hasOwnProperty(ne))&&(Q=Z[ne],Q||(Q=Z[ne]=Object.create(null),O++),Z=Q);let N=Z[qi];N?N>=96&&v?($[U++]=((N-=96)&31)+96,$[U++]=N>>5):$[U++]=N:fe(Z,Z.__keys__||Object.keys(A),O);for(let ne in A)(typeof A.hasOwnProperty!="function"||A.hasOwnProperty(ne))&&z(A[ne])},V=typeof this.useRecords=="function"&&this.useRecords,Y=V?A=>{V(A)?H(A):W(A)}:H,te=A=>{let Q;if(A>16777216){if(A-s>wx)throw new Error("Packed buffer would be larger than maximum buffer size");Q=Math.min(wx,Math.round(Math.max((A-s)*(A>67108864?1.25:2),4194304)/4096)*4096)}else Q=(Math.max(A-s<<2,$.length-1)>>12)+1<<12;let Z=new Po(Q);return Pe=Z.dataView||(Z.dataView=new DataView(Z.buffer,0,Q)),A=Math.min(A,$.length),$.copy?$.copy(Z,0,s,A):Z.set($.slice(s,A)),U-=s,s=0,Zt=Z.length-10,$=Z},fe=(A,Q,Z)=>{let O=u.nextId;O||(O=64),O<_&&this.shouldShareStructure&&!this.shouldShareStructure(Q)?(O=u.nextOwnId,O=x&&(O=_),u.nextId=O+1);let N=Q.highByte=O>=96&&v?O-96>>5:-1;A[qi]=O,A.__keys__=Q,u[O-64]=Q,O<_?(Q.isShared=!0,u.sharedLength=O-63,i=!0,N>=0?($[U++]=(O&31)+96,$[U++]=N):$[U++]=O):(N>=0?($[U++]=213,$[U++]=114,$[U++]=(O&31)+96,$[U++]=N):($[U++]=212,$[U++]=114,$[U++]=O),Z&&(j+=B*Z),T.length>=S&&(T.shift()[qi]=0),T.push(A),z(Q))},oe=(A,Q,Z,O)=>{let N=$,ne=U,ce=Zt,se=s;$=mu,U=0,s=0,$||(mu=$=new Po(8192)),Zt=$.length-10,fe(A,Q,O),mu=$;let w=U;if($=N,U=ne,Zt=ce,s=se,w>1){let G=U+w-1;G>Zt&&te(G);let re=Z+s;$.copyWithin(re+w,re+1,U),$.set(mu.slice(0,w),re),U=G}else $[Z+s]=mu[0]},ie=A=>{let Q=z8(A,$,s,U,u,te,(Z,O,N)=>{if(N)return i=!0;U=O;let ne=$;return z(Z),M(),ne!==$?{position:U,targetView:Pe,target:$}:U},this);if(Q===0)return Y(A);U=Q}}useBuffer(n){$=n,$.dataView||($.dataView=new DataView($.buffer,$.byteOffset,$.byteLength)),Pe=$.dataView,U=0}set position(n){U=n}get position(){return U}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}Dg=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,p2];Ng=[{pack(e,n,s){let i=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&i>=0&&i<4294967296){let{target:u,targetView:o,position:d}=n(6);u[d++]=214,u[d++]=255,o.setUint32(d,i)}else if(i>0&&i<4294967296){let{target:u,targetView:o,position:d}=n(10);u[d++]=215,u[d++]=255,o.setUint32(d,e.getMilliseconds()*4e6+(i/1e3/4294967296>>0)),o.setUint32(d+4,i)}else if(isNaN(i)){if(this.onInvalidDate)return n(0),s(this.onInvalidDate());let{target:u,targetView:o,position:d}=n(3);u[d++]=212,u[d++]=255,u[d++]=255}else{let{target:u,targetView:o,position:d}=n(15);u[d++]=199,u[d++]=12,u[d++]=255,o.setUint32(d,e.getMilliseconds()*1e6),o.setBigInt64(d+4,BigInt(Math.floor(i)))}}},{pack(e,n,s){if(this.setAsEmptyObject)return n(0),s({});let i=Array.from(e),{target:u,position:o}=n(this.moreTypes?3:0);this.moreTypes&&(u[o++]=212,u[o++]=115,u[o++]=0),s(i)}},{pack(e,n,s){let{target:i,position:u}=n(this.moreTypes?3:0);this.moreTypes&&(i[u++]=212,i[u++]=101,i[u++]=0),s([e.name,e.message,e.cause])}},{pack(e,n,s){let{target:i,position:u}=n(this.moreTypes?3:0);this.moreTypes&&(i[u++]=212,i[u++]=120,i[u++]=0),s([e.source,e.flags])}},{pack(e,n){this.moreTypes?Dp(e,16,n):Lp(ic?Buffer.from(e):new Uint8Array(e),n)}},{pack(e,n){let s=e.constructor;s!==w2&&this.moreTypes?Dp(e,x2.indexOf(s.name),n):Lp(e,n)}},{pack(e,n){this.moreTypes?Dp(e,17,n):Lp(ic?Buffer.from(e):new Uint8Array(e),n)}},{pack(e,n){let{target:s,position:i}=n(1);s[i]=193}}];function Dp(e,n,s,i){let u=e.byteLength;if(u+1<256){var{target:o,position:d}=s(4+u);o[d++]=199,o[d++]=u+1}else if(u+1<65536){var{target:o,position:d}=s(5+u);o[d++]=200,o[d++]=u+1>>8,o[d++]=u+1&255}else{var{target:o,position:d,targetView:h}=s(7+u);o[d++]=201,h.setUint32(d,u+1),d+=4}o[d++]=116,o[d++]=n,e.buffer||(e=new Uint8Array(e)),o.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),d)}function Lp(e,n){let s=e.byteLength;var i,u;if(s<256){var{target:i,position:u}=n(s+2);i[u++]=196,i[u++]=s}else if(s<65536){var{target:i,position:u}=n(s+3);i[u++]=197,i[u++]=s>>8,i[u++]=s&255}else{var{target:i,position:u,targetView:o}=n(s+5);i[u++]=198,o.setUint32(u,s),u+=4}i.set(e,u)}function Tx(e,n,s,i){let u=e.length;switch(u){case 1:n[s++]=212;break;case 2:n[s++]=213;break;case 4:n[s++]=214;break;case 8:n[s++]=215;break;case 16:n[s++]=216;break;default:u<256?(n[s++]=199,n[s++]=u):u<65536?(n[s++]=200,n[s++]=u>>8,n[s++]=u&255):(n[s++]=201,n[s++]=u>>24,n[s++]=u>>16&255,n[s++]=u>>8&255,n[s++]=u&255)}return n[s++]=i,n.set(e,s),s+=u,s}function j8(e,n){let s,i=n.length*6,u=e.length-i;for(;s=n.pop();){let o=s.offset,d=s.id;e.copyWithin(o+i,o,u),i-=6;let h=o+i;e[h++]=214,e[h++]=105,e[h++]=d>>24,e[h++]=d>>16&255,e[h++]=d>>8&255,e[h++]=d&255,u=o}return e}function Ox(e,n,s){if(ut.length>0){Pe.setUint32(ut.position+e,U+s-ut.position-e),ut.stringsPosition=U-e;let i=ut;ut=null,n(i[0]),n(i[1])}}function B8(e,n){return e.isCompatible=s=>{let i=!s||(n.lastNamedStructuresLength||0)===s.length;return i||n._mergeStructures(s),i},e}let T2=new L8({useRecords:!1});T2.pack;T2.pack;const q8=512,$8=1024,H8=2048;class Ry extends Sn()("effect/rpc/RpcSerialization"){}const V8=Ry.of({contentType:"application/json",includesFraming:!1,makeUnsafe:()=>{const e=new TextDecoder;return{decode:n=>[JSON.parse(typeof n=="string"?n:e.decode(n))],encode:n=>JSON.stringify(n)}}}),I8=sw(Ry)(V8),Y8=()=>e=>dr(()=>{const n=L0(1);let s=[],i=(...u)=>xd(o=>(s.push([u,o]),rt));return Un(e((...u)=>i(...u)),u=>({...u,run(o){return n.withPermits(1)(vf(function*(){const d=i;i=o;for(const[h,p]of s)yield*gw(i(...h),p);return s=[],yield*w0(pu,()=>(i=d,rt))}))}}))});let G8=BigInt(0);const F8=cr(function*(e,n){const s=n?.spanPrefix??"RpcClient",i=n?.supportsAck??!0,u=n?.disableTracing??!1,o=n?.generateRequestId??(()=>G8++),d=yield*qa(),h=Kn(d,Wi),p=new Map;let m=!1;yield*Bu(h,bf(M=>(m=!0,y(Gk(M.id)))));const y=cr(function*(M){for(const[I,z]of p)p.delete(I),z._tag==="Queue"?yield*M._tag==="Success"?c_(z.queue):ts(z.queue,M.cause):z.resume(M)}),S=M=>{const I=Ey(M.successSchema),z=x(M);return(W,H)=>{const V=H?.headers?u2(H.headers):by,Y=H?.context??Qn();if(!I){const fe=oe=>v(M,z,oe,M.payloadSchema.makeUnsafe(W),V,Y,H?.discard??!1);return u?fe(void 0):H4(`${s}.${M._tag}`,{attributes:n.spanAttributes},fe)}const te=_(M,z,M.payloadSchema.makeUnsafe(W),V,H?.streamBufferSize??16,Y);return H?.asQueue?te:ty(Un(te,wT))}},v=(M,I,z,W,H,V,Y)=>bf(te=>{if(m)return Hu;const fe=o(),oe=I(A=>n.onFromClient({message:A,context:V,discard:Y}),{_tag:"Request",id:fe,tag:M._tag,payload:W,...z?{traceId:z.traceId,spanId:z.spanId,sampled:z.sampled}:{},headers:ox(te.getRef(Ax),H)});if(Y)return oe;let ie;return O0($u(A=>{const Q={_tag:"Effect",rpc:M,context:V,resume(Z){A(Z),ie&&!ie.pollUnsafe()&&te.currentScheduler.scheduleTask(()=>{ie.interruptUnsafe(te.id)},0)}};p.set(fe,Q),ie=oe.pipe(z?s_(z,{captureStackTrace:!1}):_e,$a(te.services)),ie.addObserver(Z=>{if(Z._tag==="Failure")return A(Z)})}),A=>(p.delete(fe),_0(W4(ie),T(fe,Array.from(A),V))))}),_=cr(function*(M,I,z,W,H,V){if(m)return yield*Hu;const Y=u?void 0:yield*$4(`${s}.${M._tag}`,{attributes:n.spanAttributes}),te=Ef(),fe=o(),oe=id(te.services,Wi);yield*nw(oe,A=>p.has(fe)?(p.delete(fe),T(fe,tw(A)?Array.from(Vk(A.cause)):[],V)):rt);const ie=yield*sg(H);return p.set(fe,{_tag:"Queue",rpc:M,queue:ie,scope:oe,context:V}),yield*I(A=>n.onFromClient({message:A,context:V,discard:!1}),{_tag:"Request",id:fe,tag:M._tag,payload:z,...Y?{traceId:Y.traceId,spanId:Y.spanId,sampled:Y.sampled}:{},headers:ox(te.getRef(Ax),W)}).pipe(Y?s_(Y,{captureStackTrace:!1}):_e,as(A=>ts(ie,A)),T0,Eu(oe,{startImmediately:!0})),ie}),x=M=>{const I=[];for(const z of M.middlewares.values()){const W=d.mapUnsafe.get(`${z.key}/Client`);W&&I.push(W)}return I.length===0?(z,W)=>z(W):function z(W,H,V=I.length-1){return V===-1?W(H):I[V]({rpc:M,request:H,next(Y){return z(W,Y,V-1)}})}},T=(M,I,z)=>$u(W=>{const H=Ef();n.onFromClient({message:{_tag:"Interrupt",requestId:M,interruptors:I},context:z,discard:!1}).pipe(U4(1e3),$a(H.services)).addObserver(()=>{W(rt)})}),j=M=>{switch(M._tag){case"Chunk":{const I=M.requestId,z=p.get(I);return!z||z._tag!=="Queue"?rt:xU(z.queue,M.values).pipe(i?Xe(()=>n.onFromClient({message:{_tag:"Ack",requestId:M.requestId},context:z.context,discard:!1})):_e,as(W=>ts(z.queue,W)))}case"Exit":{const I=M.requestId,z=p.get(I);return z?(p.delete(I),z._tag==="Effect"?(z.resume(M.exit),rt):M.exit._tag==="Success"?c_(z.queue):ts(z.queue,M.exit.cause)):rt}case"Defect":return y(Yk(M.defect));case"ClientEnd":return rt}};let B;if(n.flatten){const M=new Map;B=function(z,W,H){let V=M.get(z);return V||(V=S(e.requests.get(z)),M.set(z,V)),V(W,H)}}else B={},e.requests.forEach(M=>{B[M._tag]=S(M)});return{client:B,write:j}}),K8=cr(function*(e,n){const{run:s,send:i,supportsAck:u,supportsTransferables:o}=yield*Ay,d=new Map,{client:h,write:p}=yield*F8(e,{...n,supportsAck:u,onFromClient({message:m}){switch(m._tag){case"Request":{const y=e.requests.get(m.tag),S=o?f8():void 0,v=Ef(),_={rpc:y,context:S?ds(v.services,h2,S):v.services,schemas:P8(y)};return d.set(m.id,_),_.schemas.encodePayload(m.payload).pipe(Yi(_.context),Jo,Xe(x=>i({...m,id:String(m.id),payload:x,headers:Object.entries(m.headers)},S&&S.readUnsafe())))}case"Ack":return d.get(m.requestId)?i({_tag:"Ack",requestId:String(m.requestId)}):rt;case"Interrupt":return d.get(m.requestId)?(d.delete(m.requestId),i({_tag:"Interrupt",requestId:String(m.requestId)})):rt;case"Eof":return rt}}});return yield*s(m=>{switch(m._tag){case"Chunk":{const y=Fo(m.requestId),S=d.get(y);return!S||!S.schemas.decodeChunk?rt:S.schemas.decodeChunk(m.values).pipe(Yi(S.context),Jo,Xe(v=>p({_tag:"Chunk",clientId:0,requestId:Fo(m.requestId),values:v})),rg(v=>p({_tag:"Exit",clientId:0,requestId:Fo(m.requestId),exit:rs(v)})))}case"Exit":{const y=Fo(m.requestId),S=d.get(y);return S?(d.delete(y),S.schemas.decodeExit(m.exit).pipe(Yi(S.context),Jo,x0({onSuccess:v=>p({_tag:"Exit",clientId:0,requestId:y,exit:v}),onFailure:v=>p({_tag:"Exit",clientId:0,requestId:y,exit:rs(v)})}))):rt}case"Defect":return p({_tag:"Defect",clientId:0,defect:W8(m.defect)});case"ClientProtocolError":{const y=WE(m.error);return dw(d.keys(),S=>p({_tag:"Exit",clientId:0,requestId:S,exit:y}))}default:return rt}}).pipe(as(P4),T0,R0),h}),Rx=new WeakMap,P8=e=>{let n=Rx.get(e);if(n!==void 0)return n;const s=m2(e.successSchema);return n={decodeChunk:s?E_(gp(RN(s.success))):void 0,encodePayload:wN(gp(e.payloadSchema)),decodeExit:E_(gp(_8(e)))},Rx.set(e,n),n},Ax=ft("effect/rpc/RpcClient/CurrentHeaders",{defaultValue:()=>by});class Ay extends Sn()("effect/rpc/RpcClient/Protocol"){static make=Y8()}const X8=e=>Ay.make(cr(function*(n){const s=yield*xy,i=yield*Ry,u=yield*s.writer;let o=i.makeUnsafe();const d=yield*J8(u(o.encode(w8)));let h;const p=Ut(()=>{h=void 0});return yield*dr(()=>(o=i.makeUnsafe(),d.reset(),s.runRaw(m=>{try{const y=o.decode(m);if(y.length===0)return;let S=0;return hw({while:()=>S{const v=y[S++];return v._tag==="Pong"&&d.onPong(),n(v)},step:cc})}catch(y){return n({_tag:"ClientProtocolError",error:new mx({reason:new Cg({message:"Error decoding message",cause:y})})})}},{onOpen:p}).pipe(pw(Xe(d.timeout,()=>ke(new Ki({reason:new Gf({kind:"Timeout",cause:new Error("ping timeout")})}))))))).pipe(Xe(()=>ke(new Ki({reason:new Ff({code:1e3})}))),M4(m=>{const y=xr(m),S=gM(y);return S&&y.success.reason._tag==="SocketOpenError"?rt:(h=new mx({reason:S?y.success.reason:new Cg({message:"Unknown socket error",cause:JE(m)})}),n({_tag:"ClientProtocolError",error:h}))}),C4(e?.retryPolicy??Q8),X4({module:"RpcClient",method:"makeProtocolSocket"}),R0),{send(m){if(h)return ke(h);const y=o.encode(m);return y===void 0?rt:Jo(u(y))},supportsAck:!0,supportsTransferables:!1}})),Q8=p4(500,1.5).pipe(h4(fw(5e3))),J8=cr(function*(e){let n=!0;const s=M0(),i=()=>{n=!0,s.closeUnsafe()},u=()=>{n=!0};return yield*dr(()=>n?(n=!1,e):s.open).pipe(N4("5 seconds"),k4,xu,T0,R0),{timeout:s.await,reset:i,onPong:u}}),Z8=e=>bd(Ay)(X8(e)),W8=xN(hr),ej=()=>(e,n)=>{const s=Sn()(e);s.layer=bd(s,n.makeEffect??K8(n.group,{...n,flatten:!0})).pipe(_u(n.protocol));const i=n.runtime??NT;s.runtime=i(s.layer),s.mutation=L_(o=>s.runtime.fn()(cr(function*({headers:d,payload:h,reactivityKeys:p}){const y=(yield*s)(o,h,{headers:d});return yield*p?CT(y,p):y})));const u=L_(({headers:o,payload:d,reactivityKeys:h,tag:p,timeToLive:m})=>{const y=n.group.requests.get(p);let S=Ey(y.successSchema)?s.runtime.pull(ty(s.use(v=>Ee(v(p,d,{headers:o}))))):s.runtime.atom(s.use(v=>v(p,d,{headers:o})));return m&&(S=uE(m)?kT(S,m):DT(S)),h?s.runtime.factory.withReactivity(h)(S):S});return s.query=(o,d,h)=>u({tag:o,payload:d,headers:h?.headers?u2(h.headers):void 0,reactivityKeys:h?.reactivityKeys,timeToLive:h?.timeToLive?Wu(h.timeToLive):void 0}),s},tj={add(...e){const n=new Map(this.requests);for(const s of e)n.set(s._tag,s);return Vs({requests:n,annotations:this.annotations})},merge(...e){const n=new Map(this.requests),s=new Map(this.annotations.mapUnsafe);for(const i of e){for(const[u,o]of i.requests)n.set(u,o);for(const[u,o]of i.annotations.mapUnsafe)s.set(u,o)}return Vs({requests:n,annotations:ir(s)})},middleware(e){const n=new Map;for(const[s,i]of this.requests)n.set(s,i.middleware(e));return Vs({requests:n,annotations:this.annotations})},toHandlers(e){const n=this;return vf(function*(){const s=yield*qa(),i=ss(e)?yield*e:e,u=new Map;for(const[o,d]of Object.entries(i)){const h=n.requests.get(o);u.set(h.key,{tag:h._tag,handler:d,services:s})}return ir(u)})},prefix(e){const n=new Map;for(const s of this.requests.values()){const i=s.prefix(e);n.set(i._tag,i)}return Vs({requests:n,annotations:this.annotations})},toLayer(e){return ng(this.toHandlers(e))},of:_e,toLayerHandler(e,n){const s=this;return ng(vf(function*(){const i=yield*qa(),u=ss(n)?yield*n:n,o=new Map,d=s.requests.get(e);return o.set(d.key,{handler:u,services:i}),ir(o)}))},accessHandler(e){return xd(n=>{const s=this.requests.get(e),{handler:i,services:u}=n.mapUnsafe.get(s.key);return Ee((o,d)=>{d.rpc=s;const h=i(o,d),p=E8(h)?h.value:h;return ss(p)?gw(p,u):QN(p,u)})})},annotate(e,n){return Vs({requests:this.requests,annotations:ds(this.annotations,e,n)})},annotateRpcs(e,n){return this.annotateRpcsMerge(Qi(e,n))},annotateMerge(e){return Vs({requests:this.requests,annotations:Ba(this.annotations,e)})},annotateRpcsMerge(e){const n=new Map;for(const[s,i]of this.requests)n.set(s,i.annotateMerge(Ba(e,i.annotations)));return Vs({requests:n,annotations:this.annotations})}},Vs=e=>Object.assign(function(){},tj,{requests:e.requests,annotations:e.annotations}),nj=(...e)=>Vs({requests:new Map(e.map(n=>[n._tag,n])),annotations:Qn()}),rj=Qe({text:vt}),sj=Qe({text:vt}),aj=Qe({left:cs,right:cs}),ij=Qe({total:cs}),cj=Qe({iso:vt}),O2=Qe({id:vt,title:vt,completed:ea,archived:ea,revision:cs,updatedAt:vt}),uj=lr([Qe({_tag:Fn("TodoCreated")}),Qe({_tag:Fn("TodoRenamed"),title:vt}),Qe({_tag:Fn("TodoCompleted"),completed:ea}),Qe({_tag:Fn("TodoArchived"),archived:ea})]),jd=Qe({offset:cs,at:vt,todo:O2,change:uj}),lj=Qe({offset:cs,todos:pg(O2)}),oj=ia("echo",{payload:rj,success:sj}),fj=ia("sum",{payload:aj,success:ij}),dj=ia("time",{success:cj}),hj=ia("listTodos",{payload:Qe({includeArchived:ea}),success:lj}),mj=ia("renameTodo",{payload:Qe({id:vt,title:vt}),success:jd}),pj=ia("completeTodo",{payload:Qe({id:vt,completed:ea}),success:jd}),gj=ia("archiveTodo",{payload:Qe({id:vt,archived:ea}),success:jd}),yj=ia("subscribeTodos",{payload:Qe({fromOffset:cs,includeArchived:ea}),success:jd,stream:!0}),Sj=nj(oj,fj,dj,hj,mj,pj,gj,yj),vj=()=>`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`,bj=Z8({}).pipe(_u(o8(vj())),_u(c8),_u(I8));class vl extends ej()("TodoRpcClient",{group:Sj,protocol:bj}){}const _j=vl.query("listTodos",{includeArchived:!0}),jp=vl.query("subscribeTodos",{fromOffset:0,includeArchived:!0}),xj=vl.mutation("renameTodo"),Ej=vl.mutation("completeTodo"),wj=vl.mutation("archiveTodo"),Lg=yl({todos:[],titleDrafts:{},lastOffset:0}).pipe(Cd("todo-projection")),R2=yl([]).pipe(Cd("events")),Bd=yl({subscriptionState:"idle",lastError:null}).pipe(Cd("connection")),A2=yl(null).pipe(Cd("mutation-busy")),Tj=1250,Oj=2e4,Rj=8,Aj=Rg("/")({component:Mj});function Mj(){const e=Wr(Lg),n=Wr(R2),s=Wr(Bd),i=Wr(A2),u=ta(_j),o=ta(jp),d=Wr(jp),h=H6(jp),p=le.useRef(new Set),m=le.useRef(0),y=le.useRef(!1),S=le.useRef(!1),v=le.useRef(!1),_=le.useRef(0),x=le.useRef(null),T=()=>{x.current!==null&&(clearTimeout(x.current),x.current=null)},j=()=>{T(),S.current||(S.current=!0),s(H=>({...H,subscriptionState:"connecting"})),h(),d(void 0)},B=H=>{if(v.current=!0,_.current+=1,_.current>Rj){s(Y=>({...Y,lastError:H,subscriptionState:"idle"}));return}const V=Math.min(Tj*2**Math.max(0,_.current-1),Oj);s(Y=>({...Y,lastError:H,subscriptionState:"connecting"})),T(),x.current=setTimeout(()=>{x.current=null,j()},V)},M=H=>H.offset<=m.current||p.current.has(H.offset)?!1:(p.current.add(H.offset),n(V=>[...V,H]),!0),I=H=>{e(V=>({...V,lastOffset:Math.max(V.lastOffset,H.offset),todos:Mx(V.todos.some(Y=>Y.id===H.todo.id)?V.todos.map(Y=>Y.id===H.todo.id?H.todo:Y):[...V.todos,H.todo]),titleDrafts:{...V.titleDrafts,[H.todo.id]:H.todo.title}}))},z=H=>{M(H)&&I(H)};le.useEffect(()=>{if(k_(u))return;if(gg(u)){B(dp(u.cause));return}const H=u.value;e({todos:Mx(H.todos),lastOffset:H.offset,titleDrafts:Object.fromEntries(H.todos.map(V=>[V.id,V.title]))}),y.current||(y.current=!0,m.current=H.offset,p.current=new Set,n([]),j())},[u,n,e]),le.useEffect(()=>{if(S.current){if(k_(o)){s(H=>({...H,subscriptionState:o.waiting?"connected":"connecting"}));return}if(gg(o)){B(dp(o.cause));return}_.current=0,v.current=!1,s(H=>({...H,lastError:null,subscriptionState:"connected"}));for(const H of o.value.items)z(H);!o.value.done&&!o.waiting&&d(void 0)}},[d,s,o]),le.useEffect(()=>{const H=()=>{document.visibilityState==="visible"&&v.current&&(_.current=0,j())};return window.addEventListener("focus",H),document.addEventListener("visibilitychange",H),()=>{window.removeEventListener("focus",H),document.removeEventListener("visibilitychange",H)}},[s]),le.useEffect(()=>()=>{T()},[]);const W=(H,V,Y)=>{i(H),s(te=>({...te,lastError:null})),V().then(te=>{Y(te)},te=>{s(fe=>({...fe,lastError:dp(te)}))}).finally(()=>{i(null)})};return ee.jsxs("main",{className:"shell",children:[ee.jsx(kj,{}),ee.jsxs("section",{className:"hero",children:[ee.jsx("p",{className:"eyebrow",children:"effect-http-ws-cli"}),ee.jsx("h1",{children:"Realtime Todo Stream"}),ee.jsx("p",{className:"lead",children:"Snapshot on load, then live updates over typed WebSocket RPC subscriptions."})]}),ee.jsx(Uj,{runMutation:W,applyTodoEvent:z}),ee.jsx(zj,{}),ee.jsx(Nj,{})]})}const Mx=e=>[...e].sort((n,s)=>n.archived!==s.archived?n.archived?1:-1:n.completed!==s.completed?n.completed?1:-1:n.id.localeCompare(s.id)),Cj=e=>{switch(e._tag){case"TodoCreated":return"created";case"TodoRenamed":return`renamed to "${e.title}"`;case"TodoCompleted":return e.completed?"completed":"marked incomplete";case"TodoArchived":return e.archived?"archived":"unarchived"}},kj=()=>{const e=ta(Bd),n=ta(A2);return ee.jsx("section",{className:"panel status-panel",children:ee.jsxs("div",{className:"status-grid",children:[ee.jsxs("div",{className:`status-item status-subscription-${e.subscriptionState}`,children:[ee.jsx("span",{className:"status-label",children:"Subscription"}),ee.jsx("strong",{children:e.subscriptionState})]}),ee.jsxs("div",{className:`status-item ${n?"status-mutation-busy":"status-mutation-idle"}`,children:[ee.jsx("span",{className:"status-label",children:"Mutation"}),ee.jsx("strong",{children:n||"idle"})]})]})})},Uj=e=>{const n=ta(Lg),s=ta(Bd),i=Wr(Lg),u=Wr(xj,{mode:"promise"}),o=Wr(Ej,{mode:"promise"}),d=Wr(wj,{mode:"promise"});return ee.jsxs("section",{className:"panel todo-panel",children:[ee.jsxs("header",{className:"todo-header",children:[ee.jsx("h2",{children:"Todos"}),ee.jsxs("div",{className:"meta",children:[ee.jsxs("span",{children:["offset #",n.lastOffset]}),ee.jsxs("span",{children:["subscription: ",s.subscriptionState]})]})]}),ee.jsx("ul",{className:"todo-list",children:n.todos.map(h=>ee.jsxs("li",{className:`todo-item${h.completed?" is-completed":""}${h.archived?" is-archived":""}`,children:[ee.jsxs("div",{className:"todo-main",children:[ee.jsx("input",{value:n.titleDrafts[h.id]??h.title,onChange:p=>{i(m=>({...m,titleDrafts:{...m.titleDrafts,[h.id]:p.target.value}}))}}),ee.jsxs("small",{children:["rev ",h.revision," ยท ",new Date(h.updatedAt).toLocaleTimeString()]})]}),ee.jsxs("div",{className:"todo-actions",children:[ee.jsx("button",{type:"button",onClick:()=>e.runMutation(`rename:${h.id}`,()=>u({payload:{id:h.id,title:n.titleDrafts[h.id]??h.title}}),e.applyTodoEvent),children:"Rename"}),ee.jsx("button",{type:"button",onClick:()=>e.runMutation(`complete:${h.id}`,()=>o({payload:{id:h.id,completed:!h.completed}}),e.applyTodoEvent),children:h.completed?"Undo":"Complete"}),ee.jsx("button",{type:"button",onClick:()=>e.runMutation(`archive:${h.id}`,()=>d({payload:{id:h.id,archived:!h.archived}}),e.applyTodoEvent),children:h.archived?"Unarchive":"Archive"})]})]},h.id))})]})},zj=()=>{const e=ta(R2);return ee.jsxs("section",{className:"panel event-panel",children:[ee.jsxs("header",{className:"todo-header",children:[ee.jsx("h2",{children:"Events"}),ee.jsx("div",{className:"meta",children:ee.jsxs("span",{children:[e.length," total"]})})]}),ee.jsx("ul",{className:"event-list",children:[...e].reverse().map(n=>ee.jsxs("li",{className:"event-item",children:[ee.jsxs("div",{className:"event-top",children:[ee.jsxs("strong",{children:["#",n.offset]}),ee.jsx("span",{children:new Date(n.at).toLocaleTimeString()})]}),ee.jsxs("div",{className:"event-body",children:[ee.jsx("span",{children:n.todo.title}),ee.jsx("small",{children:Cj(n.change)})]})]},n.offset))})]})},Nj=()=>{const e=ta(Bd);return ee.jsx("footer",{className:"footer",children:e.lastError?ee.jsx("span",{className:"error",children:e.lastError}):ee.jsx("span",{children:"no errors"})})},Dj=Aj.update({id:"/",path:"/",getParentRoute:()=>c2}),Lj={IndexRoute:Dj},jj=c2._addFileChildren(Lj)._addFileTypes(),Bj=e=>BL({routeTree:jj,history:e}),qj=IT(),$j=Bj(qj);tA.createRoot(document.getElementById("root")).render(ee.jsx(le.StrictMode,{children:ee.jsx(L6,{children:ee.jsx(HL,{router:$j})})})); diff --git a/.reference/public/index.html b/.reference/public/index.html new file mode 100644 index 0000000000..11d724f1d5 --- /dev/null +++ b/.reference/public/index.html @@ -0,0 +1,16 @@ + + + + + + effect-http-ws-cli rpc console + + + + + + + +
+ + diff --git a/.reference/scripts/dev.mjs b/.reference/scripts/dev.mjs new file mode 100644 index 0000000000..7dae4de8b3 --- /dev/null +++ b/.reference/scripts/dev.mjs @@ -0,0 +1,94 @@ +import { spawn } from "node:child_process" + +const frontendDevOrigin = process.env.FRONTEND_DEV_ORIGIN ?? "http://127.0.0.1:5173" +const frontendDevUrl = new URL(frontendDevOrigin) + +if (frontendDevUrl.protocol !== "http:" && frontendDevUrl.protocol !== "https:") { + throw new Error(`FRONTEND_DEV_ORIGIN must use http or https, received ${frontendDevOrigin}`) +} + +const frontendHost = process.env.FRONTEND_DEV_HOST ?? frontendDevUrl.hostname +const frontendPort = process.env.FRONTEND_DEV_PORT ?? (frontendDevUrl.port || "5173") +const serverArgs = process.argv.slice(2) + +const readFlagValue = (name) => { + const index = serverArgs.findIndex((arg) => arg === name) + if (index >= 0) { + return serverArgs[index + 1] + } + + const prefixed = serverArgs.find((arg) => arg.startsWith(`${name}=`)) + return prefixed ? prefixed.slice(name.length + 1) : undefined +} + +const normalizeBackendHost = (host) => { + if (!host || host === "0.0.0.0" || host === "::") { + return "127.0.0.1" + } + return host +} + +const backendHost = normalizeBackendHost(process.env.HOST ?? readFlagValue("--host")) +const backendPort = process.env.PORT ?? readFlagValue("--port") ?? "8787" +const backendOrigin = process.env.VITE_BACKEND_ORIGIN ?? `http://${backendHost}:${backendPort}` + +const children = new Set() +let shuttingDown = false + +const stopChildren = (signal = "SIGTERM") => { + if (shuttingDown) { + return + } + shuttingDown = true + for (const child of children) { + if (!child.killed) { + child.kill(signal) + } + } +} + +const spawnChild = (command, args, env = {}) => { + const child = spawn(command, args, { + stdio: "inherit", + env: { + ...process.env, + ...env + } + }) + + children.add(child) + + child.on("exit", (code, signal) => { + stopChildren(signal ?? "SIGTERM") + if (signal) { + process.kill(process.pid, signal) + return + } + process.exit(code ?? 0) + }) + + return child +} + +spawnChild("bun", [ + "run", + "--filter", + "@effect-http-ws-cli/web", + "dev", + "--", + "--host", + frontendHost, + "--port", + frontendPort, + "--strictPort" +], { + VITE_BACKEND_ORIGIN: backendOrigin +}) + +spawnChild("node", ["server/src/bin.ts", ...serverArgs], { + FRONTEND_DEV_ORIGIN: frontendDevOrigin +}) + +for (const signal of ["SIGINT", "SIGTERM"]) { + process.on(signal, () => stopChildren(signal)) +} diff --git a/.reference/server/package.json b/.reference/server/package.json new file mode 100644 index 0000000000..8df16b6766 --- /dev/null +++ b/.reference/server/package.json @@ -0,0 +1,27 @@ +{ + "name": "@effect-http-ws-cli/server", + "version": "0.1.0", + "private": true, + "type": "module", + "exports": { + "./client": "./src/client.ts", + "./contracts": "./src/contracts.ts" + }, + "scripts": { + "dev": "node src/bin.ts", + "start": "node src/bin.ts", + "test": "vitest run", + "lint": "tsc --noEmit" + }, + "dependencies": { + "@effect/platform-node": "catalog:", + "@effect/sql-sqlite-node": "catalog:", + "effect": "catalog:" + }, + "devDependencies": { + "@effect/vitest": "catalog:", + "@types/node": "^24.10.0", + "typescript": "catalog:", + "vitest": "catalog:" + } +} diff --git a/.reference/server/src/Migrations/001_TodoSchema.ts b/.reference/server/src/Migrations/001_TodoSchema.ts new file mode 100644 index 0000000000..aa6c1418e7 --- /dev/null +++ b/.reference/server/src/Migrations/001_TodoSchema.ts @@ -0,0 +1,32 @@ +import * as Effect from "effect/Effect" +import * as SqlClient from "effect/unstable/sql/SqlClient" + +export default Effect.gen(function*() { + const sql = yield* SqlClient.SqlClient + + yield* sql` + CREATE TABLE IF NOT EXISTS todos ( + id TEXT PRIMARY KEY NOT NULL, + title TEXT NOT NULL, + completed INTEGER NOT NULL, + archived INTEGER NOT NULL, + revision INTEGER NOT NULL, + updated_at TEXT NOT NULL + ) + ` + + yield* sql` + CREATE TABLE IF NOT EXISTS todo_events ( + event_offset INTEGER PRIMARY KEY AUTOINCREMENT, + at TEXT NOT NULL, + todo_json TEXT NOT NULL, + change_json TEXT NOT NULL, + archived INTEGER NOT NULL + ) + ` + + yield* sql` + CREATE INDEX IF NOT EXISTS idx_todo_events_archived_offset + ON todo_events (archived, event_offset) + ` +}) diff --git a/.reference/server/src/bin.ts b/.reference/server/src/bin.ts new file mode 100644 index 0000000000..647a33e519 --- /dev/null +++ b/.reference/server/src/bin.ts @@ -0,0 +1,11 @@ +#!/usr/bin/env node +import * as NodeRuntime from "@effect/platform-node/NodeRuntime" +import * as NodeServices from "@effect/platform-node/NodeServices" +import * as Effect from "effect/Effect" +import { cli } from "./cli.ts" +import { Command } from "effect/unstable/cli" + +Command.run(cli, { version: "0.1.0" }).pipe( + Effect.provide(NodeServices.layer), + NodeRuntime.runMain +) diff --git a/.reference/server/src/cli.ts b/.reference/server/src/cli.ts new file mode 100644 index 0000000000..75806c2f4e --- /dev/null +++ b/.reference/server/src/cli.ts @@ -0,0 +1,125 @@ +import * as SqliteNode from "@effect/sql-sqlite-node" +import { Command, Flag } from "effect/unstable/cli" +import * as Config from "effect/Config" +import * as Effect from "effect/Effect" +import * as FileSystem from "effect/FileSystem" +import * as Option from "effect/Option" +import * as Path from "effect/Path" +import { fileURLToPath } from "node:url" +import { ServerConfig } from "./config.ts" +import { runMigrations } from "./migrations.ts" +import { runServer } from "./server.ts" +import type { ServerConfigData } from "./config.ts" + +const defaultAssetsDir = fileURLToPath(new URL("../../public", import.meta.url)) +const defaultDbFilename = fileURLToPath(new URL("../../todo.sqlite", import.meta.url)) + +const hostFlag = Flag.string("host").pipe( + Flag.withDescription("Host interface to bind"), + Flag.optional +) + +const portFlag = Flag.integer("port").pipe( + Flag.withDescription("Port to listen on"), + Flag.optional +) + +const assetsFlag = Flag.directory("assets").pipe( + Flag.withDescription("Directory of static assets"), + Flag.optional +) + +const dbFlag = Flag.string("db").pipe( + Flag.withDescription("SQLite database filename"), + Flag.optional +) + +const requestLoggingFlag = Flag.boolean("request-logging").pipe( + Flag.withDescription("Enable request logging"), + Flag.optional +) + +const frontendDevOriginFlag = Flag.string("frontend-dev-origin").pipe( + Flag.withDescription("Redirect frontend GET requests to a Vite dev server origin"), + Flag.optional +) + +const EnvServerConfig = Config.unwrap({ + host: Config.string("HOST").pipe(Config.withDefault("127.0.0.1")), + port: Config.port("PORT").pipe(Config.withDefault(8787)), + assetsDir: Config.string("ASSETS_DIR").pipe(Config.withDefault(defaultAssetsDir)), + dbFilename: Config.string("DB_FILENAME").pipe(Config.withDefault(defaultDbFilename)), + requestLogging: Config.boolean("REQUEST_LOGGING").pipe(Config.withDefault(true)), + frontendDevOrigin: Config.string("FRONTEND_DEV_ORIGIN").pipe( + Config.option, + Config.map(Option.getOrUndefined) + ) +}) + +export interface CliServerFlags { + readonly host: Option.Option + readonly port: Option.Option + readonly assets: Option.Option + readonly db: Option.Option + readonly requestLogging: Option.Option + readonly frontendDevOrigin: Option.Option +} + +export const resolveServerConfig = ( + flags: CliServerFlags +): Effect.Effect => + Effect.gen(function*() { + const env = yield* EnvServerConfig + return { + host: Option.getOrElse(flags.host, () => env.host), + port: Option.getOrElse(flags.port, () => env.port), + assetsDir: Option.getOrElse(flags.assets, () => env.assetsDir), + dbFilename: Option.getOrElse(flags.db, () => env.dbFilename), + requestLogging: Option.getOrElse(flags.requestLogging, () => env.requestLogging), + frontendDevOrigin: Option.getOrElse(flags.frontendDevOrigin, () => env.frontendDevOrigin) + } + }) + + +export const resetDatabase = (dbFilename: string) => + Effect.gen(function*() { + const fs = yield* FileSystem.FileSystem + const path = yield* Path.Path + + if (dbFilename !== ":memory:") { + yield* fs.remove(path.resolve(dbFilename), { force: true }) + } + + const sqliteLayer = SqliteNode.SqliteClient.layer({ + filename: dbFilename + }) + + yield* runMigrations.pipe(Effect.provide(sqliteLayer)) + }) + +const commandFlags = { + host: hostFlag, + port: portFlag, + assets: assetsFlag, + db: dbFlag, + requestLogging: requestLoggingFlag, + frontendDevOrigin: frontendDevOriginFlag +} as const + +const rootCommand = Command.make("effect-http-ws-cli", commandFlags).pipe( + Command.withDescription("Run a unified Effect HTTP + WebSocket server"), + Command.withHandler((flags) => + Effect.flatMap(resolveServerConfig(flags), (config) => + runServer.pipe(Effect.provideService(ServerConfig, config)))), +) + +const resetCommand = Command.make("reset", commandFlags).pipe( + Command.withDescription("Delete the SQLite database file and rerun migrations"), + Command.withHandler((flags) => + Effect.flatMap(resolveServerConfig(flags), (config) => resetDatabase(config.dbFilename)) + ) +) + +export const cli = rootCommand.pipe( + Command.withSubcommands([resetCommand]) +) diff --git a/.reference/server/src/client.ts b/.reference/server/src/client.ts new file mode 100644 index 0000000000..4650807973 --- /dev/null +++ b/.reference/server/src/client.ts @@ -0,0 +1,58 @@ +import { NodeSocket } from "@effect/platform-node" +import * as Effect from "effect/Effect" +import * as Layer from "effect/Layer" +import * as RpcClient from "effect/unstable/rpc/RpcClient" +import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization" +import * as Stream from "effect/Stream" +import { WsRpcGroup } from "./contracts.ts" + +export const wsRpcProtocolLayer = (wsUrl: string) => + RpcClient.layerProtocolSocket().pipe( + Layer.provide(NodeSocket.layerWebSocket(wsUrl)), + Layer.provide(RpcSerialization.layerJson) + ) + +export const makeWsRpcClient = RpcClient.make(WsRpcGroup) +type WsRpcClient = typeof makeWsRpcClient extends Effect.Effect ? Client : never + +export const withWsRpcClient = ( + wsUrl: string, + f: (client: WsRpcClient) => Effect.Effect +) => + makeWsRpcClient.pipe( + Effect.flatMap(f), + Effect.provide(wsRpcProtocolLayer(wsUrl)) + ) + +export const runClientExample = (wsUrl: string) => + Effect.scoped( + withWsRpcClient(wsUrl, (client) => + Effect.gen(function*() { + const echoed = yield* client.echo({ text: "hello from client" }) + const summed = yield* client.sum({ left: 20, right: 22 }) + const time = yield* client.time(undefined) + return { echoed, summed, time } + }) + ) + ) + +export const runSubscriptionExample = (wsUrl: string, modelId: string) => + Effect.scoped( + withWsRpcClient(wsUrl, (client) => + Effect.gen(function*() { + const snapshot = yield* client.listTodos({ includeArchived: true }) + const todo = snapshot.todos[0] + if (!todo) { + return [] + } + + yield* client.renameTodo({ id: todo.id, title: `${modelId}: first` }) + yield* client.completeTodo({ id: todo.id, completed: true }) + + return yield* client.subscribeTodos({ fromOffset: snapshot.offset, includeArchived: true }).pipe( + Stream.take(2), + Stream.runCollect + ) + }) + ) + ) diff --git a/.reference/server/src/config.ts b/.reference/server/src/config.ts new file mode 100644 index 0000000000..601135fefb --- /dev/null +++ b/.reference/server/src/config.ts @@ -0,0 +1,14 @@ +import * as ServiceMap from "effect/ServiceMap" + +export interface ServerConfigData { + readonly host: string + readonly port: number + readonly assetsDir: string + readonly dbFilename: string + readonly requestLogging: boolean + readonly frontendDevOrigin: string | undefined +} + +export class ServerConfig extends ServiceMap.Service()( + "effect-http-ws-cli/ServerConfig" +) {} diff --git a/.reference/server/src/contracts.ts b/.reference/server/src/contracts.ts new file mode 100644 index 0000000000..f2b2534f93 --- /dev/null +++ b/.reference/server/src/contracts.ts @@ -0,0 +1,132 @@ +import * as Schema from "effect/Schema" +import * as Rpc from "effect/unstable/rpc/Rpc" +import * as RpcGroup from "effect/unstable/rpc/RpcGroup" + +export const EchoPayload = Schema.Struct({ + text: Schema.String +}) + +export const EchoResult = Schema.Struct({ + text: Schema.String +}) + +export const SumPayload = Schema.Struct({ + left: Schema.Number, + right: Schema.Number +}) + +export const SumResult = Schema.Struct({ + total: Schema.Number +}) + +export const TimeResult = Schema.Struct({ + iso: Schema.String +}) + +export const Todo = Schema.Struct({ + id: Schema.String, + title: Schema.String, + completed: Schema.Boolean, + archived: Schema.Boolean, + revision: Schema.Number, + updatedAt: Schema.String +}) +export type Todo = Schema.Schema.Type + +export const TodoChange = Schema.Union([ + Schema.Struct({ + _tag: Schema.Literal("TodoCreated") + }), + Schema.Struct({ + _tag: Schema.Literal("TodoRenamed"), + title: Schema.String + }), + Schema.Struct({ + _tag: Schema.Literal("TodoCompleted"), + completed: Schema.Boolean + }), + Schema.Struct({ + _tag: Schema.Literal("TodoArchived"), + archived: Schema.Boolean + }) +]) +export type TodoChange = Schema.Schema.Type + +export const TodoEvent = Schema.Struct({ + offset: Schema.Number, + at: Schema.String, + todo: Todo, + change: TodoChange +}) +export type TodoEvent = Schema.Schema.Type + +export const TodoSnapshot = Schema.Struct({ + offset: Schema.Number, + todos: Schema.Array(Todo) +}) +export type TodoSnapshot = Schema.Schema.Type + +export const EchoRpc = Rpc.make("echo", { + payload: EchoPayload, + success: EchoResult +}) + +export const SumRpc = Rpc.make("sum", { + payload: SumPayload, + success: SumResult +}) + +export const TimeRpc = Rpc.make("time", { + success: TimeResult +}) + +export const ListTodosRpc = Rpc.make("listTodos", { + payload: Schema.Struct({ + includeArchived: Schema.Boolean + }), + success: TodoSnapshot +}) + +export const RenameTodoRpc = Rpc.make("renameTodo", { + payload: Schema.Struct({ + id: Schema.String, + title: Schema.String + }), + success: TodoEvent +}) + +export const CompleteTodoRpc = Rpc.make("completeTodo", { + payload: Schema.Struct({ + id: Schema.String, + completed: Schema.Boolean + }), + success: TodoEvent +}) + +export const ArchiveTodoRpc = Rpc.make("archiveTodo", { + payload: Schema.Struct({ + id: Schema.String, + archived: Schema.Boolean + }), + success: TodoEvent +}) + +export const SubscribeTodosRpc = Rpc.make("subscribeTodos", { + payload: Schema.Struct({ + fromOffset: Schema.Number, + includeArchived: Schema.Boolean + }), + success: TodoEvent, + stream: true +}) + +export const WsRpcGroup = RpcGroup.make( + EchoRpc, + SumRpc, + TimeRpc, + ListTodosRpc, + RenameTodoRpc, + CompleteTodoRpc, + ArchiveTodoRpc, + SubscribeTodosRpc +) diff --git a/.reference/server/src/messages.ts b/.reference/server/src/messages.ts new file mode 100644 index 0000000000..75a67efac2 --- /dev/null +++ b/.reference/server/src/messages.ts @@ -0,0 +1,73 @@ +import * as Schema from "effect/Schema" +import * as SchemaTransformation from "effect/SchemaTransformation" + +export const ClientMessage = Schema.Union([ + Schema.Struct({ + kind: Schema.Literal("echo"), + text: Schema.String + }), + Schema.Struct({ + kind: Schema.Literal("sum"), + left: Schema.Number, + right: Schema.Number + }), + Schema.Struct({ + kind: Schema.Literal("time") + }) +]) + +export type ClientMessage = Schema.Schema.Type + +export const ServerMessage = Schema.Union([ + Schema.Struct({ + kind: Schema.Literal("echo"), + text: Schema.String + }), + Schema.Struct({ + kind: Schema.Literal("sumResult"), + total: Schema.Number + }), + Schema.Struct({ + kind: Schema.Literal("time"), + iso: Schema.String + }), + Schema.Struct({ + kind: Schema.Literal("error"), + error: Schema.String + }) +]) + + +export type ServerMessage = Schema.Schema.Type + +export const decodeClientMessage = Schema.decodeUnknownEffect(ClientMessage) + +const Utf8StringFromUint8Array = Schema.Uint8Array.pipe( + Schema.decodeTo( + Schema.String, + SchemaTransformation.transform({ + decode: (bytes) => new TextDecoder().decode(bytes), + encode: (text) => new TextEncoder().encode(text) + }) + ) +) + +const ClientMessageFromWire = Schema.Union([ + Schema.String, + Utf8StringFromUint8Array +]).pipe( + Schema.decodeTo(Schema.fromJsonString(ClientMessage)) +) + +export const decodeWireClientMessage = Schema.decodeUnknownEffect(ClientMessageFromWire) + +export const routeClientMessage = (message: ClientMessage): ServerMessage => { + switch (message.kind) { + case "echo": + return { kind: "echo", text: message.text } + case "sum": + return { kind: "sumResult", total: message.left + message.right } + case "time": + return { kind: "time", iso: new Date().toISOString() } + } +} diff --git a/.reference/server/src/migrations.ts b/.reference/server/src/migrations.ts new file mode 100644 index 0000000000..65abf1a534 --- /dev/null +++ b/.reference/server/src/migrations.ts @@ -0,0 +1,41 @@ +/** + * MigrationsLive - Migration runner with inline loader + * + * Uses Migrator.make with fromRecord to define migrations inline. + * All migrations are statically imported - no dynamic file system loading. + * + * Migrations run automatically when the MigrationsLive layer is provided, + * ensuring the database schema is up-to-date before the application starts. + */ +import * as Effect from "effect/Effect" +import * as Layer from "effect/Layer" +import * as ServiceMap from "effect/ServiceMap" +import * as Migrator from "effect/unstable/sql/Migrator" +import Migration0001 from "./Migrations/001_TodoSchema.ts" + +const loader = Migrator.fromRecord({ + "1_TodoSchema": Migration0001 +}) + +const run = Migrator.make({}) + +export const runMigrations = Effect.gen(function*() { + yield* Effect.log("Running migrations...") + yield* run({ loader }) + yield* Effect.log("Migrations ran successfully") +}) + +export interface MigrationsReadyApi { + readonly ready: true +} + +export class MigrationsReady extends ServiceMap.Service()( + "effect-http-ws-cli/MigrationsReady" +) {} + +export const MigrationsLive = Layer.effect( + MigrationsReady, + runMigrations.pipe( + Effect.as(MigrationsReady.of({ ready: true })) + ) +) diff --git a/.reference/server/src/model-store.ts b/.reference/server/src/model-store.ts new file mode 100644 index 0000000000..56bcc0c05a --- /dev/null +++ b/.reference/server/src/model-store.ts @@ -0,0 +1,268 @@ +import * as Effect from "effect/Effect" +import * as Layer from "effect/Layer" +import * as Option from "effect/Option" +import * as PubSub from "effect/PubSub" +import * as Schema from "effect/Schema" +import * as ServiceMap from "effect/ServiceMap" +import * as Stream from "effect/Stream" +import * as SqlClient from "effect/unstable/sql/SqlClient" +import * as SqlSchema from "effect/unstable/sql/SqlSchema" +import type { Todo, TodoChange, TodoEvent, TodoSnapshot } from "./contracts.ts" +import { Todo as TodoSchema, TodoChange as TodoChangeSchema } from "./contracts.ts" +import { MigrationsReady } from "./migrations.ts" + +export interface TodoStoreApi { + readonly list: (input: { + readonly includeArchived: boolean + }) => Effect.Effect + readonly rename: (input: { + readonly id: string + readonly title: string + }) => Effect.Effect + readonly complete: (input: { + readonly id: string + readonly completed: boolean + }) => Effect.Effect + readonly archive: (input: { + readonly id: string + readonly archived: boolean + }) => Effect.Effect + readonly subscribe: (input: { + readonly fromOffset: number + readonly includeArchived: boolean + }) => Stream.Stream +} + +export class TodoStore extends ServiceMap.Service()( + "effect-http-ws-cli/TodoStore" +) {} + +const TodoRow = Schema.Struct({ + id: Schema.String, + title: Schema.String, + completed: Schema.BooleanFromBit, + archived: Schema.BooleanFromBit, + revision: Schema.Number, + updatedAt: Schema.String +}) + +const TodoEventRow = Schema.Struct({ + offset: Schema.Number, + at: Schema.String, + todo: Schema.fromJsonString(TodoSchema), + change: Schema.fromJsonString(TodoChangeSchema) +}) + +const EventInsertRequest = Schema.Struct({ + at: Schema.String, + todo: Schema.fromJsonString(TodoSchema), + change: Schema.fromJsonString(TodoChangeSchema), + archived: Schema.BooleanFromBit +}) + +const ListRequest = Schema.Struct({ + includeArchived: Schema.Boolean +}) + +const CatchupRequest = Schema.Struct({ + fromOffset: Schema.Number, + includeArchived: Schema.Boolean +}) + +const OffsetRow = Schema.Struct({ + offset: Schema.Number +}) + +const makeQueries = (sql: SqlClient.SqlClient) => { + const listTodoRows = SqlSchema.findAll({ + Request: ListRequest, + Result: TodoRow, + execute: (request) => + request.includeArchived + ? sql` + SELECT id, title, completed, archived, revision, updated_at AS updatedAt + FROM todos + ORDER BY id + ` + : sql` + SELECT id, title, completed, archived, revision, updated_at AS updatedAt + FROM todos + WHERE archived = 0 + ORDER BY id + ` + }) + + const findTodoById = SqlSchema.findOneOption({ + Request: Schema.String, + Result: TodoRow, + execute: (id) => sql` + SELECT id, title, completed, archived, revision, updated_at AS updatedAt + FROM todos + WHERE id = ${id} + ` + }) + + const upsertTodo = SqlSchema.void({ + Request: TodoRow, + execute: (todo) => sql` + INSERT INTO todos (id, title, completed, archived, revision, updated_at) + VALUES (${todo.id}, ${todo.title}, ${todo.completed}, ${todo.archived}, ${todo.revision}, ${todo.updatedAt}) + ON CONFLICT(id) DO UPDATE SET + title = excluded.title, + completed = excluded.completed, + archived = excluded.archived, + revision = excluded.revision, + updated_at = excluded.updated_at + ` + }) + + const loadEventsSince = SqlSchema.findAll({ + Request: CatchupRequest, + Result: TodoEventRow, + execute: (request) => + request.includeArchived + ? sql` + SELECT event_offset AS "offset", at, todo_json AS todo, change_json AS change + FROM todo_events + WHERE event_offset > ${request.fromOffset} + ORDER BY event_offset + ` + : sql` + SELECT event_offset AS "offset", at, todo_json AS todo, change_json AS change + FROM todo_events + WHERE event_offset > ${request.fromOffset} AND archived = 0 + ORDER BY event_offset + ` + }) + + const insertTodoEvent = SqlSchema.findOne({ + Request: EventInsertRequest, + Result: TodoEventRow, + execute: (request) => sql` + INSERT INTO todo_events (at, todo_json, change_json, archived) + VALUES (${request.at}, ${request.todo}, ${request.change}, ${request.archived}) + RETURNING event_offset AS "offset", at, todo_json AS todo, change_json AS change + ` + }) + + const currentOffset = SqlSchema.findOne({ + Request: Schema.Undefined, + Result: OffsetRow, + execute: () => sql<{ readonly offset: number }>` + SELECT COALESCE(MAX(event_offset), 0) AS "offset" + FROM todo_events + ` + }) + + return { + listTodoRows, + findTodoById, + upsertTodo, + loadEventsSince, + insertTodoEvent, + currentOffset + } as const +} + +export const layerTodoStore = Layer.effect( + TodoStore, + Effect.gen(function*() { + yield* MigrationsReady + const eventsPubSub = yield* PubSub.unbounded() + + const append = ( + todoId: string, + change: TodoChange, + update: (todo: Todo) => Todo + ): Effect.Effect => + Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => { + const queries = makeQueries(sql) + return sql.withTransaction( + queries.findTodoById(todoId).pipe( + Effect.flatMap( + Option.match({ + onNone: () => Effect.die(`Todo not found: ${todoId}`), + onSome: (todo) => { + const updated = update(todo) + return queries.upsertTodo(updated).pipe( + Effect.flatMap(() => + queries.insertTodoEvent({ + at: updated.updatedAt, + todo: updated, + change, + archived: updated.archived + }) + ) + ) + } + }) + ) + ) + ) + }).pipe(Effect.tap((event) => PubSub.publish(eventsPubSub, event)), Effect.orDie) + + const visible = (todo: Todo, includeArchived: boolean) => includeArchived || !todo.archived + + const subscribe = (input: { + readonly fromOffset: number + readonly includeArchived: boolean + }): Stream.Stream => { + const catchup = Stream.fromIterableEffect( + Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => makeQueries(sql).loadEventsSince(input)) + ).pipe(Stream.orDie) + + const live = Stream.fromPubSub(eventsPubSub).pipe( + Stream.filter((event) => visible(event.todo, input.includeArchived)) + ) + + return Stream.concat(catchup, live) + } + + return TodoStore.of({ + list: ({ includeArchived }) => + Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => { + const queries = makeQueries(sql) + return Effect.all({ + todos: queries.listTodoRows({ includeArchived }), + offset: queries.currentOffset(undefined).pipe(Effect.map(({ offset }) => offset)) + }).pipe( + Effect.map(({ offset, todos }) => ({ offset, todos })) + ) + }).pipe(Effect.orDie), + rename: ({ id, title }) => + append( + id, + { _tag: "TodoRenamed", title }, + (todo) => ({ + ...todo, + title, + revision: todo.revision + 1, + updatedAt: new Date().toISOString() + }) + ), + complete: ({ id, completed }) => + append( + id, + { _tag: "TodoCompleted", completed }, + (todo) => ({ + ...todo, + completed, + revision: todo.revision + 1, + updatedAt: new Date().toISOString() + }) + ), + archive: ({ id, archived }) => + append( + id, + { _tag: "TodoArchived", archived }, + (todo) => ({ + ...todo, + archived, + revision: todo.revision + 1, + updatedAt: new Date().toISOString() + }) + ), + subscribe + }) + }) +) diff --git a/.reference/server/src/server.ts b/.reference/server/src/server.ts new file mode 100644 index 0000000000..0d1e7a16dd --- /dev/null +++ b/.reference/server/src/server.ts @@ -0,0 +1,155 @@ +import { NodeHttpServer } from "@effect/platform-node" +import * as SqliteNode from "@effect/sql-sqlite-node" +import * as Effect from "effect/Effect" +import * as FileSystem from "effect/FileSystem" +import * as Layer from "effect/Layer" +import * as Path from "effect/Path" +import * as Http from "node:http" +import { + HttpRouter, + HttpServerRequest, + HttpServerResponse +} from "effect/unstable/http" +import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization" +import * as RpcServer from "effect/unstable/rpc/RpcServer" +import * as Stream from "effect/Stream" +import { + ClientMessage, + routeClientMessage, + ServerMessage +} from "./messages.ts" +import { ServerConfig } from "./config.ts" +import { WsRpcGroup } from "./contracts.ts" +import { TodoStore, layerTodoStore } from "./model-store.ts" +import { MigrationsLive } from "./migrations.ts" + +const respondMessage = HttpServerResponse.schemaJson(ServerMessage) + +const messageDispatchRoute = HttpRouter.add( + "POST", + "/api/dispatch", + HttpServerRequest.schemaBodyJson(ClientMessage).pipe( + Effect.flatMap((message) => respondMessage(routeClientMessage(message))), + Effect.catchTag( + "SchemaError", + () => Effect.succeed(HttpServerResponse.jsonUnsafe({ kind: "error", error: "Invalid message schema" }, { status: 400 })) + ), + Effect.catchTag( + "HttpServerError", + () => Effect.succeed(HttpServerResponse.jsonUnsafe({ kind: "error", error: "Invalid request body" }, { status: 400 })) + ) + ) +) + +const websocketRpcRoute = RpcServer.layerHttp({ + group: WsRpcGroup, + path: "/ws", + protocol: "websocket" + }).pipe( + Layer.provide(WsRpcGroup.toLayer({ + echo: ({ text }) => Effect.succeed({ text }), + sum: ({ left, right }) => Effect.succeed({ total: left + right }), + time: () => Effect.sync(() => ({ iso: new Date().toISOString() })), + listTodos: ({ includeArchived }) => + Effect.flatMap(Effect.service(TodoStore), (store) => store.list({ includeArchived })), + renameTodo: ({ id, title }) => + Effect.flatMap(Effect.service(TodoStore), (store) => store.rename({ id, title })), + completeTodo: ({ id, completed }) => + Effect.flatMap(Effect.service(TodoStore), (store) => store.complete({ id, completed })), + archiveTodo: ({ id, archived }) => + Effect.flatMap(Effect.service(TodoStore), (store) => store.archive({ id, archived })), + subscribeTodos: ({ fromOffset, includeArchived }) => + Stream.unwrap( + Effect.map( + Effect.service(TodoStore), + (store) => store.subscribe({ fromOffset, includeArchived }) + ) + ) + })), + Layer.provide(layerTodoStore), + Layer.provide(RpcSerialization.layerJson) + ) + +const staticRoute = HttpRouter.add( + "GET", + "*", + (request) => + Effect.gen(function*() { + const fs = yield* FileSystem.FileSystem + const path = yield* Path.Path + const config = yield* ServerConfig + const url = HttpServerRequest.toURL(request) + if (!url) { + return HttpServerResponse.text("Bad Request", { status: 400 }) + } + + if (config.frontendDevOrigin) { + return HttpServerResponse.redirect( + new URL(`${url.pathname}${url.search}`, config.frontendDevOrigin), + { + status: 307, + headers: { "cache-control": "no-store" } + } + ) + } + + const root = path.resolve(config.assetsDir) + const decodedPath = decodeURIComponent(url.pathname) + const target = decodedPath === "/" + ? "index.html" + : decodedPath.endsWith("/") + ? `${decodedPath.slice(1)}index.html` + : decodedPath.slice(1) + + const normalizedTarget = path.normalize(target) + const absoluteTarget = path.resolve(root, normalizedTarget) + const relativeToRoot = path.relative(root, absoluteTarget) + + if (relativeToRoot.startsWith("..") || path.isAbsolute(relativeToRoot)) { + return HttpServerResponse.text("Forbidden", { status: 403 }) + } + + const exists = yield* fs.exists(absoluteTarget) + if (!exists) { + return HttpServerResponse.text("Not Found", { status: 404 }) + } + + return yield* HttpServerResponse.file(absoluteTarget) + }).pipe(Effect.catchCause(() => Effect.succeed(HttpServerResponse.text("Bad Request", { status: 400 })))) +) + +export const makeRoutesLayer = + Layer.mergeAll( + HttpRouter.add( + "GET", + "/health", + HttpServerResponse.json({ ok: true }) + ), + messageDispatchRoute, + websocketRpcRoute, + staticRoute + ) + +export const makeServerLayer = Layer.unwrap( + Effect.gen(function*() { + const config = yield* ServerConfig + const sqliteLayer = SqliteNode.SqliteClient.layer({ + filename: config.dbFilename + }) + const persistenceLayer = MigrationsLive.pipe( + Layer.provideMerge(sqliteLayer) + ) + + return HttpRouter.serve(makeRoutesLayer, { + disableLogger: !config.requestLogging + }).pipe( + Layer.provideMerge(persistenceLayer), + Layer.provide(NodeHttpServer.layer(Http.createServer, { + host: config.host, + port: config.port + })) + ) + }) +) + +export const runServer = Layer.launch(makeServerLayer) diff --git a/.reference/server/test/cli-config.test.ts b/.reference/server/test/cli-config.test.ts new file mode 100644 index 0000000000..90b75857a7 --- /dev/null +++ b/.reference/server/test/cli-config.test.ts @@ -0,0 +1,79 @@ +import { describe, expect, it } from "@effect/vitest" +import * as ConfigProvider from "effect/ConfigProvider" +import * as Effect from "effect/Effect" +import * as Option from "effect/Option" +import { resolveServerConfig } from "../src/cli.ts" + +describe("cli config resolution", () => { + it.effect("falls back to effect/config values when flags are omitted", () => + Effect.gen(function*() { + const resolved = yield* resolveServerConfig({ + host: Option.none(), + port: Option.none(), + assets: Option.none(), + db: Option.none(), + requestLogging: Option.none(), + frontendDevOrigin: Option.none() + }).pipe( + Effect.provideService( + ConfigProvider.ConfigProvider, + ConfigProvider.fromEnv({ + env: { + HOST: "0.0.0.0", + PORT: "4001", + ASSETS_DIR: "public", + DB_FILENAME: "dev.sqlite", + REQUEST_LOGGING: "false", + FRONTEND_DEV_ORIGIN: "http://127.0.0.1:5173" + } + }) + ) + ) + + expect(resolved).toEqual({ + host: "0.0.0.0", + port: 4001, + assetsDir: "public", + dbFilename: "dev.sqlite", + requestLogging: false, + frontendDevOrigin: "http://127.0.0.1:5173" + }) + }) + ) + + it.effect("uses CLI flags when provided", () => + Effect.gen(function*() { + const resolved = yield* resolveServerConfig({ + host: Option.some("127.0.0.1"), + port: Option.some(8788), + assets: Option.some("public"), + db: Option.some("override.sqlite"), + requestLogging: Option.some(true), + frontendDevOrigin: Option.some("http://127.0.0.1:4173") + }).pipe( + Effect.provideService( + ConfigProvider.ConfigProvider, + ConfigProvider.fromEnv({ + env: { + HOST: "0.0.0.0", + PORT: "4001", + ASSETS_DIR: "other", + DB_FILENAME: "ignored.sqlite", + REQUEST_LOGGING: "false", + FRONTEND_DEV_ORIGIN: "http://127.0.0.1:5173" + } + }) + ) + ) + + expect(resolved).toEqual({ + host: "127.0.0.1", + port: 8788, + assetsDir: "public", + dbFilename: "override.sqlite", + requestLogging: true, + frontendDevOrigin: "http://127.0.0.1:4173" + }) + }) + ) +}) diff --git a/.reference/server/test/reset.test.ts b/.reference/server/test/reset.test.ts new file mode 100644 index 0000000000..b180538e31 --- /dev/null +++ b/.reference/server/test/reset.test.ts @@ -0,0 +1,90 @@ +import * as NodeServices from "@effect/platform-node/NodeServices" +import * as SqliteNode from "@effect/sql-sqlite-node" +import { describe, expect, it } from "@effect/vitest" +import * as Effect from "effect/Effect" +import * as Layer from "effect/Layer" +import * as SqlClient from "effect/unstable/sql/SqlClient" +import * as FileSystem from "node:fs" +import * as OS from "node:os" +import * as NodePath from "node:path" +import { resetDatabase } from "../src/cli.ts" +import { MigrationsLive } from "../src/migrations.ts" + +const countRows = (dbFilename: string, tableName: string) => + Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => + sql<{ readonly count: number }>`SELECT COUNT(*) AS count FROM ${sql(tableName)}`.pipe( + Effect.map((rows) => rows[0]?.count ?? 0) + ) + ).pipe( + Effect.provide(SqliteNode.SqliteClient.layer({ filename: dbFilename })) + ) + +const insertTodo = (dbFilename: string) => + Effect.scoped( + Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => { + const now = new Date().toISOString() + const id = "todo-reset-test" + const title = "before-reset" + return sql.withTransaction( + sql` + INSERT INTO todos (id, title, completed, archived, revision, updated_at) + VALUES (${id}, ${title}, 0, 0, 1, ${now}) + `.pipe( + Effect.flatMap(() => + sql` + INSERT INTO todo_events (at, todo_json, change_json, archived) + VALUES ( + ${now}, + ${JSON.stringify({ + id, + title, + completed: false, + archived: false, + revision: 1, + updatedAt: now + })}, + ${JSON.stringify({ _tag: "TodoCreated" })}, + 0 + ) + ` + ) + ) + ) + }).pipe( + Effect.provide(MigrationsLive.pipe(Layer.provideMerge(SqliteNode.SqliteClient.layer({ filename: dbFilename })))) + ) + ) + +describe("reset command", () => { + it.effect("deletes the database and reruns migrations without reseeding todos", () => + Effect.gen(function*() { + const dbFilename = NodePath.join( + OS.tmpdir(), + `effect-http-ws-cli-reset-${Date.now()}-${Math.random().toString(16).slice(2)}.sqlite` + ) + + yield* insertTodo(dbFilename) + + const beforeCount = yield* countRows(dbFilename, "todos") + expect(beforeCount).toBe(1) + + yield* resetDatabase(dbFilename).pipe( + Effect.provide(NodeServices.layer) + ) + + const todoCount = yield* countRows(dbFilename, "todos") + const migrationCount = yield* countRows(dbFilename, "effect_sql_migrations") + + expect(todoCount).toBe(0) + expect(migrationCount).toBe(1) + + yield* Effect.sync(() => { + try { + FileSystem.rmSync(dbFilename, { force: true }) + } catch { + // ignore cleanup failures in tests + } + }) + }) + ) +}) diff --git a/.reference/server/test/server.test.ts b/.reference/server/test/server.test.ts new file mode 100644 index 0000000000..317e2a9058 --- /dev/null +++ b/.reference/server/test/server.test.ts @@ -0,0 +1,310 @@ +import { NodeHttpServer } from "@effect/platform-node" +import * as SqliteNode from "@effect/sql-sqlite-node" +import { describe, expect, it } from "@effect/vitest" +import * as Effect from "effect/Effect" +import * as Layer from "effect/Layer" +import * as Stream from "effect/Stream" +import * as FileSystem from "node:fs" +import * as OS from "node:os" +import * as NodePath from "node:path" +import { + HttpBody, + HttpClient, + HttpClientResponse, + HttpServer, + HttpRouter +} from "effect/unstable/http" +import * as SqlClient from "effect/unstable/sql/SqlClient" +import { ServerConfig } from "../src/config.ts" +import { MigrationsLive } from "../src/migrations.ts" +import { ServerMessage } from "../src/messages.ts" +import { withWsRpcClient } from "../src/client.ts" +import { makeRoutesLayer } from "../src/server.ts" + +const testServerConfig = { + host: "127.0.0.1", + port: 0, + assetsDir: new URL("../../public", import.meta.url).pathname, + dbFilename: ":memory:", + requestLogging: false, + frontendDevOrigin: undefined +} + +const AppUnderTest = HttpRouter.serve( + makeRoutesLayer, + { + disableListenLog: true, + disableLogger: true + } +) + +const persistenceLayer = (dbFilename: string) => { + const sqliteLayer = SqliteNode.SqliteClient.layer({ filename: dbFilename }) + return MigrationsLive.pipe(Layer.provideMerge(sqliteLayer)) +} + +const appLayer = (dbFilename: string) => + AppUnderTest.pipe(Layer.provideMerge(persistenceLayer(dbFilename))) + +const insertTodo = (dbFilename: string, id: string, title: string) => + Effect.scoped( + Effect.flatMap(Effect.service(SqlClient.SqlClient), (sql) => { + const now = new Date().toISOString() + return sql.withTransaction( + sql` + INSERT INTO todos (id, title, completed, archived, revision, updated_at) + VALUES (${id}, ${title}, 0, 0, 1, ${now}) + `.pipe( + Effect.flatMap(() => + sql` + INSERT INTO todo_events (at, todo_json, change_json, archived) + VALUES ( + ${now}, + ${JSON.stringify({ + id, + title, + completed: false, + archived: false, + revision: 1, + updatedAt: now + })}, + ${JSON.stringify({ _tag: "TodoCreated" })}, + 0 + ) + ` + ) + ) + ) + }).pipe( + Effect.provide(persistenceLayer(dbFilename)) + ) + ) + +describe("server", () => { + it.effect("routes HTTP messages validated by Schema", () => + Effect.gen(function*() { + yield* Layer.build(appLayer(testServerConfig.dbFilename)).pipe( + Effect.provideService(ServerConfig, testServerConfig) + ) + const client = yield* HttpClient.HttpClient + const response = yield* client.post("/api/dispatch", { + body: HttpBody.jsonUnsafe({ kind: "sum", left: 20, right: 22 }) + }) + + const parsed = yield* HttpClientResponse.schemaBodyJson(ServerMessage)(response) + expect(parsed).toEqual({ kind: "sumResult", total: 42 }) + }).pipe(Effect.provide(NodeHttpServer.layerTest)) + ) + + it.effect("serves static files from local filesystem", () => + Effect.gen(function*() { + yield* Layer.build(appLayer(testServerConfig.dbFilename)).pipe( + Effect.provideService(ServerConfig, testServerConfig) + ) + const text = yield* HttpClient.get("/").pipe( + Effect.flatMap((response) => response.text) + ) + + expect(text).toContain("effect-http-ws-cli") + }).pipe(Effect.provide(NodeHttpServer.layerTest)) + ) + + it.effect("redirects frontend requests to the Vite dev server when enabled", () => + Effect.gen(function*() { + yield* Layer.build(appLayer(testServerConfig.dbFilename)).pipe( + Effect.provideService(ServerConfig, { + ...testServerConfig, + frontendDevOrigin: "http://127.0.0.1:5173" + }) + ) + + const server = yield* HttpServer.HttpServer + const address = server.address as HttpServer.TcpAddress + const response = yield* Effect.promise(() => + fetch(`http://127.0.0.1:${address.port}/todos?filter=active`, { + redirect: "manual" + }) + ) + + expect(response.status).toBe(307) + expect(response.headers.get("location")).toBe("http://127.0.0.1:5173/todos?filter=active") + }).pipe(Effect.provide(NodeHttpServer.layerTest)) + ) + + it.effect("routes WebSocket RPC messages with shared contracts", () => + Effect.gen(function*() { + yield* Layer.build(appLayer(testServerConfig.dbFilename)).pipe( + Effect.provideService(ServerConfig, testServerConfig) + ) + const server = yield* HttpServer.HttpServer + const address = server.address as HttpServer.TcpAddress + const wsUrl = `ws://127.0.0.1:${address.port}/ws` + + const response = yield* Effect.scoped( + withWsRpcClient(wsUrl, (client) => client.echo({ text: "hello from ws" })) + ) + + expect(response).toEqual({ text: "hello from ws" }) + }).pipe(Effect.provide(NodeHttpServer.layerTest)) + ) + + it.effect("routes WebSocket RPC calls for multiple procedures", () => + Effect.gen(function*() { + yield* Layer.build(appLayer(testServerConfig.dbFilename)).pipe( + Effect.provideService(ServerConfig, testServerConfig) + ) + const server = yield* HttpServer.HttpServer + const address = server.address as HttpServer.TcpAddress + const wsUrl = `ws://127.0.0.1:${address.port}/ws` + + const result = yield* Effect.scoped( + withWsRpcClient(wsUrl, (client) => + Effect.all({ + sum: client.sum({ left: 1, right: 2 }), + time: client.time(undefined) + }) + ) + ) + + expect(result.sum).toEqual({ total: 3 }) + expect(typeof result.time.iso).toBe("string") + }).pipe(Effect.provide(NodeHttpServer.layerTest)) + ) + + it.effect("lists todos and streams todo updates from offset", () => + Effect.gen(function*() { + const dbFilename = NodePath.join( + OS.tmpdir(), + `effect-http-ws-cli-stream-${Date.now()}-${Math.random().toString(16).slice(2)}.sqlite` + ) + + yield* insertTodo(dbFilename, "todo-stream-test", "stream-seed") + + const events = yield* Effect.scoped( + Effect.gen(function*() { + yield* Layer.build(appLayer(dbFilename)).pipe( + Effect.provideService(ServerConfig, { + ...testServerConfig, + dbFilename + }) + ) + const server = yield* HttpServer.HttpServer + const address = server.address as HttpServer.TcpAddress + const wsUrl = `ws://127.0.0.1:${address.port}/ws` + + return yield* withWsRpcClient(wsUrl, (client) => + Effect.gen(function*() { + const snapshot = yield* client.listTodos({ includeArchived: true }) + const firstTodo = snapshot.todos[0] + if (!firstTodo) { + return yield* Effect.die("Expected a todo fixture") + } + + yield* client.renameTodo({ id: firstTodo.id, title: "alpha" }) + yield* client.completeTodo({ id: firstTodo.id, completed: true }) + yield* client.archiveTodo({ id: firstTodo.id, archived: true }) + + return yield* client.subscribeTodos({ + fromOffset: snapshot.offset, + includeArchived: true + }).pipe( + Stream.take(3), + Stream.runCollect + ) + }) + ) + }) + ).pipe( + Effect.ensuring( + Effect.sync(() => { + try { + FileSystem.rmSync(dbFilename, { force: true }) + } catch { + // ignore cleanup failures in tests + } + }) + ) + ) + + expect(events).toHaveLength(3) + expect(events[0]?.change).toEqual({ _tag: "TodoRenamed", title: "alpha" }) + expect(events[1]?.change).toEqual({ _tag: "TodoCompleted", completed: true }) + expect(events[2]?.change).toEqual({ _tag: "TodoArchived", archived: true }) + expect(events[0]?.todo.title).toBe("alpha") + expect(events[1]?.todo.completed).toBe(true) + expect(events[2]?.todo.archived).toBe(true) + }).pipe(Effect.provide(NodeHttpServer.layerTest)) + ) + + it.effect("persists todos across server restarts when using a file database", () => + Effect.gen(function*() { + const dbFilename = NodePath.join( + OS.tmpdir(), + `effect-http-ws-cli-${Date.now()}-${Math.random().toString(16).slice(2)}.sqlite` + ) + + yield* insertTodo(dbFilename, "todo-persist-test", "persist-seed") + + const withServer = (f: (wsUrl: string) => Effect.Effect) => + Effect.scoped( + Effect.gen(function*() { + yield* Layer.build(appLayer(dbFilename)).pipe( + Effect.provideService(ServerConfig, { + ...testServerConfig, + dbFilename + }) + ) + + const server = yield* HttpServer.HttpServer + const address = server.address as HttpServer.TcpAddress + const wsUrl = `ws://127.0.0.1:${address.port}/ws` + return yield* f(wsUrl) + }) + ) + + const renamedTodoId = yield* withServer((wsUrl) => + Effect.scoped( + withWsRpcClient(wsUrl, (client) => + Effect.gen(function*() { + const snapshot = yield* client.listTodos({ includeArchived: true }) + const firstTodo = snapshot.todos[0] + if (!firstTodo) { + return yield* Effect.die("Expected a todo fixture") + } + + yield* client.renameTodo({ id: firstTodo.id, title: "persisted-title" }) + return firstTodo.id + }) + ) + ) + ) + + const persistedTitle = yield* withServer((wsUrl) => + Effect.scoped( + withWsRpcClient(wsUrl, (client) => + Effect.gen(function*() { + const snapshot = yield* client.listTodos({ includeArchived: true }) + const persisted = snapshot.todos.find((todo) => todo.id === renamedTodoId) + if (!persisted) { + return yield* Effect.die("Expected persisted todo") + } + return persisted.title + }) + ) + ) + ).pipe( + Effect.ensuring( + Effect.sync(() => { + try { + FileSystem.rmSync(dbFilename, { force: true }) + } catch { + // ignore cleanup failures in tests + } + }) + ) + ) + + expect(persistedTitle).toBe("persisted-title") + }).pipe(Effect.provide(NodeHttpServer.layerTest)) + ) +}) diff --git a/.reference/server/tsconfig.json b/.reference/server/tsconfig.json new file mode 100644 index 0000000000..de981b3bf8 --- /dev/null +++ b/.reference/server/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../tsconfig.json", + "include": ["src", "test", "vitest.config.ts"] +} diff --git a/.reference/server/vitest.config.ts b/.reference/server/vitest.config.ts new file mode 100644 index 0000000000..7ef18d4fc7 --- /dev/null +++ b/.reference/server/vitest.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config" + +export default defineConfig({ + test: { + include: ["test/**/*.test.ts"], + environment: "node" + } +}) diff --git a/.reference/tsconfig.json b/.reference/tsconfig.json new file mode 100644 index 0000000000..46be07bb98 --- /dev/null +++ b/.reference/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "allowImportingTsExtensions": true, + "rewriteRelativeImportExtensions": true, + "erasableSyntaxOnly": true, + "verbatimModuleSyntax": true, + "noEmit": true, + "strict": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "types": ["node", "vitest/globals"] + } +} diff --git a/.reference/web/index.html b/.reference/web/index.html new file mode 100644 index 0000000000..73b7940744 --- /dev/null +++ b/.reference/web/index.html @@ -0,0 +1,15 @@ + + + + + + effect-http-ws-cli rpc console + + + + + +
+ + + diff --git a/.reference/web/package.json b/.reference/web/package.json new file mode 100644 index 0000000000..b9ba463881 --- /dev/null +++ b/.reference/web/package.json @@ -0,0 +1,33 @@ +{ + "name": "@effect-http-ws-cli/web", + "version": "0.1.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "test": "vitest run", + "lint": "tsc --noEmit" + }, + "dependencies": { + "@effect-http-ws-cli/server": "workspace:*", + "@effect/atom-react": "catalog:", + "@tanstack/react-router": "^1.166.2", + "effect": "catalog:", + "react": "^19.2.0", + "react-dom": "^19.2.0" + }, + "devDependencies": { + "@tanstack/router-plugin": "^1.166.2", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "@vitest/browser-playwright": "^4.0.18", + "playwright": "^1.58.2", + "typescript": "catalog:", + "vite": "^7.2.0", + "vitest": "catalog:", + "vitest-browser-react": "^2.0.5" + } +} diff --git a/.reference/web/src/main.tsx b/.reference/web/src/main.tsx new file mode 100644 index 0000000000..4c9152ef25 --- /dev/null +++ b/.reference/web/src/main.tsx @@ -0,0 +1,17 @@ +import { StrictMode } from "react" +import { createRoot } from "react-dom/client" +import { RegistryProvider } from "@effect/atom-react" +import { createBrowserHistory, RouterProvider } from "@tanstack/react-router" +import { getRouter } from "./router" +import "./styles.css" + +const history = createBrowserHistory() +const router = getRouter(history) + +createRoot(document.getElementById("root")!).render( + + + + + +) diff --git a/.reference/web/src/routeTree.gen.ts b/.reference/web/src/routeTree.gen.ts new file mode 100644 index 0000000000..d204c269b3 --- /dev/null +++ b/.reference/web/src/routeTree.gen.ts @@ -0,0 +1,59 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/': typeof IndexRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/' + fileRoutesByTo: FileRoutesByTo + to: '/' + id: '__root__' | '/' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport + parentRoute: typeof rootRouteImport + } + } +} + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/.reference/web/src/router.tsx b/.reference/web/src/router.tsx new file mode 100644 index 0000000000..7f4fd3d5a4 --- /dev/null +++ b/.reference/web/src/router.tsx @@ -0,0 +1,15 @@ +import { createRouter, type RouterHistory } from "@tanstack/react-router" +import { routeTree } from "./routeTree.gen" + +export const getRouter = (history: RouterHistory) => + createRouter({ + routeTree, + history + }) + + +declare module "@tanstack/react-router" { + interface Register { + router: ReturnType + } +} diff --git a/.reference/web/src/routes/__root.tsx b/.reference/web/src/routes/__root.tsx new file mode 100644 index 0000000000..6198e3b050 --- /dev/null +++ b/.reference/web/src/routes/__root.tsx @@ -0,0 +1,5 @@ +import { Outlet, createRootRoute } from "@tanstack/react-router" + +export const Route = createRootRoute({ + component: Outlet +}) diff --git a/.reference/web/src/routes/index.tsx b/.reference/web/src/routes/index.tsx new file mode 100644 index 0000000000..17d48498ea --- /dev/null +++ b/.reference/web/src/routes/index.tsx @@ -0,0 +1,460 @@ +import { createFileRoute } from "@tanstack/react-router" + + + +import { useEffect, useRef } from "react" +import * as Cause from "effect/Cause" +import * as AsyncResult from "effect/unstable/reactivity/AsyncResult" +import { useAtomRefresh, useAtomSet, useAtomValue } from "@effect/atom-react" +import type { Todo, TodoEvent, TodoChange } from "@effect-http-ws-cli/server/contracts" +import { + archiveTodoMutationAtom, + completeTodoMutationAtom, + renameTodoMutationAtom, + subscribeTodosPullAtom, + todosSnapshotAtom +} from "../rpc" +import { + connectionAtom, + eventsAtom, + mutationBusyAtom, + todoProjectionAtom +} from "../state" + +const reconnectBaseMs = 1_250 +const reconnectMaxMs = 20_000 +const maxReconnectAttempts = 8 + + + +export const Route = createFileRoute("/")({ + component: IndexRoute +}) + +function IndexRoute() { + const setProjection = useAtomSet(todoProjectionAtom) + const setEvents = useAtomSet(eventsAtom) + const setConnection = useAtomSet(connectionAtom) + const setBusy = useAtomSet(mutationBusyAtom) + + const snapshotResult = useAtomValue(todosSnapshotAtom) + const subscriptionPullResult = useAtomValue(subscribeTodosPullAtom) + const pullSubscription = useAtomSet(subscribeTodosPullAtom) + const refreshSubscription = useAtomRefresh(subscribeTodosPullAtom) + + const seenOffsetsRef = useRef>(new Set()) + const baselineOffsetRef = useRef(0) + const hasInitializedRef = useRef(false) + const hasStartedSubscriptionRef = useRef(false) + const brokenSubscriptionRef = useRef(false) + + const reconnectAttemptsRef = useRef(0) + const reconnectTimerRef = useRef | null>(null) + + const clearReconnectTimer = () => { + if (reconnectTimerRef.current !== null) { + clearTimeout(reconnectTimerRef.current) + reconnectTimerRef.current = null + } + } + + const startSubscriptionPull = () => { + clearReconnectTimer() + if (!hasStartedSubscriptionRef.current) { + hasStartedSubscriptionRef.current = true + } + setConnection((current) => ({ ...current, subscriptionState: "connecting" })) + refreshSubscription() + pullSubscription(undefined) + } + + const scheduleReconnect = (lastError: string) => { + brokenSubscriptionRef.current = true + reconnectAttemptsRef.current += 1 + + if (reconnectAttemptsRef.current > maxReconnectAttempts) { + setConnection((current) => ({ + ...current, + lastError, + subscriptionState: "idle" + })) + return + } + + const delayMs = Math.min( + reconnectBaseMs * 2 ** Math.max(0, reconnectAttemptsRef.current - 1), + reconnectMaxMs + ) + + setConnection((current) => ({ + ...current, + lastError, + subscriptionState: "connecting" + })) + + clearReconnectTimer() + reconnectTimerRef.current = setTimeout(() => { + reconnectTimerRef.current = null + startSubscriptionPull() + }, delayMs) + } + + const addEvent = (event: TodoEvent): boolean => { + if (event.offset <= baselineOffsetRef.current) { + return false + } + + if (seenOffsetsRef.current.has(event.offset)) { + return false + } + + seenOffsetsRef.current.add(event.offset) + setEvents((events) => [...events, event]) + return true + } + + const applyEvent = (event: TodoEvent) => { + setProjection((current) => ({ + ...current, + lastOffset: Math.max(current.lastOffset, event.offset), + todos: sortTodos( + current.todos.some((todo) => todo.id === event.todo.id) + ? current.todos.map((todo) => (todo.id === event.todo.id ? event.todo : todo)) + : [...current.todos, event.todo] + ), + titleDrafts: { + ...current.titleDrafts, + [event.todo.id]: event.todo.title + } + })) + } + + const applyTodoEvent = (event: TodoEvent) => { + const isNew = addEvent(event) + if (isNew) { + applyEvent(event) + } + } + + useEffect(() => { + if (AsyncResult.isInitial(snapshotResult)) { + return + } + + if (AsyncResult.isFailure(snapshotResult)) { + scheduleReconnect(Cause.pretty(snapshotResult.cause)) + return + } + + const snapshot = snapshotResult.value + + setProjection({ + todos: sortTodos(snapshot.todos), + lastOffset: snapshot.offset, + titleDrafts: Object.fromEntries(snapshot.todos.map((todo) => [todo.id, todo.title])) + }) + + if (!hasInitializedRef.current) { + hasInitializedRef.current = true + baselineOffsetRef.current = snapshot.offset + seenOffsetsRef.current = new Set() + setEvents([]) + startSubscriptionPull() + } + }, [snapshotResult, setEvents, setProjection]) + + useEffect(() => { + if (!hasStartedSubscriptionRef.current) { + return + } + + if (AsyncResult.isInitial(subscriptionPullResult)) { + setConnection((current) => ({ + ...current, + subscriptionState: subscriptionPullResult.waiting ? "connected" : "connecting" + })) + return + } + + if (AsyncResult.isFailure(subscriptionPullResult)) { + scheduleReconnect(Cause.pretty(subscriptionPullResult.cause)) + return + } + + reconnectAttemptsRef.current = 0 + brokenSubscriptionRef.current = false + + setConnection((current) => ({ + ...current, + lastError: null, + subscriptionState: "connected" + })) + + for (const event of subscriptionPullResult.value.items) { + applyTodoEvent(event) + } + + if (!subscriptionPullResult.value.done && !subscriptionPullResult.waiting) { + pullSubscription(undefined) + } + }, [pullSubscription, setConnection, subscriptionPullResult]) + + useEffect(() => { + const reconnectOnFocus = () => { + if (document.visibilityState !== "visible") { + return + } + + if (!brokenSubscriptionRef.current) { + return + } + + reconnectAttemptsRef.current = 0 + startSubscriptionPull() + } + + window.addEventListener("focus", reconnectOnFocus) + document.addEventListener("visibilitychange", reconnectOnFocus) + + return () => { + window.removeEventListener("focus", reconnectOnFocus) + document.removeEventListener("visibilitychange", reconnectOnFocus) + } + }, [setConnection]) + + useEffect(() => { + return () => { + clearReconnectTimer() + } + }, []) + + const runMutation: MutationRunner = (label, run, onSuccess) => { + setBusy(label) + setConnection((current) => ({ ...current, lastError: null })) + + void run().then( + (value) => { + onSuccess(value) + }, + (error) => { + setConnection((current) => ({ ...current, lastError: Cause.pretty(error) })) + } + ).finally(() => { + setBusy(null) + }) + } + + return ( +
+ + +
+

effect-http-ws-cli

+

Realtime Todo Stream

+

+ Snapshot on load, then live updates over typed WebSocket RPC subscriptions. +

+
+ + + +
+
+ ) +} + + + + +type MutationRunner = ( + label: string, + run: () => Promise, + onSuccess: (value: A) => void +) => void + +const sortTodos = (todos: ReadonlyArray): ReadonlyArray => + [...todos].sort((a, b) => { + if (a.archived !== b.archived) return a.archived ? 1 : -1 + if (a.completed !== b.completed) return a.completed ? 1 : -1 + return a.id.localeCompare(b.id) + }) + +const describeChange = (change: TodoChange): string => { + switch (change._tag) { + case "TodoCreated": + return "created" + case "TodoRenamed": + return `renamed to "${change.title}"` + case "TodoCompleted": + return change.completed ? "completed" : "marked incomplete" + case "TodoArchived": + return change.archived ? "archived" : "unarchived" + } +} + +const Status = () => { + const connection = useAtomValue(connectionAtom) + const busy = useAtomValue(mutationBusyAtom) + + return ( +
+
+
+ Subscription + {connection.subscriptionState} +
+
+ Mutation + {busy ? busy : "idle"} +
+
+
+ ) +} + +const TodoPanel = (props: { + readonly runMutation: MutationRunner + readonly applyTodoEvent: (event: TodoEvent) => void +}) => { + const projection = useAtomValue(todoProjectionAtom) + const connection = useAtomValue(connectionAtom) + const setProjection = useAtomSet(todoProjectionAtom) + const renameTodo = useAtomSet(renameTodoMutationAtom, { mode: "promise" }) + const completeTodo = useAtomSet(completeTodoMutationAtom, { mode: "promise" }) + const archiveTodo = useAtomSet(archiveTodoMutationAtom, { mode: "promise" }) + + return ( +
+
+

Todos

+
+ offset #{projection.lastOffset} + subscription: {connection.subscriptionState} +
+
+ +
    + {projection.todos.map((todo) => ( +
  • +
    + { + setProjection((current) => ({ + ...current, + titleDrafts: { + ...current.titleDrafts, + [todo.id]: event.target.value + } + })) + }} + /> + + rev {todo.revision} ยท {new Date(todo.updatedAt).toLocaleTimeString()} + +
    +
    + + + +
    +
  • + ))} +
+
+ ) +} + +const EventList = () => { + const events = useAtomValue(eventsAtom) + + return ( +
+
+

Events

+
+ {events.length} total +
+
+ +
    + {[...events].reverse().map((event) => ( +
  • +
    + #{event.offset} + {new Date(event.at).toLocaleTimeString()} +
    +
    + {event.todo.title} + {describeChange(event.change)} +
    +
  • + ))} +
+
+ ) +} + +const Footer = () => { + const connection = useAtomValue(connectionAtom) + + return ( +
+ {connection.lastError ? {connection.lastError} : no errors} +
+ ) +} diff --git a/.reference/web/src/rpc.ts b/.reference/web/src/rpc.ts new file mode 100644 index 0000000000..3c686a68a0 --- /dev/null +++ b/.reference/web/src/rpc.ts @@ -0,0 +1,41 @@ +import * as Layer from "effect/Layer" +import * as RpcClient from "effect/unstable/rpc/RpcClient" +import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization" +import * as AtomRpc from "effect/unstable/reactivity/AtomRpc" +import * as Socket from "effect/unstable/socket/Socket" +import { WsRpcGroup } from "@effect-http-ws-cli/server/contracts" + +const wsUrl = () => { + const protocol = window.location.protocol === "https:" ? "wss" : "ws" + return `${protocol}://${window.location.host}/ws` +} + +const protocolLayer = RpcClient.layerProtocolSocket({ + retryTransientErrors: true +}).pipe( + Layer.provide(Socket.layerWebSocket(wsUrl())), + Layer.provide(Socket.layerWebSocketConstructorGlobal), + Layer.provide(RpcSerialization.layerJson) +) + +export class TodoRpcClient extends AtomRpc.Service()("TodoRpcClient", { + group: WsRpcGroup, + protocol: protocolLayer +}) {} + +export const todosSnapshotAtom = TodoRpcClient.query( + "listTodos", + { includeArchived: true } +) + +export const subscribeTodosPullAtom = TodoRpcClient.query( + "subscribeTodos", + { + fromOffset: 0, + includeArchived: true + } +) + +export const renameTodoMutationAtom = TodoRpcClient.mutation("renameTodo") +export const completeTodoMutationAtom = TodoRpcClient.mutation("completeTodo") +export const archiveTodoMutationAtom = TodoRpcClient.mutation("archiveTodo") diff --git a/.reference/web/src/state.ts b/.reference/web/src/state.ts new file mode 100644 index 0000000000..f7516f8ba2 --- /dev/null +++ b/.reference/web/src/state.ts @@ -0,0 +1,34 @@ +import * as Atom from "effect/unstable/reactivity/Atom" +import type { Todo, TodoEvent } from "@effect-http-ws-cli/server/contracts" + +export type SubscriptionState = "connecting" | "connected" | "idle" + +export interface TodoProjectionState { + readonly todos: ReadonlyArray + readonly titleDrafts: Readonly> + readonly lastOffset: number +} + +export interface ConnectionState { + readonly subscriptionState: SubscriptionState + readonly lastError: string | null +} + +export const todoProjectionAtom = Atom.make({ + todos: [], + titleDrafts: {}, + lastOffset: 0 +}).pipe(Atom.withLabel("todo-projection")) + +export const eventsAtom = Atom.make>([]).pipe( + Atom.withLabel("events") +) + +export const connectionAtom = Atom.make({ + subscriptionState: "idle", + lastError: null +}).pipe(Atom.withLabel("connection")) + +export const mutationBusyAtom = Atom.make(null).pipe( + Atom.withLabel("mutation-busy") +) diff --git a/.reference/web/src/styles.css b/.reference/web/src/styles.css new file mode 100644 index 0000000000..436d8a86a0 --- /dev/null +++ b/.reference/web/src/styles.css @@ -0,0 +1,298 @@ +:root { + --paper: #f3f0e8; + --ink: #13222c; + --ink-soft: #345264; + --accent: #dc4f18; + --accent-soft: #f8bb68; + --panel: #fffdf6; + --line: #162f3f22; + --shadow: 0 16px 40px #0f1e291f; +} + +* { + box-sizing: border-box; +} + +body { + margin: 0; + min-height: 100vh; + font-family: "IBM Plex Sans", "Segoe UI", sans-serif; + color: var(--ink); + background: + radial-gradient(circle at 10% 10%, #f7cf9a 0%, transparent 36%), + radial-gradient(circle at 92% 88%, #95c7d2 0%, transparent 32%), + linear-gradient(165deg, #ece8dc 0%, var(--paper) 48%, #e9dfcf 100%); +} + +.shell { + width: min(1100px, 100% - 2rem); + margin: 1.5rem auto; + padding: 1.5rem; + border: 1px solid var(--line); + border-radius: 20px; + background: color-mix(in oklab, var(--paper), white 35%); + box-shadow: var(--shadow); +} + +.hero { + position: relative; + overflow: hidden; + padding: 1.5rem; + border-radius: 16px; + border: 1px solid var(--line); + background: linear-gradient(140deg, #fff9ed 0%, #f7efe0 65%, #f2e7d4 100%); +} + +.hero::after { + content: ""; + position: absolute; + width: 220px; + height: 220px; + right: -60px; + top: -90px; + border-radius: 999px; + background: linear-gradient(180deg, var(--accent-soft), transparent 70%); + pointer-events: none; +} + +.eyebrow { + margin: 0; + font-size: 0.72rem; + letter-spacing: 0.22em; + text-transform: uppercase; + color: var(--ink-soft); +} + +h1, +h2 { + font-family: "Archivo Black", Impact, sans-serif; + letter-spacing: 0.02em; + margin: 0; +} + +h1 { + margin-top: 0.35rem; + font-size: clamp(1.5rem, 4vw, 2.35rem); +} + +h2 { + font-size: 1.1rem; +} + +.lead { + margin: 0.6rem 0 0; + color: var(--ink-soft); + max-width: 68ch; +} + +.panel { + border: 1px solid var(--line); + border-radius: 14px; + padding: 1rem; + background: var(--panel); + margin-top: 1rem; +} + +.status-panel { + margin-top: 0; + background: linear-gradient(140deg, #fbf7ee, #f1e8d7); +} + +.status-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 0.7rem; +} + +.status-item { + border: 1px solid var(--line); + border-radius: 10px; + padding: 0.55rem 0.7rem; + display: flex; + justify-content: space-between; + align-items: baseline; + gap: 0.75rem; + background: #fff; +} + +.status-label { + color: var(--ink-soft); + font-size: 0.82rem; +} + +.status-subscription-connected { + border-color: #24704755; + background: #f1fbf5; +} + +.status-subscription-connecting { + border-color: #8d6a1b55; + background: #fff8eb; +} + +.status-subscription-idle { + border-color: var(--line); +} + +.status-mutation-busy { + border-color: #6b3b2e55; + background: #fff3ef; +} + +.todo-header { + display: flex; + justify-content: space-between; + align-items: baseline; + gap: 1rem; +} + +.meta { + display: flex; + gap: 0.75rem; + color: var(--ink-soft); + font-size: 0.86rem; +} + +.todo-list { + margin: 0.8rem 0 0; + padding: 0; + list-style: none; + display: grid; + gap: 0.6rem; +} + +.event-list { + margin: 0.8rem 0 0; + padding: 0; + list-style: none; + display: grid; + gap: 0.5rem; + max-height: 260px; + overflow: auto; +} + +.event-item { + border: 1px solid var(--line); + border-radius: 10px; + background: #fff; + padding: 0.55rem 0.65rem; +} + +.event-top { + display: flex; + justify-content: space-between; + gap: 0.6rem; + color: var(--ink-soft); + font-size: 0.8rem; +} + +.event-body { + margin-top: 0.2rem; + display: flex; + justify-content: space-between; + gap: 0.75rem; + font-size: 0.9rem; +} + +.event-body small { + color: var(--ink-soft); + white-space: nowrap; +} + +.todo-item { + display: flex; + gap: 0.8rem; + align-items: center; + border: 1px solid var(--line); + border-radius: 10px; + background: #fff; + padding: 0.65rem; +} + +.todo-main { + flex: 1; +} + +.todo-main input { + width: 100%; + margin: 0; + border: 1px solid var(--line); + background: #fff; + border-radius: 8px; + padding: 0.42rem 0.55rem; + color: var(--ink); + font: inherit; + font-weight: 600; +} + +.todo-main small { + display: block; + margin-top: 0.3rem; + color: var(--ink-soft); +} + +.todo-actions { + display: flex; + gap: 0.45rem; +} + +button { + border: 1px solid #0f243233; + border-radius: 8px; + background: linear-gradient(160deg, #fff, #f4efe3); + color: var(--ink); + padding: 0.4rem 0.6rem; + font: inherit; + font-size: 0.85rem; + font-weight: 700; + cursor: pointer; + transition: transform 120ms ease, box-shadow 120ms ease; +} + +button:hover { + transform: translateY(-1px); + box-shadow: 0 8px 18px #0f20321a; +} + +.todo-item.is-completed .todo-main input { + text-decoration: line-through; + color: var(--ink-soft); +} + +.todo-item.is-archived { + opacity: 0.64; +} + +.footer { + margin-top: 1rem; + display: flex; + gap: 1rem; + align-items: center; + font-size: 0.88rem; + color: var(--ink-soft); +} + +.error { + color: var(--accent); + font-weight: 700; +} + +@media (max-width: 880px) { + .shell { + width: min(1100px, 100% - 1rem); + padding: 1rem; + } + + .todo-item { + flex-direction: column; + align-items: stretch; + } + + .todo-actions { + justify-content: flex-end; + } + + .status-grid { + grid-template-columns: 1fr; + } +} diff --git a/.reference/web/test/app.browser.test.tsx b/.reference/web/test/app.browser.test.tsx new file mode 100644 index 0000000000..a9527483f6 --- /dev/null +++ b/.reference/web/test/app.browser.test.tsx @@ -0,0 +1,74 @@ +import * as React from "react" +import { RegistryProvider } from "@effect/atom-react" +import * as AsyncResult from "effect/unstable/reactivity/AsyncResult" +import * as Atom from "effect/unstable/reactivity/Atom" +import { describe, expect, it, vi } from "vitest" +import { render } from "vitest-browser-react" +import { createMemoryHistory, RouterProvider } from "@tanstack/react-router" +import { getRouter } from "../src/router" + +vi.mock("../src/rpc.ts", () => { + const initialSnapshot = AsyncResult.success({ + offset: 42, + todos: [ + { + id: "todo-1", + title: "Harness Todo", + completed: false, + archived: false, + revision: 1, + updatedAt: "2026-03-05T00:00:00.000Z" + } + ] + }) + + const noopSubscription = AsyncResult.initial<{ + readonly done: boolean + readonly items: ReadonlyArray + }>(true) + + const mutationResult = AsyncResult.success({ + offset: 43, + at: "2026-03-05T00:00:01.000Z", + todo: { + id: "todo-1", + title: "Harness Todo", + completed: false, + archived: false, + revision: 1, + updatedAt: "2026-03-05T00:00:01.000Z" + }, + change: { _tag: "TodoRenamed", title: "Harness Todo" as const } + }) + + return { + todosSnapshotAtom: Atom.make(initialSnapshot), + subscribeTodosPullAtom: Atom.writable( + () => noopSubscription, + () => { + // no-op: smoke test doesn't exercise stream pulling + } + ), + renameTodoMutationAtom: Atom.make(mutationResult), + completeTodoMutationAtom: Atom.make(mutationResult), + archiveTodoMutationAtom: Atom.make(mutationResult) + } +}) + + + +describe("web app harness", () => { + it("renders App in browser mode", async () => { + const history = createMemoryHistory() + const router = getRouter(history) + const screen = await render( + + + + ) + + await expect.element(screen.getByRole("heading", { name: "Realtime Todo Stream" })).toBeVisible() + await expect.element(screen.getByRole("heading", { name: "Todos" })).toBeVisible() + await expect.element(screen.getByRole("textbox")).toHaveValue("Harness Todo") + }) +}) diff --git a/.reference/web/tsconfig.json b/.reference/web/tsconfig.json new file mode 100644 index 0000000000..656793a086 --- /dev/null +++ b/.reference/web/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "jsx": "react-jsx", + "strict": true, + "noEmit": true, + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "esModuleInterop": true, + "skipLibCheck": true, + "types": ["vite/client"] + }, + "include": ["src", "vite.config.ts", "vitest.config.ts"] +} diff --git a/.reference/web/vite.config.ts b/.reference/web/vite.config.ts new file mode 100644 index 0000000000..f9536c3cdc --- /dev/null +++ b/.reference/web/vite.config.ts @@ -0,0 +1,30 @@ +import { defineConfig } from "vite" +import react from "@vitejs/plugin-react" +import { TanStackRouterVite } from "@tanstack/router-plugin/vite" + +const backendOrigin = process.env.VITE_BACKEND_ORIGIN ?? "http://127.0.0.1:8787" + +export default defineConfig({ + plugins: [TanStackRouterVite(), react()], + server: { + proxy: { + "/api": { + target: backendOrigin, + changeOrigin: true + }, + "/health": { + target: backendOrigin, + changeOrigin: true + }, + "/ws": { + target: backendOrigin, + changeOrigin: true, + ws: true + } + } + }, + build: { + outDir: "../public", + emptyOutDir: true + } +}) diff --git a/.reference/web/vitest.config.ts b/.reference/web/vitest.config.ts new file mode 100644 index 0000000000..73f0839fb1 --- /dev/null +++ b/.reference/web/vitest.config.ts @@ -0,0 +1,31 @@ +import { playwright } from "@vitest/browser-playwright" +import react from "@vitejs/plugin-react" +import { defineConfig } from "vitest/config" + +export default defineConfig({ + plugins: [react()], + optimizeDeps: { + include: [ + "react", + "react-dom", + "react/jsx-dev-runtime", + "@tanstack/react-router", + "@effect/atom-react", + "vitest-browser-react", + "effect/unstable/reactivity/Atom", + "effect/unstable/reactivity/AsyncResult" + ] + }, + test: { + include: ["test/**/*.browser.test.tsx"], + browser: { + enabled: true, + provider: playwright(), + instances: [ + { + browser: "chromium" + } + ] + } + } +})