Compare commits
9 Commits
labWork3-
...
branch-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a19ddbffb | |||
| 8f9394c01d | |||
| 600eb67f5a | |||
| f4a1992f8d | |||
| ebe36b8d49 | |||
| 55c427a847 | |||
| 60f316d27a | |||
| e2a32ad09d | |||
| 66e2e28e05 |
18
MyWebSite/.vscode/launch.json
vendored
@@ -1,18 +1,14 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"type": "chrome",
|
||||
"name": "Debug",
|
||||
"type": "java",
|
||||
"name": "Spring Boot-ServerApplication<server>",
|
||||
"request": "launch",
|
||||
"url": "http://localhost:5173"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"name": "Start",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": ["run-script", "start"],
|
||||
"console": "integratedTerminal"
|
||||
"cwd": "${workspaceFolder}",
|
||||
"mainClass": "com.example.server.ServerApplication",
|
||||
"projectName": "server",
|
||||
"args": "",
|
||||
"envFile": "${workspaceFolder}/.env"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
6
MyWebSite/.vscode/settings.json
vendored
@@ -35,5 +35,9 @@
|
||||
},
|
||||
"[html]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
},
|
||||
"java.configuration.updateBuildConfiguration": "interactive",
|
||||
"java.compile.nullAnalysis.mode": "automatic",
|
||||
"java.import.gradle.buildServer.enabled": false,
|
||||
"java.import.gradle.enabled": true
|
||||
}
|
||||
|
||||
24
MyWebSite/App.jsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
import 'bootstrap/dist/js/bootstrap.bundle.min';
|
||||
import BasketPage from './pages/BasketPage';
|
||||
import { Route, BrowserRouter as Router, Routes } from 'react-router-dom';
|
||||
import CatalogPage from './pages/CatalogPage';
|
||||
import DiscountsPage from './pages/DiscountsPage';
|
||||
import HomePage from './pages/HomePage';
|
||||
import ContactUsPage from './pages/ContactUsPage';
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<Router>
|
||||
<Routes>
|
||||
<Route path="/" element={<HomePage />} />
|
||||
<Route path="/catalog" element={<CatalogPage />} />
|
||||
<Route path="/discounts" element={<DiscountsPage />} />
|
||||
<Route path="/basket" element={<BasketPage />} />
|
||||
<Route path="/contact" element={<ContactUsPage />} />
|
||||
</Routes>
|
||||
</Router>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
@@ -1,164 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Корзина | Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="logo.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-10">
|
||||
<h2 class="text-center mb-4">Ваша корзина</h2>
|
||||
|
||||
<!-- Список товаров -->
|
||||
<div class="card mb-4">
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<img src="images/dune.jpg" alt="Дюна" class="img-fluid rounded" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h5>Дюна</h5>
|
||||
<p class="text-muted">Фрэнк Герберт</p>
|
||||
<p>
|
||||
Эпическая история о борьбе за контроль над планетой Арракис, источником самого
|
||||
ценного вещества во вселенной.
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<p class="h5">500 руб.</p>
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<button class="btn btn-outline-danger"><i class="bi bi-trash"></i> Удалить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<img src="images/the_hobbit.webp" alt="Хоббит" class="img-fluid rounded" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h5>Хоббит</h5>
|
||||
<p class="text-muted">Дж.Р.Р. Толкин</p>
|
||||
<p>Путешествие Бильбо Бэггинса в мир приключений и драконов.</p>
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<p class="h5">750 руб.</p>
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<button class="btn btn-outline-danger"><i class="bi bi-trash"></i> Удалить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Итоговая информация -->
|
||||
<div class="card mb-4 border-danger">
|
||||
<div class="card-body">
|
||||
<div class="alert alert-warning mb-3">
|
||||
<i class="bi bi-exclamation-triangle-fill me-2"></i>
|
||||
Условия скидки не применены. Добавьте еще одну книгу для скидки 25%!
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h4 class="mb-0">Общая стоимость:</h4>
|
||||
<h4 class="mb-0">1250 руб.</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Кнопки действий -->
|
||||
<div class="d-flex justify-content-between mb-5">
|
||||
<a href="catalog.html" class="btn btn-outline-primary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Продолжить покупки
|
||||
</a>
|
||||
<button class="btn btn-success btn-lg px-4">
|
||||
<i class="bi bi-credit-card me-2"></i>Оформить заказ
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Контакты</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
200
MyWebSite/basket1.html
Normal file
@@ -0,0 +1,200 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Корзина | Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="logo.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link position-relative show-cart-btn" href="#">
|
||||
<i class="bi bi-cart3"></i>
|
||||
<span
|
||||
class="cart-count badge bg-danger rounded-pill position-absolute top-0 start-100 translate-middle"
|
||||
style="display: none"
|
||||
></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-10">
|
||||
<h2 class="text-center mb-4">Ваша корзина</h2>
|
||||
|
||||
<!-- Список товаров -->
|
||||
<div id="cartItemsContainer">
|
||||
<!-- Товары будут загружены через JavaScript -->
|
||||
</div>
|
||||
|
||||
<!-- Итоговая информация -->
|
||||
<div class="card mb-4 border-danger">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h4 class="mb-0">Общая стоимость:</h4>
|
||||
<h4 class="mb-0" id="cartTotal">0 руб.</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Кнопки действий -->
|
||||
<div class="d-flex justify-content-between mb-5">
|
||||
<a href="catalog.html" class="btn btn-outline-primary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Продолжить покупки
|
||||
</a>
|
||||
<div>
|
||||
<button id="clearCartBtn" class="btn btn-outline-danger me-2">
|
||||
<i class="bi bi-trash me-2"></i>Очистить корзину
|
||||
</button>
|
||||
<button id="checkoutBtn" class="btn btn-success btn-lg px-4">
|
||||
<i class="bi bi-credit-card me-2"></i>Оформить заказ
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Контакты</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Наш компонент -->
|
||||
<script src="bookComponent.js"></script>
|
||||
|
||||
<script>
|
||||
// Инициализация корзины на странице basket.html
|
||||
document.addEventListener("DOMContentLoaded", async () => {
|
||||
const model = new BookModel();
|
||||
const view = new BookView();
|
||||
const controller = new BookController(model, view);
|
||||
|
||||
// Загружаем и отображаем корзину при загрузке страницы
|
||||
const cartItems = await model.fetchCartItems();
|
||||
view.renderCart(cartItems);
|
||||
|
||||
// Обновляем счетчик в навигации
|
||||
await controller.updateCartCount();
|
||||
|
||||
// Обработчики для кнопок на странице корзины
|
||||
document.getElementById("clearCartBtn").addEventListener("click", async () => {
|
||||
if (confirm("Вы уверены, что хотите очистить корзину?")) {
|
||||
await model.clearCart();
|
||||
view.renderCart([]);
|
||||
await controller.updateCartCount();
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById("checkoutBtn").addEventListener("click", () => {
|
||||
alert("Заказ оформлен! Спасибо за покупку!");
|
||||
model.clearCart();
|
||||
view.renderCart([]);
|
||||
controller.updateCartCount();
|
||||
});
|
||||
|
||||
// Обработчик изменения количества товаров
|
||||
document.addEventListener("change", async (event) => {
|
||||
if (event.target.classList.contains("cart-item-quantity")) {
|
||||
const id = parseInt(event.target.dataset.id);
|
||||
const quantity = parseInt(event.target.value);
|
||||
|
||||
if (quantity > 0) {
|
||||
await model.updateCartItem(id, { quantity });
|
||||
const cartItems = await model.fetchCartItems();
|
||||
view.renderCart(cartItems);
|
||||
await controller.updateCartCount();
|
||||
} else {
|
||||
event.target.value = 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Обработчик удаления товаров
|
||||
document.addEventListener("click", async (event) => {
|
||||
if (
|
||||
event.target.classList.contains("remove-from-cart") ||
|
||||
event.target.closest(".remove-from-cart")
|
||||
) {
|
||||
const id = parseInt(
|
||||
event.target.dataset.id || event.target.closest(".remove-from-cart").dataset.id
|
||||
);
|
||||
await model.removeFromCart(id);
|
||||
const cartItems = await model.fetchCartItems();
|
||||
view.renderCart(cartItems);
|
||||
await controller.updateCartCount();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
794
MyWebSite/bookComponent.js
Normal file
@@ -0,0 +1,794 @@
|
||||
import React from "react";
|
||||
|
||||
// Модель
|
||||
class BookModel {
|
||||
constructor() {
|
||||
this.API_URL = "http://localhost:3001";
|
||||
}
|
||||
|
||||
async fetchGenres() {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/genres`);
|
||||
if (!response.ok) throw new Error("Ошибка загрузки жанров");
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("fetchGenres error:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
async createGenre(genreData) {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/genres`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(genreData),
|
||||
});
|
||||
if (!response.ok) throw new Error("Ошибка создания жанра");
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("createGenre error:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
async fetchBooksByGenre(genreId) {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/books?genreId=${genreId}`);
|
||||
if (!response.ok) throw new Error("Ошибка загрузки книг");
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("fetchBooksByGenre error:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
async fetchBook(id) {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/books/${id}`);
|
||||
if (!response.ok) throw new Error("Ошибка загрузки книги");
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("fetchBook error:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async createBook(bookData) {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/books`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(bookData),
|
||||
});
|
||||
if (!response.ok) throw new Error("Ошибка создания книги");
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("createBook error:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async updateBook(id, bookData) {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/books/${id}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(bookData),
|
||||
});
|
||||
if (!response.ok) throw new Error("Ошибка обновления книги");
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("updateBook error:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async deleteBook(id) {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/books/${id}`, {
|
||||
method: "DELETE",
|
||||
});
|
||||
if (!response.ok) throw new Error("Ошибка удаления книги");
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("deleteBook error:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async fetchCartItems() {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/cart?_expand=book`);
|
||||
if (!response.ok) throw new Error("Ошибка загрузки корзины");
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("fetchCartItems error:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
async addToCart(bookId) {
|
||||
try {
|
||||
const existingItem = await this.getCartItemByBookId(bookId);
|
||||
|
||||
if (existingItem) {
|
||||
return await this.updateCartItem(existingItem.id, { quantity: existingItem.quantity + 1 });
|
||||
} else {
|
||||
const response = await fetch(`${this.API_URL}/cart`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ bookId, quantity: 1 }),
|
||||
});
|
||||
if (!response.ok) throw new Error("Ошибка добавления в корзину");
|
||||
return await response.json();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("addToCart error:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async getCartItemByBookId(bookId) {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/cart?bookId=${bookId}`);
|
||||
if (!response.ok) throw new Error("Ошибка проверки корзины");
|
||||
const items = await response.json();
|
||||
return items[0] || null;
|
||||
} catch (error) {
|
||||
console.error("getCartItemByBookId error:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async updateCartItem(id, data) {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/cart/${id}`, {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
if (!response.ok) throw new Error("Ошибка обновления корзины");
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("updateCartItem error:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async removeFromCart(id) {
|
||||
try {
|
||||
const response = await fetch(`${this.API_URL}/cart/${id}`, {
|
||||
method: "DELETE",
|
||||
});
|
||||
if (!response.ok) throw new Error("Ошибка удаления из корзины");
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("removeFromCart error:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async clearCart() {
|
||||
try {
|
||||
const items = await this.fetchCartItems();
|
||||
await Promise.all(items.map((item) => this.removeFromCart(item.id)));
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error("clearCart error:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Представление
|
||||
class BookView {
|
||||
constructor() {
|
||||
this.bookModal = document.getElementById("bookModal")
|
||||
? new bootstrap.Modal(document.getElementById("bookModal"))
|
||||
: null;
|
||||
this.bookModalTitle = document.getElementById("bookModalLabel");
|
||||
this.bookForm = document.getElementById("bookForm");
|
||||
this.genreSelect = document.getElementById("bookGenre");
|
||||
this.genreModal = document.getElementById("genreModal")
|
||||
? new bootstrap.Modal(document.getElementById("genreModal"))
|
||||
: null;
|
||||
this.genreModalTitle = document.getElementById("genreModalLabel");
|
||||
this.genreForm = document.getElementById("genreForm");
|
||||
this.cartModal = document.getElementById("cartModal")
|
||||
? new bootstrap.Modal(document.getElementById("cartModal"))
|
||||
: null;
|
||||
|
||||
// Ищем контейнеры корзины на разных страницах
|
||||
this.cartItemsContainer = document.getElementById("cartItemsContainer") || document.getElementById("cartItems");
|
||||
this.cartTotal = document.getElementById("cartTotal") || document.querySelector("#cartModal #cartTotal");
|
||||
// Инициализация refs для модальных окон
|
||||
this.modalRefs = {
|
||||
bookModal: React.createRef(),
|
||||
genreModal: React.createRef(),
|
||||
cartModal: React.createRef(),
|
||||
};
|
||||
}
|
||||
|
||||
renderBooks(books, genreName) {
|
||||
const container = document.getElementById("books-container");
|
||||
if (!container) return;
|
||||
container = document.getElementById(`${genreName.toLowerCase()}-books`);
|
||||
if (!container) {
|
||||
console.warn(`Контейнер для жанра ${genreName} не найден`);
|
||||
return;
|
||||
}
|
||||
|
||||
container.innerHTML = "";
|
||||
|
||||
if (!books || books.length === 0) {
|
||||
container.innerHTML = '<div class="col-12 text-muted">Книги не найдены</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
books.forEach((book) => {
|
||||
const bookCard = this.createBookCard(book);
|
||||
container.appendChild(bookCard);
|
||||
});
|
||||
}
|
||||
|
||||
renderGenresSections(genres) {
|
||||
const main = document.querySelector("main");
|
||||
if (!main) return;
|
||||
|
||||
// Удаляем старые секции жанров
|
||||
document.querySelectorAll(".genre-section").forEach((section) => section.remove());
|
||||
|
||||
// Создаём новые секции для каждого жанра
|
||||
genres.forEach((genre) => {
|
||||
const section = document.createElement("section");
|
||||
section.className = "mb-5 genre-section";
|
||||
section.innerHTML = `
|
||||
<div class="genre-title bg-light p-3 rounded text-center mb-4">
|
||||
<h3>${genre.name}</h3>
|
||||
</div>
|
||||
<div class="row g-4" id="${genre.name.toLowerCase()}-books"></div>
|
||||
`;
|
||||
main.insertBefore(section, main.querySelector("footer"));
|
||||
});
|
||||
}
|
||||
|
||||
createBookCard(book) {
|
||||
const col = document.createElement("div");
|
||||
col.className = "col-md-6 mb-4";
|
||||
|
||||
col.innerHTML = `
|
||||
<div class="card h-100 border-0 shadow-sm" data-id="${book.id}">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img src="${book.image || "images/default-book.jpg"}"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="${book.title || "Без названия"}"
|
||||
style="object-fit: cover"
|
||||
onerror="this.src='images/default-book.jpg'">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">${book.title || "Без названия"}</h5>
|
||||
<p class="card-text text-muted">${book.author || "Автор не указан"}</p>
|
||||
<p class="card-text">${book.description || "Описание отсутствует"}</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">${book.price || 0} руб.</p>
|
||||
<div>
|
||||
<button class="btn btn-primary me-2 mb-2 add-to-cart">В корзину</button>
|
||||
<button class="btn btn-outline-secondary me-2 mb-2 edit-book">Редактировать</button>
|
||||
<button class="btn btn-outline-danger delete-book">Удалить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
return col;
|
||||
}
|
||||
|
||||
renderGenreSelect(genres) {
|
||||
if (!this.genreSelect) {
|
||||
console.error("Элемент выбора жанра не найден");
|
||||
return;
|
||||
}
|
||||
|
||||
this.genreSelect.innerHTML = (genres || [])
|
||||
.map((genre) => `<option value="${genre.id}">${genre.name}</option>`)
|
||||
.join("");
|
||||
}
|
||||
|
||||
renderCart(cartItems) {
|
||||
if (!this.cartItemsContainer || !this.cartTotal) {
|
||||
console.error("Элементы корзины не найдены");
|
||||
return;
|
||||
}
|
||||
|
||||
this.cartItemsContainer.innerHTML = "";
|
||||
|
||||
let total = 0;
|
||||
|
||||
if (!cartItems || cartItems.length === 0) {
|
||||
this.cartItemsContainer.innerHTML = '<p class="text-muted">Корзина пуста</p>';
|
||||
this.cartTotal.textContent = "0 руб.";
|
||||
return;
|
||||
}
|
||||
|
||||
cartItems.forEach((item) => {
|
||||
if (!item.book) return;
|
||||
|
||||
const book = item.book;
|
||||
const itemTotal = (book.price || 0) * (item.quantity || 1);
|
||||
total += itemTotal;
|
||||
|
||||
const cartItem = document.createElement("div");
|
||||
cartItem.className = "card mb-3";
|
||||
cartItem.innerHTML = `
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<img src="${book.image || "images/default-book.jpg"}"
|
||||
alt="${book.title || "Без названия"}"
|
||||
class="img-fluid rounded"
|
||||
onerror="this.src='images/default-book.jpg'">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h5>${book.title || "Без названия"}</h5>
|
||||
<p class="text-muted">${book.author || "Автор не указан"}</p>
|
||||
<p>Цена: ${book.price || 0} руб. × ${item.quantity || 1} = ${itemTotal} руб.</p>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<input type="number" min="1" value="${item.quantity || 1}"
|
||||
class="form-control cart-item-quantity"
|
||||
data-id="${item.id}">
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<button class="btn btn-outline-danger remove-from-cart" data-id="${item.id}">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
this.cartItemsContainer.appendChild(cartItem);
|
||||
});
|
||||
|
||||
this.cartTotal.textContent = `${total} руб.`;
|
||||
}
|
||||
|
||||
showBookModal(title, bookData = null) {
|
||||
if (!this.bookModal || !this.bookModalTitle || !this.bookForm) {
|
||||
console.error("Элементы модального окна книги не найдены");
|
||||
return;
|
||||
}
|
||||
|
||||
this.bookModalTitle.textContent = title || "Книга";
|
||||
|
||||
if (bookData) {
|
||||
document.getElementById("bookId").value = bookData.id || "";
|
||||
document.getElementById("bookTitle").value = bookData.title || "";
|
||||
document.getElementById("bookAuthor").value = bookData.author || "";
|
||||
document.getElementById("bookPrice").value = bookData.price || "";
|
||||
document.getElementById("bookDescription").value = bookData.description || "";
|
||||
document.getElementById("bookImage").value = (bookData.image || "").replace("images/", "");
|
||||
document.getElementById("bookGenre").value = bookData.genreId || "";
|
||||
} else {
|
||||
this.bookForm.reset();
|
||||
document.getElementById("bookId").value = "";
|
||||
}
|
||||
|
||||
this.bookModal.show();
|
||||
}
|
||||
|
||||
showCartModal() {
|
||||
if (this.cartModal) {
|
||||
this.cartModal.show();
|
||||
} else {
|
||||
console.error("Модальное окно корзины не найдено");
|
||||
}
|
||||
}
|
||||
|
||||
bindAddBook(handler) {
|
||||
document.querySelectorAll(".add-book-btn").forEach((btn) => {
|
||||
btn.addEventListener("click", handler);
|
||||
});
|
||||
}
|
||||
|
||||
bindEditBook(handler) {
|
||||
document.addEventListener("click", (event) => {
|
||||
if (event.target.classList.contains("edit-book")) {
|
||||
const card = event.target.closest(".card");
|
||||
if (card) {
|
||||
const id = parseInt(card.dataset.id);
|
||||
if (!isNaN(id)) handler(id);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bindDeleteBook(handler) {
|
||||
document.addEventListener("click", (event) => {
|
||||
if (event.target.classList.contains("delete-book")) {
|
||||
const card = event.target.closest(".card");
|
||||
if (card) {
|
||||
const id = parseInt(card.dataset.id);
|
||||
if (!isNaN(id) && confirm("Вы уверены, что хотите удалить эту книгу?")) {
|
||||
handler(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bindAddToCart(handler) {
|
||||
document.addEventListener("click", (event) => {
|
||||
if (event.target.classList.contains("add-to-cart")) {
|
||||
const card = event.target.closest(".card");
|
||||
if (card) {
|
||||
const id = parseInt(card.dataset.id);
|
||||
if (!isNaN(id)) handler(id);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bindShowCart(handler) {
|
||||
document.querySelectorAll(".show-cart-btn").forEach((btn) => {
|
||||
btn.addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
handler();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
bindRemoveFromCart(handler) {
|
||||
document.addEventListener("click", (event) => {
|
||||
const removeBtn = event.target.closest(".remove-from-cart");
|
||||
if (removeBtn) {
|
||||
const id = parseInt(removeBtn.dataset.id);
|
||||
if (!isNaN(id)) handler(id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bindUpdateCartItem(handler) {
|
||||
document.addEventListener("change", (event) => {
|
||||
if (event.target.classList.contains("cart-item-quantity")) {
|
||||
const id = parseInt(event.target.dataset.id);
|
||||
const quantity = parseInt(event.target.value);
|
||||
if (!isNaN(id) && !isNaN(quantity) && quantity > 0) {
|
||||
handler(id, quantity);
|
||||
} else {
|
||||
event.target.value = 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bindClearCart(handler) {
|
||||
const clearBtn = document.getElementById("clearCartBtn");
|
||||
if (clearBtn) {
|
||||
clearBtn.addEventListener("click", async (e) => {
|
||||
e.preventDefault();
|
||||
if (confirm("Вы уверены, что хотите очистить корзину?")) {
|
||||
await handler();
|
||||
// После очистки обновляем отображение
|
||||
const cartItems = await this.model.fetchCartItems();
|
||||
this.renderCart(cartItems);
|
||||
await this.controller.updateCartCount();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bindCheckout(handler) {
|
||||
const checkoutBtn = document.getElementById("checkoutBtn");
|
||||
if (checkoutBtn) {
|
||||
checkoutBtn.addEventListener("click", handler);
|
||||
}
|
||||
}
|
||||
|
||||
bindSubmitBookForm(handler) {
|
||||
if (this.bookForm) {
|
||||
this.bookForm.addEventListener("submit", (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
const id = document.getElementById("bookId").value;
|
||||
const bookData = {
|
||||
title: document.getElementById("bookTitle").value,
|
||||
author: document.getElementById("bookAuthor").value,
|
||||
price: parseInt(document.getElementById("bookPrice").value) || 0,
|
||||
description: document.getElementById("bookDescription").value,
|
||||
image: document.getElementById("bookImage").value.startsWith("http")
|
||||
? document.getElementById("bookImage").value
|
||||
: `images/${document.getElementById("bookImage").value}`,
|
||||
genreId: parseInt(document.getElementById("bookGenre").value),
|
||||
};
|
||||
|
||||
if (!bookData.title || !bookData.author) {
|
||||
alert("Пожалуйста, заполните обязательные поля");
|
||||
return;
|
||||
}
|
||||
|
||||
handler(id, bookData);
|
||||
});
|
||||
}
|
||||
}
|
||||
// Метод для показа модального окна жанра
|
||||
showGenreModal(title) {
|
||||
if (!this.genreModal || !this.genreModalTitle || !this.genreForm) {
|
||||
console.error("Элементы модального окна жанра не найдены");
|
||||
return;
|
||||
}
|
||||
|
||||
this.genreModalTitle.textContent = title || "Жанр";
|
||||
this.genreForm.reset();
|
||||
this.genreModal.show();
|
||||
}
|
||||
|
||||
// Привязка обработчика добавления жанра
|
||||
bindAddGenre(handler) {
|
||||
document.querySelectorAll(".add-genre-btn").forEach((btn) => {
|
||||
btn.addEventListener("click", handler);
|
||||
});
|
||||
}
|
||||
|
||||
// Привязка обработчика отправки формы жанра
|
||||
bindSubmitGenreForm(handler) {
|
||||
if (this.genreForm) {
|
||||
this.genreForm.addEventListener("submit", (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
const genreData = {
|
||||
name: document.getElementById("genreName").value,
|
||||
};
|
||||
|
||||
if (!genreData.name) {
|
||||
alert("Пожалуйста, укажите название жанра");
|
||||
return;
|
||||
}
|
||||
|
||||
handler(genreData);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Контроллер
|
||||
class BookController {
|
||||
constructor(model, view) {
|
||||
this.model = model;
|
||||
this.view = view;
|
||||
this.view.controller = this;
|
||||
this.init();
|
||||
}
|
||||
|
||||
async init() {
|
||||
try {
|
||||
// Инициализация обработчиков событий
|
||||
this.view.bindAddGenre(() => this.handleAddGenre());
|
||||
this.view.bindSubmitGenreForm((genreData) => this.handleSubmitGenreForm(genreData));
|
||||
this.view.bindAddBook(() => this.handleAddBook());
|
||||
this.view.bindEditBook((id) => this.handleEditBook(id));
|
||||
this.view.bindDeleteBook((id) => this.handleDeleteBook(id));
|
||||
this.view.bindAddToCart((id) => this.handleAddToCart(id));
|
||||
this.view.bindShowCart(() => this.handleShowCart());
|
||||
this.view.bindRemoveFromCart((id) => this.handleRemoveFromCart(id));
|
||||
this.view.bindUpdateCartItem((id, quantity) => this.handleUpdateCartItem(id, quantity));
|
||||
this.view.bindClearCart(() => this.handleClearCart());
|
||||
this.view.bindCheckout(() => this.handleCheckout());
|
||||
this.view.bindSubmitBookForm((id, bookData) => this.handleSubmitBookForm(id, bookData));
|
||||
|
||||
// Загрузка данных только если мы на странице каталога
|
||||
if (document.getElementById("fantasy-books")) {
|
||||
await this.loadData();
|
||||
}
|
||||
|
||||
// Обновляем счетчик корзины всегда
|
||||
await this.updateCartCount();
|
||||
|
||||
// Если мы на странице корзины, загружаем ее содержимое
|
||||
if (document.getElementById("cartItemsContainer")) {
|
||||
const cartItems = await this.model.fetchCartItems();
|
||||
this.view.renderCart(cartItems);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Ошибка инициализации:", error);
|
||||
}
|
||||
}
|
||||
// Новые методы обработчиков:
|
||||
async handleAddGenre() {
|
||||
this.view.showGenreModal("Добавить новый жанр");
|
||||
}
|
||||
|
||||
async handleSubmitGenreForm(genreData) {
|
||||
try {
|
||||
const newGenre = await this.model.createGenre(genreData);
|
||||
const genres = await this.model.fetchGenres();
|
||||
|
||||
// Обновляем интерфейс
|
||||
this.view.renderGenreSelect(genres);
|
||||
this.view.renderGenresSections(genres);
|
||||
|
||||
// Загружаем книги для ВСЕХ жанров после обновления секций
|
||||
for (const genre of genres) {
|
||||
const books = await this.model.fetchBooksByGenre(genre.id);
|
||||
this.view.renderBooks(books, genre.name);
|
||||
}
|
||||
|
||||
if (this.view.genreModal) {
|
||||
this.view.genreModal.hide();
|
||||
}
|
||||
alert("Жанр успешно добавлен!");
|
||||
} catch (error) {
|
||||
console.error("Ошибка сохранения жанра:", error);
|
||||
alert("Не удалось сохранить жанр");
|
||||
}
|
||||
}
|
||||
async loadData() {
|
||||
try {
|
||||
const genres = await this.model.fetchGenres();
|
||||
this.view.renderGenreSelect(genres);
|
||||
this.view.renderGenresSections(genres);
|
||||
|
||||
for (const genre of genres) {
|
||||
const books = await this.model.fetchBooksByGenre(genre.id);
|
||||
this.view.renderBooks(books, genre.name);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Ошибка загрузки данных:", error);
|
||||
}
|
||||
}
|
||||
|
||||
async handleAddBook() {
|
||||
this.view.showBookModal("Добавить новую книгу");
|
||||
}
|
||||
|
||||
async handleEditBook(id) {
|
||||
try {
|
||||
const book = await this.model.fetchBook(id);
|
||||
if (book) {
|
||||
this.view.showBookModal("Редактировать книгу", book);
|
||||
} else {
|
||||
alert("Книга не найдена");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Ошибка редактирования книги:", error);
|
||||
alert("Не удалось загрузить данные книги");
|
||||
}
|
||||
}
|
||||
|
||||
async handleDeleteBook(id) {
|
||||
try {
|
||||
await this.model.deleteBook(id);
|
||||
location.reload();
|
||||
} catch (error) {
|
||||
console.error("Ошибка удаления книги:", error);
|
||||
alert("Не удалось удалить книгу");
|
||||
}
|
||||
}
|
||||
|
||||
async handleAddToCart(bookId) {
|
||||
try {
|
||||
await this.model.addToCart(bookId);
|
||||
await this.updateCartCount();
|
||||
alert("Книга добавлена в корзину");
|
||||
} catch (error) {
|
||||
console.error("Ошибка добавления в корзину:", error);
|
||||
alert("Не удалось добавить книгу в корзину");
|
||||
}
|
||||
}
|
||||
|
||||
async handleShowCart() {
|
||||
try {
|
||||
const cartItems = await this.model.fetchCartItems();
|
||||
this.view.renderCart(cartItems);
|
||||
this.view.showCartModal();
|
||||
} catch (error) {
|
||||
console.error("Ошибка загрузки корзины:", error);
|
||||
alert("Не удалось загрузить корзину");
|
||||
}
|
||||
}
|
||||
|
||||
async handleRemoveFromCart(id) {
|
||||
try {
|
||||
await this.model.removeFromCart(id);
|
||||
const cartItems = await this.model.fetchCartItems();
|
||||
this.view.renderCart(cartItems);
|
||||
await this.updateCartCount();
|
||||
} catch (error) {
|
||||
console.error("Ошибка удаления из корзины:", error);
|
||||
alert("Не удалось удалить товар из корзины");
|
||||
}
|
||||
}
|
||||
|
||||
async handleUpdateCartItem(id, quantity) {
|
||||
try {
|
||||
await this.model.updateCartItem(id, { quantity });
|
||||
const cartItems = await this.model.fetchCartItems();
|
||||
this.view.renderCart(cartItems);
|
||||
await this.updateCartCount();
|
||||
} catch (error) {
|
||||
console.error("Ошибка обновления корзины:", error);
|
||||
alert("Не удалось обновить количество товара");
|
||||
}
|
||||
}
|
||||
|
||||
async handleClearCart() {
|
||||
try {
|
||||
await this.model.clearCart();
|
||||
// Обновляем отображение корзины
|
||||
const cartItems = await this.model.fetchCartItems();
|
||||
this.view.renderCart(cartItems);
|
||||
await this.updateCartCount();
|
||||
|
||||
// Показываем сообщение об успехе
|
||||
alert("Корзина успешно очищена");
|
||||
} catch (error) {
|
||||
console.error("Ошибка очистки корзины:", error);
|
||||
alert("Не удалось очистить корзину");
|
||||
}
|
||||
}
|
||||
|
||||
async handleCheckout() {
|
||||
try {
|
||||
alert("Заказ оформлен! Спасибо за покупку!");
|
||||
await this.model.clearCart();
|
||||
this.view.renderCart([]);
|
||||
await this.updateCartCount();
|
||||
} catch (error) {
|
||||
console.error("Ошибка оформления заказа:", error);
|
||||
alert("Не удалось оформить заказ");
|
||||
}
|
||||
}
|
||||
|
||||
async handleSubmitBookForm(id, bookData) {
|
||||
try {
|
||||
if (id) {
|
||||
await this.model.updateBook(id, bookData);
|
||||
} else {
|
||||
await this.model.createBook(bookData);
|
||||
}
|
||||
|
||||
location.reload();
|
||||
} catch (error) {
|
||||
console.error("Ошибка сохранения книги:", error);
|
||||
alert("Не удалось сохранить книгу");
|
||||
}
|
||||
}
|
||||
|
||||
async updateCartCount() {
|
||||
try {
|
||||
const cartItems = await this.model.fetchCartItems();
|
||||
const totalItems = cartItems.reduce((sum, item) => sum + (item.quantity || 0), 0);
|
||||
|
||||
document.querySelectorAll(".cart-count").forEach((el) => {
|
||||
el.textContent = totalItems;
|
||||
el.style.display = totalItems > 0 ? "inline-block" : "none";
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Ошибка обновления счетчика корзины:", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Инициализация приложения
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
try {
|
||||
const model = new BookModel();
|
||||
const view = new BookView();
|
||||
new BookController(model, view);
|
||||
} catch (error) {
|
||||
console.error("Ошибка инициализации приложения:", error);
|
||||
}
|
||||
});
|
||||
@@ -1,506 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Каталог | Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="logo.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<h2 class="text-center mb-5">Каталог книг</h2>
|
||||
|
||||
<!-- Фантастика -->
|
||||
<section class="mb-5">
|
||||
<div class="genre-title bg-light p-3 rounded text-center mb-4">
|
||||
<h3>Фантастика</h3>
|
||||
</div>
|
||||
<button class="btn btn-success" data-bs-toggle="modal" data-bs-target="#addBookModal">
|
||||
<i class="bi bi-plus-circle"></i> Добавить книгу
|
||||
</button>
|
||||
|
||||
<div class="row g-4" id="fantasy-books">
|
||||
<!-- Существующие книги будут здесь -->
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="images/dune.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Дюна"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Дюна</h5>
|
||||
<p class="card-text text-muted">Фрэнк Герберт</p>
|
||||
<p class="card-text">
|
||||
Эпическая история о борьбе за контроль над планетой Арракис, источником
|
||||
самого ценного вещества во вселенной.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">500 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="images/foundation.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Основание"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Основание</h5>
|
||||
<p class="card-text text-muted">Айзек Азимов</p>
|
||||
<p class="card-text">
|
||||
Сага о падении и возрождении галактической империи, основанная на научных
|
||||
принципах.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">600 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Детектив -->
|
||||
<section class="mb-5">
|
||||
<div class="genre-title bg-light p-3 rounded text-center mb-4">
|
||||
<h3>Детектив</h3>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="images/murder_on_the_orient_express.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Убийство в Восточном экспрессе"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Убийство в Восточном экспрессе</h5>
|
||||
<p class="card-text text-muted">Агата Кристи</p>
|
||||
<p class="card-text">
|
||||
Загадочное убийство на поезде, где каждый пассажир может быть подозреваемым.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">750 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="images/the_girl_with_the_dragon_tattoo.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Девушка с татуировкой дракона"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Девушка с татуировкой дракона</h5>
|
||||
<p class="card-text text-muted">Стиг Ларссон</p>
|
||||
<p class="card-text">
|
||||
История о расследовании исчезновения девушки, связанная с мрачными тайнами
|
||||
семьи.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">700 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Роман -->
|
||||
<section class="mb-5">
|
||||
<div class="genre-title bg-light p-3 rounded text-center mb-4">
|
||||
<h3>Роман</h3>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="images/pride_and_prejudice.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Гордость и предубеждение"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Гордость и предубеждение</h5>
|
||||
<p class="card-text text-muted">Джейн Остин</p>
|
||||
<p class="card-text">
|
||||
Классический роман о любви и социальном статусе в Англии XIX века.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">650 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="images/the_great_gatsby.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Великий Гэтсби"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Великий Гэтсби</h5>
|
||||
<p class="card-text text-muted">Фрэнсис Скотт Фицджеральд</p>
|
||||
<p class="card-text">
|
||||
История о любви, богатстве и утраченных мечтах в эпоху джаза.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">500 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Фэнтези -->
|
||||
<section class="mb-5">
|
||||
<div class="genre-title bg-light p-3 rounded text-center mb-4">
|
||||
<h3>Фэнтези</h3>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="images/harry_potter.webp"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Гарри Поттер"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Гарри Поттер и философский камень</h5>
|
||||
<p class="card-text text-muted">Дж.К. Роулинг</p>
|
||||
<p class="card-text">Приключения молодого волшебника в школе магии Хогвартс.</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">800 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="images/the_hobbit.webp"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Хоббит"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Хоббит</h5>
|
||||
<p class="card-text text-muted">Дж.Р.Р. Толкин</p>
|
||||
<p class="card-text">
|
||||
Путешествие Бильбо Бэггинса в мир приключений и драконов.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">750 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Модальное окно для добавления книги -->
|
||||
<div class="modal fade" id="addBookModal" tabindex="-1" aria-labelledby="addBookModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="addBookModalLabel">Добавить новую книгу</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="addBookForm">
|
||||
<div class="mb-3">
|
||||
<label for="bookTitle" class="form-label">Название книги</label>
|
||||
<input type="text" class="form-control" id="bookTitle" required />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="bookAuthor" class="form-label">Автор</label>
|
||||
<input type="text" class="form-control" id="bookAuthor" minlength="5" required />
|
||||
<div class="invalid-feedback">Имя автора должно содержать не менее 5 символов</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="bookPrice" class="form-label">Цена (руб.)</label>
|
||||
<input type="number" step="10" class="form-control" id="bookPrice" required />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="bookDescription" class="form-label">Описание</label>
|
||||
<textarea class="form-control" id="bookDescription" rows="3" required></textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="bookImage" class="form-label">
|
||||
Путь к изображению (из папки images) или URL
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="bookImage"
|
||||
placeholder="book.jpg или https://example.com/book.jpg"
|
||||
required
|
||||
/>
|
||||
<div class="invalid-feedback">Пожалуйста, укажите путь к изображению</div>
|
||||
<div class="form-text">
|
||||
Можно указать имя файла из папки images (например, "book.jpg") или полный URL
|
||||
изображения
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
|
||||
<button type="button" class="btn btn-primary" id="saveBookBtn">Сохранить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Контакты</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Скрипт для добавления книг -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const saveBookBtn = document.getElementById("saveBookBtn");
|
||||
const addBookForm = document.getElementById("addBookForm");
|
||||
const fantasyBooksContainer = document.getElementById("fantasy-books");
|
||||
const addBookModal = new bootstrap.Modal(document.getElementById("addBookModal"));
|
||||
|
||||
// Получаем элементы для валидации
|
||||
const bookAuthorInput = document.getElementById("bookAuthor");
|
||||
const bookImageInput = document.getElementById("bookImage");
|
||||
|
||||
// Добавляем кастомную валидацию для автора
|
||||
bookAuthorInput.addEventListener("input", function () {
|
||||
if (bookAuthorInput.value.length < 5 && bookAuthorInput.value.length > 0) {
|
||||
bookAuthorInput.setCustomValidity("Имя автора должно содержать не менее 5 символов");
|
||||
} else {
|
||||
bookAuthorInput.setCustomValidity("");
|
||||
}
|
||||
});
|
||||
|
||||
saveBookBtn.addEventListener("click", function () {
|
||||
// Дополнительная проверка длины имени автора
|
||||
if (bookAuthorInput.value.length < 5) {
|
||||
bookAuthorInput.setCustomValidity("Имя автора должно содержать не менее 5 символов");
|
||||
addBookForm.classList.add("was-validated");
|
||||
return;
|
||||
} else {
|
||||
bookAuthorInput.setCustomValidity("");
|
||||
}
|
||||
|
||||
if (addBookForm.checkValidity()) {
|
||||
// Получаем значения из формы
|
||||
const title = document.getElementById("bookTitle").value;
|
||||
const author = document.getElementById("bookAuthor").value;
|
||||
const price = document.getElementById("bookPrice").value;
|
||||
const description = document.getElementById("bookDescription").value;
|
||||
let image = document.getElementById("bookImage").value;
|
||||
|
||||
// Проверяем, является ли введенное значение URL
|
||||
const isUrl = /^https?:\/\//.test(image);
|
||||
|
||||
// Формируем правильный путь к изображению
|
||||
if (!isUrl) {
|
||||
// Если не URL, предполагаем что это имя файла в папке images
|
||||
image = `images/${image}`;
|
||||
}
|
||||
|
||||
// Создаем HTML для новой карточки книги
|
||||
const bookCard = `
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="${image}"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="${title}"
|
||||
style="object-fit: cover"
|
||||
onerror="this.src='images/default-book.jpg'"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">${title}</h5>
|
||||
<p class="card-text text-muted">${author}</p>
|
||||
<p class="card-text">${description}</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">${price} руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Добавляем новую карточку в раздел "Фантастика"
|
||||
fantasyBooksContainer.insertAdjacentHTML("beforeend", bookCard);
|
||||
|
||||
// Закрываем модальное окно и очищаем форму
|
||||
addBookModal.hide();
|
||||
addBookForm.reset();
|
||||
} else {
|
||||
// Показываем сообщения об ошибках валидации
|
||||
addBookForm.classList.add("was-validated");
|
||||
}
|
||||
});
|
||||
|
||||
// Сбрасываем состояние валидации при закрытии модального окна
|
||||
document.getElementById("addBookModal").addEventListener("hidden.bs.modal", function () {
|
||||
addBookForm.classList.remove("was-validated");
|
||||
bookAuthorInput.setCustomValidity(""); // Сбрасываем кастомную валидацию
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
65
MyWebSite/components/BookComponent.jsx
Normal file
@@ -0,0 +1,65 @@
|
||||
import { Button, Card } from 'react-bootstrap';
|
||||
import { BiCart, BiEdit, BiTrash } from 'react-icons/bi';
|
||||
|
||||
const BookComponent = ({ book, onEdit, onDelete, onAddToCart }) => {
|
||||
const displayPrice = book.price === 0 ? "Бесплатно" : `${book.price || 0} руб.`;
|
||||
return (
|
||||
<div className="col-md-6 mb-4">
|
||||
<Card className="h-100 border-0 shadow-sm">
|
||||
<div className="row g-0 h-100">
|
||||
<div className="col-md-4">
|
||||
<Card.Img
|
||||
variant="top"
|
||||
src={book.image || "images/default-book.jpg"}
|
||||
alt={book.title || "Без названия"}
|
||||
className="h-100 rounded-start"
|
||||
style={{ objectFit: 'cover' }}
|
||||
onError={(e) => { e.target.src = 'images/default-book.jpg' }}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-md-8">
|
||||
<Card.Body className="d-flex flex-column h-100">
|
||||
<Card.Title>{book.title || "Без названия"}</Card.Title>
|
||||
<Card.Subtitle className="mb-2 text-muted">
|
||||
{book.author || "Автор не указан"}
|
||||
</Card.Subtitle>
|
||||
<Card.Text className="flex-grow-1">
|
||||
{book.description || "Описание отсутствует"}
|
||||
</Card.Text>
|
||||
<div className="d-flex justify-content-between align-items-center">
|
||||
<Card.Text className="h5 me-2 mb-2">
|
||||
{displayPrice}
|
||||
</Card.Text>
|
||||
<div>
|
||||
<Button
|
||||
variant="primary"
|
||||
className="me-2 mb-2"
|
||||
onClick={() => onAddToCart(book.id)}
|
||||
>
|
||||
<BiCart /> В корзину
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline-secondary"
|
||||
className="me-2 mb-2"
|
||||
onClick={() => onEdit(book.id)}
|
||||
>
|
||||
<BiEdit /> Редактировать
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline-danger"
|
||||
className="mb-2"
|
||||
onClick={() => onDelete(book.id)}
|
||||
>
|
||||
<BiTrash /> Удалить
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Card.Body>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default BookComponent;
|
||||
139
MyWebSite/components/BookModal.jsx
Normal file
@@ -0,0 +1,139 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Modal, Button, Form } from 'react-bootstrap';
|
||||
import api from '../services/api';
|
||||
|
||||
const BookModal = ({ show, onHide, bookId, genres, onSave }) => {
|
||||
const [formData, setFormData] = useState({
|
||||
title: '',
|
||||
author: '',
|
||||
genreId: '',
|
||||
price: '',
|
||||
description: '',
|
||||
image: ''
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (bookId) {
|
||||
api.fetchBook(bookId).then(response => {
|
||||
const book = response.data;
|
||||
setFormData({
|
||||
title: book.title,
|
||||
author: book.author,
|
||||
genreId: book.genreId,
|
||||
price: book.price,
|
||||
description: book.description,
|
||||
image: book.image?.replace('images/', '') || ''
|
||||
});
|
||||
});
|
||||
} else {
|
||||
setFormData({
|
||||
title: '',
|
||||
author: '',
|
||||
genreId: genres[0]?.id || '',
|
||||
price: '',
|
||||
description: '',
|
||||
image: ''
|
||||
});
|
||||
}
|
||||
}, [bookId, genres]);
|
||||
|
||||
const handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
const bookData = {
|
||||
...formData,
|
||||
price: Number(formData.price),
|
||||
genreId: Number(formData.genreId),
|
||||
image: formData.image.startsWith('http')
|
||||
? formData.image
|
||||
: `images/${formData.image}`
|
||||
};
|
||||
onSave(bookData);
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal show={show} onHide={onHide} size="lg">
|
||||
<Modal.Header closeButton>
|
||||
<Modal.Title>{bookId ? 'Редактировать книгу' : 'Добавить книгу'}</Modal.Title>
|
||||
</Modal.Header>
|
||||
<Modal.Body>
|
||||
<Form onSubmit={handleSubmit}>
|
||||
<Form.Group className="mb-3">
|
||||
<Form.Label>Название книги</Form.Label>
|
||||
<Form.Control
|
||||
type="text"
|
||||
value={formData.title}
|
||||
onChange={(e) => setFormData({...formData, title: e.target.value})}
|
||||
required
|
||||
/>
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group className="mb-3">
|
||||
<Form.Label>Автор</Form.Label>
|
||||
<Form.Control
|
||||
type="text"
|
||||
value={formData.author}
|
||||
onChange={(e) => setFormData({...formData, author: e.target.value})}
|
||||
required
|
||||
/>
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group className="mb-3">
|
||||
<Form.Label>Жанр</Form.Label>
|
||||
<Form.Select
|
||||
value={formData.genreId}
|
||||
onChange={(e) => setFormData({...formData, genreId: e.target.value})}
|
||||
required
|
||||
>
|
||||
{genres.map(genre => (
|
||||
<option key={genre.id} value={genre.id}>{genre.name}</option>
|
||||
))}
|
||||
</Form.Select>
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group className="mb-3">
|
||||
<Form.Label>Цена</Form.Label>
|
||||
<Form.Control
|
||||
type="number"
|
||||
value={formData.price}
|
||||
onChange={(e) => setFormData({...formData, price: e.target.value})}
|
||||
required
|
||||
min="0"
|
||||
/>
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group className="mb-3">
|
||||
<Form.Label>Описание</Form.Label>
|
||||
<Form.Control
|
||||
as="textarea"
|
||||
rows={3}
|
||||
value={formData.description}
|
||||
onChange={(e) => setFormData({...formData, description: e.target.value})}
|
||||
required
|
||||
/>
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group className="mb-3">
|
||||
<Form.Label>Изображение</Form.Label>
|
||||
<Form.Control
|
||||
type="text"
|
||||
value={formData.image}
|
||||
onChange={(e) => setFormData({...formData, image: e.target.value})}
|
||||
placeholder="Имя файла (например, book.jpg) или полный URL"
|
||||
required
|
||||
/>
|
||||
<Form.Text className="text-muted">
|
||||
Можно указать имя файла из папки images (например, "book.jpg") или полный URL изображения
|
||||
</Form.Text>
|
||||
</Form.Group>
|
||||
|
||||
<Modal.Footer>
|
||||
<Button variant="secondary" onClick={onHide}>Отмена</Button>
|
||||
<Button variant="primary" type="submit">Сохранить</Button>
|
||||
</Modal.Footer>
|
||||
</Form>
|
||||
</Modal.Body>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default BookModal;
|
||||
124
MyWebSite/components/CartModal.jsx
Normal file
@@ -0,0 +1,124 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Modal, Button, Card, Form } from 'react-bootstrap';
|
||||
import { BiTrash } from 'react-icons/bi';
|
||||
import api from '../services/api';
|
||||
|
||||
const CartModal = ({ show, onHide, onCheckout }) => {
|
||||
const [cartItems, setCartItems] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
if (show) {
|
||||
loadCart();
|
||||
}
|
||||
}, [show]);
|
||||
|
||||
const loadCart = async () => {
|
||||
try {
|
||||
const response = await api.fetchCartItems();
|
||||
const items = response.data;
|
||||
setCartItems(items);
|
||||
|
||||
const newTotal = items.reduce((sum, item) => {
|
||||
return sum + (item.book?.price || 0) * (item.quantity || 1);
|
||||
}, 0);
|
||||
setTotal(newTotal);
|
||||
} catch (error) {
|
||||
console.error('Ошибка загрузки корзины:', error);
|
||||
}
|
||||
};
|
||||
|
||||
const handleQuantityChange = async (id, quantity) => {
|
||||
if (quantity < 1) return;
|
||||
|
||||
try {
|
||||
await api.updateCartItem(id, { quantity });
|
||||
loadCart();
|
||||
} catch (error) {
|
||||
console.error('Ошибка обновления количества:', error);
|
||||
}
|
||||
};
|
||||
|
||||
const handleRemoveItem = async (id) => {
|
||||
try {
|
||||
await api.removeFromCart(id);
|
||||
loadCart();
|
||||
} catch (error) {
|
||||
console.error('Ошибка удаления из корзины:', error);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal show={show} onHide={onHide} size="lg">
|
||||
<Modal.Header closeButton>
|
||||
<Modal.Title>Ваша корзина</Modal.Title>
|
||||
</Modal.Header>
|
||||
<Modal.Body>
|
||||
{cartItems.length === 0 ? (
|
||||
<p className="text-muted">Корзина пуста</p>
|
||||
) : (
|
||||
<>
|
||||
{cartItems.map(item => (
|
||||
<Card key={item.id} className="mb-3">
|
||||
<Card.Body>
|
||||
<div className="row align-items-center">
|
||||
<div className="col-md-2">
|
||||
<img
|
||||
src={item.book?.image || "images/default-book.jpg"}
|
||||
alt={item.book?.title || "Без названия"}
|
||||
className="img-fluid rounded"
|
||||
onError={(e) => { e.target.src = 'images/default-book.jpg' }}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-md-6">
|
||||
<h5>{item.book?.title || "Без названия"}</h5>
|
||||
<p className="text-muted">{item.book?.author || "Автор не указан"}</p>
|
||||
<p>
|
||||
Цена: {item.book?.price || 0} руб. × {item.quantity || 1} =
|
||||
{(item.book?.price || 0) * (item.quantity || 1)} руб.
|
||||
</p>
|
||||
</div>
|
||||
<div className="col-md-2">
|
||||
<Form.Control
|
||||
type="number"
|
||||
min="1"
|
||||
value={item.quantity || 1}
|
||||
onChange={(e) => handleQuantityChange(item.id, parseInt(e.target.value))}
|
||||
className="cart-item-quantity"
|
||||
/>
|
||||
</div>
|
||||
<div className="col-md-2 text-center">
|
||||
<Button
|
||||
variant="outline-danger"
|
||||
onClick={() => handleRemoveItem(item.id)}
|
||||
>
|
||||
<BiTrash />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Card.Body>
|
||||
</Card>
|
||||
))}
|
||||
|
||||
<div className="d-flex justify-content-between align-items-center mt-3">
|
||||
<h4>Итого:</h4>
|
||||
<h4>{total} руб.</h4>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</Modal.Body>
|
||||
<Modal.Footer>
|
||||
<Button variant="secondary" onClick={onHide}>Продолжить покупки</Button>
|
||||
<Button
|
||||
variant="success"
|
||||
onClick={onCheckout}
|
||||
disabled={cartItems.length === 0}
|
||||
>
|
||||
Оформить заказ
|
||||
</Button>
|
||||
</Modal.Footer>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default CartModal;
|
||||
31
MyWebSite/components/Footer.jsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import React from 'react';
|
||||
|
||||
const Footer = () => {
|
||||
return (
|
||||
<footer className="bg-light py-4 mt-5">
|
||||
<div className="container">
|
||||
<div className="row">
|
||||
<div className="col-md-6 mb-4 mb-md-0">
|
||||
<h5 className="mb-3">Контакты</h5>
|
||||
<ul className="list-unstyled">
|
||||
<li><i className="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i className="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i className="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i className="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div className="col-md-6 text-md-end">
|
||||
<h5 className="mb-3">Социальные сети</h5>
|
||||
<div className="social-media">
|
||||
<a href="#" className="text-decoration-none me-3"><i className="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" className="text-decoration-none me-3"><i className="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" className="text-decoration-none"><i className="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
};
|
||||
|
||||
export default Footer;
|
||||
41
MyWebSite/components/GenreModal.jsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Modal, Button, Form } from 'react-bootstrap';
|
||||
|
||||
const GenreModal = ({ show, onHide, onSave }) => {
|
||||
const [genreName, setGenreName] = useState('');
|
||||
|
||||
const handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
if (!genreName.trim()) return;
|
||||
onSave({ name: genreName });
|
||||
setGenreName('');
|
||||
onHide();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal show={show} onHide={onHide}>
|
||||
<Modal.Header closeButton>
|
||||
<Modal.Title>Добавить жанр</Modal.Title>
|
||||
</Modal.Header>
|
||||
<Modal.Body>
|
||||
<Form onSubmit={handleSubmit}>
|
||||
<Form.Group className="mb-3">
|
||||
<Form.Label>Название жанра</Form.Label>
|
||||
<Form.Control
|
||||
type="text"
|
||||
value={genreName}
|
||||
onChange={(e) => setGenreName(e.target.value)}
|
||||
required
|
||||
/>
|
||||
</Form.Group>
|
||||
<Modal.Footer>
|
||||
<Button variant="secondary" onClick={onHide}>Отмена</Button>
|
||||
<Button variant="primary" type="submit">Сохранить</Button>
|
||||
</Modal.Footer>
|
||||
</Form>
|
||||
</Modal.Body>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default GenreModal;
|
||||
70
MyWebSite/components/Navbar.jsx
Normal file
@@ -0,0 +1,70 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
const Navbar = ({ cartCount }) => {
|
||||
return (
|
||||
<nav className="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div className="container">
|
||||
<Link className="navbar-brand d-flex align-items-center" to="/">
|
||||
<img src="/logo.png" alt="Логотип" className="logo me-2" />
|
||||
<span className="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span className="d-lg-none">"Тома"</span>
|
||||
</Link>
|
||||
|
||||
{/* Кнопка для мобильного меню */}
|
||||
<button
|
||||
className="navbar-toggler"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#navbarContent"
|
||||
aria-controls="navbarContent"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation"
|
||||
>
|
||||
<span className="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
{/* Основное меню */}
|
||||
<div className="collapse navbar-collapse" id="navbarContent">
|
||||
<ul className="navbar-nav ms-auto mb-2 mb-lg-0">
|
||||
<li className="nav-item">
|
||||
<Link className="nav-link" to="/">Главная страница</Link>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<Link className="nav-link" to="/catalog">Каталог</Link>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<Link className="nav-link" to="/discounts">Скидки</Link>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<Link className="nav-link" to="/contact">Связаться с нами</Link>
|
||||
</li>
|
||||
<li className="nav-item d-lg-none">
|
||||
<Link className="nav-link position-relative" to="/basket">
|
||||
<i className="bi bi-cart3 me-1"></i> Корзина
|
||||
{cartCount > 0 && (
|
||||
<span className="cart-count badge bg-danger rounded-pill position-absolute top-0 start-100 translate-middle">
|
||||
{cartCount}
|
||||
</span>
|
||||
)}
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{/* Иконка корзины для десктопной версии */}
|
||||
<div className="d-none d-lg-block ms-3">
|
||||
<Link className="nav-link position-relative" to="/basket">
|
||||
<i className="bi bi-cart3 fs-5"></i>
|
||||
{cartCount > 0 && (
|
||||
<span className="cart-count badge bg-danger rounded-pill position-absolute top-0 start-100 translate-middle">
|
||||
{cartCount}
|
||||
</span>
|
||||
)}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
);
|
||||
};
|
||||
|
||||
export default Navbar;
|
||||
@@ -1,156 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Свяжитесь с нами | Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="logo.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<section class="my-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<h2 class="text-center mb-4">Свяжитесь с нами</h2>
|
||||
|
||||
<form class="needs-validation" novalidate>
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Имя</label>
|
||||
<input type="text" class="form-control" id="name" required />
|
||||
<div class="invalid-feedback">Пожалуйста, введите ваше имя.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Электронная почта</label>
|
||||
<input type="email" class="form-control" id="email" required />
|
||||
<div class="invalid-feedback">Пожалуйста, введите корректный email.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="purchase-code" class="form-label">Код покупки (если есть)</label>
|
||||
<input type="text" class="form-control" id="purchase-code" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="problem-description" class="form-label">Описание проблемы</label>
|
||||
<textarea class="form-control" id="problem-description" rows="6" required></textarea>
|
||||
<div class="invalid-feedback">Пожалуйста, опишите вашу проблему.</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary btn-lg px-4">Отправить</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Контактная информация -->
|
||||
<div class="card mt-5">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Контактная информация</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Книжный магазин "Тома"</h5>
|
||||
<p>Ваш надежный партнер в мире литературы с 2025 года.</p>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Валидация формы -->
|
||||
<script>
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const forms = document.querySelectorAll(".needs-validation");
|
||||
|
||||
Array.from(forms).forEach((form) => {
|
||||
form.addEventListener(
|
||||
"submit",
|
||||
(event) => {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
form.classList.add("was-validated");
|
||||
},
|
||||
false
|
||||
);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
108
MyWebSite/db.json
Normal file
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"genres": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "ФАНТАСТИКА"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "ДЕТЕКТИВ"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "РОМАН"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"name": "ФЭНТЕЗИ"
|
||||
},
|
||||
{
|
||||
"name": "УЖАС",
|
||||
"id": 5
|
||||
},
|
||||
{
|
||||
"name": "ужас3",
|
||||
"id": 7
|
||||
},
|
||||
{
|
||||
"name": "класс2",
|
||||
"id": 9
|
||||
},
|
||||
{
|
||||
"name": "ввв",
|
||||
"id": 10
|
||||
},
|
||||
{
|
||||
"name": "уу",
|
||||
"id": 11
|
||||
}
|
||||
],
|
||||
"books": [
|
||||
{
|
||||
"title": "Дюна",
|
||||
"author": "Фрэнк Герберт",
|
||||
"genreId": 1,
|
||||
"price": 0,
|
||||
"description": "Эпическая история о борьбе за контроль над планетой Арракис, источником самого ценного вещества во вселенной.",
|
||||
"image": "images/dune.jpg",
|
||||
"id": 1
|
||||
},
|
||||
{
|
||||
"title": "Основание",
|
||||
"author": "Айзек Азимов",
|
||||
"price": 700,
|
||||
"description": "Сага о падении и возрождении галактической империи, основанная на научных принципах.",
|
||||
"image": "images/foundation.jpg",
|
||||
"genreId": 1,
|
||||
"id": 2
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "Убийство в Восточном экспрессе",
|
||||
"author": "Агата Кристи",
|
||||
"price": 750,
|
||||
"description": "Загадочное убийство на поезде, где каждый пассажир может быть подозреваемым.",
|
||||
"image": "images/murder_on_the_orient_express.jpg",
|
||||
"genreId": 2
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"title": "Гарри Поттер и философский камень",
|
||||
"author": "Дж.К. Роулинг",
|
||||
"price": 800,
|
||||
"description": "Приключения молодого волшебника в школе магии Хогвартс.",
|
||||
"image": "images/harry_potter.webp",
|
||||
"genreId": 4
|
||||
},
|
||||
{
|
||||
"title": "Песнь льда и огня",
|
||||
"author": "Джордж Р. Р. Мартин",
|
||||
"price": 5,
|
||||
"description": "роарапс",
|
||||
"image": "images/asongoficeandfire.jpg",
|
||||
"genreId": 4,
|
||||
"id": 6
|
||||
},
|
||||
{
|
||||
"title": "Песнь льда и огня",
|
||||
"author": "ыыы",
|
||||
"price": 3455,
|
||||
"description": "кцакровчвепп",
|
||||
"image": "images/foundation.jpg",
|
||||
"genreId": 2,
|
||||
"id": 7
|
||||
}
|
||||
],
|
||||
"cart": [
|
||||
{
|
||||
"bookId": 2,
|
||||
"quantity": 2,
|
||||
"id": 1
|
||||
},
|
||||
{
|
||||
"bookId": 1,
|
||||
"quantity": 4,
|
||||
"id": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
<!-- Сделать кнопку в фантастике "добавить книгу", вводим данные в форму, и карточка книги добавляется в Фантастику-->
|
||||
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Скидки | Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="logo.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<section class="my-5">
|
||||
<h2 class="text-center mb-4">Скидки</h2>
|
||||
<hr class="mb-4" />
|
||||
|
||||
<div class="row g-4 justify-content-center">
|
||||
<!-- Книга 1 -->
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img
|
||||
src="images/the_girl_with_the_dragon_tattoo.jpg"
|
||||
class="card-img-top p-3"
|
||||
alt="Девушка с татуировкой дракона"
|
||||
/>
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Девушка с татуировкой дракона</h5>
|
||||
<p class="card-text">Стиг Ларссон</p>
|
||||
<p class="text-muted"><s>700 р.</s></p>
|
||||
<p class="text-danger fs-4 fw-bold">525 р.</p>
|
||||
<p class="small text-muted">Экономия 175 р. (25%)</p>
|
||||
<button class="btn btn-primary mt-2">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Книга 2 -->
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img src="images/the_hobbit.webp" class="card-img-top p-3" alt="Хоббит" />
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Хоббит</h5>
|
||||
<p class="card-text">Дж.Р.Р. Толкин</p>
|
||||
<p class="text-muted"><s>750 р.</s></p>
|
||||
<p class="text-danger fs-4 fw-bold">563 р.</p>
|
||||
<p class="small text-muted">Экономия 187 р. (25%)</p>
|
||||
<button class="btn btn-primary mt-2">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Книга 3 -->
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img src="images/dune.jpg" class="card-img-top p-3" alt="Дюна" />
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Дюна</h5>
|
||||
<p class="card-text">Фрэнк Герберт</p>
|
||||
<p class="text-muted"><s>500 р.</s></p>
|
||||
<p class="text-danger fs-4 fw-bold">375 р.</p>
|
||||
<p class="small text-muted">Экономия 125 р. (25%)</p>
|
||||
<button class="btn btn-primary mt-2">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-4" />
|
||||
|
||||
<div class="alert alert-success text-center">
|
||||
<h3>Условия получения скидки:</h3>
|
||||
<p class="lead mb-0">
|
||||
При покупке трех книг одновременно Вы получаете скидку 25%!<br />
|
||||
Скидка действует с 1 по 15 число каждого месяца. Не упустите возможность!
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Контакты</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
MyWebSite/dist/assets/Book1-BdJql_-B.jpg
vendored
|
Before Width: | Height: | Size: 69 KiB |
BIN
MyWebSite/dist/assets/Book2-BEB7Ih2u.jpg
vendored
|
Before Width: | Height: | Size: 177 KiB |
BIN
MyWebSite/dist/assets/Book3-bPojlso8.jpg
vendored
|
Before Width: | Height: | Size: 114 KiB |
BIN
MyWebSite/dist/assets/dune-Co1F1vkB.jpg
vendored
|
Before Width: | Height: | Size: 817 KiB |
BIN
MyWebSite/dist/assets/foundation-5XPRZ_kD.jpg
vendored
|
Before Width: | Height: | Size: 159 KiB |
BIN
MyWebSite/dist/assets/harry_potter-DFeuOAF5.webp
vendored
|
Before Width: | Height: | Size: 356 KiB |
BIN
MyWebSite/dist/assets/logo-DsrEtJYJ.png
vendored
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 178 KiB |
|
Before Width: | Height: | Size: 198 KiB |
1
MyWebSite/dist/assets/style-k5itloYG.css
vendored
@@ -1 +0,0 @@
|
||||
body{background-color:#fff;background-image:url(/assets/background-oYp1cNqc.png);background-size:cover;background-repeat:no-repeat;color:#036;font-family:Arial,sans-serif;padding-top:56px}.logo{border-radius:50%;width:50px;height:50px;object-fit:cover}.navbar-brand{font-weight:600}.card{transition:transform .3s ease;background-color:#ffffffe6}.card:hover{transform:translateY(-5px)}.btn-primary{background-color:#036;border-color:#036}.btn-primary:hover{background-color:#024;border-color:#024}@media (max-width: 768px){.navbar-brand span{font-size:1rem}body{background-size:auto;background-position:center}}.social-media a{color:#036;transition:color .3s ease}.social-media a:hover{color:#024}.card-img-top{height:300px;object-fit:contain}@media (max-width: 576px){.card{margin-bottom:20px}footer .col-md-6{text-align:center!important;margin-bottom:20px}}
|
||||
|
Before Width: | Height: | Size: 370 KiB |
BIN
MyWebSite/dist/assets/the_great_gatsby-qOYOk9u7.jpg
vendored
|
Before Width: | Height: | Size: 1.9 MiB |
BIN
MyWebSite/dist/assets/the_hobbit-CkJ8H01T.webp
vendored
|
Before Width: | Height: | Size: 172 KiB |
164
MyWebSite/dist/basket.html
vendored
@@ -1,164 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Корзина | Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
|
||||
<link rel="stylesheet" crossorigin href="/assets/style-k5itloYG.css">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="/assets/logo-DsrEtJYJ.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-10">
|
||||
<h2 class="text-center mb-4">Ваша корзина</h2>
|
||||
|
||||
<!-- Список товаров -->
|
||||
<div class="card mb-4">
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<img src="/assets/dune-Co1F1vkB.jpg" alt="Дюна" class="img-fluid rounded" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h5>Дюна</h5>
|
||||
<p class="text-muted">Фрэнк Герберт</p>
|
||||
<p>
|
||||
Эпическая история о борьбе за контроль над планетой Арракис, источником самого
|
||||
ценного вещества во вселенной.
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<p class="h5">500 руб.</p>
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<button class="btn btn-outline-danger"><i class="bi bi-trash"></i> Удалить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-2">
|
||||
<img src="/assets/the_hobbit-CkJ8H01T.webp" alt="Хоббит" class="img-fluid rounded" />
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h5>Хоббит</h5>
|
||||
<p class="text-muted">Дж.Р.Р. Толкин</p>
|
||||
<p>Путешествие Бильбо Бэггинса в мир приключений и драконов.</p>
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<p class="h5">750 руб.</p>
|
||||
</div>
|
||||
<div class="col-md-2 text-center">
|
||||
<button class="btn btn-outline-danger"><i class="bi bi-trash"></i> Удалить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Итоговая информация -->
|
||||
<div class="card mb-4 border-danger">
|
||||
<div class="card-body">
|
||||
<div class="alert alert-warning mb-3">
|
||||
<i class="bi bi-exclamation-triangle-fill me-2"></i>
|
||||
Условия скидки не применены. Добавьте еще одну книгу для скидки 25%!
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h4 class="mb-0">Общая стоимость:</h4>
|
||||
<h4 class="mb-0">1250 руб.</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Кнопки действий -->
|
||||
<div class="d-flex justify-content-between mb-5">
|
||||
<a href="catalog.html" class="btn btn-outline-primary">
|
||||
<i class="bi bi-arrow-left me-2"></i>Продолжить покупки
|
||||
</a>
|
||||
<button class="btn btn-success btn-lg px-4">
|
||||
<i class="bi bi-credit-card me-2"></i>Оформить заказ
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Контакты</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
461
MyWebSite/dist/catalog.html
vendored
@@ -1,461 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Каталог | Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
|
||||
<link rel="stylesheet" crossorigin href="/assets/style-k5itloYG.css">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="/assets/logo-DsrEtJYJ.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<h2 class="text-center mb-5">Каталог книг</h2>
|
||||
|
||||
<!-- Фантастика -->
|
||||
<section class="mb-5">
|
||||
<div class="genre-title bg-light p-3 rounded text-center mb-4">
|
||||
<h3>Фантастика</h3>
|
||||
</div>
|
||||
<button class="btn btn-success" data-bs-toggle="modal" data-bs-target="#addBookModal">
|
||||
<i class="bi bi-plus-circle"></i> Добавить книгу
|
||||
</button>
|
||||
|
||||
<div class="row g-4" id="fantasy-books">
|
||||
<!-- Существующие книги будут здесь -->
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="/assets/dune-Co1F1vkB.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Дюна"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Дюна</h5>
|
||||
<p class="card-text text-muted">Фрэнк Герберт</p>
|
||||
<p class="card-text">
|
||||
Эпическая история о борьбе за контроль над планетой Арракис, источником
|
||||
самого ценного вещества во вселенной.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">500 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="/assets/foundation-5XPRZ_kD.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Основание"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Основание</h5>
|
||||
<p class="card-text text-muted">Айзек Азимов</p>
|
||||
<p class="card-text">
|
||||
Сага о падении и возрождении галактической империи, основанная на научных
|
||||
принципах.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">600 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Детектив -->
|
||||
<section class="mb-5">
|
||||
<div class="genre-title bg-light p-3 rounded text-center mb-4">
|
||||
<h3>Детектив</h3>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="/assets/murder_on_the_orient_express-CZUCH3sF.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Убийство в Восточном экспрессе"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Убийство в Восточном экспрессе</h5>
|
||||
<p class="card-text text-muted">Агата Кристи</p>
|
||||
<p class="card-text">
|
||||
Загадочное убийство на поезде, где каждый пассажир может быть подозреваемым.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">750 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="/assets/the_girl_with_the_dragon_tattoo-CgrgasX2.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Девушка с татуировкой дракона"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Девушка с татуировкой дракона</h5>
|
||||
<p class="card-text text-muted">Стиг Ларссон</p>
|
||||
<p class="card-text">
|
||||
История о расследовании исчезновения девушки, связанная с мрачными тайнами
|
||||
семьи.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">700 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Роман -->
|
||||
<section class="mb-5">
|
||||
<div class="genre-title bg-light p-3 rounded text-center mb-4">
|
||||
<h3>Роман</h3>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="/assets/pride_and_prejudice-DkQ_n7hh.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Гордость и предубеждение"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Гордость и предубеждение</h5>
|
||||
<p class="card-text text-muted">Джейн Остин</p>
|
||||
<p class="card-text">
|
||||
Классический роман о любви и социальном статусе в Англии XIX века.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">650 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="/assets/the_great_gatsby-qOYOk9u7.jpg"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Великий Гэтсби"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Великий Гэтсби</h5>
|
||||
<p class="card-text text-muted">Фрэнсис Скотт Фицджеральд</p>
|
||||
<p class="card-text">
|
||||
История о любви, богатстве и утраченных мечтах в эпоху джаза.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">500 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Фэнтези -->
|
||||
<section class="mb-5">
|
||||
<div class="genre-title bg-light p-3 rounded text-center mb-4">
|
||||
<h3>Фэнтези</h3>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="/assets/harry_potter-DFeuOAF5.webp"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Гарри Поттер"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Гарри Поттер и философский камень</h5>
|
||||
<p class="card-text text-muted">Дж.К. Роулинг</p>
|
||||
<p class="card-text">Приключения молодого волшебника в школе магии Хогвартс.</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">800 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="/assets/the_hobbit-CkJ8H01T.webp"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="Хоббит"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Хоббит</h5>
|
||||
<p class="card-text text-muted">Дж.Р.Р. Толкин</p>
|
||||
<p class="card-text">
|
||||
Путешествие Бильбо Бэггинса в мир приключений и драконов.
|
||||
</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">750 руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Модальное окно для добавления книги -->
|
||||
<div class="modal fade" id="addBookModal" tabindex="-1" aria-labelledby="addBookModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="addBookModalLabel">Добавить новую книгу</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="addBookForm">
|
||||
<div class="mb-3">
|
||||
<label for="bookTitle" class="form-label">Название книги</label>
|
||||
<input type="text" class="form-control" id="bookTitle" required />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="bookAuthor" class="form-label">Автор</label>
|
||||
<input type="text" class="form-control" id="bookAuthor" required />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="bookPrice" class="form-label">Цена (руб.)</label>
|
||||
<input type="number" class="form-control" id="bookPrice" required />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="bookDescription" class="form-label">Описание</label>
|
||||
<textarea class="form-control" id="bookDescription" rows="3" required></textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="bookImage" class="form-label"
|
||||
>Имя файла изображения (из папки images)</label
|
||||
>
|
||||
<input type="text" class="form-control" id="bookImage" required />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
|
||||
<button type="button" class="btn btn-primary" id="saveBookBtn">Сохранить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Контакты</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Скрипт для добавления книг -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const saveBookBtn = document.getElementById("saveBookBtn");
|
||||
const addBookForm = document.getElementById("addBookForm");
|
||||
const fantasyBooksContainer = document.getElementById("fantasy-books");
|
||||
const addBookModal = new bootstrap.Modal(document.getElementById("addBookModal"));
|
||||
|
||||
saveBookBtn.addEventListener("click", function () {
|
||||
if (addBookForm.checkValidity()) {
|
||||
// Получаем значения из формы
|
||||
const title = document.getElementById("bookTitle").value;
|
||||
const author = document.getElementById("bookAuthor").value;
|
||||
const price = document.getElementById("bookPrice").value;
|
||||
const description = document.getElementById("bookDescription").value;
|
||||
const image = document.getElementById("bookImage").value;
|
||||
|
||||
// Создаем HTML для новой карточки книги
|
||||
const bookCard = `
|
||||
<div class="col-md-6">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img
|
||||
src="images/${image}"
|
||||
class="img-fluid rounded-start h-100"
|
||||
alt="${title}"
|
||||
style="object-fit: cover"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">${title}</h5>
|
||||
<p class="card-text text-muted">${author}</p>
|
||||
<p class="card-text">${description}</p>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<p class="h5 mb-0">${price} руб.</p>
|
||||
<button class="btn btn-primary">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Добавляем новую карточку в раздел "Фантастика"
|
||||
fantasyBooksContainer.insertAdjacentHTML("beforeend", bookCard);
|
||||
|
||||
// Закрываем модальное окно и очищаем форму
|
||||
addBookModal.hide();
|
||||
addBookForm.reset();
|
||||
} else {
|
||||
// Показываем сообщения об ошибках валидации
|
||||
addBookForm.classList.add("was-validated");
|
||||
}
|
||||
});
|
||||
|
||||
// Сбрасываем состояние валидации при закрытии модального окна
|
||||
document.getElementById("addBookModal").addEventListener("hidden.bs.modal", function () {
|
||||
addBookForm.classList.remove("was-validated");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
156
MyWebSite/dist/contactUs.html
vendored
@@ -1,156 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Свяжитесь с нами | Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
|
||||
<link rel="stylesheet" crossorigin href="/assets/style-k5itloYG.css">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="/assets/logo-DsrEtJYJ.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<section class="my-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<h2 class="text-center mb-4">Свяжитесь с нами</h2>
|
||||
|
||||
<form class="needs-validation" novalidate>
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Имя</label>
|
||||
<input type="text" class="form-control" id="name" required />
|
||||
<div class="invalid-feedback">Пожалуйста, введите ваше имя.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Электронная почта</label>
|
||||
<input type="email" class="form-control" id="email" required />
|
||||
<div class="invalid-feedback">Пожалуйста, введите корректный email.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="purchase-code" class="form-label">Код покупки (если есть)</label>
|
||||
<input type="text" class="form-control" id="purchase-code" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="problem-description" class="form-label">Описание проблемы</label>
|
||||
<textarea class="form-control" id="problem-description" rows="6" required></textarea>
|
||||
<div class="invalid-feedback">Пожалуйста, опишите вашу проблему.</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary btn-lg px-4">Отправить</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Контактная информация -->
|
||||
<div class="card mt-5">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Контактная информация</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Книжный магазин "Тома"</h5>
|
||||
<p>Ваш надежный партнер в мире литературы с 2010 года.</p>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Валидация формы -->
|
||||
<script>
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const forms = document.querySelectorAll(".needs-validation");
|
||||
|
||||
Array.from(forms).forEach((form) => {
|
||||
form.addEventListener(
|
||||
"submit",
|
||||
(event) => {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
form.classList.add("was-validated");
|
||||
},
|
||||
false
|
||||
);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
155
MyWebSite/dist/discounts.html
vendored
@@ -1,155 +0,0 @@
|
||||
<!-- Сделать кнопку в фантастике "добавить книгу", вводим данные в форму, и карточка книги добавляется в Фантастику-->
|
||||
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Скидки | Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
|
||||
<link rel="stylesheet" crossorigin href="/assets/style-k5itloYG.css">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="/assets/logo-DsrEtJYJ.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<section class="my-5">
|
||||
<h2 class="text-center mb-4">Скидки</h2>
|
||||
<hr class="mb-4" />
|
||||
|
||||
<div class="row g-4 justify-content-center">
|
||||
<!-- Книга 1 -->
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img
|
||||
src="/assets/the_girl_with_the_dragon_tattoo-CgrgasX2.jpg"
|
||||
class="card-img-top p-3"
|
||||
alt="Девушка с татуировкой дракона"
|
||||
/>
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Девушка с татуировкой дракона</h5>
|
||||
<p class="card-text">Стиг Ларссон</p>
|
||||
<p class="text-muted"><s>700 р.</s></p>
|
||||
<p class="text-danger fs-4 fw-bold">525 р.</p>
|
||||
<p class="small text-muted">Экономия 175 р. (25%)</p>
|
||||
<button class="btn btn-primary mt-2">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Книга 2 -->
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img src="/assets/the_hobbit-CkJ8H01T.webp" class="card-img-top p-3" alt="Хоббит" />
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Хоббит</h5>
|
||||
<p class="card-text">Дж.Р.Р. Толкин</p>
|
||||
<p class="text-muted"><s>750 р.</s></p>
|
||||
<p class="text-danger fs-4 fw-bold">563 р.</p>
|
||||
<p class="small text-muted">Экономия 187 р. (25%)</p>
|
||||
<button class="btn btn-primary mt-2">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Книга 3 -->
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img src="/assets/dune-Co1F1vkB.jpg" class="card-img-top p-3" alt="Дюна" />
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Дюна</h5>
|
||||
<p class="card-text">Фрэнк Герберт</p>
|
||||
<p class="text-muted"><s>500 р.</s></p>
|
||||
<p class="text-danger fs-4 fw-bold">375 р.</p>
|
||||
<p class="small text-muted">Экономия 125 р. (25%)</p>
|
||||
<button class="btn btn-primary mt-2">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-4" />
|
||||
|
||||
<div class="alert alert-success text-center">
|
||||
<h3>Условия получения скидки:</h3>
|
||||
<p class="lead mb-0">
|
||||
При покупке трех книг одновременно Вы получаете скидку 25%!<br />
|
||||
Скидка действует с 1 по 15 число каждого месяца. Не упустите возможность!
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Контакты</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
131
MyWebSite/dist/index.html
vendored
@@ -1,136 +1,21 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
|
||||
<script type="module" crossorigin src="/assets/main-9YKRXbpb.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/main-BLg3Q5Rn.css">
|
||||
</head>
|
||||
<body>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="/assets/logo-DsrEtJYJ.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
<div id="root"></div>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<section class="my-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8 text-center">
|
||||
<h2 class="mb-4">Описание:</h2>
|
||||
<p class="lead">
|
||||
Погрузитесь в незабываемые рукописные миры!<br />
|
||||
Бесчисленные литературные направления ждут вас!<br />
|
||||
Познакомьтесь с популярными работами известных<br />
|
||||
писателей! Мы Вам рады!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="my-5">
|
||||
<h2 class="text-center mb-4">Хиты продаж</h2>
|
||||
<div class="row g-4 justify-content-center">
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img src="/assets/Book1-BdJql_-B.jpg" class="card-img-top p-3" alt="Книга 1" />
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Тимоти Брук «Шляпа Вермеера»</h5>
|
||||
<button class="btn btn-primary mt-3">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img src="/assets/Book2-BEB7Ih2u.jpg" class="card-img-top p-3" alt="Книга 2" />
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Пол Линч «Песнь пророка»</h5>
|
||||
<button class="btn btn-primary mt-3">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img src="/assets/Book3-bPojlso8.jpg" class="card-img-top p-3" alt="Книга 3" />
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Яна Вагнер «Тоннель»</h5>
|
||||
<button class="btn btn-primary mt-3">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Контакты</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Подключение React и Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Подключение скриптов приложения -->
|
||||
|
||||
</body>
|
||||
|
||||
@@ -1,136 +1,20 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Книжный интернет-магазин "Тома"</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
|
||||
<!-- Ваш CSS -->
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Навигация -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center" href="index.html">
|
||||
<img src="logo.png" alt="Логотип" class="logo me-2" />
|
||||
<span class="d-none d-lg-block">Книжный магазин "Тома"</span>
|
||||
<span class="d-lg-none">"Тома"</span>
|
||||
</a>
|
||||
<div id="root"></div>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarContent">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a
|
||||
class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
id="navbarDropdown"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
>
|
||||
Страницы
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="index.html">Главная</a></li>
|
||||
<li><a class="dropdown-item" href="catalog.html">Каталог</a></li>
|
||||
<li><a class="dropdown-item" href="discounts.html">Скидки</a></li>
|
||||
<li><a class="dropdown-item" href="basket.html">Корзина</a></li>
|
||||
<li><a class="dropdown-item" href="contactUs.html">Контакты</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<main class="container mt-5 pt-5">
|
||||
<section class="my-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8 text-center">
|
||||
<h2 class="mb-4">Описание:</h2>
|
||||
<p class="lead">
|
||||
Погрузитесь в незабываемые рукописные миры!<br />
|
||||
Бесчисленные литературные направления ждут вас!<br />
|
||||
Познакомьтесь с популярными работами известных<br />
|
||||
писателей! Мы Вам рады!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="my-5">
|
||||
<h2 class="text-center mb-4">Хиты продаж</h2>
|
||||
<div class="row g-4 justify-content-center">
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img src="images/Book1.jpg" class="card-img-top p-3" alt="Книга 1" />
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Тимоти Брук «Шляпа Вермеера»</h5>
|
||||
<button class="btn btn-primary mt-3">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img src="images/Book2.jpg" class="card-img-top p-3" alt="Книга 2" />
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Пол Линч «Песнь пророка»</h5>
|
||||
<button class="btn btn-primary mt-3">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<img src="images/Book3.jpg" class="card-img-top p-3" alt="Книга 3" />
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Яна Вагнер «Тоннель»</h5>
|
||||
<button class="btn btn-primary mt-3">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!-- Подвал -->
|
||||
<footer class="bg-light py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-4 mb-md-0">
|
||||
<h5 class="mb-3">Контакты</h5>
|
||||
<ul class="list-unstyled">
|
||||
<li><i class="bi bi-envelope me-2"></i> info@toma.ru</li>
|
||||
<li><i class="bi bi-phone me-2"></i> +7 (123) 456-78-90</li>
|
||||
<li><i class="bi bi-clock me-2"></i> Пн-Пт 9:00-18:00</li>
|
||||
<li><i class="bi bi-geo-alt me-2"></i> г. Москва, ул. Литераторов, д. 1</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-md-end">
|
||||
<h5 class="mb-3">Социальные сети</h5>
|
||||
<div class="social-media">
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-facebook fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none me-3"><i class="bi bi-vk fs-3"></i></a>
|
||||
<a href="#" class="text-decoration-none"><i class="bi bi-telegram fs-3"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<!-- Подключение React и Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Подключение скриптов приложения -->
|
||||
<script type="module" src="main.jsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
10
MyWebSite/main.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './App';
|
||||
import './style.css';
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
16
MyWebSite/node_modules/.bin/browserslist
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../browserslist/cli.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../browserslist/cli.js" "$@"
|
||||
fi
|
||||
17
MyWebSite/node_modules/.bin/browserslist.cmd
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\browserslist\cli.js" %*
|
||||
28
MyWebSite/node_modules/.bin/browserslist.ps1
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../browserslist/cli.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../browserslist/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
16
MyWebSite/node_modules/.bin/jsesc
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@"
|
||||
else
|
||||
exec node "$basedir/../jsesc/bin/jsesc" "$@"
|
||||
fi
|
||||
17
MyWebSite/node_modules/.bin/jsesc.cmd
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jsesc\bin\jsesc" %*
|
||||
28
MyWebSite/node_modules/.bin/jsesc.ps1
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../jsesc/bin/jsesc" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../jsesc/bin/jsesc" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
16
MyWebSite/node_modules/.bin/json-server
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../json-server/lib/cli/bin.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../json-server/lib/cli/bin.js" "$@"
|
||||
fi
|
||||
17
MyWebSite/node_modules/.bin/json-server.cmd
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json-server\lib\cli\bin.js" %*
|
||||
28
MyWebSite/node_modules/.bin/json-server.ps1
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../json-server/lib/cli/bin.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../json-server/lib/cli/bin.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../json-server/lib/cli/bin.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../json-server/lib/cli/bin.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
16
MyWebSite/node_modules/.bin/loose-envify
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../loose-envify/cli.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../loose-envify/cli.js" "$@"
|
||||
fi
|
||||
17
MyWebSite/node_modules/.bin/loose-envify.cmd
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\loose-envify\cli.js" %*
|
||||
28
MyWebSite/node_modules/.bin/loose-envify.ps1
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../loose-envify/cli.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../loose-envify/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../loose-envify/cli.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../loose-envify/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
16
MyWebSite/node_modules/.bin/parser
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
||||
fi
|
||||
17
MyWebSite/node_modules/.bin/parser.cmd
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@babel\parser\bin\babel-parser.js" %*
|
||||
28
MyWebSite/node_modules/.bin/parser.ps1
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
16
MyWebSite/node_modules/.bin/update-browserslist-db
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../update-browserslist-db/cli.js" "$@"
|
||||
else
|
||||
exec node "$basedir/../update-browserslist-db/cli.js" "$@"
|
||||
fi
|
||||
17
MyWebSite/node_modules/.bin/update-browserslist-db.cmd
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
@ECHO off
|
||||
GOTO start
|
||||
:find_dp0
|
||||
SET dp0=%~dp0
|
||||
EXIT /b
|
||||
:start
|
||||
SETLOCAL
|
||||
CALL :find_dp0
|
||||
|
||||
IF EXIST "%dp0%\node.exe" (
|
||||
SET "_prog=%dp0%\node.exe"
|
||||
) ELSE (
|
||||
SET "_prog=node"
|
||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
)
|
||||
|
||||
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\update-browserslist-db\cli.js" %*
|
||||
28
MyWebSite/node_modules/.bin/update-browserslist-db.ps1
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env pwsh
|
||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
||||
|
||||
$exe=""
|
||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
||||
# Fix case when both the Windows and Linux builds of Node
|
||||
# are installed in the same directory
|
||||
$exe=".exe"
|
||||
}
|
||||
$ret=0
|
||||
if (Test-Path "$basedir/node$exe") {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args
|
||||
} else {
|
||||
& "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
} else {
|
||||
# Support pipeline input
|
||||
if ($MyInvocation.ExpectingInput) {
|
||||
$input | & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args
|
||||
} else {
|
||||
& "node$exe" "$basedir/../update-browserslist-db/cli.js" $args
|
||||
}
|
||||
$ret=$LASTEXITCODE
|
||||
}
|
||||
exit $ret
|
||||
10784
MyWebSite/node_modules/.package-lock.json
generated
vendored
86
MyWebSite/node_modules/.vite/deps/_metadata.json
generated
vendored
@@ -1,8 +1,82 @@
|
||||
{
|
||||
"hash": "7f0718fc",
|
||||
"configHash": "4e678905",
|
||||
"lockfileHash": "553d2e6a",
|
||||
"browserHash": "32e71a75",
|
||||
"optimized": {},
|
||||
"chunks": {}
|
||||
"hash": "ef787cc2",
|
||||
"configHash": "2b522f55",
|
||||
"lockfileHash": "7001390e",
|
||||
"browserHash": "8139cfad",
|
||||
"optimized": {
|
||||
"react": {
|
||||
"src": "../../react/index.js",
|
||||
"file": "react.js",
|
||||
"fileHash": "5f6216af",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react-dom": {
|
||||
"src": "../../react-dom/index.js",
|
||||
"file": "react-dom.js",
|
||||
"fileHash": "2ca99a2e",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react/jsx-dev-runtime": {
|
||||
"src": "../../react/jsx-dev-runtime.js",
|
||||
"file": "react_jsx-dev-runtime.js",
|
||||
"fileHash": "d15c3b5a",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react/jsx-runtime": {
|
||||
"src": "../../react/jsx-runtime.js",
|
||||
"file": "react_jsx-runtime.js",
|
||||
"fileHash": "cb8f170d",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react-dom/client": {
|
||||
"src": "../../react-dom/client.js",
|
||||
"file": "react-dom_client.js",
|
||||
"fileHash": "78d4b582",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react-router-dom": {
|
||||
"src": "../../react-router-dom/dist/index.mjs",
|
||||
"file": "react-router-dom.js",
|
||||
"fileHash": "0e0b5812",
|
||||
"needsInterop": false
|
||||
},
|
||||
"bootstrap/dist/js/bootstrap.bundle.min": {
|
||||
"src": "../../bootstrap/dist/js/bootstrap.bundle.min.js",
|
||||
"file": "bootstrap_dist_js_bootstrap__bundle__min.js",
|
||||
"fileHash": "62b9b8be",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react-bootstrap": {
|
||||
"src": "../../react-bootstrap/esm/index.js",
|
||||
"file": "react-bootstrap.js",
|
||||
"fileHash": "294aeee0",
|
||||
"needsInterop": false
|
||||
},
|
||||
"react-icons/bi": {
|
||||
"src": "../../react-icons/bi/index.mjs",
|
||||
"file": "react-icons_bi.js",
|
||||
"fileHash": "a1695011",
|
||||
"needsInterop": false
|
||||
},
|
||||
"axios": {
|
||||
"src": "../../axios/index.js",
|
||||
"file": "axios.js",
|
||||
"fileHash": "fb4c2b20",
|
||||
"needsInterop": false
|
||||
}
|
||||
},
|
||||
"chunks": {
|
||||
"chunk-MJNCUEZK": {
|
||||
"file": "chunk-MJNCUEZK.js"
|
||||
},
|
||||
"chunk-HE4GKDYE": {
|
||||
"file": "chunk-HE4GKDYE.js"
|
||||
},
|
||||
"chunk-UGC3UZ7L": {
|
||||
"file": "chunk-UGC3UZ7L.js"
|
||||
},
|
||||
"chunk-G3PMV62Z": {
|
||||
"file": "chunk-G3PMV62Z.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
2520
MyWebSite/node_modules/.vite/deps/axios.js
generated
vendored
Normal file
7
MyWebSite/node_modules/.vite/deps/axios.js.map
generated
vendored
Normal file
2012
MyWebSite/node_modules/.vite/deps/bootstrap_dist_js_bootstrap__bundle__min.js
generated
vendored
Normal file
7
MyWebSite/node_modules/.vite/deps/bootstrap_dist_js_bootstrap__bundle__min.js.map
generated
vendored
Normal file
35
MyWebSite/node_modules/.vite/deps/chunk-G3PMV62Z.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
export {
|
||||
__commonJS,
|
||||
__export,
|
||||
__toESM
|
||||
};
|
||||
7
MyWebSite/node_modules/.vite/deps/chunk-G3PMV62Z.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
280
MyWebSite/node_modules/.vite/deps/chunk-HE4GKDYE.js
generated
vendored
Normal file
@@ -0,0 +1,280 @@
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-UGC3UZ7L.js";
|
||||
import {
|
||||
__commonJS
|
||||
} from "./chunk-G3PMV62Z.js";
|
||||
|
||||
// node_modules/react-dom/cjs/react-dom.development.js
|
||||
var require_react_dom_development = __commonJS({
|
||||
"node_modules/react-dom/cjs/react-dom.development.js"(exports) {
|
||||
"use strict";
|
||||
(function() {
|
||||
function noop() {
|
||||
}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function createPortal$1(children, containerInfo, implementation) {
|
||||
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
||||
try {
|
||||
testStringCoercion(key);
|
||||
var JSCompiler_inline_result = false;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = true;
|
||||
}
|
||||
JSCompiler_inline_result && (console.error(
|
||||
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||
"function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"
|
||||
), testStringCoercion(key));
|
||||
return {
|
||||
$$typeof: REACT_PORTAL_TYPE,
|
||||
key: null == key ? null : "" + key,
|
||||
children,
|
||||
containerInfo,
|
||||
implementation
|
||||
};
|
||||
}
|
||||
function getCrossOriginStringAs(as, input) {
|
||||
if ("font" === as) return "";
|
||||
if ("string" === typeof input)
|
||||
return "use-credentials" === input ? input : "";
|
||||
}
|
||||
function getValueDescriptorExpectingObjectForWarning(thing) {
|
||||
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : 'something with type "' + typeof thing + '"';
|
||||
}
|
||||
function getValueDescriptorExpectingEnumForWarning(thing) {
|
||||
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"';
|
||||
}
|
||||
function resolveDispatcher() {
|
||||
var dispatcher = ReactSharedInternals.H;
|
||||
null === dispatcher && console.error(
|
||||
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
||||
);
|
||||
return dispatcher;
|
||||
}
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||
var React = require_react(), Internals = {
|
||||
d: {
|
||||
f: noop,
|
||||
r: function() {
|
||||
throw Error(
|
||||
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
|
||||
);
|
||||
},
|
||||
D: noop,
|
||||
C: noop,
|
||||
L: noop,
|
||||
m: noop,
|
||||
X: noop,
|
||||
S: noop,
|
||||
M: noop
|
||||
},
|
||||
p: 0,
|
||||
findDOMNode: null
|
||||
}, REACT_PORTAL_TYPE = Symbol.for("react.portal"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
||||
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
|
||||
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
||||
);
|
||||
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
||||
exports.createPortal = function(children, container) {
|
||||
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
||||
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
||||
throw Error("Target container is not a DOM element.");
|
||||
return createPortal$1(children, container, null, key);
|
||||
};
|
||||
exports.flushSync = function(fn) {
|
||||
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
||||
try {
|
||||
if (ReactSharedInternals.T = null, Internals.p = 2, fn)
|
||||
return fn();
|
||||
} finally {
|
||||
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error(
|
||||
"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
|
||||
);
|
||||
}
|
||||
};
|
||||
exports.preconnect = function(href, options) {
|
||||
"string" === typeof href && href ? null != options && "object" !== typeof options ? console.error(
|
||||
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
|
||||
getValueDescriptorExpectingEnumForWarning(options)
|
||||
) : null != options && "string" !== typeof options.crossOrigin && console.error(
|
||||
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
|
||||
getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
|
||||
) : console.error(
|
||||
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
||||
getValueDescriptorExpectingObjectForWarning(href)
|
||||
);
|
||||
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
||||
};
|
||||
exports.prefetchDNS = function(href) {
|
||||
if ("string" !== typeof href || !href)
|
||||
console.error(
|
||||
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
||||
getValueDescriptorExpectingObjectForWarning(href)
|
||||
);
|
||||
else if (1 < arguments.length) {
|
||||
var options = arguments[1];
|
||||
"object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error(
|
||||
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
||||
getValueDescriptorExpectingEnumForWarning(options)
|
||||
) : console.error(
|
||||
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
||||
getValueDescriptorExpectingEnumForWarning(options)
|
||||
);
|
||||
}
|
||||
"string" === typeof href && Internals.d.D(href);
|
||||
};
|
||||
exports.preinit = function(href, options) {
|
||||
"string" === typeof href && href ? null == options || "object" !== typeof options ? console.error(
|
||||
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
|
||||
getValueDescriptorExpectingEnumForWarning(options)
|
||||
) : "style" !== options.as && "script" !== options.as && console.error(
|
||||
'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
|
||||
getValueDescriptorExpectingEnumForWarning(options.as)
|
||||
) : console.error(
|
||||
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
||||
getValueDescriptorExpectingObjectForWarning(href)
|
||||
);
|
||||
if ("string" === typeof href && options && "string" === typeof options.as) {
|
||||
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
||||
"style" === as ? Internals.d.S(
|
||||
href,
|
||||
"string" === typeof options.precedence ? options.precedence : void 0,
|
||||
{
|
||||
crossOrigin,
|
||||
integrity,
|
||||
fetchPriority
|
||||
}
|
||||
) : "script" === as && Internals.d.X(href, {
|
||||
crossOrigin,
|
||||
integrity,
|
||||
fetchPriority,
|
||||
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.preinitModule = function(href, options) {
|
||||
var encountered = "";
|
||||
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
|
||||
if (encountered)
|
||||
console.error(
|
||||
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
|
||||
encountered
|
||||
);
|
||||
else
|
||||
switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
|
||||
case "script":
|
||||
break;
|
||||
default:
|
||||
encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error(
|
||||
'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
|
||||
encountered,
|
||||
href
|
||||
);
|
||||
}
|
||||
if ("string" === typeof href)
|
||||
if ("object" === typeof options && null !== options) {
|
||||
if (null == options.as || "script" === options.as)
|
||||
encountered = getCrossOriginStringAs(
|
||||
options.as,
|
||||
options.crossOrigin
|
||||
), Internals.d.M(href, {
|
||||
crossOrigin: encountered,
|
||||
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
||||
});
|
||||
} else null == options && Internals.d.M(href);
|
||||
};
|
||||
exports.preload = function(href, options) {
|
||||
var encountered = "";
|
||||
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||
null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
||||
encountered && console.error(
|
||||
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
|
||||
encountered
|
||||
);
|
||||
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
||||
encountered = options.as;
|
||||
var crossOrigin = getCrossOriginStringAs(
|
||||
encountered,
|
||||
options.crossOrigin
|
||||
);
|
||||
Internals.d.L(href, encountered, {
|
||||
crossOrigin,
|
||||
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
||||
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
||||
type: "string" === typeof options.type ? options.type : void 0,
|
||||
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
||||
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
||||
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
||||
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
||||
media: "string" === typeof options.media ? options.media : void 0
|
||||
});
|
||||
}
|
||||
};
|
||||
exports.preloadModule = function(href, options) {
|
||||
var encountered = "";
|
||||
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
||||
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
||||
encountered && console.error(
|
||||
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
|
||||
encountered
|
||||
);
|
||||
"string" === typeof href && (options ? (encountered = getCrossOriginStringAs(
|
||||
options.as,
|
||||
options.crossOrigin
|
||||
), Internals.d.m(href, {
|
||||
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
||||
crossOrigin: encountered,
|
||||
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
||||
})) : Internals.d.m(href));
|
||||
};
|
||||
exports.requestFormReset = function(form) {
|
||||
Internals.d.r(form);
|
||||
};
|
||||
exports.unstable_batchedUpdates = function(fn, a) {
|
||||
return fn(a);
|
||||
};
|
||||
exports.useFormState = function(action, initialState, permalink) {
|
||||
return resolveDispatcher().useFormState(action, initialState, permalink);
|
||||
};
|
||||
exports.useFormStatus = function() {
|
||||
return resolveDispatcher().useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.1.0";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/react-dom/index.js
|
||||
var require_react_dom = __commonJS({
|
||||
"node_modules/react-dom/index.js"(exports, module) {
|
||||
if (false) {
|
||||
checkDCE();
|
||||
module.exports = null;
|
||||
} else {
|
||||
module.exports = require_react_dom_development();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export {
|
||||
require_react_dom
|
||||
};
|
||||
/*! Bundled license information:
|
||||
|
||||
react-dom/cjs/react-dom.development.js:
|
||||
(**
|
||||
* @license React
|
||||
* react-dom.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
*/
|
||||
//# sourceMappingURL=chunk-HE4GKDYE.js.map
|
||||
7
MyWebSite/node_modules/.vite/deps/chunk-HE4GKDYE.js.map
generated
vendored
Normal file
297
MyWebSite/node_modules/.vite/deps/chunk-MJNCUEZK.js
generated
vendored
Normal file
@@ -0,0 +1,297 @@
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-UGC3UZ7L.js";
|
||||
import {
|
||||
__commonJS
|
||||
} from "./chunk-G3PMV62Z.js";
|
||||
|
||||
// node_modules/react/cjs/react-jsx-runtime.development.js
|
||||
var require_react_jsx_runtime_development = __commonJS({
|
||||
"node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
||||
"use strict";
|
||||
(function() {
|
||||
function getComponentNameFromType(type) {
|
||||
if (null == type) return null;
|
||||
if ("function" === typeof type)
|
||||
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||
if ("string" === typeof type) return type;
|
||||
switch (type) {
|
||||
case REACT_FRAGMENT_TYPE:
|
||||
return "Fragment";
|
||||
case REACT_PROFILER_TYPE:
|
||||
return "Profiler";
|
||||
case REACT_STRICT_MODE_TYPE:
|
||||
return "StrictMode";
|
||||
case REACT_SUSPENSE_TYPE:
|
||||
return "Suspense";
|
||||
case REACT_SUSPENSE_LIST_TYPE:
|
||||
return "SuspenseList";
|
||||
case REACT_ACTIVITY_TYPE:
|
||||
return "Activity";
|
||||
}
|
||||
if ("object" === typeof type)
|
||||
switch ("number" === typeof type.tag && console.error(
|
||||
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
||||
), type.$$typeof) {
|
||||
case REACT_PORTAL_TYPE:
|
||||
return "Portal";
|
||||
case REACT_CONTEXT_TYPE:
|
||||
return (type.displayName || "Context") + ".Provider";
|
||||
case REACT_CONSUMER_TYPE:
|
||||
return (type._context.displayName || "Context") + ".Consumer";
|
||||
case REACT_FORWARD_REF_TYPE:
|
||||
var innerType = type.render;
|
||||
type = type.displayName;
|
||||
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||
return type;
|
||||
case REACT_MEMO_TYPE:
|
||||
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||
case REACT_LAZY_TYPE:
|
||||
innerType = type._payload;
|
||||
type = type._init;
|
||||
try {
|
||||
return getComponentNameFromType(type(innerType));
|
||||
} catch (x) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function checkKeyStringCoercion(value) {
|
||||
try {
|
||||
testStringCoercion(value);
|
||||
var JSCompiler_inline_result = false;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = true;
|
||||
}
|
||||
if (JSCompiler_inline_result) {
|
||||
JSCompiler_inline_result = console;
|
||||
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||
JSCompiler_temp_const.call(
|
||||
JSCompiler_inline_result,
|
||||
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||
JSCompiler_inline_result$jscomp$0
|
||||
);
|
||||
return testStringCoercion(value);
|
||||
}
|
||||
}
|
||||
function getTaskName(type) {
|
||||
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
||||
return "<...>";
|
||||
try {
|
||||
var name = getComponentNameFromType(type);
|
||||
return name ? "<" + name + ">" : "<...>";
|
||||
} catch (x) {
|
||||
return "<...>";
|
||||
}
|
||||
}
|
||||
function getOwner() {
|
||||
var dispatcher = ReactSharedInternals.A;
|
||||
return null === dispatcher ? null : dispatcher.getOwner();
|
||||
}
|
||||
function UnknownOwner() {
|
||||
return Error("react-stack-top-frame");
|
||||
}
|
||||
function hasValidKey(config) {
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||
if (getter && getter.isReactWarning) return false;
|
||||
}
|
||||
return void 0 !== config.key;
|
||||
}
|
||||
function defineKeyPropWarningGetter(props, displayName) {
|
||||
function warnAboutAccessingKey() {
|
||||
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
||||
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
||||
displayName
|
||||
));
|
||||
}
|
||||
warnAboutAccessingKey.isReactWarning = true;
|
||||
Object.defineProperty(props, "key", {
|
||||
get: warnAboutAccessingKey,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function elementRefGetterWithDeprecationWarning() {
|
||||
var componentName = getComponentNameFromType(this.type);
|
||||
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
||||
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
||||
));
|
||||
componentName = this.props.ref;
|
||||
return void 0 !== componentName ? componentName : null;
|
||||
}
|
||||
function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
|
||||
self = props.ref;
|
||||
type = {
|
||||
$$typeof: REACT_ELEMENT_TYPE,
|
||||
type,
|
||||
key,
|
||||
props,
|
||||
_owner: owner
|
||||
};
|
||||
null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
|
||||
enumerable: false,
|
||||
get: elementRefGetterWithDeprecationWarning
|
||||
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
||||
type._store = {};
|
||||
Object.defineProperty(type._store, "validated", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: 0
|
||||
});
|
||||
Object.defineProperty(type, "_debugInfo", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: null
|
||||
});
|
||||
Object.defineProperty(type, "_debugStack", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: debugStack
|
||||
});
|
||||
Object.defineProperty(type, "_debugTask", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: debugTask
|
||||
});
|
||||
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||
return type;
|
||||
}
|
||||
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self, debugStack, debugTask) {
|
||||
var children = config.children;
|
||||
if (void 0 !== children)
|
||||
if (isStaticChildren)
|
||||
if (isArrayImpl(children)) {
|
||||
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
||||
validateChildKeys(children[isStaticChildren]);
|
||||
Object.freeze && Object.freeze(children);
|
||||
} else
|
||||
console.error(
|
||||
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
||||
);
|
||||
else validateChildKeys(children);
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
children = getComponentNameFromType(type);
|
||||
var keys = Object.keys(config).filter(function(k) {
|
||||
return "key" !== k;
|
||||
});
|
||||
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
||||
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
||||
isStaticChildren,
|
||||
children,
|
||||
keys,
|
||||
children
|
||||
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
||||
}
|
||||
children = null;
|
||||
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
||||
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
||||
if ("key" in config) {
|
||||
maybeKey = {};
|
||||
for (var propName in config)
|
||||
"key" !== propName && (maybeKey[propName] = config[propName]);
|
||||
} else maybeKey = config;
|
||||
children && defineKeyPropWarningGetter(
|
||||
maybeKey,
|
||||
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
||||
);
|
||||
return ReactElement(
|
||||
type,
|
||||
children,
|
||||
self,
|
||||
source,
|
||||
getOwner(),
|
||||
maybeKey,
|
||||
debugStack,
|
||||
debugTask
|
||||
);
|
||||
}
|
||||
function validateChildKeys(node) {
|
||||
"object" === typeof node && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
|
||||
}
|
||||
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||
Symbol.for("react.provider");
|
||||
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
||||
return null;
|
||||
};
|
||||
React = {
|
||||
"react-stack-bottom-frame": function(callStackForError) {
|
||||
return callStackForError();
|
||||
}
|
||||
};
|
||||
var specialPropKeyWarningShown;
|
||||
var didWarnAboutElementRef = {};
|
||||
var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(
|
||||
React,
|
||||
UnknownOwner
|
||||
)();
|
||||
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||
var didWarnAboutKeySpread = {};
|
||||
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||
exports.jsx = function(type, config, maybeKey, source, self) {
|
||||
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||
return jsxDEVImpl(
|
||||
type,
|
||||
config,
|
||||
maybeKey,
|
||||
false,
|
||||
source,
|
||||
self,
|
||||
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||
);
|
||||
};
|
||||
exports.jsxs = function(type, config, maybeKey, source, self) {
|
||||
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||
return jsxDEVImpl(
|
||||
type,
|
||||
config,
|
||||
maybeKey,
|
||||
true,
|
||||
source,
|
||||
self,
|
||||
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||
);
|
||||
};
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/react/jsx-runtime.js
|
||||
var require_jsx_runtime = __commonJS({
|
||||
"node_modules/react/jsx-runtime.js"(exports, module) {
|
||||
if (false) {
|
||||
module.exports = null;
|
||||
} else {
|
||||
module.exports = require_react_jsx_runtime_development();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export {
|
||||
require_jsx_runtime
|
||||
};
|
||||
/*! Bundled license information:
|
||||
|
||||
react/cjs/react-jsx-runtime.development.js:
|
||||
(**
|
||||
* @license React
|
||||
* react-jsx-runtime.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
*/
|
||||
//# sourceMappingURL=chunk-MJNCUEZK.js.map
|
||||
7
MyWebSite/node_modules/.vite/deps/chunk-MJNCUEZK.js.map
generated
vendored
Normal file
972
MyWebSite/node_modules/.vite/deps/chunk-UGC3UZ7L.js
generated
vendored
Normal file
@@ -0,0 +1,972 @@
|
||||
import {
|
||||
__commonJS
|
||||
} from "./chunk-G3PMV62Z.js";
|
||||
|
||||
// node_modules/react/cjs/react.development.js
|
||||
var require_react_development = __commonJS({
|
||||
"node_modules/react/cjs/react.development.js"(exports, module) {
|
||||
"use strict";
|
||||
(function() {
|
||||
function defineDeprecationWarning(methodName, info) {
|
||||
Object.defineProperty(Component.prototype, methodName, {
|
||||
get: function() {
|
||||
console.warn(
|
||||
"%s(...) is deprecated in plain JavaScript React classes. %s",
|
||||
info[0],
|
||||
info[1]
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
function getIteratorFn(maybeIterable) {
|
||||
if (null === maybeIterable || "object" !== typeof maybeIterable)
|
||||
return null;
|
||||
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
||||
return "function" === typeof maybeIterable ? maybeIterable : null;
|
||||
}
|
||||
function warnNoop(publicInstance, callerName) {
|
||||
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
||||
var warningKey = publicInstance + "." + callerName;
|
||||
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
|
||||
"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
|
||||
callerName,
|
||||
publicInstance
|
||||
), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
|
||||
}
|
||||
function Component(props, context, updater) {
|
||||
this.props = props;
|
||||
this.context = context;
|
||||
this.refs = emptyObject;
|
||||
this.updater = updater || ReactNoopUpdateQueue;
|
||||
}
|
||||
function ComponentDummy() {
|
||||
}
|
||||
function PureComponent(props, context, updater) {
|
||||
this.props = props;
|
||||
this.context = context;
|
||||
this.refs = emptyObject;
|
||||
this.updater = updater || ReactNoopUpdateQueue;
|
||||
}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function checkKeyStringCoercion(value) {
|
||||
try {
|
||||
testStringCoercion(value);
|
||||
var JSCompiler_inline_result = false;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = true;
|
||||
}
|
||||
if (JSCompiler_inline_result) {
|
||||
JSCompiler_inline_result = console;
|
||||
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||
JSCompiler_temp_const.call(
|
||||
JSCompiler_inline_result,
|
||||
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||
JSCompiler_inline_result$jscomp$0
|
||||
);
|
||||
return testStringCoercion(value);
|
||||
}
|
||||
}
|
||||
function getComponentNameFromType(type) {
|
||||
if (null == type) return null;
|
||||
if ("function" === typeof type)
|
||||
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||
if ("string" === typeof type) return type;
|
||||
switch (type) {
|
||||
case REACT_FRAGMENT_TYPE:
|
||||
return "Fragment";
|
||||
case REACT_PROFILER_TYPE:
|
||||
return "Profiler";
|
||||
case REACT_STRICT_MODE_TYPE:
|
||||
return "StrictMode";
|
||||
case REACT_SUSPENSE_TYPE:
|
||||
return "Suspense";
|
||||
case REACT_SUSPENSE_LIST_TYPE:
|
||||
return "SuspenseList";
|
||||
case REACT_ACTIVITY_TYPE:
|
||||
return "Activity";
|
||||
}
|
||||
if ("object" === typeof type)
|
||||
switch ("number" === typeof type.tag && console.error(
|
||||
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
||||
), type.$$typeof) {
|
||||
case REACT_PORTAL_TYPE:
|
||||
return "Portal";
|
||||
case REACT_CONTEXT_TYPE:
|
||||
return (type.displayName || "Context") + ".Provider";
|
||||
case REACT_CONSUMER_TYPE:
|
||||
return (type._context.displayName || "Context") + ".Consumer";
|
||||
case REACT_FORWARD_REF_TYPE:
|
||||
var innerType = type.render;
|
||||
type = type.displayName;
|
||||
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||
return type;
|
||||
case REACT_MEMO_TYPE:
|
||||
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||
case REACT_LAZY_TYPE:
|
||||
innerType = type._payload;
|
||||
type = type._init;
|
||||
try {
|
||||
return getComponentNameFromType(type(innerType));
|
||||
} catch (x) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function getTaskName(type) {
|
||||
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
||||
return "<...>";
|
||||
try {
|
||||
var name = getComponentNameFromType(type);
|
||||
return name ? "<" + name + ">" : "<...>";
|
||||
} catch (x) {
|
||||
return "<...>";
|
||||
}
|
||||
}
|
||||
function getOwner() {
|
||||
var dispatcher = ReactSharedInternals.A;
|
||||
return null === dispatcher ? null : dispatcher.getOwner();
|
||||
}
|
||||
function UnknownOwner() {
|
||||
return Error("react-stack-top-frame");
|
||||
}
|
||||
function hasValidKey(config) {
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||
if (getter && getter.isReactWarning) return false;
|
||||
}
|
||||
return void 0 !== config.key;
|
||||
}
|
||||
function defineKeyPropWarningGetter(props, displayName) {
|
||||
function warnAboutAccessingKey() {
|
||||
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
||||
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
||||
displayName
|
||||
));
|
||||
}
|
||||
warnAboutAccessingKey.isReactWarning = true;
|
||||
Object.defineProperty(props, "key", {
|
||||
get: warnAboutAccessingKey,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function elementRefGetterWithDeprecationWarning() {
|
||||
var componentName = getComponentNameFromType(this.type);
|
||||
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
||||
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
||||
));
|
||||
componentName = this.props.ref;
|
||||
return void 0 !== componentName ? componentName : null;
|
||||
}
|
||||
function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
|
||||
self = props.ref;
|
||||
type = {
|
||||
$$typeof: REACT_ELEMENT_TYPE,
|
||||
type,
|
||||
key,
|
||||
props,
|
||||
_owner: owner
|
||||
};
|
||||
null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
|
||||
enumerable: false,
|
||||
get: elementRefGetterWithDeprecationWarning
|
||||
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
||||
type._store = {};
|
||||
Object.defineProperty(type._store, "validated", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: 0
|
||||
});
|
||||
Object.defineProperty(type, "_debugInfo", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: null
|
||||
});
|
||||
Object.defineProperty(type, "_debugStack", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: debugStack
|
||||
});
|
||||
Object.defineProperty(type, "_debugTask", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: debugTask
|
||||
});
|
||||
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||
return type;
|
||||
}
|
||||
function cloneAndReplaceKey(oldElement, newKey) {
|
||||
newKey = ReactElement(
|
||||
oldElement.type,
|
||||
newKey,
|
||||
void 0,
|
||||
void 0,
|
||||
oldElement._owner,
|
||||
oldElement.props,
|
||||
oldElement._debugStack,
|
||||
oldElement._debugTask
|
||||
);
|
||||
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
||||
return newKey;
|
||||
}
|
||||
function isValidElement(object) {
|
||||
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
||||
}
|
||||
function escape(key) {
|
||||
var escaperLookup = { "=": "=0", ":": "=2" };
|
||||
return "$" + key.replace(/[=:]/g, function(match) {
|
||||
return escaperLookup[match];
|
||||
});
|
||||
}
|
||||
function getElementKey(element, index) {
|
||||
return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
||||
}
|
||||
function noop$1() {
|
||||
}
|
||||
function resolveThenable(thenable) {
|
||||
switch (thenable.status) {
|
||||
case "fulfilled":
|
||||
return thenable.value;
|
||||
case "rejected":
|
||||
throw thenable.reason;
|
||||
default:
|
||||
switch ("string" === typeof thenable.status ? thenable.then(noop$1, noop$1) : (thenable.status = "pending", thenable.then(
|
||||
function(fulfilledValue) {
|
||||
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
||||
},
|
||||
function(error) {
|
||||
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
||||
}
|
||||
)), thenable.status) {
|
||||
case "fulfilled":
|
||||
return thenable.value;
|
||||
case "rejected":
|
||||
throw thenable.reason;
|
||||
}
|
||||
}
|
||||
throw thenable;
|
||||
}
|
||||
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
||||
var type = typeof children;
|
||||
if ("undefined" === type || "boolean" === type) children = null;
|
||||
var invokeCallback = false;
|
||||
if (null === children) invokeCallback = true;
|
||||
else
|
||||
switch (type) {
|
||||
case "bigint":
|
||||
case "string":
|
||||
case "number":
|
||||
invokeCallback = true;
|
||||
break;
|
||||
case "object":
|
||||
switch (children.$$typeof) {
|
||||
case REACT_ELEMENT_TYPE:
|
||||
case REACT_PORTAL_TYPE:
|
||||
invokeCallback = true;
|
||||
break;
|
||||
case REACT_LAZY_TYPE:
|
||||
return invokeCallback = children._init, mapIntoArray(
|
||||
invokeCallback(children._payload),
|
||||
array,
|
||||
escapedPrefix,
|
||||
nameSoFar,
|
||||
callback
|
||||
);
|
||||
}
|
||||
}
|
||||
if (invokeCallback) {
|
||||
invokeCallback = children;
|
||||
callback = callback(invokeCallback);
|
||||
var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
||||
isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
||||
return c;
|
||||
})) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
|
||||
callback,
|
||||
escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
|
||||
userProvidedKeyEscapeRegex,
|
||||
"$&/"
|
||||
) + "/") + childKey
|
||||
), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
|
||||
return 1;
|
||||
}
|
||||
invokeCallback = 0;
|
||||
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
||||
if (isArrayImpl(children))
|
||||
for (var i = 0; i < children.length; i++)
|
||||
nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
||||
nameSoFar,
|
||||
array,
|
||||
escapedPrefix,
|
||||
type,
|
||||
callback
|
||||
);
|
||||
else if (i = getIteratorFn(children), "function" === typeof i)
|
||||
for (i === children.entries && (didWarnAboutMaps || console.warn(
|
||||
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
||||
), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
||||
nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
||||
nameSoFar,
|
||||
array,
|
||||
escapedPrefix,
|
||||
type,
|
||||
callback
|
||||
);
|
||||
else if ("object" === type) {
|
||||
if ("function" === typeof children.then)
|
||||
return mapIntoArray(
|
||||
resolveThenable(children),
|
||||
array,
|
||||
escapedPrefix,
|
||||
nameSoFar,
|
||||
callback
|
||||
);
|
||||
array = String(children);
|
||||
throw Error(
|
||||
"Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
|
||||
);
|
||||
}
|
||||
return invokeCallback;
|
||||
}
|
||||
function mapChildren(children, func, context) {
|
||||
if (null == children) return children;
|
||||
var result = [], count = 0;
|
||||
mapIntoArray(children, result, "", "", function(child) {
|
||||
return func.call(context, child, count++);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function lazyInitializer(payload) {
|
||||
if (-1 === payload._status) {
|
||||
var ctor = payload._result;
|
||||
ctor = ctor();
|
||||
ctor.then(
|
||||
function(moduleObject) {
|
||||
if (0 === payload._status || -1 === payload._status)
|
||||
payload._status = 1, payload._result = moduleObject;
|
||||
},
|
||||
function(error) {
|
||||
if (0 === payload._status || -1 === payload._status)
|
||||
payload._status = 2, payload._result = error;
|
||||
}
|
||||
);
|
||||
-1 === payload._status && (payload._status = 0, payload._result = ctor);
|
||||
}
|
||||
if (1 === payload._status)
|
||||
return ctor = payload._result, void 0 === ctor && console.error(
|
||||
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
|
||||
ctor
|
||||
), "default" in ctor || console.error(
|
||||
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
|
||||
ctor
|
||||
), ctor.default;
|
||||
throw payload._result;
|
||||
}
|
||||
function resolveDispatcher() {
|
||||
var dispatcher = ReactSharedInternals.H;
|
||||
null === dispatcher && console.error(
|
||||
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
||||
);
|
||||
return dispatcher;
|
||||
}
|
||||
function noop() {
|
||||
}
|
||||
function enqueueTask(task) {
|
||||
if (null === enqueueTaskImpl)
|
||||
try {
|
||||
var requireString = ("require" + Math.random()).slice(0, 7);
|
||||
enqueueTaskImpl = (module && module[requireString]).call(
|
||||
module,
|
||||
"timers"
|
||||
).setImmediate;
|
||||
} catch (_err) {
|
||||
enqueueTaskImpl = function(callback) {
|
||||
false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
|
||||
"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
|
||||
));
|
||||
var channel = new MessageChannel();
|
||||
channel.port1.onmessage = callback;
|
||||
channel.port2.postMessage(void 0);
|
||||
};
|
||||
}
|
||||
return enqueueTaskImpl(task);
|
||||
}
|
||||
function aggregateErrors(errors) {
|
||||
return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
|
||||
}
|
||||
function popActScope(prevActQueue, prevActScopeDepth) {
|
||||
prevActScopeDepth !== actScopeDepth - 1 && console.error(
|
||||
"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
|
||||
);
|
||||
actScopeDepth = prevActScopeDepth;
|
||||
}
|
||||
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
||||
var queue = ReactSharedInternals.actQueue;
|
||||
if (null !== queue)
|
||||
if (0 !== queue.length)
|
||||
try {
|
||||
flushActQueue(queue);
|
||||
enqueueTask(function() {
|
||||
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
||||
});
|
||||
return;
|
||||
} catch (error) {
|
||||
ReactSharedInternals.thrownErrors.push(error);
|
||||
}
|
||||
else ReactSharedInternals.actQueue = null;
|
||||
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
|
||||
}
|
||||
function flushActQueue(queue) {
|
||||
if (!isFlushing) {
|
||||
isFlushing = true;
|
||||
var i = 0;
|
||||
try {
|
||||
for (; i < queue.length; i++) {
|
||||
var callback = queue[i];
|
||||
do {
|
||||
ReactSharedInternals.didUsePromise = false;
|
||||
var continuation = callback(false);
|
||||
if (null !== continuation) {
|
||||
if (ReactSharedInternals.didUsePromise) {
|
||||
queue[i] = callback;
|
||||
queue.splice(0, i);
|
||||
return;
|
||||
}
|
||||
callback = continuation;
|
||||
} else break;
|
||||
} while (1);
|
||||
}
|
||||
queue.length = 0;
|
||||
} catch (error) {
|
||||
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
||||
} finally {
|
||||
isFlushing = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
||||
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||
Symbol.for("react.provider");
|
||||
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
||||
isMounted: function() {
|
||||
return false;
|
||||
},
|
||||
enqueueForceUpdate: function(publicInstance) {
|
||||
warnNoop(publicInstance, "forceUpdate");
|
||||
},
|
||||
enqueueReplaceState: function(publicInstance) {
|
||||
warnNoop(publicInstance, "replaceState");
|
||||
},
|
||||
enqueueSetState: function(publicInstance) {
|
||||
warnNoop(publicInstance, "setState");
|
||||
}
|
||||
}, assign = Object.assign, emptyObject = {};
|
||||
Object.freeze(emptyObject);
|
||||
Component.prototype.isReactComponent = {};
|
||||
Component.prototype.setState = function(partialState, callback) {
|
||||
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
||||
throw Error(
|
||||
"takes an object of state variables to update or a function which returns an object of state variables."
|
||||
);
|
||||
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
||||
};
|
||||
Component.prototype.forceUpdate = function(callback) {
|
||||
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
||||
};
|
||||
var deprecatedAPIs = {
|
||||
isMounted: [
|
||||
"isMounted",
|
||||
"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
|
||||
],
|
||||
replaceState: [
|
||||
"replaceState",
|
||||
"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
|
||||
]
|
||||
}, fnName;
|
||||
for (fnName in deprecatedAPIs)
|
||||
deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
||||
ComponentDummy.prototype = Component.prototype;
|
||||
deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
|
||||
deprecatedAPIs.constructor = PureComponent;
|
||||
assign(deprecatedAPIs, Component.prototype);
|
||||
deprecatedAPIs.isPureReactComponent = true;
|
||||
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
|
||||
H: null,
|
||||
A: null,
|
||||
T: null,
|
||||
S: null,
|
||||
V: null,
|
||||
actQueue: null,
|
||||
isBatchingLegacy: false,
|
||||
didScheduleLegacyUpdate: false,
|
||||
didUsePromise: false,
|
||||
thrownErrors: [],
|
||||
getCurrentStack: null,
|
||||
recentlyCreatedOwnerStacks: 0
|
||||
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
||||
return null;
|
||||
};
|
||||
deprecatedAPIs = {
|
||||
"react-stack-bottom-frame": function(callStackForError) {
|
||||
return callStackForError();
|
||||
}
|
||||
};
|
||||
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
||||
var didWarnAboutElementRef = {};
|
||||
var unknownOwnerDebugStack = deprecatedAPIs["react-stack-bottom-frame"].bind(deprecatedAPIs, UnknownOwner)();
|
||||
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||
var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
||||
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
||||
var event = new window.ErrorEvent("error", {
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
||||
error
|
||||
});
|
||||
if (!window.dispatchEvent(event)) return;
|
||||
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
||||
process.emit("uncaughtException", error);
|
||||
return;
|
||||
}
|
||||
console.error(error);
|
||||
}, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
|
||||
queueMicrotask(function() {
|
||||
return queueMicrotask(callback);
|
||||
});
|
||||
} : enqueueTask;
|
||||
deprecatedAPIs = Object.freeze({
|
||||
__proto__: null,
|
||||
c: function(size) {
|
||||
return resolveDispatcher().useMemoCache(size);
|
||||
}
|
||||
});
|
||||
exports.Children = {
|
||||
map: mapChildren,
|
||||
forEach: function(children, forEachFunc, forEachContext) {
|
||||
mapChildren(
|
||||
children,
|
||||
function() {
|
||||
forEachFunc.apply(this, arguments);
|
||||
},
|
||||
forEachContext
|
||||
);
|
||||
},
|
||||
count: function(children) {
|
||||
var n = 0;
|
||||
mapChildren(children, function() {
|
||||
n++;
|
||||
});
|
||||
return n;
|
||||
},
|
||||
toArray: function(children) {
|
||||
return mapChildren(children, function(child) {
|
||||
return child;
|
||||
}) || [];
|
||||
},
|
||||
only: function(children) {
|
||||
if (!isValidElement(children))
|
||||
throw Error(
|
||||
"React.Children.only expected to receive a single React element child."
|
||||
);
|
||||
return children;
|
||||
}
|
||||
};
|
||||
exports.Component = Component;
|
||||
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||
exports.Profiler = REACT_PROFILER_TYPE;
|
||||
exports.PureComponent = PureComponent;
|
||||
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
||||
exports.Suspense = REACT_SUSPENSE_TYPE;
|
||||
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
||||
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
||||
exports.act = function(callback) {
|
||||
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
||||
actScopeDepth++;
|
||||
var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
|
||||
try {
|
||||
var result = callback();
|
||||
} catch (error) {
|
||||
ReactSharedInternals.thrownErrors.push(error);
|
||||
}
|
||||
if (0 < ReactSharedInternals.thrownErrors.length)
|
||||
throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
||||
if (null !== result && "object" === typeof result && "function" === typeof result.then) {
|
||||
var thenable = result;
|
||||
queueSeveralMicrotasks(function() {
|
||||
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
||||
"You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
|
||||
));
|
||||
});
|
||||
return {
|
||||
then: function(resolve, reject) {
|
||||
didAwaitActCall = true;
|
||||
thenable.then(
|
||||
function(returnValue) {
|
||||
popActScope(prevActQueue, prevActScopeDepth);
|
||||
if (0 === prevActScopeDepth) {
|
||||
try {
|
||||
flushActQueue(queue), enqueueTask(function() {
|
||||
return recursivelyFlushAsyncActWork(
|
||||
returnValue,
|
||||
resolve,
|
||||
reject
|
||||
);
|
||||
});
|
||||
} catch (error$0) {
|
||||
ReactSharedInternals.thrownErrors.push(error$0);
|
||||
}
|
||||
if (0 < ReactSharedInternals.thrownErrors.length) {
|
||||
var _thrownError = aggregateErrors(
|
||||
ReactSharedInternals.thrownErrors
|
||||
);
|
||||
ReactSharedInternals.thrownErrors.length = 0;
|
||||
reject(_thrownError);
|
||||
}
|
||||
} else resolve(returnValue);
|
||||
},
|
||||
function(error) {
|
||||
popActScope(prevActQueue, prevActScopeDepth);
|
||||
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
|
||||
ReactSharedInternals.thrownErrors
|
||||
), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
var returnValue$jscomp$0 = result;
|
||||
popActScope(prevActQueue, prevActScopeDepth);
|
||||
0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
|
||||
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
||||
"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
|
||||
));
|
||||
}), ReactSharedInternals.actQueue = null);
|
||||
if (0 < ReactSharedInternals.thrownErrors.length)
|
||||
throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
||||
return {
|
||||
then: function(resolve, reject) {
|
||||
didAwaitActCall = true;
|
||||
0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
||||
return recursivelyFlushAsyncActWork(
|
||||
returnValue$jscomp$0,
|
||||
resolve,
|
||||
reject
|
||||
);
|
||||
})) : resolve(returnValue$jscomp$0);
|
||||
}
|
||||
};
|
||||
};
|
||||
exports.cache = function(fn) {
|
||||
return function() {
|
||||
return fn.apply(null, arguments);
|
||||
};
|
||||
};
|
||||
exports.captureOwnerStack = function() {
|
||||
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
||||
return null === getCurrentStack ? null : getCurrentStack();
|
||||
};
|
||||
exports.cloneElement = function(element, config, children) {
|
||||
if (null === element || void 0 === element)
|
||||
throw Error(
|
||||
"The argument must be a React element, but you passed " + element + "."
|
||||
);
|
||||
var props = assign({}, element.props), key = element.key, owner = element._owner;
|
||||
if (null != config) {
|
||||
var JSCompiler_inline_result;
|
||||
a: {
|
||||
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
|
||||
config,
|
||||
"ref"
|
||||
).get) && JSCompiler_inline_result.isReactWarning) {
|
||||
JSCompiler_inline_result = false;
|
||||
break a;
|
||||
}
|
||||
JSCompiler_inline_result = void 0 !== config.ref;
|
||||
}
|
||||
JSCompiler_inline_result && (owner = getOwner());
|
||||
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
||||
for (propName in config)
|
||||
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
||||
}
|
||||
var propName = arguments.length - 2;
|
||||
if (1 === propName) props.children = children;
|
||||
else if (1 < propName) {
|
||||
JSCompiler_inline_result = Array(propName);
|
||||
for (var i = 0; i < propName; i++)
|
||||
JSCompiler_inline_result[i] = arguments[i + 2];
|
||||
props.children = JSCompiler_inline_result;
|
||||
}
|
||||
props = ReactElement(
|
||||
element.type,
|
||||
key,
|
||||
void 0,
|
||||
void 0,
|
||||
owner,
|
||||
props,
|
||||
element._debugStack,
|
||||
element._debugTask
|
||||
);
|
||||
for (key = 2; key < arguments.length; key++)
|
||||
owner = arguments[key], isValidElement(owner) && owner._store && (owner._store.validated = 1);
|
||||
return props;
|
||||
};
|
||||
exports.createContext = function(defaultValue) {
|
||||
defaultValue = {
|
||||
$$typeof: REACT_CONTEXT_TYPE,
|
||||
_currentValue: defaultValue,
|
||||
_currentValue2: defaultValue,
|
||||
_threadCount: 0,
|
||||
Provider: null,
|
||||
Consumer: null
|
||||
};
|
||||
defaultValue.Provider = defaultValue;
|
||||
defaultValue.Consumer = {
|
||||
$$typeof: REACT_CONSUMER_TYPE,
|
||||
_context: defaultValue
|
||||
};
|
||||
defaultValue._currentRenderer = null;
|
||||
defaultValue._currentRenderer2 = null;
|
||||
return defaultValue;
|
||||
};
|
||||
exports.createElement = function(type, config, children) {
|
||||
for (var i = 2; i < arguments.length; i++) {
|
||||
var node = arguments[i];
|
||||
isValidElement(node) && node._store && (node._store.validated = 1);
|
||||
}
|
||||
i = {};
|
||||
node = null;
|
||||
if (null != config)
|
||||
for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
|
||||
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
|
||||
)), hasValidKey(config) && (checkKeyStringCoercion(config.key), node = "" + config.key), config)
|
||||
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
|
||||
var childrenLength = arguments.length - 2;
|
||||
if (1 === childrenLength) i.children = children;
|
||||
else if (1 < childrenLength) {
|
||||
for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
|
||||
childArray[_i] = arguments[_i + 2];
|
||||
Object.freeze && Object.freeze(childArray);
|
||||
i.children = childArray;
|
||||
}
|
||||
if (type && type.defaultProps)
|
||||
for (propName in childrenLength = type.defaultProps, childrenLength)
|
||||
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
||||
node && defineKeyPropWarningGetter(
|
||||
i,
|
||||
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
||||
);
|
||||
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||
return ReactElement(
|
||||
type,
|
||||
node,
|
||||
void 0,
|
||||
void 0,
|
||||
getOwner(),
|
||||
i,
|
||||
propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||
propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||
);
|
||||
};
|
||||
exports.createRef = function() {
|
||||
var refObject = { current: null };
|
||||
Object.seal(refObject);
|
||||
return refObject;
|
||||
};
|
||||
exports.forwardRef = function(render) {
|
||||
null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
|
||||
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
||||
) : "function" !== typeof render ? console.error(
|
||||
"forwardRef requires a render function but was given %s.",
|
||||
null === render ? "null" : typeof render
|
||||
) : 0 !== render.length && 2 !== render.length && console.error(
|
||||
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
||||
1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
|
||||
);
|
||||
null != render && null != render.defaultProps && console.error(
|
||||
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
||||
);
|
||||
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
|
||||
Object.defineProperty(elementType, "displayName", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
get: function() {
|
||||
return ownName;
|
||||
},
|
||||
set: function(name) {
|
||||
ownName = name;
|
||||
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
||||
}
|
||||
});
|
||||
return elementType;
|
||||
};
|
||||
exports.isValidElement = isValidElement;
|
||||
exports.lazy = function(ctor) {
|
||||
return {
|
||||
$$typeof: REACT_LAZY_TYPE,
|
||||
_payload: { _status: -1, _result: ctor },
|
||||
_init: lazyInitializer
|
||||
};
|
||||
};
|
||||
exports.memo = function(type, compare) {
|
||||
null == type && console.error(
|
||||
"memo: The first argument must be a component. Instead received: %s",
|
||||
null === type ? "null" : typeof type
|
||||
);
|
||||
compare = {
|
||||
$$typeof: REACT_MEMO_TYPE,
|
||||
type,
|
||||
compare: void 0 === compare ? null : compare
|
||||
};
|
||||
var ownName;
|
||||
Object.defineProperty(compare, "displayName", {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
get: function() {
|
||||
return ownName;
|
||||
},
|
||||
set: function(name) {
|
||||
ownName = name;
|
||||
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
||||
}
|
||||
});
|
||||
return compare;
|
||||
};
|
||||
exports.startTransition = function(scope) {
|
||||
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
||||
ReactSharedInternals.T = currentTransition;
|
||||
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
||||
try {
|
||||
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
||||
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
||||
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop, reportGlobalError);
|
||||
} catch (error) {
|
||||
reportGlobalError(error);
|
||||
} finally {
|
||||
null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
|
||||
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
|
||||
)), ReactSharedInternals.T = prevTransition;
|
||||
}
|
||||
};
|
||||
exports.unstable_useCacheRefresh = function() {
|
||||
return resolveDispatcher().useCacheRefresh();
|
||||
};
|
||||
exports.use = function(usable) {
|
||||
return resolveDispatcher().use(usable);
|
||||
};
|
||||
exports.useActionState = function(action, initialState, permalink) {
|
||||
return resolveDispatcher().useActionState(
|
||||
action,
|
||||
initialState,
|
||||
permalink
|
||||
);
|
||||
};
|
||||
exports.useCallback = function(callback, deps) {
|
||||
return resolveDispatcher().useCallback(callback, deps);
|
||||
};
|
||||
exports.useContext = function(Context) {
|
||||
var dispatcher = resolveDispatcher();
|
||||
Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
|
||||
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
|
||||
);
|
||||
return dispatcher.useContext(Context);
|
||||
};
|
||||
exports.useDebugValue = function(value, formatterFn) {
|
||||
return resolveDispatcher().useDebugValue(value, formatterFn);
|
||||
};
|
||||
exports.useDeferredValue = function(value, initialValue) {
|
||||
return resolveDispatcher().useDeferredValue(value, initialValue);
|
||||
};
|
||||
exports.useEffect = function(create, createDeps, update) {
|
||||
null == create && console.warn(
|
||||
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
||||
);
|
||||
var dispatcher = resolveDispatcher();
|
||||
if ("function" === typeof update)
|
||||
throw Error(
|
||||
"useEffect CRUD overload is not enabled in this build of React."
|
||||
);
|
||||
return dispatcher.useEffect(create, createDeps);
|
||||
};
|
||||
exports.useId = function() {
|
||||
return resolveDispatcher().useId();
|
||||
};
|
||||
exports.useImperativeHandle = function(ref, create, deps) {
|
||||
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
||||
};
|
||||
exports.useInsertionEffect = function(create, deps) {
|
||||
null == create && console.warn(
|
||||
"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
||||
);
|
||||
return resolveDispatcher().useInsertionEffect(create, deps);
|
||||
};
|
||||
exports.useLayoutEffect = function(create, deps) {
|
||||
null == create && console.warn(
|
||||
"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
||||
);
|
||||
return resolveDispatcher().useLayoutEffect(create, deps);
|
||||
};
|
||||
exports.useMemo = function(create, deps) {
|
||||
return resolveDispatcher().useMemo(create, deps);
|
||||
};
|
||||
exports.useOptimistic = function(passthrough, reducer) {
|
||||
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
||||
};
|
||||
exports.useReducer = function(reducer, initialArg, init) {
|
||||
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
||||
};
|
||||
exports.useRef = function(initialValue) {
|
||||
return resolveDispatcher().useRef(initialValue);
|
||||
};
|
||||
exports.useState = function(initialState) {
|
||||
return resolveDispatcher().useState(initialState);
|
||||
};
|
||||
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
||||
return resolveDispatcher().useSyncExternalStore(
|
||||
subscribe,
|
||||
getSnapshot,
|
||||
getServerSnapshot
|
||||
);
|
||||
};
|
||||
exports.useTransition = function() {
|
||||
return resolveDispatcher().useTransition();
|
||||
};
|
||||
exports.version = "19.1.0";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/react/index.js
|
||||
var require_react = __commonJS({
|
||||
"node_modules/react/index.js"(exports, module) {
|
||||
if (false) {
|
||||
module.exports = null;
|
||||
} else {
|
||||
module.exports = require_react_development();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export {
|
||||
require_react
|
||||
};
|
||||
/*! Bundled license information:
|
||||
|
||||
react/cjs/react.development.js:
|
||||
(**
|
||||
* @license React
|
||||
* react.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
*/
|
||||
//# sourceMappingURL=chunk-UGC3UZ7L.js.map
|
||||
7
MyWebSite/node_modules/.vite/deps/chunk-UGC3UZ7L.js.map
generated
vendored
Normal file
11014
MyWebSite/node_modules/.vite/deps/react-bootstrap.js
generated
vendored
Normal file
7
MyWebSite/node_modules/.vite/deps/react-bootstrap.js.map
generated
vendored
Normal file
6
MyWebSite/node_modules/.vite/deps/react-dom.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import {
|
||||
require_react_dom
|
||||
} from "./chunk-HE4GKDYE.js";
|
||||
import "./chunk-UGC3UZ7L.js";
|
||||
import "./chunk-G3PMV62Z.js";
|
||||
export default require_react_dom();
|
||||
7
MyWebSite/node_modules/.vite/deps/react-dom.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
18100
MyWebSite/node_modules/.vite/deps/react-dom_client.js
generated
vendored
Normal file
7
MyWebSite/node_modules/.vite/deps/react-dom_client.js.map
generated
vendored
Normal file
6685
MyWebSite/node_modules/.vite/deps/react-icons_bi.js
generated
vendored
Normal file
7
MyWebSite/node_modules/.vite/deps/react-icons_bi.js.map
generated
vendored
Normal file
12117
MyWebSite/node_modules/.vite/deps/react-router-dom.js
generated
vendored
Normal file
7
MyWebSite/node_modules/.vite/deps/react-router-dom.js.map
generated
vendored
Normal file
5
MyWebSite/node_modules/.vite/deps/react.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-UGC3UZ7L.js";
|
||||
import "./chunk-G3PMV62Z.js";
|
||||
export default require_react();
|
||||
7
MyWebSite/node_modules/.vite/deps/react.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
281
MyWebSite/node_modules/.vite/deps/react_jsx-dev-runtime.js
generated
vendored
Normal file
@@ -0,0 +1,281 @@
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-UGC3UZ7L.js";
|
||||
import {
|
||||
__commonJS
|
||||
} from "./chunk-G3PMV62Z.js";
|
||||
|
||||
// node_modules/react/cjs/react-jsx-dev-runtime.development.js
|
||||
var require_react_jsx_dev_runtime_development = __commonJS({
|
||||
"node_modules/react/cjs/react-jsx-dev-runtime.development.js"(exports) {
|
||||
"use strict";
|
||||
(function() {
|
||||
function getComponentNameFromType(type) {
|
||||
if (null == type) return null;
|
||||
if ("function" === typeof type)
|
||||
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
||||
if ("string" === typeof type) return type;
|
||||
switch (type) {
|
||||
case REACT_FRAGMENT_TYPE:
|
||||
return "Fragment";
|
||||
case REACT_PROFILER_TYPE:
|
||||
return "Profiler";
|
||||
case REACT_STRICT_MODE_TYPE:
|
||||
return "StrictMode";
|
||||
case REACT_SUSPENSE_TYPE:
|
||||
return "Suspense";
|
||||
case REACT_SUSPENSE_LIST_TYPE:
|
||||
return "SuspenseList";
|
||||
case REACT_ACTIVITY_TYPE:
|
||||
return "Activity";
|
||||
}
|
||||
if ("object" === typeof type)
|
||||
switch ("number" === typeof type.tag && console.error(
|
||||
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
||||
), type.$$typeof) {
|
||||
case REACT_PORTAL_TYPE:
|
||||
return "Portal";
|
||||
case REACT_CONTEXT_TYPE:
|
||||
return (type.displayName || "Context") + ".Provider";
|
||||
case REACT_CONSUMER_TYPE:
|
||||
return (type._context.displayName || "Context") + ".Consumer";
|
||||
case REACT_FORWARD_REF_TYPE:
|
||||
var innerType = type.render;
|
||||
type = type.displayName;
|
||||
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
||||
return type;
|
||||
case REACT_MEMO_TYPE:
|
||||
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
||||
case REACT_LAZY_TYPE:
|
||||
innerType = type._payload;
|
||||
type = type._init;
|
||||
try {
|
||||
return getComponentNameFromType(type(innerType));
|
||||
} catch (x) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function testStringCoercion(value) {
|
||||
return "" + value;
|
||||
}
|
||||
function checkKeyStringCoercion(value) {
|
||||
try {
|
||||
testStringCoercion(value);
|
||||
var JSCompiler_inline_result = false;
|
||||
} catch (e) {
|
||||
JSCompiler_inline_result = true;
|
||||
}
|
||||
if (JSCompiler_inline_result) {
|
||||
JSCompiler_inline_result = console;
|
||||
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
||||
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
||||
JSCompiler_temp_const.call(
|
||||
JSCompiler_inline_result,
|
||||
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
||||
JSCompiler_inline_result$jscomp$0
|
||||
);
|
||||
return testStringCoercion(value);
|
||||
}
|
||||
}
|
||||
function getTaskName(type) {
|
||||
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
||||
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
||||
return "<...>";
|
||||
try {
|
||||
var name = getComponentNameFromType(type);
|
||||
return name ? "<" + name + ">" : "<...>";
|
||||
} catch (x) {
|
||||
return "<...>";
|
||||
}
|
||||
}
|
||||
function getOwner() {
|
||||
var dispatcher = ReactSharedInternals.A;
|
||||
return null === dispatcher ? null : dispatcher.getOwner();
|
||||
}
|
||||
function UnknownOwner() {
|
||||
return Error("react-stack-top-frame");
|
||||
}
|
||||
function hasValidKey(config) {
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
||||
if (getter && getter.isReactWarning) return false;
|
||||
}
|
||||
return void 0 !== config.key;
|
||||
}
|
||||
function defineKeyPropWarningGetter(props, displayName) {
|
||||
function warnAboutAccessingKey() {
|
||||
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
||||
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
||||
displayName
|
||||
));
|
||||
}
|
||||
warnAboutAccessingKey.isReactWarning = true;
|
||||
Object.defineProperty(props, "key", {
|
||||
get: warnAboutAccessingKey,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
function elementRefGetterWithDeprecationWarning() {
|
||||
var componentName = getComponentNameFromType(this.type);
|
||||
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
||||
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
||||
));
|
||||
componentName = this.props.ref;
|
||||
return void 0 !== componentName ? componentName : null;
|
||||
}
|
||||
function ReactElement(type, key, self, source, owner, props, debugStack, debugTask) {
|
||||
self = props.ref;
|
||||
type = {
|
||||
$$typeof: REACT_ELEMENT_TYPE,
|
||||
type,
|
||||
key,
|
||||
props,
|
||||
_owner: owner
|
||||
};
|
||||
null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
|
||||
enumerable: false,
|
||||
get: elementRefGetterWithDeprecationWarning
|
||||
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
||||
type._store = {};
|
||||
Object.defineProperty(type._store, "validated", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: 0
|
||||
});
|
||||
Object.defineProperty(type, "_debugInfo", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: null
|
||||
});
|
||||
Object.defineProperty(type, "_debugStack", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: debugStack
|
||||
});
|
||||
Object.defineProperty(type, "_debugTask", {
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
value: debugTask
|
||||
});
|
||||
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
||||
return type;
|
||||
}
|
||||
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self, debugStack, debugTask) {
|
||||
var children = config.children;
|
||||
if (void 0 !== children)
|
||||
if (isStaticChildren)
|
||||
if (isArrayImpl(children)) {
|
||||
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
||||
validateChildKeys(children[isStaticChildren]);
|
||||
Object.freeze && Object.freeze(children);
|
||||
} else
|
||||
console.error(
|
||||
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
||||
);
|
||||
else validateChildKeys(children);
|
||||
if (hasOwnProperty.call(config, "key")) {
|
||||
children = getComponentNameFromType(type);
|
||||
var keys = Object.keys(config).filter(function(k) {
|
||||
return "key" !== k;
|
||||
});
|
||||
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
||||
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
||||
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
||||
isStaticChildren,
|
||||
children,
|
||||
keys,
|
||||
children
|
||||
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
||||
}
|
||||
children = null;
|
||||
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
||||
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
||||
if ("key" in config) {
|
||||
maybeKey = {};
|
||||
for (var propName in config)
|
||||
"key" !== propName && (maybeKey[propName] = config[propName]);
|
||||
} else maybeKey = config;
|
||||
children && defineKeyPropWarningGetter(
|
||||
maybeKey,
|
||||
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
||||
);
|
||||
return ReactElement(
|
||||
type,
|
||||
children,
|
||||
self,
|
||||
source,
|
||||
getOwner(),
|
||||
maybeKey,
|
||||
debugStack,
|
||||
debugTask
|
||||
);
|
||||
}
|
||||
function validateChildKeys(node) {
|
||||
"object" === typeof node && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
|
||||
}
|
||||
var React = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
||||
Symbol.for("react.provider");
|
||||
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
||||
return null;
|
||||
};
|
||||
React = {
|
||||
"react-stack-bottom-frame": function(callStackForError) {
|
||||
return callStackForError();
|
||||
}
|
||||
};
|
||||
var specialPropKeyWarningShown;
|
||||
var didWarnAboutElementRef = {};
|
||||
var unknownOwnerDebugStack = React["react-stack-bottom-frame"].bind(
|
||||
React,
|
||||
UnknownOwner
|
||||
)();
|
||||
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
||||
var didWarnAboutKeySpread = {};
|
||||
exports.Fragment = REACT_FRAGMENT_TYPE;
|
||||
exports.jsxDEV = function(type, config, maybeKey, isStaticChildren, source, self) {
|
||||
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
||||
return jsxDEVImpl(
|
||||
type,
|
||||
config,
|
||||
maybeKey,
|
||||
isStaticChildren,
|
||||
source,
|
||||
self,
|
||||
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
||||
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
||||
);
|
||||
};
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/react/jsx-dev-runtime.js
|
||||
var require_jsx_dev_runtime = __commonJS({
|
||||
"node_modules/react/jsx-dev-runtime.js"(exports, module) {
|
||||
if (false) {
|
||||
module.exports = null;
|
||||
} else {
|
||||
module.exports = require_react_jsx_dev_runtime_development();
|
||||
}
|
||||
}
|
||||
});
|
||||
export default require_jsx_dev_runtime();
|
||||
/*! Bundled license information:
|
||||
|
||||
react/cjs/react-jsx-dev-runtime.development.js:
|
||||
(**
|
||||
* @license React
|
||||
* react-jsx-dev-runtime.development.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
*/
|
||||
//# sourceMappingURL=react_jsx-dev-runtime.js.map
|
||||
7
MyWebSite/node_modules/.vite/deps/react_jsx-dev-runtime.js.map
generated
vendored
Normal file
6
MyWebSite/node_modules/.vite/deps/react_jsx-runtime.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import {
|
||||
require_jsx_runtime
|
||||
} from "./chunk-MJNCUEZK.js";
|
||||
import "./chunk-UGC3UZ7L.js";
|
||||
import "./chunk-G3PMV62Z.js";
|
||||
export default require_jsx_runtime();
|
||||
7
MyWebSite/node_modules/.vite/deps/react_jsx-runtime.js.map
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
202
MyWebSite/node_modules/@ampproject/remapping/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
218
MyWebSite/node_modules/@ampproject/remapping/README.md
generated
vendored
Normal file
@@ -0,0 +1,218 @@
|
||||
# @ampproject/remapping
|
||||
|
||||
> Remap sequential sourcemaps through transformations to point at the original source code
|
||||
|
||||
Remapping allows you to take the sourcemaps generated through transforming your code and "remap"
|
||||
them to the original source locations. Think "my minified code, transformed with babel and bundled
|
||||
with webpack", all pointing to the correct location in your original source code.
|
||||
|
||||
With remapping, none of your source code transformations need to be aware of the input's sourcemap,
|
||||
they only need to generate an output sourcemap. This greatly simplifies building custom
|
||||
transformations (think a find-and-replace).
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @ampproject/remapping
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```typescript
|
||||
function remapping(
|
||||
map: SourceMap | SourceMap[],
|
||||
loader: (file: string, ctx: LoaderContext) => (SourceMap | null | undefined),
|
||||
options?: { excludeContent: boolean, decodedMappings: boolean }
|
||||
): SourceMap;
|
||||
|
||||
// LoaderContext gives the loader the importing sourcemap, tree depth, the ability to override the
|
||||
// "source" location (where child sources are resolved relative to, or the location of original
|
||||
// source), and the ability to override the "content" of an original source for inclusion in the
|
||||
// output sourcemap.
|
||||
type LoaderContext = {
|
||||
readonly importer: string;
|
||||
readonly depth: number;
|
||||
source: string;
|
||||
content: string | null | undefined;
|
||||
}
|
||||
```
|
||||
|
||||
`remapping` takes the final output sourcemap, and a `loader` function. For every source file pointer
|
||||
in the sourcemap, the `loader` will be called with the resolved path. If the path itself represents
|
||||
a transformed file (it has a sourcmap associated with it), then the `loader` should return that
|
||||
sourcemap. If not, the path will be treated as an original, untransformed source code.
|
||||
|
||||
```js
|
||||
// Babel transformed "helloworld.js" into "transformed.js"
|
||||
const transformedMap = JSON.stringify({
|
||||
file: 'transformed.js',
|
||||
// 1st column of 2nd line of output file translates into the 1st source
|
||||
// file, line 3, column 2
|
||||
mappings: ';CAEE',
|
||||
sources: ['helloworld.js'],
|
||||
version: 3,
|
||||
});
|
||||
|
||||
// Uglify minified "transformed.js" into "transformed.min.js"
|
||||
const minifiedTransformedMap = JSON.stringify({
|
||||
file: 'transformed.min.js',
|
||||
// 0th column of 1st line of output file translates into the 1st source
|
||||
// file, line 2, column 1.
|
||||
mappings: 'AACC',
|
||||
names: [],
|
||||
sources: ['transformed.js'],
|
||||
version: 3,
|
||||
});
|
||||
|
||||
const remapped = remapping(
|
||||
minifiedTransformedMap,
|
||||
(file, ctx) => {
|
||||
|
||||
// The "transformed.js" file is an transformed file.
|
||||
if (file === 'transformed.js') {
|
||||
// The root importer is empty.
|
||||
console.assert(ctx.importer === '');
|
||||
// The depth in the sourcemap tree we're currently loading.
|
||||
// The root `minifiedTransformedMap` is depth 0, and its source children are depth 1, etc.
|
||||
console.assert(ctx.depth === 1);
|
||||
|
||||
return transformedMap;
|
||||
}
|
||||
|
||||
// Loader will be called to load transformedMap's source file pointers as well.
|
||||
console.assert(file === 'helloworld.js');
|
||||
// `transformed.js`'s sourcemap points into `helloworld.js`.
|
||||
console.assert(ctx.importer === 'transformed.js');
|
||||
// This is a source child of `transformed`, which is a source child of `minifiedTransformedMap`.
|
||||
console.assert(ctx.depth === 2);
|
||||
return null;
|
||||
}
|
||||
);
|
||||
|
||||
console.log(remapped);
|
||||
// {
|
||||
// file: 'transpiled.min.js',
|
||||
// mappings: 'AAEE',
|
||||
// sources: ['helloworld.js'],
|
||||
// version: 3,
|
||||
// };
|
||||
```
|
||||
|
||||
In this example, `loader` will be called twice:
|
||||
|
||||
1. `"transformed.js"`, the first source file pointer in the `minifiedTransformedMap`. We return the
|
||||
associated sourcemap for it (its a transformed file, after all) so that sourcemap locations can
|
||||
be traced through it into the source files it represents.
|
||||
2. `"helloworld.js"`, our original, unmodified source code. This file does not have a sourcemap, so
|
||||
we return `null`.
|
||||
|
||||
The `remapped` sourcemap now points from `transformed.min.js` into locations in `helloworld.js`. If
|
||||
you were to read the `mappings`, it says "0th column of the first line output line points to the 1st
|
||||
column of the 2nd line of the file `helloworld.js`".
|
||||
|
||||
### Multiple transformations of a file
|
||||
|
||||
As a convenience, if you have multiple single-source transformations of a file, you may pass an
|
||||
array of sourcemap files in the order of most-recent transformation sourcemap first. Note that this
|
||||
changes the `importer` and `depth` of each call to our loader. So our above example could have been
|
||||
written as:
|
||||
|
||||
```js
|
||||
const remapped = remapping(
|
||||
[minifiedTransformedMap, transformedMap],
|
||||
() => null
|
||||
);
|
||||
|
||||
console.log(remapped);
|
||||
// {
|
||||
// file: 'transpiled.min.js',
|
||||
// mappings: 'AAEE',
|
||||
// sources: ['helloworld.js'],
|
||||
// version: 3,
|
||||
// };
|
||||
```
|
||||
|
||||
### Advanced control of the loading graph
|
||||
|
||||
#### `source`
|
||||
|
||||
The `source` property can overridden to any value to change the location of the current load. Eg,
|
||||
for an original source file, it allows us to change the location to the original source regardless
|
||||
of what the sourcemap source entry says. And for transformed files, it allows us to change the
|
||||
relative resolving location for child sources of the loaded sourcemap.
|
||||
|
||||
```js
|
||||
const remapped = remapping(
|
||||
minifiedTransformedMap,
|
||||
(file, ctx) => {
|
||||
|
||||
if (file === 'transformed.js') {
|
||||
// We pretend the transformed.js file actually exists in the 'src/' directory. When the nested
|
||||
// source files are loaded, they will now be relative to `src/`.
|
||||
ctx.source = 'src/transformed.js';
|
||||
return transformedMap;
|
||||
}
|
||||
|
||||
console.assert(file === 'src/helloworld.js');
|
||||
// We could futher change the source of this original file, eg, to be inside a nested directory
|
||||
// itself. This will be reflected in the remapped sourcemap.
|
||||
ctx.source = 'src/nested/transformed.js';
|
||||
return null;
|
||||
}
|
||||
);
|
||||
|
||||
console.log(remapped);
|
||||
// {
|
||||
// …,
|
||||
// sources: ['src/nested/helloworld.js'],
|
||||
// };
|
||||
```
|
||||
|
||||
|
||||
#### `content`
|
||||
|
||||
The `content` property can be overridden when we encounter an original source file. Eg, this allows
|
||||
you to manually provide the source content of the original file regardless of whether the
|
||||
`sourcesContent` field is present in the parent sourcemap. It can also be set to `null` to remove
|
||||
the source content.
|
||||
|
||||
```js
|
||||
const remapped = remapping(
|
||||
minifiedTransformedMap,
|
||||
(file, ctx) => {
|
||||
|
||||
if (file === 'transformed.js') {
|
||||
// transformedMap does not include a `sourcesContent` field, so usually the remapped sourcemap
|
||||
// would not include any `sourcesContent` values.
|
||||
return transformedMap;
|
||||
}
|
||||
|
||||
console.assert(file === 'helloworld.js');
|
||||
// We can read the file to provide the source content.
|
||||
ctx.content = fs.readFileSync(file, 'utf8');
|
||||
return null;
|
||||
}
|
||||
);
|
||||
|
||||
console.log(remapped);
|
||||
// {
|
||||
// …,
|
||||
// sourcesContent: [
|
||||
// 'console.log("Hello world!")',
|
||||
// ],
|
||||
// };
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
#### excludeContent
|
||||
|
||||
By default, `excludeContent` is `false`. Passing `{ excludeContent: true }` will exclude the
|
||||
`sourcesContent` field from the returned sourcemap. This is mainly useful when you want to reduce
|
||||
the size out the sourcemap.
|
||||
|
||||
#### decodedMappings
|
||||
|
||||
By default, `decodedMappings` is `false`. Passing `{ decodedMappings: true }` will leave the
|
||||
`mappings` field in a [decoded state](https://github.com/rich-harris/sourcemap-codec) instead of
|
||||
encoding into a VLQ string.
|
||||
197
MyWebSite/node_modules/@ampproject/remapping/dist/remapping.mjs
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
import { decodedMappings, traceSegment, TraceMap } from '@jridgewell/trace-mapping';
|
||||
import { GenMapping, maybeAddSegment, setSourceContent, setIgnore, toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping';
|
||||
|
||||
const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false);
|
||||
const EMPTY_SOURCES = [];
|
||||
function SegmentObject(source, line, column, name, content, ignore) {
|
||||
return { source, line, column, name, content, ignore };
|
||||
}
|
||||
function Source(map, sources, source, content, ignore) {
|
||||
return {
|
||||
map,
|
||||
sources,
|
||||
source,
|
||||
content,
|
||||
ignore,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes
|
||||
* (which may themselves be SourceMapTrees).
|
||||
*/
|
||||
function MapSource(map, sources) {
|
||||
return Source(map, sources, '', null, false);
|
||||
}
|
||||
/**
|
||||
* A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive
|
||||
* segment tracing ends at the `OriginalSource`.
|
||||
*/
|
||||
function OriginalSource(source, content, ignore) {
|
||||
return Source(null, EMPTY_SOURCES, source, content, ignore);
|
||||
}
|
||||
/**
|
||||
* traceMappings is only called on the root level SourceMapTree, and begins the process of
|
||||
* resolving each mapping in terms of the original source files.
|
||||
*/
|
||||
function traceMappings(tree) {
|
||||
// TODO: Eventually support sourceRoot, which has to be removed because the sources are already
|
||||
// fully resolved. We'll need to make sources relative to the sourceRoot before adding them.
|
||||
const gen = new GenMapping({ file: tree.map.file });
|
||||
const { sources: rootSources, map } = tree;
|
||||
const rootNames = map.names;
|
||||
const rootMappings = decodedMappings(map);
|
||||
for (let i = 0; i < rootMappings.length; i++) {
|
||||
const segments = rootMappings[i];
|
||||
for (let j = 0; j < segments.length; j++) {
|
||||
const segment = segments[j];
|
||||
const genCol = segment[0];
|
||||
let traced = SOURCELESS_MAPPING;
|
||||
// 1-length segments only move the current generated column, there's no source information
|
||||
// to gather from it.
|
||||
if (segment.length !== 1) {
|
||||
const source = rootSources[segment[1]];
|
||||
traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : '');
|
||||
// If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a
|
||||
// respective segment into an original source.
|
||||
if (traced == null)
|
||||
continue;
|
||||
}
|
||||
const { column, line, name, content, source, ignore } = traced;
|
||||
maybeAddSegment(gen, i, genCol, source, line, column, name);
|
||||
if (source && content != null)
|
||||
setSourceContent(gen, source, content);
|
||||
if (ignore)
|
||||
setIgnore(gen, source, true);
|
||||
}
|
||||
}
|
||||
return gen;
|
||||
}
|
||||
/**
|
||||
* originalPositionFor is only called on children SourceMapTrees. It recurses down into its own
|
||||
* child SourceMapTrees, until we find the original source map.
|
||||
*/
|
||||
function originalPositionFor(source, line, column, name) {
|
||||
if (!source.map) {
|
||||
return SegmentObject(source.source, line, column, name, source.content, source.ignore);
|
||||
}
|
||||
const segment = traceSegment(source.map, line, column);
|
||||
// If we couldn't find a segment, then this doesn't exist in the sourcemap.
|
||||
if (segment == null)
|
||||
return null;
|
||||
// 1-length segments only move the current generated column, there's no source information
|
||||
// to gather from it.
|
||||
if (segment.length === 1)
|
||||
return SOURCELESS_MAPPING;
|
||||
return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
|
||||
}
|
||||
|
||||
function asArray(value) {
|
||||
if (Array.isArray(value))
|
||||
return value;
|
||||
return [value];
|
||||
}
|
||||
/**
|
||||
* Recursively builds a tree structure out of sourcemap files, with each node
|
||||
* being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of
|
||||
* `OriginalSource`s and `SourceMapTree`s.
|
||||
*
|
||||
* Every sourcemap is composed of a collection of source files and mappings
|
||||
* into locations of those source files. When we generate a `SourceMapTree` for
|
||||
* the sourcemap, we attempt to load each source file's own sourcemap. If it
|
||||
* does not have an associated sourcemap, it is considered an original,
|
||||
* unmodified source file.
|
||||
*/
|
||||
function buildSourceMapTree(input, loader) {
|
||||
const maps = asArray(input).map((m) => new TraceMap(m, ''));
|
||||
const map = maps.pop();
|
||||
for (let i = 0; i < maps.length; i++) {
|
||||
if (maps[i].sources.length > 1) {
|
||||
throw new Error(`Transformation map ${i} must have exactly one source file.\n` +
|
||||
'Did you specify these with the most recent transformation maps first?');
|
||||
}
|
||||
}
|
||||
let tree = build(map, loader, '', 0);
|
||||
for (let i = maps.length - 1; i >= 0; i--) {
|
||||
tree = MapSource(maps[i], [tree]);
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
function build(map, loader, importer, importerDepth) {
|
||||
const { resolvedSources, sourcesContent, ignoreList } = map;
|
||||
const depth = importerDepth + 1;
|
||||
const children = resolvedSources.map((sourceFile, i) => {
|
||||
// The loading context gives the loader more information about why this file is being loaded
|
||||
// (eg, from which importer). It also allows the loader to override the location of the loaded
|
||||
// sourcemap/original source, or to override the content in the sourcesContent field if it's
|
||||
// an unmodified source file.
|
||||
const ctx = {
|
||||
importer,
|
||||
depth,
|
||||
source: sourceFile || '',
|
||||
content: undefined,
|
||||
ignore: undefined,
|
||||
};
|
||||
// Use the provided loader callback to retrieve the file's sourcemap.
|
||||
// TODO: We should eventually support async loading of sourcemap files.
|
||||
const sourceMap = loader(ctx.source, ctx);
|
||||
const { source, content, ignore } = ctx;
|
||||
// If there is a sourcemap, then we need to recurse into it to load its source files.
|
||||
if (sourceMap)
|
||||
return build(new TraceMap(sourceMap, source), loader, source, depth);
|
||||
// Else, it's an unmodified source file.
|
||||
// The contents of this unmodified source file can be overridden via the loader context,
|
||||
// allowing it to be explicitly null or a string. If it remains undefined, we fall back to
|
||||
// the importing sourcemap's `sourcesContent` field.
|
||||
const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;
|
||||
const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false;
|
||||
return OriginalSource(source, sourceContent, ignored);
|
||||
});
|
||||
return MapSource(map, children);
|
||||
}
|
||||
|
||||
/**
|
||||
* A SourceMap v3 compatible sourcemap, which only includes fields that were
|
||||
* provided to it.
|
||||
*/
|
||||
class SourceMap {
|
||||
constructor(map, options) {
|
||||
const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);
|
||||
this.version = out.version; // SourceMap spec says this should be first.
|
||||
this.file = out.file;
|
||||
this.mappings = out.mappings;
|
||||
this.names = out.names;
|
||||
this.ignoreList = out.ignoreList;
|
||||
this.sourceRoot = out.sourceRoot;
|
||||
this.sources = out.sources;
|
||||
if (!options.excludeContent) {
|
||||
this.sourcesContent = out.sourcesContent;
|
||||
}
|
||||
}
|
||||
toString() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Traces through all the mappings in the root sourcemap, through the sources
|
||||
* (and their sourcemaps), all the way back to the original source location.
|
||||
*
|
||||
* `loader` will be called every time we encounter a source file. If it returns
|
||||
* a sourcemap, we will recurse into that sourcemap to continue the trace. If
|
||||
* it returns a falsey value, that source file is treated as an original,
|
||||
* unmodified source file.
|
||||
*
|
||||
* Pass `excludeContent` to exclude any self-containing source file content
|
||||
* from the output sourcemap.
|
||||
*
|
||||
* Pass `decodedMappings` to receive a SourceMap with decoded (instead of
|
||||
* VLQ encoded) mappings.
|
||||
*/
|
||||
function remapping(input, loader, options) {
|
||||
const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };
|
||||
const tree = buildSourceMapTree(input, loader);
|
||||
return new SourceMap(traceMappings(tree), opts);
|
||||
}
|
||||
|
||||
export { remapping as default };
|
||||
//# sourceMappingURL=remapping.mjs.map
|
||||
1
MyWebSite/node_modules/@ampproject/remapping/dist/remapping.mjs.map
generated
vendored
Normal file
202
MyWebSite/node_modules/@ampproject/remapping/dist/remapping.umd.js
generated
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@jridgewell/trace-mapping'), require('@jridgewell/gen-mapping')) :
|
||||
typeof define === 'function' && define.amd ? define(['@jridgewell/trace-mapping', '@jridgewell/gen-mapping'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.remapping = factory(global.traceMapping, global.genMapping));
|
||||
})(this, (function (traceMapping, genMapping) { 'use strict';
|
||||
|
||||
const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false);
|
||||
const EMPTY_SOURCES = [];
|
||||
function SegmentObject(source, line, column, name, content, ignore) {
|
||||
return { source, line, column, name, content, ignore };
|
||||
}
|
||||
function Source(map, sources, source, content, ignore) {
|
||||
return {
|
||||
map,
|
||||
sources,
|
||||
source,
|
||||
content,
|
||||
ignore,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes
|
||||
* (which may themselves be SourceMapTrees).
|
||||
*/
|
||||
function MapSource(map, sources) {
|
||||
return Source(map, sources, '', null, false);
|
||||
}
|
||||
/**
|
||||
* A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive
|
||||
* segment tracing ends at the `OriginalSource`.
|
||||
*/
|
||||
function OriginalSource(source, content, ignore) {
|
||||
return Source(null, EMPTY_SOURCES, source, content, ignore);
|
||||
}
|
||||
/**
|
||||
* traceMappings is only called on the root level SourceMapTree, and begins the process of
|
||||
* resolving each mapping in terms of the original source files.
|
||||
*/
|
||||
function traceMappings(tree) {
|
||||
// TODO: Eventually support sourceRoot, which has to be removed because the sources are already
|
||||
// fully resolved. We'll need to make sources relative to the sourceRoot before adding them.
|
||||
const gen = new genMapping.GenMapping({ file: tree.map.file });
|
||||
const { sources: rootSources, map } = tree;
|
||||
const rootNames = map.names;
|
||||
const rootMappings = traceMapping.decodedMappings(map);
|
||||
for (let i = 0; i < rootMappings.length; i++) {
|
||||
const segments = rootMappings[i];
|
||||
for (let j = 0; j < segments.length; j++) {
|
||||
const segment = segments[j];
|
||||
const genCol = segment[0];
|
||||
let traced = SOURCELESS_MAPPING;
|
||||
// 1-length segments only move the current generated column, there's no source information
|
||||
// to gather from it.
|
||||
if (segment.length !== 1) {
|
||||
const source = rootSources[segment[1]];
|
||||
traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : '');
|
||||
// If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a
|
||||
// respective segment into an original source.
|
||||
if (traced == null)
|
||||
continue;
|
||||
}
|
||||
const { column, line, name, content, source, ignore } = traced;
|
||||
genMapping.maybeAddSegment(gen, i, genCol, source, line, column, name);
|
||||
if (source && content != null)
|
||||
genMapping.setSourceContent(gen, source, content);
|
||||
if (ignore)
|
||||
genMapping.setIgnore(gen, source, true);
|
||||
}
|
||||
}
|
||||
return gen;
|
||||
}
|
||||
/**
|
||||
* originalPositionFor is only called on children SourceMapTrees. It recurses down into its own
|
||||
* child SourceMapTrees, until we find the original source map.
|
||||
*/
|
||||
function originalPositionFor(source, line, column, name) {
|
||||
if (!source.map) {
|
||||
return SegmentObject(source.source, line, column, name, source.content, source.ignore);
|
||||
}
|
||||
const segment = traceMapping.traceSegment(source.map, line, column);
|
||||
// If we couldn't find a segment, then this doesn't exist in the sourcemap.
|
||||
if (segment == null)
|
||||
return null;
|
||||
// 1-length segments only move the current generated column, there's no source information
|
||||
// to gather from it.
|
||||
if (segment.length === 1)
|
||||
return SOURCELESS_MAPPING;
|
||||
return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
|
||||
}
|
||||
|
||||
function asArray(value) {
|
||||
if (Array.isArray(value))
|
||||
return value;
|
||||
return [value];
|
||||
}
|
||||
/**
|
||||
* Recursively builds a tree structure out of sourcemap files, with each node
|
||||
* being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of
|
||||
* `OriginalSource`s and `SourceMapTree`s.
|
||||
*
|
||||
* Every sourcemap is composed of a collection of source files and mappings
|
||||
* into locations of those source files. When we generate a `SourceMapTree` for
|
||||
* the sourcemap, we attempt to load each source file's own sourcemap. If it
|
||||
* does not have an associated sourcemap, it is considered an original,
|
||||
* unmodified source file.
|
||||
*/
|
||||
function buildSourceMapTree(input, loader) {
|
||||
const maps = asArray(input).map((m) => new traceMapping.TraceMap(m, ''));
|
||||
const map = maps.pop();
|
||||
for (let i = 0; i < maps.length; i++) {
|
||||
if (maps[i].sources.length > 1) {
|
||||
throw new Error(`Transformation map ${i} must have exactly one source file.\n` +
|
||||
'Did you specify these with the most recent transformation maps first?');
|
||||
}
|
||||
}
|
||||
let tree = build(map, loader, '', 0);
|
||||
for (let i = maps.length - 1; i >= 0; i--) {
|
||||
tree = MapSource(maps[i], [tree]);
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
function build(map, loader, importer, importerDepth) {
|
||||
const { resolvedSources, sourcesContent, ignoreList } = map;
|
||||
const depth = importerDepth + 1;
|
||||
const children = resolvedSources.map((sourceFile, i) => {
|
||||
// The loading context gives the loader more information about why this file is being loaded
|
||||
// (eg, from which importer). It also allows the loader to override the location of the loaded
|
||||
// sourcemap/original source, or to override the content in the sourcesContent field if it's
|
||||
// an unmodified source file.
|
||||
const ctx = {
|
||||
importer,
|
||||
depth,
|
||||
source: sourceFile || '',
|
||||
content: undefined,
|
||||
ignore: undefined,
|
||||
};
|
||||
// Use the provided loader callback to retrieve the file's sourcemap.
|
||||
// TODO: We should eventually support async loading of sourcemap files.
|
||||
const sourceMap = loader(ctx.source, ctx);
|
||||
const { source, content, ignore } = ctx;
|
||||
// If there is a sourcemap, then we need to recurse into it to load its source files.
|
||||
if (sourceMap)
|
||||
return build(new traceMapping.TraceMap(sourceMap, source), loader, source, depth);
|
||||
// Else, it's an unmodified source file.
|
||||
// The contents of this unmodified source file can be overridden via the loader context,
|
||||
// allowing it to be explicitly null or a string. If it remains undefined, we fall back to
|
||||
// the importing sourcemap's `sourcesContent` field.
|
||||
const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;
|
||||
const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false;
|
||||
return OriginalSource(source, sourceContent, ignored);
|
||||
});
|
||||
return MapSource(map, children);
|
||||
}
|
||||
|
||||
/**
|
||||
* A SourceMap v3 compatible sourcemap, which only includes fields that were
|
||||
* provided to it.
|
||||
*/
|
||||
class SourceMap {
|
||||
constructor(map, options) {
|
||||
const out = options.decodedMappings ? genMapping.toDecodedMap(map) : genMapping.toEncodedMap(map);
|
||||
this.version = out.version; // SourceMap spec says this should be first.
|
||||
this.file = out.file;
|
||||
this.mappings = out.mappings;
|
||||
this.names = out.names;
|
||||
this.ignoreList = out.ignoreList;
|
||||
this.sourceRoot = out.sourceRoot;
|
||||
this.sources = out.sources;
|
||||
if (!options.excludeContent) {
|
||||
this.sourcesContent = out.sourcesContent;
|
||||
}
|
||||
}
|
||||
toString() {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Traces through all the mappings in the root sourcemap, through the sources
|
||||
* (and their sourcemaps), all the way back to the original source location.
|
||||
*
|
||||
* `loader` will be called every time we encounter a source file. If it returns
|
||||
* a sourcemap, we will recurse into that sourcemap to continue the trace. If
|
||||
* it returns a falsey value, that source file is treated as an original,
|
||||
* unmodified source file.
|
||||
*
|
||||
* Pass `excludeContent` to exclude any self-containing source file content
|
||||
* from the output sourcemap.
|
||||
*
|
||||
* Pass `decodedMappings` to receive a SourceMap with decoded (instead of
|
||||
* VLQ encoded) mappings.
|
||||
*/
|
||||
function remapping(input, loader, options) {
|
||||
const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };
|
||||
const tree = buildSourceMapTree(input, loader);
|
||||
return new SourceMap(traceMappings(tree), opts);
|
||||
}
|
||||
|
||||
return remapping;
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=remapping.umd.js.map
|
||||
1
MyWebSite/node_modules/@ampproject/remapping/dist/remapping.umd.js.map
generated
vendored
Normal file
14
MyWebSite/node_modules/@ampproject/remapping/dist/types/build-source-map-tree.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { MapSource as MapSourceType } from './source-map-tree';
|
||||
import type { SourceMapInput, SourceMapLoader } from './types';
|
||||
/**
|
||||
* Recursively builds a tree structure out of sourcemap files, with each node
|
||||
* being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of
|
||||
* `OriginalSource`s and `SourceMapTree`s.
|
||||
*
|
||||
* Every sourcemap is composed of a collection of source files and mappings
|
||||
* into locations of those source files. When we generate a `SourceMapTree` for
|
||||
* the sourcemap, we attempt to load each source file's own sourcemap. If it
|
||||
* does not have an associated sourcemap, it is considered an original,
|
||||
* unmodified source file.
|
||||
*/
|
||||
export default function buildSourceMapTree(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader): MapSourceType;
|
||||
20
MyWebSite/node_modules/@ampproject/remapping/dist/types/remapping.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import SourceMap from './source-map';
|
||||
import type { SourceMapInput, SourceMapLoader, Options } from './types';
|
||||
export type { SourceMapSegment, EncodedSourceMap, EncodedSourceMap as RawSourceMap, DecodedSourceMap, SourceMapInput, SourceMapLoader, LoaderContext, Options, } from './types';
|
||||
export type { SourceMap };
|
||||
/**
|
||||
* Traces through all the mappings in the root sourcemap, through the sources
|
||||
* (and their sourcemaps), all the way back to the original source location.
|
||||
*
|
||||
* `loader` will be called every time we encounter a source file. If it returns
|
||||
* a sourcemap, we will recurse into that sourcemap to continue the trace. If
|
||||
* it returns a falsey value, that source file is treated as an original,
|
||||
* unmodified source file.
|
||||
*
|
||||
* Pass `excludeContent` to exclude any self-containing source file content
|
||||
* from the output sourcemap.
|
||||
*
|
||||
* Pass `decodedMappings` to receive a SourceMap with decoded (instead of
|
||||
* VLQ encoded) mappings.
|
||||
*/
|
||||
export default function remapping(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader, options?: boolean | Options): SourceMap;
|
||||
45
MyWebSite/node_modules/@ampproject/remapping/dist/types/source-map-tree.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import { GenMapping } from '@jridgewell/gen-mapping';
|
||||
import type { TraceMap } from '@jridgewell/trace-mapping';
|
||||
export declare type SourceMapSegmentObject = {
|
||||
column: number;
|
||||
line: number;
|
||||
name: string;
|
||||
source: string;
|
||||
content: string | null;
|
||||
ignore: boolean;
|
||||
};
|
||||
export declare type OriginalSource = {
|
||||
map: null;
|
||||
sources: Sources[];
|
||||
source: string;
|
||||
content: string | null;
|
||||
ignore: boolean;
|
||||
};
|
||||
export declare type MapSource = {
|
||||
map: TraceMap;
|
||||
sources: Sources[];
|
||||
source: string;
|
||||
content: null;
|
||||
ignore: false;
|
||||
};
|
||||
export declare type Sources = OriginalSource | MapSource;
|
||||
/**
|
||||
* MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes
|
||||
* (which may themselves be SourceMapTrees).
|
||||
*/
|
||||
export declare function MapSource(map: TraceMap, sources: Sources[]): MapSource;
|
||||
/**
|
||||
* A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive
|
||||
* segment tracing ends at the `OriginalSource`.
|
||||
*/
|
||||
export declare function OriginalSource(source: string, content: string | null, ignore: boolean): OriginalSource;
|
||||
/**
|
||||
* traceMappings is only called on the root level SourceMapTree, and begins the process of
|
||||
* resolving each mapping in terms of the original source files.
|
||||
*/
|
||||
export declare function traceMappings(tree: MapSource): GenMapping;
|
||||
/**
|
||||
* originalPositionFor is only called on children SourceMapTrees. It recurses down into its own
|
||||
* child SourceMapTrees, until we find the original source map.
|
||||
*/
|
||||
export declare function originalPositionFor(source: Sources, line: number, column: number, name: string): SourceMapSegmentObject | null;
|
||||
18
MyWebSite/node_modules/@ampproject/remapping/dist/types/source-map.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { GenMapping } from '@jridgewell/gen-mapping';
|
||||
import type { DecodedSourceMap, EncodedSourceMap, Options } from './types';
|
||||
/**
|
||||
* A SourceMap v3 compatible sourcemap, which only includes fields that were
|
||||
* provided to it.
|
||||
*/
|
||||
export default class SourceMap {
|
||||
file?: string | null;
|
||||
mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings'];
|
||||
sourceRoot?: string;
|
||||
names: string[];
|
||||
sources: (string | null)[];
|
||||
sourcesContent?: (string | null)[];
|
||||
version: 3;
|
||||
ignoreList: number[] | undefined;
|
||||
constructor(map: GenMapping, options: Options);
|
||||
toString(): string;
|
||||
}
|
||||
15
MyWebSite/node_modules/@ampproject/remapping/dist/types/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { SourceMapInput } from '@jridgewell/trace-mapping';
|
||||
export type { SourceMapSegment, DecodedSourceMap, EncodedSourceMap, } from '@jridgewell/trace-mapping';
|
||||
export type { SourceMapInput };
|
||||
export declare type LoaderContext = {
|
||||
readonly importer: string;
|
||||
readonly depth: number;
|
||||
source: string;
|
||||
content: string | null | undefined;
|
||||
ignore: boolean | undefined;
|
||||
};
|
||||
export declare type SourceMapLoader = (file: string, ctx: LoaderContext) => SourceMapInput | null | undefined | void;
|
||||
export declare type Options = {
|
||||
excludeContent?: boolean;
|
||||
decodedMappings?: boolean;
|
||||
};
|
||||
75
MyWebSite/node_modules/@ampproject/remapping/package.json
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"name": "@ampproject/remapping",
|
||||
"version": "2.3.0",
|
||||
"description": "Remap sequential sourcemaps through transformations to point at the original source code",
|
||||
"keywords": [
|
||||
"source",
|
||||
"map",
|
||||
"remap"
|
||||
],
|
||||
"main": "dist/remapping.umd.js",
|
||||
"module": "dist/remapping.mjs",
|
||||
"types": "dist/types/remapping.d.ts",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"types": "./dist/types/remapping.d.ts",
|
||||
"browser": "./dist/remapping.umd.js",
|
||||
"require": "./dist/remapping.umd.js",
|
||||
"import": "./dist/remapping.mjs"
|
||||
},
|
||||
"./dist/remapping.umd.js"
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"author": "Justin Ridgewell <jridgewell@google.com>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ampproject/remapping.git"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "run-s -n build:*",
|
||||
"build:rollup": "rollup -c rollup.config.js",
|
||||
"build:ts": "tsc --project tsconfig.build.json",
|
||||
"lint": "run-s -n lint:*",
|
||||
"lint:prettier": "npm run test:lint:prettier -- --write",
|
||||
"lint:ts": "npm run test:lint:ts -- --fix",
|
||||
"prebuild": "rm -rf dist",
|
||||
"prepublishOnly": "npm run preversion",
|
||||
"preversion": "run-s test build",
|
||||
"test": "run-s -n test:lint test:only",
|
||||
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
|
||||
"test:lint": "run-s -n test:lint:*",
|
||||
"test:lint:prettier": "prettier --check '{src,test}/**/*.ts'",
|
||||
"test:lint:ts": "eslint '{src,test}/**/*.ts'",
|
||||
"test:only": "jest --coverage",
|
||||
"test:watch": "jest --coverage --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-typescript": "8.3.2",
|
||||
"@types/jest": "27.4.1",
|
||||
"@typescript-eslint/eslint-plugin": "5.20.0",
|
||||
"@typescript-eslint/parser": "5.20.0",
|
||||
"eslint": "8.14.0",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"jest": "27.5.1",
|
||||
"jest-config": "27.5.1",
|
||||
"npm-run-all": "4.1.5",
|
||||
"prettier": "2.6.2",
|
||||
"rollup": "2.70.2",
|
||||
"ts-jest": "27.1.4",
|
||||
"tslib": "2.4.0",
|
||||
"typescript": "4.6.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jridgewell/gen-mapping": "^0.3.5",
|
||||
"@jridgewell/trace-mapping": "^0.3.24"
|
||||
}
|
||||
}
|
||||
22
MyWebSite/node_modules/@babel/code-frame/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
19
MyWebSite/node_modules/@babel/code-frame/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# @babel/code-frame
|
||||
|
||||
> Generate errors that contain a code frame that point to source locations.
|
||||
|
||||
See our website [@babel/code-frame](https://babeljs.io/docs/babel-code-frame) for more information.
|
||||
|
||||
## Install
|
||||
|
||||
Using npm:
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/code-frame
|
||||
```
|
||||
|
||||
or using yarn:
|
||||
|
||||
```sh
|
||||
yarn add @babel/code-frame --dev
|
||||
```
|
||||
216
MyWebSite/node_modules/@babel/code-frame/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var picocolors = require('picocolors');
|
||||
var jsTokens = require('js-tokens');
|
||||
var helperValidatorIdentifier = require('@babel/helper-validator-identifier');
|
||||
|
||||
function isColorSupported() {
|
||||
return (typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported
|
||||
);
|
||||
}
|
||||
const compose = (f, g) => v => f(g(v));
|
||||
function buildDefs(colors) {
|
||||
return {
|
||||
keyword: colors.cyan,
|
||||
capitalized: colors.yellow,
|
||||
jsxIdentifier: colors.yellow,
|
||||
punctuator: colors.yellow,
|
||||
number: colors.magenta,
|
||||
string: colors.green,
|
||||
regex: colors.magenta,
|
||||
comment: colors.gray,
|
||||
invalid: compose(compose(colors.white, colors.bgRed), colors.bold),
|
||||
gutter: colors.gray,
|
||||
marker: compose(colors.red, colors.bold),
|
||||
message: compose(colors.red, colors.bold),
|
||||
reset: colors.reset
|
||||
};
|
||||
}
|
||||
const defsOn = buildDefs(picocolors.createColors(true));
|
||||
const defsOff = buildDefs(picocolors.createColors(false));
|
||||
function getDefs(enabled) {
|
||||
return enabled ? defsOn : defsOff;
|
||||
}
|
||||
|
||||
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
||||
const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
||||
const BRACKET = /^[()[\]{}]$/;
|
||||
let tokenize;
|
||||
{
|
||||
const JSX_TAG = /^[a-z][\w-]*$/i;
|
||||
const getTokenType = function (token, offset, text) {
|
||||
if (token.type === "name") {
|
||||
if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) {
|
||||
return "keyword";
|
||||
}
|
||||
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
|
||||
return "jsxIdentifier";
|
||||
}
|
||||
if (token.value[0] !== token.value[0].toLowerCase()) {
|
||||
return "capitalized";
|
||||
}
|
||||
}
|
||||
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
||||
return "bracket";
|
||||
}
|
||||
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
||||
return "punctuator";
|
||||
}
|
||||
return token.type;
|
||||
};
|
||||
tokenize = function* (text) {
|
||||
let match;
|
||||
while (match = jsTokens.default.exec(text)) {
|
||||
const token = jsTokens.matchToToken(match);
|
||||
yield {
|
||||
type: getTokenType(token, match.index, text),
|
||||
value: token.value
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
function highlight(text) {
|
||||
if (text === "") return "";
|
||||
const defs = getDefs(true);
|
||||
let highlighted = "";
|
||||
for (const {
|
||||
type,
|
||||
value
|
||||
} of tokenize(text)) {
|
||||
if (type in defs) {
|
||||
highlighted += value.split(NEWLINE$1).map(str => defs[type](str)).join("\n");
|
||||
} else {
|
||||
highlighted += value;
|
||||
}
|
||||
}
|
||||
return highlighted;
|
||||
}
|
||||
|
||||
let deprecationWarningShown = false;
|
||||
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
||||
function getMarkerLines(loc, source, opts) {
|
||||
const startLoc = Object.assign({
|
||||
column: 0,
|
||||
line: -1
|
||||
}, loc.start);
|
||||
const endLoc = Object.assign({}, startLoc, loc.end);
|
||||
const {
|
||||
linesAbove = 2,
|
||||
linesBelow = 3
|
||||
} = opts || {};
|
||||
const startLine = startLoc.line;
|
||||
const startColumn = startLoc.column;
|
||||
const endLine = endLoc.line;
|
||||
const endColumn = endLoc.column;
|
||||
let start = Math.max(startLine - (linesAbove + 1), 0);
|
||||
let end = Math.min(source.length, endLine + linesBelow);
|
||||
if (startLine === -1) {
|
||||
start = 0;
|
||||
}
|
||||
if (endLine === -1) {
|
||||
end = source.length;
|
||||
}
|
||||
const lineDiff = endLine - startLine;
|
||||
const markerLines = {};
|
||||
if (lineDiff) {
|
||||
for (let i = 0; i <= lineDiff; i++) {
|
||||
const lineNumber = i + startLine;
|
||||
if (!startColumn) {
|
||||
markerLines[lineNumber] = true;
|
||||
} else if (i === 0) {
|
||||
const sourceLength = source[lineNumber - 1].length;
|
||||
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
||||
} else if (i === lineDiff) {
|
||||
markerLines[lineNumber] = [0, endColumn];
|
||||
} else {
|
||||
const sourceLength = source[lineNumber - i].length;
|
||||
markerLines[lineNumber] = [0, sourceLength];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (startColumn === endColumn) {
|
||||
if (startColumn) {
|
||||
markerLines[startLine] = [startColumn, 0];
|
||||
} else {
|
||||
markerLines[startLine] = true;
|
||||
}
|
||||
} else {
|
||||
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
||||
}
|
||||
}
|
||||
return {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
};
|
||||
}
|
||||
function codeFrameColumns(rawLines, loc, opts = {}) {
|
||||
const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
|
||||
const defs = getDefs(shouldHighlight);
|
||||
const lines = rawLines.split(NEWLINE);
|
||||
const {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
} = getMarkerLines(loc, lines, opts);
|
||||
const hasColumns = loc.start && typeof loc.start.column === "number";
|
||||
const numberMaxWidth = String(end).length;
|
||||
const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
|
||||
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {
|
||||
const number = start + 1 + index;
|
||||
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
||||
const gutter = ` ${paddedNumber} |`;
|
||||
const hasMarker = markerLines[number];
|
||||
const lastMarkerLine = !markerLines[number + 1];
|
||||
if (hasMarker) {
|
||||
let markerLine = "";
|
||||
if (Array.isArray(hasMarker)) {
|
||||
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
||||
const numberOfMarkers = hasMarker[1] || 1;
|
||||
markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join("");
|
||||
if (lastMarkerLine && opts.message) {
|
||||
markerLine += " " + defs.message(opts.message);
|
||||
}
|
||||
}
|
||||
return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
||||
} else {
|
||||
return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
||||
}
|
||||
}).join("\n");
|
||||
if (opts.message && !hasColumns) {
|
||||
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
||||
}
|
||||
if (shouldHighlight) {
|
||||
return defs.reset(frame);
|
||||
} else {
|
||||
return frame;
|
||||
}
|
||||
}
|
||||
function index (rawLines, lineNumber, colNumber, opts = {}) {
|
||||
if (!deprecationWarningShown) {
|
||||
deprecationWarningShown = true;
|
||||
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
||||
if (process.emitWarning) {
|
||||
process.emitWarning(message, "DeprecationWarning");
|
||||
} else {
|
||||
const deprecationError = new Error(message);
|
||||
deprecationError.name = "DeprecationWarning";
|
||||
console.warn(new Error(message));
|
||||
}
|
||||
}
|
||||
colNumber = Math.max(colNumber, 0);
|
||||
const location = {
|
||||
start: {
|
||||
column: colNumber,
|
||||
line: lineNumber
|
||||
}
|
||||
};
|
||||
return codeFrameColumns(rawLines, location, opts);
|
||||
}
|
||||
|
||||
exports.codeFrameColumns = codeFrameColumns;
|
||||
exports.default = index;
|
||||
exports.highlight = highlight;
|
||||
//# sourceMappingURL=index.js.map
|
||||