commit 89eeea485514c1c1063482f33ba689e0a298fcd5 Author: Виталий Оскарев Date: Mon Nov 16 14:32:08 2026 +0700 Новогодний квиз: ядро, сервер и три экрана - ядро: контент, reducer всех фаз, undo, проекции по ролям - сервер: комнаты, сокеты, таймеры, раздача интерфейса и медиа - интерфейс: табло, пульт ведущего, телефон игрока - контент: пак 5x5 с финалом и демо-пак с рабочим аудио - 57 тестов и e2e на трёх вкладках diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2a67c07 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,10 @@ +# Единые переводы строк в репозитории и в рабочей копии. +# Без этого Windows-настройка core.autocrlf=true превращает любую правку +# одного файла в диф на весь файл. +* text=auto eol=lf + +*.png binary +*.jpg binary +*.wav binary +*.mp3 binary +*.ico binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..beb775f --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +node_modules/ +dist/ +*.local +*.log +.DS_Store +.vscode/* +!.vscode/settings.json +coverage/ +.screenshots/ +.chrome-profile/ +.npm-cache/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..3d78165 --- /dev/null +++ b/README.md @@ -0,0 +1,188 @@ +# Новогодний квиз + +Квиз в формате «Своей игры»: табло на проекторе, телефоны игроков, ведущий с +ноутбука и пульта. Сервер поднимается на ноутбуке в локальной сети — интернет +во время игры не нужен. + +Архитектура и обоснование решений: [docs/architecture.md](docs/architecture.md). + +## Статус + +| Этап | Что | Готово | +|---|---|---| +| 1 | Ядро: типы, схема пака, reducer, движок, проекции, тесты | ✅ | +| 2 | Сервер: комнаты, сокеты, таймеры, рассылка | ✅ | +| 3 | Табло и пульт ведущего (Vue) | ✅ | +| 4 | Телефоны игроков, QR, реконнект | ✅ | +| 5 | Полировка: звук, вспышки, переходы, медиа в финале | ✅ | + +Играть можно по-настоящему: табло на проекторе, ведущий с ноутбука или телефона, +игроки со своих телефонов. Комната одна, партия живёт в памяти сервера. + +## Как играть + +1. `npm run dev` — сервер печатает комнату и адрес, по которому дойдут телефоны. + По умолчанию загружается демо-пак; боевой выбирается так: + + ```powershell + $env:QUIZ_PACK='novy-god-2027'; npm run dev + ``` + +2. На ноутбуке с проектором: открыть `http://<адрес>:5173/board`. +3. Ведущий: открыть `http://<адрес>:5173/host/<токен>` — токен печатает сервер. +4. Игроки: навести камеру на QR с табло и ввести имя. + +Дальше всё как в «Своей игре»: ведущий открывает клетки, игроки нажимают +«Ответить», судит ведущий. Телефон можно заблокировать — место и очки +восстановятся сами, по токену из памяти браузера. + +## Перед игрой: пять минут проверки + +Это список того, что реально ломает вечер, а не того, что приятно проверить. + +1. **Одна сеть, без изоляции клиентов.** В гостевых Wi-Fi телефоны часто не + видят ноутбук. Если сомневаетесь — раздайте точку доступа с ноутбука. +2. **Брандмауэр Windows.** При первом запуске он спросит про `node.exe` — + разрешить для частных сетей. Если окно пропустили, телефоны не подключатся. +3. **Звук на табло.** Нажать 🔇 в правом верхнем углу: браузер не даёт звучать + без действия пользователя. Настройка запоминается, но после перезагрузки + нужен ещё один клик по табло. +4. **Один телефон по QR.** До гостей, а не при них. +5. **Репетиция.** Пройти пару клеток и нажать «⟲ Заново» — партия обнулится, + подключённые игроки останутся. + +## Звук + +Ни одного аудиофайла: тоны синтезируются в браузере +([audio/sfx.ts](packages/web/src/audio/sfx.ts)). Причина практическая — на +площадке нечему не загрузиться и нечего забыть скопировать на другой ноутбук. + +## Структура + +``` +quiz/ +├─ content/packs/ паки вопросов (JSON) + content/media/ для аудио и картинок +├─ docs/architecture.md архитектура и принятые решения +└─ packages/ + ├─ shared/src/ чистая игровая логика, без сети и UI + │ ├─ types.ts контракт: контент, состояние, команды, события + │ ├─ pack.ts zod-схема пака, валидация, ключи клеток + │ ├─ game.ts reducer: все фазы партии, очки, таймеры, спецклетки + │ ├─ engine.ts история для undo + защита от двойных команд + │ ├─ projection.ts что видит табло, ведущий и игрок + │ └─ protocol.ts проводной протокол: роли, рукопожатие, сообщения + ├─ server/src/ Fastify + Socket.IO на одном порту + │ ├─ app.ts сборка HTTP и сокетов, раздача интерфейса и медиа + │ ├─ room.ts комната: авторизация ролей, команды, тик, рассылка + │ ├─ content.ts загрузка паков; битый пак не роняет сервер + │ └─ network.ts выбор адреса, по которому телефоны дойдут до ноутбука + └─ web/src/ три экрана на Vue 3 + ├─ views/ BoardView (проектор), HostView (пульт), PlayerView (телефон) + ├─ net/game.ts одно соединение страницы: состояние, команды, реконнект + └─ components/ табло, вопрос с медиа, таймер, счёт +``` + +## Команды + +```bash +npm install # один раз +npm run dev # сервер :3000 + табло :5173 (Vite проксирует сокеты) +npm test # тесты ядра и сервера (vitest) +npm run typecheck # tsc + vue-tsc по всем пакетам +npm run build # продакшн-сборка табло в packages/web/dist +npm start # прод: один порт :3000 раздаёт и интерфейс, и сокеты +``` + +Сервер печатает при старте код комнаты и адрес, по которому к нему дойдут +телефоны (он выбирается по диапазону IP, а не по имени адаптера — виртуальные +адаптеры VPN и WSL игнорируются). + +Проверка интерфейса в настоящем браузере (нужен запущенный `npm run dev`): + +```powershell +# отдельное окно: фиксированные комната и токен +$env:QUIZ_ROOM='TEST'; $env:QUIZ_HOST_TOKEN='smoke-token'; npm run dev + +node scripts/smoke.mjs +``` + +Скрипт открывает три вкладки — табло, телефон и пульт — и проходит партию до +первого очка: проверяет, что ответ не утёк на табло, а очки дошли до телефона. +Скриншоты складываются в `.screenshots/`. + +Постоянные комната и токен (переменные `QUIZ_ROOM`, `QUIZ_HOST_TOKEN`) полезны +и в жизни: ссылка на пульт не меняется при перезапуске сервера. + +## Как добавить вопросы + +Пак — это JSON в `content/packs/`. Минимальная клетка: + +```json +{ + "value": 100, + "question": { "text": "Сколько ударов бьют куранты?", "answer": "Двенадцать" } +} +``` + +Поля клетки: + +| Поле | Обязательно | Смысл | +|---|---|---| +| `value` | да | номинал, он же подпись клетки на табло | +| `kind` | нет | `normal` (по умолчанию), `cat_in_bag`, `auction`, `super` | +| `question.text` | да, если нет `media` | текст вопроса | +| `question.media` | нет | `{ "kind": "audio" \| "image" \| "video", "src": "/media/..." }` | +| `question.answer` | да | ответ; **на табло и телефоны не уходит** до вскрытия | +| `question.comment` | нет | ремарка ведущему | +| `timeLimit` | нет | секунды на вопрос, по умолчанию из `settings` | + +Правила, которые проверяет схема: + +- у всех тем раунда одинаковое число клеток (табло — прямоугольник); +- номиналы внутри темы не повторяются; +- `media.src` начинается с `/media/` — файлы раздаёт наш же сервер, без CDN; +- `final` можно задать только при `settings.finalEnabled = true`. + +Медиа лежит в `content/media//`, например +`content/media/demo/jingle-bells.wav` → `"src": "/media/demo/jingle-bells.wav"`. +Формат любой (mp3, wav, ogg). Готовый пример с музыкой — клетка «Музыка / 100» +в демо-паке. + +## Паки + +| Файл | Что это | +|---|---| +| `novy-god-2027.json` | игра на вечер: 5 тем × 5 вопросов и финал | +| `demo.json` | маленький, для проверки движка | + +Сервер берёт пак, первый по алфавиту. Выбрать другой: + +```powershell +$env:QUIZ_PACK='novy-god-2027'; npm run dev +``` + +Тесты проверяют **все** паки в `content/packs/`: схему и то, что каждый +медиафайл действительно лежит на диске. Самый обидный баг вечера — вопрос с +музыкой, у которого нет файла, поэтому он ловится на `npm test`. + +## Что уже умеет движок + +- Фазы: лобби → раунд → табло → вопрос → нажатие → ответ → вскрытие → финал → итоги. +- Таймеры на вопрос и на ответ; просроченный ответ = неверный. +- Штраф за неверный ответ (`wrongPenalty`), вопрос возвращается остальным, + ответивший больше не может нажать на этот вопрос. +- «Кот в мешке»: передаёт тот, кто открыл клетку, и не себе. +- «Аукцион»: игроки ставят, играет ставка победителя, но не выше номинала. +- «Супер»: номинал удваивается. +- Финал со ставками и судейством каждого игрока отдельно. +- Undo на 20 шагов, ручная правка очков. +- Идемпотентность: повторная команда с тем же `cmdId` не применяется дважды. + +## Что важно помнить + +**Правильный ответ не покидает сервер до вскрытия.** `board` и `player` получают +проекцию без `answer`; ведущий — с `answer`, потому что по нему судит. Это +проверяется тестом, а не соглашением между разработчиками. + +**Ключ клетки — `roundId/themeId/index`.** Он не зависит от текста вопроса, +поэтому правка формулировок не ломает сохранённую партию. diff --git a/content/media/demo/jingle-bells.wav b/content/media/demo/jingle-bells.wav new file mode 100644 index 0000000..a34904b Binary files /dev/null and b/content/media/demo/jingle-bells.wav differ diff --git a/content/packs/demo.json b/content/packs/demo.json new file mode 100644 index 0000000..60724a8 --- /dev/null +++ b/content/packs/demo.json @@ -0,0 +1,177 @@ +{ + "id": "demo", + "title": "Демо-квиз: проверка движка", + "settings": { + "wrongPenalty": "value", + "buzzers": true, + "finalEnabled": true, + "defaultTimeLimit": 30, + "answerTimeLimit": 20, + "auctionTimeLimit": 30, + "betTimeLimit": 20 + }, + "rounds": [ + { + "id": "r1", + "title": "Раунд 1. Новогодний стол", + "themes": [ + { + "id": "table", + "title": "Стол", + "cells": [ + { + "value": 100, + "question": { + "text": "Главный салат новогоднего стола, названный в честь французского повара", + "answer": "Оливье", + "comment": "Люсьен Оливье держал в Москве ресторан «Эрмитаж»." + } + }, + { + "value": 200, + "kind": "cat_in_bag", + "question": { + "text": "Сколько ударов бьют куранты в новогоднюю ночь?", + "answer": "Двенадцать", + "comment": "Последний, двенадцатый удар — момент, когда принято загадывать желание." + } + }, + { + "value": 300, + "question": { + "text": "Из какой страны в Россию привезли мандарины как новогодний фрукт?", + "answer": "Из Марокко", + "comment": "Традиция пошла от поставок цитрусовых в СССР в 1960-е." + } + } + ] + }, + { + "id": "tree", + "title": "Ёлка", + "cells": [ + { + "value": 100, + "question": { + "text": "Чем по традиции украшают макушку ёлки?", + "answer": "Звездой" + } + }, + { + "value": 200, + "question": { + "text": "Как называется длинная лента из лампочек, которую вешают на ёлку?", + "answer": "Гирлянда" + } + }, + { + "value": 300, + "question": { + "text": "В какой стране впервые начали украшать ёлку на Рождество?", + "answer": "В Германии", + "comment": "Немецкая традиция, известная с XVI века." + } + } + ] + }, + { + "id": "cinema", + "title": "Кино", + "cells": [ + { + "value": 100, + "question": { + "text": "В каком фильме герой случайно улетает в Ленинград и попадает на чужую улицу с тем же адресом?", + "answer": "Ирония судьбы, или С лёгким паром!" + } + }, + { + "value": 200, + "question": { + "text": "Кто сыграл Женю Лукашина в «Иронии судьбы»?", + "answer": "Андрей Мягков" + } + }, + { + "value": 300, + "kind": "super", + "question": { + "text": "В каком фильме мальчик остаётся один дома на Рождество и защищает дом от грабителей?", + "answer": "Один дома", + "comment": "Вопрос-супер: номинал удваивается." + } + } + ] + }, + { + "id": "music", + "title": "Музыка", + "cells": [ + { + "value": 100, + "question": { + "media": { + "kind": "audio", + "src": "/media/demo/jingle-bells.wav", + "hint": "Угадайте мелодию" + }, + "answer": "Jingle Bells", + "comment": "Файл сгенерирован скриптом scripts/make-audio.mjs — замените своим." + } + }, + { + "value": 200, + "question": { + "text": "У какой группы есть песня «Happy New Year»?", + "answer": "ABBA" + } + }, + { + "value": 300, + "question": { + "text": "Кто поёт «Три белых коня» в фильме «Чародеи»?", + "answer": "Лариса Долина" + } + } + ] + }, + { + "id": "omens", + "title": "Приметы", + "cells": [ + { + "value": 100, + "question": { + "text": "В какое время суток по традиции наступает Новый год?", + "answer": "В полночь" + } + }, + { + "value": 200, + "kind": "auction", + "question": { + "text": "Как называется вечер накануне Рождества?", + "answer": "Сочельник" + } + }, + { + "value": 300, + "question": { + "text": "Какое животное по восточному календарю считается символом 2027 года?", + "answer": "Коза", + "comment": "Огненная Коза, если быть точным." + } + } + ] + } + ] + } + ], + "final": { + "question": { + "text": "Что принято делать под бой курантов, пока часы ещё бьют?", + "answer": "Загадывать желание", + "comment": "Считается, что нужно успеть до последнего удара." + } + } +} diff --git a/content/packs/novy-god-2027.json b/content/packs/novy-god-2027.json new file mode 100644 index 0000000..df828dd --- /dev/null +++ b/content/packs/novy-god-2027.json @@ -0,0 +1,244 @@ +{ + "id": "novy-god-2027", + "title": "Новогодний квиз 2027", + "settings": { + "wrongPenalty": "value", + "buzzers": true, + "finalEnabled": true, + "defaultTimeLimit": 40, + "answerTimeLimit": 20, + "auctionTimeLimit": 30, + "betTimeLimit": 20 + }, + "rounds": [ + { + "id": "r1", + "title": "Раунд 1. Новогодний вечер", + "themes": [ + { + "id": "table", + "title": "Новогодний стол", + "cells": [ + { + "value": 100, + "question": { + "text": "Главный салат новогоднего стола, названный в честь французского повара", + "answer": "Оливье", + "comment": "Люсьен Оливье держал в Москве ресторан «Эрмитаж»." + } + }, + { + "value": 200, + "question": { + "text": "Какой цитрус в России традиционно считается новогодним фруктом?", + "answer": "Мандарин" + } + }, + { + "value": 300, + "question": { + "text": "Каким напитком по традиции встречают Новый год?", + "answer": "Шампанское" + } + }, + { + "value": 400, + "question": { + "text": "В какой стране на Новый год съедают двенадцать виноградин — по одной на каждый удар часов?", + "answer": "В Испании", + "comment": "Традиция «двенадцати виноградин» (las doce uvas)." + } + }, + { + "value": 500, + "question": { + "text": "Как называется французское рождественское полено из бисквита и крема?", + "answer": "Бюш де Ноэль (рождественское полено)" + } + } + ] + }, + { + "id": "tree", + "title": "Ёлка", + "cells": [ + { + "value": 100, + "question": { + "text": "Чем по традиции украшают макушку ёлки?", + "answer": "Звездой" + } + }, + { + "value": 200, + "question": { + "text": "Как называется длинная лента из лампочек, которую вешают на ёлку?", + "answer": "Гирлянда" + } + }, + { + "value": 300, + "question": { + "text": "В какой стране впервые начали украшать ёлку на Рождество?", + "answer": "В Германии", + "comment": "Немецкая традиция, известная с XVI века." + } + }, + { + "value": 400, + "question": { + "text": "В каком веке традиция украшать ёлку пришла в Россию из Германии?", + "answer": "В XIX веке" + } + }, + { + "value": 500, + "question": { + "text": "В каком году в России впервые отметили Новый год 1 января по указу Петра I?", + "answer": "В 1700 году", + "comment": "Указ издан в декабре 1699 года, а праздновали уже 1 января 1700-го." + } + } + ] + }, + { + "id": "cinema", + "title": "Кино", + "cells": [ + { + "value": 100, + "question": { + "text": "В каком фильме герой случайно улетает в Ленинград и попадает на чужую улицу с тем же адресом?", + "answer": "Ирония судьбы, или С лёгким паром!" + } + }, + { + "value": 200, + "question": { + "text": "Кто сыграл Женю Лукашина в «Иронии судьбы»?", + "answer": "Андрей Мягков" + } + }, + { + "value": 300, + "question": { + "text": "В каком фильме мальчик остаётся один дома на Рождество и защищает дом от грабителей?", + "answer": "Один дома" + } + }, + { + "value": 400, + "question": { + "text": "Какая актриса сыграла Надю Шевелёву в «Иронии судьбы»?", + "answer": "Барбара Брыльска" + } + }, + { + "value": 500, + "kind": "super", + "question": { + "text": "Кто написал пьесу «Двенадцать месяцев», по которой снят фильм-сказка?", + "answer": "Самуил Маршак", + "comment": "Вопрос-супер: номинал удваивается." + } + } + ] + }, + { + "id": "music", + "title": "Музыка", + "cells": [ + { + "value": 100, + "question": { + "text": "Как называется песня про ёлочку, которую поют на детских утренниках?", + "answer": "В лесу родилась ёлочка" + } + }, + { + "value": 200, + "question": { + "text": "У какой шведской группы есть песня «Happy New Year»?", + "answer": "ABBA" + } + }, + { + "value": 300, + "question": { + "text": "Кто поёт «Три белых коня» в фильме «Чародеи»?", + "answer": "Лариса Долина" + } + }, + { + "value": 400, + "question": { + "text": "Какую песню поют в канун Нового года в англоязычных странах, взявшись за руки?", + "answer": "Auld Lang Syne", + "comment": "Шотландская песня на слова Роберта Бёрнса." + } + }, + { + "value": 500, + "kind": "auction", + "question": { + "text": "Кто написал музыку к балету «Щелкунчик»?", + "answer": "Пётр Чайковский" + } + } + ] + }, + { + "id": "customs", + "title": "Традиции", + "cells": [ + { + "value": 100, + "question": { + "text": "Что загадывают под бой курантов?", + "answer": "Желание" + } + }, + { + "value": 200, + "question": { + "text": "Как называется вечер накануне Рождества?", + "answer": "Сочельник" + } + }, + { + "value": 300, + "question": { + "text": "Какое животное по восточному календарю считается символом 2027 года?", + "answer": "Коза", + "comment": "Огненная Коза, если быть точным." + } + }, + { + "value": 400, + "kind": "cat_in_bag", + "question": { + "text": "Сколько ударов бьют куранты в новогоднюю ночь?", + "answer": "Двенадцать" + } + }, + { + "value": 500, + "question": { + "text": "В какой стране на Новый год выбрасывают старую мебель из окон?", + "answer": "В Италии", + "comment": "В наши дни скорее традиция-легенда, чем повседневность." + } + } + ] + } + ] + } + ], + "final": { + "question": { + "text": "Что по традиции делают с запиской, на которой написано желание?", + "answer": "Сжигают, а пепел высыпают в бокал", + "comment": "Успеть надо до последнего удара курантов." + } + } +} diff --git a/docs/architecture.md b/docs/architecture.md new file mode 100644 index 0000000..84c8db9 --- /dev/null +++ b/docs/architecture.md @@ -0,0 +1,337 @@ +# Архитектура «Новогодний квиз» + +Статус: черновик, согласованные решения. +Дата: 2026-11-16. + +## 1. Цели и ограничения + +Режим игры: **ноутбук-ведущий + проектор + телефоны игроков в одной локальной сети.** + +Из этого следуют жёсткие ограничения, которые важнее любых «красивостей»: + +1. **Никакого интернета в момент игры.** Все зависимости, бандлы, шрифты, звуки и + картинки лежат в репозитории и раздаются локальным сервером. Ни одного CDN, + ни одного `fetch` во внешний мир. +2. **Один порт.** И HTTP, и WebSocket живут на одном порту (3000). Меньше правил + в брандмауэре, меньше способов ошибиться. +3. **Адрес — по IP локальной сети**, не `localhost`. Сервер печатает при старте все + LAN-адреса и показывает QR с игровым URL на табло. +4. **HTTPS не нужен** (нет доступа к микрофону, камере, геолокации). Это важно: + самоподписанный сертификат на телефонах даёт страшное предупреждение и требует + возни с корневыми сертификатами на каждом устройстве. Ограничений secure + context при этом два и оба не критичны — см. раздел 9. +5. **Телефоны спят.** Экран блокируется, вкладка уходит в bfcache, сокет рвётся. + Реконнект — штатный режим работы, а не обработка исключения. + +## 2. Роли и экраны + +| Роль | Устройство | URL | Видит | +|---|---|---|---| +| `board` | проектор / ТВ | `/board` | табло, вопрос, медиа. **Без ответов.** | +| `host` | ноутбук | `/host/:token` | всё + ответ + управление | +| `host` | телефон ведущего | `/host/:token` | компактная панель управления | +| `player` | телефон игрока | `/play?room=ABCD` | своё имя/счёт, кнопка «Ответить» | + +`board` — публичный экран, поэтому он **никогда** не получает правильный ответ. +Иначе любой игрок откроет devtools и прочитает `answer` в снапшоте. + +`/host/:token` — токен комнаты, генерируется при старте сервера, печатается в +консоли и показывается на экране ведущего. Он же есть в QR на табло (QR ведёт на +игровой, не на хостовый URL). + +## 3. Компоненты + +``` +┌────────────────────────────── ноутбук ──────────────────────────────┐ +│ │ +│ Fastify (порт 3000) │ +│ ├─ GET / → packages/web/dist (SPA) │ +│ ├─ GET /media/* → content/media (аудио/картинки/видео) │ +│ ├─ GET /api/packs → список паков + ошибки валидации │ +│ └─ Socket.IO /socket.io │ +│ └─ rooms: {code} → GameRoom │ +│ ├─ GameState (авторитет) │ +│ ├─ reducer из @quiz/shared │ +│ └─ tick 100 ms (таймеры, дедлайны) │ +│ │ +│ @quiz/shared ← чистая логика, ноль зависимостей от сети/БД/фреймворка │ +└─────────────────────────────────────────────────────────────────────┘ + │ Wi-Fi │ HDMI + ▼ ▼ + телефоны игроков проектор (/board) +``` + +Ключевое решение: **вся игровая логика — чистый reducer в `shared`.** Сервер его +вызывает, тесты его гоняют, а позже тот же код можно поднять в офлайн-режиме без +переписывания. Никакого `state` внутри Vue-компонентов и никакой логики в +Socket.IO-обработчиках, кроме «распарсить → вызвать reducer → разослать». + +## 4. Протокол + +Транспорт: Socket.IO (комнаты, автореконнект, ack-колбэки, фолбэк на long-polling). + +### Handshake + +``` +socket.auth = { room: "ABCD", role: "board" | "host" | "player", + token?: string, // для host + playerId?: string, // для player + playerToken?: string } // для player, отдан при первом join +``` + +Проверка в `io.use()`: комната существует, токен совпадает с ролью. Игрок без +`playerId` регистрируется заново; игрок с `playerId` восстанавливает своё место +(сохраняется в `localStorage`), иначе — новый слот. + +### Клиент → сервер + +Единственный канал мутаций — `cmd`. Все команды идемпотентны по `cmdId` +(телефон любит отправить двойной тап): + +```ts +socket.emit('cmd', { cmdId: 'uuid', type: 'buzz' }) +``` + +| `type` | payload | кто может | +|---|---|---| +| `selectCell` | `{ roundId, themeId, cellId }` | host, player (чей ход) | +| `buzz` | — | player | +| `judge` | `{ verdict: 'correct' \| 'wrong' \| 'skip' }` | host | +| `adjustScore` | `{ playerId, delta }` | host | +| `next` | — | host | +| `undo` | — | host | +| `bet` | `{ amount }` | player | +| `media` | `{ action: 'play' \| 'pause' \| 'replay' }` | host | + +### Сервер → клиент + +| событие | что внутри | +|---|---| +| `state` | полный снапшот под **роль этого сокета** + `seq` | +| `event` | короткие события для анимаций/звуков: `cellOpened`, `buzzLocked`, `scoreChanged`, `timerTick` | +| `error` | `{ code, message }` | +| `media:state` | `{ playing, positionMs, ended }` — состояние плеера на табло | + +Принцип: **полные снапшоты, а не дельты.** Состояние партии — единицы килобайт; +отправка целиком на каждое изменение убирает класс багов «клиент разошёлся с +сервером», а реконнект превращается в одну строку: пришёл `hello` → отдали +снапшот. Клиент игнорирует снапшот, у которого `seq` меньше уже применённого. + +## 5. Машина состояний + +``` +lobby + └→ intro(round) + └→ board ──────────────────────────────┐ + └→ question (таймер, медиа) │ + └→ buzz (если включены) │ + └→ answering │ + └→ judging │ + correct → +value ──┤ + wrong → −value ──┤ (клетка закрыта, если все ошиблись) + skip → ─────────┘ + └→ round_end → intro(next) | final + └→ final_bet → final_question → final_reveal + └→ results +``` + +Спецклетки — ветки той же машины, а не отдельные экраны: + +- `cat_in_bag` — после `question` фаза «передача вопроса»: отвечающего выбирает + получивший; +- `auction` — фаза ставок до `question`, стоимость = сумма ставки; +- `super` — обычный вопрос, но с множителем и своей анимацией. + +`deadline` (абсолютное серверное время) ставится при входе в `question` и +`final_bet`. Один `setInterval` на комнату раз в 100 мс проверяет истечения — +никаких `setTimeout` на вопрос, которые растут от раунда к раунду и текут при undo. + +**Undo — это стек снапшотов, а не обратные команды.** Последние 20 состояний +лежат в комнате, `undo` просто откатывает указатель. Обратные команды для +каждого перехода — это гарантированные баги на спецклетках. + +## 6. Модель данных + +### Контент (JSON, версионируется в git) + +```ts +type Pack = { + id: string + title: string + settings: { + wrongPenalty: 'none' | 'value' // штраф за неверный ответ + buzzers: boolean // нужен ли «кто первый нажал» + finalEnabled: boolean + defaultTimeLimit: number // сек + } + rounds: Round[] +} + +type Round = { id: string; title: string; themes: Theme[] } +type Theme = { id: string; title: string; cells: Cell[] } + +type Cell = { + value: number // 100..500 + kind: 'normal' | 'cat_in_bag' | 'auction' | 'super' + question: { + text?: string + media?: { kind: 'audio' | 'image' | 'video'; src: string; hint?: string } + answer: string // НЕ уходит на board/player + comment?: string // для ведущего, «интересный факт» + } + timeLimit?: number +} +``` + +Медиа ортогонально `kind`: музыкальный вопрос — это `cell.kind = 'normal'` + +`question.media.kind = 'audio'`. `src` — путь вида `/media/ny-2027/song-01.mp3`, +то есть файл лежит в `content/media/` и раздаётся тем же сервером. + +Валидация — zod-схема в `shared`. Сервер при старте читает все `content/packs/*.json`, +проверяет и **не падает** на битом паке: пишет ошибку в лог, помечает пак +невалидным, отдаёт в `/api/packs`. Играть с опечаткой в JSON должно быть +невозможно, но и сервер из-за неё ронять нельзя. + +### Состояние партии + +```ts +type GameState = { + seq: number + phase: Phase + packId: string + players: Player[] // { id, name, score, connected } + turn?: PlayerId // кто выбирает клетку + active?: { roundId: string; themeId: string; cellId: string; by: PlayerId } + closed: Set // открытые клетки, для табло + buzzes: { playerId: PlayerId; at: number }[] + penalized: PlayerId[] // кому уже нельзя отвечать на этот вопрос + deadline?: number // серверное время + bets?: Record +} +``` + +## 7. Проекция по ролям + +```ts +project(state: GameState, view: View, viewerId?: PlayerId): PublicState +``` + +- `board` — всё, кроме `answer`, `comment`, `bets` (до раскрытия); +- `player` — то же + свои очки и своё право хода/нажатия; +- `host` — всё, включая ответ. + +Сервер на каждое изменение состояния **обходит сокеты комнаты и отправляет +каждому его проекцию** (`io.to(room).fetchSockets()`). При ≤ 20 сокетах это +бесплатно и полностью исключает утечку ответа «не тому» экрану — в отличие от +рассылки одного общего объекта, где защита держится на дисциплине программиста. + +## 8. Медиа и звук + +Плеер живёт **на табло** (`board`), потому что звук должен идти из колонок у +проектора, а не из телефона ведущего. + +- `host` шлёт `cmd{type:'media', action}`, сервер транслирует `media:cmd` в `board`; +- `board` играет и рапортует `media:state{playing, positionMs, ended}`; +- `host` видит состояние плеера и знает, доиграл ли трек. + +Предзагрузка: при входе в `question` с медиа табло начинает `preload` и показывает +индикатор готовности; кнопка «Играть» в пульте блокируется, пока не готово. +Звуковых эффектов (верно/неверно/баззер) — отдельный маленький набор, грузится +один раз при старте. + +**Автоплей заблокирован браузером** до первого жеста — на табло нужна кнопка +«Включить звук», которая разблокирует `AudioContext` и стартует пустым клипом. +Без неё первый же вопрос с музыкой сыграет в тишину. + +## 9. Локальная сеть: реальные грабли + +Это самый вероятный источник проблем в день игры, поэтому фиксирую заранее. + +| Проблема | Решение в архитектуре | +|---|---| +| Брандмауэр Windows блокирует входящие | Правило для `node.exe` на порт 3000; скрипт `npm run open-firewall` требует прав администратора, в README — что жать «Разрешить» при первом старте | +| Гостевая сеть с изоляцией клиентов (AP isolation) | Телефон физически не видит ноутбук. Проверить заранее; вариант Б — точка доступа с ноутбука | +| Адрес неизвестен игрокам | QR на табло + печать всех LAN-IP при старте; код комнаты 4 символа | +| Телефон не знает точное время | Клиент при коннекте считает смещение `serverNow − Date.now()` и рисует таймер по серверному времени | +| Экран телефона гаснет | `navigator.wakeLock` требует HTTPS → недоступен. Лечится подсказкой «не блокируйте экран» + реконнектом | +| Двойной тап / повторная отправка | `cmdId` на каждую команду, сервер помнит последние 100 | +| Слабый Wi-Fi, просадки | Полный снапшот при реконнекте решает всё; состояние маленькое | + +## 10. Структура репозитория + +``` +quiz/ +├─ package.json # npm workspaces +├─ tsconfig.base.json +├─ content/ +│ ├─ packs/ny-2027.json +│ └─ media/ny-2027/*.mp3 +├─ docs/architecture.md +└─ packages/ + ├─ shared/ # @quiz/shared + │ └─ src/{types.ts, pack.schema.ts, reducer.ts, scoring.ts, projection.ts} + ├─ server/ # @quiz/server + │ └─ src/ + │ ├─ index.ts # Fastify, статика, socket.io, печать LAN-URL + │ ├─ room.ts # GameRoom: состояние, tick, рассылка проекций + │ ├─ socket.ts # handshake, cmd, идемпотентность + │ ├─ content.ts # загрузка + валидация паков + │ └─ lan.ts # os.networkInterfaces(), QR в терминале + └─ web/ # @quiz/web + └─ src/ + ├─ router.ts # /board, /host/:token, /play + ├─ net/socket.ts # клиент, реконнект, serverNow offset + ├─ stores/game.ts # Pinia: снапшот + производные getters + ├─ views/{BoardView,HostView,PlayerView}.vue + ├─ components/board/ # BoardGrid, ThemeColumn, CellCard, QuestionPanel, ScoreBar + ├─ components/host/ # ControlPanel, AnswerCard, ScoreEditor, MediaControls + ├─ components/player/ # BuzzButton, ScoreCard + └─ audio/{sfx.ts, music.ts} +``` + +## 11. Стек + +| Слой | Выбор | Почему | +|---|---|---| +| Web | Vue 3 + TS + Vite | выбран; Composition API отлично ложится на «снапшот → computed» | +| Стейт | Pinia | один стор на снапшот, `computed` для производных | +| Стили | Tailwind | быстро, но для табло — вручную `clamp()`/`vmin`, иначе на проекторе не читается | +| Анимации | встроенные `` + CSS | без библиотек: меньше зависимостей, проще отладка | +| Сервер | Fastify + Socket.IO | один порт, комнаты, реконнект из коробки | +| Валидация | zod | общая схема для сервера и клиента | +| Тесты | Vitest (+ Playwright опционально) | reducer гоняется без сети | +| Хранилище | в памяти + JSON паки | MVP; при необходимости — `better-sqlite3` для истории партий | + +## 12. Запуск + +``` +npm run dev # server :3000 (tsx watch) + vite :5173 с proxy на /socket.io, /api, /media +npm run build # vite build → packages/web/dist +npm start # Fastify раздаёт dist + socket.io на :3000, печатает LAN-URL и QR +``` + +В dev телефону надо открывать `http://:5173`; Vite проксирует WS +(`server.proxy['/socket.io'].ws = true`). В проде — только порт 3000. + +## 13. Этапы + +1. **Ядро.** `shared`: типы, zod-схема пака, reducer всех фаз, проекции. Vitest на + полный прогон партии. → *без UI, только тесты* +2. **Сервер.** Комнаты, handshake, `cmd`, tick, рассылка проекций. Тест двумя + фейковыми сокетами. +3. **Табло.** `BoardView` на одном экране, управление с `HostView` на том же + ноутбуке. Уже можно провести игру. +4. **Телефоны.** `PlayerView`, QR, реконнект, `buzz`. +5. **Пульт.** Компактная host-панель для телефона + управление медиа. +6. **Полировка.** Звуки, анимации открытия клетки, финал со ставками, + «кот в мешке», «аукцион». + +Первые три этапа дают работающую игру — это и есть MVP. + +## 14. Открытые вопросы + +- Нужен ли режим «команды» (несколько игроков на одно очко), или только индивидуальный зачёт? +- Сколько клеток в теме: фиксированно 5, или переменное число (табло тогда + раскладывается по-разному)? +- Нужна ли история прошлых партий / таблица лидеров между играми? +- Пак на Новый год один, или сразу несколько (разминка + основной + финал)? diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2cfd8d3 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5098 @@ +{ + "name": "quiz", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "quiz", + "version": "0.1.0", + "workspaces": [ + "packages/*" + ], + "devDependencies": { + "concurrently": "^9.1.2", + "puppeteer-core": "^23.11.1", + "tsx": "^4.19.2", + "typescript": "^5.7.2", + "vitest": "^2.1.8" + }, + "engines": { + "node": ">=22" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.14", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.29.14.tgz", + "integrity": "sha512-CXvKMFvM80ihI7Vox9jb+kQjnyjESQNPM+vB7U0Zz6TWuZA+Z/FL0QPMH300h33qJtIx+REeBhXqWOPW48TcAQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.14", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.29.14.tgz", + "integrity": "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.14" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.14", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.29.14.tgz", + "integrity": "sha512-UjI/dKmwJwT9pOszJitq2G6EObZPnsZUfdCr92z2TlF3EZK9J3EdfOKUrCzHl6wFthbzwhzl1Soc/UIwxRiq6w==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.14", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@fastify/accept-negotiator": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/@fastify/accept-negotiator/-/accept-negotiator-2.1.2.tgz", + "integrity": "sha512-LV7MZqTwXTEt3GxBT6BU8ACztWnv++hSkMEsP3usIHiI0tA4F5EO4THhDCOr5J/ginM9DCnLCmZ6u3JLA9x8Iw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/ajv-compiler": { + "version": "4.0.7", + "resolved": "https://registry.npmmirror.com/@fastify/ajv-compiler/-/ajv-compiler-4.0.7.tgz", + "integrity": "sha512-VP0yIfwlc1ohj733keYDqyHm1VWeP9VQxYomunhr90jkC4aNNibbkrRiaNgPgqj1ORxUenILR4qzA/ppYBNAtQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^4.0.0" + } + }, + "node_modules/@fastify/deepmerge": { + "version": "3.2.4", + "resolved": "https://registry.npmmirror.com/@fastify/deepmerge/-/deepmerge-3.2.4.tgz", + "integrity": "sha512-kc8GQq5gX9RRhw0rov3DMrN8wS8yRlxJRdDzsYwwdBV/wazuVgc/1K7CKL90tlvu3RlHan6Y0R0aE3nJtBz2eQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/error": { + "version": "4.2.1", + "resolved": "https://registry.npmmirror.com/@fastify/error/-/error-4.2.1.tgz", + "integrity": "sha512-MYBumuIwP+5MIpXSyKm6/o1Eigcoij186lWUssX3LH5U8KWqU0ktZhzC4CErIX9EJeQeRGI+zJZQWakBlFbUcg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/fast-json-stringify-compiler": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-5.2.0.tgz", + "integrity": "sha512-LPTVA0w4oPITWHAvox9NgI1rDSrjUnjxX6QN5MCb9FY+HqvDsUmgLucbj9eQakqC8lYwO7UgkDPHEQLJNl9vtg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "fast-json-stringify": "^7.3.0" + } + }, + "node_modules/@fastify/forwarded": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/@fastify/forwarded/-/forwarded-3.1.2.tgz", + "integrity": "sha512-89WiRG+hW3VQSfCwg4Hb8b43PeyEX15K5+lEfsZ4EUth/FyOjS/lv8HsVuswUNXWiSnxMGNouE/fq/0w3VumHQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/@fastify/merge-json-schemas": { + "version": "0.2.2", + "resolved": "https://registry.npmmirror.com/@fastify/merge-json-schemas/-/merge-json-schemas-0.2.2.tgz", + "integrity": "sha512-d/gx9sRbUCVgGRGzma46wLcwiY8noTqO2Nmjg/vbTARxHRE5bdh5PIL8s97Lt1X7ScRWRW52eVYxwIoPwIdVUA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/@fastify/proxy-addr": { + "version": "5.1.3", + "resolved": "https://registry.npmmirror.com/@fastify/proxy-addr/-/proxy-addr-5.1.3.tgz", + "integrity": "sha512-ptgIgB+abBNTs5lsKNvFaKMCauPaTOE6ZIjxJr3FxCLehmYQQKYGg4srwwNICR9QQlFrYw59jWAo+i9GalVCaw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/forwarded": "^3.0.0", + "ipaddr.js": "^2.1.0" + } + }, + "node_modules/@fastify/send": { + "version": "4.2.1", + "resolved": "https://registry.npmmirror.com/@fastify/send/-/send-4.2.1.tgz", + "integrity": "sha512-zOB8L9z444PnGbd1Nd7gNXPz/7bnDR8Z4KNTNSwLVQuE3cTGsU9qUj1N4SjXKK0Tq4cauZYTwB+tqvlqosuKsw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@lukeed/ms": "^2.0.2", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "^2.0.0", + "mime": "^3" + } + }, + "node_modules/@fastify/static": { + "version": "8.3.0", + "resolved": "https://registry.npmmirror.com/@fastify/static/-/static-8.3.0.tgz", + "integrity": "sha512-yKxviR5PH1OKNnisIzZKmgZSus0r2OZb8qCSbqmw34aolT4g3UlzYfeBRym+HJ1J471CR8e2ldNub4PubD1coA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/accept-negotiator": "^2.0.0", + "@fastify/send": "^4.0.0", + "content-disposition": "^0.5.4", + "fastify-plugin": "^5.0.0", + "fastq": "^1.17.1", + "glob": "^11.0.0" + } + }, + "node_modules/@isaacs/cliui": { + "version": "9.0.0", + "resolved": "https://registry.npmmirror.com/@isaacs/cliui/-/cliui-9.0.0.tgz", + "integrity": "sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@lukeed/ms": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/@lukeed/ms/-/ms-2.0.2.tgz", + "integrity": "sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@pinojs/redact": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/@pinojs/redact/-/redact-0.4.0.tgz", + "integrity": "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==", + "license": "MIT" + }, + "node_modules/@puppeteer/browsers": { + "version": "2.6.1", + "resolved": "https://registry.npmmirror.com/@puppeteer/browsers/-/browsers-2.6.1.tgz", + "integrity": "sha512-aBSREisdsGH890S2rQqK82qmQYU3uFpSH8wcZWHgHzl3LfzsxAKbLNiAG9mO8v1Y0UICBeClICxPJvyr0rcuxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "debug": "^4.4.0", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.5.0", + "semver": "^7.6.3", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@quiz/server": { + "resolved": "packages/server", + "link": true + }, + "node_modules/@quiz/shared": { + "resolved": "packages/shared", + "link": true + }, + "node_modules/@quiz/web": { + "resolved": "packages/web", + "link": true + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.68.3.tgz", + "integrity": "sha512-mqfypgH/liYjaSCoPI4erckUcROgZtmFUUmyOJ05oyayi/tVqOEYAzWP7ufqCoCT3xB31Fw4XIVO/jX42hYvKA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.68.3.tgz", + "integrity": "sha512-5tY+GC/1gpt79cKS2DQzu6iD824j6BmI4q5Zb6qftZ4kWqIQmvR3DD4eJ2Gclu6/nVMYDk2IVpqxypWOiAuWJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-x64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-x64/-/rollup-android-x64-4.68.3.tgz", + "integrity": "sha512-nDBcQ/o3PMmGxmAzGBJFn+n1rb83Va9WSdFIq1AHmlEF3tuibVsyJ3kG5x13r7VIy6WI8SvzCdHVNSlSDIdj8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.68.3.tgz", + "integrity": "sha512-dra5zl0QWKkIkaMgNDNPC19gkMlPAfAf41yWlkGztXMIvUQrX9XWZFQRw7abhH3nks+XZGQpybINAxT2pKdFew==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.68.3.tgz", + "integrity": "sha512-xo5xeo/AjEB/ArzQjGn0JRDZuybZicQ5O3VPfko6ocH1li/qNrN4p5+R/WgjavzRz6UwAOaqsau7VvRQA6i6AA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.68.3.tgz", + "integrity": "sha512-zdckkcxHDEEKyDbC1t21DeaaiKGymxbkBU9c3zyfaaz+8N96ItJw4nmzHhZF+Mukgt906fnf2tsc90pVyStuHA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.68.3.tgz", + "integrity": "sha512-9oXqI7g/ycEz7TyicdGBC4sL6PfWMXAx8u15f/nd7lYkCLJd8U8VdBfbpc4SSnRBU/e7aPALve3mhzasGDeCYg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.68.3.tgz", + "integrity": "sha512-hbgT4NlaOELE3D5UUzSqF+OFgwz4Scvo2SQD9nZJUFjdIsg9Kg3FabQauUxkHKY9N5yjNXfXRRmiKNN4JpLmFA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.68.3.tgz", + "integrity": "sha512-yECcXZ/Bl+JVRhLFgld42rYrXgPdE0LtySGAmmmH6OtkaJM17A4cWG/eCzDymMVb52/jZjW0R54YrTHj4xXlSA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.68.3.tgz", + "integrity": "sha512-q4Q4/B7wyqM+TFqY5tJYQlaz5+ksGopcRmMeMdu4q6eaPK7N1PymTjIaH5LL32mMJBqIzpRof7BhlYLim5JgNQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.68.3.tgz", + "integrity": "sha512-Ich3TGl/7GqhQ6G6jVPzgGQGJjd3E5hECxSVanPYchy6Vwcq+WI8wG/gmEMilHNy+ZYCR6U8EN50EejG3TaIgw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.68.3.tgz", + "integrity": "sha512-URBmOhwv4Y0Hi5Hhxc3cmqZLtQlx55DOs5PUhhITDC3zu0qwAfhcNAFAIwAhOUdA6NFVEck07CNZX6cBEs1vTg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.68.3.tgz", + "integrity": "sha512-PTdJXuZplRyaE3ECArlbZubI2LlUHWm0oCipCexnE/8LM+L7qIqUiNbU0piBxt46EB5zxXX+cpmDvHX4Z3WwcQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.68.3.tgz", + "integrity": "sha512-IlSQPDExSm9YdtrWeZIHj87GPXI9lYygRvHVwQ1o9t91JHIiB2CihrvNIASpc/zI28atqm04jS3proaQuaJMww==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.68.3.tgz", + "integrity": "sha512-O2ssyDcBTZkH5v2P/9ZaXJreL0hCKvUA5UwuHn0jCKeMLKi4GhspZJ1I5FT5QsHtJ/dPx4pup7pg/Lw0emeY0Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.68.3.tgz", + "integrity": "sha512-fesqagxcnc87lH2+aBWne/tFCmQVIGH+YezjY1wQwbUODuTBBlhHoyxju6umwn8LnjHVanjpoeaQdLsXP8JQSQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.68.3.tgz", + "integrity": "sha512-WAjFDtLW3HjJ2RAytKoWdFwlK/hW8rJHrjhRZFw14nR+c9JN//WIlSBkyXUjEYCNOFs2sGLNutOEPQG4iVYHgA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.68.3.tgz", + "integrity": "sha512-+fZiTeHV/1fy/14dRqE4thjYwUOABL6qQjxElOEQg2oHLkCamO8dxhHphVgD4+pFxtVEUIWxsGVduPtwnAlvbg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.68.3.tgz", + "integrity": "sha512-pfn4Zd9Ic3lEaSwW3GsQhTIDd7929C+eiEkOutsSCT2IHD6rDLblwmMQkgeGOso0oDo9Jk/ERtFdtFr9ElLs+g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.68.3.tgz", + "integrity": "sha512-eUXzaeNQbKXKNqseL3g/usUqOPmRu+DbQsvwr9MXMdV+VQFUNb9bcWSNAAs/TRV95PCbFK46kLzHEOhFSzujsg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.68.3.tgz", + "integrity": "sha512-OiUclE7QDU4H/hr3ACRHhVGKWl+gNx+6Emignfq0hmNmzzTkZnT79wzB9NXKd0QH16S4t/wVqlAFBfC17nkZ5A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.68.3.tgz", + "integrity": "sha512-s6EclDWmk6zvIfk1yixgYthk7xHNx0xu5cEF5RDpS4IHNTpfswRX6xOXVG5cHF5xWn0B6EpDGARhPQ520KTlsA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.68.3.tgz", + "integrity": "sha512-G2xnmxGnU8XHLwtjnnXNRcLrub+Af3nm9VQ1QzL2aEiAL7woBdRgTCZBslJl8umA+YMqdEFpUh9kJB/Vyzk2wQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.68.3.tgz", + "integrity": "sha512-Y/4tApNVrMUYWbAHsyRWJgwuuJOfhTNhA2B04Xpa6+G9btkPZ9kU3XagUKzPTwF3hg36NpQk748JsnoTVho67Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.68.3.tgz", + "integrity": "sha512-i2vH/OA5BcW+TdNg12ZTRC4rn+vILaPMP9CvHqnv+QEpMjBHGGNLo4k4EnEqzjYvTD6x1Xark9WhsQbH4bTzUQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.68.3.tgz", + "integrity": "sha512-ADb1Uz2MNM0sxVpAlMNdQG16Hw4sgW1aqVL7NeqBMpcZeiHb192d7W6shZdMQs33D+w9ihDYBBPsYqqc4MlD8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", + "license": "MIT" + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmmirror.com/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/cors": { + "version": "2.8.19", + "resolved": "https://registry.npmmirror.com/@types/cors/-/cors-2.8.19.tgz", + "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.10", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.10.tgz", + "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.20.5", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.20.5.tgz", + "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/qrcode": { + "version": "1.5.6", + "resolved": "https://registry.npmmirror.com/@types/qrcode/-/qrcode-1.5.6.tgz", + "integrity": "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/ws": { + "version": "8.18.2", + "resolved": "https://registry.npmmirror.com/@types/ws/-/ws-8.18.2.tgz", + "integrity": "sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmmirror.com/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@vitejs/plugin-vue": { + "version": "5.2.4", + "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz", + "integrity": "sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vitest/expect": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/@vitest/expect/-/expect-2.1.9.tgz", + "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/@vitest/mocker/-/mocker-2.1.9.tgz", + "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/@vitest/pretty-format/-/pretty-format-2.1.9.tgz", + "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/@vitest/runner/-/runner-2.1.9.tgz", + "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.9", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/@vitest/snapshot/-/snapshot-2.1.9.tgz", + "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "magic-string": "^0.30.12", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/@vitest/spy/-/spy-2.1.9.tgz", + "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/@vitest/utils/-/utils-2.1.9.tgz", + "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "loupe": "^3.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@volar/language-core": { + "version": "2.4.15", + "resolved": "https://registry.npmmirror.com/@volar/language-core/-/language-core-2.4.15.tgz", + "integrity": "sha512-3VHw+QZU0ZG9IuQmzT68IyN4hZNd9GchGPhbD9+pa8CVv7rnoOZwo7T8weIbrRmihqy3ATpdfXFnqRrfPVK6CA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/source-map": "2.4.15" + } + }, + "node_modules/@volar/source-map": { + "version": "2.4.15", + "resolved": "https://registry.npmmirror.com/@volar/source-map/-/source-map-2.4.15.tgz", + "integrity": "sha512-CPbMWlUN6hVZJYGcU/GSoHu4EnCHiLaXI9n8c9la6RaI9W5JHX+NqG+GSQcB0JdC2FIBLdZJwGsfKyBB71VlTg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@volar/typescript": { + "version": "2.4.15", + "resolved": "https://registry.npmmirror.com/@volar/typescript/-/typescript-2.4.15.tgz", + "integrity": "sha512-2aZ8i0cqPGjXb4BhkMsPYDkkuc2ZQ6yOpqwAuNwUoncELqoy5fRgOQtLR9gB0g902iS0NAkvpIzs27geVyVdPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.15", + "path-browserify": "^1.0.1", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.45", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.45.tgz", + "integrity": "sha512-XGHJrM6ufZARAc/w+tyOswStw9tdKiqCKBScI4gGaNxD+aaGu/HQWgKJ+JItjRLPqenQ7iE7G8AJC7T5ew1p+g==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.12", + "@vue/shared": "3.5.45", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.2" + } + }, + "node_modules/@vue/compiler-core/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.45", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.45.tgz", + "integrity": "sha512-LbP2d19GSOYGPmvMBBCVJVlv7TKtjM1Cfeyu3cYia720pknZP+1cLX7H5MVatvruT6MuJhiPuNbQBW/MDn/EwA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.45", + "@vue/shared": "3.5.45" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.45", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.45.tgz", + "integrity": "sha512-MKFjb2UX0M/l/jhfzqMLrI8VM4pfvFKG3pqFZkSZFHRLtNld/O4RtUPZFWSwhro/14qP88UQEkWzHxAZAQ0tsw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.12", + "@vue/compiler-core": "3.5.45", + "@vue/compiler-dom": "3.5.45", + "@vue/compiler-ssr": "3.5.45", + "@vue/shared": "3.5.45", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.32", + "source-map-js": "^1.2.2" + } + }, + "node_modules/@vue/compiler-sfc/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.45", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.45.tgz", + "integrity": "sha512-RF5sbZOfYz5AK00tOJUn2PwFXR2fS1u2HVzI8D9VF9rGAFxuGBqg2bB1kJ3ZHMprqSltXnT9MZE1IsqjSM8oew==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.45", + "@vue/shared": "3.5.45" + } + }, + "node_modules/@vue/compiler-vue2": { + "version": "2.7.16", + "resolved": "https://registry.npmmirror.com/@vue/compiler-vue2/-/compiler-vue2-2.7.16.tgz", + "integrity": "sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==", + "dev": true, + "license": "MIT", + "dependencies": { + "de-indent": "^1.0.2", + "he": "^1.2.0" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + }, + "node_modules/@vue/language-core": { + "version": "2.2.12", + "resolved": "https://registry.npmmirror.com/@vue/language-core/-/language-core-2.2.12.tgz", + "integrity": "sha512-IsGljWbKGU1MZpBPN+BvPAdr55YPkj2nB/TBNGNC32Vy2qLG25DYu/NBN2vNtZqdRbTRjaoYrahLrToim2NanA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.15", + "@vue/compiler-dom": "^3.5.0", + "@vue/compiler-vue2": "^2.7.16", + "@vue/shared": "^3.5.0", + "alien-signals": "^1.0.3", + "minimatch": "^9.0.3", + "muggle-string": "^0.4.1", + "path-browserify": "^1.0.1" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.45", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.45.tgz", + "integrity": "sha512-WqkyubNWpI4OYBOipSrjIssMdJO8K1i9Zts/Wm8Er10/0msOEwCyWWWvZnAI7WW3kQsTong6DJp8Cbb+vd4cPA==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.45" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.45", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.45.tgz", + "integrity": "sha512-bzIO3+FABjpj85uIKSc+Qnj36/sxDNI3tcH9i6w6xKA1k6e0ejv0G0jMCfeJBvK3yGL5XbJ3DMZj+ClqyCHFYw==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.45", + "@vue/shared": "3.5.45" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.45", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.45.tgz", + "integrity": "sha512-ZvRTFMDgfqTDYWvJfoVpQTJx1RN5M6l7Pyd6wfdY2NaXzbPQVh9ezeQYFbNPP6bIcRVn2SqSSR25N/jSW69BFw==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.45", + "@vue/runtime-core": "3.5.45", + "@vue/shared": "3.5.45", + "csstype": "^3.2.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.45", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.45.tgz", + "integrity": "sha512-1fNXUHhhsWf4EVL4XixbGBU5mKdiIXJAB82feHRTyPPo6ZUEYWIJuEeUl3mVV6QDBp50HJOX4obLhxYXlrjrzA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.45", + "@vue/runtime-dom": "3.5.45", + "@vue/shared": "3.5.45" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.45", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.45.tgz", + "integrity": "sha512-ue9fgHmVNPlP7iW3+cxoBX/Cnlw53dHlVSw0JKGY6z1lObg8pHoj928M2nzG4/yVsMZ3NaRZ2s2z61uC16NDwQ==", + "license": "MIT" + }, + "node_modules/abstract-logging": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/abstract-logging/-/abstract-logging-2.0.1.tgz", + "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==", + "license": "MIT" + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmmirror.com/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv/node_modules/fast-uri": { + "version": "3.1.9", + "resolved": "https://registry.npmmirror.com/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/alien-signals": { + "version": "1.0.13", + "resolved": "https://registry.npmmirror.com/alien-signals/-/alien-signals-1.0.13.tgz", + "integrity": "sha512-OGj9yyTnJEttvzhTUWuscOvtqxq5vrhF7vL9oS0xJ2mK0ItPYP1/y+vCFebfxoEyAz0++1AIwJ5CMr+Fk3nDmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmmirror.com/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/atomic-sleep": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz", + "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/avvio": { + "version": "9.3.1", + "resolved": "https://registry.npmmirror.com/avvio/-/avvio-9.3.1.tgz", + "integrity": "sha512-QyTKW61/qlba+cUQBm/sT9X8lri4UdomqSDwCnrnj1IvLVDRRiXRkz4CgBRWB+/cmfC7SK5WQc8T1vSdGvaUcQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/error": "^4.0.0", + "fastq": "^1.17.1" + } + }, + "node_modules/b4a": { + "version": "1.9.0", + "resolved": "https://registry.npmmirror.com/b4a/-/b4a-1.9.0.tgz", + "integrity": "sha512-dpfcF9fDNR6++cthXR67iyhgqWy9CBouAvIWhIntzBG6cvK/cnIPiZQjBwi/ZqjjBEDGfoNDtmB0kTjroOJ3pQ==", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "react-native-b4a": "*" + }, + "peerDependenciesMeta": { + "react-native-b4a": { + "optional": true + } + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/bare-buffer": { + "version": "3.7.2", + "resolved": "https://registry.npmmirror.com/bare-buffer/-/bare-buffer-3.7.2.tgz", + "integrity": "sha512-kI35SYpVg0JCk+a+gkUEJZY39mt+g71y1NRwBrEj7SbxLnwngYYMf0T/kouYIujlJwelvPZ9TTbBCbCSPw059Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "bare": ">=1.20.0" + } + }, + "node_modules/bare-events": { + "version": "2.9.2", + "resolved": "https://registry.npmmirror.com/bare-events/-/bare-events-2.9.2.tgz", + "integrity": "sha512-AIPKioV7/Y/8KfZ3AAhjPJxLLbY49S64Ym5DakZlUg75qQiTgUq9hEJoEwa4eUezPUlXRy/i5NpsKvo9jgKmoA==", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "bare-abort-controller": "*" + }, + "peerDependenciesMeta": { + "bare-abort-controller": { + "optional": true + } + } + }, + "node_modules/bare-fs": { + "version": "4.8.4", + "resolved": "https://registry.npmmirror.com/bare-fs/-/bare-fs-4.8.4.tgz", + "integrity": "sha512-MPC2eyrpbk3A873sK4y6rk+Iv4o2enxTjHZ8zH3HO0mjrpm5XjnguY2XmfidIsDV6vnjpbMBKUAJpV0ISD2SsQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bare-events": "^2.5.4", + "bare-path": "^3.0.0", + "bare-stream": "^2.6.4", + "bare-url": "^2.2.2", + "fast-fifo": "^1.3.2" + }, + "engines": { + "bare": ">=1.28.0" + }, + "peerDependencies": { + "bare-buffer": "*" + }, + "peerDependenciesMeta": { + "bare-buffer": { + "optional": true + } + } + }, + "node_modules/bare-path": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/bare-path/-/bare-path-3.1.3.tgz", + "integrity": "sha512-8r+FVU/o4zcFmpCDqbqAYhHHbtXPP+cyZKo7DRGRWc7OLlNs4TMaSQEpXL/sIdzyEG0M7RHw4B7xYMGrTc+qrg==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/bare-stream": { + "version": "2.13.4", + "resolved": "https://registry.npmmirror.com/bare-stream/-/bare-stream-2.13.4.tgz", + "integrity": "sha512-PcrQ8lVLbiJscNm1Kez+Yp4Gy4AHGcN1lzwjvf5NybWen7VvEgUfyfnXYJ2zNqWnzOfCb1Abq6lH8ti0syQszA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.8.1", + "streamx": "^2.25.0", + "teex": "^1.0.1" + }, + "peerDependencies": { + "bare-abort-controller": "*", + "bare-buffer": "*", + "bare-events": "*" + }, + "peerDependenciesMeta": { + "bare-abort-controller": { + "optional": true + }, + "bare-buffer": { + "optional": true + }, + "bare-events": { + "optional": true + } + } + }, + "node_modules/bare-url": { + "version": "2.5.7", + "resolved": "https://registry.npmmirror.com/bare-url/-/bare-url-2.5.7.tgz", + "integrity": "sha512-pWAiECRdNYPJAXYKVOb4HuTQedQyRjtGBUu86kO/vOt4GM7e45PghHXQ/Erm5NumaDSWNBzehIfpc768esW7gA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bare-buffer": "^3.0.0", + "bare-path": "^3.0.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/basic-ftp": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/basic-ftp/-/basic-ftp-5.3.1.tgz", + "integrity": "sha512-bopVNp6ugyA150DDuZfPFdt1KZ5a94ZDiwX4hMgZDzF+GttD80lEy8kj98kbyhLXnPvhtIo93mdnLIjpCAeeOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "2.1.8", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.1.8.tgz", + "integrity": "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmmirror.com/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmmirror.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmmirror.com/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmmirror.com/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmmirror.com/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/chromium-bidi": { + "version": "0.11.0", + "resolved": "https://registry.npmmirror.com/chromium-bidi/-/chromium-bidi-0.11.0.tgz", + "integrity": "sha512-6CJWHkNRoyZyjV9Rwv2lYONZf1Xm0IuDyNq97nwSsxxP3wf5Bwy15K5rOvVKMtJ127jJBmxFUanSAOjgFRxgrA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "mitt": "3.0.1", + "zod": "3.23.8" + }, + "peerDependencies": { + "devtools-protocol": "*" + } + }, + "node_modules/chromium-bidi/node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmmirror.com/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/concurrently": { + "version": "9.2.5", + "resolved": "https://registry.npmmirror.com/concurrently/-/concurrently-9.2.5.tgz", + "integrity": "sha512-YMZlvWrTPQEhjKp60XSmMGt60+pffbv6DyRnOMvVO98+J7aF8w8Ui9FhdcOwvSixc/kyR6SoVvmejcn/2lZBqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "4.1.2", + "rxjs": "7.8.2", + "shell-quote": "1.12.0", + "supports-color": "8.1.1", + "tree-kill": "1.2.2", + "yargs": "17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmmirror.com/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/cookie/-/cookie-2.0.2.tgz", + "integrity": "sha512-SL0cVuEdETEp7pN0FuZb01toc3vnODEfVUCooxG1SJN0yIirh7JMb9X9bvfCFf0vzzbT68RdbKDHYTiWy7a7iw==", + "license": "MIT", + "engines": { + "node": ">=22" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cors": { + "version": "2.8.6", + "resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmmirror.com/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/de-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz", + "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmmirror.com/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/devtools-protocol": { + "version": "0.0.1367902", + "resolved": "https://registry.npmmirror.com/devtools-protocol/-/devtools-protocol-0.0.1367902.tgz", + "integrity": "sha512-XxtPuC3PGakY6PD7dG66/o8KwJ/LkH2/EKe19Dcw58w53dv4/vSQEkn/SzuyhHE2q4zPgCkxQBxus3VV4ql+Pg==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmmirror.com/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/engine.io": { + "version": "6.6.11", + "resolved": "https://registry.npmmirror.com/engine.io/-/engine.io-6.6.11.tgz", + "integrity": "sha512-z34mGpLoY/82ZbkX1LqGMIaf3wjVMPL6gVC681QDqnmzJ26synI8qAE32P+a7UazmpJZ8UGrFIeAavgRfXzYrg==", + "license": "MIT", + "dependencies": { + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "@types/ws": "^8.5.12", + "accepts": "~1.3.4", + "cookie": "~0.7.2", + "cors": "~2.8.5", + "debug": "~4.4.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.21.0" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/engine.io-client": { + "version": "6.6.8", + "resolved": "https://registry.npmmirror.com/engine.io-client/-/engine.io-client-6.6.8.tgz", + "integrity": "sha512-DPN6+2uNi3A2cbSR3gqJepLVOnSQmbaJT4USgU+TgGPczEqLQT0i6t05jHrf4TT6rcxABrGp/1As0FyqwIZlGg==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.4.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.21.0", + "xmlhttprequest-ssl": "~2.1.1" + } + }, + "node_modules/engine.io-client/node_modules/ws": { + "version": "8.21.3", + "resolved": "https://registry.npmmirror.com/ws/-/ws-8.21.3.tgz", + "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.3", + "resolved": "https://registry.npmmirror.com/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/engine.io/node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/engine.io/node_modules/ws": { + "version": "8.21.3", + "resolved": "https://registry.npmmirror.com/ws/-/ws-8.21.3.tgz", + "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmmirror.com/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmmirror.com/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmmirror.com/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/events-universal": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/events-universal/-/events-universal-1.0.1.tgz", + "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bare-events": "^2.7.0" + } + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/fast-decode-uri-component": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", + "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==", + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stringify": { + "version": "7.3.6", + "resolved": "https://registry.npmmirror.com/fast-json-stringify/-/fast-json-stringify-7.3.6.tgz", + "integrity": "sha512-hXCpiZTZGiER/Xree1Tb4PY1DREPUnlWTP5Df9hgtoDnUppulV7Km8lh1/NEBuqz4JnNGSXghnABudfZ/iwIzg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/merge-json-schemas": "^0.2.0", + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^4.0.0", + "json-schema-ref-resolver": "^3.0.0", + "rfdc": "^1.2.0" + } + }, + "node_modules/fast-querystring": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", + "license": "MIT", + "dependencies": { + "fast-decode-uri-component": "^1.0.1" + } + }, + "node_modules/fast-uri": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/fast-uri/-/fast-uri-4.2.3.tgz", + "integrity": "sha512-I1PXwP5eAhlNlcdpjt9CgB59op2ZvZfxw+BkqGFVIUOgNpCVTcTqp3HhTX7brxj5vsip+nSY4nTvff+eIA76hg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/fastify": { + "version": "5.12.8", + "resolved": "https://registry.npmmirror.com/fastify/-/fastify-5.12.8.tgz", + "integrity": "sha512-moP8exb2sCHLUbJkwp+I6C0padhy4D8lp0SdmzY7HhSdZuqm7O/u3o2aq7u8okaQ//33QDzj3G/u+FsSdB8Qzw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "@fastify/ajv-compiler": "^4.0.5", + "@fastify/error": "^4.0.0", + "@fastify/fast-json-stringify-compiler": "^5.0.0", + "@fastify/proxy-addr": "^5.0.0", + "abstract-logging": "^2.0.1", + "avvio": "^9.0.0", + "fast-json-stringify": "^7.0.0", + "find-my-way": "^9.10.0", + "light-my-request": "^6.0.0", + "pino": "^9.14.0 || ^10.1.0", + "process-warning": "^5.1.0", + "rfdc": "^1.3.1", + "secure-json-parse": "^4.0.0", + "semver": "^7.6.0", + "toad-cache": "^3.7.0" + } + }, + "node_modules/fastify-plugin": { + "version": "5.1.0", + "resolved": "https://registry.npmmirror.com/fastify-plugin/-/fastify-plugin-5.1.0.tgz", + "integrity": "sha512-FAIDA8eovSt5qcDgcBvDuX/v0Cjz0ohGhENZ/wpc3y+oZCY2afZ9Baqql3g/lC+OHRnciQol4ww7tuthOb9idw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.20.3", + "resolved": "https://registry.npmmirror.com/fastq/-/fastq-1.20.3.tgz", + "integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/find-my-way": { + "version": "9.10.1", + "resolved": "https://registry.npmmirror.com/find-my-way/-/find-my-way-9.10.1.tgz", + "integrity": "sha512-UwbZdEdk59YXIGPW/rbDn/Ayr3mJ5fPH/HJeMPlK8Ez10aUin4iyRwgJvNTSkRfpZ2h8uLX0LbvZm/YUBUpymw==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-querystring": "^1.0.0", + "safe-regex2": "^5.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-uri": { + "version": "6.0.5", + "resolved": "https://registry.npmmirror.com/get-uri/-/get-uri-6.0.5.tgz", + "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/glob": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/glob/-/glob-11.1.0.tgz", + "integrity": "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "foreground-child": "^3.3.1", + "jackspeak": "^4.1.1", + "minimatch": "^10.1.1", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "5.0.13", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmmirror.com/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmmirror.com/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "10.7.6", + "resolved": "https://registry.npmmirror.com/ip-address/-/ip-address-10.7.6.tgz", + "integrity": "sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "2.5.0", + "resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-2.5.0.tgz", + "integrity": "sha512-aq+t5NAc+cS6rZQQVWC2x98CPqGtKKTMDd4Gaodv0wShnItdKg/51djkGJ1hqH+Oy0ivDftCbSLCQob8zso01w==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/jackspeak": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/jackspeak/-/jackspeak-4.2.3.tgz", + "integrity": "sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^9.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/json-schema-ref-resolver": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/json-schema-ref-resolver/-/json-schema-ref-resolver-3.0.1.tgz", + "integrity": "sha512-w+HwgljXpVwZ3IidoUR1qPZxSOQ+NRQWuVe6a5pe8XbHsNZE4UAwVPUvzZagn7yBKbJtt6UJnRFYbNTRPZI45Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/light-my-request": { + "version": "6.8.1", + "resolved": "https://registry.npmmirror.com/light-my-request/-/light-my-request-6.8.1.tgz", + "integrity": "sha512-20biUK0HAIPG9BZOK3/4s8uVAkAoi1+qW55lciHZCR0puTWipBgyMPEUjqXDWLjsZeqfO6DGsuwW5eyfsTGtyg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause", + "dependencies": { + "@fastify/deepmerge": "^3.1.0", + "cookie": "^2.0.0", + "process-warning": "^5.0.0", + "set-cookie-parser": "^3.0.1" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmmirror.com/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmmirror.com/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "dev": true, + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/muggle-string": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netmask": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/netmask/-/netmask-2.1.1.tgz", + "integrity": "sha512-eonl3sLUha+S1GzTPxychyhnUzKyeQkZ7jLjKrBagJgPla13F+uQ71HgpFefyHgqrjEbCPkDArxYsjY8/+gLKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/on-exit-leak-free": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pac-proxy-agent": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz", + "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.6", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmmirror.com/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "dev": true, + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/pino": { + "version": "10.4.0", + "resolved": "https://registry.npmmirror.com/pino/-/pino-10.4.0.tgz", + "integrity": "sha512-bk1ZMTwG/Vymx+zPoa28MhNzucFvXJWp3csrSuxuHPSMeUettaCoQ5Jvg07mtC4JGNpcfTwz41oVCnNgBK9+vA==", + "license": "MIT", + "dependencies": { + "@pinojs/redact": "^0.4.0", + "atomic-sleep": "^1.0.0", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^3.0.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^5.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^1.0.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^4.0.1", + "thread-stream": "^4.0.0" + }, + "bin": { + "pino": "bin.js" + } + }, + "node_modules/pino-abstract-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/pino-abstract-transport/-/pino-abstract-transport-3.0.0.tgz", + "integrity": "sha512-wlfUczU+n7Hy/Ha5j9a/gZNy7We5+cXp8YL+X+PG8S0KXxw7n/JXA3c46Y0zQznIJ83URJiwy7Lh56WLokNuxg==", + "license": "MIT", + "dependencies": { + "split2": "^4.0.0" + } + }, + "node_modules/pino-std-serializers": { + "version": "7.1.0", + "resolved": "https://registry.npmmirror.com/pino-std-serializers/-/pino-std-serializers-7.1.0.tgz", + "integrity": "sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw==", + "license": "MIT" + }, + "node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/postcss": { + "version": "8.5.33", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/process-warning": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/process-warning/-/process-warning-5.1.1.tgz", + "integrity": "sha512-oCkNVj4OKnKEcocVBcDfiIugN1/cE6rgfT3nCtzeqZPA8+rIxMaQ0xXzIkGP8Gj2qUaP1UR7uhJ1VD8lUCpzCg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/proxy-agent": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.6", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.1.0", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.4", + "resolved": "https://registry.npmmirror.com/pump/-/pump-3.0.4.tgz", + "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/puppeteer-core": { + "version": "23.11.1", + "resolved": "https://registry.npmmirror.com/puppeteer-core/-/puppeteer-core-23.11.1.tgz", + "integrity": "sha512-3HZ2/7hdDKZvZQ7dhhITOUg4/wOrDRjyK2ZBllRB0ZCOi9u0cwq1ACHDjBB+nX+7+kltHjQvBRdeY7+W0T+7Gg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@puppeteer/browsers": "2.6.1", + "chromium-bidi": "0.11.0", + "debug": "^4.4.0", + "devtools-protocol": "0.0.1367902", + "typed-query-selector": "^2.12.0", + "ws": "^8.18.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/qrcode": { + "version": "1.5.4", + "resolved": "https://registry.npmmirror.com/qrcode/-/qrcode-1.5.4.tgz", + "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==", + "license": "MIT", + "dependencies": { + "dijkstrajs": "^1.0.1", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/qrcode/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/qrcode/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "node_modules/qrcode/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/quick-format-unescaped": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", + "license": "MIT" + }, + "node_modules/real-require": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/real-require/-/real-require-1.0.0.tgz", + "integrity": "sha512-P4nbQYQfePJxRSmY+v/KINxVucm4NF3p3s7pJveMTtom52FR4YGltUQLB8idDXwDDWW+eYrWDFbuzUnjoWHF7g==", + "license": "MIT" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "license": "ISC" + }, + "node_modules/ret": { + "version": "0.5.1", + "resolved": "https://registry.npmmirror.com/ret/-/ret-0.5.1.tgz", + "integrity": "sha512-Z/nyvABwcRnRD2mMP7Kz6G1dFZZqX1mNErOnxF42OCQKE07b9k9hK9SQxHL3LFEZUdzQaLM4dId1E/E6Vm4WhA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "license": "MIT" + }, + "node_modules/rollup": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.68.3.tgz", + "integrity": "sha512-wd2gavj7CEQv52rdcVqfUupO/KPIKcoJKxyFWl4cOqYZGMQEOSijJRkliz0dRa7gpkj/h4TRqyWa+dJJi6T0OA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.10" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.68.3", + "@rollup/rollup-android-arm64": "4.68.3", + "@rollup/rollup-android-x64": "4.68.3", + "@rollup/rollup-darwin-arm64": "4.68.3", + "@rollup/rollup-darwin-x64": "4.68.3", + "@rollup/rollup-freebsd-arm64": "4.68.3", + "@rollup/rollup-freebsd-x64": "4.68.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.68.3", + "@rollup/rollup-linux-arm-musleabihf": "4.68.3", + "@rollup/rollup-linux-arm64-gnu": "4.68.3", + "@rollup/rollup-linux-arm64-musl": "4.68.3", + "@rollup/rollup-linux-loong64-gnu": "4.68.3", + "@rollup/rollup-linux-loong64-musl": "4.68.3", + "@rollup/rollup-linux-ppc64-gnu": "4.68.3", + "@rollup/rollup-linux-ppc64-musl": "4.68.3", + "@rollup/rollup-linux-riscv64-gnu": "4.68.3", + "@rollup/rollup-linux-riscv64-musl": "4.68.3", + "@rollup/rollup-linux-s390x-gnu": "4.68.3", + "@rollup/rollup-linux-x64-gnu": "4.68.3", + "@rollup/rollup-linux-x64-musl": "4.68.3", + "@rollup/rollup-openbsd-x64": "4.68.3", + "@rollup/rollup-openharmony-arm64": "4.68.3", + "@rollup/rollup-win32-arm64-msvc": "4.68.3", + "@rollup/rollup-win32-ia32-msvc": "4.68.3", + "@rollup/rollup-win32-x64-gnu": "4.68.3", + "@rollup/rollup-win32-x64-msvc": "4.68.3", + "fsevents": "~2.3.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmmirror.com/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-regex2": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/safe-regex2/-/safe-regex2-5.1.2.tgz", + "integrity": "sha512-tAtCGFPPP02VroDVzp4daGi6bC7jWG+41D47GKf18FeH/ubvKQHT9VmhAkvtjNOmJwqtApzWeUpEhkyEYULvmw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ret": "~0.5.0" + }, + "bin": { + "safe-regex2": "bin/safe-regex2.js" + } + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmmirror.com/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/secure-json-parse": { + "version": "4.1.1", + "resolved": "https://registry.npmmirror.com/secure-json-parse/-/secure-json-parse-4.1.1.tgz", + "integrity": "sha512-lnd81MQEZKjhW/Gd2TQqdd4XP6QYNdDW/EP+I7nTrFHP9y2LmaGPIHk9xsnzcOiEr1c39c/e84xFgGviQKBTRw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/set-cookie-parser": { + "version": "3.2.2", + "resolved": "https://registry.npmmirror.com/set-cookie-parser/-/set-cookie-parser-3.2.2.tgz", + "integrity": "sha512-df017qMeYuXo4emL09nlyMpi2i2MtEIKS/6jtXH3vmjFgIRsOi852/5RmhJ4EkvN3ZF8jXadM/EkTPXgc8yPIw==", + "license": "MIT" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.12.0", + "resolved": "https://registry.npmmirror.com/shell-quote/-/shell-quote-1.12.0.tgz", + "integrity": "sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socket.io": { + "version": "4.8.4", + "resolved": "https://registry.npmmirror.com/socket.io/-/socket.io-4.8.4.tgz", + "integrity": "sha512-9ZV9zg8vN8hO3Y25DhR7nUkJ1VDnBhq5O/JrXhFT9s6+F0gqytSASTHVfCFc2mJXaTfARroErplXlzFWwETZqQ==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.4", + "cors": "~2.8.5", + "debug": "~4.4.1", + "engine.io": "~6.6.0", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/socket.io-adapter": { + "version": "2.5.8", + "resolved": "https://registry.npmmirror.com/socket.io-adapter/-/socket.io-adapter-2.5.8.tgz", + "integrity": "sha512-6Oy52pbg+kvdCVvjcN+FnY7BvxZ7cIHNScbvztT/It5d0vbwoJoVZmF2gjJmnV0/4WlXRfG15zc45ySk9Ah8bw==", + "license": "MIT", + "dependencies": { + "debug": "~4.4.1", + "ws": "~8.21.0" + } + }, + "node_modules/socket.io-adapter/node_modules/ws": { + "version": "8.21.3", + "resolved": "https://registry.npmmirror.com/ws/-/ws-8.21.3.tgz", + "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/socket.io-client": { + "version": "4.8.4", + "resolved": "https://registry.npmmirror.com/socket.io-client/-/socket.io-client-4.8.4.tgz", + "integrity": "sha512-7wjKAvVXYOJsbmUgkWbnhPD4bFpkqrUR0++XOjpGFmqDqsqV1CI93VTraeExLxpjxEqrWgFoSRZu1ihjLWfkAA==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.4.1", + "engine.io-client": "~6.6.1", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.7", + "resolved": "https://registry.npmmirror.com/socket.io-parser/-/socket.io-parser-4.2.7.tgz", + "integrity": "sha512-IH/iSeO9T6gz1KkFleGDWkG9N3dl4jXVYUtMhIqH10Md0ttMer8nUNWiP1DKuNrybD2xBrixLJdCC9J6ECoYkg==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.4.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.10", + "resolved": "https://registry.npmmirror.com/socks/-/socks-2.8.10.tgz", + "integrity": "sha512-e0VyvkVTwVYViNovRkZ9aodhxVlyoMn7eJhVUPxZ+eK9P/7CBkxvvsBOHqFPEH416726W8tLXXXjKwqgTErrCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ip-address": "^10.1.1", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmmirror.com/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/sonic-boom": { + "version": "4.2.1", + "resolved": "https://registry.npmmirror.com/sonic-boom/-/sonic-boom-4.2.1.tgz", + "integrity": "sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q==", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmmirror.com/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmmirror.com/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/streamx": { + "version": "2.28.1", + "resolved": "https://registry.npmmirror.com/streamx/-/streamx-2.28.1.tgz", + "integrity": "sha512-zEzXb0s5Cds7tqMH6rhZ05lcJydCWiQPEwiNngVqzsxCc962vLY4Uw+mW7od8kDH258k2Uz/JrOkdIAAhSh9VA==", + "dev": true, + "license": "MIT", + "dependencies": { + "events-universal": "^1.0.0", + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/tar-fs": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/tar-fs/-/tar-fs-3.1.3.tgz", + "integrity": "sha512-/hU4AXnIdZu+Gvl1pk0oI5f5HxWsCJRtY2aFaJdk9VvyL48DWU6iU5WAIPG+wIi1YvWA6eTJvIviP/tMAZZNwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^4.0.1", + "bare-path": "^3.0.0" + } + }, + "node_modules/tar-stream": { + "version": "3.2.2", + "resolved": "https://registry.npmmirror.com/tar-stream/-/tar-stream-3.2.2.tgz", + "integrity": "sha512-+8NeqHRjQWH9nYlwo2gamAMImZCVzI4UoEgDpWorBt9OEfppiZn+uSkskzQKPWIZyji/C8fpWO7u69G0DX0tbg==", + "dev": true, + "license": "MIT", + "dependencies": { + "b4a": "^1.9.0", + "bare-fs": "^4.8.2", + "fast-fifo": "^1.3.2", + "streamx": "^2.28.1" + } + }, + "node_modules/teex": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/teex/-/teex-1.0.1.tgz", + "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "streamx": "^2.12.5" + } + }, + "node_modules/text-decoder": { + "version": "1.2.7", + "resolved": "https://registry.npmmirror.com/text-decoder/-/text-decoder-1.2.7.tgz", + "integrity": "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, + "node_modules/thread-stream": { + "version": "4.2.1", + "resolved": "https://registry.npmmirror.com/thread-stream/-/thread-stream-4.2.1.tgz", + "integrity": "sha512-Stg6edJXC/6/xqGwSXwFokrUhChJ18amEjpKH89WrQQ0oVFDF+pUUcTpiwWhFUrE89Vf16FBOlwhaw+lescxMQ==", + "license": "MIT", + "dependencies": { + "real-require": "^1.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmmirror.com/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmmirror.com/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmmirror.com/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/toad-cache": { + "version": "3.7.4", + "resolved": "https://registry.npmmirror.com/toad-cache/-/toad-cache-3.7.4.tgz", + "integrity": "sha512-m1TdR/rvT7kgGJZhspNtXdsdYk0fddFpJJFlG5s+UkPFo6lkLoZ3YLOaovPYjq1R75NP5JfeTlSHaOsE09peCg==", + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsx": { + "version": "4.23.15", + "resolved": "https://registry.npmmirror.com/tsx/-/tsx-4.23.15.tgz", + "integrity": "sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/typed-query-selector": { + "version": "2.12.4", + "resolved": "https://registry.npmmirror.com/typed-query-selector/-/typed-query-selector-2.12.4.tgz", + "integrity": "sha512-lF6/OY655DSWZeuNovde8TZhju6QyC0Xtav57b07oZQ1EQvfSowA3+WfLEhvFJOc9sVfAtW5hie1lGIppOqbpQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmmirror.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmmirror.com/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/vite-node/-/vite-node-2.1.9.tgz", + "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vite/node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/vitest": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/vitest/-/vitest-2.1.9.tgz", + "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.9", + "@vitest/mocker": "2.1.9", + "@vitest/pretty-format": "^2.1.9", + "@vitest/runner": "2.1.9", + "@vitest/snapshot": "2.1.9", + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.9", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.9", + "@vitest/ui": "2.1.9", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vscode-uri": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.2.0.tgz", + "integrity": "sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/vue": { + "version": "3.5.45", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.45.tgz", + "integrity": "sha512-3cvsib8m9c0vB24+MDKsgcW4+Da4xaBl9Z/5Tbm2pmSIsRPxcil4cdXjXlVsmJ2g64XJo5h+IRd7rsdGT9pZaw==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.45", + "@vue/compiler-sfc": "3.5.45", + "@vue/runtime-dom": "3.5.45", + "@vue/server-renderer": "3.5.45", + "@vue/shared": "3.5.45" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-router": { + "version": "4.6.5", + "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.6.5.tgz", + "integrity": "sha512-HBoGqixpB2ej1kI17NotdOatUdKIsi3yfOQ5vhwAhcoHk90+JtwtIy7MEeOqdPi1+npmQVMEu5F+Hvw+3TU48w==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/vue-tsc": { + "version": "2.2.12", + "resolved": "https://registry.npmmirror.com/vue-tsc/-/vue-tsc-2.2.12.tgz", + "integrity": "sha512-P7OP77b2h/Pmk+lZdJ0YWs+5tJ6J2+uOQPo7tlBnY44QqQSPYvS0qVT4wqDJgwrZaLe47etJLLQRFia71GYITw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/typescript": "2.4.15", + "@vue/language-core": "2.2.12" + }, + "bin": { + "vue-tsc": "bin/vue-tsc.js" + }, + "peerDependencies": { + "typescript": ">=5.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "license": "ISC" + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ws": { + "version": "8.23.0", + "resolved": "https://registry.npmmirror.com/ws/-/ws-8.23.0.tgz", + "integrity": "sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xmlhttprequest-ssl": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.1.2.tgz", + "integrity": "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmmirror.com/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmmirror.com/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmmirror.com/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmmirror.com/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "packages/server": { + "name": "@quiz/server", + "version": "0.1.0", + "dependencies": { + "@fastify/static": "^8.0.3", + "@quiz/shared": "0.1.0", + "fastify": "^5.2.0", + "socket.io": "^4.8.1" + }, + "devDependencies": { + "@types/node": "^22.10.2", + "socket.io-client": "^4.8.1", + "tsx": "^4.19.2" + } + }, + "packages/shared": { + "name": "@quiz/shared", + "version": "0.1.0", + "dependencies": { + "zod": "^3.24.1" + }, + "devDependencies": { + "@types/node": "^22.10.2" + } + }, + "packages/web": { + "name": "@quiz/web", + "version": "0.1.0", + "dependencies": { + "@quiz/shared": "0.1.0", + "qrcode": "^1.5.4", + "socket.io-client": "^4.8.1", + "vue": "^3.5.13", + "vue-router": "^4.5.0" + }, + "devDependencies": { + "@types/qrcode": "^1.5.5", + "@vitejs/plugin-vue": "^5.2.1", + "vite": "^5.4.11", + "vue-tsc": "^2.1.10" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..6e24654 --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "quiz", + "private": true, + "type": "module", + "version": "0.1.0", + "description": "Новогодний квиз: табло на проекторе, телефоны игроков, ведущий с ноутбука и пульта", + "workspaces": [ + "packages/*" + ], + "scripts": { + "dev": "concurrently -n server,web -c yellow,cyan --kill-others-on-fail \"npm:dev:server\" \"npm:dev:web\"", + "dev:server": "npm run dev --workspace @quiz/server", + "dev:web": "npm run dev --workspace @quiz/web", + "build": "npm run build --workspace @quiz/web", + "start": "npm run start --workspace @quiz/server", + "preview": "npm run preview --workspace @quiz/web", + "test": "npm run test --workspaces --if-present", + "typecheck": "npm run typecheck --workspaces --if-present" + }, + "devDependencies": { + "concurrently": "^9.1.2", + "puppeteer-core": "^23.11.1", + "tsx": "^4.19.2", + "typescript": "^5.7.2", + "vitest": "^2.1.8" + }, + "engines": { + "node": ">=22" + } +} diff --git a/packages/server/package.json b/packages/server/package.json new file mode 100644 index 0000000..8af3ef3 --- /dev/null +++ b/packages/server/package.json @@ -0,0 +1,24 @@ +{ + "name": "@quiz/server", + "version": "0.1.0", + "private": true, + "type": "module", + "description": "Игровой сервер: комнаты, сокеты, таймеры, раздача интерфейса", + "scripts": { + "dev": "tsx watch src/index.ts", + "start": "tsx src/index.ts", + "test": "vitest run", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "@fastify/static": "^8.0.3", + "@quiz/shared": "0.1.0", + "fastify": "^5.2.0", + "socket.io": "^4.8.1" + }, + "devDependencies": { + "@types/node": "^22.10.2", + "socket.io-client": "^4.8.1", + "tsx": "^4.19.2" + } +} diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts new file mode 100644 index 0000000..7519bdc --- /dev/null +++ b/packages/server/src/app.ts @@ -0,0 +1,150 @@ +/** + * Сборка приложения: HTTP + сокеты на одном порту. + * + * Один порт выбран сознательно: меньше правил в брандмауэре Windows и меньше + * способов ошибиться на площадке. В dev-режиме Vite проксирует /socket.io сюда, + * в продакшене этот же сервер раздаёт собранный интерфейс. + */ + +import { randomBytes } from 'node:crypto' +import { existsSync } from 'node:fs' +import path from 'node:path' +import fastifyStatic from '@fastify/static' +import Fastify, { type FastifyInstance } from 'fastify' +import { Server } from 'socket.io' +import type { AuthPayload, Pack } from '@quiz/shared' +import { EVENTS, makeRoomCode } from '@quiz/shared' +import { Room } from './room' + +export interface AppOptions { + packs: Pack[] + packId?: string + roomCode?: string + hostToken?: string + /** Каталог собранного интерфейса (packages/web/dist). */ + staticDir?: string + /** Каталог с медиа (content/media). */ + mediaDir?: string + tickMs?: number + logger?: boolean +} + +export interface BuiltApp { + app: FastifyInstance + io: Server + room: Room + pack: Pack + roomCode: string + hostToken: string + close: () => Promise +} + +export async function buildApp(options: AppOptions): Promise { + const pack = options.packId + ? options.packs.find((candidate) => candidate.id === options.packId) + : options.packs[0] + if (!pack) { + throw new Error( + options.packId ? `пак «${options.packId}» не найден` : 'не загружено ни одного пака', + ) + } + + const roomCode = (options.roomCode ?? makeRoomCode()).toUpperCase() + const hostToken = options.hostToken ?? randomBytes(6).toString('hex') + + const app = Fastify({ logger: options.logger ?? false }) + const io = new Server(app.server, { + serveClient: false, + // Игра живёт в локальной сети:Origin у телефонов любой, поэтому не режем. + cors: { origin: true, credentials: true }, + }) + const room = new Room({ code: roomCode, pack, hostToken, io, tickMs: options.tickMs }) + + io.use((socket, next) => { + const auth = (socket.handshake.auth ?? {}) as Partial + const result = room.authorize(auth) + if (!result.ok) { + next(new Error(result.reason)) + return + } + socket.data.role = result.value.role + socket.data.playerId = result.value.playerId + socket.data.playerToken = result.value.playerToken + socket.data.name = auth.name + next() + }) + + io.on('connection', (socket) => { + room.attach( + socket, + { + role: socket.data.role, + playerId: socket.data.playerId, + playerToken: socket.data.playerToken, + }, + socket.data.name, + ) + socket.on(EVENTS.cmd, (message: unknown) => room.handleCommand(socket, message)) + socket.on(EVENTS.undo, () => room.undo(socket)) + socket.on('disconnect', () => room.detach(socket)) + }) + + if (options.staticDir && existsSync(options.staticDir)) { + await app.register(fastifyStatic, { root: options.staticDir }) + } + if (options.mediaDir && existsSync(options.mediaDir)) { + await app.register(fastifyStatic, { + root: options.mediaDir, + prefix: '/media/', + decorateReply: false, + }) + } + + app.get('/health', async () => ({ + ok: true, + room: roomCode, + pack: pack.id, + phase: room.state.phase, + players: room.state.players.length, + })) + + app.get('/api/packs', async () => + options.packs.map((candidate) => ({ + id: candidate.id, + title: candidate.title, + rounds: candidate.rounds.length, + })), + ) + + app.get('/api/room', async () => ({ + code: roomCode, + pack: pack.id, + title: pack.title, + })) + + // SPA: /board, /play и /host/ — это маршруты одного приложения. + app.setNotFoundHandler((request, reply) => { + const url = request.raw.url ?? '' + if (url.startsWith('/api/') || url.startsWith('/socket.io')) { + return reply.code(404).send({ error: 'не найдено' }) + } + const indexHtml = options.staticDir ? path.join(options.staticDir, 'index.html') : '' + if (indexHtml && existsSync(indexHtml)) { + return reply.sendFile('index.html') + } + return reply.code(404).send({ + error: 'интерфейс не собран', + hint: 'выполните npm run build или откройте dev-сервер Vite', + }) + }) + + const close = async (): Promise => { + room.close() + await new Promise((resolve) => { + io.close(() => resolve()) + }) + if (app.server.listening) await app.close() + } + + return { app, io, room, pack, roomCode, hostToken, close } +} diff --git a/packages/server/src/content.ts b/packages/server/src/content.ts new file mode 100644 index 0000000..dea199d --- /dev/null +++ b/packages/server/src/content.ts @@ -0,0 +1,67 @@ +/** + * Загрузка паков с диска. + * + * Битый пак не должен ронять сервер: он отбрасывается, а причина пишется в лог + * и остаётся доступной по /api/packs. Играть с опечаткой в JSON нельзя, но и + * остаться без игры из-за одного файла — тоже. + */ + +import { existsSync, readFileSync, readdirSync } from 'node:fs' +import path from 'node:path' +import type { Pack } from '@quiz/shared' +import { parsePack } from '@quiz/shared' + +export interface LoadedPack { + pack: Pack + file: string +} + +export interface PackProblem { + file: string + errors: string[] +} + +export interface LoadResult { + packs: LoadedPack[] + problems: PackProblem[] +} + +export function loadPacks(contentDir: string): LoadResult { + const packsDir = path.join(contentDir, 'packs') + if (!existsSync(packsDir)) { + return { packs: [], problems: [{ file: packsDir, errors: ['каталог с паками не найден'] }] } + } + + const packs: LoadedPack[] = [] + const problems: PackProblem[] = [] + + const files = readdirSync(packsDir) + .filter((file) => file.endsWith('.json')) + .sort() + + for (const file of files) { + const full = path.join(packsDir, file) + try { + const raw: unknown = JSON.parse(readFileSync(full, 'utf8')) + const result = parsePack(raw) + if (result.ok) { + packs.push({ pack: result.pack, file }) + } else { + problems.push({ file, errors: result.errors }) + } + } catch (error) { + problems.push({ + file, + errors: [error instanceof Error ? error.message : String(error)], + }) + } + } + + return { packs, problems } +} + +export function formatProblems(problems: PackProblem[]): string { + return problems + .map((problem) => ` ${problem.file}:\n${problem.errors.map((e) => ` - ${e}`).join('\n')}`) + .join('\n') +} diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts new file mode 100644 index 0000000..89dd3a5 --- /dev/null +++ b/packages/server/src/index.ts @@ -0,0 +1,91 @@ +/** + * Точка входа сервера. + * + * Задача этого файла — собрать конфигурацию, загрузить контент и понятно + * рассказать в консоли, куда идти. Всё остальное живёт в app.ts и room.ts. + */ + +import { existsSync } from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { buildApp } from './app' +import { formatProblems, loadPacks } from './content' +import { lanAddresses } from './network' + +const here = path.dirname(fileURLToPath(import.meta.url)) +const repoRoot = path.resolve(here, '../../..') +const contentDir = process.env.QUIZ_CONTENT ?? path.join(repoRoot, 'content') +const staticDir = path.join(repoRoot, 'packages/web/dist') +const mediaDir = path.join(contentDir, 'media') + +const { packs, problems } = loadPacks(contentDir) + +if (problems.length > 0) { + console.warn('\n⚠ Паки с ошибками (они не будут доступны):\n' + formatProblems(problems) + '\n') +} +if (packs.length === 0) { + console.error('Не загружено ни одного пака. Положите JSON в content/packs/') + process.exit(1) +} + +const port = Number(process.env.PORT ?? 3000) +const built = await buildApp({ + packs: packs.map((entry) => entry.pack), + packId: process.env.QUIZ_PACK, + // Фиксированные комната и токен удобны, когда ссылку на пульт сохранили + // в закладки: перезапуск сервера её не ломает. + roomCode: process.env.QUIZ_ROOM, + hostToken: process.env.QUIZ_HOST_TOKEN, + staticDir, + mediaDir, +}) + +try { + await built.app.listen({ port, host: '0.0.0.0' }) +} catch (error) { + const code = (error as NodeJS.ErrnoException).code + if (code === 'EADDRINUSE') { + // Самая частая причина: сервер уже запущен в другом окне терминала. + console.error( + `\nПорт ${port} уже занят — похоже, сервер уже запущен.\n` + + 'Остановите старый процесс (Ctrl+C в его окне) и запустите снова.\n' + + `Найти, кто держит порт: netstat -ano | findstr :${port}\n`, + ) + process.exit(1) + } + throw error +} + +const external = lanAddresses()[0]?.address ?? '127.0.0.1' + +// Порт интерфейса: если интерфейс собран, его раздаёт этот же сервер; +// иначе его поднимает Vite на 5173. +const hasStatic = existsSync(path.join(staticDir, 'index.html')) +const uiPort = hasStatic ? port : Number(process.env.QUIZ_UI_PORT ?? 5173) +const ui = `http://${external}:${uiPort}` +const local = `http://localhost:${uiPort}` + +const lines = [ + ' ─────────────────────────────────────────────', + ' НОВОГОДНИЙ КВИЗ', + ` пак: ${built.pack.title}`, + ` комната: ${built.roomCode}`, + ' ─────────────────────────────────────────────', + ` Табло: ${ui}/board`, + ` Пульт: ${ui}/host/${built.hostToken}`, + ` Игроки: ${ui}/play?room=${built.roomCode}`, + ' ─────────────────────────────────────────────', + ` на этом компьютере: ${local}/board`, + hasStatic + ? ' интерфейс собран; в dev-режиме живой код на порту 5173' + : ' интерфейс поднимает Vite: npm run dev', +] +console.log(`\n${lines.join('\n')}\n`) + +const shutdown = async (): Promise => { + console.log('\nОстанавливаюсь…') + await built.close() + process.exit(0) +} +process.on('SIGINT', () => void shutdown()) +process.on('SIGTERM', () => void shutdown()) diff --git a/packages/server/src/network.ts b/packages/server/src/network.ts new file mode 100644 index 0000000..3d492d0 --- /dev/null +++ b/packages/server/src/network.ts @@ -0,0 +1,50 @@ +/** Адреса, по которым телефоны в той же сети дотянутся до этого ноутбука. */ + +import { networkInterfaces } from 'node:os' + +export interface LanAddress { + name: string + address: string +} + +/** + * Виртуальные адаптеры (VPN, WSL, прокси) выдают адреса, до которых телефон + * не дойдёт. Поэтому ранжируем по диапазону адреса, а имя — только подсказка. + */ +export function addressRank(address: string): number { + const parts = address.split('.').map(Number) + const a = parts[0] + const b = parts[1] + if (a === undefined || b === undefined) return 9 + + if (a === 192 && b === 168) return 0 // домашние и офисные Wi-Fi + if (a === 10) return 1 // корпоративные сети + if (a === 172 && b >= 16 && b <= 31) return 2 + if (a === 169 && b === 254) return 8 // link-local: без DHCP, почти всегда мимо + if (a === 198 && (b === 18 || b === 19)) return 9 // стенд для тестов, TUN-адаптеры + return 5 +} + +function nameRank(name: string): number { + return /vEthernet|Loopback|Virtual|VMware|VirtualBox|Tailscale|ZeroTier|WireGuard|Hyper-V/i.test( + name, + ) + ? 7 + : 0 +} + +export function lanAddresses(): LanAddress[] { + const result: LanAddress[] = [] + for (const [name, infos] of Object.entries(networkInterfaces())) { + for (const info of infos ?? []) { + if (info.family !== 'IPv4' || info.internal) continue + result.push({ name, address: info.address }) + } + } + + return result.sort( + (left, right) => + addressRank(left.address) * 10 + nameRank(left.name) - + (addressRank(right.address) * 10 + nameRank(right.name)), + ) +} diff --git a/packages/server/src/room.ts b/packages/server/src/room.ts new file mode 100644 index 0000000..798c7f6 --- /dev/null +++ b/packages/server/src/room.ts @@ -0,0 +1,284 @@ +/** + * Комната: авторитетное состояние партии + сокеты этой комнаты. + * + * Всё, что приходит из сети, здесь проверяется ДО reducer'а. Reducer описывает + * правила игры, но он не парсер: если прислать ему `{ type: 'bet', amount: 'abc' }` + * или команду ведущего от игрока, он не обязан это выдерживать — обязан сервер. + */ + +import { randomUUID } from 'node:crypto' +import type { Server, Socket } from 'socket.io' +import type { + Actor, + AuthPayload, + ClientRole, + CmdMessage, + Command, + GameEvent, + Pack, + PublicState, +} from '@quiz/shared' +import { EVENTS, GameEngine, project } from '@quiz/shared' + +export interface RoomOptions { + code: string + pack: Pack + hostToken: string + io: Server + tickMs?: number +} + +interface Client { + socket: Socket + role: ClientRole + playerId?: string +} + +export interface Authorized { + role: ClientRole + playerId?: string + /** Выдаётся только новому игроку: по нему он вернётся после блокировки экрана. */ + playerToken?: string +} + +export type AuthorizeResult = { ok: true; value: Authorized } | { ok: false; reason: string } + +const SYSTEM: Actor = { id: 'system', role: 'system' } +const HOST: Actor = { id: 'host', role: 'host' } + +const MAX_NAME = 24 +const MAX_CMD_ID = 64 + +/** Что сокет каждой роли имеет право прислать. Всё остальное — отказ. */ +const ALLOWED_COMMANDS: Record> = { + host: ['startGame', 'next', 'selectCell', 'nominate', 'judge', 'bet', 'adjustScore', 'resetGame'], + player: ['selectCell', 'nominate', 'buzz', 'bet'], + board: [], +} + +function isCmdMessage(value: unknown): value is CmdMessage { + if (!value || typeof value !== 'object') return false + const message = value as Record + if (typeof message.cmdId !== 'string') return false + if (message.cmdId.length === 0 || message.cmdId.length > MAX_CMD_ID) return false + const command = message.command + if (!command || typeof command !== 'object') return false + return typeof (command as Record).type === 'string' +} + +function cleanName(input: unknown, fallback: string): string { + if (typeof input !== 'string') return fallback + const trimmed = input.trim().slice(0, MAX_NAME) + return trimmed.length > 0 ? trimmed : fallback +} + +export class Room { + readonly code: string + readonly pack: Pack + readonly hostToken: string + + private readonly io: Server + private readonly engine: GameEngine + private readonly clients = new Map() + private readonly playerTokens = new Map() + private readonly timer: NodeJS.Timeout + private lastSeq = -1 + private playerCounter = 0 + + constructor(options: RoomOptions) { + this.code = options.code.toUpperCase() + this.pack = options.pack + this.hostToken = options.hostToken + this.io = options.io + this.engine = new GameEngine(this.pack) + this.timer = setInterval(() => this.tick(), options.tickMs ?? 100) + this.timer.unref() + } + + get channel(): string { + return `room:${this.code}` + } + + get state() { + return this.engine.current + } + + close(): void { + clearInterval(this.timer) + } + + // ─── Рукопожатие ───────────────────────────────────────────────────────── + + authorize(auth: Partial | undefined): AuthorizeResult { + if (!auth || typeof auth.room !== 'string') return { ok: false, reason: 'нет кода комнаты' } + if (auth.room.trim().toUpperCase() !== this.code) { + return { ok: false, reason: `комната ${auth.room} не найдена` } + } + + if (auth.role === 'host') { + if (!auth.token || auth.token !== this.hostToken) { + return { ok: false, reason: 'неверный токен ведущего' } + } + return { ok: true, value: { role: 'host' } } + } + + if (auth.role === 'board') { + return { ok: true, value: { role: 'board' } } + } + + if (auth.role === 'player') { + // Возврат на своё место: токен важнее имени, имя могло измениться. + if ( + typeof auth.playerId === 'string' && + typeof auth.playerToken === 'string' && + this.playerTokens.get(auth.playerId) === auth.playerToken + ) { + return { ok: true, value: { role: 'player', playerId: auth.playerId } } + } + if (this.state.phase === 'results') { + return { ok: false, reason: 'игра уже закончилась' } + } + const playerId = `p${(this.playerCounter += 1)}` + const playerToken = randomUUID() + this.playerTokens.set(playerId, playerToken) + return { ok: true, value: { role: 'player', playerId, playerToken } } + } + + return { ok: false, reason: 'неизвестная роль' } + } + + attach(socket: Socket, authorized: Authorized, rawName?: unknown): void { + const client: Client = { + socket, + role: authorized.role, + playerId: authorized.playerId, + } + this.clients.set(socket.id, client) + void socket.join(this.channel) + + if (authorized.role === 'player' && authorized.playerId) { + const existing = this.state.players.find((p) => p.id === authorized.playerId) + const name = cleanName(rawName, existing?.name ?? `Игрок ${authorized.playerId.slice(1)}`) + this.engine.dispatch( + { type: 'addPlayer', playerId: authorized.playerId, name }, + { actor: { id: authorized.playerId, role: 'player' } }, + ) + } + + socket.emit(EVENTS.hello, { + room: this.code, + role: authorized.role, + playerId: authorized.playerId, + playerToken: authorized.playerToken, + serverNow: Date.now(), + }) + socket.emit(EVENTS.state, this.viewFor(client, Date.now())) + this.broadcast() + } + + detach(socket: Socket): void { + const client = this.clients.get(socket.id) + if (!client) return + this.clients.delete(socket.id) + if (client.role !== 'player' || !client.playerId) return + + // Место сохраняется за игроком: он мог просто заблокировать экран. + const stillAttached = [...this.clients.values()].some( + (other) => other.playerId === client.playerId, + ) + if (stillAttached) return + + this.engine.dispatch( + { type: 'removePlayer', playerId: client.playerId }, + { actor: SYSTEM }, + ) + this.broadcast() + } + + // ─── Команды ───────────────────────────────────────────────────────────── + + handleCommand(socket: Socket, raw: unknown): void { + const client = this.clients.get(socket.id) + if (!client) return + + if (!isCmdMessage(raw)) { + socket.emit(EVENTS.error, { reason: 'некорректное сообщение' }) + return + } + + const allowed = ALLOWED_COMMANDS[client.role] + if (client.role !== 'host' && !allowed.includes(raw.command.type)) { + socket.emit(EVENTS.error, { + cmdId: raw.cmdId, + reason: `роль «${client.role}» не может выполнять «${raw.command.type}»`, + }) + return + } + + const actor: Actor = + client.role === 'player' + ? { id: client.playerId ?? '', role: 'player' } + : { id: client.role, role: client.role } + + const result = this.engine.dispatch(raw.command, { actor, cmdId: raw.cmdId }) + + if (!result.ok) { + socket.emit(EVENTS.error, { cmdId: raw.cmdId, reason: result.reason }) + return + } + + this.emitEvents(result.events) + this.broadcast() + } + + undo(socket: Socket): void { + const client = this.clients.get(socket.id) + if (!client) return + if (client.role !== 'host') { + socket.emit(EVENTS.error, { reason: 'откатывать может только ведущий' }) + return + } + const result = this.engine.undo(HOST) + if (!result.ok) { + socket.emit(EVENTS.error, { reason: result.reason }) + return + } + this.broadcast() + } + + // ─── Рассылка ──────────────────────────────────────────────────────────── + + private tick(): void { + const result = this.engine.dispatch({ type: 'tick' }, { actor: SYSTEM }) + if (result.ok) this.broadcast() + } + + private emitEvents(events: GameEvent[]): void { + for (const event of events) this.io.to(this.channel).emit(EVENTS.event, event) + } + + /** + * Каждый сокет получает СВОЮ проекцию: табло и телефоны — без правильного + * ответа, ведущий — с ответом. Общий объект на всех тут недопустим. + */ + private broadcast(): void { + const state = this.state + if (state.seq === this.lastSeq) return + this.lastSeq = state.seq + + const now = Date.now() + for (const client of this.clients.values()) { + client.socket.emit(EVENTS.state, this.viewFor(client, now)) + } + } + + private viewFor(client: Client, now: number): PublicState { + if (client.role === 'host') { + return project(this.pack, this.state, 'host', undefined, now) + } + if (client.role === 'player') { + return project(this.pack, this.state, 'player', client.playerId, now) + } + return project(this.pack, this.state, 'board', undefined, now) + } +} diff --git a/packages/server/test/network.test.ts b/packages/server/test/network.test.ts new file mode 100644 index 0000000..f18d807 --- /dev/null +++ b/packages/server/test/network.test.ts @@ -0,0 +1,32 @@ +/** + * Выбор адреса, который диктуют телефонам. + * + * Ошибка здесь стоит вечера: сервер напечатает адрес виртуального адаптера, + * и ни один телефон не подключится. Поэтому правило покрыто тестом. + */ + +import { describe, expect, it } from 'vitest' +import { addressRank, lanAddresses } from '../src/network' + +describe('пригодность адреса', () => { + it('домашний Wi-Fi лучше виртуальных адаптеров', () => { + expect(addressRank('192.168.1.136')).toBeLessThan(addressRank('198.18.0.1')) + expect(addressRank('10.0.0.5')).toBeLessThan(addressRank('198.18.0.1')) + expect(addressRank('172.20.1.2')).toBeLessThan(addressRank('169.254.10.10')) + }) + + it('не разбирает мусор как адрес', () => { + expect(addressRank('не адрес')).toBe(9) + }) +}) + +describe('список адресов', () => { + it('отдаёт только IPv4 в порядке пригодности', () => { + const addresses = lanAddresses() + for (const entry of addresses) { + expect(entry.address).toMatch(/^\d{1,3}(\.\d{1,3}){3}$/) + } + const ranks = addresses.map((entry) => addressRank(entry.address)) + expect(ranks).toEqual([...ranks].sort((left, right) => left - right)) + }) +}) diff --git a/packages/server/test/socket.test.ts b/packages/server/test/socket.test.ts new file mode 100644 index 0000000..f37d114 --- /dev/null +++ b/packages/server/test/socket.test.ts @@ -0,0 +1,308 @@ +/** + * Тесты сервера на настоящих сокетах: клиенты подключаются по WebSocket, + * команды идут через протокол, состояние проверяется как у живого клиента. + * + * Это не тест reducer'а (он покрыт отдельно), а тест границы: авторизация ролей, + * изоляция ответов между табло и ведущим, поведение при реконнекте. + */ + +import { afterEach, beforeEach, describe, expect, it } from 'vitest' +import { io as connectIo, type Socket as ClientSocket } from 'socket.io-client' +import type { + AuthPayload, + Command, + HelloMessage, + Pack, + PublicState, + ServerError, +} from '@quiz/shared' +import { buildApp, type BuiltApp } from '../src/app' + +const ROOM = 'TEST' +const HOST_TOKEN = 'secret-token' + +function makePack(): Pack { + const cell = (value: number) => ({ + value, + kind: 'normal' as const, + question: { text: `Вопрос за ${value}`, answer: `Ответ ${value}` }, + }) + + return { + id: 'test', + title: 'Тестовый пак', + settings: { + wrongPenalty: 'value', + buzzers: true, + finalEnabled: false, + defaultTimeLimit: 30, + answerTimeLimit: 20, + auctionTimeLimit: 30, + betTimeLimit: 20, + }, + rounds: [ + { + id: 'r1', + title: 'Раунд 1', + themes: [{ id: 't1', title: 'Тема', cells: [cell(100), cell(200)] }], + }, + ], + } +} + +interface Harness { + built: BuiltApp + url: string + sockets: ClientSocket[] + states: Map + hellos: Map + errors: Map +} + +let harness: Harness + +beforeEach(async () => { + const built = await buildApp({ + packs: [makePack()], + roomCode: ROOM, + hostToken: HOST_TOKEN, + tickMs: 25, + }) + await built.app.listen({ port: 0, host: '127.0.0.1' }) + const address = built.app.server.address() + if (!address || typeof address === 'string') throw new Error('сервер не сообщил порт') + + harness = { + built, + url: `http://127.0.0.1:${address.port}`, + sockets: [], + states: new Map(), + hellos: new Map(), + errors: new Map(), + } +}) + +afterEach(async () => { + for (const socket of harness.sockets) socket.disconnect() + await harness.built.close() +}) + +async function connect(auth: Partial = {}): Promise { + const socket = connectIo(harness.url, { + auth: { room: ROOM, ...auth }, + transports: ['websocket'], + reconnection: false, + forceNew: true, + }) + harness.sockets.push(socket) + + // Буферы ставим синхронно: сервер шлёт hello и state сразу после connect, + // и без буфера первый снапшот можно потерять. + socket.on('state', (state: PublicState) => harness.states.set(socket, state)) + socket.on('hello', (hello: HelloMessage) => harness.hellos.set(socket, hello)) + socket.on('error', (error: ServerError) => { + const list = harness.errors.get(socket) ?? [] + list.push(error) + harness.errors.set(socket, list) + }) + + await new Promise((resolve, reject) => { + socket.once('connect', () => resolve()) + socket.once('connect_error', (error: Error) => reject(error)) + }) + return socket +} + +function waitState( + socket: ClientSocket, + match: (state: PublicState) => boolean, + label: string, + timeoutMs = 4000, +): Promise { + const buffered = harness.states.get(socket) + if (buffered && match(buffered)) return Promise.resolve(buffered) + + return new Promise((resolve, reject) => { + const timer = setTimeout(() => { + socket.off('state', handler) + reject(new Error(`не дождались состояния: ${label}`)) + }, timeoutMs) + + function handler(state: PublicState): void { + if (!match(state)) return + clearTimeout(timer) + socket.off('state', handler) + resolve(state) + } + + socket.on('state', handler) + }) +} + +function waitError(socket: ClientSocket, match: RegExp, label: string): Promise { + const existing = harness.errors.get(socket)?.find((error) => match.test(error.reason)) + if (existing) return Promise.resolve(existing) + + return new Promise((resolve, reject) => { + const timer = setTimeout(() => { + socket.off('error', handler) + reject(new Error(`не дождались ошибки: ${label}`)) + }, 4000) + + function handler(error: ServerError): void { + if (!match.test(error.reason)) return + clearTimeout(timer) + socket.off('error', handler) + resolve(error) + } + + socket.on('error', handler) + }) +} + +let cmdSeq = 0 +function send(socket: ClientSocket, command: Command): void { + cmdSeq += 1 + socket.emit('cmd', { cmdId: `c${cmdSeq}`, command }) +} + +/** Доводит партию до табло: старт и переход из интро. */ +async function toBoard(host: ClientSocket, players: number): Promise { + await waitState(host, (state) => state.players.length >= players, 'игроки вошли') + send(host, { type: 'startGame' }) + await waitState(host, (state) => state.phase === 'intro', 'интро') + send(host, { type: 'next' }) + await waitState(host, (state) => state.phase === 'board', 'табло') +} + +describe('рукопожатие', () => { + it('ведущий с верным токеном получает состояние лобби', async () => { + const host = await connect({ role: 'host', token: HOST_TOKEN }) + const state = await waitState(host, (s) => s.phase === 'lobby', 'лобби') + expect(state.players).toEqual([]) + expect(harness.hellos.get(host)?.role).toBe('host') + }) + + it('не пускает с чужим токеном ведущего', async () => { + await expect(connect({ role: 'host', token: 'не тот' })).rejects.toThrow(/токен/) + }) + + it('не пускает в несуществующую комнату', async () => { + await expect(connect({ role: 'player', room: 'ZZZZ' })).rejects.toThrow(/не найдена/) + }) + + it('выдаёт игроку id и токен для возврата', async () => { + const player = await connect({ role: 'player', name: 'Аня' }) + await waitState(player, (s) => s.players.length === 1, 'игрок в списке') + + const hello = harness.hellos.get(player) + expect(hello?.playerId).toBe('p1') + expect(hello?.playerToken).toBeTruthy() + const state = harness.states.get(player) + expect(state?.players[0]?.name).toBe('Аня') + }) +}) + +describe('изоляция ответов', () => { + it('табло не получает правильный ответ, а ведущий получает', async () => { + const host = await connect({ role: 'host', token: HOST_TOKEN }) + const board = await connect({ role: 'board' }) + await connect({ role: 'player', name: 'Аня' }) + + await toBoard(host, 1) + send(host, { type: 'selectCell', cellKey: 'r1/t1/0' }) + + const onBoard = await waitState(board, (s) => s.phase === 'question', 'вопрос на табло') + expect(onBoard.active?.question.text).toBe('Вопрос за 100') + expect(JSON.stringify(onBoard)).not.toContain('Ответ 100') + + const onHost = await waitState(host, (s) => s.phase === 'question', 'вопрос у ведущего') + expect(onHost.active?.answer).toBe('Ответ 100') + }) +}) + +describe('игра по сети', () => { + it('первое нажатие забирает вопрос, второе отклоняется', async () => { + const host = await connect({ role: 'host', token: HOST_TOKEN }) + const first = await connect({ role: 'player', name: 'Аня' }) + const second = await connect({ role: 'player', name: 'Боря' }) + + await toBoard(host, 2) + send(host, { type: 'selectCell', cellKey: 'r1/t1/0' }) + await waitState(first, (s) => s.phase === 'question', 'вопрос игрокам') + + send(first, { type: 'buzz' }) + const answered = await waitState(host, (s) => s.phase === 'answering', 'кто-то отвечает') + expect(answered.answerer).toBe('p1') + expect(answered.buzzes).toHaveLength(1) + + send(second, { type: 'buzz' }) + // Первое нажатие уже перевело игру в фазу ответа, поэтому второму отказ + // приходит именно как «сейчас нельзя нажать», а не «отвечающий уже есть». + await waitError(second, /нельзя нажать|отвечающий уже есть/, 'второму отказали') + }) + + it('очки и место переживают реконнект', async () => { + const host = await connect({ role: 'host', token: HOST_TOKEN }) + const player = await connect({ role: 'player', name: 'Аня' }) + const hello = harness.hellos.get(player) + if (!hello?.playerId || !hello.playerToken) throw new Error('нет токена игрока') + + await waitState(host, (s) => s.players.length === 1, 'игрок вошёл') + // Игру надо начать: в лобби отключившийся игрок освобождает слот целиком, + // а нас интересует именно сохранение места в начавшейся партии. + send(host, { type: 'startGame' }) + await waitState(host, (s) => s.phase === 'intro', 'игра началась') + + send(host, { type: 'adjustScore', playerId: hello.playerId, delta: 250 }) + await waitState(player, (s) => s.players[0]?.score === 250, 'очки начислены') + + player.disconnect() + await waitState(host, (s) => s.players[0]?.connected === false, 'игрок отключился') + + const again = await connect({ + role: 'player', + playerId: hello.playerId, + playerToken: hello.playerToken, + name: 'Аня', + }) + + const restored = await waitState( + again, + (s) => s.players.some((p) => p.id === hello.playerId && p.connected && p.score === 250), + 'игрок вернулся с очками', + ) + expect(restored.players.find((p) => p.id === hello.playerId)?.name).toBe('Аня') + expect(harness.hellos.get(again)?.playerId).toBe(hello.playerId) + }) +}) + +describe('недоверенный ввод', () => { + it('игрок не может начать игру', async () => { + const player = await connect({ role: 'player', name: 'Аня' }) + send(player, { type: 'startGame' }) + const error = await waitError(player, /не может выполнять/, 'отказ по роли') + expect(error.reason).toContain('startGame') + }) + + it('табло не может ничего изменить', async () => { + const board = await connect({ role: 'board' }) + send(board, { type: 'next' }) + await waitError(board, /не может выполнять/, 'табло без прав') + }) + + it('сообщение без команды отклоняется', async () => { + const player = await connect({ role: 'player', name: 'Аня' }) + player.emit('cmd', { hello: 'world' }) + await waitError(player, /некорректное сообщение/, 'мусор') + }) + + it('мусорные данные внутри команды не роняют сервер', async () => { + const player = await connect({ role: 'player', name: 'Аня' }) + player.emit('cmd', { cmdId: 'x', command: { type: 'bet', amount: 'очень много' } }) + await waitError(player, /время ставить|целым/, 'ставка мусором') + + const health = await fetch(`${harness.url}/health`) + expect(health.status).toBe(200) + }) +}) diff --git a/packages/server/tsconfig.json b/packages/server/tsconfig.json new file mode 100644 index 0000000..61eabd8 --- /dev/null +++ b/packages/server/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "noEmit": true, + "types": ["node"] + }, + "include": ["src/**/*.ts", "test/**/*.ts"] +} diff --git a/packages/shared/package.json b/packages/shared/package.json new file mode 100644 index 0000000..b1fbebd --- /dev/null +++ b/packages/shared/package.json @@ -0,0 +1,22 @@ +{ + "name": "@quiz/shared", + "version": "0.1.0", + "private": true, + "type": "module", + "description": "Чистая игровая логика: типы, схема пака, reducer, проекции. Без сети, без БД, без UI.", + "exports": { + ".": "./src/index.ts" + }, + "types": "./src/index.ts", + "scripts": { + "test": "vitest run", + "test:watch": "vitest", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "zod": "^3.24.1" + }, + "devDependencies": { + "@types/node": "^22.10.2" + } +} diff --git a/packages/shared/src/engine.ts b/packages/shared/src/engine.ts new file mode 100644 index 0000000..f1f2033 --- /dev/null +++ b/packages/shared/src/engine.ts @@ -0,0 +1,94 @@ +/** + * Обёртка над reducer'ом, которая помнит историю и защищает от дублей. + * + * Сервер держит один GameEngine на комнату. Всё, что не является чистой + * логикой (сеть, рассылка, БД), живёт снаружи. + */ + +import type { Actor, Command, GameState, Pack, Result } from './types' +import { applyCommand, initialState } from './game' + +export interface EngineOptions { + /** Часы. В тестах подменяются, чтобы таймеры были детерминированными. */ + now?: () => number + /** Сколько состояний помнить для undo. */ + historyLimit?: number + /** Сколько cmdId помнить для защиты от повторов. */ + dedupeLimit?: number + /** Стартовое состояние, если нужно продолжить партию. */ + initial?: GameState +} + +export class GameEngine { + private state: GameState + private readonly pack: Pack + private readonly history: GameState[] = [] + private readonly seen: string[] = [] + private readonly seenSet = new Set() + private readonly now: () => number + private readonly historyLimit: number + private readonly dedupeLimit: number + + constructor(pack: Pack, options: EngineOptions = {}) { + this.pack = pack + this.state = options.initial ?? initialState() + this.now = options.now ?? (() => Date.now()) + this.historyLimit = options.historyLimit ?? 20 + this.dedupeLimit = options.dedupeLimit ?? 200 + } + + get current(): GameState { + return this.state + } + + get canUndo(): boolean { + return this.history.length > 0 + } + + /** + * Выполнить команду. `cmdId` делает повторную отправку (двойной тап, + * ретрай после реконнекта) безопасной: второй раз команда не применится. + */ + dispatch(cmd: Command, options: { actor: Actor; cmdId?: string }): Result { + const { actor, cmdId } = options + + if (cmdId && this.seenSet.has(cmdId)) { + return { ok: true, state: this.state, events: [] } + } + + const result = applyCommand(this.pack, this.state, cmd, { now: this.now(), actor }) + if (!result.ok) return result + + if (cmdId) this.remember(cmdId) + + if (result.state !== this.state) { + this.history.push(this.state) + if (this.history.length > this.historyLimit) this.history.shift() + this.state = result.state + } + + return result + } + + /** Откат на шаг назад: восстанавливается целый снапшот, а не инверсия команды. */ + undo(actor: Actor): Result { + if (actor.role !== 'host') return { ok: false, reason: 'откатывать может только ведущий' } + const previous = this.history.pop() + if (!previous) return { ok: false, reason: 'нечего откатывать' } + this.state = { ...previous, seq: this.state.seq + 1 } + return { + ok: true, + state: this.state, + events: [{ type: 'phase', phase: this.state.phase }], + } + } + + private remember(cmdId: string): void { + this.seen.push(cmdId) + this.seenSet.add(cmdId) + while (this.seen.length > this.dedupeLimit) { + const dropped = this.seen.shift() + if (dropped) this.seenSet.delete(dropped) + } + } +} diff --git a/packages/shared/src/game.ts b/packages/shared/src/game.ts new file mode 100644 index 0000000..28be37f --- /dev/null +++ b/packages/shared/src/game.ts @@ -0,0 +1,628 @@ +/** + * Чистый reducer партии: (пак, состояние, команда) → новое состояние + события. + * + * Здесь нет ни сети, ни таймеров, ни БД. Время приходит в `ctx.now`, поэтому + * любой сценарий (включая истечение таймера) воспроизводится в тесте точно. + * + * Авторизация тоже здесь: reducer проверяет, кто и в какой фазе имеет право + * на действие. Сервер лишь подставляет актора из сокета — и ничего не решает. + */ + +import type { + Buzz, + Command, + Ctx, + GameEvent, + GameState, + JudgeVerdict, + Pack, + Player, + Result, + Round, +} from './types' +import { effectiveValue, findCell, isRoundComplete } from './pack' + +const MAX_PLAYERS = 12 + +// ─── Мелкие помощники ────────────────────────────────────────────────────── + +function ok(state: GameState, patch: Partial, events: GameEvent[] = []): Result { + return { ok: true, state: { ...state, ...patch, seq: state.seq + 1 }, events } +} + +function fail(reason: string): Result { + return { ok: false, reason } +} + +function currentRound(pack: Pack, state: GameState): Round | undefined { + return pack.rounds[state.roundIndex] +} + +function activeCellOf(pack: Pack, state: GameState) { + if (!state.active) return null + return findCell(pack, state.active.key) +} + +function withScore(players: Player[], playerId: string, delta: number): Player[] { + return players.map((p) => (p.id === playerId ? { ...p, score: p.score + delta } : p)) +} + +function closeActive(state: GameState): string[] { + const key = state.active?.key + if (!key || state.closed.includes(key)) return state.closed + return [...state.closed, key] +} + +/** Кто ещё имеет право отвечать на текущий вопрос. */ +function freePlayers(players: Player[], penalized: readonly string[]): Player[] { + return players.filter((p) => !penalized.includes(p.id)) +} + +export function initialState(): GameState { + return { + seq: 0, + phase: 'lobby', + roundIndex: 0, + players: [], + closed: [], + buzzes: [], + penalized: [], + bets: {}, + finalJudged: {}, + } +} + +/** Победитель аукциона: максимальная ставка, при равенстве — кто раньше в списке. */ +function auctionWinner( + players: Player[], + bets: Record, +): { playerId: string; amount: number } | null { + let best: { playerId: string; amount: number } | null = null + for (const player of players) { + const amount = bets[player.id] + if (amount === undefined) continue + if (!best || amount > best.amount) best = { playerId: player.id, amount } + } + return best +} + +// ─── Судейство ───────────────────────────────────────────────────────────── + +function judgeAnswer(pack: Pack, state: GameState, verdict: JudgeVerdict, now: number): Result { + const found = activeCellOf(pack, state) + const answerer = state.answerer + if (!found || !answerer) return fail('сейчас никто не отвечает') + const value = state.stake ?? effectiveValue(found.cell) + + if (verdict === 'correct') { + return ok( + state, + { + players: withScore(state.players, answerer, value), + closed: closeActive(state), + phase: 'reveal', + turn: answerer, + deadline: undefined, + buzzes: [], + }, + [{ type: 'correct', playerId: answerer, delta: value }], + ) + } + + if (verdict === 'skip') { + return ok(state, { + closed: closeActive(state), + phase: 'reveal', + answerer: undefined, + buzzes: [], + deadline: undefined, + }) + } + + return settleWrong(pack, state, answerer, now) +} + +/** + * Неверный ответ (явный или по таймауту): штраф, игрок выбывает из вопроса, + * вопрос возвращается в игру остальным. Если ответить больше некому — reveal. + */ +function settleWrong(pack: Pack, state: GameState, answerer: string, now: number): Result { + const found = activeCellOf(pack, state) + if (!found) return fail('нет открытой клетки') + const value = state.stake ?? effectiveValue(found.cell) + const delta = pack.settings.wrongPenalty === 'value' ? -value : 0 + const players = delta === 0 ? state.players : withScore(state.players, answerer, delta) + const penalized = state.penalized.includes(answerer) + ? state.penalized + : [...state.penalized, answerer] + const events: GameEvent[] = [{ type: 'wrong', playerId: answerer, delta }] + + if (freePlayers(players, penalized).length === 0) { + return ok( + state, + { + players, + penalized, + closed: closeActive(state), + phase: 'reveal', + answerer: undefined, + buzzes: [], + deadline: undefined, + }, + events, + ) + } + + return ok( + state, + { + players, + penalized, + phase: 'question', + answerer: undefined, + buzzes: [], + deadline: now + pack.settings.answerTimeLimit * 1000, + }, + events, + ) +} + +function judgeFinal(state: GameState, verdict: JudgeVerdict, playerId: string | undefined): Result { + if (!playerId) return fail('в финале нужно указать игрока') + const player = state.players.find((p) => p.id === playerId) + if (!player) return fail('игрок не найден') + const bet = state.bets[playerId] ?? 0 + + if (verdict === 'skip') { + const finalJudged = { ...state.finalJudged } + delete finalJudged[playerId] + return ok(state, { finalJudged }) + } + + const delta = verdict === 'correct' ? bet : -bet + return ok( + state, + { + players: withScore(state.players, playerId, delta), + finalJudged: { ...state.finalJudged, [playerId]: verdict }, + }, + [{ type: verdict === 'correct' ? 'correct' : 'wrong', playerId, delta }], + ) +} + +// ─── Таймеры ─────────────────────────────────────────────────────────────── + +function expire(pack: Pack, state: GameState, now: number): Result { + switch (state.phase) { + case 'question': + case 'cat_nominate': + // Никто не успел: вопрос закрывается без изменения очков. + return ok( + state, + { + closed: closeActive(state), + phase: 'reveal', + answerer: undefined, + buzzes: [], + deadline: undefined, + }, + [{ type: 'timeout' }], + ) + + case 'auction': { + const winner = auctionWinner(state.players, state.bets) + if (!winner) { + return ok( + state, + { + closed: closeActive(state), + phase: 'reveal', + answerer: undefined, + buzzes: [], + deadline: undefined, + }, + [{ type: 'timeout' }], + ) + } + return ok( + state, + { + phase: 'answering', + answerer: winner.playerId, + stake: winner.amount, + deadline: now + pack.settings.answerTimeLimit * 1000, + }, + [{ type: 'timeout' }], + ) + } + + case 'answering': { + if (!state.answerer) { + return ok(state, { + closed: closeActive(state), + phase: 'reveal', + buzzes: [], + deadline: undefined, + }) + } + return settleWrong(pack, state, state.answerer, now) + } + + case 'final_bet': + return ok( + state, + { phase: 'final_question', deadline: undefined }, + [{ type: 'timeout' }], + ) + + default: + return { ok: true, state, events: [] } + } +} + +// ─── Команды ─────────────────────────────────────────────────────────────── + +export function applyCommand(pack: Pack, state: GameState, cmd: Command, ctx: Ctx): Result { + const { now, actor } = ctx + const isHost = actor.role === 'host' + + switch (cmd.type) { + case 'addPlayer': { + const existing = state.players.find((p) => p.id === cmd.playerId) + if (existing) { + // Повторный вход: обновляем имя и статус, очки сохраняем. + const name = cmd.name.trim() || existing.name + return ok(state, { + players: state.players.map((p) => + p.id === cmd.playerId ? { ...p, name, connected: true } : p, + ), + }) + } + if (state.phase === 'results') return fail('партия уже закончилась') + if (state.players.length >= MAX_PLAYERS) { + return fail(`больше ${MAX_PLAYERS} игроков не поддерживается`) + } + const player: Player = { + id: cmd.playerId, + name: cmd.name.trim() || `Игрок ${state.players.length + 1}`, + score: 0, + connected: true, + } + return ok(state, { + players: [...state.players, player], + turn: state.turn ?? player.id, + }) + } + + case 'removePlayer': { + if (!state.players.some((p) => p.id === cmd.playerId)) return fail('игрок не найден') + const marked = state.players.map((p) => + p.id === cmd.playerId ? { ...p, connected: false } : p, + ) + // В лобби партия ещё не началась — слот просто освобождается. + const players = + state.phase === 'lobby' ? marked.filter((p) => p.id !== cmd.playerId) : marked + const turn = state.turn === cmd.playerId ? players[0]?.id : state.turn + return ok(state, { players, turn }) + } + + case 'startGame': { + if (!isHost) return fail('начать игру может только ведущий') + if (state.phase !== 'lobby') return fail('игра уже началась') + if (state.players.length === 0) return fail('в игре нет игроков') + return ok( + state, + { + phase: 'intro', + roundIndex: 0, + turn: state.players[0]?.id, + active: undefined, + closed: [], + buzzes: [], + penalized: [], + answerer: undefined, + stake: undefined, + bets: {}, + finalJudged: {}, + deadline: undefined, + }, + [{ type: 'phase', phase: 'intro' }], + ) + } + + case 'next': { + if (!isHost) return fail('двигает игру дальше только ведущий') + switch (state.phase) { + case 'intro': + return ok(state, { phase: 'board', deadline: undefined }) + + case 'board': { + const round = currentRound(pack, state) + if (!round) return fail('раунд не найден') + if (!isRoundComplete(round, state.closed)) { + return fail('на табло ещё есть несыгранные клетки') + } + return ok(state, { phase: 'round_end' }, [ + { type: 'roundEnd', roundIndex: state.roundIndex }, + ]) + } + + case 'reveal': { + const round = currentRound(pack, state) + const complete = round ? isRoundComplete(round, state.closed) : true + const cleared: Partial = { + active: undefined, + answerer: undefined, + buzzes: [], + penalized: [], + stake: undefined, + deadline: undefined, + } + if (complete) { + return ok(state, { ...cleared, phase: 'round_end' }, [ + { type: 'roundEnd', roundIndex: state.roundIndex }, + ]) + } + return ok(state, { ...cleared, phase: 'board' }) + } + + case 'round_end': { + const nextIndex = state.roundIndex + 1 + if (nextIndex < pack.rounds.length) { + return ok(state, { + phase: 'intro', + roundIndex: nextIndex, + active: undefined, + answerer: undefined, + buzzes: [], + penalized: [], + stake: undefined, + deadline: undefined, + bets: {}, + }) + } + if (pack.settings.finalEnabled && pack.final) { + return ok(state, { + phase: 'final_bet', + active: undefined, + answerer: undefined, + buzzes: [], + penalized: [], + stake: undefined, + bets: {}, + finalJudged: {}, + deadline: now + pack.settings.betTimeLimit * 1000, + }) + } + return ok(state, { phase: 'results', deadline: undefined }, [{ type: 'gameOver' }]) + } + + case 'final_bet': + return ok(state, { phase: 'final_question', deadline: undefined }) + + case 'final_question': + return ok(state, { phase: 'final_reveal', deadline: undefined }) + + case 'final_reveal': + return ok(state, { phase: 'results', deadline: undefined }, [{ type: 'gameOver' }]) + + default: + return fail(`из фазы «${state.phase}» нельзя перейти дальше`) + } + } + + case 'selectCell': { + if (state.phase !== 'board') return fail('сейчас нельзя выбрать клетку') + if (actor.role === 'board') return fail('экран табло не управляет игрой') + if (actor.role === 'player' && state.turn !== actor.id) { + return fail('сейчас клетку выбирает другой игрок') + } + const found = findCell(pack, cmd.cellKey) + if (!found) return fail('такой клетки нет в паке') + if (state.closed.includes(cmd.cellKey)) return fail('эта клетка уже сыграна') + + const by = actor.role === 'player' ? actor.id : (state.turn ?? actor.id) + const base: Partial = { + active: { key: cmd.cellKey, by }, + buzzes: [], + penalized: [], + answerer: undefined, + stake: undefined, + bets: {}, + deadline: undefined, + } + const events: GameEvent[] = [{ type: 'cellOpened', cellKey: cmd.cellKey }] + + if (found.cell.kind === 'cat_in_bag') { + return ok( + state, + { ...base, phase: 'cat_nominate', deadline: now + pack.settings.answerTimeLimit * 1000 }, + events, + ) + } + if (found.cell.kind === 'auction') { + return ok( + state, + { ...base, phase: 'auction', deadline: now + pack.settings.auctionTimeLimit * 1000 }, + events, + ) + } + const limit = found.cell.timeLimit ?? pack.settings.defaultTimeLimit + return ok(state, { ...base, phase: 'question', deadline: now + limit * 1000 }, events) + } + + case 'nominate': { + const found = activeCellOf(pack, state) + if (!found || !state.active) return fail('нет открытой клетки') + const target = state.players.find((p) => p.id === cmd.playerId) + if (!target) return fail('игрок не найден') + + if (state.phase === 'cat_nominate') { + const allowed = + isHost || (actor.role === 'player' && state.active.by === actor.id) + if (!allowed) return fail('передавать вопрос может только открывший клетку') + if (target.id === state.active.by) return fail('нельзя передать вопрос самому себе') + return ok(state, { + phase: 'answering', + answerer: target.id, + deadline: now + pack.settings.answerTimeLimit * 1000, + }) + } + + if (state.phase === 'question' || state.phase === 'auction') { + if (!isHost) return fail('назначить отвечающего может только ведущий') + const stake = + state.phase === 'auction' + ? (state.bets[target.id] ?? effectiveValue(found.cell)) + : state.stake + return ok(state, { + phase: 'answering', + answerer: target.id, + stake, + deadline: now + pack.settings.answerTimeLimit * 1000, + }) + } + + return fail(`из фазы «${state.phase}» нельзя назначить игрока`) + } + + case 'buzz': { + if (actor.role !== 'player') return fail('нажимать может только игрок') + if (state.phase !== 'question') return fail('сейчас нельзя нажать') + if (!pack.settings.buzzers) return fail('в этой игре нажатия выключены') + if (state.answerer) return fail('отвечающий уже есть') + if (state.penalized.includes(actor.id)) return fail('вы уже отвечали на этот вопрос') + if (!state.players.some((p) => p.id === actor.id)) return fail('вас нет в игре') + + const buzz: Buzz = { playerId: actor.id, at: now } + return ok( + state, + { + buzzes: [...state.buzzes, buzz], + answerer: actor.id, + phase: 'answering', + deadline: now + pack.settings.answerTimeLimit * 1000, + }, + [{ type: 'buzz', playerId: actor.id, at: now }], + ) + } + + case 'judge': { + if (!isHost) return fail('судит только ведущий') + if (state.phase === 'answering') return judgeAnswer(pack, state, cmd.verdict, now) + if (state.phase === 'final_reveal') return judgeFinal(state, cmd.verdict, cmd.playerId) + // Снять вопрос можно и до того, как кто-то ответил: таймер — не единственный + // способ закрыть клетку, ведущий должен уметь это по ходу игры. + if ( + cmd.verdict === 'skip' && + (state.phase === 'question' || state.phase === 'cat_nominate' || state.phase === 'auction') + ) { + return ok(state, { + closed: closeActive(state), + phase: 'reveal', + answerer: undefined, + buzzes: [], + deadline: undefined, + }) + } + return fail(`судить можно в фазе ответа, а сейчас «${state.phase}»`) + } + + case 'bet': { + if (state.phase !== 'auction' && state.phase !== 'final_bet') { + return fail('сейчас не время ставить') + } + // Игрок ставит за себя, ведущий — за конкретного игрока: телефон может + // разрядиться, и партия не должна из-за этого встать. + const targetId = actor.role === 'player' ? actor.id : cmd.playerId + if (!targetId) return fail('ведущему нужно указать игрока') + if (actor.role !== 'player' && actor.role !== 'host') return fail('ставку делает игрок') + const player = state.players.find((p) => p.id === targetId) + if (!player) return fail('игрок не найден') + if (!Number.isInteger(cmd.amount) || cmd.amount <= 0) { + return fail('ставка должна быть целым положительным числом') + } + if (state.phase === 'auction') { + const found = activeCellOf(pack, state) + if (!found) return fail('нет открытой клетки') + if (cmd.amount > found.cell.value) { + return fail(`ставка не может быть больше номинала (${found.cell.value})`) + } + } else { + const limit = Math.max(player.score, 100) + if (cmd.amount > limit) return fail(`ставка не может быть больше ${limit}`) + } + + const bets = { ...state.bets, [targetId]: cmd.amount } + const allBet = state.players.every((p) => bets[p.id] !== undefined) + + if (state.phase === 'auction' && allBet) { + const winner = auctionWinner(state.players, bets) + if (winner) { + return ok(state, { + bets, + phase: 'answering', + answerer: winner.playerId, + stake: winner.amount, + deadline: now + pack.settings.answerTimeLimit * 1000, + }) + } + } + if (state.phase === 'final_bet' && allBet) { + return ok(state, { bets, phase: 'final_question', deadline: undefined }) + } + return ok(state, { bets }) + } + + case 'adjustScore': { + if (!isHost) return fail('менять очки может только ведущий') + if (!state.players.some((p) => p.id === cmd.playerId)) return fail('игрок не найден') + if (!Number.isInteger(cmd.delta) || cmd.delta === 0) { + return fail('изменение должно быть целым и не нулевым') + } + return ok(state, { players: withScore(state.players, cmd.playerId, cmd.delta) }) + } + + case 'resetGame': { + if (!isHost) return fail('перезапустить игру может только ведущий') + if (state.phase === 'lobby') return fail('игра ещё не начиналась') + // Остаются только те, кто сейчас за столом: отключившиеся — это следы + // прошлой партии, их место в новой игре никому не нужно. + return ok( + state, + { + phase: 'lobby', + roundIndex: 0, + turn: state.players.find((player) => player.connected)?.id, + active: undefined, + closed: [], + buzzes: [], + penalized: [], + answerer: undefined, + stake: undefined, + bets: {}, + finalJudged: {}, + deadline: undefined, + players: state.players + .filter((player) => player.connected) + .map((player) => ({ ...player, score: 0 })), + }, + [{ type: 'phase', phase: 'lobby' }], + ) + } + + case 'tick': { + if (!state.deadline || now < state.deadline) { + // Ничего не меняем и НЕ трогаем seq: иначе гоняли бы снапшот каждые 100 мс. + return { ok: true, state, events: [] } + } + return expire(pack, state, now) + } + + default: { + // Исчерпывающая проверка: новая команда без обработки не скомпилируется. + const never: never = cmd + return fail(`неизвестная команда: ${JSON.stringify(never)}`) + } + } +} diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts new file mode 100644 index 0000000..7388b02 --- /dev/null +++ b/packages/shared/src/index.ts @@ -0,0 +1,36 @@ +export type * from './types' + +export { + packSchema, + parsePack, + cellKey, + parseCellKey, + findCell, + roundCellKeys, + isRoundComplete, + effectiveValue, +} from './pack' +export type { CellKeyParts, FoundCell, ParsePackResult, ParsedPack } from './pack' + +export { applyCommand, initialState } from './game' +export { GameEngine } from './engine' +export type { EngineOptions } from './engine' + +export { project, projectBoard } from './projection' +export type { + PublicActive, + PublicBoard, + PublicCell, + PublicFinal, + PublicPlayer, + PublicQuestion, + PublicReveal, + PublicRound, + PublicState, + PublicTheme, + View, + You, +} from './projection' + +export { EVENTS, ROOM_ALPHABET, makeRoomCode, normalizeRoomCode } from './protocol' +export type { AuthPayload, ClientRole, CmdMessage, HelloMessage, ServerError, UndoMessage } from './protocol' diff --git a/packages/shared/src/pack.ts b/packages/shared/src/pack.ts new file mode 100644 index 0000000..546e53b --- /dev/null +++ b/packages/shared/src/pack.ts @@ -0,0 +1,217 @@ +/** + * Схема пака, валидация и помощники навигации по сетке. + * + * Задача схемы — сделать так, чтобы опечатка в JSON не могла сломать игру: + * сервер не падает на битом паке, он его отклоняет с внятным сообщением. + */ + +import { z } from 'zod' +import type { Cell, Pack, Round } from './types' + +const idSchema = z + .string() + .min(1) + .regex(/^[a-z0-9][a-z0-9-]*$/, 'id: только строчные латинские буквы, цифры и дефис') + +const mediaSchema = z.object({ + kind: z.enum(['audio', 'image', 'video']), + src: z + .string() + .startsWith('/media/', 'src должен начинаться с /media/ — файлы раздаёт наш сервер'), + hint: z.string().min(1).optional(), +}) + +const questionSchema = z + .object({ + text: z.string().min(1).optional(), + media: mediaSchema.optional(), + answer: z.string().min(1), + comment: z.string().min(1).optional(), + }) + .refine((q) => Boolean(q.text || q.media), { + message: 'у вопроса должен быть text или media', + }) + +const cellSchema = z.object({ + value: z.number().int().positive(), + kind: z.enum(['normal', 'cat_in_bag', 'auction', 'super']).default('normal'), + question: questionSchema, + timeLimit: z.number().int().positive().optional(), +}) + +const themeSchema = z.object({ + id: idSchema, + title: z.string().min(1), + cells: z.array(cellSchema).min(1), +}) + +const roundSchema = z + .object({ + id: idSchema, + title: z.string().min(1), + themes: z.array(themeSchema).min(1), + }) + .superRefine((round, ctx) => { + // Табло — это прямоугольник: у всех тем раунда одинаковое число клеток. + const sizes = new Set(round.themes.map((t) => t.cells.length)) + if (sizes.size > 1) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + path: ['themes'], + message: `у всех тем раунда должно быть одинаковое число клеток, а сейчас ${[...sizes].join(', ')}`, + }) + } + + const themeIds = new Set() + for (const theme of round.themes) { + if (themeIds.has(theme.id)) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + path: ['themes'], + message: `повторяющийся id темы: ${theme.id}`, + }) + } + themeIds.add(theme.id) + + // Стоимость — это подпись клетки на табло, дубликат выглядит как баг. + const values = new Set() + for (const cell of theme.cells) { + if (values.has(cell.value)) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + path: ['themes', theme.id], + message: `в теме «${theme.title}» повторяется номинал ${cell.value}`, + }) + } + values.add(cell.value) + } + } + }) + +const settingsSchema = z + .object({ + wrongPenalty: z.enum(['none', 'value']).default('value'), + buzzers: z.boolean().default(true), + finalEnabled: z.boolean().default(true), + defaultTimeLimit: z.number().int().positive().max(600).default(30), + answerTimeLimit: z.number().int().positive().max(600).default(20), + auctionTimeLimit: z.number().int().positive().max(600).default(30), + betTimeLimit: z.number().int().positive().max(600).default(20), + }) + .default({}) + +export const packSchema = z + .object({ + id: idSchema, + title: z.string().min(1), + settings: settingsSchema, + rounds: z.array(roundSchema).min(1), + final: z.object({ question: questionSchema }).optional(), + }) + .superRefine((pack, ctx) => { + const roundIds = new Set() + for (const round of pack.rounds) { + if (roundIds.has(round.id)) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + path: ['rounds'], + message: `повторяющийся id раунда: ${round.id}`, + }) + } + roundIds.add(round.id) + } + + if (pack.final && !pack.settings.finalEnabled) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + path: ['final'], + message: 'финальный раунд задан, но finalEnabled = false', + }) + } + }) + +export type ParsedPack = z.infer + +export type ParsePackResult = + | { ok: true; pack: Pack } + | { ok: false; errors: string[] } + +export function parsePack(input: unknown): ParsePackResult { + const parsed = packSchema.safeParse(input) + if (!parsed.success) { + return { + ok: false, + errors: parsed.error.issues.map( + (issue) => `${issue.path.join('.') || '(корень)'}: ${issue.message}`, + ), + } + } + // Схема полностью описывает Pack; приведение нужно, чтобы точный тип + // контракта не зависел от того, как zod выводит значения по умолчанию. + return { ok: true, pack: parsed.data as Pack } +} + +// ─── Ключи клеток ────────────────────────────────────────────────────────── + +/** Ключ клетки: `roundId/themeId/index`. Устойчив к правкам текста вопросов. */ +export function cellKey(roundId: string, themeId: string, index: number): string { + return `${roundId}/${themeId}/${index}` +} + +export interface CellKeyParts { + roundId: string + themeId: string + index: number +} + +export function parseCellKey(key: string): CellKeyParts | null { + // Ключ приходит и по сети: строка не гарантирована, а падать из-за этого нельзя. + if (typeof key !== 'string') return null + const parts = key.split('/') + if (parts.length !== 3) return null + const [roundId, themeId, indexRaw] = parts + if (!roundId || !themeId || indexRaw === undefined) return null + const index = Number(indexRaw) + if (!Number.isInteger(index) || index < 0) return null + return { roundId, themeId, index } +} + +export interface FoundCell { + key: string + round: Round + roundIndex: number + themeId: string + index: number + cell: Cell +} + +export function findCell(pack: Pack, key: string): FoundCell | null { + const parts = parseCellKey(key) + if (!parts) return null + const roundIndex = pack.rounds.findIndex((r) => r.id === parts.roundId) + if (roundIndex < 0) return null + const round = pack.rounds[roundIndex] + if (!round) return null + const theme = round.themes.find((t) => t.id === parts.themeId) + if (!theme) return null + const cell = theme.cells[parts.index] + if (!cell) return null + return { key, round, roundIndex, themeId: theme.id, index: parts.index, cell } +} + +export function roundCellKeys(round: Round): string[] { + const keys: string[] = [] + for (const theme of round.themes) { + theme.cells.forEach((_, index) => keys.push(cellKey(round.id, theme.id, index))) + } + return keys +} + +export function isRoundComplete(round: Round, closed: readonly string[]): boolean { + return roundCellKeys(round).every((key) => closed.includes(key)) +} + +/** Стоимость клетки в очках: «супер» удваивает номинал. */ +export function effectiveValue(cell: Cell): number { + return cell.kind === 'super' ? cell.value * 2 : cell.value +} diff --git a/packages/shared/src/projection.ts b/packages/shared/src/projection.ts new file mode 100644 index 0000000..b791a84 --- /dev/null +++ b/packages/shared/src/projection.ts @@ -0,0 +1,254 @@ +/** + * Проекция состояния под конкретную роль. + * + * Правило одно и жёсткое: правильный ответ не попадает в `board` и `player` + * до фазы reveal. Иначе любой игрок откроет devtools и прочитает ответ. + * Ведущему ответ нужен сразу — он по нему судит. + * + * По той же причине в `board`-проекции нет самого пака: клетки приходят + * уже «обезвреженными» — номинал, тип, закрыта/нет, без вопроса и ответа. + */ + +import type { Buzz, CellKind, GameState, Media, Pack, Phase } from './types' +import { findCell } from './pack' + +export type View = 'board' | 'host' | 'player' + +export interface PublicCell { + key: string + value: number + kind: CellKind + closed: boolean +} + +export interface PublicTheme { + id: string + title: string + cells: PublicCell[] +} + +export interface PublicRound { + id: string + title: string + themes: PublicTheme[] +} + +export interface PublicBoard { + round: PublicRound + roundIndex: number + totalRounds: number +} + +export interface PublicQuestion { + text?: string + media?: Media + /** Только для ведущего: ремарка, которую полезно прочитать вслух. */ + comment?: string +} + +export interface PublicActive { + key: string + value: number + kind: CellKind + /** Кто открыл клетку: он же передаёт «кота в мешке». */ + by: string + question: PublicQuestion + /** Только для ведущего. */ + answer?: string +} + +export interface PublicReveal { + answer: string + comment?: string +} + +export interface PublicFinal { + question?: PublicQuestion + /** Только для ведущего. */ + answer?: string + revealed?: PublicReveal +} + +export interface PublicPlayer { + id: string + name: string + score: number + connected: boolean +} + +export interface You { + id: string + canPick: boolean + canBuzz: boolean + canNominate: boolean + canBet: boolean + bet?: number +} + +export interface PublicState { + /** Версия состояния: клиент игнорирует всё, что старее. */ + seq: number + /** Серверное время на момент сборки: клиент считает по нему смещение часов. */ + now: number + phase: Phase + packId: string + packTitle: string + board: PublicBoard + players: PublicPlayer[] + turn?: string + active?: PublicActive + answerer?: string + buzzes: Buzz[] + penalized: string[] + /** Фактическая стоимость розыгрыша: ставка аукциона, иначе номинал. */ + stake?: number + deadline?: number + bets?: Record + revealed?: PublicReveal + final?: PublicFinal + finalJudged?: Record + you?: You +} + +export function projectBoard(pack: Pack, state: GameState): PublicBoard { + const round = pack.rounds[state.roundIndex] ?? { + id: 'empty', + title: '—', + themes: [], + } + + return { + roundIndex: state.roundIndex, + totalRounds: pack.rounds.length, + round: { + id: round.id, + title: round.title, + themes: round.themes.map((theme) => ({ + id: theme.id, + title: theme.title, + cells: theme.cells.map((cell, index) => ({ + key: `${round.id}/${theme.id}/${index}`, + value: cell.value, + kind: cell.kind, + closed: state.closed.includes(`${round.id}/${theme.id}/${index}`), + })), + })), + }, + } +} + +const FINAL_PHASES: Phase[] = ['final_bet', 'final_question', 'final_reveal', 'results'] + +export function project( + pack: Pack, + state: GameState, + view: View, + viewerId?: string, + now: number = Date.now(), +): PublicState { + const board = projectBoard(pack, state) + const found = state.active ? findCell(pack, state.active.key) : null + const answerVisible = state.phase === 'reveal' || state.phase === 'results' + + let active: PublicActive | undefined + if (state.active && found) { + active = { + key: found.key, + value: found.cell.value, + kind: found.cell.kind, + by: state.active.by, + question: { + text: found.cell.question.text, + media: found.cell.question.media, + ...(view === 'host' ? { comment: found.cell.question.comment } : {}), + }, + } + if (view === 'host') active.answer = found.cell.question.answer + } + + let revealed: PublicReveal | undefined + if (answerVisible && found) { + revealed = { + answer: found.cell.question.answer, + comment: found.cell.question.comment, + } + } + + let final: PublicFinal | undefined + if (pack.final && FINAL_PHASES.includes(state.phase)) { + final = {} + if (state.phase !== 'final_bet') { + final.question = { + text: pack.final.question.text, + media: pack.final.question.media, + } + } + if (view === 'host') final.answer = pack.final.question.answer + if (state.phase === 'final_reveal' || state.phase === 'results') { + final.revealed = { + answer: pack.final.question.answer, + comment: pack.final.question.comment, + } + } + } + + // Ставки в аукционе и финале скрыты от игроков до вскрытия: свой размер + // игрок видит в `you`, а ведущему нужно знать, кто ещё не поставил. + const betsVisible = + view === 'host' || + state.phase === 'answering' || + state.phase === 'reveal' || + state.phase === 'final_reveal' || + state.phase === 'results' + + let you: You | undefined + if (view === 'player' && viewerId) { + const me = state.players.find((p) => p.id === viewerId) + if (me) { + you = { + id: me.id, + canPick: state.phase === 'board' && state.turn === me.id, + canBuzz: + state.phase === 'question' && + pack.settings.buzzers && + !state.penalized.includes(me.id) && + !state.answerer, + canNominate: state.phase === 'cat_nominate' && state.active?.by === me.id, + canBet: + (state.phase === 'auction' || state.phase === 'final_bet') && + state.bets[me.id] === undefined, + bet: state.bets[me.id], + } + } + } + + return { + seq: state.seq, + now, + phase: state.phase, + packId: pack.id, + packTitle: pack.title, + board, + players: state.players.map((p) => ({ + id: p.id, + name: p.name, + score: p.score, + connected: p.connected, + })), + turn: state.turn, + active, + answerer: state.answerer, + buzzes: state.buzzes, + penalized: state.penalized, + stake: state.stake, + deadline: state.deadline, + bets: betsVisible ? { ...state.bets } : undefined, + revealed, + final, + finalJudged: + state.phase === 'final_reveal' || state.phase === 'results' + ? { ...state.finalJudged } + : undefined, + you, + } +} diff --git a/packages/shared/src/protocol.ts b/packages/shared/src/protocol.ts new file mode 100644 index 0000000..5102d8e --- /dev/null +++ b/packages/shared/src/protocol.ts @@ -0,0 +1,70 @@ +/** + * Проводной протокол между клиентом и сервером. + * + * Живёт в shared, потому что обе стороны должны говорить на одном языке: + * сервер не должен угадывать, что прислал клиент, а клиент — что придёт назад. + */ + +import type { Command } from './types' + +export type ClientRole = 'board' | 'host' | 'player' + +/** То, что клиент кладёт в `auth` при подключении. */ +export interface AuthPayload { + room: string + role: ClientRole + /** Имя игрока; используется только при роли player. */ + name?: string + /** Токен ведущего; используется только при роли host. */ + token?: string + /** Для восстановления места после реконнекта или блокировки экрана. */ + playerId?: string + playerToken?: string +} + +export interface HelloMessage { + room: string + role: ClientRole + playerId?: string + /** Выдаётся один раз — новому игроку, чтобы он мог вернуться. */ + playerToken?: string + /** Серверное время: клиент считает по нему смещение своих часов. */ + serverNow: number +} + +export interface CmdMessage { + cmdId: string + command: Command +} + +export interface UndoMessage { + cmdId: string +} + +export interface ServerError { + cmdId?: string + reason: string +} + +/** Имена событий в одном месте: опечатка в строке ломает связь молча. */ +export const EVENTS = { + hello: 'hello', + state: 'state', + event: 'event', + cmd: 'cmd', + undo: 'undo', + error: 'error', +} as const + +/** Коды комнат: без похожих символов, чтобы их можно было продиктовать вслух. */ +export const ROOM_ALPHABET = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789' + +export function makeRoomCode(random: (max: number) => number = (max) => Math.floor(Math.random() * max)): string { + let code = '' + for (let i = 0; i < 4; i += 1) code += ROOM_ALPHABET[random(ROOM_ALPHABET.length)] + return code +} + +export function normalizeRoomCode(input: string): string { + return input.trim().toUpperCase() +} diff --git a/packages/shared/src/types.ts b/packages/shared/src/types.ts new file mode 100644 index 0000000..792f431 --- /dev/null +++ b/packages/shared/src/types.ts @@ -0,0 +1,181 @@ +/** + * Контракт игры: контент, состояние партии, команды, события. + * + * Этот файл не зависит ни от сети, ни от фреймворка, ни от браузера. + * Его импортируют и сервер, и клиент, и тесты. + */ + +// ─── Контент ─────────────────────────────────────────────────────────────── + +export type MediaKind = 'audio' | 'image' | 'video' + +export interface Media { + kind: MediaKind + /** Всегда путь внутри /media/... — файлы раздаёт наш же сервер, без CDN. */ + src: string + hint?: string +} + +export interface Question { + text?: string + media?: Media + /** НЕ уходит на табло и телефоны до фазы reveal. */ + answer: string + /** Комментарий ведущему: «интересный факт», подсказка для судейства. */ + comment?: string +} + +export type CellKind = 'normal' | 'cat_in_bag' | 'auction' | 'super' + +export interface Cell { + value: number + kind: CellKind + question: Question + timeLimit?: number +} + +export interface Theme { + id: string + title: string + cells: Cell[] +} + +export interface Round { + id: string + title: string + themes: Theme[] +} + +export type WrongPenalty = 'none' | 'value' + +export interface PackSettings { + /** Штраф за неверный ответ: ничего или номинал вопроса. */ + wrongPenalty: WrongPenalty + /** Нужен ли «кто первый нажал» или ведущий назначает отвечающего. */ + buzzers: boolean + finalEnabled: boolean + /** Секунды по умолчанию на вопрос. */ + defaultTimeLimit: number + /** Секунды на ответ конкретного игрока. */ + answerTimeLimit: number + /** Секунды на ставки в «аукционе». */ + auctionTimeLimit: number + /** Секунды на ставки в финале. */ + betTimeLimit: number +} + +export interface FinalRound { + question: Question +} + +export interface Pack { + id: string + title: string + settings: PackSettings + rounds: Round[] + final?: FinalRound +} + +// ─── Партия ──────────────────────────────────────────────────────────────── + +export type Phase = + | 'lobby' + | 'intro' + | 'board' + | 'question' + | 'cat_nominate' + | 'auction' + | 'answering' + | 'reveal' + | 'round_end' + | 'final_bet' + | 'final_question' + | 'final_reveal' + | 'results' + +export interface Player { + id: string + name: string + score: number + connected: boolean +} + +export interface Buzz { + playerId: string + at: number +} + +/** Открытая клетка: ключ + кто её открыл (он же передаёт «кота в мешке»). */ +export interface ActiveCell { + key: string + by: string +} + +export interface GameState { + /** Монотонная версия: клиент игнорирует снапшоты со старым seq. */ + seq: number + phase: Phase + roundIndex: number + players: Player[] + /** Кто выбирает следующую клетку. */ + turn?: string + active?: ActiveCell + /** Ключи всех сыгранных клеток. */ + closed: string[] + buzzes: Buzz[] + /** Кому уже нельзя отвечать на текущий вопрос (ответили неверно). */ + penalized: string[] + answerer?: string + /** Фактическая стоимость розыгрыша: ставка аукциона, иначе номинал. */ + stake?: number + /** Ставки: аукцион и финал. */ + bets: Record + /** Абсолютное серверное время истечения фазы. */ + deadline?: number + /** Вердикты в финале, по игрокам. */ + finalJudged: Record +} + +// ─── Команды ─────────────────────────────────────────────────────────────── + +export type Role = 'host' | 'player' | 'board' | 'system' + +export interface Actor { + id: string + role: Role +} + +export interface Ctx { + now: number + actor: Actor +} + +export type JudgeVerdict = 'correct' | 'wrong' | 'skip' + +export type Command = + | { type: 'addPlayer'; playerId: string; name: string } + | { type: 'removePlayer'; playerId: string } + | { type: 'startGame' } + | { type: 'next' } + | { type: 'selectCell'; cellKey: string } + | { type: 'nominate'; playerId: string } + | { type: 'buzz' } + | { type: 'judge'; verdict: JudgeVerdict; playerId?: string } + | { type: 'bet'; amount: number; playerId?: string } + | { type: 'adjustScore'; playerId: string; delta: number } + | { type: 'resetGame' } + | { type: 'tick' } + +export type GameEvent = + | { type: 'phase'; phase: Phase } + | { type: 'cellOpened'; cellKey: string } + | { type: 'buzz'; playerId: string; at: number } + | { type: 'correct'; playerId: string; delta: number } + | { type: 'wrong'; playerId: string; delta: number } + | { type: 'timeout' } + | { type: 'roundEnd'; roundIndex: number } + | { type: 'gameOver' } + +export type Result = + | { ok: true; state: GameState; events: GameEvent[] } + | { ok: false; reason: string } diff --git a/packages/shared/test/content.test.ts b/packages/shared/test/content.test.ts new file mode 100644 index 0000000..d30e629 --- /dev/null +++ b/packages/shared/test/content.test.ts @@ -0,0 +1,219 @@ +/** + * Валидация контента. + * + * Пак — это данные, которые пишет человек руками, поэтому схема обязана + * ловить опечатки до игры, а не в момент показа вопроса на проекторе. + */ + +import { existsSync, readFileSync, readdirSync } from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { describe, expect, it } from 'vitest' +import type { Pack } from '../src/index' +import { cellKey, effectiveValue, findCell, isRoundComplete, parseCellKey, parsePack } from '../src/index' + +const CONTENT_DIR = fileURLToPath(new URL('../../../content/', import.meta.url)) +const PACKS_DIR = path.join(CONTENT_DIR, 'packs') + +function loadDemo(): unknown { + return JSON.parse(readFileSync(path.join(PACKS_DIR, 'demo.json'), 'utf8')) +} + +function packFiles(): string[] { + return readdirSync(PACKS_DIR).filter((file) => file.endsWith('.json')) +} + +function mediaSources(pack: Pack): string[] { + const sources: string[] = [] + for (const round of pack.rounds) { + for (const theme of round.themes) { + for (const cell of theme.cells) { + if (cell.question.media) sources.push(cell.question.media.src) + } + } + } + if (pack.final?.question.media) sources.push(pack.final.question.media.src) + return sources +} + +function errorsOf(input: unknown): string[] { + const result = parsePack(input) + if (result.ok) throw new Error('ожидалась ошибка валидации, а пак прошёл') + return result.errors +} + +function validPack(): Record { + return { + id: 'demo', + title: 'Демо', + settings: {}, + rounds: [ + { + id: 'r1', + title: 'Раунд 1', + themes: [ + { + id: 't1', + title: 'Тема 1', + cells: [{ value: 100, question: { text: 'Вопрос', answer: 'Ответ' } }], + }, + ], + }, + ], + } +} + +describe('все паки в репозитории', () => { + const files = packFiles() + + it('их вообще есть', () => { + expect(files.length).toBeGreaterThan(0) + }) + + for (const file of files) { + it(`${file}: проходит схему`, () => { + const raw: unknown = JSON.parse(readFileSync(path.join(PACKS_DIR, file), 'utf8')) + const result = parsePack(raw) + if (!result.ok) throw new Error(`${file}:\n${result.errors.join('\n')}`) + + for (const round of result.pack.rounds) { + const sizes = new Set(round.themes.map((theme) => theme.cells.length)) + expect(sizes.size).toBe(1) + } + }) + + it(`${file}: все медиафайлы лежат на диске`, () => { + // Самый обидный баг вечера — вопрос с музыкой, у которого нет файла. + const raw: unknown = JSON.parse(readFileSync(path.join(PACKS_DIR, file), 'utf8')) + const result = parsePack(raw) + if (!result.ok) throw new Error(`${file}:\n${result.errors.join('\n')}`) + + for (const source of mediaSources(result.pack)) { + const relative = source.replace(/^\/media\//, '') + const full = path.join(CONTENT_DIR, 'media', relative) + expect(existsSync(full), `нет файла для ${source} (${file})`).toBe(true) + } + }) + } +}) + +describe('демо-пак', () => { + it('проходит валидацию и готов к игре', () => { + const result = parsePack(loadDemo()) + if (!result.ok) throw new Error(result.errors.join('\n')) + const pack = result.pack + + expect(pack.rounds.length).toBeGreaterThan(0) + expect(pack.final).toBeDefined() + + for (const round of pack.rounds) { + const sizes = new Set(round.themes.map((t) => t.cells.length)) + expect(sizes.size).toBe(1) + for (const theme of round.themes) { + for (const cell of theme.cells) { + expect(cell.question.answer.length).toBeGreaterThan(0) + expect(Boolean(cell.question.text || cell.question.media)).toBe(true) + } + } + } + }) + + it('заполняет значения по умолчанию', () => { + const result = parsePack(loadDemo()) + if (!result.ok) throw new Error(result.errors.join('\n')) + expect(result.pack.settings.defaultTimeLimit).toBe(30) + expect(result.pack.settings.buzzers).toBe(true) + const firstCell = result.pack.rounds[0]?.themes[0]?.cells[0] + expect(firstCell?.kind).toBe('normal') + }) +}) + +describe('схема ловит ошибки автора', () => { + it('повторяющийся номинал в теме', () => { + const pack = validPack() + const round = (pack.rounds as any[])[0] + round.themes[0].cells.push({ value: 100, question: { text: 'Ещё', answer: 'Ответ' } }) + expect(errorsOf(pack).join(' ')).toMatch(/повторяется номинал 100/) + }) + + it('разное число клеток у тем', () => { + const pack = validPack() + const round = (pack.rounds as any[])[0] + round.themes.push({ + id: 't2', + title: 'Тема 2', + cells: [ + { value: 100, question: { text: 'Вопрос', answer: 'Ответ' } }, + { value: 200, question: { text: 'Вопрос', answer: 'Ответ' } }, + ], + }) + expect(errorsOf(pack).join(' ')).toMatch(/одинаковое число клеток/) + }) + + it('вопрос без текста и без медиа', () => { + const pack = validPack() + const round = (pack.rounds as any[])[0] + round.themes[0].cells[0].question = { answer: 'Ответ' } + expect(errorsOf(pack).join(' ')).toMatch(/text или media/) + }) + + it('медиа вне /media/', () => { + const pack = validPack() + const round = (pack.rounds as any[])[0] + round.themes[0].cells[0].question = { + media: { kind: 'audio', src: 'https://example.com/song.mp3' }, + answer: 'Ответ', + } + expect(errorsOf(pack).join(' ')).toMatch(/\/media\//) + }) + + it('финал задан, но выключен', () => { + const pack = validPack() + pack.settings = { finalEnabled: false } + pack.final = { question: { text: 'Финал', answer: 'Ответ' } } + expect(errorsOf(pack).join(' ')).toMatch(/finalEnabled/) + }) + + it('неизвестный тип клетки', () => { + const pack = validPack() + const round = (pack.rounds as any[])[0] + round.themes[0].cells[0].kind = 'bonus' + expect(errorsOf(pack).length).toBeGreaterThan(0) + }) +}) + +describe('навигация по сетке', () => { + it('ключ клетки переживает разбор', () => { + const key = cellKey('r1', 't1', 2) + expect(key).toBe('r1/t1/2') + expect(parseCellKey(key)).toEqual({ roundId: 'r1', themeId: 't1', index: 2 }) + expect(parseCellKey('мусор')).toBeNull() + expect(parseCellKey('r1/t1/нет')).toBeNull() + }) + + it('findCell находит клетку и стоимость с учётом супер-вопроса', () => { + const result = parsePack(loadDemo()) + if (!result.ok) throw new Error(result.errors.join('\n')) + const pack = result.pack + + const found = findCell(pack, 'r1/cinema/2') + expect(found?.cell.kind).toBe('super') + expect(found && effectiveValue(found.cell)).toBe(600) + + expect(findCell(pack, 'r1/нет-такой/0')).toBeNull() + expect(findCell(pack, 'r1/cinema/99')).toBeNull() + }) + + it('раунд считается сыгранным только когда закрыты все клетки', () => { + const result = parsePack(loadDemo()) + if (!result.ok) throw new Error(result.errors.join('\n')) + const round = result.pack.rounds[0] + if (!round) throw new Error('нет раунда') + + const keys = round.themes.flatMap((theme) => + theme.cells.map((_, index) => cellKey(round.id, theme.id, index)), + ) + expect(isRoundComplete(round, keys.slice(0, -1))).toBe(false) + expect(isRoundComplete(round, keys)).toBe(true) + }) +}) diff --git a/packages/shared/test/game.test.ts b/packages/shared/test/game.test.ts new file mode 100644 index 0000000..b2f2a93 --- /dev/null +++ b/packages/shared/test/game.test.ts @@ -0,0 +1,465 @@ +/** + * Сценарии партии целиком: без сети, без браузера, с подменёнными часами. + * + * Каждый тест — это то, что ведущий реально делает за вечер. Если сценарий + * зелёный здесь, в игре он сломается только из-за сети. + */ + +import { describe, expect, it } from 'vitest' +import type { Actor, Cell, Pack, PackSettings, Result } from '../src/index' +import { GameEngine, project } from '../src/index' + +const HOST: Actor = { id: 'host', role: 'host' } +const SYSTEM: Actor = { id: 'system', role: 'system' } +const p1: Actor = { id: 'p1', role: 'player' } +const p2: Actor = { id: 'p2', role: 'player' } + +const SETTINGS: PackSettings = { + wrongPenalty: 'value', + buzzers: true, + finalEnabled: true, + defaultTimeLimit: 30, + answerTimeLimit: 20, + auctionTimeLimit: 30, + betTimeLimit: 20, +} + +function cell(value: number, kind: Cell['kind'] = 'normal'): Cell { + return { value, kind, question: { text: `Вопрос за ${value}`, answer: `Ответ ${value}` } } +} + +/** Один раунд, две темы по три клетки — покрывают normal, cat_in_bag, auction, super. */ +function makePack(): Pack { + return { + id: 'test', + title: 'Тестовый пак', + // Копия обязательна: тесты меняют настройки, а общий объект протёк бы между ними. + settings: { ...SETTINGS }, + rounds: [ + { + id: 'r1', + title: 'Раунд 1', + themes: [ + { id: 't1', title: 'Тема 1', cells: [cell(100), cell(200), cell(300)] }, + { + id: 't2', + title: 'Тема 2', + cells: [cell(100, 'cat_in_bag'), cell(200, 'auction'), cell(300, 'super')], + }, + ], + }, + ], + final: { question: { text: 'Финальный вопрос', answer: 'Финальный ответ' } }, + } +} + +const KEYS = ['r1/t1/0', 'r1/t1/1', 'r1/t1/2', 'r1/t2/0', 'r1/t2/1', 'r1/t2/2'] + +function expectOk(result: Result): Extract { + if (!result.ok) throw new Error(`ожидался успех, а пришла ошибка: ${result.reason}`) + return result +} + +function expectFail(result: Result): string { + if (result.ok) throw new Error('ожидалась ошибка, а команда прошла') + return result.reason +} + +interface Setup { + engine: GameEngine + clock: { value: number } +} + +function setup(): Setup { + const clock = { value: 1_000_000 } + const engine = new GameEngine(makePack(), { now: () => clock.value }) + for (const [id, name] of [ + ['p1', 'Аня'], + ['p2', 'Боря'], + ] as const) { + expectOk(engine.dispatch({ type: 'addPlayer', playerId: id, name }, { actor: SYSTEM })) + } + expectOk(engine.dispatch({ type: 'startGame' }, { actor: HOST })) + expectOk(engine.dispatch({ type: 'next' }, { actor: HOST })) + return { engine, clock } +} + +/** Ведущий принудительно закрывает клетку: назначил игрока и снял вопрос. */ +function skipCell(engine: GameEngine, key: string): void { + expectOk(engine.dispatch({ type: 'selectCell', cellKey: key }, { actor: HOST })) + // У «кота в мешке» нельзя назначить того, кто открыл клетку, — берём другого. + const target = engine.current.active?.by === 'p1' ? 'p2' : 'p1' + expectOk(engine.dispatch({ type: 'nominate', playerId: target }, { actor: HOST })) + expectOk(engine.dispatch({ type: 'judge', verdict: 'skip' }, { actor: HOST })) + expectOk(engine.dispatch({ type: 'next' }, { actor: HOST })) +} + +describe('партия целиком', () => { + it('проходит от лобби до результатов', () => { + const { engine } = setup() + expect(engine.current.phase).toBe('board') + expect(engine.current.turn).toBe('p1') + + // Первая клетка — честный ответ на 100. + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + expect(engine.current.phase).toBe('question') + + expectOk(engine.dispatch({ type: 'buzz' }, { actor: p1 })) + expect(engine.current.phase).toBe('answering') + expect(engine.current.answerer).toBe('p1') + + expectOk(engine.dispatch({ type: 'judge', verdict: 'correct' }, { actor: HOST })) + expect(engine.current.phase).toBe('reveal') + expect(engine.current.closed).toContain('r1/t1/0') + expect(engine.current.turn).toBe('p1') + + const anya = engine.current.players.find((p) => p.id === 'p1') + expect(anya?.score).toBe(100) + + // Остальные клетки закрываем снятием вопроса. + expectOk(engine.dispatch({ type: 'next' }, { actor: HOST })) + for (const key of KEYS.slice(1)) skipCell(engine, key) + + expect(engine.current.phase).toBe('round_end') + expect(engine.current.closed).toHaveLength(KEYS.length) + + // Финал: ставки, вопрос, вскрытие. + expectOk(engine.dispatch({ type: 'next' }, { actor: HOST })) + expect(engine.current.phase).toBe('final_bet') + expectOk(engine.dispatch({ type: 'bet', amount: 50 }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'bet', amount: 100 }, { actor: p2 })) + expect(engine.current.phase).toBe('final_question') + + expectOk(engine.dispatch({ type: 'next' }, { actor: HOST })) + expect(engine.current.phase).toBe('final_reveal') + expectOk(engine.dispatch({ type: 'judge', verdict: 'correct', playerId: 'p2' }, { actor: HOST })) + + const boris = engine.current.players.find((p) => p.id === 'p2') + expect(boris?.score).toBe(100) + + expectOk(engine.dispatch({ type: 'next' }, { actor: HOST })) + expect(engine.current.phase).toBe('results') + }) + + it('удваивает номинал у супер-вопроса', () => { + const { engine } = setup() + // r1/t2/2 — супер за 300, ответ должен принести 600. + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t2/2' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'buzz' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'judge', verdict: 'correct' }, { actor: HOST })) + expect(engine.current.players.find((p) => p.id === 'p1')?.score).toBe(600) + }) +}) + +describe('неверный ответ', () => { + it('штрафует, возвращает вопрос в игру и блокирует повторное нажатие', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'buzz' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'judge', verdict: 'wrong' }, { actor: HOST })) + + expect(engine.current.phase).toBe('question') + expect(engine.current.penalized).toContain('p1') + expect(engine.current.players.find((p) => p.id === 'p1')?.score).toBe(-100) + expect(engine.current.answerer).toBeUndefined() + + // Тот же игрок второй раз нажать не может… + const reason = expectFail(engine.dispatch({ type: 'buzz' }, { actor: p1 })) + expect(reason).toMatch(/уже отвечали/) + + // …а второй игрок может, и забирает очки. + expectOk(engine.dispatch({ type: 'buzz' }, { actor: p2 })) + expectOk(engine.dispatch({ type: 'judge', verdict: 'correct' }, { actor: HOST })) + expect(engine.current.players.find((p) => p.id === 'p2')?.score).toBe(100) + expect(engine.current.phase).toBe('reveal') + }) + + it('ведущий может снять вопрос, не дожидаясь таймера', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + expect(engine.current.answerer).toBeUndefined() + + expectOk(engine.dispatch({ type: 'judge', verdict: 'skip' }, { actor: HOST })) + + expect(engine.current.phase).toBe('reveal') + expect(engine.current.closed).toContain('r1/t1/0') + expect(engine.current.players.every((p) => p.score === 0)).toBe(true) + }) + + it('закрывает вопрос, когда ответить больше некому', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'buzz' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'judge', verdict: 'wrong' }, { actor: HOST })) + expectOk(engine.dispatch({ type: 'buzz' }, { actor: p2 })) + expectOk(engine.dispatch({ type: 'judge', verdict: 'wrong' }, { actor: HOST })) + + expect(engine.current.phase).toBe('reveal') + expect(engine.current.closed).toContain('r1/t1/0') + }) + + it('без штрафа очки не меняются', () => { + const clock = { value: 1_000_000 } + const pack = makePack() + pack.settings.wrongPenalty = 'none' + const engine = new GameEngine(pack, { now: () => clock.value }) + expectOk(engine.dispatch({ type: 'addPlayer', playerId: 'p1', name: 'Аня' }, { actor: SYSTEM })) + expectOk(engine.dispatch({ type: 'startGame' }, { actor: HOST })) + expectOk(engine.dispatch({ type: 'next' }, { actor: HOST })) + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'buzz' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'judge', verdict: 'wrong' }, { actor: HOST })) + expect(engine.current.players[0]?.score).toBe(0) + }) +}) + +describe('кот в мешке', () => { + it('передать вопрос может только открывший клетку и не себе', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t2/0' }, { actor: p1 })) + expect(engine.current.phase).toBe('cat_nominate') + + expect(expectFail(engine.dispatch({ type: 'nominate', playerId: 'p2' }, { actor: p2 }))).toMatch( + /только открывший/, + ) + expect(expectFail(engine.dispatch({ type: 'nominate', playerId: 'p1' }, { actor: p1 }))).toMatch( + /самому себе/, + ) + + expectOk(engine.dispatch({ type: 'nominate', playerId: 'p2' }, { actor: p1 })) + expect(engine.current.phase).toBe('answering') + expect(engine.current.answerer).toBe('p2') + }) + + it('не даёт нажать кнопку во время передачи', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t2/0' }, { actor: p1 })) + expect(expectFail(engine.dispatch({ type: 'buzz' }, { actor: p2 }))).toMatch(/нельзя нажать/) + }) +}) + +describe('аукцион', () => { + it('играет на ставку победителя, а не на номинал', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t2/1' }, { actor: p1 })) + expect(engine.current.phase).toBe('auction') + + expectOk(engine.dispatch({ type: 'bet', amount: 150 }, { actor: p1 })) + expect(engine.current.phase).toBe('auction') + expectOk(engine.dispatch({ type: 'bet', amount: 50 }, { actor: p2 })) + + expect(engine.current.phase).toBe('answering') + expect(engine.current.answerer).toBe('p1') + expect(engine.current.stake).toBe(150) + + expectOk(engine.dispatch({ type: 'judge', verdict: 'correct' }, { actor: HOST })) + expect(engine.current.players.find((p) => p.id === 'p1')?.score).toBe(150) + }) + + it('не даёт поставить больше номинала', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t2/1' }, { actor: p1 })) + expect(expectFail(engine.dispatch({ type: 'bet', amount: 500 }, { actor: p1 }))).toMatch( + /больше номинала/, + ) + }) + + it('ведущий может поставить за игрока, если тот не успевает', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t2/1' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'bet', amount: 120, playerId: 'p2' }, { actor: HOST })) + expect(engine.current.bets['p2']).toBe(120) + + // Без указания игрока ставка ведущего не имеет смысла. + expect(expectFail(engine.dispatch({ type: 'bet', amount: 50 }, { actor: HOST }))).toMatch( + /указать игрока/, + ) + }) +}) + +describe('сброс партии', () => { + it('возвращает в лобби, обнуляет очки и оставляет игроков', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'buzz' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'judge', verdict: 'correct' }, { actor: HOST })) + expect(engine.current.players[0]?.score).toBe(100) + + expectOk(engine.dispatch({ type: 'resetGame' }, { actor: HOST })) + + expect(engine.current.phase).toBe('lobby') + expect(engine.current.closed).toEqual([]) + expect(engine.current.players).toHaveLength(2) + expect(engine.current.players.every((player) => player.score === 0)).toBe(true) + expect(engine.current.turn).toBe('p1') + }) + + it('не даёт сбросить игроку и не сбрасывает уже пустое лобби', () => { + const { engine } = setup() + expect(expectFail(engine.dispatch({ type: 'resetGame' }, { actor: p1 }))).toMatch( + /только ведущий/, + ) + expectOk(engine.dispatch({ type: 'resetGame' }, { actor: HOST })) + expect(expectFail(engine.dispatch({ type: 'resetGame' }, { actor: HOST }))).toMatch( + /ещё не начиналась/, + ) + }) + + it('выбрасывает отключившихся: за столом только подключённые', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'removePlayer', playerId: 'p2' }, { actor: SYSTEM })) + expectOk(engine.dispatch({ type: 'resetGame' }, { actor: HOST })) + + expect(engine.current.players.map((player) => player.id)).toEqual(['p1']) + expect(engine.current.turn).toBe('p1') + }) +}) + +describe('таймеры', () => { + it('по истечении времени закрывает вопрос без штрафа', () => { + const { engine, clock } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + const deadline = engine.current.deadline + expect(deadline).toBe(clock.value + 30_000) + + clock.value += 30_001 + expectOk(engine.dispatch({ type: 'tick' }, { actor: SYSTEM })) + + expect(engine.current.phase).toBe('reveal') + expect(engine.current.closed).toContain('r1/t1/0') + expect(engine.current.players.find((p) => p.id === 'p1')?.score).toBe(0) + }) + + it('до истечения tick ничего не меняет и не двигает версию', () => { + const { engine, clock } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + const before = engine.current + clock.value += 1_000 + const result = expectOk(engine.dispatch({ type: 'tick' }, { actor: SYSTEM })) + expect(result.state).toBe(before) + expect(engine.current.seq).toBe(before.seq) + }) + + it('просроченный ответ игрока трактуется как неверный', () => { + const { engine, clock } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'buzz' }, { actor: p1 })) + clock.value += 20_001 + expectOk(engine.dispatch({ type: 'tick' }, { actor: SYSTEM })) + expect(engine.current.penalized).toContain('p1') + expect(engine.current.players.find((p) => p.id === 'p1')?.score).toBe(-100) + }) + + it('аукцион по таймауту достаётся лидеру', () => { + const { engine, clock } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t2/1' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'bet', amount: 100 }, { actor: p2 })) + clock.value += 30_001 + expectOk(engine.dispatch({ type: 'tick' }, { actor: SYSTEM })) + expect(engine.current.phase).toBe('answering') + expect(engine.current.answerer).toBe('p2') + expect(engine.current.stake).toBe(100) + }) +}) + +describe('undo и идемпотентность', () => { + it('откатывает последний шаг и сохраняет растущий seq', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'buzz' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'judge', verdict: 'correct' }, { actor: HOST })) + expect(engine.current.phase).toBe('reveal') + const seqBefore = engine.current.seq + + expectOk(engine.undo(HOST)) + + expect(engine.current.phase).toBe('answering') + expect(engine.current.players.find((p) => p.id === 'p1')?.score).toBe(0) + expect(engine.current.closed).not.toContain('r1/t1/0') + expect(engine.current.seq).toBe(seqBefore + 1) + }) + + it('не даёт откатывать игроку', () => { + const { engine } = setup() + expect(expectFail(engine.undo(p1))).toMatch(/только ведущий/) + }) + + it('повторная команда с тем же cmdId не применяется дважды', () => { + const { engine } = setup() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + const first = expectOk(engine.dispatch({ type: 'buzz' }, { actor: p1, cmdId: 'same' })) + const second = expectOk(engine.dispatch({ type: 'buzz' }, { actor: p2, cmdId: 'same' })) + expect(second.state).toBe(first.state) + expect(engine.current.answerer).toBe('p1') + expect(engine.current.buzzes).toHaveLength(1) + }) +}) + +describe('авторизация', () => { + it('игрок не может выбрать клетку не в свой ход', () => { + const { engine } = setup() + expect(expectFail(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p2 }))) + .toMatch(/другой игрок/) + }) + + it('экран табло не управляет игрой', () => { + const { engine } = setup() + const board: Actor = { id: 'board', role: 'board' } + expect(expectFail(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: board }))) + .toMatch(/не управляет/) + expect(expectFail(engine.dispatch({ type: 'next' }, { actor: board }))).toMatch(/только ведущий/) + }) + + it('игрок не может судить и менять очки', () => { + const { engine } = setup() + expect(expectFail(engine.dispatch({ type: 'adjustScore', playerId: 'p1', delta: 500 }, { actor: p1 }))) + .toMatch(/только ведущий/) + expect(expectFail(engine.dispatch({ type: 'judge', verdict: 'correct' }, { actor: p1 }))) + .toMatch(/только ведущий/) + }) +}) + +describe('проекция по ролям', () => { + it('не отдаёт правильный ответ на табло и телефоны до вскрытия', () => { + const { engine } = setup() + const pack = makePack() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + + const boardView = project(pack, engine.current, 'board') + expect(JSON.stringify(boardView)).not.toContain('Ответ 100') + expect(boardView.active?.question.text).toBe('Вопрос за 100') + + const playerView = project(pack, engine.current, 'player', 'p1') + expect(JSON.stringify(playerView)).not.toContain('Ответ 100') + expect(playerView.you?.canBuzz).toBe(true) + + // Только ведущему ответ доступен сразу — он по нему судит. + const hostView = project(pack, engine.current, 'host') + expect(hostView.active?.answer).toBe('Ответ 100') + }) + + it('после вскрытия ответ появляется у всех', () => { + const { engine } = setup() + const pack = makePack() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t1/0' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'nominate', playerId: 'p2' }, { actor: HOST })) + expectOk(engine.dispatch({ type: 'judge', verdict: 'skip' }, { actor: HOST })) + + const boardView = project(pack, engine.current, 'board') + expect(boardView.revealed?.answer).toBe('Ответ 100') + }) + + it('прячет чужие ставки аукциона, но показывает свою', () => { + const { engine } = setup() + const pack = makePack() + expectOk(engine.dispatch({ type: 'selectCell', cellKey: 'r1/t2/1' }, { actor: p1 })) + expectOk(engine.dispatch({ type: 'bet', amount: 120 }, { actor: p1 })) + + const viewOfP1 = project(pack, engine.current, 'player', 'p1') + expect(viewOfP1.you?.bet).toBe(120) + expect(viewOfP1.bets).toBeUndefined() + + const viewOfP2 = project(pack, engine.current, 'player', 'p2') + expect(viewOfP2.you?.bet).toBeUndefined() + }) +}) diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json new file mode 100644 index 0000000..fa45778 --- /dev/null +++ b/packages/shared/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "noEmit": true, + "types": ["node", "vitest/globals"] + }, + "include": ["src/**/*.ts", "test/**/*.ts"] +} diff --git a/packages/web/index.html b/packages/web/index.html new file mode 100644 index 0000000..cf2f916 --- /dev/null +++ b/packages/web/index.html @@ -0,0 +1,16 @@ + + + + + + + Новогодний квиз + + +
+ + + diff --git a/packages/web/package.json b/packages/web/package.json new file mode 100644 index 0000000..dc08bbc --- /dev/null +++ b/packages/web/package.json @@ -0,0 +1,26 @@ +{ + "name": "@quiz/web", + "version": "0.1.0", + "private": true, + "type": "module", + "description": "Табло, пульт ведущего и телефон игрока", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "typecheck": "vue-tsc --noEmit" + }, + "dependencies": { + "@quiz/shared": "0.1.0", + "qrcode": "^1.5.4", + "socket.io-client": "^4.8.1", + "vue": "^3.5.13", + "vue-router": "^4.5.0" + }, + "devDependencies": { + "@types/qrcode": "^1.5.5", + "@vitejs/plugin-vue": "^5.2.1", + "vite": "^5.4.11", + "vue-tsc": "^2.1.10" + } +} diff --git a/packages/web/src/App.vue b/packages/web/src/App.vue new file mode 100644 index 0000000..0ea89de --- /dev/null +++ b/packages/web/src/App.vue @@ -0,0 +1,26 @@ + + + diff --git a/packages/web/src/audio/sfx.ts b/packages/web/src/audio/sfx.ts new file mode 100644 index 0000000..3f45382 --- /dev/null +++ b/packages/web/src/audio/sfx.ts @@ -0,0 +1,112 @@ +/** + * Звуки квиза, синтезированные на месте. + * + * Ни одного mp3 в репозитории: звук собирается из осцилляторов. Причина не в + * экономии — на площадке нечему «не загрузиться», и папку с ассетами нельзя + * забыть скопировать на другой ноутбук. + * + * Браузер не даёт звучать до действия пользователя, поэтому на табло есть + * кнопка включения: один клик при настройке — и дальше всё играет само. + */ + +const STORAGE_KEY = 'quiz:sound' + +let context: AudioContext | null = null +let enabled = false + +export function preferredSound(): boolean { + try { + return localStorage.getItem(STORAGE_KEY) === '1' + } catch { + return false + } +} + +export function soundEnabled(): boolean { + return enabled +} + +export async function enableSound(): Promise { + if (typeof window === 'undefined') return false + try { + if (!context) context = new AudioContext() + if (context.state === 'suspended') await context.resume() + enabled = context.state === 'running' + localStorage.setItem(STORAGE_KEY, enabled ? '1' : '0') + } catch { + enabled = false + } + return enabled +} + +export function disableSound(): void { + enabled = false + try { + localStorage.setItem(STORAGE_KEY, '0') + } catch { + // Приватный режим — не страшно. + } +} + +interface ToneOptions { + frequency: number + duration: number + type?: OscillatorType + gain?: number + delay?: number + sweepTo?: number +} + +function tone(options: ToneOptions): void { + if (!enabled || !context || context.state !== 'running') return + + const start = context.currentTime + (options.delay ?? 0) + const oscillator = context.createOscillator() + const amp = context.createGain() + + oscillator.type = options.type ?? 'sine' + oscillator.frequency.setValueAtTime(options.frequency, start) + if (options.sweepTo) { + oscillator.frequency.exponentialRampToValueAtTime(options.sweepTo, start + options.duration) + } + + const level = options.gain ?? 0.14 + amp.gain.setValueAtTime(0.0001, start) + amp.gain.exponentialRampToValueAtTime(level, start + 0.012) + amp.gain.exponentialRampToValueAtTime(0.0001, start + options.duration) + + oscillator.connect(amp) + amp.connect(context.destination) + oscillator.start(start) + oscillator.stop(start + options.duration + 0.03) +} + +export const sfx = { + /** Открылась клетка. */ + open(): void { + tone({ frequency: 520, sweepTo: 880, duration: 0.12, type: 'triangle', gain: 0.1 }) + }, + /** Кто-то нажал кнопку. */ + buzz(): void { + tone({ frequency: 190, sweepTo: 120, duration: 0.16, type: 'square', gain: 0.12 }) + }, + /** Ответ верный. */ + correct(): void { + tone({ frequency: 660, duration: 0.16, type: 'sine', gain: 0.16 }) + tone({ frequency: 990, duration: 0.24, type: 'sine', gain: 0.14, delay: 0.12 }) + }, + /** Ответ неверный или время вышло. */ + wrong(): void { + tone({ frequency: 240, sweepTo: 110, duration: 0.38, type: 'sawtooth', gain: 0.1 }) + }, + /** Последние секунды. */ + tick(): void { + tone({ frequency: 1200, duration: 0.045, type: 'sine', gain: 0.05 }) + }, + /** Раунд или партия закончились. */ + end(): void { + for (const [index, frequency] of [523, 659, 784].entries()) { + tone({ frequency, duration: 0.5, type: 'sine', gain: 0.1, delay: index * 0.09 }) + } + }, +} diff --git a/packages/web/src/components/BoardGrid.vue b/packages/web/src/components/BoardGrid.vue new file mode 100644 index 0000000..095cbe7 --- /dev/null +++ b/packages/web/src/components/BoardGrid.vue @@ -0,0 +1,46 @@ + + + diff --git a/packages/web/src/components/Countdown.vue b/packages/web/src/components/Countdown.vue new file mode 100644 index 0000000..cabf26f --- /dev/null +++ b/packages/web/src/components/Countdown.vue @@ -0,0 +1,19 @@ + + + diff --git a/packages/web/src/components/QuestionMedia.vue b/packages/web/src/components/QuestionMedia.vue new file mode 100644 index 0000000..ee389c8 --- /dev/null +++ b/packages/web/src/components/QuestionMedia.vue @@ -0,0 +1,30 @@ + + + diff --git a/packages/web/src/components/ScoreBar.vue b/packages/web/src/components/ScoreBar.vue new file mode 100644 index 0000000..68ffc53 --- /dev/null +++ b/packages/web/src/components/ScoreBar.vue @@ -0,0 +1,52 @@ + + + diff --git a/packages/web/src/env.d.ts b/packages/web/src/env.d.ts new file mode 100644 index 0000000..8b53f84 --- /dev/null +++ b/packages/web/src/env.d.ts @@ -0,0 +1,7 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + const component: DefineComponent, Record, unknown> + export default component +} diff --git a/packages/web/src/main.ts b/packages/web/src/main.ts new file mode 100644 index 0000000..85048bf --- /dev/null +++ b/packages/web/src/main.ts @@ -0,0 +1,6 @@ +import { createApp } from 'vue' +import App from './App.vue' +import { router } from './router' +import './styles.css' + +createApp(App).use(router).mount('#app') diff --git a/packages/web/src/net/game.ts b/packages/web/src/net/game.ts new file mode 100644 index 0000000..00fea3d --- /dev/null +++ b/packages/web/src/net/game.ts @@ -0,0 +1,130 @@ +/** + * Единственное соединение страницы с сервером. + * + * Модуль-синглтон: на странице всегда одна роль (табло, пульт или телефон), + * поэтому второй сокет был бы лишним. Компоненты читают `state` и вызывают + * `send` — никакой другой логики здесь нет. + */ + +import { ref, shallowRef } from 'vue' +import { io, type Socket } from 'socket.io-client' +import { + EVENTS, + type ClientRole, + type Command, + type GameEvent, + type HelloMessage, + type PublicState, + type ServerError, +} from '@quiz/shared' + +export interface ConnectOptions { + role: ClientRole + room: string + token?: string + name?: string + playerId?: string + playerToken?: string +} + +const state = shallowRef(null) +const hello = shallowRef(null) +const connected = ref(false) +const connecting = ref(false) +const lastError = ref('') +/** Последнее игровое событие: по нему включаются звук и вспышки. */ +const lastEvent = shallowRef<{ value: GameEvent; at: number } | null>(null) + +let socket: Socket | null = null +let lastSeq = -1 +let counter = 0 + +function nextId(): string { + counter += 1 + return `${Date.now().toString(36)}-${counter}` +} + +export function connect(options: ConnectOptions): void { + disconnect() + lastSeq = -1 + lastError.value = '' + connecting.value = true + + const client = io({ + auth: { + room: options.room, + role: options.role, + token: options.token, + name: options.name, + playerId: options.playerId, + playerToken: options.playerToken, + }, + }) + socket = client + + client.on('connect', () => { + connected.value = true + connecting.value = false + }) + client.on('disconnect', () => { + connected.value = false + }) + client.on('connect_error', (error: Error) => { + connecting.value = false + connected.value = false + lastError.value = error.message + }) + client.on(EVENTS.hello, (message: HelloMessage) => { + hello.value = message + // Запоминаем выданный токен: по нему сервер узнает нас после блокировки + // экрана и переподключения. + if (message.playerId && message.playerToken) { + client.auth = { + ...(client.auth as Record), + playerId: message.playerId, + playerToken: message.playerToken, + } + } + }) + client.on(EVENTS.state, (next: PublicState) => { + if (next.seq < lastSeq) return + lastSeq = next.seq + state.value = next + }) + client.on(EVENTS.error, (error: ServerError) => { + lastError.value = error.reason + }) + client.on(EVENTS.event, (value: GameEvent) => { + lastEvent.value = { value, at: Date.now() } + }) +} + +export function disconnect(): void { + socket?.disconnect() + socket = null + connected.value = false + connecting.value = false + state.value = null + hello.value = null +} + +export function send(command: Command): void { + socket?.emit(EVENTS.cmd, { cmdId: nextId(), command }) +} + +export function undo(): void { + socket?.emit(EVENTS.undo, { cmdId: nextId() }) +} + +export const game = { + state, + hello, + connected, + connecting, + lastError, + lastEvent, + connect, + disconnect, + send, + undo, +} diff --git a/packages/web/src/net/room.ts b/packages/web/src/net/room.ts new file mode 100644 index 0000000..13431bb --- /dev/null +++ b/packages/web/src/net/room.ts @@ -0,0 +1,33 @@ +/** Определение комнаты: из ссылки, из сервера или из памяти браузера. */ + +import { normalizeRoomCode } from '@quiz/shared' + +const ROOM_KEY = 'quiz:room' + +export function rememberRoom(code: string): void { + try { + localStorage.setItem(ROOM_KEY, normalizeRoomCode(code)) + } catch { + // Приватный режим — переживём. + } +} + +export async function resolveRoom(fromQuery: unknown): Promise { + if (typeof fromQuery === 'string' && fromQuery.trim()) return normalizeRoomCode(fromQuery) + + try { + const response = await fetch('/api/room') + if (response.ok) { + const data = (await response.json()) as { code?: string } + if (data.code) return normalizeRoomCode(data.code) + } + } catch { + // Сервер может быть ещё не поднят — ниже попробуем сохранённое значение. + } + + try { + return localStorage.getItem(ROOM_KEY) ?? '' + } catch { + return '' + } +} diff --git a/packages/web/src/net/toast.ts b/packages/web/src/net/toast.ts new file mode 100644 index 0000000..2a4d69a --- /dev/null +++ b/packages/web/src/net/toast.ts @@ -0,0 +1,18 @@ +/** Одно всплывающее сообщение на всё приложение. */ + +import { ref } from 'vue' + +const message = ref('') +let timer: ReturnType | undefined + +export function useToast() { + function say(text: string): void { + message.value = text + if (timer) clearTimeout(timer) + timer = setTimeout(() => { + message.value = '' + }, 2800) + } + + return { message, say } +} diff --git a/packages/web/src/router.ts b/packages/web/src/router.ts new file mode 100644 index 0000000..0201abb --- /dev/null +++ b/packages/web/src/router.ts @@ -0,0 +1,16 @@ +import { createRouter, createWebHistory } from 'vue-router' +import BoardView from './views/BoardView.vue' +import HomeView from './views/HomeView.vue' +import HostView from './views/HostView.vue' +import PlayerView from './views/PlayerView.vue' + +export const router = createRouter({ + history: createWebHistory(), + routes: [ + { path: '/', name: 'home', component: HomeView }, + { path: '/board', name: 'board', component: BoardView }, + { path: '/host/:token', name: 'host', component: HostView }, + { path: '/play', name: 'play', component: PlayerView }, + { path: '/:pathMatch(.*)*', redirect: '/' }, + ], +}) diff --git a/packages/web/src/styles.css b/packages/web/src/styles.css new file mode 100644 index 0000000..6401eb7 --- /dev/null +++ b/packages/web/src/styles.css @@ -0,0 +1,876 @@ +/* Оформление рассчитано на проектор: крупный шрифт, высокий контраст, + никакой прокрутки на табло. Размеры привязаны к vmin, а не к пикселям. */ + +:root { + --bg: #080d1f; + --panel: rgba(255, 255, 255, 0.045); + --gold: #e9c46a; + --gold-soft: rgba(233, 196, 106, 0.16); + --text: #f6f2e7; + --muted: #98a2c0; + --ok: #48b98a; + --bad: #e2675f; + --line: rgba(233, 196, 106, 0.22); + --radius: 14px; +} + +*, +*::before, +*::after { + box-sizing: border-box; +} + +html, +body, +#app { + height: 100%; + margin: 0; +} + +body { + font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif; + color: var(--text); + background: + radial-gradient(1100px 700px at 50% -15%, #1d3170 0%, transparent 60%), + radial-gradient(800px 600px at 88% 110%, #3b1f4a 0%, transparent 55%), + var(--bg); + background-attachment: fixed; + -webkit-font-smoothing: antialiased; +} + +button { + font: inherit; + color: inherit; + cursor: pointer; + border: 0; + background: none; +} + +button:disabled { + cursor: default; +} + +input { + font: inherit; + color: var(--text); + background: rgba(0, 0, 0, 0.28); + border: 1px solid var(--line); + border-radius: 10px; + padding: 0.45em 0.7em; +} + +input:focus { + outline: 2px solid rgba(233, 196, 106, 0.45); + outline-offset: 1px; +} + +/* ─── Каркас ─────────────────────────────────────────────────────────── */ + +.shell { + min-height: 100%; + display: flex; + flex-direction: column; + gap: clamp(0.5rem, 1.5vmin, 1rem); + padding: clamp(0.75rem, 2vmin, 1.75rem); +} + +.topbar { + display: flex; + align-items: center; + gap: 0.9rem; + flex-wrap: wrap; +} + +.topbar h1 { + margin: 0; + font-size: clamp(0.9rem, 1.8vmin, 1.3rem); + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--gold); +} + +.pack-title { + color: var(--muted); + font-size: clamp(0.7rem, 1.3vmin, 0.9rem); +} + +.spacer { + flex: 1; +} + +.phase-badge { + font-size: 0.68rem; + letter-spacing: 0.1em; + text-transform: uppercase; + color: var(--muted); + border: 1px solid rgba(255, 255, 255, 0.09); + border-radius: 999px; + padding: 0.3em 0.75em; +} + +.stage { + flex: 1; + display: flex; + flex-direction: column; + min-height: 0; +} + +/* ─── Кнопки ─────────────────────────────────────────────────────────── */ + +.primary { + background: linear-gradient(180deg, #f1d288, #d8aa47); + color: #241a05; + font-weight: 650; + border-radius: 12px; + padding: 0.7em 1.4em; + box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); +} + +.primary:disabled { + opacity: 0.4; + box-shadow: none; +} + +.big { + font-size: clamp(1rem, 1.2vmin + 0.75rem, 1.4rem); + padding: 0.8em 1.9em; +} + +.ghost { + border: 1px solid var(--line); + border-radius: 12px; + padding: 0.6em 1.1em; + color: var(--muted); + transition: color 0.12s, border-color 0.12s; +} + +.ghost:hover { + color: var(--text); + border-color: var(--gold); +} + +.ok { + background: rgba(72, 185, 138, 0.16); + border: 1px solid rgba(72, 185, 138, 0.5); + color: #b9f0d8; + border-radius: 12px; + padding: 0.7em 1.3em; +} + +.bad { + background: rgba(226, 103, 95, 0.14); + border: 1px solid rgba(226, 103, 95, 0.45); + color: #ffc9c4; + border-radius: 12px; + padding: 0.7em 1.3em; +} + +.icon { + width: 2rem; + height: 2rem; + border-radius: 8px; + color: var(--muted); + line-height: 1; +} + +.icon:hover { + color: var(--bad); + background: rgba(226, 103, 95, 0.1); +} + +/* ─── Общие раскладки ────────────────────────────────────────────────── */ + +.center, +.lobby { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: clamp(0.8rem, 2vmin, 1.4rem); + text-align: center; +} + +.kicker { + margin: 0; + text-transform: uppercase; + letter-spacing: 0.18em; + font-size: clamp(0.62rem, 1.2vmin, 0.8rem); + color: var(--muted); +} + +.title { + margin: 0; + font-size: clamp(1.7rem, 5vmin, 3.2rem); +} + +.round-title { + margin: 0; + font-size: clamp(1.5rem, 4.5vmin, 3rem); + color: var(--gold); +} + +.note { + margin: 0; + max-width: 48ch; + color: var(--muted); + font-size: 0.84rem; + line-height: 1.55; +} + +.status { + margin: 0; + text-align: center; + color: var(--muted); + font-size: clamp(0.8rem, 1.5vmin, 1rem); +} + +.status b { + color: var(--text); +} + +/* ─── Лобби ──────────────────────────────────────────────────────────── */ + +.players-editor { + display: flex; + flex-direction: column; + gap: 0.45rem; + width: min(360px, 90vw); +} + +.row { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.row input { + flex: 1; +} + +.player-name { + flex: 1; + text-align: left; +} + +/* ─── Табло ──────────────────────────────────────────────────────────── */ + +.board-stage { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + gap: clamp(0.6rem, 1.5vmin, 1.2rem); + min-height: 0; +} + +.board { + display: grid; + gap: clamp(0.4rem, 1.2vmin, 0.9rem); + flex: 1; + min-height: 0; +} + +.column { + display: flex; + flex-direction: column; + gap: clamp(0.35rem, 1vmin, 0.75rem); + min-width: 0; +} + +.theme { + margin: 0; + padding: 0 clamp(0.2rem, 0.6vmin, 0.4rem) clamp(0.4rem, 1vmin, 0.8rem); + text-align: center; + font-size: clamp(0.7rem, 1.55vmin, 1.35rem); + font-weight: 600; + letter-spacing: 0.05em; + text-transform: uppercase; + color: var(--gold); + border-bottom: 1px solid var(--line); + overflow-wrap: anywhere; +} + +.cell { + flex: 1; + min-height: clamp(58px, 9vmin, 120px); + display: grid; + place-items: center; + border-radius: var(--radius); + background: linear-gradient(180deg, rgba(35, 52, 104, 0.85), rgba(18, 26, 56, 0.9)); + border: 1px solid rgba(120, 145, 220, 0.18); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); + transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s; +} + +.cell:hover:not(.closed) { + transform: translateY(-2px); + border-color: var(--gold); + box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38); +} + +.cell .value { + font-size: clamp(1rem, 3.2vmin, 2.4rem); + font-weight: 700; + color: var(--gold); + font-variant-numeric: tabular-nums; +} + +.cell.closed { + background: rgba(255, 255, 255, 0.025); + border-color: transparent; + box-shadow: none; +} + +.cell.closed .snow { + color: rgba(255, 255, 255, 0.14); + font-size: clamp(0.9rem, 2vmin, 1.5rem); +} + +/* ─── Вопрос ─────────────────────────────────────────────────────────── */ + +.question-stage { + flex: 1; + display: flex; + flex-direction: column; + gap: clamp(0.7rem, 2vmin, 1.4rem); + padding: clamp(0.4rem, 2vmin, 1.6rem); + justify-content: center; +} + +.q-head { + display: flex; + align-items: center; + gap: 0.75rem; + flex-wrap: wrap; +} + +.badge { + font-size: clamp(1.3rem, 3.4vmin, 2.4rem); + font-weight: 800; + color: var(--gold); + font-variant-numeric: tabular-nums; +} + +.tag { + font-size: 0.7rem; + letter-spacing: 0.08em; + text-transform: uppercase; + padding: 0.35em 0.7em; + border-radius: 999px; + border: 1px solid var(--line); + color: var(--gold); +} + +.question-text { + margin: 0; + font-size: clamp(1.2rem, 3.6vmin, 2.9rem); + line-height: 1.25; + font-weight: 550; + max-width: 60ch; +} + +.big-text { + font-size: clamp(1.5rem, 4.6vmin, 3.6rem); +} + +.media img, +.media video { + max-width: min(100%, 900px); + max-height: 42vh; + border-radius: var(--radius); + border: 1px solid rgba(255, 255, 255, 0.1); +} + +.audio { + display: flex; + align-items: center; + gap: 1rem; + flex-wrap: wrap; +} + +.hint { + margin: 0.4rem 0 0; + color: var(--muted); + font-size: 0.85rem; +} + +.warn { + margin: 0.4rem 0 0; + color: #ffc9c4; + font-size: 0.8rem; +} + +.answer-box { + display: flex; + align-items: center; + gap: 1rem; + flex-wrap: wrap; +} + +.answer { + margin: 0; + color: var(--gold); + font-size: clamp(1.3rem, 3.4vmin, 2.6rem); + font-weight: 600; +} + +.actions { + display: flex; + flex-direction: column; + gap: 0.7rem; + align-items: flex-start; +} + +.label { + margin: 0; + color: var(--muted); + font-size: clamp(0.75rem, 1.4vmin, 0.95rem); +} + +.label b { + color: var(--text); +} + +.chips { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; +} + +.chip { + border: 1px solid var(--line); + border-radius: 999px; + padding: 0.55em 1.1em; + font-size: clamp(0.85rem, 1.6vmin, 1.05rem); + transition: border-color 0.12s, background 0.12s; +} + +.chip:hover { + border-color: var(--gold); + background: var(--gold-soft); +} + +/* ─── Ставки ─────────────────────────────────────────────────────────── */ + +.bets { + display: flex; + flex-direction: column; + gap: 0.5rem; + width: min(520px, 92vw); +} + +.bet-row { + display: flex; + align-items: center; + gap: 0.6rem; +} + +.bet-row input { + width: 96px; + flex: none; +} + +.bet-done { + color: var(--ok); + font-variant-numeric: tabular-nums; +} + +/* ─── Таймер ─────────────────────────────────────────────────────────── */ + +.countdown { + display: flex; + align-items: baseline; + gap: 0.3rem; + padding: 0.25em 0.85em; + border-radius: 999px; + border: 1px solid var(--line); + color: var(--gold); + font-variant-numeric: tabular-nums; +} + +.countdown .count { + font-size: clamp(1.1rem, 2.5vmin, 1.9rem); + font-weight: 700; +} + +.countdown .count-label { + font-size: 0.68rem; + color: var(--muted); +} + +.countdown.urgent { + border-color: var(--bad); + color: var(--bad); + animation: pulse 1s ease-in-out infinite; +} + +@keyframes pulse { + 50% { + opacity: 0.55; + } +} + +/* ─── Счёт ───────────────────────────────────────────────────────────── */ + +.score-list { + list-style: none; + padding: 0; + margin: 0; + width: min(520px, 90vw); + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.score-list li { + display: flex; + justify-content: space-between; + padding: 0.7rem 1rem; + border-radius: 12px; + background: var(--panel); + font-size: clamp(0.95rem, 2vmin, 1.35rem); +} + +.score-list li:first-child { + border: 1px solid var(--gold); + background: var(--gold-soft); +} + +.scorebar { + display: flex; + flex-wrap: wrap; + gap: 0.6rem; + padding-top: 0.6rem; + border-top: 1px solid rgba(255, 255, 255, 0.06); +} + +.score-chip { + display: flex; + align-items: baseline; + gap: 0.6rem; + padding: 0.45rem 0.9rem; + border-radius: 12px; + background: var(--panel); + border: 1px solid transparent; +} + +.score-chip.picking { + border-color: var(--gold); + background: var(--gold-soft); +} + +.score-chip.answering { + border-color: var(--ok); + background: rgba(72, 185, 138, 0.12); +} + +.score-chip.offline { + opacity: 0.45; +} + +.score-value { + font-weight: 700; + font-variant-numeric: tabular-nums; +} + +/* ─── Финал ──────────────────────────────────────────────────────────── */ + +.judge-grid { + display: flex; + flex-direction: column; + gap: 0.5rem; + width: min(520px, 92vw); +} + +.judge-row { + display: flex; + align-items: center; + gap: 0.5rem; +} + +/* ─── Служебное ──────────────────────────────────────────────────────── */ + +.fatal { + margin: auto; + max-width: 60ch; + padding: 1.5rem; + border: 1px solid var(--bad); + border-radius: var(--radius); + background: rgba(226, 103, 95, 0.08); +} + +.toast { + position: fixed; + left: 50%; + bottom: 1.4rem; + transform: translateX(-50%); + padding: 0.7rem 1.2rem; + border-radius: 999px; + background: #1b2340; + border: 1px solid var(--line); + box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); + font-size: 0.88rem; + max-width: 90vw; +} + +/* ─── Служебные элементы экранов ─────────────────────────────────────── */ + +.room-tag { + font-size: 0.72rem; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--muted); + border: 1px solid rgba(255, 255, 255, 0.09); + border-radius: 999px; + padding: 0.3em 0.7em; +} + +.link-grid { + display: flex; + gap: 0.8rem; + flex-wrap: wrap; + justify-content: center; +} + +/* ─── Лобби на табло: QR и адрес ─────────────────────────────────────── */ + +.lobby-join { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: clamp(0.6rem, 2vmin, 1.2rem); + text-align: center; +} + +.qr { + width: clamp(150px, 24vmin, 300px); + height: auto; + border-radius: 16px; + background: #fff; + padding: 8px; +} + +.join-url { + margin: 0; + font-size: clamp(0.78rem, 1.6vmin, 1.05rem); + color: var(--gold); + word-break: break-all; +} + +.room-big { + margin: 0; + font-size: clamp(1.5rem, 3.6vmin, 2.6rem); + font-weight: 700; + letter-spacing: 0.12em; + color: var(--text); +} + +.chip-list { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + justify-content: center; + max-width: 70ch; +} + +/* ─── Табло: клетки не нажимаются ────────────────────────────────────── */ + +.board.static .cell { + cursor: default; +} + +.board.static .cell:hover:not(.closed) { + transform: none; + border-color: rgba(120, 145, 220, 0.18); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); +} + +/* ─── Телефон игрока ─────────────────────────────────────────────────── */ + +.player-shell { + padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); +} + +.player-stage { + flex: 1; + display: flex; + flex-direction: column; + gap: 0.9rem; +} + +.player-head { + display: flex; + align-items: baseline; + gap: 0.5rem; + justify-content: center; +} + +.player-score { + font-size: clamp(2rem, 8vmin, 3.2rem); + font-weight: 800; + color: var(--gold); + font-variant-numeric: tabular-nums; +} + +.player-block { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 0.9rem; + text-align: center; +} + +.player-question { + margin: 0; + text-align: center; + color: var(--muted); + font-size: 0.92rem; + line-height: 1.45; +} + +.name-input, +.bet-input { + width: min(280px, 80vw); + text-align: center; + font-size: 1.1rem; + padding: 0.7em 1em; +} + +.buzz { + width: min(66vmin, 300px); + aspect-ratio: 1; + border-radius: 50%; + font-size: clamp(1.25rem, 5.5vmin, 1.9rem); + font-weight: 800; + letter-spacing: 0.08em; + color: #241a05; + background: radial-gradient(circle at 35% 30%, #ffe6a3, #e0ab3c 60%, #b98a24); + box-shadow: 0 12px 40px rgba(233, 196, 106, 0.35), inset 0 -6px 14px rgba(0, 0, 0, 0.25); + animation: buzz-pulse 1.6s ease-in-out infinite; +} + +.buzz:active { + transform: scale(0.96); + box-shadow: 0 6px 18px rgba(233, 196, 106, 0.3); +} + +@keyframes buzz-pulse { + 0%, + 100% { + transform: scale(1); + } + 50% { + transform: scale(1.04); + } +} + +/* На телефоне сетка табло должна влезать в ширину экрана. */ +.player-shell .board { + width: 100%; + gap: 0.25rem; +} + +.player-shell .theme { + font-size: 0.6rem; + padding-bottom: 0.3rem; +} + +.player-shell .cell { + min-height: 44px; + border-radius: 10px; +} + +.player-shell .cell .value { + font-size: 0.95rem; +} + +@media (prefers-reduced-motion: reduce) { + .buzz, + .countdown.urgent { + animation: none; + } +} + +/* ─── Обратная связь: вспышки и появление ────────────────────────────── */ + +.shell { + transition: box-shadow 0.25s ease; +} + +.shell.flash-good { + box-shadow: inset 0 0 0 4px rgba(72, 185, 138, 0.55); +} + +.shell.flash-bad { + box-shadow: inset 0 0 0 4px rgba(226, 103, 95, 0.55); +} + +.score-chip { + transition: border-color 0.2s, background 0.2s, transform 0.2s; +} + +.score-chip.flash-up { + border-color: var(--ok); + background: rgba(72, 185, 138, 0.18); + transform: translateY(-2px); +} + +.score-chip.flash-down { + border-color: var(--bad); + background: rgba(226, 103, 95, 0.16); + transform: translateY(-2px); +} + +.question-stage { + animation: stage-in 0.28s ease-out; +} + +@keyframes stage-in { + from { + opacity: 0; + transform: translateY(10px); + } + to { + opacity: 1; + transform: none; + } +} + +.answer { + animation: answer-in 0.35s ease-out; +} + +@keyframes answer-in { + from { + opacity: 0; + transform: scale(0.96); + } + to { + opacity: 1; + transform: none; + } +} + +.sound-toggle { + font-size: 1rem; + line-height: 1; + padding: 0.45em 0.7em; +} + +@media (prefers-reduced-motion: reduce) { + .question-stage, + .answer { + animation: none; + } + + .score-chip.flash-up, + .score-chip.flash-down { + transform: none; + } +} diff --git a/packages/web/src/views/BoardView.vue b/packages/web/src/views/BoardView.vue new file mode 100644 index 0000000..bf5b7b9 --- /dev/null +++ b/packages/web/src/views/BoardView.vue @@ -0,0 +1,259 @@ + + + diff --git a/packages/web/src/views/HomeView.vue b/packages/web/src/views/HomeView.vue new file mode 100644 index 0000000..0b200fa --- /dev/null +++ b/packages/web/src/views/HomeView.vue @@ -0,0 +1,32 @@ + + + diff --git a/packages/web/src/views/HostView.vue b/packages/web/src/views/HostView.vue new file mode 100644 index 0000000..519f1ec --- /dev/null +++ b/packages/web/src/views/HostView.vue @@ -0,0 +1,356 @@ + + + diff --git a/packages/web/src/views/PlayerView.vue b/packages/web/src/views/PlayerView.vue new file mode 100644 index 0000000..ccdc565 --- /dev/null +++ b/packages/web/src/views/PlayerView.vue @@ -0,0 +1,289 @@ + + + diff --git a/packages/web/tsconfig.json b/packages/web/tsconfig.json new file mode 100644 index 0000000..ac9f503 --- /dev/null +++ b/packages/web/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "noEmit": true, + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "types": ["vite/client"], + "jsx": "preserve", + "paths": { + "@quiz/shared": ["../shared/src/index.ts"] + } + }, + "include": ["src/**/*.ts", "src/**/*.vue", "vite.config.ts"] +} diff --git a/packages/web/vite.config.ts b/packages/web/vite.config.ts new file mode 100644 index 0000000..0f01e30 --- /dev/null +++ b/packages/web/vite.config.ts @@ -0,0 +1,30 @@ +import { fileURLToPath, URL } from 'node:url' +import vue from '@vitejs/plugin-vue' +import { defineConfig } from 'vite' + +const repoRoot = fileURLToPath(new URL('../..', import.meta.url)) + +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { + // Ведём на исходники, а не на dist: не нужен отдельный шаг сборки shared. + '@quiz/shared': fileURLToPath(new URL('../shared/src/index.ts', import.meta.url)), + }, + }, + server: { + host: true, + port: 5173, + // Без этого Vite молча уезжает на 5174, а напечатанные сервером адреса + // остаются врать. Лучше упасть с понятной ошибкой, чем показать не тот порт. + strictPort: true, + // Пак лежит в content/ за пределами пакета web — разрешаем читать весь репозиторий. + fs: { allow: [repoRoot] }, + proxy: { + // Один сервер на одном порту; в dev сокеты и API проксируются на него. + '/socket.io': { target: 'http://127.0.0.1:3000', ws: true }, + '/api': { target: 'http://127.0.0.1:3000' }, + '/media': { target: 'http://127.0.0.1:3000' }, + }, + }, +}) diff --git a/scripts/debug-page.mjs b/scripts/debug-page.mjs new file mode 100644 index 0000000..35f2ee3 --- /dev/null +++ b/scripts/debug-page.mjs @@ -0,0 +1,31 @@ +/** + * Диагностика страницы: открывает адрес, печатает ошибки консоли и видимый текст. + * Запуск: node scripts/debug-page.mjs /board + */ + +import puppeteer from 'puppeteer-core' + +const path = process.argv[2] ?? '/' +const base = process.env.QUIZ_URL ?? 'http://127.0.0.1:5173' + +const browser = await puppeteer.launch({ + executablePath: 'C:/Program Files/Google/Chrome/Application/chrome.exe', + headless: 'new', + args: ['--disable-gpu', '--no-first-run'], + defaultViewport: { width: 1280, height: 800 }, +}) + +const page = await browser.newPage() +page.on('console', (message) => console.log(`[${message.type()}] ${message.text()}`)) +page.on('pageerror', (error) => console.log(`[pageerror] ${error.message}`)) +page.on('requestfailed', (request) => + console.log(`[requestfailed] ${request.url()} ${request.failure()?.errorText}`), +) + +await page.goto(`${base}${path}`, { waitUntil: 'networkidle0' }) +await new Promise((resolve) => setTimeout(resolve, 1500)) + +console.log('--- видимый текст ---') +console.log(await page.evaluate(() => document.body.innerText.slice(0, 800))) + +await browser.close() diff --git a/scripts/make-audio.mjs b/scripts/make-audio.mjs new file mode 100644 index 0000000..6505752 --- /dev/null +++ b/scripts/make-audio.mjs @@ -0,0 +1,95 @@ +/** + * Генератор короткой мелодии в WAV. + * + * Нужен, чтобы музыкальный вопрос работал «из коробки»: в репозитории лежит + * файл, а не ссылка на файл, которого нет. Замените его своей записью — + * формат и имя значения не имеют, важна строка media.src в паке. + * + * Запуск: node scripts/make-audio.mjs + */ + +import { writeFileSync, mkdirSync } from 'node:fs' +import { fileURLToPath } from 'node:url' + +const SAMPLE_RATE = 22050 +const OUT = fileURLToPath(new URL('../content/media/demo/jingle-bells.wav', import.meta.url)) + +const NOTES = { + C4: 261.63, + D4: 293.66, + E4: 329.63, + F4: 349.23, + G4: 392.0, + A4: 440.0, + B4: 493.88, + C5: 523.25, +} + +const BEAT = 0.28 + +/** «Jingle Bells» — мелодия в общественном достоянии, первые две фразы. */ +const MELODY = [ + ['E4', 1], ['E4', 1], ['E4', 2], + ['E4', 1], ['E4', 1], ['E4', 2], + ['E4', 1], ['G4', 1], ['C4', 1], ['D4', 1], ['E4', 4], + ['F4', 1], ['F4', 1], ['F4', 1], ['F4', 1], + ['F4', 1], ['E4', 1], ['E4', 1], ['E4', 0.5], ['E4', 0.5], + ['E4', 1], ['D4', 1], ['D4', 1], ['E4', 1], ['D4', 2], ['G4', 2], +] + +const samples = [] + +for (const [note, beats] of MELODY) { + const frequency = NOTES[note] + const duration = beats * BEAT + const total = Math.floor(duration * SAMPLE_RATE) + const attack = Math.floor(0.01 * SAMPLE_RATE) + const release = Math.floor(0.06 * SAMPLE_RATE) + + for (let index = 0; index < total; index += 1) { + // Простая огибающая: без неё на стыках нот слышны щелчки. + let envelope = 1 + if (index < attack) envelope = index / attack + else if (index > total - release) envelope = Math.max(0, (total - index) / release) + + const time = index / SAMPLE_RATE + const wave = + Math.sin(2 * Math.PI * frequency * time) * 0.6 + + Math.sin(2 * Math.PI * frequency * 2 * time) * 0.25 + + Math.sin(2 * Math.PI * frequency * 3 * time) * 0.1 + + samples.push(wave * envelope * 0.35) + } + + // Короткая пауза между нотами. + const gap = Math.floor(0.01 * SAMPLE_RATE) + for (let index = 0; index < gap; index += 1) samples.push(0) +} + +const dataBytes = samples.length * 2 +const buffer = Buffer.alloc(44 + dataBytes) + +buffer.write('RIFF', 0) +buffer.writeUInt32LE(36 + dataBytes, 4) +buffer.write('WAVE', 8) +buffer.write('fmt ', 12) +buffer.writeUInt32LE(16, 16) +buffer.writeUInt16LE(1, 20) // PCM +buffer.writeUInt16LE(1, 22) // моно +buffer.writeUInt32LE(SAMPLE_RATE, 24) +buffer.writeUInt32LE(SAMPLE_RATE * 2, 28) +buffer.writeUInt16LE(2, 32) +buffer.writeUInt16LE(16, 34) +buffer.write('data', 36) +buffer.writeUInt32LE(dataBytes, 40) + +samples.forEach((sample, index) => { + const clamped = Math.max(-1, Math.min(1, sample)) + buffer.writeInt16LE(Math.round(clamped * 32767), 44 + index * 2) +}) + +mkdirSync(fileURLToPath(new URL('../content/media/demo/', import.meta.url)), { recursive: true }) +writeFileSync(OUT, buffer) + +const seconds = (samples.length / SAMPLE_RATE).toFixed(1) +console.log(`готово: ${OUT} (${seconds} с, ${Math.round(buffer.length / 1024)} КБ)`) diff --git a/scripts/smoke.mjs b/scripts/smoke.mjs new file mode 100644 index 0000000..960604d --- /dev/null +++ b/scripts/smoke.mjs @@ -0,0 +1,170 @@ +/** + * Дымовой прогон игры на трёх экранах. + * + * Открывает в одном браузере три вкладки — табло, телефон игрока и пульт — + * и проходит партию до первого набранного очка. Это проверка не вёрстки, + * а связки: сокеты, роли, изоляция ответа и подсчёт. + * + * Требует запущенного `npm run dev` и фиксированных комнаты и токена: + * QUIZ_ROOM=TEST QUIZ_HOST_TOKEN=smoke-token npm run dev + * + * Запуск: node scripts/smoke.mjs + */ + +import { mkdirSync } from 'node:fs' +import { fileURLToPath } from 'node:url' +import puppeteer from 'puppeteer-core' + +const BASE = process.env.QUIZ_URL ?? 'http://127.0.0.1:5173' +const ROOM = process.env.QUIZ_ROOM ?? 'TEST' +const TOKEN = process.env.QUIZ_HOST_TOKEN ?? 'smoke-token' +const OUT = fileURLToPath(new URL('../.screenshots/', import.meta.url)) +const CHROME = + process.env.CHROME_PATH ?? 'C:/Program Files/Google/Chrome/Application/chrome.exe' + +mkdirSync(OUT, { recursive: true }) + +const browser = await puppeteer.launch({ + executablePath: CHROME, + headless: 'new', + args: ['--disable-gpu', '--no-first-run', '--no-default-browser-check'], + defaultViewport: { width: 1440, height: 900 }, + protocolTimeout: 60_000, +}) + +const problems = [] + +function watch(page, label) { + page.on('pageerror', (error) => problems.push(`${label}: ${error.message}`)) + page.on('console', (message) => { + if (message.type() === 'error') problems.push(`${label}: ${message.text()}`) + }) + return page +} + +async function shot(page, name) { + await page.screenshot({ path: `${OUT}${name}.png` }) + console.log(` снимок: ${name}.png`) +} + +async function newPage(path, label, viewport) { + const page = watch(await browser.newPage(), label) + await page.setViewport(viewport ?? { width: 1440, height: 900 }) + await page.goto(`${BASE}${path}`, { waitUntil: 'networkidle0' }) + return page +} + +// Chrome «замораживает» фоновые вкладки, и вызовы к ним по CDP повисают. +// Поэтому перед работой с экраном его нужно вывести вперёд. +async function focus(page) { + await page.bringToFront() +} + +const phone = { width: 390, height: 844, isMobile: true, hasTouch: true } + +try { + console.log('1. пульт: чистое лобби') + const host = await newPage(`/host/${TOKEN}`, 'пульт') + await focus(host) + host.on('dialog', (dialog) => dialog.accept()) + await host.waitForSelector('.topbar', { timeout: 15000 }) + + // Сервер держит партию в памяти: если прошлый прогон не дошёл до конца, + // обнуляем её, иначе табло откроется не в лобби. + const reset = await host.evaluate(() => { + const button = Array.from(document.querySelectorAll('button')).find((node) => + node.textContent?.includes('Заново'), + ) + if (!button) return false + button.click() + return true + }) + if (reset) { + console.log(' сброс прошлой партии') + await host.waitForSelector('.primary.big', { timeout: 15000 }) + } + + console.log('2. табло: лобби с QR') + const board = await newPage('/board', 'табло') + await focus(board) + await board.waitForSelector('.qr', { timeout: 15000 }) + await shot(board, '10-board-lobby') + + console.log('3. телефон: вход по коду комнаты') + const player = await newPage(`/play?room=${ROOM}`, 'телефон', phone) + await focus(player) + await player.waitForSelector('.name-input', { timeout: 15000 }) + await player.type('.name-input', 'Аня') + await player.click('button.primary.big') + await player.waitForSelector('.player-stage', { timeout: 15000 }) + await shot(player, '11-player-lobby') + + console.log('4. пульт видит игрока') + await focus(host) + await host.waitForSelector('.chip', { timeout: 15000 }) + + console.log('5. старт игры') + await focus(host) + await host.click('button.primary.big') + await host.waitForSelector('.round-title') + await host.click('button.primary.big') + await host.waitForSelector('.board') + await focus(board) + await board.waitForSelector('.board') + await shot(host, '12-host-board') + + console.log('6. вопрос') + await focus(host) + await host.click('.cell:not(.closed)') + await host.waitForSelector('.question-text') + await focus(board) + await board.waitForSelector('.question-text') + + // Главная проверка изоляции: на табло ответа быть не должно. + const leak = await board.$('.answer') + if (leak) throw new Error('табло получило правильный ответ до вскрытия') + await shot(board, '13-board-question') + + console.log('7. игрок нажимает') + await focus(player) + await player.waitForSelector('.buzz', { timeout: 15000 }) + await shot(player, '14-player-buzz') + await player.click('.buzz') + await focus(host) + await host.waitForSelector('.actions .ok', { timeout: 15000 }) + await focus(player) + await player.waitForSelector('.player-block') + + console.log('8. ведущий судит: верно') + await focus(host) + await host.click('.actions .ok') + await host.waitForSelector('.answer') + await focus(board) + await board.waitForSelector('.answer', { timeout: 15000 }) + await shot(board, '15-board-reveal') + + await focus(host) + const scores = await host.$$eval('.score-chip', (nodes) => + nodes.map((node) => node.textContent?.replace(/\s+/g, ' ').trim()), + ) + console.log(` счёт: ${scores.join(' | ')}`) + if (!scores.some((text) => /100/.test(text ?? ''))) { + throw new Error('очки не начислились') + } + + await focus(player) + const playerScore = await player.$eval('.player-score', (node) => node.textContent?.trim()) + console.log(` очки на телефоне: ${playerScore}`) + if (playerScore !== '100') throw new Error(`на телефоне ${playerScore}, ожидалось 100`) + await shot(player, '16-player-reveal') + + if (problems.length > 0) { + console.error('\nОшибки в консоли браузера:') + for (const problem of problems) console.error(` - ${problem}`) + process.exitCode = 1 + } else { + console.log('\nOK: три экрана синхронизированы, ответ не утёк на табло') + } +} finally { + await browser.close() +} diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..9768cda --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2022", + "lib": ["ES2022"], + "module": "ESNext", + "moduleResolution": "bundler", + "strict": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": false, + "noImplicitOverride": true, + "noFallthroughCasesInSwitch": true, + "isolatedModules": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "types": [] + } +}